]> git.saurik.com Git - bison.git/blob - doc/bison.1
e46d1ea6b03fa551420cd83aca75d2720204d43a
[bison.git] / doc / bison.1
1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
2 .TH BISON "1" "February 2008" "bison 2.3a+" "User Commands"
3 .SH NAME
4 bison \- GNU Project parser generator (yacc replacement)
5 .SH SYNOPSIS
6 .B bison
7 [\fIOPTION\fR]... \fIFILE\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.texinfo
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 LALR(1) and GLR parsers.
62 .PP
63 Mandatory arguments to long options are mandatory for short options too.
64 .SS "Operation modes:"
65 .TP
66 \fB\-h\fR, \fB\-\-help\fR
67 display this help and exit
68 .TP
69 \fB\-V\fR, \fB\-\-version\fR
70 output version information and exit
71 .TP
72 \fB\-\-print\-localedir\fR
73 output directory containing locale\-dependent data
74 .TP
75 \fB\-\-print\-datadir\fR
76 output directory containing skeletons and XSLT
77 .TP
78 \fB\-y\fR, \fB\-\-yacc\fR
79 emulate POSIX Yacc
80 .TP
81 \fB\-W\fR, \fB\-\-warnings\fR=\fI[CATEGORY]\fR
82 report the warnings falling in CATEGORY
83 .SS "Parser:"
84 .TP
85 \fB\-L\fR, \fB\-\-language\fR=\fILANGUAGE\fR
86 specify the output programming language
87 .TP
88 \fB\-S\fR, \fB\-\-skeleton\fR=\fIFILE\fR
89 specify the skeleton to use
90 .TP
91 \fB\-t\fR, \fB\-\-debug\fR
92 instrument the parser for debugging
93 .TP
94 \fB\-\-locations\fR
95 enable locations computation
96 .TP
97 \fB\-p\fR, \fB\-\-name\-prefix\fR=\fIPREFIX\fR
98 prepend PREFIX to the external symbols
99 .TP
100 \fB\-l\fR, \fB\-\-no\-lines\fR
101 don't generate `#line' directives
102 .TP
103 \fB\-k\fR, \fB\-\-token\-table\fR
104 include a table of token names
105 .SS "Output:"
106 .TP
107 \fB\-d\fR, \fB\-\-defines\fR[=\fIFILE\fR]
108 also produce a header file
109 .TP
110 \fB\-r\fR, \fB\-\-report\fR=\fITHINGS\fR
111 also produce details on the automaton
112 .TP
113 \fB\-\-report\-file\fR=\fIFILE\fR
114 write report to FILE
115 .TP
116 \fB\-v\fR, \fB\-\-verbose\fR
117 same as `\-\-report=state'
118 .TP
119 \fB\-b\fR, \fB\-\-file\-prefix\fR=\fIPREFIX\fR
120 specify a PREFIX for output files
121 .TP
122 \fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
123 leave output to FILE
124 .TP
125 \fB\-g\fR, \fB\-\-graph\fR[=\fIFILE\fR]
126 also output a graph of the automaton
127 .TP
128 \fB\-x\fR, \fB\-\-xml\fR[=\fIFILE\fR]
129 also output an XML report of the automaton
130 (the XML schema is experimental)
131 .SS "Warning categories include:"
132 .TP
133 `midrule\-values'
134 unset or unused midrule values
135 .TP
136 `yacc'
137 incompatibilities with POSIX YACC
138 .TP
139 `all'
140 all the warnings
141 .TP
142 `no\-CATEGORY'
143 turn off warnings in CATEGORY
144 .TP
145 `none'
146 turn off all the warnings
147 .TP
148 `error'
149 treat warnings as errors
150 .SS "THINGS is a list of comma separated words that can include:"
151 .TP
152 `state'
153 describe the states
154 .TP
155 `itemset'
156 complete the core item sets with their closure
157 .TP
158 `lookahead'
159 explicitly associate lookahead tokens to items
160 .TP
161 `solved'
162 describe shift/reduce conflicts solving
163 .TP
164 `all'
165 include all the above information
166 .TP
167 `none'
168 disable the report
169 .SH AUTHOR
170 Written by Robert Corbett and Richard Stallman.
171 .SH "REPORTING BUGS"
172 Report bugs to <bug\-bison@gnu.org>.
173 .SH COPYRIGHT
174 Copyright \(co 2007 Free Software Foundation, Inc.
175 .br
176 This is free software; see the source for copying conditions. There is NO
177 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
178 .SH "SEE ALSO"
179 .BR lex (1),
180 .BR flex (1),
181 .BR yacc (1).
182 .PP
183 The full documentation for
184 .B bison
185 is maintained as a Texinfo manual. If the
186 .B info
187 and
188 .B bison
189 programs are properly installed at your site, the command
190 .IP
191 .B info bison
192 .PP
193 should give you access to the complete manual.