graphviz.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* Output Graphviz specification of a state machine generated by Bison.
  2. Copyright (C) 2006, 2010-2015, 2018-2021 Free Software Foundation,
  3. Inc.
  4. This file is part of Bison, the GNU Compiler Compiler.
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  15. /* Written by Paul Eggert and Satya Kiran Popuri. */
  16. #ifndef GRAPHVIZ_H_
  17. # define GRAPHVIZ_H_
  18. # include "state.h"
  19. /** Begin a Dot graph.
  20. *
  21. * \param fout output stream.
  22. */
  23. void start_graph (FILE *fout);
  24. /** Output a Dot node.
  25. *
  26. * \param id identifier of the node
  27. * \param label human readable label of the node (no Dot escaping needed).
  28. * \param fout output stream.
  29. */
  30. void output_node (int id, char const *label, FILE *fout);
  31. /** Output a Dot edge.
  32. * \param source id of the source node
  33. * \param destination id of the target node
  34. * \param label human readable label of the edge
  35. * (no Dot escaping needed). Can be 0.
  36. * \param style Dot style of the edge (e.g., "dotted" or "solid").
  37. * \param fout output stream.
  38. */
  39. void output_edge (int source, int destination, char const *label,
  40. char const *style, FILE *fout);
  41. /** Output a reduction.
  42. * \param s current state
  43. * \param reds the set of reductions
  44. * \param fout output stream.
  45. */
  46. void output_red (state const *s, reductions const *reds, FILE *fout);
  47. /** End a Dot graph.
  48. *
  49. * \param fout output stream.
  50. */
  51. void finish_graph (FILE *fout);
  52. #endif /* ! GRAPHVIZ_H_ */