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