]> git.saurik.com Git - bison.git/blame - doc/bison.rnh
(Calling Convention): Fix strncmp typo.
[bison.git] / doc / bison.rnh
CommitLineData
22a89eed
RS
1.!
2.! RUNOFF source file for BISON.HLP
3.!
4.! This is a RUNOFF input file which will produce a VMS help file
5.! for the VMS HELP library.
6.!
333ccc01 7.! Eric Youngdale and Wilfred J. Hansen (wjh+@cmu.edu).
22a89eed
RS
8.!
9.literal
10.end literal
11.no paging
12.no flags all
13.right margin 70
14.left margin 1
15
16.indent -1
171 BISON
18.skip
19 The BISON command invokes the GNU BISON parser generator.
20.skip
21.literal
22 BISON file-spec
23.end literal
24.skip
25.indent -1
262 Parameters
27.skip
28 file-spec
29.skip
30Here file-spec is the grammar file name, which usually ends in
31.y. The parser file's name is made by replacing the .y
32with _tab.c. Thus, the command bison foo.y yields
33foo_tab.c.
34
35.skip
36.indent -1
372 Qualifiers
38.skip
39 The following is the list of available qualifiers for BISON:
40.literal
41 /DEBUG
42 /DEFINES
43 /FILE_PREFIX=prefix
44 /FIXED_OUTFILES
45 /NAME_PREFIX=prefix
46 /NOLINES
333ccc01 47 /NOPARSER
22a89eed 48 /OUTPUT=outfilefile
333ccc01
RS
49 /RAW
50 /TOKEN_TABLE
22a89eed
RS
51 /VERBOSE
52 /VERSION
53 /YACC
54.end literal
55.skip
56.indent -1
572 /DEBUG
58.skip
4947ebdb
PE
59In the parser file,
60define the macro YYDEBUG to 1 if it is not already defined,
22a89eed
RS
61so that the debugging facilities are compiled.
62.skip
63.indent -1
642 /DEFINES
65.skip
66Write an extra output file containing macro definitions for the token
67type names defined in the grammar and the semantic value type
68YYSTYPE, as well as a extern variable declarations.
69.skip
70If the parser output file is named "name.c" then this file
71is named "name.h".
72.skip
73This output file is essential if you wish to put the definition of
74yylex in a separate source file, because yylex needs to
75be able to refer to token type codes and the variable
76yylval.
77.skip
78.indent -1
792 /FILE_PREFIX
80.skip
81.literal
82 /FILIE_PREFIX=prefix
83.end literal
84.skip
85 Specify a prefix to use for all Bison output file names. The names are
86chosen as if the input file were named prefix.c
87
88.skip
89.indent -1
902 /FIXED_OUTFILES
91.skip
92Equivalent to /OUTPUT=y_tab.c; the parser output file is called
93y_tab.c, and the other outputs are called y.output and
94y_tab.h. The purpose of this switch is to imitate Yacc's output
95file name conventions. The /YACC qualifier is functionally equivalent
96to /FIXED_OUTFILES. The following command definition will
97work as a substitute for Yacc:
98
99.literal
100$YACC:==BISON/FIXED_OUTFILES
101.end literal
102.skip
103.indent -1
1042 /NAME_PREFIX
105.skip
106.literal
107 /NAME_PREFIX=prefix
108.end literal
109.skip
110Rename the external symbols used in the parser so that they start with
111"prefix" instead of "yy". The precise list of symbols renamed
112is yyparse, yylex, yyerror, yylval, yychar and yydebug.
113
114For example, if you use /NAME_PREFIX="c", the names become cparse,
115clex, and so on.
116
117.skip
118.indent -1
1192 /NOLINES
120.skip
121Don't put any "#line" preprocessor commands in the parser file.
122Ordinarily Bison puts them in the parser file so that the C compiler
123and debuggers will associate errors with your source file, the
124grammar file. This option causes them to associate errors with the
125parser file, treating it an independent source file in its own right.
333ccc01
RS
126.skip
127.indent -1
1282 /NOPARSER
129.skip
130Do not generate the parser code into the output; generate only
131declarations. The generated name_tab.c file will have only
132constant declarations. In addition, a name.act file is
133generated containing a switch statement body containing all the
134translated actions.
22a89eed
RS
135.skip
136.indent -1
1372 /OUTPUT
138.skip
139.literal
140 /OUTPUT=outfile
141.end literal
142.skip
143Specify the name "outfile" for the parser file.
333ccc01
RS
144.skip
145.indent -1
1462 /RAW
147.skip
148When this switch is specified, the .tab.h file defines the tokens to
149have the bison token numbers rather than the yacc compatible numbers.
150To employ this switch you would have to have your own parser.
151.skip
152.indent -1
1532 /TOKEN_TABLE
154.skip
155This switch causes the name_tab.c output to include a list of
156token names in order by their token numbers; this is defined in the array
157yytname. Also generated are #defines for YYNTOKENS, YYNNTS, YYNRULES,
158and YYNSTATES.
159
22a89eed
RS
160.skip
161.indent -1
1622 /VERBOSE
163.skip
164Write an extra output file containing verbose descriptions of the
165parser states and what is done for each type of look-ahead token in
166that state.
167.skip
168This file also describes all the conflicts, both those resolved by
169operator precedence and the unresolved ones.
170.skip
171The file's name is made by removing _tab.c or .c from
172the parser output file name, and adding .output instead.
173.skip
174Therefore, if the input file is foo.y, then the parser file is
175called foo_tab.c by default. As a consequence, the verbose
176output file is called foo.output.
177.skip
178.indent -1
1792 /VERSION
180.skip
181Print the version number of Bison.
182
183.skip
184.indent -1
1852 /YACC
186.skip
187See /FIXED_OUTFILES.
188.skip
189.indent -1
190
191
192