| 1 |
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. |
| 2 |
.TH BISON "1" "January 2026" "GNU Bison 3.8.2" "User Commands" |
| 3 |
.SH NAME |
| 4 |
bison \- GNU Project parser generator (yacc replacement) |
| 5 |
.SH SYNOPSIS |
| 6 |
.B bison |
| 7 |
[\fI\,OPTION\/\fR]... \fI\,FILE\/\fR |
| 8 |
.SH DESCRIPTION |
| 9 |
.I Bison |
| 10 |
is a parser generator in the style of |
| 11 |
.IR yacc (1). |
| 12 |
It should be upwardly compatible with input files designed |
| 13 |
for |
| 14 |
.IR yacc . |
| 15 |
.PP |
| 16 |
Input files should follow the |
| 17 |
.I yacc |
| 18 |
convention of ending in |
| 19 |
.BR .y . |
| 20 |
Unlike |
| 21 |
.IR yacc , |
| 22 |
the generated files do not have fixed names, but instead use the prefix |
| 23 |
of the input file. |
| 24 |
Moreover, if you need to put |
| 25 |
.I C++ |
| 26 |
code in the input file, you can end his name by a C++-like extension |
| 27 |
(.ypp or .y++), then bison will follow your extension to name the |
| 28 |
output file (.cpp or .c++). |
| 29 |
For instance, a grammar description file named |
| 30 |
.B parse.yxx |
| 31 |
would produce the generated parser in a file named |
| 32 |
.BR parse.tab.cxx , |
| 33 |
instead of |
| 34 |
.IR yacc 's |
| 35 |
.B y.tab.c |
| 36 |
or old |
| 37 |
.I Bison |
| 38 |
version's |
| 39 |
.BR parse.tab.c . |
| 40 |
.PP |
| 41 |
This description of the options that can be given to |
| 42 |
.I bison |
| 43 |
is adapted from the node |
| 44 |
.B Invocation |
| 45 |
in the |
| 46 |
.B bison.texi |
| 47 |
manual, which should be taken as authoritative. |
| 48 |
.PP |
| 49 |
.I Bison |
| 50 |
supports both traditional single-letter options and mnemonic long |
| 51 |
option names. Long option names are indicated with |
| 52 |
.B \-\- |
| 53 |
instead of |
| 54 |
.BR \- . |
| 55 |
Abbreviations for option names are allowed as long as they |
| 56 |
are unique. When a long option takes an argument, like |
| 57 |
.BR \-\-file-prefix , |
| 58 |
connect the option name and the argument with |
| 59 |
.BR = . |
| 60 |
.PP |
| 61 |
Generate a deterministic LR or generalized LR (GLR) parser employing |
| 62 |
LALR(1), IELR(1), or canonical LR(1) parser tables. |
| 63 |
.PP |
| 64 |
Mandatory arguments to long options are mandatory for short options too. |
| 65 |
The same is true for optional arguments. |
| 66 |
.SS "Operation Modes:" |
| 67 |
.TP |
| 68 |
\fB\-h\fR, \fB\-\-help\fR |
| 69 |
display this help and exit |
| 70 |
.TP |
| 71 |
\fB\-V\fR, \fB\-\-version\fR |
| 72 |
output version information and exit |
| 73 |
.TP |
| 74 |
\fB\-\-print\-localedir\fR |
| 75 |
output directory containing locale\-dependent data |
| 76 |
and exit |
| 77 |
.TP |
| 78 |
\fB\-\-print\-datadir\fR |
| 79 |
output directory containing skeletons and XSLT |
| 80 |
and exit |
| 81 |
.TP |
| 82 |
\fB\-u\fR, \fB\-\-update\fR |
| 83 |
apply fixes to the source grammar file and exit |
| 84 |
.TP |
| 85 |
\fB\-f\fR, \fB\-\-feature\fR[=\fI\,FEATURES\/\fR] |
| 86 |
activate miscellaneous features |
| 87 |
.SS "FEATURES is a list of comma separated words that can include:" |
| 88 |
.TP |
| 89 |
caret, diagnostics\-show\-caret |
| 90 |
show errors with carets |
| 91 |
.TP |
| 92 |
fixit, diagnostics\-parseable\-fixits |
| 93 |
show machine\-readable fixes |
| 94 |
.TP |
| 95 |
syntax\-only |
| 96 |
do not generate any file |
| 97 |
.TP |
| 98 |
all |
| 99 |
all of the above |
| 100 |
.TP |
| 101 |
none |
| 102 |
disable all of the above |
| 103 |
.SS "Diagnostics:" |
| 104 |
.TP |
| 105 |
\fB\-W\fR, \fB\-\-warnings\fR[=\fI\,CATEGORY\/\fR] |
| 106 |
report the warnings falling in CATEGORY |
| 107 |
.TP |
| 108 |
\fB\-\-color\fR[=\fI\,WHEN\/\fR] |
| 109 |
whether to colorize the diagnostics |
| 110 |
.TP |
| 111 |
\fB\-\-style\fR=\fI\,FILE\/\fR |
| 112 |
specify the CSS FILE for colorizer diagnostics |
| 113 |
.SS "Warning categories include:" |
| 114 |
.TP |
| 115 |
conflicts\-sr |
| 116 |
S/R conflicts (enabled by default) |
| 117 |
.TP |
| 118 |
conflicts\-rr |
| 119 |
R/R conflicts (enabled by default) |
| 120 |
.TP |
| 121 |
counterexamples, cex |
| 122 |
generate conflict counterexamples |
| 123 |
.TP |
| 124 |
dangling\-alias |
| 125 |
string aliases not attached to a symbol |
| 126 |
.TP |
| 127 |
deprecated |
| 128 |
obsolete constructs |
| 129 |
.TP |
| 130 |
empty\-rule |
| 131 |
empty rules without %empty |
| 132 |
.TP |
| 133 |
midrule\-values |
| 134 |
unset or unused midrule values |
| 135 |
.TP |
| 136 |
precedence |
| 137 |
useless precedence and associativity |
| 138 |
.TP |
| 139 |
yacc |
| 140 |
incompatibilities with POSIX Yacc |
| 141 |
.TP |
| 142 |
other |
| 143 |
all other warnings (enabled by default) |
| 144 |
.TP |
| 145 |
all |
| 146 |
all the warnings except 'counterexamples', 'dangling\-alias' and 'yacc' |
| 147 |
.TP |
| 148 |
no\-CATEGORY |
| 149 |
turn off warnings in CATEGORY |
| 150 |
.TP |
| 151 |
none |
| 152 |
turn off all the warnings |
| 153 |
.TP |
| 154 |
error[=CATEGORY] |
| 155 |
treat warnings as errors |
| 156 |
.SS "WHEN can be one of the following:" |
| 157 |
.TP |
| 158 |
always, yes |
| 159 |
colorize the output |
| 160 |
.TP |
| 161 |
never, no |
| 162 |
don't colorize the output |
| 163 |
.TP |
| 164 |
auto, tty |
| 165 |
colorize if the output device is a tty |
| 166 |
.SS "Tuning the Parser:" |
| 167 |
.TP |
| 168 |
\fB\-L\fR, \fB\-\-language\fR=\fI\,LANGUAGE\/\fR |
| 169 |
specify the output programming language |
| 170 |
.TP |
| 171 |
\fB\-S\fR, \fB\-\-skeleton\fR=\fI\,FILE\/\fR |
| 172 |
specify the skeleton to use |
| 173 |
.TP |
| 174 |
\fB\-t\fR, \fB\-\-debug\fR |
| 175 |
instrument the parser for tracing |
| 176 |
same as '\-Dparse.trace' |
| 177 |
.TP |
| 178 |
\fB\-\-locations\fR |
| 179 |
enable location support |
| 180 |
.TP |
| 181 |
\fB\-D\fR, \fB\-\-define=NAME\fR[=\fI\,VALUE\/\fR] |
| 182 |
similar to '%define NAME VALUE' |
| 183 |
.TP |
| 184 |
\fB\-F\fR, \fB\-\-force\-define=NAME\fR[=\fI\,VALUE\/\fR] |
| 185 |
override '%define NAME VALUE' |
| 186 |
.TP |
| 187 |
\fB\-p\fR, \fB\-\-name\-prefix\fR=\fI\,PREFIX\/\fR |
| 188 |
prepend PREFIX to the external symbols |
| 189 |
deprecated by '\-Dapi.prefix={PREFIX}' |
| 190 |
.TP |
| 191 |
\fB\-l\fR, \fB\-\-no\-lines\fR |
| 192 |
don't generate '#line' directives |
| 193 |
.TP |
| 194 |
\fB\-k\fR, \fB\-\-token\-table\fR |
| 195 |
include a table of token names |
| 196 |
.TP |
| 197 |
\fB\-y\fR, \fB\-\-yacc\fR |
| 198 |
emulate POSIX Yacc |
| 199 |
.SS "Output Files:" |
| 200 |
.TP |
| 201 |
\fB\-H\fR, \fB\-\-header\fR=\fI\,[FILE]\/\fR |
| 202 |
also produce a header file |
| 203 |
.TP |
| 204 |
\fB\-d\fR |
| 205 |
likewise but cannot specify FILE (for POSIX Yacc) |
| 206 |
.TP |
| 207 |
\fB\-r\fR, \fB\-\-report\fR=\fI\,THINGS\/\fR |
| 208 |
also produce details on the automaton |
| 209 |
.TP |
| 210 |
\fB\-\-report\-file\fR=\fI\,FILE\/\fR |
| 211 |
write report to FILE |
| 212 |
.TP |
| 213 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 214 |
same as '\-\-report=state' |
| 215 |
.TP |
| 216 |
\fB\-b\fR, \fB\-\-file\-prefix\fR=\fI\,PREFIX\/\fR |
| 217 |
specify a PREFIX for output files |
| 218 |
.TP |
| 219 |
\fB\-o\fR, \fB\-\-output\fR=\fI\,FILE\/\fR |
| 220 |
leave output to FILE |
| 221 |
.TP |
| 222 |
\fB\-g\fR, \fB\-\-graph\fR[=\fI\,FILE\/\fR] |
| 223 |
also output a graph of the automaton |
| 224 |
.TP |
| 225 |
\fB\-\-html\fR[=\fI\,FILE\/\fR] |
| 226 |
also output an HTML report of the automaton |
| 227 |
.TP |
| 228 |
\fB\-x\fR, \fB\-\-xml\fR[=\fI\,FILE\/\fR] |
| 229 |
also output an XML report of the automaton |
| 230 |
.TP |
| 231 |
\fB\-M\fR, \fB\-\-file\-prefix\-map\fR=\fI\,OLD=NEW\/\fR replace prefix OLD with NEW when writing file paths |
| 232 |
in output files |
| 233 |
.SS "THINGS is a list of comma separated words that can include:" |
| 234 |
.TP |
| 235 |
states |
| 236 |
describe the states |
| 237 |
.TP |
| 238 |
itemsets |
| 239 |
complete the core item sets with their closure |
| 240 |
.TP |
| 241 |
lookaheads |
| 242 |
explicitly associate lookahead tokens to items |
| 243 |
.TP |
| 244 |
solved |
| 245 |
describe shift/reduce conflicts solving |
| 246 |
.TP |
| 247 |
counterexamples, cex |
| 248 |
generate conflict counterexamples |
| 249 |
.TP |
| 250 |
all |
| 251 |
include all the above information |
| 252 |
.TP |
| 253 |
none |
| 254 |
disable the report |
| 255 |
.SH AUTHOR |
| 256 |
Written by Robert Corbett and Richard Stallman. |
| 257 |
.SH "REPORTING BUGS" |
| 258 |
Report bugs to <bug\[email protected]>. |
| 259 |
.br |
| 260 |
GNU Bison home page: <https://www.gnu.org/software/bison/>. |
| 261 |
.br |
| 262 |
General help using GNU software: <https://www.gnu.org/gethelp/>. |
| 263 |
.PP |
| 264 |
.br |
| 265 |
Report translation bugs to <https://translationproject.org/team/>. |
| 266 |
.br |
| 267 |
For complete documentation, run: info bison. |
| 268 |
.SH COPYRIGHT |
| 269 |
Copyright \(co 2021 Free Software Foundation, Inc. |
| 270 |
.br |
| 271 |
This is free software; see the source for copying conditions. There is NO |
| 272 |
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 273 |
.SH "SEE ALSO" |
| 274 |
.BR lex (1), |
| 275 |
.BR flex (1), |
| 276 |
.BR yacc (1). |
| 277 |
.PP |
| 278 |
The full documentation for |
| 279 |
.B bison |
| 280 |
is maintained as a Texinfo manual. If the |
| 281 |
.B info |
| 282 |
and |
| 283 |
.B bison |
| 284 |
programs are properly installed at your site, the command |
| 285 |
.IP |
| 286 |
.B info bison |
| 287 |
.PP |
| 288 |
should give you access to the complete manual. |