]>
Commit | Line | Data |
---|---|---|
ae7453f2 | 1 | /* A Bison parser, made from parse-gram.y, by GNU bison 1.75a. */ |
e9955c83 | 2 | |
c76e14da | 3 | /* Skeleton parser for Yacc-like parsing with Bison, |
04b6e11e | 4 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. |
1921f1d7 AD |
5 | |
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2, or (at your option) | |
9 | any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 59 Temple Place - Suite 330, | |
19 | Boston, MA 02111-1307, USA. */ | |
20 | ||
21 | /* As a special exception, when this file is copied by Bison into a | |
22 | Bison output file, you may use that output file without restriction. | |
23 | This special exception was added by the Free Software Foundation | |
24 | in version 1.24 of Bison. */ | |
25 | ||
c76e14da AD |
26 | /* Written by Richard Stallman by simplifying the original so called |
27 | ``semantic'' parser. */ | |
1921f1d7 AD |
28 | |
29 | /* All symbols defined below should begin with yy or YY, to avoid | |
30 | infringing on user name space. This should be done even for local | |
31 | variables, as they might otherwise be expanded by user macros. | |
32 | There are some unavoidable exceptions within include files to | |
33 | define necessary library symbols; they are noted "INFRINGES ON | |
34 | USER NAME SPACE" below. */ | |
35 | ||
36 | /* Identify Bison output. */ | |
37 | #define YYBISON 1 | |
38 | ||
39 | /* Pure parsers. */ | |
40 | #define YYPURE 1 | |
41 | ||
42 | /* Using locations. */ | |
43 | #define YYLSP_NEEDED 1 | |
e96c9728 | 44 | |
1921f1d7 AD |
45 | /* If NAME_PREFIX is specified substitute the variables and functions |
46 | names. */ | |
e9955c83 | 47 | #define yyparse gram_parse |
1921f1d7 | 48 | #define yylex gram_lex |
e9955c83 | 49 | #define yyerror gram_error |
1921f1d7 AD |
50 | #define yylval gram_lval |
51 | #define yychar gram_char | |
e9955c83 AD |
52 | #define yydebug gram_debug |
53 | #define yynerrs gram_nerrs | |
366eea36 | 54 | #define yylloc gram_lloc |
e9955c83 | 55 | |
ae7453f2 AD |
56 | /* Tokens. */ |
57 | #ifndef YYTOKENTYPE | |
58 | # define YYTOKENTYPE | |
59 | /* Put the tokens into the symbol table, so that GDB and other debuggers | |
60 | know about them. */ | |
61 | enum yytokentype { | |
62 | GRAM_EOF = 0, | |
63 | STRING = 258, | |
64 | CHARACTER = 259, | |
65 | INT = 260, | |
66 | PERCENT_TOKEN = 261, | |
67 | PERCENT_NTERM = 262, | |
68 | PERCENT_TYPE = 263, | |
69 | PERCENT_DESTRUCTOR = 264, | |
70 | PERCENT_PRINTER = 265, | |
71 | PERCENT_UNION = 266, | |
72 | PERCENT_LEFT = 267, | |
73 | PERCENT_RIGHT = 268, | |
74 | PERCENT_NONASSOC = 269, | |
75 | PERCENT_PREC = 270, | |
76 | PERCENT_DPREC = 271, | |
77 | PERCENT_MERGE = 272, | |
78 | PERCENT_DEBUG = 273, | |
79 | PERCENT_DEFINE = 274, | |
80 | PERCENT_DEFINES = 275, | |
81 | PERCENT_ERROR_VERBOSE = 276, | |
82 | PERCENT_EXPECT = 277, | |
83 | PERCENT_FILE_PREFIX = 278, | |
84 | PERCENT_GLR_PARSER = 279, | |
85 | PERCENT_LEX_PARAM = 280, | |
86 | PERCENT_LOCATIONS = 281, | |
87 | PERCENT_NAME_PREFIX = 282, | |
88 | PERCENT_NO_LINES = 283, | |
89 | PERCENT_OUTPUT = 284, | |
90 | PERCENT_PARSE_PARAM = 285, | |
91 | PERCENT_PURE_PARSER = 286, | |
92 | PERCENT_SKELETON = 287, | |
93 | PERCENT_START = 288, | |
94 | PERCENT_TOKEN_TABLE = 289, | |
95 | PERCENT_VERBOSE = 290, | |
96 | PERCENT_YACC = 291, | |
97 | TYPE = 292, | |
98 | EQUAL = 293, | |
99 | SEMICOLON = 294, | |
100 | COLON = 295, | |
101 | COMMA = 296, | |
102 | PIPE = 297, | |
103 | ID = 298, | |
104 | PERCENT_PERCENT = 299, | |
105 | PROLOGUE = 300, | |
106 | EPILOGUE = 301, | |
107 | BRACED_CODE = 302 | |
108 | }; | |
109 | #endif | |
110 | #define GRAM_EOF 0 | |
111 | #define STRING 258 | |
112 | #define CHARACTER 259 | |
113 | #define INT 260 | |
114 | #define PERCENT_TOKEN 261 | |
115 | #define PERCENT_NTERM 262 | |
116 | #define PERCENT_TYPE 263 | |
117 | #define PERCENT_DESTRUCTOR 264 | |
118 | #define PERCENT_PRINTER 265 | |
119 | #define PERCENT_UNION 266 | |
120 | #define PERCENT_LEFT 267 | |
121 | #define PERCENT_RIGHT 268 | |
122 | #define PERCENT_NONASSOC 269 | |
123 | #define PERCENT_PREC 270 | |
124 | #define PERCENT_DPREC 271 | |
125 | #define PERCENT_MERGE 272 | |
126 | #define PERCENT_DEBUG 273 | |
127 | #define PERCENT_DEFINE 274 | |
128 | #define PERCENT_DEFINES 275 | |
129 | #define PERCENT_ERROR_VERBOSE 276 | |
130 | #define PERCENT_EXPECT 277 | |
131 | #define PERCENT_FILE_PREFIX 278 | |
132 | #define PERCENT_GLR_PARSER 279 | |
133 | #define PERCENT_LEX_PARAM 280 | |
134 | #define PERCENT_LOCATIONS 281 | |
135 | #define PERCENT_NAME_PREFIX 282 | |
136 | #define PERCENT_NO_LINES 283 | |
137 | #define PERCENT_OUTPUT 284 | |
138 | #define PERCENT_PARSE_PARAM 285 | |
139 | #define PERCENT_PURE_PARSER 286 | |
140 | #define PERCENT_SKELETON 287 | |
141 | #define PERCENT_START 288 | |
142 | #define PERCENT_TOKEN_TABLE 289 | |
143 | #define PERCENT_VERBOSE 290 | |
144 | #define PERCENT_YACC 291 | |
145 | #define TYPE 292 | |
146 | #define EQUAL 293 | |
147 | #define SEMICOLON 294 | |
148 | #define COLON 295 | |
149 | #define COMMA 296 | |
150 | #define PIPE 297 | |
151 | #define ID 298 | |
152 | #define PERCENT_PERCENT 299 | |
153 | #define PROLOGUE 300 | |
154 | #define EPILOGUE 301 | |
155 | #define BRACED_CODE 302 | |
156 | ||
157 | ||
158 | ||
159 | ||
1921f1d7 | 160 | /* Copy the first part of user declarations. */ |
e9955c83 AD |
161 | #line 31 "parse-gram.y" |
162 | ||
163 | #include "system.h" | |
b275314e | 164 | #include "complain.h" |
e9955c83 AD |
165 | #include "muscle_tab.h" |
166 | #include "files.h" | |
167 | #include "getargs.h" | |
168 | #include "output.h" | |
56c47203 | 169 | #include "symlist.h" |
e9955c83 AD |
170 | #include "gram.h" |
171 | #include "reader.h" | |
172 | #include "conflicts.h" | |
173 | ||
0c15323d | 174 | /* Produce verbose parse errors. */ |
4cdb01db | 175 | #define YYERROR_VERBOSE 1 |
8efe435c AD |
176 | #define YYLLOC_DEFAULT(Current, Rhs, N) \ |
177 | do { \ | |
178 | if (N) \ | |
179 | { \ | |
180 | Current.first_column = Rhs[1].first_column; \ | |
181 | Current.first_line = Rhs[1].first_line; \ | |
182 | Current.last_column = Rhs[N].last_column; \ | |
183 | Current.last_line = Rhs[N].last_line; \ | |
184 | } \ | |
185 | else \ | |
186 | { \ | |
187 | Current = Rhs[0]; \ | |
188 | } \ | |
189 | } while (0) | |
4cdb01db | 190 | |
e9955c83 AD |
191 | /* Pass the control structure to YYPARSE and YYLEX. */ |
192 | #define YYPARSE_PARAM gram_control | |
193 | #define YYLEX_PARAM gram_control | |
194 | /* YYPARSE receives GRAM_CONTROL as a void *. Provide a | |
195 | correctly typed access to it. */ | |
196 | #define yycontrol ((gram_control_t *) gram_control) | |
197 | ||
fc5734fe AD |
198 | /* Request detailed parse error messages, and pass them to GRAM_ERROR. |
199 | FIXME: depends on the undocumented availability of YYLLOC.t */ | |
e9955c83 AD |
200 | #undef yyerror |
201 | #define yyerror(Msg) \ | |
fc5734fe | 202 | gram_error (&yylloc, Msg) |
e9955c83 | 203 | |
e9955c83 | 204 | #define YYPRINT(File, Type, Value) \ |
e776192e AD |
205 | yyprint (File, Type, &Value) |
206 | static void yyprint (FILE *file, int type, const yystype *value); | |
e9955c83 AD |
207 | |
208 | symbol_class current_class = unknown_sym; | |
209 | char *current_type = 0; | |
210 | symbol_t *current_lhs; | |
8efe435c | 211 | location_t current_lhs_location; |
a945ec39 | 212 | assoc_t current_assoc; |
e9955c83 | 213 | int current_prec = 0; |
9280d3ef | 214 | braced_code_t current_braced_code = action_braced_code; |
e9955c83 | 215 | |
1921f1d7 | 216 | |
1921f1d7 AD |
217 | /* Enabling traces. */ |
218 | #ifndef YYDEBUG | |
219 | # define YYDEBUG 1 | |
220 | #endif | |
221 | ||
222 | /* Enabling verbose error messages. */ | |
223 | #ifdef YYERROR_VERBOSE | |
224 | # undef YYERROR_VERBOSE | |
225 | # define YYERROR_VERBOSE 1 | |
226 | #else | |
227 | # define YYERROR_VERBOSE 0 | |
228 | #endif | |
229 | ||
0c15323d | 230 | #ifndef YYSTYPE |
b275314e | 231 | #line 89 "parse-gram.y" |
1921f1d7 | 232 | typedef union { |
e9955c83 | 233 | symbol_t *symbol; |
56c47203 | 234 | symbol_list_t *list; |
e9955c83 AD |
235 | int integer; |
236 | char *string; | |
a945ec39 | 237 | assoc_t assoc; |
e9955c83 | 238 | } yystype; |
d33cb3ae | 239 | /* Line 203 of /tmp/prefix/share/bison/yacc.c. */ |
ae7453f2 | 240 | #line 241 "parse-gram.c" |
e9955c83 AD |
241 | # define YYSTYPE yystype |
242 | # define YYSTYPE_IS_TRIVIAL 1 | |
243 | #endif | |
244 | ||
245 | #ifndef YYLTYPE | |
246 | typedef struct yyltype | |
247 | { | |
248 | int first_line; | |
249 | int first_column; | |
250 | int last_line; | |
251 | int last_column; | |
252 | } yyltype; | |
253 | # define YYLTYPE yyltype | |
254 | # define YYLTYPE_IS_TRIVIAL 1 | |
255 | #endif | |
256 | ||
1921f1d7 | 257 | /* Copy the second part of user declarations. */ |
0c15323d | 258 | |
0c15323d | 259 | |
d33cb3ae | 260 | /* Line 223 of /tmp/prefix/share/bison/yacc.c. */ |
ae7453f2 | 261 | #line 262 "parse-gram.c" |
0c15323d | 262 | |
1921f1d7 | 263 | #if ! defined (yyoverflow) || YYERROR_VERBOSE |
e9955c83 AD |
264 | |
265 | /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
266 | ||
267 | # if YYSTACK_USE_ALLOCA | |
268 | # define YYSTACK_ALLOC alloca | |
269 | # else | |
270 | # ifndef YYSTACK_USE_ALLOCA | |
271 | # if defined (alloca) || defined (_ALLOCA_H) | |
272 | # define YYSTACK_ALLOC alloca | |
273 | # else | |
274 | # ifdef __GNUC__ | |
275 | # define YYSTACK_ALLOC __builtin_alloca | |
276 | # endif | |
277 | # endif | |
278 | # endif | |
279 | # endif | |
280 | ||
281 | # ifdef YYSTACK_ALLOC | |
282 | /* Pacify GCC's `empty if-body' warning. */ | |
283 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) | |
284 | # else | |
285 | # if defined (__STDC__) || defined (__cplusplus) | |
286 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
287 | # define YYSIZE_T size_t | |
288 | # endif | |
289 | # define YYSTACK_ALLOC malloc | |
290 | # define YYSTACK_FREE free | |
291 | # endif | |
1921f1d7 | 292 | #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ |
e9955c83 AD |
293 | |
294 | ||
295 | #if (! defined (yyoverflow) \ | |
296 | && (! defined (__cplusplus) \ | |
297 | || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
298 | ||
299 | /* A type that is properly aligned for any stack member. */ | |
300 | union yyalloc | |
301 | { | |
302 | short yyss; | |
303 | YYSTYPE yyvs; | |
366eea36 | 304 | YYLTYPE yyls; |
e9955c83 AD |
305 | }; |
306 | ||
307 | /* The size of the maximum gap between one aligned stack and the next. */ | |
308 | # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) | |
309 | ||
310 | /* The size of an array large to enough to hold all stacks, each with | |
311 | N elements. */ | |
366eea36 | 312 | # define YYSTACK_BYTES(N) \ |
e9955c83 AD |
313 | ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
314 | + 2 * YYSTACK_GAP_MAX) | |
e9955c83 AD |
315 | |
316 | /* Copy COUNT objects from FROM to TO. The source and destination do | |
317 | not overlap. */ | |
318 | # ifndef YYCOPY | |
319 | # if 1 < __GNUC__ | |
320 | # define YYCOPY(To, From, Count) \ | |
321 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
322 | # else | |
323 | # define YYCOPY(To, From, Count) \ | |
324 | do \ | |
325 | { \ | |
326 | register YYSIZE_T yyi; \ | |
327 | for (yyi = 0; yyi < (Count); yyi++) \ | |
1921f1d7 | 328 | (To)[yyi] = (From)[yyi]; \ |
e9955c83 AD |
329 | } \ |
330 | while (0) | |
331 | # endif | |
332 | # endif | |
333 | ||
334 | /* Relocate STACK from its old location to the new one. The | |
335 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
336 | elements in the stack, and YYPTR gives the new location of the | |
337 | stack. Advance YYPTR to a properly aligned location for the next | |
338 | stack. */ | |
339 | # define YYSTACK_RELOCATE(Stack) \ | |
340 | do \ | |
341 | { \ | |
342 | YYSIZE_T yynewbytes; \ | |
343 | YYCOPY (&yyptr->Stack, Stack, yysize); \ | |
344 | Stack = &yyptr->Stack; \ | |
345 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ | |
346 | yyptr += yynewbytes / sizeof (*yyptr); \ | |
347 | } \ | |
348 | while (0) | |
349 | ||
350 | #endif | |
351 | ||
ae7453f2 AD |
352 | #if defined (__STDC__) || defined (__cplusplus) |
353 | typedef signed char yysigned_char; | |
354 | #else | |
355 | typedef short yysigned_char; | |
356 | #endif | |
357 | ||
1921f1d7 AD |
358 | /* YYFINAL -- State number of the termination state. */ |
359 | #define YYFINAL 3 | |
d33cb3ae | 360 | /* YYLAST -- Last index in YYTABLE. */ |
ae7453f2 | 361 | #define YYLAST 152 |
1921f1d7 AD |
362 | |
363 | /* YYNTOKENS -- Number of terminals. */ | |
ae7453f2 | 364 | #define YYNTOKENS 48 |
1921f1d7 | 365 | /* YYNNTS -- Number of nonterminals. */ |
366eea36 | 366 | #define YYNNTS 28 |
1921f1d7 | 367 | /* YYNRULES -- Number of rules. */ |
ae7453f2 | 368 | #define YYNRULES 77 |
1921f1d7 | 369 | /* YYNRULES -- Number of states. */ |
ae7453f2 | 370 | #define YYNSTATES 116 |
1921f1d7 AD |
371 | |
372 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
373 | #define YYUNDEFTOK 2 | |
ae7453f2 | 374 | #define YYMAXUTOK 302 |
1921f1d7 AD |
375 | |
376 | #define YYTRANSLATE(X) \ | |
377 | ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK) | |
378 | ||
379 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ | |
380 | static const unsigned char yytranslate[] = | |
381 | { | |
382 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
383 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
384 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
385 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
386 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
387 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
388 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
389 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
390 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
391 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
392 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
393 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
394 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
395 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
396 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
397 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
398 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
399 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
400 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
401 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
402 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
403 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
404 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
405 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
406 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
407 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | |
408 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | |
409 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | |
410 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | |
ae7453f2 AD |
411 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
412 | 45, 46, 47 | |
1921f1d7 AD |
413 | }; |
414 | ||
415 | #if YYDEBUG | |
416 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | |
417 | YYRHS. */ | |
418 | static const unsigned char yyprhs[] = | |
419 | { | |
8efe435c | 420 | 0, 0, 3, 8, 9, 13, 15, 17, 19, 23, |
ae7453f2 AD |
421 | 25, 27, 30, 34, 36, 41, 43, 47, 49, 53, |
422 | 58, 60, 63, 65, 67, 69, 71, 73, 76, 79, | |
423 | 80, 85, 86, 91, 92, 96, 97, 101, 105, 109, | |
424 | 111, 113, 115, 116, 118, 120, 123, 125, 127, 130, | |
425 | 133, 137, 139, 142, 144, 147, 149, 152, 155, 156, | |
426 | 162, 164, 168, 169, 172, 175, 179, 183, 187, 189, | |
427 | 191, 193, 195, 197, 199, 200, 203, 204 | |
1921f1d7 AD |
428 | }; |
429 | ||
430 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ | |
ae7453f2 | 431 | static const yysigned_char yyrhs[] = |
1921f1d7 | 432 | { |
ae7453f2 AD |
433 | 49, 0, -1, 50, 44, 64, 74, -1, -1, 50, |
434 | 51, 75, -1, 52, -1, 45, -1, 18, -1, 19, | |
435 | 73, 73, -1, 20, -1, 21, -1, 22, 5, -1, | |
436 | 23, 38, 73, -1, 24, -1, 25, 73, 41, 73, | |
437 | -1, 26, -1, 27, 38, 73, -1, 28, -1, 29, | |
438 | 38, 73, -1, 30, 73, 41, 73, -1, 31, -1, | |
439 | 32, 73, -1, 34, -1, 35, -1, 36, -1, 58, | |
440 | -1, 55, -1, 33, 70, -1, 11, 47, -1, -1, | |
441 | 9, 53, 47, 61, -1, -1, 10, 54, 47, 61, | |
442 | -1, -1, 7, 56, 63, -1, -1, 6, 57, 63, | |
443 | -1, 8, 37, 61, -1, 59, 60, 61, -1, 12, | |
444 | -1, 13, -1, 14, -1, -1, 37, -1, 70, -1, | |
445 | 61, 70, -1, 37, -1, 43, -1, 43, 5, -1, | |
446 | 43, 72, -1, 43, 5, 72, -1, 62, -1, 63, | |
447 | 62, -1, 65, -1, 64, 65, -1, 66, -1, 52, | |
448 | 39, -1, 1, 39, -1, -1, 43, 40, 67, 68, | |
449 | 39, -1, 69, -1, 68, 42, 69, -1, -1, 69, | |
450 | 70, -1, 69, 71, -1, 69, 15, 70, -1, 69, | |
451 | 16, 5, -1, 69, 17, 37, -1, 43, -1, 72, | |
452 | -1, 4, -1, 47, -1, 3, -1, 3, -1, -1, | |
453 | 44, 46, -1, -1, 39, -1 | |
1921f1d7 AD |
454 | }; |
455 | ||
456 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | |
457 | static const unsigned short yyrline[] = | |
458 | { | |
ae7453f2 AD |
459 | 0, 168, 168, 181, 183, 186, 188, 189, 190, 191, |
460 | 192, 193, 194, 195, 196, 198, 199, 200, 201, 202, | |
461 | 204, 205, 206, 207, 208, 211, 213, 214, 218, 225, | |
462 | 224, 235, 234, 247, 246, 252, 252, 257, 266, 281, | |
463 | 283, 284, 287, 289, 294, 296, 300, 305, 310, 316, | |
464 | 322, 332, 335, 344, 346, 352, 354, 359, 366, 365, | |
465 | 370, 372, 375, 378, 380, 382, 384, 386, 390, 392, | |
466 | 393, 396, 402, 411, 419, 424, 430, 432 | |
1921f1d7 AD |
467 | }; |
468 | #endif | |
469 | ||
470 | #if YYDEBUG || YYERROR_VERBOSE | |
471 | /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | |
472 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | |
473 | static const char *const yytname[] = | |
474 | { | |
3d38c03a AD |
475 | "\"end of file\"", "error", "$undefined", "\"string\"", "\"character\"", |
476 | "\"integer\"", "\"%token\"", "\"%nterm\"", "\"%type\"", | |
477 | "\"%destructor\"", "\"%printer\"", "\"%union\"", "\"%left\"", | |
ae7453f2 AD |
478 | "\"%right\"", "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", |
479 | "\"%debug\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"", | |
480 | "\"%expect\"", "\"%file-prefix\"", "\"%glr-parser\"", "\"%lex-param\"", | |
481 | "\"%locations\"", "\"%name-prefix\"", "\"%no-lines\"", "\"%output\"", | |
482 | "\"%parse-param\"", "\"%pure-parser\"", "\"%skeleton\"", "\"%start\"", | |
483 | "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"type\"", "\"=\"", | |
484 | "\";\"", "\":\"", "\",\"", "\"|\"", "\"identifier\"", "\"%%\"", | |
485 | "\"%{...%}\"", "\"epilogue\"", "\"{...}\"", "$accept", "input", | |
486 | "declarations", "declaration", "grammar_declaration", "@1", "@2", | |
487 | "symbol_declaration", "@3", "@4", "precedence_declaration", | |
488 | "precedence_declarator", "type.opt", "symbols.1", "symbol_def", | |
489 | "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules", | |
490 | "@5", "rhses.1", "rhs", "symbol", "action", "string_as_id", | |
491 | "string_content", "epilogue.opt", "semi_colon.opt", 0 | |
1921f1d7 AD |
492 | }; |
493 | #endif | |
494 | ||
3d38c03a | 495 | # ifdef YYPRINT |
1921f1d7 AD |
496 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
497 | token YYLEX-NUM. */ | |
04b6e11e | 498 | static const unsigned short yytoknum[] = |
1921f1d7 AD |
499 | { |
500 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
501 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | |
502 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | |
503 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |
ae7453f2 | 504 | 295, 296, 297, 298, 299, 300, 301, 302 |
1921f1d7 | 505 | }; |
3d38c03a | 506 | # endif |
1921f1d7 AD |
507 | |
508 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
509 | static const unsigned char yyr1[] = | |
510 | { | |
ae7453f2 AD |
511 | 0, 48, 49, 50, 50, 51, 51, 51, 51, 51, |
512 | 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, | |
513 | 51, 51, 51, 51, 51, 52, 52, 52, 52, 53, | |
514 | 52, 54, 52, 56, 55, 57, 55, 55, 58, 59, | |
515 | 59, 59, 60, 60, 61, 61, 62, 62, 62, 62, | |
516 | 62, 63, 63, 64, 64, 65, 65, 65, 67, 66, | |
517 | 68, 68, 69, 69, 69, 69, 69, 69, 70, 70, | |
518 | 70, 71, 72, 73, 74, 74, 75, 75 | |
1921f1d7 AD |
519 | }; |
520 | ||
521 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
522 | static const unsigned char yyr2[] = | |
523 | { | |
8efe435c | 524 | 0, 2, 4, 0, 3, 1, 1, 1, 3, 1, |
ae7453f2 AD |
525 | 1, 2, 3, 1, 4, 1, 3, 1, 3, 4, |
526 | 1, 2, 1, 1, 1, 1, 1, 2, 2, 0, | |
527 | 4, 0, 4, 0, 3, 0, 3, 3, 3, 1, | |
528 | 1, 1, 0, 1, 1, 2, 1, 1, 2, 2, | |
529 | 3, 1, 2, 1, 2, 1, 2, 2, 0, 5, | |
530 | 1, 3, 0, 2, 2, 3, 3, 3, 1, 1, | |
531 | 1, 1, 1, 1, 0, 2, 0, 1 | |
1921f1d7 AD |
532 | }; |
533 | ||
534 | /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state | |
535 | STATE-NUM when YYTABLE doesn't specify something else to do. Zero | |
536 | means the default is an error. */ | |
04b6e11e | 537 | static const unsigned char yydefact[] = |
1921f1d7 | 538 | { |
ae7453f2 AD |
539 | 3, 0, 0, 1, 35, 33, 0, 29, 31, 0, |
540 | 39, 40, 41, 7, 0, 9, 10, 0, 0, 13, | |
541 | 0, 15, 0, 17, 0, 0, 20, 0, 0, 22, | |
542 | 23, 24, 0, 6, 76, 5, 26, 25, 42, 0, | |
543 | 0, 0, 0, 0, 28, 73, 0, 11, 0, 0, | |
544 | 0, 0, 0, 21, 72, 70, 68, 27, 69, 0, | |
545 | 0, 0, 0, 53, 55, 77, 4, 43, 0, 46, | |
546 | 47, 51, 36, 34, 37, 44, 0, 0, 8, 12, | |
547 | 0, 16, 18, 0, 57, 58, 56, 0, 54, 2, | |
548 | 38, 48, 49, 52, 45, 30, 32, 14, 19, 62, | |
549 | 75, 50, 0, 60, 59, 62, 0, 0, 0, 71, | |
550 | 63, 64, 61, 65, 66, 67 | |
1921f1d7 AD |
551 | }; |
552 | ||
04b6e11e | 553 | /* YYDEFGOTO[NTERM-NUM]. */ |
ae7453f2 | 554 | static const yysigned_char yydefgoto[] = |
1921f1d7 | 555 | { |
ae7453f2 AD |
556 | -1, 1, 2, 34, 61, 42, 43, 36, 40, 39, |
557 | 37, 38, 68, 74, 71, 72, 62, 63, 64, 99, | |
558 | 102, 103, 75, 111, 58, 46, 89, 66 | |
1921f1d7 AD |
559 | }; |
560 | ||
561 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
562 | STATE-NUM. */ | |
ae7453f2 AD |
563 | #define YYPACT_NINF -64 |
564 | static const yysigned_char yypact[] = | |
1921f1d7 | 565 | { |
ae7453f2 AD |
566 | -64, 9, 107, -64, -64, -64, -13, -64, -64, -9, |
567 | -64, -64, -64, -64, 27, -64, -64, 38, 3, -64, | |
568 | 27, -64, 6, -64, 7, 27, -64, 27, -1, -64, | |
569 | -64, -64, 79, -64, 10, -64, -64, -64, 13, -17, | |
570 | -17, -1, 8, 11, -64, -64, 27, -64, 27, 15, | |
571 | 27, 27, 16, -64, -64, -64, -64, -64, -64, 20, | |
572 | 14, 21, 4, -64, -64, -64, -64, -64, -1, -64, | |
573 | 18, -64, -17, -17, -1, -64, -1, -1, -64, -64, | |
574 | 27, -64, -64, 27, -64, -64, -64, 17, -64, -64, | |
575 | -1, 62, -64, -64, -64, -1, -1, -64, -64, -64, | |
576 | -64, -64, -20, 36, -64, -64, -1, 61, 32, -64, | |
577 | -64, -64, 36, -64, -64, -64 | |
1921f1d7 AD |
578 | }; |
579 | ||
580 | /* YYPGOTO[NTERM-NUM]. */ | |
ae7453f2 | 581 | static const yysigned_char yypgoto[] = |
1921f1d7 | 582 | { |
ae7453f2 AD |
583 | -64, -64, -64, -64, 68, -64, -64, -64, -64, -64, |
584 | -64, -64, -64, -43, -37, 31, -64, 12, -64, -64, | |
585 | -64, -33, -28, -64, -63, -19, -64, -64 | |
1921f1d7 AD |
586 | }; |
587 | ||
588 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | |
589 | positive, shift that token. If negative, reduce the rule which | |
ae7453f2 AD |
590 | number is the opposite. If zero, do what YYDEFACT says. |
591 | If YYTABLE_NINF, parse error. */ | |
592 | #define YYTABLE_NINF -75 | |
593 | static const yysigned_char yytable[] = | |
1921f1d7 | 594 | { |
ae7453f2 AD |
595 | 57, 49, 54, 55, -74, 59, 52, 92, 53, 3, |
596 | 4, 5, 6, 7, 8, 9, 10, 11, 12, 104, | |
597 | 69, 54, 105, 91, 41, 90, 70, 78, 101, 79, | |
598 | 45, 81, 82, 95, 96, 93, 93, 28, 44, 54, | |
599 | 55, 48, 56, 47, 50, 51, 94, 60, 87, 65, | |
600 | 67, 106, 107, 108, 85, 76, 80, 83, 77, 84, | |
601 | 86, 97, 94, 100, 98, 54, 114, 94, 94, 115, | |
602 | 35, 73, 112, 0, 88, 110, 0, 0, 113, 56, | |
603 | 59, 0, 0, 109, 110, 4, 5, 6, 7, 8, | |
604 | 9, 10, 11, 12, 0, 0, 0, 0, 0, 0, | |
605 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
606 | 0, 0, 28, 4, 5, 6, 7, 8, 9, 10, | |
607 | 11, 12, 60, 0, 0, 13, 14, 15, 16, 17, | |
608 | 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, | |
609 | 28, 29, 30, 31, 0, 0, 0, 0, 0, 0, | |
610 | 0, 32, 33 | |
1921f1d7 AD |
611 | }; |
612 | ||
ae7453f2 | 613 | static const yysigned_char yycheck[] = |
1921f1d7 | 614 | { |
ae7453f2 AD |
615 | 28, 20, 3, 4, 0, 1, 25, 70, 27, 0, |
616 | 6, 7, 8, 9, 10, 11, 12, 13, 14, 39, | |
617 | 37, 3, 42, 5, 37, 68, 43, 46, 91, 48, | |
618 | 3, 50, 51, 76, 77, 72, 73, 33, 47, 3, | |
619 | 4, 38, 43, 5, 38, 38, 74, 43, 44, 39, | |
620 | 37, 15, 16, 17, 40, 47, 41, 41, 47, 39, | |
621 | 39, 80, 90, 46, 83, 3, 5, 95, 96, 37, | |
622 | 2, 40, 105, -1, 62, 103, -1, -1, 106, 43, | |
623 | 1, -1, -1, 47, 112, 6, 7, 8, 9, 10, | |
624 | 11, 12, 13, 14, -1, -1, -1, -1, -1, -1, | |
625 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
626 | -1, -1, 33, 6, 7, 8, 9, 10, 11, 12, | |
627 | 13, 14, 43, -1, -1, 18, 19, 20, 21, 22, | |
628 | 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, | |
629 | 33, 34, 35, 36, -1, -1, -1, -1, -1, -1, | |
630 | -1, 44, 45 | |
1921f1d7 AD |
631 | }; |
632 | ||
1921f1d7 AD |
633 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
634 | symbol of state STATE-NUM. */ | |
635 | static const unsigned char yystos[] = | |
636 | { | |
ae7453f2 AD |
637 | 0, 49, 50, 0, 6, 7, 8, 9, 10, 11, |
638 | 12, 13, 14, 18, 19, 20, 21, 22, 23, 24, | |
676385e2 | 639 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
ae7453f2 AD |
640 | 35, 36, 44, 45, 51, 52, 55, 58, 59, 57, |
641 | 56, 37, 53, 54, 47, 3, 73, 5, 38, 73, | |
642 | 38, 38, 73, 73, 3, 4, 43, 70, 72, 1, | |
643 | 43, 52, 64, 65, 66, 39, 75, 37, 60, 37, | |
644 | 43, 62, 63, 63, 61, 70, 47, 47, 73, 73, | |
645 | 41, 73, 73, 41, 39, 40, 39, 44, 65, 74, | |
646 | 61, 5, 72, 62, 70, 61, 61, 73, 73, 67, | |
647 | 46, 72, 68, 69, 39, 42, 15, 16, 17, 47, | |
648 | 70, 71, 69, 70, 5, 37 | |
1921f1d7 | 649 | }; |
e9955c83 AD |
650 | |
651 | #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) | |
652 | # define YYSIZE_T __SIZE_TYPE__ | |
653 | #endif | |
654 | #if ! defined (YYSIZE_T) && defined (size_t) | |
655 | # define YYSIZE_T size_t | |
656 | #endif | |
657 | #if ! defined (YYSIZE_T) | |
658 | # if defined (__STDC__) || defined (__cplusplus) | |
659 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
660 | # define YYSIZE_T size_t | |
661 | # endif | |
662 | #endif | |
663 | #if ! defined (YYSIZE_T) | |
664 | # define YYSIZE_T unsigned int | |
665 | #endif | |
666 | ||
667 | #define yyerrok (yyerrstatus = 0) | |
668 | #define yyclearin (yychar = YYEMPTY) | |
669 | #define YYEMPTY -2 | |
670 | #define YYEOF 0 | |
1921f1d7 | 671 | |
e9955c83 | 672 | #define YYACCEPT goto yyacceptlab |
1921f1d7 | 673 | #define YYABORT goto yyabortlab |
e9955c83 | 674 | #define YYERROR goto yyerrlab1 |
1921f1d7 | 675 | |
e9955c83 AD |
676 | /* Like YYERROR except do call yyerror. This remains here temporarily |
677 | to ease the transition to the new meaning of YYERROR, for GCC. | |
678 | Once GCC version 2 has supplanted version 1, this can go. */ | |
1921f1d7 | 679 | |
e9955c83 | 680 | #define YYFAIL goto yyerrlab |
1921f1d7 | 681 | |
e9955c83 | 682 | #define YYRECOVERING() (!!yyerrstatus) |
1921f1d7 | 683 | |
e9955c83 AD |
684 | #define YYBACKUP(Token, Value) \ |
685 | do \ | |
686 | if (yychar == YYEMPTY && yylen == 1) \ | |
687 | { \ | |
688 | yychar = (Token); \ | |
689 | yylval = (Value); \ | |
690 | yychar1 = YYTRANSLATE (yychar); \ | |
691 | YYPOPSTACK; \ | |
692 | goto yybackup; \ | |
693 | } \ | |
694 | else \ | |
695 | { \ | |
696 | yyerror ("syntax error: cannot back up"); \ | |
697 | YYERROR; \ | |
698 | } \ | |
699 | while (0) | |
700 | ||
701 | #define YYTERROR 1 | |
702 | #define YYERRCODE 256 | |
703 | ||
704 | /* YYLLOC_DEFAULT -- Compute the default location (before the actions | |
1921f1d7 | 705 | are run). */ |
e9955c83 AD |
706 | |
707 | #ifndef YYLLOC_DEFAULT | |
1921f1d7 AD |
708 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
709 | Current.first_line = Rhs[1].first_line; \ | |
710 | Current.first_column = Rhs[1].first_column; \ | |
711 | Current.last_line = Rhs[N].last_line; \ | |
712 | Current.last_column = Rhs[N].last_column; | |
e9955c83 AD |
713 | #endif |
714 | ||
715 | /* YYLEX -- calling `yylex' with the right arguments. */ | |
716 | ||
366eea36 | 717 | #ifdef YYLEX_PARAM |
d33cb3ae | 718 | # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) |
366eea36 | 719 | #else |
d33cb3ae | 720 | # define YYLEX yylex (&yylval, &yylloc) |
366eea36 | 721 | #endif |
e9955c83 AD |
722 | |
723 | /* Enable debugging if requested. */ | |
724 | #if YYDEBUG | |
725 | ||
726 | # ifndef YYFPRINTF | |
727 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
728 | # define YYFPRINTF fprintf | |
729 | # endif | |
730 | ||
731 | # define YYDPRINTF(Args) \ | |
732 | do { \ | |
733 | if (yydebug) \ | |
734 | YYFPRINTF Args; \ | |
735 | } while (0) | |
e776192e AD |
736 | # define YYDSYMPRINT(Args) \ |
737 | do { \ | |
738 | if (yydebug) \ | |
739 | yysymprint Args; \ | |
740 | } while (0) | |
e9955c83 AD |
741 | /* Nonzero means print parse trace. It is left uninitialized so that |
742 | multiple parsers can coexist. */ | |
743 | int yydebug; | |
744 | #else /* !YYDEBUG */ | |
745 | # define YYDPRINTF(Args) | |
e776192e | 746 | # define YYDSYMPRINT(Args) |
e9955c83 AD |
747 | #endif /* !YYDEBUG */ |
748 | ||
749 | /* YYINITDEPTH -- initial size of the parser's stacks. */ | |
750 | #ifndef YYINITDEPTH | |
751 | # define YYINITDEPTH 200 | |
752 | #endif | |
753 | ||
754 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only | |
755 | if the built-in stack extension method is used). | |
756 | ||
757 | Do not make this value too large; the results are undefined if | |
758 | SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) | |
759 | evaluated with infinite-precision integer arithmetic. */ | |
760 | ||
761 | #if YYMAXDEPTH == 0 | |
762 | # undef YYMAXDEPTH | |
763 | #endif | |
764 | ||
765 | #ifndef YYMAXDEPTH | |
766 | # define YYMAXDEPTH 10000 | |
767 | #endif | |
1921f1d7 | 768 | |
e9955c83 | 769 | \f |
1921f1d7 AD |
770 | |
771 | #if YYERROR_VERBOSE | |
e9955c83 AD |
772 | |
773 | # ifndef yystrlen | |
774 | # if defined (__GLIBC__) && defined (_STRING_H) | |
775 | # define yystrlen strlen | |
776 | # else | |
777 | /* Return the length of YYSTR. */ | |
778 | static YYSIZE_T | |
779 | # if defined (__STDC__) || defined (__cplusplus) | |
780 | yystrlen (const char *yystr) | |
781 | # else | |
782 | yystrlen (yystr) | |
783 | const char *yystr; | |
784 | # endif | |
785 | { | |
786 | register const char *yys = yystr; | |
787 | ||
788 | while (*yys++ != '\0') | |
789 | continue; | |
790 | ||
791 | return yys - yystr - 1; | |
792 | } | |
793 | # endif | |
794 | # endif | |
795 | ||
796 | # ifndef yystpcpy | |
797 | # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) | |
798 | # define yystpcpy stpcpy | |
799 | # else | |
800 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
801 | YYDEST. */ | |
802 | static char * | |
803 | # if defined (__STDC__) || defined (__cplusplus) | |
804 | yystpcpy (char *yydest, const char *yysrc) | |
805 | # else | |
806 | yystpcpy (yydest, yysrc) | |
807 | char *yydest; | |
808 | const char *yysrc; | |
809 | # endif | |
810 | { | |
811 | register char *yyd = yydest; | |
812 | register const char *yys = yysrc; | |
813 | ||
814 | while ((*yyd++ = *yys++) != '\0') | |
815 | continue; | |
816 | ||
817 | return yyd - 1; | |
818 | } | |
819 | # endif | |
820 | # endif | |
0c15323d | 821 | |
1921f1d7 AD |
822 | #endif /* !YYERROR_VERBOSE */ |
823 | ||
824 | \f | |
e9955c83 | 825 | |
04b6e11e PE |
826 | #if YYDEBUG |
827 | /*-----------------------------. | |
828 | | Print this symbol on YYOUT. | | |
829 | `-----------------------------*/ | |
830 | ||
04b6e11e | 831 | #if defined (__STDC__) || defined (__cplusplus) |
d33cb3ae PE |
832 | static void |
833 | yysymprint (FILE *yyout, int yytype, YYSTYPE yyvalue, YYLTYPE yylocation) | |
04b6e11e | 834 | #else |
d33cb3ae | 835 | static void |
04b6e11e | 836 | yysymprint (yyout, yytype, yyvalue, yylocation) |
d33cb3ae | 837 | FILE *yyout; |
04b6e11e PE |
838 | int yytype; |
839 | YYSTYPE yyvalue; | |
840 | YYLTYPE yylocation; | |
841 | #endif | |
842 | { | |
843 | /* Pacify ``unused variable'' warnings. */ | |
844 | (void) yyvalue; | |
845 | (void) yylocation; | |
846 | ||
847 | if (yytype < YYNTOKENS) | |
848 | { | |
849 | YYFPRINTF (yyout, "token %s (", yytname[yytype]); | |
850 | # ifdef YYPRINT | |
851 | YYPRINT (yyout, yytoknum[yytype], yyvalue); | |
852 | # endif | |
853 | } | |
854 | else | |
855 | YYFPRINTF (yyout, "nterm %s (", yytname[yytype]); | |
856 | ||
857 | switch (yytype) | |
858 | { | |
859 | default: | |
860 | break; | |
861 | } | |
862 | YYFPRINTF (yyout, ")"); | |
863 | } | |
864 | #endif /* YYDEBUG. */ | |
865 | ||
866 | ||
04b6e11e PE |
867 | /*-----------------------------------------------. |
868 | | Release the memory associated to this symbol. | | |
869 | `-----------------------------------------------*/ | |
870 | ||
04b6e11e | 871 | #if defined (__STDC__) || defined (__cplusplus) |
d33cb3ae | 872 | static void |
04b6e11e PE |
873 | yydestruct (int yytype, YYSTYPE yyvalue, YYLTYPE yylocation) |
874 | #else | |
d33cb3ae | 875 | static void |
04b6e11e PE |
876 | yydestruct (yytype, yyvalue, yylocation) |
877 | int yytype; | |
878 | YYSTYPE yyvalue; | |
879 | YYLTYPE yylocation; | |
880 | #endif | |
881 | { | |
882 | /* Pacify ``unused variable'' warnings. */ | |
883 | (void) yyvalue; | |
884 | (void) yylocation; | |
885 | ||
886 | switch (yytype) | |
887 | { | |
888 | default: | |
889 | break; | |
890 | } | |
891 | } | |
892 | ||
893 | \f | |
894 | ||
d33cb3ae | 895 | /* Prevent warnings from -Wmissing-prototypes. */ |
e9955c83 AD |
896 | |
897 | #ifdef YYPARSE_PARAM | |
898 | # if defined (__STDC__) || defined (__cplusplus) | |
d33cb3ae | 899 | int yyparse (void *YYPARSE_PARAM); |
e9955c83 | 900 | # else |
d33cb3ae | 901 | int yyparse (); |
e9955c83 | 902 | # endif |
d33cb3ae PE |
903 | #else /* ! YYPARSE_PARAM */ |
904 | #if defined (__STDC__) || defined (__cplusplus) | |
e9955c83 | 905 | int yyparse (void); |
d33cb3ae PE |
906 | #else |
907 | int yyparse (); | |
908 | #endif | |
e9955c83 | 909 | #endif |
e776192e | 910 | |
e9955c83 | 911 | |
e9955c83 | 912 | |
e9955c83 | 913 | |
d33cb3ae PE |
914 | |
915 | ||
916 | /*----------. | |
917 | | yyparse. | | |
918 | `----------*/ | |
919 | ||
920 | #ifdef YYPARSE_PARAM | |
921 | # if defined (__STDC__) || defined (__cplusplus) | |
922 | int yyparse (void *YYPARSE_PARAM) | |
923 | # else | |
924 | int yyparse (YYPARSE_PARAM) | |
925 | void *YYPARSE_PARAM; | |
926 | # endif | |
927 | #else /* ! YYPARSE_PARAM */ | |
928 | #if defined (__STDC__) || defined (__cplusplus) | |
929 | int | |
930 | yyparse (void) | |
931 | #else | |
e9955c83 | 932 | int |
d33cb3ae PE |
933 | yyparse () |
934 | ||
935 | #endif | |
936 | #endif | |
e9955c83 | 937 | { |
366eea36 AD |
938 | /* The lookahead symbol. */ |
939 | int yychar; | |
940 | ||
941 | /* The semantic value of the lookahead symbol. */ | |
942 | YYSTYPE yylval; | |
943 | ||
944 | /* Number of parse errors so far. */ | |
945 | int yynerrs; | |
946 | /* Location data for the lookahead symbol. */ | |
947 | YYLTYPE yylloc; | |
e9955c83 AD |
948 | |
949 | register int yystate; | |
950 | register int yyn; | |
951 | int yyresult; | |
952 | /* Number of tokens to shift before error messages enabled. */ | |
953 | int yyerrstatus; | |
954 | /* Lookahead token as an internal (translated) token number. */ | |
955 | int yychar1 = 0; | |
956 | ||
957 | /* Three stacks and their tools: | |
958 | `yyss': related to states, | |
959 | `yyvs': related to semantic values, | |
960 | `yyls': related to locations. | |
961 | ||
962 | Refer to the stacks thru separate pointers, to allow yyoverflow | |
963 | to reallocate them elsewhere. */ | |
964 | ||
1921f1d7 | 965 | /* The state stack. */ |
e9955c83 AD |
966 | short yyssa[YYINITDEPTH]; |
967 | short *yyss = yyssa; | |
968 | register short *yyssp; | |
969 | ||
970 | /* The semantic value stack. */ | |
971 | YYSTYPE yyvsa[YYINITDEPTH]; | |
972 | YYSTYPE *yyvs = yyvsa; | |
973 | register YYSTYPE *yyvsp; | |
974 | ||
e9955c83 AD |
975 | /* The location stack. */ |
976 | YYLTYPE yylsa[YYINITDEPTH]; | |
977 | YYLTYPE *yyls = yylsa; | |
978 | YYLTYPE *yylsp; | |
e9955c83 | 979 | |
366eea36 | 980 | #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) |
e9955c83 AD |
981 | |
982 | YYSIZE_T yystacksize = YYINITDEPTH; | |
983 | ||
984 | /* The variables used to return semantic value and location from the | |
985 | action routines. */ | |
986 | YYSTYPE yyval; | |
e9955c83 | 987 | YYLTYPE yyloc; |
e9955c83 AD |
988 | |
989 | /* When reducing, the number of symbols on the RHS of the reduced | |
1921f1d7 | 990 | rule. */ |
e9955c83 AD |
991 | int yylen; |
992 | ||
993 | YYDPRINTF ((stderr, "Starting parse\n")); | |
994 | ||
995 | yystate = 0; | |
996 | yyerrstatus = 0; | |
997 | yynerrs = 0; | |
998 | yychar = YYEMPTY; /* Cause a token to be read. */ | |
999 | ||
1000 | /* Initialize stack pointers. | |
1001 | Waste one element of value and location stack | |
1002 | so that they stay on the same level as the state stack. | |
1003 | The wasted elements are never initialized. */ | |
1004 | ||
1005 | yyssp = yyss; | |
1006 | yyvsp = yyvs; | |
e9955c83 | 1007 | yylsp = yyls; |
e9955c83 AD |
1008 | goto yysetstate; |
1009 | ||
1010 | /*------------------------------------------------------------. | |
1011 | | yynewstate -- Push a new state, which is found in yystate. | | |
1012 | `------------------------------------------------------------*/ | |
1013 | yynewstate: | |
1014 | /* In all cases, when you get here, the value and location stacks | |
1015 | have just been pushed. so pushing a state here evens the stacks. | |
1016 | */ | |
1017 | yyssp++; | |
1018 | ||
1019 | yysetstate: | |
1020 | *yyssp = yystate; | |
1021 | ||
d33cb3ae | 1022 | if (yyss + yystacksize - 1 <= yyssp) |
e9955c83 AD |
1023 | { |
1024 | /* Get the current used size of the three stacks, in elements. */ | |
1025 | YYSIZE_T yysize = yyssp - yyss + 1; | |
1026 | ||
1027 | #ifdef yyoverflow | |
1028 | { | |
1029 | /* Give user a chance to reallocate the stack. Use copies of | |
1030 | these so that the &'s don't force the real ones into | |
1031 | memory. */ | |
1032 | YYSTYPE *yyvs1 = yyvs; | |
1033 | short *yyss1 = yyss; | |
366eea36 | 1034 | YYLTYPE *yyls1 = yyls; |
e9955c83 AD |
1035 | |
1036 | /* Each stack pointer address is followed by the size of the | |
366eea36 AD |
1037 | data in use in that stack, in bytes. This used to be a |
1038 | conditional around just the two extra args, but that might | |
1039 | be undefined if yyoverflow is a macro. */ | |
e9955c83 AD |
1040 | yyoverflow ("parser stack overflow", |
1041 | &yyss1, yysize * sizeof (*yyssp), | |
1042 | &yyvs1, yysize * sizeof (*yyvsp), | |
1043 | &yyls1, yysize * sizeof (*yylsp), | |
1044 | &yystacksize); | |
1045 | yyls = yyls1; | |
e9955c83 AD |
1046 | yyss = yyss1; |
1047 | yyvs = yyvs1; | |
1048 | } | |
1049 | #else /* no yyoverflow */ | |
1050 | # ifndef YYSTACK_RELOCATE | |
1051 | goto yyoverflowlab; | |
1052 | # else | |
1053 | /* Extend the stack our own way. */ | |
d33cb3ae | 1054 | if (YYMAXDEPTH <= yystacksize) |
e9955c83 AD |
1055 | goto yyoverflowlab; |
1056 | yystacksize *= 2; | |
d33cb3ae | 1057 | if (YYMAXDEPTH < yystacksize) |
e9955c83 AD |
1058 | yystacksize = YYMAXDEPTH; |
1059 | ||
1060 | { | |
1061 | short *yyss1 = yyss; | |
1062 | union yyalloc *yyptr = | |
1063 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
1064 | if (! yyptr) | |
1065 | goto yyoverflowlab; | |
1066 | YYSTACK_RELOCATE (yyss); | |
1067 | YYSTACK_RELOCATE (yyvs); | |
e9955c83 | 1068 | YYSTACK_RELOCATE (yyls); |
1921f1d7 | 1069 | # undef YYSTACK_RELOCATE |
e9955c83 AD |
1070 | if (yyss1 != yyssa) |
1071 | YYSTACK_FREE (yyss1); | |
1072 | } | |
1073 | # endif | |
1074 | #endif /* no yyoverflow */ | |
1075 | ||
1076 | yyssp = yyss + yysize - 1; | |
1077 | yyvsp = yyvs + yysize - 1; | |
e9955c83 | 1078 | yylsp = yyls + yysize - 1; |
e9955c83 AD |
1079 | |
1080 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", | |
1081 | (unsigned long int) yystacksize)); | |
1082 | ||
d33cb3ae | 1083 | if (yyss + yystacksize - 1 <= yyssp) |
e9955c83 AD |
1084 | YYABORT; |
1085 | } | |
1086 | ||
1087 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | |
1088 | ||
1089 | goto yybackup; | |
1090 | ||
1091 | /*-----------. | |
1092 | | yybackup. | | |
1093 | `-----------*/ | |
1094 | yybackup: | |
1095 | ||
1096 | /* Do appropriate processing given the current state. */ | |
1097 | /* Read a lookahead token if we need one and don't already have one. */ | |
1098 | /* yyresume: */ | |
1099 | ||
1100 | /* First try to decide what to do without reference to lookahead token. */ | |
1101 | ||
1102 | yyn = yypact[yystate]; | |
04b6e11e | 1103 | if (yyn == YYPACT_NINF) |
e9955c83 AD |
1104 | goto yydefault; |
1105 | ||
1106 | /* Not known => get a lookahead token if don't already have one. */ | |
1107 | ||
1108 | /* yychar is either YYEMPTY or YYEOF | |
1109 | or a valid token in external form. */ | |
1110 | ||
1111 | if (yychar == YYEMPTY) | |
1112 | { | |
1113 | YYDPRINTF ((stderr, "Reading a token: ")); | |
1114 | yychar = YYLEX; | |
1115 | } | |
1116 | ||
1921f1d7 | 1117 | /* Convert token to internal form (in yychar1) for indexing tables with. */ |
e9955c83 | 1118 | |
1921f1d7 | 1119 | if (yychar <= 0) /* This means end of input. */ |
e9955c83 AD |
1120 | { |
1121 | yychar1 = 0; | |
1921f1d7 | 1122 | yychar = YYEOF; /* Don't call YYLEX any more. */ |
e9955c83 AD |
1123 | |
1124 | YYDPRINTF ((stderr, "Now at end of input.\n")); | |
1125 | } | |
1126 | else | |
1127 | { | |
1128 | yychar1 = YYTRANSLATE (yychar); | |
1129 | ||
e776192e AD |
1130 | /* We have to keep this `#if YYDEBUG', since we use variables |
1131 | which are defined only if `YYDEBUG' is set. */ | |
1132 | YYDPRINTF ((stderr, "Next token is ")); | |
1133 | YYDSYMPRINT ((stderr, yychar1, yylval, yyloc)); | |
1134 | YYDPRINTF ((stderr, "\n")); | |
e9955c83 AD |
1135 | } |
1136 | ||
ae7453f2 AD |
1137 | /* If the proper action on seeing token YYCHAR1 is to reduce or to |
1138 | detect an error, take that action. */ | |
e9955c83 | 1139 | yyn += yychar1; |
04b6e11e | 1140 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1) |
e9955c83 | 1141 | goto yydefault; |
e9955c83 | 1142 | yyn = yytable[yyn]; |
ae7453f2 | 1143 | if (yyn <= 0) |
e9955c83 | 1144 | { |
ae7453f2 | 1145 | if (yyn == 0 || yyn == YYTABLE_NINF) |
e9955c83 AD |
1146 | goto yyerrlab; |
1147 | yyn = -yyn; | |
1148 | goto yyreduce; | |
1149 | } | |
e9955c83 AD |
1150 | |
1151 | if (yyn == YYFINAL) | |
1152 | YYACCEPT; | |
1153 | ||
1154 | /* Shift the lookahead token. */ | |
1155 | YYDPRINTF ((stderr, "Shifting token %d (%s), ", | |
1156 | yychar, yytname[yychar1])); | |
1157 | ||
1158 | /* Discard the token being shifted unless it is eof. */ | |
1159 | if (yychar != YYEOF) | |
1160 | yychar = YYEMPTY; | |
1161 | ||
1162 | *++yyvsp = yylval; | |
e9955c83 | 1163 | *++yylsp = yylloc; |
e9955c83 AD |
1164 | |
1165 | /* Count tokens shifted since error; after three, turn off error | |
1166 | status. */ | |
1167 | if (yyerrstatus) | |
1168 | yyerrstatus--; | |
1169 | ||
1170 | yystate = yyn; | |
1171 | goto yynewstate; | |
1172 | ||
1173 | ||
1174 | /*-----------------------------------------------------------. | |
1175 | | yydefault -- do the default action for the current state. | | |
1176 | `-----------------------------------------------------------*/ | |
1177 | yydefault: | |
1178 | yyn = yydefact[yystate]; | |
1179 | if (yyn == 0) | |
1180 | goto yyerrlab; | |
1181 | goto yyreduce; | |
1182 | ||
1183 | ||
1184 | /*-----------------------------. | |
1185 | | yyreduce -- Do a reduction. | | |
1186 | `-----------------------------*/ | |
1187 | yyreduce: | |
1188 | /* yyn is the number of a rule to reduce with. */ | |
1189 | yylen = yyr2[yyn]; | |
1190 | ||
1191 | /* If YYLEN is nonzero, implement the default value of the action: | |
1192 | `$$ = $1'. | |
1193 | ||
04b6e11e PE |
1194 | Otherwise, the following line sets YYVAL to garbage. |
1195 | This behavior is undocumented and Bison | |
e9955c83 AD |
1196 | users should not rely upon it. Assigning to YYVAL |
1197 | unconditionally makes the parser a bit smaller, and it avoids a | |
1198 | GCC warning that YYVAL may be used uninitialized. */ | |
1199 | yyval = yyvsp[1-yylen]; | |
1200 | ||
1921f1d7 | 1201 | /* Default location. */ |
e9955c83 | 1202 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
e9955c83 AD |
1203 | |
1204 | #if YYDEBUG | |
1205 | /* We have to keep this `#if YYDEBUG', since we use variables which | |
1206 | are defined only if `YYDEBUG' is set. */ | |
1207 | if (yydebug) | |
1208 | { | |
1209 | int yyi; | |
1210 | ||
1211 | YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", | |
1921f1d7 | 1212 | yyn - 1, yyrline[yyn]); |
e9955c83 AD |
1213 | |
1214 | /* Print the symbols being reduced, and their result. */ | |
d33cb3ae | 1215 | for (yyi = yyprhs[yyn]; 0 <= yyrhs[yyi]; yyi++) |
e9955c83 AD |
1216 | YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); |
1217 | YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); | |
1218 | } | |
1219 | #endif | |
1921f1d7 AD |
1220 | switch (yyn) |
1221 | { | |
1222 | case 2: | |
ae7453f2 | 1223 | #line 170 "parse-gram.y" |
1921f1d7 | 1224 | { |
4cdb01db | 1225 | yycontrol->errcode = 0; |
0c15323d | 1226 | epilogue_set (yyvsp[0].string, yylsp[0]); |
4cdb01db | 1227 | } |
e9955c83 | 1228 | break; |
1921f1d7 | 1229 | |
8efe435c | 1230 | case 6: |
ae7453f2 | 1231 | #line 188 "parse-gram.y" |
1921f1d7 AD |
1232 | { prologue_augment (yyvsp[0].string, yylsp[0]); } |
1233 | break; | |
1234 | ||
8efe435c | 1235 | case 7: |
ae7453f2 | 1236 | #line 189 "parse-gram.y" |
1921f1d7 AD |
1237 | { debug_flag = 1; } |
1238 | break; | |
1239 | ||
8efe435c | 1240 | case 8: |
ae7453f2 | 1241 | #line 190 "parse-gram.y" |
1921f1d7 AD |
1242 | { muscle_insert (yyvsp[-1].string, yyvsp[0].string); } |
1243 | break; | |
1244 | ||
8efe435c | 1245 | case 9: |
ae7453f2 | 1246 | #line 191 "parse-gram.y" |
1921f1d7 | 1247 | { defines_flag = 1; } |
e9955c83 | 1248 | break; |
1921f1d7 | 1249 | |
8efe435c | 1250 | case 10: |
ae7453f2 | 1251 | #line 192 "parse-gram.y" |
1921f1d7 | 1252 | { error_verbose = 1; } |
e9955c83 | 1253 | break; |
1921f1d7 | 1254 | |
8efe435c | 1255 | case 11: |
ae7453f2 | 1256 | #line 193 "parse-gram.y" |
1921f1d7 | 1257 | { expected_conflicts = yyvsp[0].integer; } |
e9955c83 | 1258 | break; |
1921f1d7 | 1259 | |
8efe435c | 1260 | case 12: |
ae7453f2 | 1261 | #line 194 "parse-gram.y" |
1921f1d7 | 1262 | { spec_file_prefix = yyvsp[0].string; } |
e9955c83 | 1263 | break; |
1921f1d7 | 1264 | |
8efe435c | 1265 | case 13: |
ae7453f2 AD |
1266 | #line 195 "parse-gram.y" |
1267 | { glr_parser = 1; } | |
e9955c83 | 1268 | break; |
1921f1d7 | 1269 | |
8efe435c | 1270 | case 14: |
ae7453f2 AD |
1271 | #line 197 "parse-gram.y" |
1272 | { muscle_pair_list_grow ("lex_param", yyvsp[-2].string, yyvsp[0].string); } | |
e9955c83 | 1273 | break; |
1921f1d7 | 1274 | |
8efe435c | 1275 | case 15: |
ae7453f2 AD |
1276 | #line 198 "parse-gram.y" |
1277 | { locations_flag = 1; } | |
e9955c83 | 1278 | break; |
1921f1d7 | 1279 | |
8efe435c | 1280 | case 16: |
ae7453f2 AD |
1281 | #line 199 "parse-gram.y" |
1282 | { spec_name_prefix = yyvsp[0].string; } | |
e9955c83 | 1283 | break; |
1921f1d7 | 1284 | |
8efe435c | 1285 | case 17: |
ae7453f2 AD |
1286 | #line 200 "parse-gram.y" |
1287 | { no_lines_flag = 1; } | |
e9955c83 | 1288 | break; |
1921f1d7 | 1289 | |
8efe435c | 1290 | case 18: |
ae7453f2 AD |
1291 | #line 201 "parse-gram.y" |
1292 | { spec_outfile = yyvsp[0].string; } | |
4cdb01db | 1293 | break; |
1921f1d7 | 1294 | |
8efe435c | 1295 | case 19: |
ae7453f2 AD |
1296 | #line 203 "parse-gram.y" |
1297 | { muscle_pair_list_grow ("parse_param", yyvsp[-2].string, yyvsp[0].string); } | |
4cdb01db | 1298 | break; |
1921f1d7 | 1299 | |
8efe435c | 1300 | case 20: |
ae7453f2 AD |
1301 | #line 204 "parse-gram.y" |
1302 | { pure_parser = 1; } | |
4cdb01db | 1303 | break; |
1921f1d7 | 1304 | |
8efe435c | 1305 | case 21: |
ae7453f2 AD |
1306 | #line 205 "parse-gram.y" |
1307 | { skeleton = yyvsp[0].string; } | |
676385e2 PH |
1308 | break; |
1309 | ||
1310 | case 22: | |
ae7453f2 AD |
1311 | #line 206 "parse-gram.y" |
1312 | { token_table_flag = 1; } | |
1313 | break; | |
1314 | ||
1315 | case 23: | |
1316 | #line 207 "parse-gram.y" | |
1317 | { report_flag = 1; } | |
1318 | break; | |
1319 | ||
1320 | case 24: | |
1321 | #line 208 "parse-gram.y" | |
1921f1d7 | 1322 | { yacc_flag = 1; } |
4cdb01db | 1323 | break; |
1921f1d7 | 1324 | |
ae7453f2 AD |
1325 | case 27: |
1326 | #line 215 "parse-gram.y" | |
1921f1d7 | 1327 | { |
8efe435c | 1328 | grammar_start_symbol_set (yyvsp[0].symbol, yylsp[0]); |
4cdb01db | 1329 | } |
e9955c83 | 1330 | break; |
1921f1d7 | 1331 | |
ae7453f2 AD |
1332 | case 28: |
1333 | #line 219 "parse-gram.y" | |
1921f1d7 | 1334 | { |
2c569025 | 1335 | typed = 1; |
1921f1d7 AD |
1336 | MUSCLE_INSERT_INT ("stype_line", yylsp[0].first_line); |
1337 | muscle_insert ("stype", yyvsp[0].string); | |
4cdb01db | 1338 | } |
e9955c83 | 1339 | break; |
1921f1d7 | 1340 | |
ae7453f2 AD |
1341 | case 29: |
1342 | #line 225 "parse-gram.y" | |
9280d3ef | 1343 | { current_braced_code = destructor_braced_code; } |
0c15323d | 1344 | break; |
1921f1d7 | 1345 | |
ae7453f2 AD |
1346 | case 30: |
1347 | #line 227 "parse-gram.y" | |
1921f1d7 | 1348 | { |
9280d3ef AD |
1349 | symbol_list_t *list; |
1350 | for (list = yyvsp[0].list; list; list = list->next) | |
1a31ed21 | 1351 | symbol_destructor_set (list->sym, yyvsp[-1].string, yylsp[-1]); |
9280d3ef AD |
1352 | symbol_list_free (yyvsp[0].list); |
1353 | current_braced_code = action_braced_code; | |
4cdb01db | 1354 | } |
e9955c83 | 1355 | break; |
1921f1d7 | 1356 | |
ae7453f2 AD |
1357 | case 31: |
1358 | #line 235 "parse-gram.y" | |
366eea36 | 1359 | { current_braced_code = printer_braced_code; } |
0c15323d | 1360 | break; |
1921f1d7 | 1361 | |
ae7453f2 AD |
1362 | case 32: |
1363 | #line 237 "parse-gram.y" | |
1921f1d7 | 1364 | { |
366eea36 AD |
1365 | symbol_list_t *list; |
1366 | for (list = yyvsp[0].list; list; list = list->next) | |
1367 | symbol_printer_set (list->sym, yyvsp[-1].string, list->location); | |
1368 | symbol_list_free (yyvsp[0].list); | |
1369 | current_braced_code = action_braced_code; | |
4cdb01db | 1370 | } |
e9955c83 | 1371 | break; |
1921f1d7 | 1372 | |
ae7453f2 AD |
1373 | case 33: |
1374 | #line 247 "parse-gram.y" | |
366eea36 | 1375 | { current_class = nterm_sym; } |
9280d3ef AD |
1376 | break; |
1377 | ||
ae7453f2 AD |
1378 | case 34: |
1379 | #line 248 "parse-gram.y" | |
9280d3ef AD |
1380 | { |
1381 | current_class = unknown_sym; | |
1382 | current_type = NULL; | |
1383 | } | |
1384 | break; | |
1385 | ||
ae7453f2 AD |
1386 | case 35: |
1387 | #line 252 "parse-gram.y" | |
366eea36 AD |
1388 | { current_class = token_sym; } |
1389 | break; | |
1390 | ||
ae7453f2 AD |
1391 | case 36: |
1392 | #line 253 "parse-gram.y" | |
366eea36 AD |
1393 | { |
1394 | current_class = unknown_sym; | |
1395 | current_type = NULL; | |
1396 | } | |
1397 | break; | |
1398 | ||
ae7453f2 AD |
1399 | case 37: |
1400 | #line 258 "parse-gram.y" | |
1e0bab92 | 1401 | { |
56c47203 | 1402 | symbol_list_t *list; |
1e0bab92 | 1403 | for (list = yyvsp[0].list; list; list = list->next) |
1a31ed21 | 1404 | symbol_type_set (list->sym, yyvsp[-1].string, yylsp[-1]); |
dafdc66f | 1405 | symbol_list_free (yyvsp[0].list); |
1e0bab92 | 1406 | } |
e9955c83 | 1407 | break; |
1921f1d7 | 1408 | |
ae7453f2 AD |
1409 | case 38: |
1410 | #line 268 "parse-gram.y" | |
1921f1d7 | 1411 | { |
56c47203 | 1412 | symbol_list_t *list; |
1e0bab92 AD |
1413 | ++current_prec; |
1414 | for (list = yyvsp[0].list; list; list = list->next) | |
1415 | { | |
1a31ed21 AD |
1416 | symbol_type_set (list->sym, current_type, yylsp[-1]); |
1417 | symbol_precedence_set (list->sym, current_prec, yyvsp[-2].assoc, yylsp[-2]); | |
1e0bab92 | 1418 | } |
dafdc66f | 1419 | symbol_list_free (yyvsp[0].list); |
2c569025 AD |
1420 | current_type = NULL; |
1421 | } | |
e9955c83 | 1422 | break; |
1921f1d7 | 1423 | |
ae7453f2 AD |
1424 | case 39: |
1425 | #line 282 "parse-gram.y" | |
1e0bab92 | 1426 | { yyval.assoc = left_assoc; } |
e9955c83 | 1427 | break; |
1921f1d7 | 1428 | |
ae7453f2 AD |
1429 | case 40: |
1430 | #line 283 "parse-gram.y" | |
1e0bab92 | 1431 | { yyval.assoc = right_assoc; } |
e9955c83 | 1432 | break; |
1921f1d7 | 1433 | |
ae7453f2 AD |
1434 | case 41: |
1435 | #line 284 "parse-gram.y" | |
1e0bab92 | 1436 | { yyval.assoc = non_assoc; } |
4cdb01db | 1437 | break; |
1921f1d7 | 1438 | |
ae7453f2 AD |
1439 | case 42: |
1440 | #line 288 "parse-gram.y" | |
1e0bab92 | 1441 | { current_type = NULL;} |
e9955c83 | 1442 | break; |
1921f1d7 | 1443 | |
ae7453f2 AD |
1444 | case 43: |
1445 | #line 289 "parse-gram.y" | |
1e0bab92 | 1446 | { current_type = yyvsp[0].string; } |
e9955c83 | 1447 | break; |
1921f1d7 | 1448 | |
ae7453f2 AD |
1449 | case 44: |
1450 | #line 295 "parse-gram.y" | |
1e0bab92 | 1451 | { yyval.list = symbol_list_new (yyvsp[0].symbol, yylsp[0]); } |
4cdb01db | 1452 | break; |
1921f1d7 | 1453 | |
ae7453f2 AD |
1454 | case 45: |
1455 | #line 296 "parse-gram.y" | |
1e0bab92 | 1456 | { yyval.list = symbol_list_prepend (yyvsp[-1].list, yyvsp[0].symbol, yylsp[0]); } |
4cdb01db | 1457 | break; |
1921f1d7 | 1458 | |
ae7453f2 AD |
1459 | case 46: |
1460 | #line 302 "parse-gram.y" | |
1921f1d7 | 1461 | { |
e9955c83 | 1462 | current_type = yyvsp[0].string; |
4cdb01db | 1463 | } |
e9955c83 | 1464 | break; |
1921f1d7 | 1465 | |
ae7453f2 AD |
1466 | case 47: |
1467 | #line 306 "parse-gram.y" | |
1921f1d7 | 1468 | { |
e776192e | 1469 | symbol_class_set (yyvsp[0].symbol, current_class, yylsp[0]); |
1a31ed21 | 1470 | symbol_type_set (yyvsp[0].symbol, current_type, yylsp[0]); |
4cdb01db | 1471 | } |
e9955c83 | 1472 | break; |
1921f1d7 | 1473 | |
ae7453f2 AD |
1474 | case 48: |
1475 | #line 311 "parse-gram.y" | |
1921f1d7 | 1476 | { |
e776192e | 1477 | symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]); |
1a31ed21 | 1478 | symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]); |
e776192e | 1479 | symbol_user_token_number_set (yyvsp[-1].symbol, yyvsp[0].integer, yylsp[0]); |
4cdb01db | 1480 | } |
e9955c83 | 1481 | break; |
1921f1d7 | 1482 | |
ae7453f2 AD |
1483 | case 49: |
1484 | #line 317 "parse-gram.y" | |
1921f1d7 | 1485 | { |
e776192e | 1486 | symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]); |
1a31ed21 | 1487 | symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]); |
a5d50994 | 1488 | symbol_make_alias (yyvsp[-1].symbol, yyvsp[0].symbol, yyloc); |
4cdb01db | 1489 | } |
e9955c83 | 1490 | break; |
1921f1d7 | 1491 | |
ae7453f2 AD |
1492 | case 50: |
1493 | #line 323 "parse-gram.y" | |
1921f1d7 | 1494 | { |
e776192e | 1495 | symbol_class_set (yyvsp[-2].symbol, current_class, yylsp[-2]); |
1a31ed21 | 1496 | symbol_type_set (yyvsp[-2].symbol, current_type, yylsp[-2]); |
e776192e | 1497 | symbol_user_token_number_set (yyvsp[-2].symbol, yyvsp[-1].integer, yylsp[-1]); |
a5d50994 | 1498 | symbol_make_alias (yyvsp[-2].symbol, yyvsp[0].symbol, yyloc); |
4cdb01db | 1499 | } |
e9955c83 | 1500 | break; |
1921f1d7 | 1501 | |
ae7453f2 AD |
1502 | case 51: |
1503 | #line 334 "parse-gram.y" | |
1921f1d7 | 1504 | {;} |
e9955c83 | 1505 | break; |
1921f1d7 | 1506 | |
ae7453f2 AD |
1507 | case 52: |
1508 | #line 336 "parse-gram.y" | |
676385e2 | 1509 | {;} |
8efe435c AD |
1510 | break; |
1511 | ||
ae7453f2 AD |
1512 | case 56: |
1513 | #line 355 "parse-gram.y" | |
b275314e AD |
1514 | { |
1515 | if (yacc_flag) | |
1516 | complain_at (yyloc, _("POSIX forbids declarations in the grammar")); | |
1517 | } | |
1518 | break; | |
1519 | ||
ae7453f2 AD |
1520 | case 57: |
1521 | #line 360 "parse-gram.y" | |
b275314e AD |
1522 | { |
1523 | yyerrok; | |
1524 | } | |
e9955c83 | 1525 | break; |
1921f1d7 | 1526 | |
ae7453f2 AD |
1527 | case 58: |
1528 | #line 366 "parse-gram.y" | |
b275314e | 1529 | { current_lhs = yyvsp[-1].symbol; current_lhs_location = yylsp[-1]; } |
e9955c83 | 1530 | break; |
1921f1d7 | 1531 | |
ae7453f2 AD |
1532 | case 59: |
1533 | #line 367 "parse-gram.y" | |
b275314e | 1534 | {;} |
e9955c83 | 1535 | break; |
1921f1d7 | 1536 | |
ae7453f2 AD |
1537 | case 60: |
1538 | #line 371 "parse-gram.y" | |
676385e2 | 1539 | { grammar_rule_end (yylsp[0]); } |
e9955c83 | 1540 | break; |
1921f1d7 | 1541 | |
ae7453f2 AD |
1542 | case 61: |
1543 | #line 372 "parse-gram.y" | |
b275314e | 1544 | { grammar_rule_end (yylsp[0]); } |
e9955c83 | 1545 | break; |
1921f1d7 | 1546 | |
ae7453f2 AD |
1547 | case 62: |
1548 | #line 377 "parse-gram.y" | |
b275314e | 1549 | { grammar_rule_begin (current_lhs, current_lhs_location); } |
e9955c83 | 1550 | break; |
1921f1d7 | 1551 | |
ae7453f2 AD |
1552 | case 63: |
1553 | #line 379 "parse-gram.y" | |
b275314e | 1554 | { grammar_current_rule_symbol_append (yyvsp[0].symbol, yylsp[0]); } |
4cdb01db | 1555 | break; |
1921f1d7 | 1556 | |
ae7453f2 AD |
1557 | case 64: |
1558 | #line 381 "parse-gram.y" | |
b275314e | 1559 | { grammar_current_rule_action_append (yyvsp[0].string, yylsp[0]); } |
e9955c83 | 1560 | break; |
1921f1d7 | 1561 | |
ae7453f2 AD |
1562 | case 65: |
1563 | #line 383 "parse-gram.y" | |
b275314e | 1564 | { grammar_current_rule_prec_set (yyvsp[0].symbol, yylsp[0]); } |
4cdb01db | 1565 | break; |
1921f1d7 | 1566 | |
ae7453f2 AD |
1567 | case 66: |
1568 | #line 385 "parse-gram.y" | |
b275314e | 1569 | { grammar_current_rule_dprec_set (yyvsp[0].integer, yylsp[0]); } |
0c15323d | 1570 | break; |
1921f1d7 | 1571 | |
ae7453f2 AD |
1572 | case 67: |
1573 | #line 387 "parse-gram.y" | |
b275314e | 1574 | { grammar_current_rule_merge_set (yyvsp[0].string, yylsp[0]); } |
2c569025 | 1575 | break; |
1921f1d7 | 1576 | |
ae7453f2 AD |
1577 | case 68: |
1578 | #line 391 "parse-gram.y" | |
676385e2 PH |
1579 | { yyval.symbol = yyvsp[0].symbol; } |
1580 | break; | |
1581 | ||
ae7453f2 AD |
1582 | case 69: |
1583 | #line 392 "parse-gram.y" | |
b275314e | 1584 | { yyval.symbol = yyvsp[0].symbol; } |
676385e2 PH |
1585 | break; |
1586 | ||
ae7453f2 AD |
1587 | case 70: |
1588 | #line 393 "parse-gram.y" | |
b275314e | 1589 | { yyval.symbol = symbol_get (yyvsp[0].string, yylsp[0]); } |
676385e2 PH |
1590 | break; |
1591 | ||
ae7453f2 AD |
1592 | case 71: |
1593 | #line 398 "parse-gram.y" | |
b275314e AD |
1594 | { yyval.string = yyvsp[0].string; } |
1595 | break; | |
1596 | ||
ae7453f2 AD |
1597 | case 72: |
1598 | #line 404 "parse-gram.y" | |
1921f1d7 | 1599 | { |
39f41916 | 1600 | yyval.symbol = symbol_get (yyvsp[0].string, yylsp[0]); |
e776192e | 1601 | symbol_class_set (yyval.symbol, token_sym, yylsp[0]); |
4cdb01db | 1602 | } |
e9955c83 | 1603 | break; |
1921f1d7 | 1604 | |
ae7453f2 AD |
1605 | case 73: |
1606 | #line 413 "parse-gram.y" | |
1921f1d7 | 1607 | { |
e9955c83 AD |
1608 | yyval.string = yyvsp[0].string + 1; |
1609 | yyval.string[strlen (yyval.string) - 1] = '\0'; | |
4cdb01db | 1610 | } |
e9955c83 | 1611 | break; |
1921f1d7 | 1612 | |
ae7453f2 AD |
1613 | case 74: |
1614 | #line 421 "parse-gram.y" | |
1921f1d7 | 1615 | { |
e9955c83 | 1616 | yyval.string = xstrdup (""); |
4cdb01db | 1617 | } |
e9955c83 | 1618 | break; |
1921f1d7 | 1619 | |
ae7453f2 AD |
1620 | case 75: |
1621 | #line 425 "parse-gram.y" | |
1921f1d7 | 1622 | { |
e9955c83 | 1623 | yyval.string = yyvsp[0].string; |
4cdb01db | 1624 | } |
e9955c83 AD |
1625 | break; |
1626 | ||
1627 | ||
1921f1d7 AD |
1628 | } |
1629 | ||
d33cb3ae PE |
1630 | /* Line 1022 of /tmp/prefix/share/bison/yacc.c. */ |
1631 | #line 1632 "parse-gram.c" | |
e9955c83 AD |
1632 | \f |
1633 | yyvsp -= yylen; | |
1634 | yyssp -= yylen; | |
e9955c83 | 1635 | yylsp -= yylen; |
e9955c83 AD |
1636 | |
1637 | #if YYDEBUG | |
1638 | if (yydebug) | |
1639 | { | |
1640 | short *yyssp1 = yyss - 1; | |
1641 | YYFPRINTF (stderr, "state stack now"); | |
1642 | while (yyssp1 != yyssp) | |
1643 | YYFPRINTF (stderr, " %d", *++yyssp1); | |
1644 | YYFPRINTF (stderr, "\n"); | |
1645 | } | |
1646 | #endif | |
1647 | ||
1648 | *++yyvsp = yyval; | |
e9955c83 | 1649 | *++yylsp = yyloc; |
e9955c83 AD |
1650 | |
1651 | /* Now `shift' the result of the reduction. Determine what state | |
1652 | that goes to, based on the state we popped back to and the rule | |
1653 | number reduced by. */ | |
1654 | ||
1655 | yyn = yyr1[yyn]; | |
1656 | ||
1921f1d7 | 1657 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
04b6e11e | 1658 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
e9955c83 AD |
1659 | yystate = yytable[yystate]; |
1660 | else | |
1921f1d7 | 1661 | yystate = yydefgoto[yyn - YYNTOKENS]; |
e9955c83 AD |
1662 | |
1663 | goto yynewstate; | |
1664 | ||
1665 | ||
1666 | /*------------------------------------. | |
1667 | | yyerrlab -- here on detecting error | | |
1668 | `------------------------------------*/ | |
1669 | yyerrlab: | |
1670 | /* If not already recovering from an error, report this error. */ | |
1671 | if (!yyerrstatus) | |
1672 | { | |
1673 | ++yynerrs; | |
ae7453f2 AD |
1674 | #if YYERROR_VERBOSE |
1675 | yyn = yypact[yystate]; | |
1676 | ||
1677 | if (YYPACT_NINF < yyn && yyn < YYLAST) | |
1678 | { | |
1679 | YYSIZE_T yysize = 0; | |
1680 | int yytype = YYTRANSLATE (yychar); | |
1681 | char *yymsg; | |
1682 | int yyx, yycount; | |
1683 | ||
1684 | yycount = 0; | |
1685 | /* Start YYX at -YYN if negative to avoid negative indexes in | |
1686 | YYCHECK. */ | |
1687 | for (yyx = yyn < 0 ? -yyn : 0; | |
1688 | yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) | |
1689 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | |
1690 | yysize += yystrlen (yytname[yyx]) + 15, yycount++; | |
1691 | yysize += yystrlen ("parse error, unexpected ") + 1; | |
1692 | yysize += yystrlen (yytname[yytype]); | |
1693 | yymsg = (char *) YYSTACK_ALLOC (yysize); | |
1694 | if (yymsg != 0) | |
1695 | { | |
1696 | char *yyp = yystpcpy (yymsg, "parse error, unexpected "); | |
1697 | yyp = yystpcpy (yyp, yytname[yytype]); | |
1698 | ||
1699 | if (yycount < 5) | |
1700 | { | |
1701 | yycount = 0; | |
1702 | for (yyx = yyn < 0 ? -yyn : 0; | |
1703 | yyx < (int) (sizeof (yytname) / sizeof (char *)); | |
1704 | yyx++) | |
1705 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | |
1706 | { | |
1707 | const char *yyq = ! yycount ? ", expecting " : " or "; | |
1708 | yyp = yystpcpy (yyp, yyq); | |
1709 | yyp = yystpcpy (yyp, yytname[yyx]); | |
1710 | yycount++; | |
1711 | } | |
1712 | } | |
1713 | yyerror (yymsg); | |
1714 | YYSTACK_FREE (yymsg); | |
1715 | } | |
1716 | else | |
1717 | yyerror ("parse error; also virtual memory exhausted"); | |
1718 | } | |
1719 | else | |
1720 | #endif /* YYERROR_VERBOSE */ | |
1721 | yyerror ("parse error"); | |
e9955c83 AD |
1722 | } |
1723 | goto yyerrlab1; | |
1724 | ||
1725 | ||
1921f1d7 AD |
1726 | /*----------------------------------------------------. |
1727 | | yyerrlab1 -- error raised explicitly by an action. | | |
1728 | `----------------------------------------------------*/ | |
e9955c83 AD |
1729 | yyerrlab1: |
1730 | if (yyerrstatus == 3) | |
1731 | { | |
1732 | /* If just tried and failed to reuse lookahead token after an | |
1733 | error, discard it. */ | |
1734 | ||
1921f1d7 | 1735 | /* Return failure if at end of input. */ |
e9955c83 | 1736 | if (yychar == YYEOF) |
366eea36 AD |
1737 | { |
1738 | /* Pop the error token. */ | |
1739 | YYPOPSTACK; | |
1740 | /* Pop the rest of the stack. */ | |
d33cb3ae | 1741 | while (yyss < yyssp) |
366eea36 | 1742 | { |
e776192e AD |
1743 | YYDPRINTF ((stderr, "Error: popping ")); |
1744 | YYDSYMPRINT ((stderr, | |
1745 | yystos[*yyssp], | |
1746 | *yyvsp, *yylsp)); | |
1747 | YYDPRINTF ((stderr, "\n")); | |
676385e2 | 1748 | yydestruct (yystos[*yyssp], *yyvsp, *yylsp); |
366eea36 AD |
1749 | YYPOPSTACK; |
1750 | } | |
1751 | YYABORT; | |
1752 | } | |
1753 | ||
e9955c83 AD |
1754 | YYDPRINTF ((stderr, "Discarding token %d (%s).\n", |
1755 | yychar, yytname[yychar1])); | |
676385e2 | 1756 | yydestruct (yychar1, yylval, yylloc); |
e9955c83 AD |
1757 | yychar = YYEMPTY; |
1758 | } | |
1759 | ||
1760 | /* Else will try to reuse lookahead token after shifting the error | |
1761 | token. */ | |
1762 | ||
1921f1d7 | 1763 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
e9955c83 | 1764 | |
1921f1d7 AD |
1765 | for (;;) |
1766 | { | |
1767 | yyn = yypact[yystate]; | |
04b6e11e | 1768 | if (yyn != YYPACT_NINF) |
1921f1d7 AD |
1769 | { |
1770 | yyn += YYTERROR; | |
1771 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
1772 | { | |
1773 | yyn = yytable[yyn]; | |
1774 | if (0 < yyn) | |
1775 | break; | |
1776 | } | |
1777 | } | |
4cdb01db | 1778 | |
1921f1d7 AD |
1779 | /* Pop the current state because it cannot handle the error token. */ |
1780 | if (yyssp == yyss) | |
1781 | YYABORT; | |
0c15323d | 1782 | |
e776192e AD |
1783 | YYDPRINTF ((stderr, "Error: popping ")); |
1784 | YYDSYMPRINT ((stderr, | |
1785 | yystos[*yyssp], *yyvsp, *yylsp)); | |
1786 | YYDPRINTF ((stderr, "\n")); | |
e9955c83 | 1787 | |
676385e2 | 1788 | yydestruct (yystos[yystate], *yyvsp, *yylsp); |
1921f1d7 AD |
1789 | yyvsp--; |
1790 | yystate = *--yyssp; | |
1921f1d7 | 1791 | yylsp--; |
e9955c83 AD |
1792 | |
1793 | #if YYDEBUG | |
1921f1d7 AD |
1794 | if (yydebug) |
1795 | { | |
1796 | short *yyssp1 = yyss - 1; | |
1797 | YYFPRINTF (stderr, "Error: state stack now"); | |
1798 | while (yyssp1 != yyssp) | |
1799 | YYFPRINTF (stderr, " %d", *++yyssp1); | |
1800 | YYFPRINTF (stderr, "\n"); | |
1801 | } | |
e9955c83 AD |
1802 | #endif |
1803 | } | |
1804 | ||
1805 | if (yyn == YYFINAL) | |
1806 | YYACCEPT; | |
1807 | ||
1808 | YYDPRINTF ((stderr, "Shifting error token, ")); | |
1809 | ||
1810 | *++yyvsp = yylval; | |
e9955c83 | 1811 | *++yylsp = yylloc; |
e9955c83 AD |
1812 | |
1813 | yystate = yyn; | |
1814 | goto yynewstate; | |
1815 | ||
1816 | ||
1817 | /*-------------------------------------. | |
1818 | | yyacceptlab -- YYACCEPT comes here. | | |
1819 | `-------------------------------------*/ | |
1820 | yyacceptlab: | |
1821 | yyresult = 0; | |
1822 | goto yyreturn; | |
1823 | ||
1824 | /*-----------------------------------. | |
1825 | | yyabortlab -- YYABORT comes here. | | |
1826 | `-----------------------------------*/ | |
1827 | yyabortlab: | |
1828 | yyresult = 1; | |
1829 | goto yyreturn; | |
1830 | ||
366eea36 AD |
1831 | #ifndef yyoverflow |
1832 | /*----------------------------------------------. | |
1833 | | yyoverflowlab -- parser overflow comes here. | | |
1834 | `----------------------------------------------*/ | |
e9955c83 AD |
1835 | yyoverflowlab: |
1836 | yyerror ("parser stack overflow"); | |
1837 | yyresult = 2; | |
1838 | /* Fall through. */ | |
366eea36 | 1839 | #endif |
e9955c83 AD |
1840 | |
1841 | yyreturn: | |
1842 | #ifndef yyoverflow | |
1843 | if (yyss != yyssa) | |
1844 | YYSTACK_FREE (yyss); | |
1845 | #endif | |
1846 | return yyresult; | |
1847 | } | |
1921f1d7 | 1848 | |
366eea36 | 1849 | |
ae7453f2 | 1850 | #line 434 "parse-gram.y" |
e9955c83 AD |
1851 | |
1852 | /*------------------------------------------------------------------. | |
1853 | | When debugging the parser, display tokens' locations and values. | | |
1854 | `------------------------------------------------------------------*/ | |
1855 | ||
1856 | static void | |
1857 | yyprint (FILE *file, | |
e776192e | 1858 | int type, const yystype *value) |
e9955c83 | 1859 | { |
e776192e | 1860 | fputc (' ', file); |
e9955c83 AD |
1861 | switch (type) |
1862 | { | |
1863 | case CHARACTER: | |
1864 | fprintf (file, " = '%s'", value->string); | |
1865 | break; | |
1866 | ||
1867 | case ID: | |
1868 | fprintf (file, " = %s", value->symbol->tag); | |
1869 | break; | |
1870 | ||
1871 | case INT: | |
1872 | fprintf (file, " = %d", value->integer); | |
1873 | break; | |
1874 | ||
1875 | case STRING: | |
1876 | fprintf (file, " = \"%s\"", value->string); | |
1877 | break; | |
1878 | ||
1879 | case TYPE: | |
1880 | fprintf (file, " = <%s>", value->string); | |
1881 | break; | |
1882 | ||
1883 | case BRACED_CODE: | |
1884 | case PROLOGUE: | |
1885 | case EPILOGUE: | |
1886 | fprintf (file, " = {{ %s }}", value->string); | |
1887 | break; | |
1888 | } | |
1889 | } | |
1890 | ||
1891 | void | |
fc5734fe | 1892 | gram_error (location_t *yylloc, const char *msg) |
e9955c83 | 1893 | { |
b275314e | 1894 | complain_at (*yylloc, "%s", msg); |
e9955c83 | 1895 | } |
1921f1d7 | 1896 |