1BISON(1) User Commands BISON(1)
2
3
4
6 bison - GNU Project parser generator (yacc replacement)
7
9 bison [OPTION]... FILE
10
12 Bison is a parser generator in the style of yacc(1). It should be
13 upwardly compatible with input files designed for yacc.
14
15 Input files should follow the yacc convention of ending in .y. Unlike
16 yacc, the generated files do not have fixed names, but instead use the
17 prefix of the input file. Moreover, if you need to put C++ code in the
18 input file, you can end his name by a C++-like extension (.ypp or
19 .y++), then bison will follow your extension to name the output file
20 (.cpp or .c++). For instance, a grammar description file named
21 parse.yxx would produce the generated parser in a file named
22 parse.tab.cxx, instead of yacc's y.tab.c or old Bison version's
23 parse.tab.c.
24
25 This description of the options that can be given to bison is adapted
26 from the node Invocation in the bison.texi manual, which should be
27 taken as authoritative.
28
29 Bison supports both traditional single-letter options and mnemonic long
30 option names. Long option names are indicated with -- instead of -.
31 Abbreviations for option names are allowed as long as they are unique.
32 When a long option takes an argument, like --file-prefix, connect the
33 option name and the argument with =.
34
35 Generate a deterministic LR or generalized LR (GLR) parser employing
36 LALR(1), IELR(1), or canonical LR(1) parser tables. IELR(1) and canon‐
37 ical LR(1) support is experimental.
38
39 Mandatory arguments to long options are mandatory for short options
40 too. The same is true for optional arguments.
41
42 Operation modes:
43 -h, --help
44 display this help and exit
45
46 -V, --version
47 output version information and exit
48
49 --print-localedir
50 output directory containing locale-dependent data and exit
51
52 --print-datadir
53 output directory containing skeletons and XSLT and exit
54
55 -u, --update
56 apply fixes to the source grammar file and exit
57
58 -y, --yacc
59 emulate POSIX Yacc
60
61 -W, --warnings[=CATEGORY]
62 report the warnings falling in CATEGORY
63
64 -f, --feature[=FEATURES]
65 activate miscellaneous features
66
67 Parser:
68 -L, --language=LANGUAGE
69 specify the output programming language
70
71 -S, --skeleton=FILE
72 specify the skeleton to use
73
74 -t, --debug
75 instrument the parser for tracing same as '-Dparse.trace'
76
77 --locations
78 enable location support
79
80 -D, --define=NAME[=VALUE]
81 similar to '%define NAME "VALUE"'
82
83 -F, --force-define=NAME[=VALUE]
84 override '%define NAME "VALUE"'
85
86 -p, --name-prefix=PREFIX
87 prepend PREFIX to the external symbols deprecated by '-Dapi.pre‐
88 fix=PREFIX'
89
90 -l, --no-lines
91 don't generate '#line' directives
92
93 -k, --token-table
94 include a table of token names
95
96 Output:
97 --defines[=FILE]
98 also produce a header file
99
100 -d likewise but cannot specify FILE (for POSIX Yacc)
101
102 -r, --report=THINGS
103 also produce details on the automaton
104
105 --report-file=FILE
106 write report to FILE
107
108 -v, --verbose
109 same as '--report=state'
110
111 -b, --file-prefix=PREFIX
112 specify a PREFIX for output files
113
114 -o, --output=FILE
115 leave output to FILE
116
117 -g, --graph[=FILE]
118 also output a graph of the automaton
119
120 -x, --xml[=FILE]
121 also output an XML report of the automaton (the XML schema is
122 experimental)
123
124 Warning categories include:
125 'conflicts-sr'
126 S/R conflicts (enabled by default)
127
128 'conflicts-rr'
129 R/R conflicts (enabled by default)
130
131 'deprecated'
132 obsolete constructs
133
134 'empty-rule'
135 empty rules without %empty
136
137 'midrule-values'
138 unset or unused midrule values
139
140 'precedence'
141 useless precedence and associativity
142
143 'yacc' incompatibilities with POSIX Yacc
144
145 'other'
146 all other warnings (enabled by default)
147
148 'all' all the warnings except 'yacc'
149
150 'no-CATEGORY'
151 turn off warnings in CATEGORY
152
153 'none' turn off all the warnings
154
155 'error[=CATEGORY]'
156 treat warnings as errors
157
158 THINGS is a list of comma separated words that can include:
159 'state'
160 describe the states
161
162 'itemset'
163 complete the core item sets with their closure
164
165 'lookahead'
166 explicitly associate lookahead tokens to items
167
168 'solved'
169 describe shift/reduce conflicts solving
170
171 'all' include all the above information
172
173 'none' disable the report
174
175 FEATURES is a list of comma separated words that can include:
176 'caret', 'diagnostics-show-caret'
177
178 show errors with carets
179
180 'fixit', 'diagnostics-parseable-fixits'
181
182 show machine-readable fixes
183
184 'syntax-only'
185
186 do not generate any file
187
188 'all'
189
190 all of the above
191
192 'none'
193
194 disable all of the above
195
197 Written by Robert Corbett and Richard Stallman.
198
200 Report bugs to <bug-bison@gnu.org>.
201 GNU Bison home page: <http://www.gnu.org/software/bison/>.
202 General help using GNU software: <http://www.gnu.org/gethelp/>.
203 For complete documentation, run: info bison.
204
206 Copyright © 2019 Free Software Foundation, Inc.
207 This is free software; see the source for copying conditions. There is
208 NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
209 PURPOSE.
210
212 lex(1), flex(1), yacc(1).
213
214 The full documentation for bison is maintained as a Texinfo manual. If
215 the info and bison programs are properly installed at your site, the
216 command
217
218 info bison
219
220 should give you access to the complete manual.
221
222
223
224bison 3.4.1 May 2019 BISON(1)