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