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