]>
Commit | Line | Data |
---|---|---|
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 | .! | |
7 | .! Eric Youngdale and Wilfred J. Hansen (wjh+@cmu.edu). | |
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 | |
17 | 1 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 | |
26 | 2 Parameters | |
27 | .skip | |
28 | file-spec | |
29 | .skip | |
30 | Here file-spec is the grammar file name, which usually ends in | |
31 | .y. The parser file's name is made by replacing the .y | |
32 | with _tab.c. Thus, the command bison foo.y yields | |
33 | foo_tab.c. | |
34 | ||
35 | .skip | |
36 | .indent -1 | |
37 | 2 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 | |
47 | /NOPARSER | |
48 | /OUTPUT=outfilefile | |
49 | /RAW | |
50 | /TOKEN_TABLE | |
51 | /VERBOSE | |
52 | /VERSION | |
53 | /YACC | |
54 | .end literal | |
55 | .skip | |
56 | .indent -1 | |
57 | 2 /DEBUG | |
58 | .skip | |
59 | Output a definition of the macro YYDEBUG into the parser file, | |
60 | so that the debugging facilities are compiled. | |
61 | .skip | |
62 | .indent -1 | |
63 | 2 /DEFINES | |
64 | .skip | |
65 | Write an extra output file containing macro definitions for the token | |
66 | type names defined in the grammar and the semantic value type | |
67 | YYSTYPE, as well as a extern variable declarations. | |
68 | .skip | |
69 | If the parser output file is named "name.c" then this file | |
70 | is named "name.h". | |
71 | .skip | |
72 | This output file is essential if you wish to put the definition of | |
73 | yylex in a separate source file, because yylex needs to | |
74 | be able to refer to token type codes and the variable | |
75 | yylval. | |
76 | .skip | |
77 | .indent -1 | |
78 | 2 /FILE_PREFIX | |
79 | .skip | |
80 | .literal | |
81 | /FILIE_PREFIX=prefix | |
82 | .end literal | |
83 | .skip | |
84 | Specify a prefix to use for all Bison output file names. The names are | |
85 | chosen as if the input file were named prefix.c | |
86 | ||
87 | .skip | |
88 | .indent -1 | |
89 | 2 /FIXED_OUTFILES | |
90 | .skip | |
91 | Equivalent to /OUTPUT=y_tab.c; the parser output file is called | |
92 | y_tab.c, and the other outputs are called y.output and | |
93 | y_tab.h. The purpose of this switch is to imitate Yacc's output | |
94 | file name conventions. The /YACC qualifier is functionally equivalent | |
95 | to /FIXED_OUTFILES. The following command definition will | |
96 | work as a substitute for Yacc: | |
97 | ||
98 | .literal | |
99 | $YACC:==BISON/FIXED_OUTFILES | |
100 | .end literal | |
101 | .skip | |
102 | .indent -1 | |
103 | 2 /NAME_PREFIX | |
104 | .skip | |
105 | .literal | |
106 | /NAME_PREFIX=prefix | |
107 | .end literal | |
108 | .skip | |
109 | Rename the external symbols used in the parser so that they start with | |
110 | "prefix" instead of "yy". The precise list of symbols renamed | |
111 | is yyparse, yylex, yyerror, yylval, yychar and yydebug. | |
112 | ||
113 | For example, if you use /NAME_PREFIX="c", the names become cparse, | |
114 | clex, and so on. | |
115 | ||
116 | .skip | |
117 | .indent -1 | |
118 | 2 /NOLINES | |
119 | .skip | |
120 | Don't put any "#line" preprocessor commands in the parser file. | |
121 | Ordinarily Bison puts them in the parser file so that the C compiler | |
122 | and debuggers will associate errors with your source file, the | |
123 | grammar file. This option causes them to associate errors with the | |
124 | parser file, treating it an independent source file in its own right. | |
125 | .skip | |
126 | .indent -1 | |
127 | 2 /NOPARSER | |
128 | .skip | |
129 | Do not generate the parser code into the output; generate only | |
130 | declarations. The generated name_tab.c file will have only | |
131 | constant declarations. In addition, a name.act file is | |
132 | generated containing a switch statement body containing all the | |
133 | translated actions. | |
134 | .skip | |
135 | .indent -1 | |
136 | 2 /OUTPUT | |
137 | .skip | |
138 | .literal | |
139 | /OUTPUT=outfile | |
140 | .end literal | |
141 | .skip | |
142 | Specify the name "outfile" for the parser file. | |
143 | .skip | |
144 | .indent -1 | |
145 | 2 /RAW | |
146 | .skip | |
147 | When this switch is specified, the .tab.h file defines the tokens to | |
148 | have the bison token numbers rather than the yacc compatible numbers. | |
149 | To employ this switch you would have to have your own parser. | |
150 | .skip | |
151 | .indent -1 | |
152 | 2 /TOKEN_TABLE | |
153 | .skip | |
154 | This switch causes the name_tab.c output to include a list of | |
155 | token names in order by their token numbers; this is defined in the array | |
156 | yytname. Also generated are #defines for YYNTOKENS, YYNNTS, YYNRULES, | |
157 | and YYNSTATES. | |
158 | ||
159 | .skip | |
160 | .indent -1 | |
161 | 2 /VERBOSE | |
162 | .skip | |
163 | Write an extra output file containing verbose descriptions of the | |
164 | parser states and what is done for each type of look-ahead token in | |
165 | that state. | |
166 | .skip | |
167 | This file also describes all the conflicts, both those resolved by | |
168 | operator precedence and the unresolved ones. | |
169 | .skip | |
170 | The file's name is made by removing _tab.c or .c from | |
171 | the parser output file name, and adding .output instead. | |
172 | .skip | |
173 | Therefore, if the input file is foo.y, then the parser file is | |
174 | called foo_tab.c by default. As a consequence, the verbose | |
175 | output file is called foo.output. | |
176 | .skip | |
177 | .indent -1 | |
178 | 2 /VERSION | |
179 | .skip | |
180 | Print the version number of Bison. | |
181 | ||
182 | .skip | |
183 | .indent -1 | |
184 | 2 /YACC | |
185 | .skip | |
186 | See /FIXED_OUTFILES. | |
187 | .skip | |
188 | .indent -1 | |
189 | ||
190 | ||
191 |