]>
Commit | Line | Data |
---|---|---|
a9439670 | 1 | /* A Bison parser, made by GNU Bison 2.5.1.885-485b-dirty. */ |
1c7b7e1d | 2 | |
fe3cae17 | 3 | /* Bison implementation for Yacc-like parsers in C |
21db118b | 4 | |
d9b968d8 | 5 | Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. |
21db118b | 6 | |
f16b0819 | 7 | This program is free software: you can redistribute it and/or modify |
1921f1d7 | 8 | it under the terms of the GNU General Public License as published by |
f16b0819 PE |
9 | the Free Software Foundation, either version 3 of the License, or |
10 | (at your option) any later version. | |
21db118b | 11 | |
1921f1d7 AD |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
21db118b | 16 | |
1921f1d7 | 17 | You should have received a copy of the GNU General Public License |
f16b0819 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
1921f1d7 | 19 | |
04c12cb8 PE |
20 | /* As a special exception, you may create a larger work that contains |
21 | part or all of the Bison parser skeleton and distribute that work | |
22 | under terms of your choice, so long as that work isn't itself a | |
23 | parser generator using the skeleton or a modified version thereof | |
24 | as a parser skeleton. Alternatively, if you modify or redistribute | |
25 | the parser skeleton itself, you may (at your option) remove this | |
26 | special exception, which will cause the skeleton and the resulting | |
27 | Bison output files to be licensed under the GNU General Public | |
28 | License without this special exception. | |
21db118b | 29 | |
04c12cb8 PE |
30 | This special exception was added by the Free Software Foundation in |
31 | version 2.2 of Bison. */ | |
1921f1d7 | 32 | |
66809587 PE |
33 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
34 | simplifying the original so-called "semantic" parser. */ | |
1921f1d7 AD |
35 | |
36 | /* All symbols defined below should begin with yy or YY, to avoid | |
37 | infringing on user name space. This should be done even for local | |
38 | variables, as they might otherwise be expanded by user macros. | |
39 | There are some unavoidable exceptions within include files to | |
40 | define necessary library symbols; they are noted "INFRINGES ON | |
41 | USER NAME SPACE" below. */ | |
42 | ||
43 | /* Identify Bison output. */ | |
62ddaef6 PE |
44 | #define YYBISON 1 |
45 | ||
f5109f5a | 46 | /* Bison version. */ |
a9439670 | 47 | #define YYBISON_VERSION "2.5.1.885-485b-dirty" |
f5109f5a | 48 | |
62ddaef6 PE |
49 | /* Skeleton name. */ |
50 | #define YYSKELETON_NAME "yacc.c" | |
1921f1d7 AD |
51 | |
52 | /* Pure parsers. */ | |
62ddaef6 | 53 | #define YYPURE 1 |
1921f1d7 | 54 | |
e021811a JD |
55 | /* Push parsers. */ |
56 | #define YYPUSH 0 | |
57 | ||
58 | /* Pull parsers. */ | |
59 | #define YYPULL 1 | |
60 | ||
a9439670 | 61 | |
76dcf299 | 62 | /* Substitute the variable and function names. */ |
e021811a JD |
63 | #define yyparse gram_parse |
64 | #define yylex gram_lex | |
65 | #define yyerror gram_error | |
66 | #define yylval gram_lval | |
67 | #define yychar gram_char | |
68 | #define yydebug gram_debug | |
69 | #define yynerrs gram_nerrs | |
70 | #define yylloc gram_lloc | |
e9955c83 | 71 | |
1921f1d7 | 72 | /* Copy the first part of user declarations. */ |
a9439670 | 73 | /* Line 337 of yacc.c */ |
f4c75eaf | 74 | #line 1 "src/parse-gram.y" |
a76ca263 PE |
75 | /* Bison Grammar Parser -*- C -*- |
76 | ||
d9b968d8 | 77 | Copyright (C) 2002-2012 Free Software Foundation, Inc. |
a76ca263 PE |
78 | |
79 | This file is part of Bison, the GNU Compiler Compiler. | |
80 | ||
f16b0819 | 81 | This program is free software: you can redistribute it and/or modify |
a76ca263 | 82 | it under the terms of the GNU General Public License as published by |
f16b0819 | 83 | the Free Software Foundation, either version 3 of the License, or |
a76ca263 PE |
84 | (at your option) any later version. |
85 | ||
86 | This program is distributed in the hope that it will be useful, | |
87 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
88 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
89 | GNU General Public License for more details. | |
90 | ||
91 | You should have received a copy of the GNU General Public License | |
f16b0819 | 92 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
e9955c83 | 93 | |
72c4d336 | 94 | #include <config.h> |
e9955c83 | 95 | #include "system.h" |
05d18c24 | 96 | |
b275314e | 97 | #include "complain.h" |
05d18c24 | 98 | #include "conflicts.h" |
e9955c83 AD |
99 | #include "files.h" |
100 | #include "getargs.h" | |
e9955c83 | 101 | #include "gram.h" |
3583d96b | 102 | #include "muscle-tab.h" |
f7c0fe19 | 103 | #include "named-ref.h" |
2ce37586 | 104 | #include "quotearg.h" |
e9955c83 | 105 | #include "reader.h" |
05d18c24 | 106 | #include "symlist.h" |
e9071366 AD |
107 | #include "scan-gram.h" |
108 | #include "scan-code.h" | |
398c298c | 109 | #include "xmemdup0.h" |
e9955c83 | 110 | |
05d18c24 PE |
111 | #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N) |
112 | static YYLTYPE lloc_default (YYLTYPE const *, int); | |
e9955c83 | 113 | |
8a8dc872 | 114 | #define YY_LOCATION_PRINT(File, Loc) \ |
e9690142 | 115 | location_print (File, Loc) |
8a8dc872 | 116 | |
b50d2359 AD |
117 | static void version_check (location const *loc, char const *version); |
118 | ||
f0616f0b | 119 | /* Request detailed syntax error messages, and pass them to GRAM_ERROR. |
05d18c24 | 120 | FIXME: depends on the undocumented availability of YYLLOC. */ |
e9955c83 AD |
121 | #undef yyerror |
122 | #define yyerror(Msg) \ | |
e9690142 | 123 | gram_error (&yylloc, Msg) |
05d18c24 | 124 | static void gram_error (location const *, char const *); |
e9955c83 | 125 | |
d2a1a60a PE |
126 | static char const *char_name (char); |
127 | ||
a9439670 AD |
128 | /* Line 337 of yacc.c */ |
129 | #line 130 "src/parse-gram.c" | |
398c298c AD |
130 | |
131 | # ifndef YY_NULL | |
132 | # if defined __cplusplus && 201103L <= __cplusplus | |
133 | # define YY_NULL nullptr | |
134 | # else | |
135 | # define YY_NULL 0 | |
136 | # endif | |
137 | # endif | |
136a0f76 | 138 | |
1921f1d7 AD |
139 | /* Enabling verbose error messages. */ |
140 | #ifdef YYERROR_VERBOSE | |
141 | # undef YYERROR_VERBOSE | |
142 | # define YYERROR_VERBOSE 1 | |
143 | #else | |
cd3684cf | 144 | # define YYERROR_VERBOSE 1 |
1921f1d7 AD |
145 | #endif |
146 | ||
415b8823 AD |
147 | /* In a future release of Bison, this section will be replaced |
148 | by #include "src/parse-gram.h". */ | |
a9439670 AD |
149 | #ifndef GRAM_SRC_PARSE_GRAM_H |
150 | # define GRAM_SRC_PARSE_GRAM_H | |
415b8823 AD |
151 | /* Enabling traces. */ |
152 | #ifndef YYDEBUG | |
153 | # define YYDEBUG 1 | |
154 | #endif | |
155 | #if YYDEBUG | |
156 | extern int gram_debug; | |
157 | #endif | |
158 | /* "%code requires" blocks. */ | |
a9439670 | 159 | /* Line 351 of yacc.c */ |
415b8823 AD |
160 | #line 221 "src/parse-gram.y" |
161 | ||
162 | # ifndef PARAM_TYPE | |
163 | # define PARAM_TYPE | |
164 | typedef enum | |
165 | { | |
166 | param_none = 0, | |
167 | param_lex = 1 << 0, | |
168 | param_parse = 1 << 1, | |
169 | param_both = param_lex | param_parse | |
170 | } param_type; | |
171 | # endif | |
172 | ||
173 | ||
a9439670 AD |
174 | /* Line 351 of yacc.c */ |
175 | #line 176 "src/parse-gram.c" | |
415b8823 AD |
176 | |
177 | /* Tokens. */ | |
178 | #ifndef YYTOKENTYPE | |
179 | # define YYTOKENTYPE | |
a9439670 AD |
180 | /* Put the tokens into the symbol table, so that GDB and other debuggers |
181 | know about them. */ | |
182 | enum yytokentype | |
183 | { | |
184 | GRAM_EOF = 0, | |
185 | STRING = 258, | |
186 | INT = 259, | |
187 | PERCENT_TOKEN = 260, | |
188 | PERCENT_NTERM = 261, | |
189 | PERCENT_TYPE = 262, | |
190 | PERCENT_DESTRUCTOR = 263, | |
191 | PERCENT_PRINTER = 264, | |
192 | PERCENT_LEFT = 265, | |
193 | PERCENT_RIGHT = 266, | |
194 | PERCENT_NONASSOC = 267, | |
195 | PERCENT_PRECEDENCE = 268, | |
196 | PERCENT_PREC = 269, | |
197 | PERCENT_DPREC = 270, | |
198 | PERCENT_MERGE = 271, | |
199 | PERCENT_CODE = 272, | |
200 | PERCENT_DEFAULT_PREC = 273, | |
201 | PERCENT_DEFINE = 274, | |
202 | PERCENT_DEFINES = 275, | |
203 | PERCENT_ERROR_VERBOSE = 276, | |
204 | PERCENT_EXPECT = 277, | |
205 | PERCENT_EXPECT_RR = 278, | |
206 | PERCENT_FLAG = 279, | |
207 | PERCENT_FILE_PREFIX = 280, | |
208 | PERCENT_GLR_PARSER = 281, | |
209 | PERCENT_INITIAL_ACTION = 282, | |
210 | PERCENT_LANGUAGE = 283, | |
211 | PERCENT_NAME_PREFIX = 284, | |
212 | PERCENT_NO_DEFAULT_PREC = 285, | |
213 | PERCENT_NO_LINES = 286, | |
214 | PERCENT_NONDETERMINISTIC_PARSER = 287, | |
215 | PERCENT_OUTPUT = 288, | |
216 | PERCENT_REQUIRE = 289, | |
217 | PERCENT_SKELETON = 290, | |
218 | PERCENT_START = 291, | |
219 | PERCENT_TOKEN_TABLE = 292, | |
220 | PERCENT_VERBOSE = 293, | |
221 | PERCENT_YACC = 294, | |
222 | BRACED_CODE = 295, | |
223 | BRACED_PREDICATE = 296, | |
224 | BRACKETED_ID = 297, | |
225 | CHAR = 298, | |
226 | EPILOGUE = 299, | |
227 | EQUAL = 300, | |
228 | ID = 301, | |
229 | ID_COLON = 302, | |
230 | PERCENT_PERCENT = 303, | |
231 | PIPE = 304, | |
232 | PROLOGUE = 305, | |
233 | SEMICOLON = 306, | |
234 | TAG = 307, | |
235 | TAG_ANY = 308, | |
236 | TAG_NONE = 309, | |
237 | PERCENT_PARAM = 310, | |
238 | PERCENT_UNION = 311 | |
239 | }; | |
415b8823 AD |
240 | #endif |
241 | /* Tokens. */ | |
242 | #define GRAM_EOF 0 | |
243 | #define STRING 258 | |
244 | #define INT 259 | |
245 | #define PERCENT_TOKEN 260 | |
246 | #define PERCENT_NTERM 261 | |
247 | #define PERCENT_TYPE 262 | |
248 | #define PERCENT_DESTRUCTOR 263 | |
249 | #define PERCENT_PRINTER 264 | |
250 | #define PERCENT_LEFT 265 | |
251 | #define PERCENT_RIGHT 266 | |
252 | #define PERCENT_NONASSOC 267 | |
253 | #define PERCENT_PRECEDENCE 268 | |
254 | #define PERCENT_PREC 269 | |
255 | #define PERCENT_DPREC 270 | |
256 | #define PERCENT_MERGE 271 | |
257 | #define PERCENT_CODE 272 | |
258 | #define PERCENT_DEFAULT_PREC 273 | |
259 | #define PERCENT_DEFINE 274 | |
260 | #define PERCENT_DEFINES 275 | |
261 | #define PERCENT_ERROR_VERBOSE 276 | |
262 | #define PERCENT_EXPECT 277 | |
263 | #define PERCENT_EXPECT_RR 278 | |
264 | #define PERCENT_FLAG 279 | |
265 | #define PERCENT_FILE_PREFIX 280 | |
266 | #define PERCENT_GLR_PARSER 281 | |
267 | #define PERCENT_INITIAL_ACTION 282 | |
268 | #define PERCENT_LANGUAGE 283 | |
269 | #define PERCENT_NAME_PREFIX 284 | |
270 | #define PERCENT_NO_DEFAULT_PREC 285 | |
271 | #define PERCENT_NO_LINES 286 | |
272 | #define PERCENT_NONDETERMINISTIC_PARSER 287 | |
273 | #define PERCENT_OUTPUT 288 | |
274 | #define PERCENT_REQUIRE 289 | |
275 | #define PERCENT_SKELETON 290 | |
276 | #define PERCENT_START 291 | |
277 | #define PERCENT_TOKEN_TABLE 292 | |
278 | #define PERCENT_VERBOSE 293 | |
279 | #define PERCENT_YACC 294 | |
280 | #define BRACED_CODE 295 | |
281 | #define BRACED_PREDICATE 296 | |
282 | #define BRACKETED_ID 297 | |
283 | #define CHAR 298 | |
284 | #define EPILOGUE 299 | |
285 | #define EQUAL 300 | |
286 | #define ID 301 | |
287 | #define ID_COLON 302 | |
288 | #define PERCENT_PERCENT 303 | |
289 | #define PIPE 304 | |
290 | #define PROLOGUE 305 | |
291 | #define SEMICOLON 306 | |
292 | #define TAG 307 | |
293 | #define TAG_ANY 308 | |
294 | #define TAG_NONE 309 | |
295 | #define PERCENT_PARAM 310 | |
296 | #define PERCENT_UNION 311 | |
297 | ||
415b8823 AD |
298 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
299 | typedef union YYSTYPE | |
300 | { | |
a9439670 | 301 | /* Line 351 of yacc.c */ |
415b8823 AD |
302 | #line 107 "src/parse-gram.y" |
303 | ||
304 | assoc assoc; | |
305 | char *code; | |
306 | char const *chars; | |
307 | int integer; | |
308 | named_ref *named_ref; | |
309 | symbol *symbol; | |
310 | symbol_list *list; | |
311 | uniqstr uniqstr; | |
312 | unsigned char character; | |
313 | ||
a9439670 | 314 | /* Line 351 of yacc.c */ |
415b8823 AD |
315 | #line 245 "src/parse-gram.y" |
316 | ||
317 | param_type param; | |
318 | ||
319 | ||
a9439670 | 320 | /* Line 351 of yacc.c */ |
415b8823 AD |
321 | #line 322 "src/parse-gram.c" |
322 | } YYSTYPE; | |
323 | # define YYSTYPE_IS_TRIVIAL 1 | |
324 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ | |
325 | # define YYSTYPE_IS_DECLARED 1 | |
326 | #endif | |
327 | ||
328 | #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED | |
329 | typedef struct YYLTYPE | |
330 | { | |
331 | int first_line; | |
332 | int first_column; | |
333 | int last_line; | |
334 | int last_column; | |
335 | } YYLTYPE; | |
336 | # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ | |
337 | # define YYLTYPE_IS_DECLARED 1 | |
338 | # define YYLTYPE_IS_TRIVIAL 1 | |
339 | #endif | |
340 | ||
341 | ||
342 | #ifdef YYPARSE_PARAM | |
343 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
344 | || defined __cplusplus || defined _MSC_VER) | |
345 | int gram_parse (void *YYPARSE_PARAM); | |
346 | #else | |
347 | int gram_parse (); | |
5f3df396 | 348 | #endif |
415b8823 AD |
349 | #else /* ! YYPARSE_PARAM */ |
350 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
351 | || defined __cplusplus || defined _MSC_VER) | |
352 | int gram_parse (void); | |
353 | #else | |
354 | int gram_parse (); | |
355 | #endif | |
356 | #endif /* ! YYPARSE_PARAM */ | |
5f3df396 | 357 | |
a9439670 | 358 | #endif /* !GRAM_SRC_PARSE_GRAM_H */ |
73521d9f | 359 | |
1921f1d7 | 360 | /* Copy the second part of user declarations. */ |
0c15323d | 361 | |
a9439670 | 362 | /* Line 354 of yacc.c */ |
415b8823 | 363 | #line 364 "src/parse-gram.c" |
b18cdd91 | 364 | /* Unqualified %code blocks. */ |
a9439670 | 365 | /* Line 355 of yacc.c */ |
398c298c | 366 | #line 56 "src/parse-gram.y" |
b18cdd91 | 367 | |
dd875058 | 368 | static int current_prec = 0; |
b18cdd91 AD |
369 | static location current_lhs_location; |
370 | static named_ref *current_lhs_named_ref; | |
f9d52903 | 371 | static symbol *current_lhs_symbol; |
dd875058 AD |
372 | static symbol_class current_class = unknown_sym; |
373 | static uniqstr current_type = NULL; | |
b18cdd91 | 374 | |
f9d52903 JD |
375 | /** Set the new current left-hand side symbol, possibly common |
376 | * to several right-hand side parts of rule. | |
377 | */ | |
378 | static | |
379 | void | |
380 | current_lhs(symbol *sym, location loc, named_ref *ref) | |
381 | { | |
382 | current_lhs_symbol = sym; | |
383 | current_lhs_location = loc; | |
384 | /* In order to simplify memory management, named references for lhs | |
385 | are always assigned by deep copy into the current symbol_list | |
386 | node. This is because a single named-ref in the grammar may | |
387 | result in several uses when the user factors lhs between several | |
388 | rules using "|". Therefore free the parser's original copy. */ | |
389 | free (current_lhs_named_ref); | |
390 | current_lhs_named_ref = ref; | |
391 | } | |
392 | ||
b18cdd91 AD |
393 | #define YYTYPE_INT16 int_fast16_t |
394 | #define YYTYPE_INT8 int_fast8_t | |
395 | #define YYTYPE_UINT16 uint_fast16_t | |
396 | #define YYTYPE_UINT8 uint_fast8_t | |
397 | ||
a9439670 | 398 | /* Line 355 of yacc.c */ |
398c298c | 399 | #line 234 "src/parse-gram.y" |
b18cdd91 AD |
400 | |
401 | /** Add a lex-param and/or a parse-param. | |
402 | * | |
403 | * \param type where to push this formal argument. | |
404 | * \param decl the formal argument. Destroyed. | |
405 | * \param loc the location in the source. | |
406 | */ | |
407 | static void add_param (param_type type, char *decl, location loc); | |
dd875058 | 408 | static param_type current_param = param_none; |
b18cdd91 AD |
409 | |
410 | ||
a9439670 | 411 | /* Line 355 of yacc.c */ |
415b8823 | 412 | #line 413 "src/parse-gram.c" |
bf8b3d98 PE |
413 | |
414 | #ifdef short | |
415 | # undef short | |
416 | #endif | |
417 | ||
418 | #ifdef YYTYPE_UINT8 | |
419 | typedef YYTYPE_UINT8 yytype_uint8; | |
420 | #else | |
421 | typedef unsigned char yytype_uint8; | |
422 | #endif | |
423 | ||
424 | #ifdef YYTYPE_INT8 | |
425 | typedef YYTYPE_INT8 yytype_int8; | |
426 | #elif (defined __STDC__ || defined __C99__FUNC__ \ | |
427 | || defined __cplusplus || defined _MSC_VER) | |
428 | typedef signed char yytype_int8; | |
429 | #else | |
430 | typedef short int yytype_int8; | |
431 | #endif | |
432 | ||
433 | #ifdef YYTYPE_UINT16 | |
434 | typedef YYTYPE_UINT16 yytype_uint16; | |
435 | #else | |
436 | typedef unsigned short int yytype_uint16; | |
437 | #endif | |
438 | ||
439 | #ifdef YYTYPE_INT16 | |
440 | typedef YYTYPE_INT16 yytype_int16; | |
441 | #else | |
442 | typedef short int yytype_int16; | |
443 | #endif | |
2ed28444 | 444 | |
ac243428 | 445 | #ifndef YYSIZE_T |
bf8b3d98 | 446 | # ifdef __SIZE_TYPE__ |
ac243428 | 447 | # define YYSIZE_T __SIZE_TYPE__ |
bf8b3d98 | 448 | # elif defined size_t |
ac243428 | 449 | # define YYSIZE_T size_t |
bf8b3d98 PE |
450 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
451 | || defined __cplusplus || defined _MSC_VER) | |
ac243428 PE |
452 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
453 | # define YYSIZE_T size_t | |
454 | # else | |
455 | # define YYSIZE_T unsigned int | |
456 | # endif | |
4b43d402 | 457 | #endif |
e9955c83 | 458 | |
2abdfeef PE |
459 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
460 | ||
6088a2a0 | 461 | #ifndef YY_ |
1625df5b | 462 | # if defined YYENABLE_NLS && YYENABLE_NLS |
6088a2a0 PE |
463 | # if ENABLE_NLS |
464 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | |
465 | # define YY_(msgid) dgettext ("bison-runtime", msgid) | |
466 | # endif | |
467 | # endif | |
468 | # ifndef YY_ | |
469 | # define YY_(msgid) msgid | |
470 | # endif | |
471 | #endif | |
472 | ||
e764d4df | 473 | /* Suppress unused-variable warnings by "using" E. */ |
bf8b3d98 | 474 | #if ! defined lint || defined __GNUC__ |
7029f892 PE |
475 | # define YYUSE(e) ((void) (e)) |
476 | #else | |
477 | # define YYUSE(e) /* empty */ | |
478 | #endif | |
479 | ||
480 | /* Identity function, used to suppress warnings about constant conditions. */ | |
481 | #ifndef lint | |
482 | # define YYID(n) (n) | |
483 | #else | |
bf8b3d98 PE |
484 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
485 | || defined __cplusplus || defined _MSC_VER) | |
7029f892 | 486 | static int |
3b452f4e | 487 | YYID (int yyi) |
7029f892 PE |
488 | #else |
489 | static int | |
3b452f4e JD |
490 | YYID (yyi) |
491 | int yyi; | |
7029f892 PE |
492 | #endif |
493 | { | |
3b452f4e | 494 | return yyi; |
7029f892 PE |
495 | } |
496 | #endif | |
e764d4df | 497 | |
107844a3 | 498 | #if 1 |
cd3684cf | 499 | |
e9955c83 AD |
500 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
501 | ||
e9955c83 | 502 | # ifdef YYSTACK_ALLOC |
3b0ffc7e | 503 | /* Pacify GCC's `empty if-body' warning. */ |
7029f892 | 504 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
2ce37586 | 505 | # ifndef YYSTACK_ALLOC_MAXIMUM |
7768896a PE |
506 | /* The OS might guarantee only one guard page at the bottom of the stack, |
507 | and a page size can be as small as 4096 bytes. So we cannot safely | |
508 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number | |
509 | to allow for a few compiler-allocated temporary stack slots. */ | |
f52b276c | 510 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
2ce37586 | 511 | # endif |
e9955c83 | 512 | # else |
cd3684cf AD |
513 | # define YYSTACK_ALLOC YYMALLOC |
514 | # define YYSTACK_FREE YYFREE | |
2ce37586 | 515 | # ifndef YYSTACK_ALLOC_MAXIMUM |
2abdfeef | 516 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
2ce37586 | 517 | # endif |
8ff146cd | 518 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
765f22f0 | 519 | && ! ((defined YYMALLOC || defined malloc) \ |
e9690142 | 520 | && (defined YYFREE || defined free))) |
765f22f0 | 521 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
8ff146cd PE |
522 | # ifndef EXIT_SUCCESS |
523 | # define EXIT_SUCCESS 0 | |
765f22f0 | 524 | # endif |
0925ebb4 | 525 | # endif |
4b43d402 PE |
526 | # ifndef YYMALLOC |
527 | # define YYMALLOC malloc | |
8ff146cd | 528 | # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
bf8b3d98 | 529 | || defined __cplusplus || defined _MSC_VER) |
4b43d402 PE |
530 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
531 | # endif | |
532 | # endif | |
533 | # ifndef YYFREE | |
534 | # define YYFREE free | |
8ff146cd | 535 | # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
bf8b3d98 | 536 | || defined __cplusplus || defined _MSC_VER) |
4b43d402 PE |
537 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
538 | # endif | |
539 | # endif | |
e9955c83 | 540 | # endif |
107844a3 JD |
541 | # define YYCOPY_NEEDED 1 |
542 | #endif | |
e9955c83 AD |
543 | |
544 | ||
bf8b3d98 PE |
545 | #if (! defined yyoverflow \ |
546 | && (! defined __cplusplus \ | |
e9690142 JD |
547 | || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ |
548 | && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
e9955c83 AD |
549 | |
550 | /* A type that is properly aligned for any stack member. */ | |
551 | union yyalloc | |
552 | { | |
e021811a JD |
553 | yytype_int16 yyss_alloc; |
554 | YYSTYPE yyvs_alloc; | |
555 | YYLTYPE yyls_alloc; | |
e9955c83 AD |
556 | }; |
557 | ||
558 | /* The size of the maximum gap between one aligned stack and the next. */ | |
05d18c24 | 559 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
e9955c83 AD |
560 | |
561 | /* The size of an array large to enough to hold all stacks, each with | |
562 | N elements. */ | |
366eea36 | 563 | # define YYSTACK_BYTES(N) \ |
bf8b3d98 | 564 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
05d18c24 | 565 | + 2 * YYSTACK_GAP_MAXIMUM) |
e9955c83 | 566 | |
107844a3 | 567 | # define YYCOPY_NEEDED 1 |
e9955c83 AD |
568 | |
569 | /* Relocate STACK from its old location to the new one. The | |
570 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
571 | elements in the stack, and YYPTR gives the new location of the | |
572 | stack. Advance YYPTR to a properly aligned location for the next | |
573 | stack. */ | |
e9690142 JD |
574 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
575 | do \ | |
576 | { \ | |
577 | YYSIZE_T yynewbytes; \ | |
578 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | |
579 | Stack = &yyptr->Stack_alloc; \ | |
580 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
581 | yyptr += yynewbytes / sizeof (*yyptr); \ | |
582 | } \ | |
7029f892 | 583 | while (YYID (0)) |
e9955c83 AD |
584 | |
585 | #endif | |
586 | ||
107844a3 | 587 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
e7b94cc3 | 588 | /* Copy COUNT objects from SRC to DST. The source and destination do |
107844a3 JD |
589 | not overlap. */ |
590 | # ifndef YYCOPY | |
591 | # if defined __GNUC__ && 1 < __GNUC__ | |
e7b94cc3 AD |
592 | # define YYCOPY(Dst, Src, Count) \ |
593 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) | |
107844a3 | 594 | # else |
e7b94cc3 | 595 | # define YYCOPY(Dst, Src, Count) \ |
e9690142 JD |
596 | do \ |
597 | { \ | |
598 | YYSIZE_T yyi; \ | |
599 | for (yyi = 0; yyi < (Count); yyi++) \ | |
e7b94cc3 | 600 | (Dst)[yyi] = (Src)[yyi]; \ |
e9690142 | 601 | } \ |
107844a3 JD |
602 | while (YYID (0)) |
603 | # endif | |
604 | # endif | |
605 | #endif /* !YYCOPY_NEEDED */ | |
606 | ||
3b0ffc7e | 607 | /* YYFINAL -- State number of the termination state. */ |
1921f1d7 | 608 | #define YYFINAL 3 |
d33cb3ae | 609 | /* YYLAST -- Last index in YYTABLE. */ |
ca2a6d15 | 610 | #define YYLAST 163 |
1921f1d7 | 611 | |
3b0ffc7e | 612 | /* YYNTOKENS -- Number of terminals. */ |
ca2a6d15 | 613 | #define YYNTOKENS 57 |
3b0ffc7e | 614 | /* YYNNTS -- Number of nonterminals. */ |
dd875058 | 615 | #define YYNNTS 36 |
3b0ffc7e | 616 | /* YYNRULES -- Number of rules. */ |
ca2a6d15 | 617 | #define YYNRULES 110 |
086fd113 | 618 | /* YYNSTATES -- Number of states. */ |
ca2a6d15 | 619 | #define YYNSTATES 149 |
1921f1d7 | 620 | |
2df9ec37 AD |
621 | /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned |
622 | by yylex, with out-of-bounds checking. */ | |
1921f1d7 | 623 | #define YYUNDEFTOK 2 |
ca2a6d15 | 624 | #define YYMAXUTOK 311 |
1921f1d7 | 625 | |
e9690142 | 626 | #define YYTRANSLATE(YYX) \ |
73521d9f | 627 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
1921f1d7 | 628 | |
2df9ec37 AD |
629 | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
630 | as returned by yylex, without out-of-bounds checking. */ | |
bf8b3d98 | 631 | static const yytype_uint8 yytranslate[] = |
1921f1d7 AD |
632 | { |
633 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
634 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
635 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
636 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
637 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
638 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
639 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
640 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
641 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
642 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
643 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
644 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
645 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
646 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
647 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
648 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
649 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
650 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
651 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
652 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
653 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
654 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
655 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
656 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
657 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
658 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | |
659 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | |
660 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | |
661 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | |
ae7453f2 | 662 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
d70059ec | 663 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
ca2a6d15 | 664 | 55, 56 |
1921f1d7 AD |
665 | }; |
666 | ||
667 | #if YYDEBUG | |
dc450175 | 668 | /* YYRLINEYYN -- Source line where rule number YYN was defined. */ |
bf8b3d98 | 669 | static const yytype_uint16 yyrline[] = |
1921f1d7 | 670 | { |
398c298c AD |
671 | 0, 270, 270, 278, 280, 284, 285, 295, 299, 304, |
672 | 305, 310, 315, 316, 317, 318, 319, 324, 333, 334, | |
673 | 335, 336, 337, 338, 339, 340, 340, 341, 342, 366, | |
674 | 367, 368, 369, 373, 374, 383, 384, 385, 389, 396, | |
675 | 403, 407, 411, 418, 433, 434, 438, 450, 450, 455, | |
676 | 455, 460, 471, 486, 487, 488, 489, 493, 494, 499, | |
677 | 501, 506, 507, 512, 514, 519, 520, 524, 525, 526, | |
678 | 527, 532, 537, 542, 548, 554, 565, 566, 575, 576, | |
679 | 582, 583, 584, 591, 591, 599, 600, 601, 606, 608, | |
680 | 610, 612, 614, 616, 618, 623, 625, 635, 636, 641, | |
681 | 642, 643, 652, 672, 674, 683, 688, 689, 694, 701, | |
682 | 703 | |
1921f1d7 AD |
683 | }; |
684 | #endif | |
685 | ||
415b8823 | 686 | #if YYDEBUG || YYERROR_VERBOSE || 1 |
9cbfdc9e | 687 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
3b0ffc7e | 688 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
1921f1d7 AD |
689 | static const char *const yytname[] = |
690 | { | |
9cbfdc9e | 691 | "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"", |
e9071366 | 692 | "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"", |
f7398526 AD |
693 | "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", |
694 | "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"", | |
2f5b478e AD |
695 | "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"", |
696 | "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"", | |
697 | "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"", | |
b18cdd91 AD |
698 | "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"", |
699 | "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"", | |
700 | "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"", | |
ca2a6d15 PH |
701 | "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"", |
702 | "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", | |
703 | "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"", | |
704 | "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations", | |
dd875058 AD |
705 | "prologue_declaration", "$@1", "params", "grammar_declaration", |
706 | "union_name", "symbol_declaration", "$@2", "$@3", | |
707 | "precedence_declaration", "precedence_declarator", "tag.opt", | |
708 | "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist", | |
709 | "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar", | |
710 | "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs", | |
711 | "named_ref.opt", "variable", "content.opt", "braceless", "id", | |
398c298c | 712 | "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL |
1921f1d7 AD |
713 | }; |
714 | #endif | |
715 | ||
3d38c03a | 716 | # ifdef YYPRINT |
2df9ec37 AD |
717 | /* YYTOKNUM[NUM] -- (External) token number corresponding to the |
718 | (internal) symbol number NUM (which must be that of a token). */ | |
bf8b3d98 | 719 | static const yytype_uint16 yytoknum[] = |
1921f1d7 AD |
720 | { |
721 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
722 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | |
723 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | |
724 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |
d6328241 | 725 | 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, |
ca2a6d15 | 726 | 305, 306, 307, 308, 309, 310, 311 |
1921f1d7 | 727 | }; |
3d38c03a | 728 | # endif |
1921f1d7 | 729 | |
ca2a6d15 | 730 | #define YYPACT_NINF -50 |
1921f1d7 | 731 | |
f2b30bdf | 732 | #define yypact_value_is_default(yystate) \ |
ca2a6d15 | 733 | ((yystate) == (-50)) |
53f036ce | 734 | |
ca2a6d15 | 735 | #define YYTABLE_NINF -110 |
d12f8e49 | 736 | |
f2b30bdf | 737 | #define yytable_value_is_error(yytable_value) \ |
aa0cb40d | 738 | YYID (0) |
53f036ce | 739 | |
d12f8e49 AD |
740 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
741 | STATE-NUM. */ | |
742 | static const yytype_int16 yypact[] = | |
1921f1d7 | 743 | { |
ca2a6d15 PH |
744 | -50, 4, 107, -50, -50, -50, -20, 3, 11, -50, |
745 | -50, -50, -50, 14, -50, 12, 68, -50, 72, 73, | |
746 | -50, 0, -50, 45, 86, 2, -50, -50, -50, 17, | |
747 | 95, 96, 32, -50, -50, -50, 16, -50, -50, -50, | |
748 | 54, -50, -50, -50, -50, 49, -2, -2, 32, 27, | |
749 | 27, -50, 63, -50, -50, -50, 37, -50, -50, -50, | |
750 | -50, 101, -50, -50, -50, 103, -50, 104, -50, -50, | |
751 | -50, -50, -50, -50, -50, -50, 57, -50, 58, 1, | |
752 | -50, -50, 79, 70, -50, 63, -50, 32, -50, -50, | |
753 | -2, 64, -2, 32, -50, -50, -50, -50, 27, -50, | |
754 | -50, 27, -50, -50, -50, -50, -50, -50, -50, -50, | |
755 | -50, 78, -50, -50, -50, -50, -50, 83, -50, 32, | |
756 | -50, 143, -50, 145, -50, -50, -50, -50, -50, -50, | |
757 | -50, -50, -50, 43, 50, -50, -50, 32, 146, 97, | |
758 | 79, -50, 79, 50, -50, -50, -50, -50, -50 | |
1921f1d7 AD |
759 | }; |
760 | ||
110ef36a JD |
761 | /* YYDEFACT[S] -- default reduction number in state S. Performed when |
762 | YYTABLE does not specify something else to do. Zero means the default | |
763 | is an error. */ | |
bf8b3d98 | 764 | static const yytype_uint8 yydefact[] = |
1921f1d7 | 765 | { |
dd875058 AD |
766 | 3, 0, 0, 1, 49, 47, 0, 0, 0, 53, |
767 | 54, 55, 56, 0, 40, 0, 9, 11, 0, 0, | |
768 | 7, 0, 16, 0, 0, 0, 41, 21, 22, 0, | |
769 | 0, 0, 0, 29, 30, 31, 0, 6, 32, 25, | |
770 | 44, 4, 5, 36, 35, 57, 0, 0, 0, 0, | |
ca2a6d15 | 771 | 0, 102, 0, 42, 98, 97, 99, 10, 12, 13, |
dd875058 | 772 | 14, 0, 17, 18, 19, 0, 23, 0, 27, 28, |
ca2a6d15 PH |
773 | 108, 104, 103, 106, 37, 107, 0, 105, 0, 0, |
774 | 78, 80, 95, 0, 45, 0, 58, 0, 71, 76, | |
dd875058 | 775 | 50, 72, 48, 51, 63, 68, 69, 70, 38, 65, |
ca2a6d15 PH |
776 | 67, 39, 43, 101, 100, 8, 15, 20, 24, 82, |
777 | 81, 0, 79, 2, 96, 83, 34, 26, 46, 52, | |
778 | 59, 61, 77, 73, 74, 64, 66, 110, 88, 33, | |
dd875058 | 779 | 60, 62, 75, 84, 85, 88, 87, 0, 0, 0, |
ca2a6d15 | 780 | 95, 91, 95, 86, 92, 93, 94, 90, 89 |
1921f1d7 AD |
781 | }; |
782 | ||
d12f8e49 | 783 | /* YYPGOTO[NTERM-NUM]. */ |
b143f404 | 784 | static const yytype_int16 yypgoto[] = |
1921f1d7 | 785 | { |
ca2a6d15 PH |
786 | -50, -50, -50, -50, -50, -50, 149, -50, -50, -50, |
787 | -50, -50, -50, -50, -50, 33, -50, 106, -42, -4, | |
788 | 112, -50, 74, -50, -50, -50, 19, -45, -50, -50, | |
789 | -16, -8, -50, -32, -49, -50 | |
1921f1d7 AD |
790 | }; |
791 | ||
d12f8e49 | 792 | /* YYDEFGOTO[NTERM-NUM]. */ |
d70059ec | 793 | static const yytype_int16 yydefgoto[] = |
d12f8e49 | 794 | { |
dd875058 AD |
795 | -1, 1, 2, 41, 83, 117, 78, 85, 43, 47, |
796 | 46, 44, 45, 87, 119, 120, 93, 98, 99, 89, | |
797 | 90, 79, 80, 81, 128, 133, 134, 115, 56, 105, | |
798 | 53, 73, 82, 100, 75, 113 | |
d12f8e49 AD |
799 | }; |
800 | ||
801 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | |
802 | positive, shift that token. If negative, reduce the rule which | |
aa0cb40d | 803 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
2ce4ed68 | 804 | static const yytype_int16 yytable[] = |
1921f1d7 | 805 | { |
ca2a6d15 PH |
806 | 74, -109, 76, 60, 3, 64, 4, 5, 6, 7, |
807 | 8, 9, 10, 11, 12, 54, 94, 76, 13, 14, | |
808 | 66, 4, 5, 6, 7, 8, 9, 10, 11, 12, | |
809 | 70, 26, 48, 13, 14, 70, 102, 32, 91, 91, | |
810 | 103, 71, 124, 49, 72, 61, 26, 65, 77, 111, | |
811 | 88, 50, 32, 70, 51, 121, 126, 40, 55, 126, | |
812 | 52, 125, 67, 77, 137, 138, 139, 70, 123, 118, | |
813 | 71, 57, 40, 72, 132, 71, 58, 59, 72, 95, | |
814 | 96, 97, 91, 104, 91, 62, 122, 121, 122, 63, | |
815 | 140, 141, 135, 71, 136, 147, 72, 148, 68, 69, | |
816 | 84, 86, 142, 51, 106, 144, 107, 108, 109, 110, | |
817 | 116, 142, 4, 5, 6, 7, 8, 9, 10, 11, | |
818 | 12, 114, 127, 129, 13, 14, 15, 16, 17, 18, | |
819 | 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, | |
820 | 29, 30, 31, 32, 33, 34, 35, 131, 70, 146, | |
821 | 145, 42, 130, 112, 143, 36, 101, 37, 38, 92, | |
822 | 0, 0, 39, 40 | |
1921f1d7 AD |
823 | }; |
824 | ||
b18cdd91 | 825 | static const yytype_int16 yycheck[] = |
1921f1d7 | 826 | { |
ca2a6d15 | 827 | 32, 0, 1, 3, 0, 3, 5, 6, 7, 8, |
b143f404 | 828 | 9, 10, 11, 12, 13, 3, 48, 1, 17, 18, |
ca2a6d15 PH |
829 | 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, |
830 | 3, 30, 52, 17, 18, 3, 52, 36, 46, 47, | |
831 | 3, 43, 91, 40, 46, 45, 30, 45, 47, 48, | |
832 | 52, 40, 36, 3, 40, 87, 98, 56, 46, 101, | |
833 | 46, 93, 45, 47, 14, 15, 16, 3, 4, 85, | |
834 | 43, 3, 56, 46, 123, 43, 4, 4, 46, 52, | |
835 | 53, 54, 90, 46, 92, 40, 90, 119, 92, 3, | |
836 | 40, 41, 49, 43, 51, 140, 46, 142, 3, 3, | |
837 | 46, 52, 134, 40, 3, 137, 3, 3, 51, 51, | |
838 | 40, 143, 5, 6, 7, 8, 9, 10, 11, 12, | |
839 | 13, 42, 44, 40, 17, 18, 19, 20, 21, 22, | |
840 | 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, | |
841 | 33, 34, 35, 36, 37, 38, 39, 4, 3, 52, | |
842 | 4, 2, 119, 79, 135, 48, 50, 50, 51, 47, | |
843 | -1, -1, 55, 56 | |
1921f1d7 AD |
844 | }; |
845 | ||
d12f8e49 AD |
846 | /* STOS_[STATE-NUM] -- The (internal number of the) accessing |
847 | symbol of state STATE-NUM. */ | |
bf8b3d98 | 848 | static const yytype_uint8 yystos[] = |
1921f1d7 | 849 | { |
ca2a6d15 | 850 | 0, 58, 59, 0, 5, 6, 7, 8, 9, 10, |
3583d96b AD |
851 | 11, 12, 13, 17, 18, 19, 20, 21, 22, 23, |
852 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, | |
ca2a6d15 PH |
853 | 34, 35, 36, 37, 38, 39, 48, 50, 51, 55, |
854 | 56, 60, 63, 65, 68, 69, 67, 66, 52, 40, | |
855 | 40, 40, 46, 87, 3, 46, 85, 3, 4, 4, | |
856 | 3, 45, 40, 3, 3, 45, 3, 45, 3, 3, | |
857 | 3, 43, 46, 88, 90, 91, 1, 47, 63, 78, | |
858 | 79, 80, 89, 61, 46, 64, 52, 70, 52, 76, | |
859 | 77, 88, 77, 73, 90, 52, 53, 54, 74, 75, | |
860 | 90, 74, 87, 3, 46, 86, 3, 3, 3, 51, | |
861 | 51, 48, 79, 92, 42, 84, 40, 62, 87, 71, | |
862 | 72, 90, 76, 4, 91, 90, 75, 44, 81, 40, | |
863 | 72, 4, 91, 82, 83, 49, 51, 14, 15, 16, | |
864 | 40, 41, 90, 83, 90, 4, 52, 84, 84 | |
1921f1d7 | 865 | }; |
e9955c83 | 866 | |
d12f8e49 AD |
867 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
868 | static const yytype_uint8 yyr1[] = | |
869 | { | |
ca2a6d15 PH |
870 | 0, 57, 58, 59, 59, 60, 60, 60, 60, 60, |
871 | 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, | |
872 | 60, 60, 60, 60, 60, 61, 60, 60, 60, 60, | |
873 | 60, 60, 60, 62, 62, 63, 63, 63, 63, 63, | |
874 | 63, 63, 63, 63, 64, 64, 63, 66, 65, 67, | |
875 | 65, 65, 68, 69, 69, 69, 69, 70, 70, 71, | |
876 | 71, 72, 72, 73, 73, 74, 74, 75, 75, 75, | |
877 | 75, 76, 76, 76, 76, 76, 77, 77, 78, 78, | |
878 | 79, 79, 79, 81, 80, 82, 82, 82, 83, 83, | |
879 | 83, 83, 83, 83, 83, 84, 84, 85, 85, 86, | |
880 | 86, 86, 87, 88, 88, 89, 90, 90, 91, 92, | |
881 | 92 | |
d12f8e49 AD |
882 | }; |
883 | ||
884 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
885 | static const yytype_uint8 yyr2[] = | |
886 | { | |
887 | 0, 2, 4, 0, 2, 1, 1, 1, 3, 1, | |
2f5b478e | 888 | 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, |
dd875058 AD |
889 | 3, 1, 1, 2, 3, 0, 3, 2, 2, 1, |
890 | 1, 1, 1, 2, 1, 1, 1, 2, 3, 3, | |
891 | 1, 1, 2, 3, 0, 1, 3, 0, 3, 0, | |
892 | 3, 3, 3, 1, 1, 1, 1, 0, 1, 1, | |
893 | 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, | |
894 | 1, 1, 1, 2, 2, 3, 1, 2, 1, 2, | |
895 | 1, 2, 2, 0, 4, 1, 3, 2, 0, 3, | |
ca2a6d15 PH |
896 | 3, 2, 3, 3, 3, 0, 1, 1, 1, 0, |
897 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, | |
898 | 2 | |
d12f8e49 AD |
899 | }; |
900 | ||
901 | ||
e9690142 JD |
902 | #define yyerrok (yyerrstatus = 0) |
903 | #define yyclearin (yychar = YYEMPTY) | |
904 | #define YYEMPTY (-2) | |
905 | #define YYEOF 0 | |
1921f1d7 | 906 | |
e9690142 JD |
907 | #define YYACCEPT goto yyacceptlab |
908 | #define YYABORT goto yyabortlab | |
909 | #define YYERROR goto yyerrorlab | |
6d5aa694 | 910 | |
1921f1d7 | 911 | |
e9955c83 AD |
912 | /* Like YYERROR except do call yyerror. This remains here temporarily |
913 | to ease the transition to the new meaning of YYERROR, for GCC. | |
1625df5b JD |
914 | Once GCC version 2 has supplanted version 1, this can go. However, |
915 | YYFAIL appears to be in use. Nevertheless, it is formally deprecated | |
916 | in Bison 2.4.2's NEWS entry, where a plan to phase it out is | |
917 | discussed. */ | |
1921f1d7 | 918 | |
e9690142 | 919 | #define YYFAIL goto yyerrlab |
1625df5b JD |
920 | #if defined YYFAIL |
921 | /* This is here to suppress warnings from the GCC cpp's | |
922 | -Wunused-macros. Normally we don't worry about that warning, but | |
923 | some users do, and we want to make it easy for users to remove | |
924 | YYFAIL uses, which will produce warnings from Bison 2.5. */ | |
925 | #endif | |
1921f1d7 | 926 | |
e9955c83 | 927 | #define YYRECOVERING() (!!yyerrstatus) |
1921f1d7 | 928 | |
e9690142 JD |
929 | #define YYBACKUP(Token, Value) \ |
930 | do \ | |
d9b968d8 | 931 | if (yychar == YYEMPTY) \ |
e9690142 JD |
932 | { \ |
933 | yychar = (Token); \ | |
934 | yylval = (Value); \ | |
d9b968d8 AD |
935 | YYPOPSTACK (yylen); \ |
936 | yystate = *yyssp; \ | |
e9690142 JD |
937 | YY_LAC_DISCARD ("YYBACKUP"); \ |
938 | goto yybackup; \ | |
939 | } \ | |
940 | else \ | |
941 | { \ | |
6088a2a0 | 942 | yyerror (YY_("syntax error: cannot back up")); \ |
e9690142 JD |
943 | YYERROR; \ |
944 | } \ | |
7029f892 | 945 | while (YYID (0)) |
e9955c83 | 946 | |
8a8dc872 | 947 | |
e9690142 JD |
948 | #define YYTERROR 1 |
949 | #define YYERRCODE 256 | |
e9955c83 | 950 | |
8a8dc872 AD |
951 | |
952 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | |
953 | If N is 0, then set CURRENT to the empty location which ends | |
954 | the previous symbol: RHS[0] (always defined). */ | |
e9955c83 AD |
955 | |
956 | #ifndef YYLLOC_DEFAULT | |
e9690142 JD |
957 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
958 | do \ | |
a9439670 | 959 | if (YYID (N)) \ |
e9690142 JD |
960 | { \ |
961 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ | |
962 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ | |
963 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ | |
964 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ | |
965 | } \ | |
966 | else \ | |
967 | { \ | |
968 | (Current).first_line = (Current).last_line = \ | |
969 | YYRHSLOC (Rhs, 0).last_line; \ | |
970 | (Current).first_column = (Current).last_column = \ | |
971 | YYRHSLOC (Rhs, 0).last_column; \ | |
972 | } \ | |
7029f892 | 973 | while (YYID (0)) |
8a8dc872 AD |
974 | #endif |
975 | ||
a9439670 | 976 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
8a8dc872 AD |
977 | |
978 | /* YY_LOCATION_PRINT -- Print the location on the stream. | |
979 | This macro was not mandated originally: define only if we know | |
980 | we won't break user code: when these are the locations we know. */ | |
981 | ||
982 | #ifndef YY_LOCATION_PRINT | |
1625df5b | 983 | # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL |
e9690142 JD |
984 | # define YY_LOCATION_PRINT(File, Loc) \ |
985 | fprintf (File, "%d.%d-%d.%d", \ | |
986 | (Loc).first_line, (Loc).first_column, \ | |
987 | (Loc).last_line, (Loc).last_column) | |
8a8dc872 AD |
988 | # else |
989 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | |
990 | # endif | |
e9955c83 AD |
991 | #endif |
992 | ||
8a8dc872 | 993 | |
e9955c83 AD |
994 | /* YYLEX -- calling `yylex' with the right arguments. */ |
995 | ||
366eea36 | 996 | #ifdef YYLEX_PARAM |
d33cb3ae | 997 | # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) |
366eea36 | 998 | #else |
d33cb3ae | 999 | # define YYLEX yylex (&yylval, &yylloc) |
366eea36 | 1000 | #endif |
e9955c83 AD |
1001 | |
1002 | /* Enable debugging if requested. */ | |
1003 | #if YYDEBUG | |
1004 | ||
74e543d2 | 1005 | # ifndef YYFPRINTF |
e9955c83 AD |
1006 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
1007 | # define YYFPRINTF fprintf | |
1008 | # endif | |
1009 | ||
e9690142 JD |
1010 | # define YYDPRINTF(Args) \ |
1011 | do { \ | |
1012 | if (yydebug) \ | |
1013 | YYFPRINTF Args; \ | |
7029f892 | 1014 | } while (YYID (0)) |
05d18c24 | 1015 | |
e9690142 JD |
1016 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
1017 | do { \ | |
1018 | if (yydebug) \ | |
1019 | { \ | |
1020 | YYFPRINTF (stderr, "%s ", Title); \ | |
1021 | yy_symbol_print (stderr, \ | |
1022 | Type, Value, Location); \ | |
1023 | YYFPRINTF (stderr, "\n"); \ | |
1024 | } \ | |
7029f892 | 1025 | } while (YYID (0)) |
f0616f0b | 1026 | |
3b0ffc7e | 1027 | |
66809587 PE |
1028 | /*--------------------------------. |
1029 | | Print this symbol on YYOUTPUT. | | |
1030 | `--------------------------------*/ | |
1031 | ||
7029f892 | 1032 | /*ARGSUSED*/ |
bf8b3d98 PE |
1033 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1034 | || defined __cplusplus || defined _MSC_VER) | |
66809587 | 1035 | static void |
d2a1a60a | 1036 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) |
66809587 PE |
1037 | #else |
1038 | static void | |
3b0ffc7e | 1039 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) |
66809587 PE |
1040 | FILE *yyoutput; |
1041 | int yytype; | |
d2a1a60a PE |
1042 | YYSTYPE const * const yyvaluep; |
1043 | YYLTYPE const * const yylocationp; | |
66809587 PE |
1044 | #endif |
1045 | { | |
398c298c AD |
1046 | FILE *yyo = yyoutput; |
1047 | YYUSE(yyo); | |
d9b968d8 | 1048 | YYUSE (yylocationp); |
bf8b3d98 PE |
1049 | if (!yyvaluep) |
1050 | return; | |
66809587 PE |
1051 | # ifdef YYPRINT |
1052 | if (yytype < YYNTOKENS) | |
1053 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
1054 | # endif | |
1055 | switch (yytype) | |
1056 | { | |
dc450175 | 1057 | case 3: // "string" |
136a0f76 | 1058 | |
a9439670 | 1059 | /* Line 740 of yacc.c */ |
398c298c | 1060 | #line 194 "src/parse-gram.y" |
dc450175 | 1061 | { fputs (quotearg_style (c_quoting_style, ((*yyvaluep).chars)), stderr); } |
a9439670 | 1062 | /* Line 740 of yacc.c */ |
415b8823 | 1063 | #line 1064 "src/parse-gram.c" |
dc450175 | 1064 | break; |
136a0f76 | 1065 | |
dc450175 | 1066 | case 4: // "integer" |
136a0f76 | 1067 | |
a9439670 | 1068 | /* Line 740 of yacc.c */ |
398c298c | 1069 | #line 207 "src/parse-gram.y" |
dc450175 | 1070 | { fprintf (stderr, "%d", ((*yyvaluep).integer)); } |
a9439670 | 1071 | /* Line 740 of yacc.c */ |
415b8823 | 1072 | #line 1073 "src/parse-gram.c" |
86cfae0a AD |
1073 | break; |
1074 | ||
2f5b478e | 1075 | case 24: // "%<flag>" |
86cfae0a | 1076 | |
a9439670 | 1077 | /* Line 740 of yacc.c */ |
398c298c | 1078 | #line 203 "src/parse-gram.y" |
86cfae0a | 1079 | { fprintf (stderr, "%%%s", ((*yyvaluep).uniqstr)); } |
a9439670 | 1080 | /* Line 740 of yacc.c */ |
415b8823 | 1081 | #line 1082 "src/parse-gram.c" |
dc450175 | 1082 | break; |
136a0f76 | 1083 | |
b18cdd91 | 1084 | case 40: // "{...}" |
136a0f76 | 1085 | |
a9439670 | 1086 | /* Line 740 of yacc.c */ |
398c298c | 1087 | #line 196 "src/parse-gram.y" |
dc450175 | 1088 | { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).code)); } |
a9439670 | 1089 | /* Line 740 of yacc.c */ |
415b8823 | 1090 | #line 1091 "src/parse-gram.c" |
dc450175 | 1091 | break; |
136a0f76 | 1092 | |
ca2a6d15 | 1093 | case 42: // "[identifier]" |
b143f404 | 1094 | |
a9439670 | 1095 | /* Line 740 of yacc.c */ |
398c298c | 1096 | #line 201 "src/parse-gram.y" |
b143f404 | 1097 | { fprintf (stderr, "[%s]", ((*yyvaluep).uniqstr)); } |
a9439670 | 1098 | /* Line 740 of yacc.c */ |
415b8823 | 1099 | #line 1100 "src/parse-gram.c" |
b143f404 JD |
1100 | break; |
1101 | ||
ca2a6d15 | 1102 | case 43: // "char" |
136a0f76 | 1103 | |
a9439670 | 1104 | /* Line 740 of yacc.c */ |
398c298c | 1105 | #line 188 "src/parse-gram.y" |
dc450175 | 1106 | { fputs (char_name (((*yyvaluep).character)), stderr); } |
a9439670 | 1107 | /* Line 740 of yacc.c */ |
415b8823 | 1108 | #line 1109 "src/parse-gram.c" |
dc450175 | 1109 | break; |
136a0f76 | 1110 | |
ca2a6d15 | 1111 | case 44: // "epilogue" |
136a0f76 | 1112 | |
a9439670 | 1113 | /* Line 740 of yacc.c */ |
398c298c | 1114 | #line 196 "src/parse-gram.y" |
dc450175 | 1115 | { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); } |
a9439670 | 1116 | /* Line 740 of yacc.c */ |
415b8823 | 1117 | #line 1118 "src/parse-gram.c" |
dc450175 | 1118 | break; |
136a0f76 | 1119 | |
ca2a6d15 | 1120 | case 46: // "identifier" |
136a0f76 | 1121 | |
a9439670 | 1122 | /* Line 740 of yacc.c */ |
398c298c | 1123 | #line 200 "src/parse-gram.y" |
dc450175 | 1124 | { fputs (((*yyvaluep).uniqstr), stderr); } |
a9439670 | 1125 | /* Line 740 of yacc.c */ |
415b8823 | 1126 | #line 1127 "src/parse-gram.c" |
dc450175 | 1127 | break; |
136a0f76 | 1128 | |
ca2a6d15 | 1129 | case 47: // "identifier:" |
136a0f76 | 1130 | |
a9439670 | 1131 | /* Line 740 of yacc.c */ |
398c298c | 1132 | #line 202 "src/parse-gram.y" |
dc450175 | 1133 | { fprintf (stderr, "%s:", ((*yyvaluep).uniqstr)); } |
a9439670 | 1134 | /* Line 740 of yacc.c */ |
415b8823 | 1135 | #line 1136 "src/parse-gram.c" |
dc450175 | 1136 | break; |
136a0f76 | 1137 | |
ca2a6d15 | 1138 | case 50: // "%{...%}" |
136a0f76 | 1139 | |
a9439670 | 1140 | /* Line 740 of yacc.c */ |
398c298c | 1141 | #line 196 "src/parse-gram.y" |
dc450175 | 1142 | { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); } |
a9439670 | 1143 | /* Line 740 of yacc.c */ |
415b8823 | 1144 | #line 1145 "src/parse-gram.c" |
dc450175 | 1145 | break; |
136a0f76 | 1146 | |
ca2a6d15 | 1147 | case 52: // "<tag>" |
136a0f76 | 1148 | |
a9439670 | 1149 | /* Line 740 of yacc.c */ |
398c298c | 1150 | #line 204 "src/parse-gram.y" |
dc450175 | 1151 | { fprintf (stderr, "<%s>", ((*yyvaluep).uniqstr)); } |
a9439670 | 1152 | /* Line 740 of yacc.c */ |
415b8823 | 1153 | #line 1154 "src/parse-gram.c" |
b18cdd91 AD |
1154 | break; |
1155 | ||
ca2a6d15 | 1156 | case 55: // "%param" |
b18cdd91 | 1157 | |
a9439670 | 1158 | /* Line 740 of yacc.c */ |
398c298c | 1159 | #line 250 "src/parse-gram.y" |
b18cdd91 AD |
1160 | { |
1161 | switch (((*yyvaluep).param)) | |
1162 | { | |
1163 | #define CASE(In, Out) \ | |
dd875058 | 1164 | case param_ ## In: fputs ("%" #Out, stderr); break |
b18cdd91 AD |
1165 | CASE(lex, lex-param); |
1166 | CASE(parse, parse-param); | |
1167 | CASE(both, param); | |
b18cdd91 | 1168 | #undef CASE |
2d399888 | 1169 | case param_none: aver (false); break; |
dd875058 | 1170 | } |
b18cdd91 | 1171 | } |
a9439670 | 1172 | /* Line 740 of yacc.c */ |
415b8823 | 1173 | #line 1174 "src/parse-gram.c" |
b143f404 JD |
1174 | break; |
1175 | ||
ca2a6d15 | 1176 | case 72: // symbol.prec |
b143f404 | 1177 | |
a9439670 | 1178 | /* Line 740 of yacc.c */ |
398c298c | 1179 | #line 210 "src/parse-gram.y" |
b143f404 | 1180 | { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); } |
a9439670 | 1181 | /* Line 740 of yacc.c */ |
415b8823 | 1182 | #line 1183 "src/parse-gram.c" |
dc450175 | 1183 | break; |
136a0f76 | 1184 | |
ca2a6d15 | 1185 | case 85: // variable |
136a0f76 | 1186 | |
a9439670 | 1187 | /* Line 740 of yacc.c */ |
398c298c | 1188 | #line 200 "src/parse-gram.y" |
dc450175 | 1189 | { fputs (((*yyvaluep).uniqstr), stderr); } |
a9439670 | 1190 | /* Line 740 of yacc.c */ |
415b8823 | 1191 | #line 1192 "src/parse-gram.c" |
dc450175 | 1192 | break; |
136a0f76 | 1193 | |
ca2a6d15 | 1194 | case 86: // content.opt |
136a0f76 | 1195 | |
a9439670 | 1196 | /* Line 740 of yacc.c */ |
398c298c | 1197 | #line 196 "src/parse-gram.y" |
dc450175 | 1198 | { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); } |
a9439670 | 1199 | /* Line 740 of yacc.c */ |
415b8823 | 1200 | #line 1201 "src/parse-gram.c" |
dc450175 | 1201 | break; |
136a0f76 | 1202 | |
ca2a6d15 | 1203 | case 87: // braceless |
16dc6a9e | 1204 | |
a9439670 | 1205 | /* Line 740 of yacc.c */ |
398c298c | 1206 | #line 196 "src/parse-gram.y" |
dc450175 | 1207 | { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); } |
a9439670 | 1208 | /* Line 740 of yacc.c */ |
415b8823 | 1209 | #line 1210 "src/parse-gram.c" |
dc450175 | 1210 | break; |
16dc6a9e | 1211 | |
ca2a6d15 | 1212 | case 88: // id |
136a0f76 | 1213 | |
a9439670 | 1214 | /* Line 740 of yacc.c */ |
398c298c | 1215 | #line 210 "src/parse-gram.y" |
dc450175 | 1216 | { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); } |
a9439670 | 1217 | /* Line 740 of yacc.c */ |
415b8823 | 1218 | #line 1219 "src/parse-gram.c" |
dc450175 | 1219 | break; |
136a0f76 | 1220 | |
ca2a6d15 | 1221 | case 89: // id_colon |
136a0f76 | 1222 | |
a9439670 | 1223 | /* Line 740 of yacc.c */ |
398c298c | 1224 | #line 211 "src/parse-gram.y" |
dc450175 | 1225 | { fprintf (stderr, "%s:", ((*yyvaluep).symbol)->tag); } |
a9439670 | 1226 | /* Line 740 of yacc.c */ |
415b8823 | 1227 | #line 1228 "src/parse-gram.c" |
dc450175 | 1228 | break; |
136a0f76 | 1229 | |
ca2a6d15 | 1230 | case 90: // symbol |
136a0f76 | 1231 | |
a9439670 | 1232 | /* Line 740 of yacc.c */ |
398c298c | 1233 | #line 210 "src/parse-gram.y" |
dc450175 | 1234 | { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); } |
a9439670 | 1235 | /* Line 740 of yacc.c */ |
415b8823 | 1236 | #line 1237 "src/parse-gram.c" |
dc450175 | 1237 | break; |
136a0f76 | 1238 | |
ca2a6d15 | 1239 | case 91: // string_as_id |
136a0f76 | 1240 | |
a9439670 | 1241 | /* Line 740 of yacc.c */ |
398c298c | 1242 | #line 210 "src/parse-gram.y" |
dc450175 | 1243 | { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); } |
a9439670 | 1244 | /* Line 740 of yacc.c */ |
415b8823 | 1245 | #line 1246 "src/parse-gram.c" |
dc450175 | 1246 | break; |
136a0f76 | 1247 | |
66809587 | 1248 | default: |
e9690142 | 1249 | break; |
66809587 | 1250 | } |
3b0ffc7e PE |
1251 | } |
1252 | ||
1253 | ||
1254 | /*--------------------------------. | |
1255 | | Print this symbol on YYOUTPUT. | | |
1256 | `--------------------------------*/ | |
1257 | ||
bf8b3d98 PE |
1258 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1259 | || defined __cplusplus || defined _MSC_VER) | |
3b0ffc7e | 1260 | static void |
d2a1a60a | 1261 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) |
3b0ffc7e PE |
1262 | #else |
1263 | static void | |
1264 | yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp) | |
1265 | FILE *yyoutput; | |
1266 | int yytype; | |
d2a1a60a PE |
1267 | YYSTYPE const * const yyvaluep; |
1268 | YYLTYPE const * const yylocationp; | |
3b0ffc7e PE |
1269 | #endif |
1270 | { | |
1271 | if (yytype < YYNTOKENS) | |
1272 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); | |
1273 | else | |
1274 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); | |
1275 | ||
1276 | YY_LOCATION_PRINT (yyoutput, *yylocationp); | |
1277 | YYFPRINTF (yyoutput, ": "); | |
1278 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp); | |
66809587 PE |
1279 | YYFPRINTF (yyoutput, ")"); |
1280 | } | |
1281 | ||
05d18c24 PE |
1282 | /*------------------------------------------------------------------. |
1283 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
cd3684cf | 1284 | | TOP (included). | |
05d18c24 PE |
1285 | `------------------------------------------------------------------*/ |
1286 | ||
bf8b3d98 PE |
1287 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1288 | || defined __cplusplus || defined _MSC_VER) | |
05d18c24 | 1289 | static void |
3b452f4e | 1290 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
05d18c24 PE |
1291 | #else |
1292 | static void | |
3b452f4e JD |
1293 | yy_stack_print (yybottom, yytop) |
1294 | yytype_int16 *yybottom; | |
1295 | yytype_int16 *yytop; | |
05d18c24 PE |
1296 | #endif |
1297 | { | |
74e543d2 | 1298 | YYFPRINTF (stderr, "Stack now"); |
3b452f4e JD |
1299 | for (; yybottom <= yytop; yybottom++) |
1300 | { | |
1301 | int yybot = *yybottom; | |
1302 | YYFPRINTF (stderr, " %d", yybot); | |
1303 | } | |
74e543d2 | 1304 | YYFPRINTF (stderr, "\n"); |
05d18c24 PE |
1305 | } |
1306 | ||
e9690142 JD |
1307 | # define YY_STACK_PRINT(Bottom, Top) \ |
1308 | do { \ | |
1309 | if (yydebug) \ | |
1310 | yy_stack_print ((Bottom), (Top)); \ | |
7029f892 | 1311 | } while (YYID (0)) |
05d18c24 PE |
1312 | |
1313 | ||
1314 | /*------------------------------------------------. | |
1315 | | Report that the YYRULE is going to be reduced. | | |
1316 | `------------------------------------------------*/ | |
1317 | ||
bf8b3d98 PE |
1318 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1319 | || defined __cplusplus || defined _MSC_VER) | |
05d18c24 | 1320 | static void |
d12f8e49 | 1321 | yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) |
05d18c24 PE |
1322 | #else |
1323 | static void | |
d12f8e49 AD |
1324 | yy_reduce_print (yyssp, yyvsp, yylsp, yyrule) |
1325 | yytype_int16 *yyssp; | |
66809587 PE |
1326 | YYSTYPE *yyvsp; |
1327 | YYLTYPE *yylsp; | |
05d18c24 PE |
1328 | int yyrule; |
1329 | #endif | |
1330 | { | |
d12f8e49 | 1331 | unsigned long int yylno = yyrline[yyrule]; |
66809587 | 1332 | int yynrhs = yyr2[yyrule]; |
05d18c24 | 1333 | int yyi; |
66809587 | 1334 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
d12f8e49 | 1335 | yyrule - 1, yylno); |
66809587 PE |
1336 | /* The symbols being reduced. */ |
1337 | for (yyi = 0; yyi < yynrhs; yyi++) | |
1338 | { | |
0bf92491 | 1339 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
d12f8e49 AD |
1340 | yy_symbol_print (stderr, |
1341 | yystos[yyssp[yyi + 1 - yynrhs]], | |
1342 | &(yyvsp[(yyi + 1) - (yynrhs)]) | |
1343 | , &(yylsp[(yyi + 1) - (yynrhs)]) ); | |
0bf92491 | 1344 | YYFPRINTF (stderr, "\n"); |
66809587 | 1345 | } |
05d18c24 PE |
1346 | } |
1347 | ||
e9690142 JD |
1348 | # define YY_REDUCE_PRINT(Rule) \ |
1349 | do { \ | |
1350 | if (yydebug) \ | |
d12f8e49 | 1351 | yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \ |
7029f892 | 1352 | } while (YYID (0)) |
05d18c24 | 1353 | |
e9955c83 AD |
1354 | /* Nonzero means print parse trace. It is left uninitialized so that |
1355 | multiple parsers can coexist. */ | |
1356 | int yydebug; | |
1357 | #else /* !YYDEBUG */ | |
1358 | # define YYDPRINTF(Args) | |
8a8dc872 | 1359 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
05d18c24 PE |
1360 | # define YY_STACK_PRINT(Bottom, Top) |
1361 | # define YY_REDUCE_PRINT(Rule) | |
e9955c83 AD |
1362 | #endif /* !YYDEBUG */ |
1363 | ||
05d18c24 | 1364 | |
e9955c83 | 1365 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
e9690142 | 1366 | #ifndef YYINITDEPTH |
e9955c83 AD |
1367 | # define YYINITDEPTH 200 |
1368 | #endif | |
1369 | ||
1370 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only | |
1371 | if the built-in stack extension method is used). | |
1372 | ||
1373 | Do not make this value too large; the results are undefined if | |
2ce37586 | 1374 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
e9955c83 AD |
1375 | evaluated with infinite-precision integer arithmetic. */ |
1376 | ||
e9955c83 AD |
1377 | #ifndef YYMAXDEPTH |
1378 | # define YYMAXDEPTH 10000 | |
1379 | #endif | |
1921f1d7 | 1380 | |
107844a3 JD |
1381 | /* Given a state stack such that *YYBOTTOM is its bottom, such that |
1382 | *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty | |
1383 | stack, and such that *YYCAPACITY is the maximum number of elements it | |
1384 | can hold without a reallocation, make sure there is enough room to | |
1385 | store YYADD more elements. If not, allocate a new stack using | |
1386 | YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM, | |
1387 | *YYTOP, and *YYCAPACITY to reflect the new capacity and memory | |
1388 | location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack | |
1389 | using YYSTACK_FREE. Return 0 if successful or if no reallocation is | |
1390 | required. Return 1 if memory is exhausted. */ | |
1391 | static int | |
1392 | yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd, | |
1393 | #if YYDEBUG | |
1394 | char const *yydebug_prefix, | |
1395 | char const *yydebug_suffix, | |
1396 | #endif | |
1397 | yytype_int16 **yybottom, | |
1398 | yytype_int16 *yybottom_no_free, | |
1399 | yytype_int16 **yytop, yytype_int16 *yytop_empty) | |
1400 | { | |
1401 | YYSIZE_T yysize_old = | |
1402 | *yytop == yytop_empty ? 0 : *yytop - *yybottom + 1; | |
1403 | YYSIZE_T yysize_new = yysize_old + yyadd; | |
1404 | if (*yycapacity < yysize_new) | |
1405 | { | |
1406 | YYSIZE_T yyalloc = 2 * yysize_new; | |
1407 | yytype_int16 *yybottom_new; | |
1408 | /* Use YYMAXDEPTH for maximum stack size given that the stack | |
1409 | should never need to grow larger than the main state stack | |
1410 | needs to grow without LAC. */ | |
1411 | if (YYMAXDEPTH < yysize_new) | |
1412 | { | |
1413 | YYDPRINTF ((stderr, "%smax size exceeded%s", yydebug_prefix, | |
1414 | yydebug_suffix)); | |
1415 | return 1; | |
1416 | } | |
1417 | if (YYMAXDEPTH < yyalloc) | |
1418 | yyalloc = YYMAXDEPTH; | |
1419 | yybottom_new = | |
1420 | (yytype_int16*) YYSTACK_ALLOC (yyalloc * sizeof *yybottom_new); | |
1421 | if (!yybottom_new) | |
1422 | { | |
1423 | YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix, | |
1424 | yydebug_suffix)); | |
1425 | return 1; | |
1426 | } | |
1427 | if (*yytop != yytop_empty) | |
1428 | { | |
1429 | YYCOPY (yybottom_new, *yybottom, yysize_old); | |
1430 | *yytop = yybottom_new + (yysize_old - 1); | |
1431 | } | |
1432 | if (*yybottom != yybottom_no_free) | |
1433 | YYSTACK_FREE (*yybottom); | |
1434 | *yybottom = yybottom_new; | |
1435 | *yycapacity = yyalloc; | |
1436 | } | |
1437 | return 0; | |
1438 | } | |
1439 | ||
1440 | /* Establish the initial context for the current lookahead if no initial | |
1441 | context is currently established. | |
1442 | ||
1443 | We define a context as a snapshot of the parser stacks. We define | |
1444 | the initial context for a lookahead as the context in which the | |
1445 | parser initially examines that lookahead in order to select a | |
1446 | syntactic action. Thus, if the lookahead eventually proves | |
1447 | syntactically unacceptable (possibly in a later context reached via a | |
1448 | series of reductions), the initial context can be used to determine | |
1449 | the exact set of tokens that would be syntactically acceptable in the | |
1450 | lookahead's place. Moreover, it is the context after which any | |
1451 | further semantic actions would be erroneous because they would be | |
1452 | determined by a syntactically unacceptable token. | |
1453 | ||
1454 | YY_LAC_ESTABLISH should be invoked when a reduction is about to be | |
1455 | performed in an inconsistent state (which, for the purposes of LAC, | |
1456 | includes consistent states that don't know they're consistent because | |
1457 | their default reductions have been disabled). Iff there is a | |
1458 | lookahead token, it should also be invoked before reporting a syntax | |
1459 | error. This latter case is for the sake of the debugging output. | |
1460 | ||
1461 | For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as | |
1462 | follows. If no initial context is currently established for the | |
1463 | current lookahead, then check if that lookahead can eventually be | |
1464 | shifted if syntactic actions continue from the current context. | |
1465 | Report a syntax error if it cannot. */ | |
1466 | #define YY_LAC_ESTABLISH \ | |
1467 | do { \ | |
1468 | if (!yy_lac_established) \ | |
1469 | { \ | |
1470 | YYDPRINTF ((stderr, \ | |
1471 | "LAC: initial context established for %s\n", \ | |
1472 | yytname[yytoken])); \ | |
1473 | yy_lac_established = 1; \ | |
1474 | { \ | |
1475 | int yy_lac_status = \ | |
1476 | yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \ | |
1477 | if (yy_lac_status == 2) \ | |
1478 | goto yyexhaustedlab; \ | |
1479 | if (yy_lac_status == 1) \ | |
1480 | goto yyerrlab; \ | |
1481 | } \ | |
1482 | } \ | |
1483 | } while (YYID (0)) | |
1484 | ||
1485 | /* Discard any previous initial lookahead context because of Event, | |
1486 | which may be a lookahead change or an invalidation of the currently | |
1487 | established initial context for the current lookahead. | |
1488 | ||
1489 | The most common example of a lookahead change is a shift. An example | |
1490 | of both cases is syntax error recovery. That is, a syntax error | |
1491 | occurs when the lookahead is syntactically erroneous for the | |
1492 | currently established initial context, so error recovery manipulates | |
1493 | the parser stacks to try to find a new initial context in which the | |
1494 | current lookahead is syntactically acceptable. If it fails to find | |
1495 | such a context, it discards the lookahead. */ | |
1496 | #if YYDEBUG | |
1497 | # define YY_LAC_DISCARD(Event) \ | |
1498 | do { \ | |
1499 | if (yy_lac_established) \ | |
1500 | { \ | |
1501 | if (yydebug) \ | |
1502 | YYFPRINTF (stderr, "LAC: initial context discarded due to " \ | |
1503 | Event "\n"); \ | |
1504 | yy_lac_established = 0; \ | |
1505 | } \ | |
1506 | } while (YYID (0)) | |
1507 | #else | |
1508 | # define YY_LAC_DISCARD(Event) yy_lac_established = 0 | |
1509 | #endif | |
1510 | ||
1511 | /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can | |
1512 | eventually (after perhaps some reductions) be shifted, return 1 if | |
1513 | not, or return 2 if memory is exhausted. As preconditions and | |
1514 | postconditions: *YYES_CAPACITY is the allocated size of the array to | |
1515 | which *YYES points, and either *YYES = YYESA or *YYES points to an | |
1516 | array allocated with YYSTACK_ALLOC. yy_lac may overwrite the | |
1517 | contents of either array, alter *YYES and *YYES_CAPACITY, and free | |
1518 | any old *YYES other than YYESA. */ | |
1519 | static int | |
1520 | yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes, | |
1521 | YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken) | |
1522 | { | |
1523 | yytype_int16 *yyes_prev = yyssp; | |
1524 | yytype_int16 *yyesp = yyes_prev; | |
1525 | YYDPRINTF ((stderr, "LAC: checking lookahead %s:", yytname[yytoken])); | |
1526 | if (yytoken == YYUNDEFTOK) | |
1527 | { | |
1528 | YYDPRINTF ((stderr, " Always Err\n")); | |
1529 | return 1; | |
1530 | } | |
1531 | while (1) | |
1532 | { | |
1533 | int yyrule = yypact[*yyesp]; | |
1534 | if (yypact_value_is_default (yyrule) | |
1535 | || (yyrule += yytoken) < 0 || YYLAST < yyrule | |
1536 | || yycheck[yyrule] != yytoken) | |
1537 | { | |
1538 | yyrule = yydefact[*yyesp]; | |
1539 | if (yyrule == 0) | |
1540 | { | |
1541 | YYDPRINTF ((stderr, " Err\n")); | |
1542 | return 1; | |
1543 | } | |
1544 | } | |
1545 | else | |
1546 | { | |
1547 | yyrule = yytable[yyrule]; | |
1548 | if (yytable_value_is_error (yyrule)) | |
1549 | { | |
1550 | YYDPRINTF ((stderr, " Err\n")); | |
1551 | return 1; | |
1552 | } | |
1553 | if (0 < yyrule) | |
1554 | { | |
1555 | YYDPRINTF ((stderr, " S%d\n", yyrule)); | |
1556 | return 0; | |
1557 | } | |
1558 | yyrule = -yyrule; | |
1559 | } | |
1560 | { | |
1561 | YYSIZE_T yylen = yyr2[yyrule]; | |
1562 | YYDPRINTF ((stderr, " R%d", yyrule - 1)); | |
1563 | if (yyesp != yyes_prev) | |
1564 | { | |
1565 | YYSIZE_T yysize = yyesp - *yyes + 1; | |
1566 | if (yylen < yysize) | |
1567 | { | |
1568 | yyesp -= yylen; | |
1569 | yylen = 0; | |
1570 | } | |
1571 | else | |
1572 | { | |
1573 | yylen -= yysize; | |
1574 | yyesp = yyes_prev; | |
1575 | } | |
1576 | } | |
1577 | if (yylen) | |
1578 | yyesp = yyes_prev -= yylen; | |
1579 | } | |
1580 | { | |
1581 | int yystate; | |
1582 | { | |
1583 | int yylhs = yyr1[yyrule] - YYNTOKENS; | |
1584 | yystate = yypgoto[yylhs] + *yyesp; | |
1585 | if (yystate < 0 || YYLAST < yystate | |
1586 | || yycheck[yystate] != *yyesp) | |
1587 | yystate = yydefgoto[yylhs]; | |
1588 | else | |
1589 | yystate = yytable[yystate]; | |
1590 | } | |
1591 | if (yyesp == yyes_prev) | |
1592 | { | |
1593 | yyesp = *yyes; | |
1594 | *yyesp = yystate; | |
1595 | } | |
1596 | else | |
1597 | { | |
1598 | if (yy_lac_stack_realloc (yyes_capacity, 1, | |
1599 | #if YYDEBUG | |
1600 | " (", ")", | |
1601 | #endif | |
1602 | yyes, yyesa, &yyesp, yyes_prev)) | |
1603 | { | |
1604 | YYDPRINTF ((stderr, "\n")); | |
1605 | return 2; | |
1606 | } | |
1607 | *++yyesp = yystate; | |
1608 | } | |
3c9b20ff | 1609 | YYDPRINTF ((stderr, " G%d", yystate)); |
107844a3 JD |
1610 | } |
1611 | } | |
1612 | } | |
1613 | ||
1921f1d7 AD |
1614 | |
1615 | #if YYERROR_VERBOSE | |
e9955c83 AD |
1616 | |
1617 | # ifndef yystrlen | |
bf8b3d98 | 1618 | # if defined __GLIBC__ && defined _STRING_H |
e9955c83 AD |
1619 | # define yystrlen strlen |
1620 | # else | |
1621 | /* Return the length of YYSTR. */ | |
bf8b3d98 PE |
1622 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1623 | || defined __cplusplus || defined _MSC_VER) | |
e9955c83 | 1624 | static YYSIZE_T |
e9955c83 | 1625 | yystrlen (const char *yystr) |
2e4c30fa PE |
1626 | #else |
1627 | static YYSIZE_T | |
e9955c83 | 1628 | yystrlen (yystr) |
2e4c30fa PE |
1629 | const char *yystr; |
1630 | #endif | |
e9955c83 | 1631 | { |
7029f892 PE |
1632 | YYSIZE_T yylen; |
1633 | for (yylen = 0; yystr[yylen]; yylen++) | |
e9955c83 | 1634 | continue; |
7029f892 | 1635 | return yylen; |
e9955c83 AD |
1636 | } |
1637 | # endif | |
1638 | # endif | |
1639 | ||
1640 | # ifndef yystpcpy | |
bf8b3d98 | 1641 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
e9955c83 AD |
1642 | # define yystpcpy stpcpy |
1643 | # else | |
1644 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
1645 | YYDEST. */ | |
bf8b3d98 PE |
1646 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1647 | || defined __cplusplus || defined _MSC_VER) | |
e9955c83 | 1648 | static char * |
e9955c83 | 1649 | yystpcpy (char *yydest, const char *yysrc) |
2e4c30fa PE |
1650 | #else |
1651 | static char * | |
e9955c83 | 1652 | yystpcpy (yydest, yysrc) |
2e4c30fa PE |
1653 | char *yydest; |
1654 | const char *yysrc; | |
1655 | #endif | |
e9955c83 | 1656 | { |
b4fb989f PE |
1657 | char *yyd = yydest; |
1658 | const char *yys = yysrc; | |
e9955c83 AD |
1659 | |
1660 | while ((*yyd++ = *yys++) != '\0') | |
1661 | continue; | |
1662 | ||
1663 | return yyd - 1; | |
1664 | } | |
1665 | # endif | |
1666 | # endif | |
0c15323d | 1667 | |
9cbfdc9e PE |
1668 | # ifndef yytnamerr |
1669 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary | |
1670 | quotes and backslashes, so that it's suitable for yyerror. The | |
1671 | heuristic is that double-quoting is unnecessary unless the string | |
1672 | contains an apostrophe, a comma, or backslash (other than | |
1673 | backslash-backslash). YYSTR is taken from yytname. If YYRES is | |
1674 | null, do not copy; instead, return the length of what the result | |
1675 | would have been. */ | |
1676 | static YYSIZE_T | |
1677 | yytnamerr (char *yyres, const char *yystr) | |
1678 | { | |
1679 | if (*yystr == '"') | |
1680 | { | |
d2a1a60a | 1681 | YYSIZE_T yyn = 0; |
9cbfdc9e PE |
1682 | char const *yyp = yystr; |
1683 | ||
1684 | for (;;) | |
e9690142 JD |
1685 | switch (*++yyp) |
1686 | { | |
1687 | case '\'': | |
1688 | case ',': | |
1689 | goto do_not_strip_quotes; | |
1690 | ||
1691 | case '\\': | |
1692 | if (*++yyp != '\\') | |
1693 | goto do_not_strip_quotes; | |
1694 | /* Fall through. */ | |
1695 | default: | |
1696 | if (yyres) | |
1697 | yyres[yyn] = *yyp; | |
1698 | yyn++; | |
1699 | break; | |
1700 | ||
1701 | case '"': | |
1702 | if (yyres) | |
1703 | yyres[yyn] = '\0'; | |
1704 | return yyn; | |
1705 | } | |
9cbfdc9e PE |
1706 | do_not_strip_quotes: ; |
1707 | } | |
1708 | ||
1709 | if (! yyres) | |
1710 | return yystrlen (yystr); | |
1711 | ||
1712 | return yystpcpy (yyres, yystr) - yyres; | |
1713 | } | |
1714 | # endif | |
1715 | ||
45319f13 | 1716 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
bf35c71c | 1717 | about the unexpected token YYTOKEN for the state stack whose top is |
107844a3 JD |
1718 | YYSSP. In order to see if a particular token T is a |
1719 | valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T). | |
45319f13 | 1720 | |
d2060f06 JD |
1721 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
1722 | not large enough to hold the message. In that case, also set | |
1723 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the | |
107844a3 JD |
1724 | required number of bytes is too large to store or if |
1725 | yy_lac returned 2. */ | |
45319f13 JD |
1726 | static int |
1727 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |
107844a3 JD |
1728 | yytype_int16 *yyesa, yytype_int16 **yyes, |
1729 | YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken) | |
b4bbc4a0 | 1730 | { |
398c298c | 1731 | YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); |
b4bbc4a0 JD |
1732 | YYSIZE_T yysize = yysize0; |
1733 | YYSIZE_T yysize1; | |
1734 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | |
1735 | /* Internationalized format string. */ | |
398c298c | 1736 | const char *yyformat = YY_NULL; |
b4bbc4a0 JD |
1737 | /* Arguments of yyformat. */ |
1738 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |
d2060f06 JD |
1739 | /* Number of reported tokens (one for the "unexpected", one per |
1740 | "expected"). */ | |
1741 | int yycount = 0; | |
b4bbc4a0 | 1742 | |
d2060f06 JD |
1743 | /* There are many possibilities here to consider: |
1744 | - Assume YYFAIL is not used. It's too flawed to consider. See | |
1745 | <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> | |
1746 | for details. YYERROR is fine as it does not invoke this | |
1747 | function. | |
1748 | - If this state is a consistent state with a default action, then | |
1749 | the only way this function was invoked is if the default action | |
1750 | is an error action. In that case, don't check for expected | |
1751 | tokens because there are none. | |
1752 | - The only way there can be no lookahead present (in yychar) is if | |
1753 | this state is a consistent state with a default action. Thus, | |
1754 | detecting the absence of a lookahead is sufficient to determine | |
1755 | that there is no unexpected or expected token to report. In that | |
1756 | case, just report a simple "syntax error". | |
1757 | - Don't assume there isn't a lookahead just because this state is a | |
1758 | consistent state with a default action. There might have been a | |
1759 | previous inconsistent state, consistent state with a non-default | |
1760 | action, or user semantic action that manipulated yychar. | |
107844a3 JD |
1761 | In the first two cases, it might appear that the current syntax |
1762 | error should have been detected in the previous state when yy_lac | |
1763 | was invoked. However, at that time, there might have been a | |
1764 | different syntax error that discarded a different initial context | |
1765 | during error recovery, leaving behind the current lookahead. | |
d2060f06 JD |
1766 | */ |
1767 | if (yytoken != YYEMPTY) | |
1768 | { | |
bf35c71c | 1769 | int yyn = yypact[*yyssp]; |
107844a3 | 1770 | YYDPRINTF ((stderr, "Constructing syntax error message\n")); |
d2060f06 JD |
1771 | yyarg[yycount++] = yytname[yytoken]; |
1772 | if (!yypact_value_is_default (yyn)) | |
1773 | { | |
b4bbc4a0 | 1774 | int yyx; |
bf35c71c | 1775 | |
107844a3 JD |
1776 | for (yyx = 0; yyx < YYNTOKENS; ++yyx) |
1777 | if (yyx != YYTERROR && yyx != YYUNDEFTOK) | |
b4bbc4a0 | 1778 | { |
107844a3 JD |
1779 | { |
1780 | int yy_lac_status = yy_lac (yyesa, yyes, yyes_capacity, | |
1781 | yyssp, yyx); | |
1782 | if (yy_lac_status == 2) | |
1783 | return 2; | |
1784 | if (yy_lac_status == 1) | |
1785 | continue; | |
1786 | } | |
b4bbc4a0 JD |
1787 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
1788 | { | |
1789 | yycount = 1; | |
1790 | yysize = yysize0; | |
1791 | break; | |
1792 | } | |
1793 | yyarg[yycount++] = yytname[yyx]; | |
398c298c | 1794 | yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); |
d2060f06 JD |
1795 | if (! (yysize <= yysize1 |
1796 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1797 | return 2; | |
b4bbc4a0 JD |
1798 | yysize = yysize1; |
1799 | } | |
d2060f06 | 1800 | } |
107844a3 JD |
1801 | # if YYDEBUG |
1802 | else if (yydebug) | |
1803 | YYFPRINTF (stderr, "No expected tokens.\n"); | |
1804 | # endif | |
d2060f06 | 1805 | } |
b4bbc4a0 JD |
1806 | |
1807 | switch (yycount) | |
2abdfeef | 1808 | { |
bf35c71c | 1809 | # define YYCASE_(N, S) \ |
b4bbc4a0 JD |
1810 | case N: \ |
1811 | yyformat = S; \ | |
1812 | break | |
d2060f06 | 1813 | YYCASE_(0, YY_("syntax error")); |
b4bbc4a0 JD |
1814 | YYCASE_(1, YY_("syntax error, unexpected %s")); |
1815 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | |
1816 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | |
1817 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | |
1818 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | |
bf35c71c | 1819 | # undef YYCASE_ |
b4bbc4a0 | 1820 | } |
dc450175 | 1821 | |
b4bbc4a0 JD |
1822 | yysize1 = yysize + yystrlen (yyformat); |
1823 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
d2060f06 | 1824 | return 2; |
b4bbc4a0 JD |
1825 | yysize = yysize1; |
1826 | ||
1827 | if (*yymsg_alloc < yysize) | |
1828 | { | |
1829 | *yymsg_alloc = 2 * yysize; | |
1830 | if (! (yysize <= *yymsg_alloc | |
1831 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) | |
1832 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; | |
d2060f06 | 1833 | return 1; |
b4bbc4a0 JD |
1834 | } |
1835 | ||
1836 | /* Avoid sprintf, as that infringes on the user's name space. | |
1837 | Don't have undefined behavior even if the translation | |
1838 | produced a string with the wrong number of "%s"s. */ | |
1839 | { | |
1840 | char *yyp = *yymsg; | |
1841 | int yyi = 0; | |
1842 | while ((*yyp = *yyformat) != '\0') | |
1843 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | |
45319f13 | 1844 | { |
b4bbc4a0 JD |
1845 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
1846 | yyformat += 2; | |
45319f13 | 1847 | } |
b4bbc4a0 | 1848 | else |
45319f13 | 1849 | { |
b4bbc4a0 JD |
1850 | yyp++; |
1851 | yyformat++; | |
45319f13 | 1852 | } |
b4bbc4a0 JD |
1853 | } |
1854 | return 0; | |
1855 | } | |
2abdfeef | 1856 | #endif /* YYERROR_VERBOSE */ |
e9955c83 | 1857 | |
04b6e11e PE |
1858 | /*-----------------------------------------------. |
1859 | | Release the memory associated to this symbol. | | |
1860 | `-----------------------------------------------*/ | |
1861 | ||
7029f892 | 1862 | /*ARGSUSED*/ |
bf8b3d98 PE |
1863 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1864 | || defined __cplusplus || defined _MSC_VER) | |
d33cb3ae | 1865 | static void |
8a8dc872 | 1866 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) |
04b6e11e | 1867 | #else |
d33cb3ae | 1868 | static void |
8a8dc872 AD |
1869 | yydestruct (yymsg, yytype, yyvaluep, yylocationp) |
1870 | const char *yymsg; | |
04b6e11e | 1871 | int yytype; |
886b69d1 AD |
1872 | YYSTYPE *yyvaluep; |
1873 | YYLTYPE *yylocationp; | |
04b6e11e PE |
1874 | #endif |
1875 | { | |
d9b968d8 | 1876 | YYUSE(yyvaluep); |
e764d4df | 1877 | YYUSE (yylocationp); |
8a8dc872 AD |
1878 | if (!yymsg) |
1879 | yymsg = "Deleting"; | |
1880 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
1881 | ||
04b6e11e PE |
1882 | switch (yytype) |
1883 | { | |
1884 | default: | |
e9690142 | 1885 | break; |
04b6e11e PE |
1886 | } |
1887 | } | |
04b6e11e | 1888 | |
bb31eb56 | 1889 | |
e776192e | 1890 | |
e9955c83 | 1891 | |
bb31eb56 JD |
1892 | /*----------. |
1893 | | yyparse. | | |
1894 | `----------*/ | |
d33cb3ae PE |
1895 | |
1896 | #ifdef YYPARSE_PARAM | |
bf8b3d98 PE |
1897 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1898 | || defined __cplusplus || defined _MSC_VER) | |
2e4c30fa PE |
1899 | int |
1900 | yyparse (void *YYPARSE_PARAM) | |
1901 | #else | |
1902 | int | |
1903 | yyparse (YYPARSE_PARAM) | |
1904 | void *YYPARSE_PARAM; | |
1905 | #endif | |
d33cb3ae | 1906 | #else /* ! YYPARSE_PARAM */ |
bf8b3d98 PE |
1907 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1908 | || defined __cplusplus || defined _MSC_VER) | |
d33cb3ae PE |
1909 | int |
1910 | yyparse (void) | |
1911 | #else | |
e9955c83 | 1912 | int |
d33cb3ae | 1913 | yyparse () |
74e543d2 | 1914 | |
d33cb3ae PE |
1915 | #endif |
1916 | #endif | |
e9955c83 | 1917 | { |
e021811a | 1918 | /* The lookahead symbol. */ |
366eea36 AD |
1919 | int yychar; |
1920 | ||
9bc0dd67 | 1921 | /* The semantic value of the lookahead symbol. */ |
366eea36 AD |
1922 | YYSTYPE yylval; |
1923 | ||
9bc0dd67 | 1924 | /* Location data for the lookahead symbol. */ |
366eea36 | 1925 | YYLTYPE yylloc; |
e9955c83 | 1926 | |
e021811a JD |
1927 | /* Number of syntax errors so far. */ |
1928 | int yynerrs; | |
e9955c83 | 1929 | |
e021811a JD |
1930 | int yystate; |
1931 | /* Number of tokens to shift before error messages enabled. */ | |
1932 | int yyerrstatus; | |
e9955c83 | 1933 | |
e021811a JD |
1934 | /* The stacks and their tools: |
1935 | `yyss': related to states. | |
1936 | `yyvs': related to semantic values. | |
1937 | `yyls': related to locations. | |
e9955c83 | 1938 | |
cbdb6d91 | 1939 | Refer to the stacks through separate pointers, to allow yyoverflow |
e021811a | 1940 | to reallocate them elsewhere. */ |
e9955c83 | 1941 | |
e021811a JD |
1942 | /* The state stack. */ |
1943 | yytype_int16 yyssa[YYINITDEPTH]; | |
1944 | yytype_int16 *yyss; | |
1945 | yytype_int16 *yyssp; | |
e9955c83 | 1946 | |
e021811a JD |
1947 | /* The semantic value stack. */ |
1948 | YYSTYPE yyvsa[YYINITDEPTH]; | |
1949 | YYSTYPE *yyvs; | |
1950 | YYSTYPE *yyvsp; | |
e9955c83 | 1951 | |
e021811a JD |
1952 | /* The location stack. */ |
1953 | YYLTYPE yylsa[YYINITDEPTH]; | |
1954 | YYLTYPE *yyls; | |
1955 | YYLTYPE *yylsp; | |
1956 | ||
1957 | /* The locations where the error started and ended. */ | |
44c2b42d | 1958 | YYLTYPE yyerror_range[3]; |
e9955c83 | 1959 | |
e021811a | 1960 | YYSIZE_T yystacksize; |
e9955c83 | 1961 | |
107844a3 JD |
1962 | yytype_int16 yyesa[20]; |
1963 | yytype_int16 *yyes; | |
1964 | YYSIZE_T yyes_capacity; | |
1965 | ||
1966 | int yy_lac_established = 0; | |
e021811a JD |
1967 | int yyn; |
1968 | int yyresult; | |
1969 | /* Lookahead token as an internal (translated) token number. */ | |
1970 | int yytoken; | |
e9955c83 AD |
1971 | /* The variables used to return semantic value and location from the |
1972 | action routines. */ | |
1973 | YYSTYPE yyval; | |
e9955c83 | 1974 | YYLTYPE yyloc; |
e9955c83 | 1975 | |
e021811a JD |
1976 | #if YYERROR_VERBOSE |
1977 | /* Buffer for error messages, and its allocated size. */ | |
1978 | char yymsgbuf[128]; | |
1979 | char *yymsg = yymsgbuf; | |
1980 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
1981 | #endif | |
1982 | ||
1983 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) | |
1984 | ||
3b0ffc7e PE |
1985 | /* The number of symbols on the RHS of the reduced rule. |
1986 | Keep to zero when no symbol should be popped. */ | |
1987 | int yylen = 0; | |
e9955c83 | 1988 | |
e021811a JD |
1989 | yytoken = 0; |
1990 | yyss = yyssa; | |
1991 | yyvs = yyvsa; | |
1992 | yyls = yylsa; | |
e021811a JD |
1993 | yystacksize = YYINITDEPTH; |
1994 | ||
107844a3 JD |
1995 | yyes = yyesa; |
1996 | yyes_capacity = sizeof yyesa / sizeof *yyes; | |
1997 | if (YYMAXDEPTH < yyes_capacity) | |
1998 | yyes_capacity = YYMAXDEPTH; | |
1999 | ||
74e543d2 | 2000 | YYDPRINTF ((stderr, "Starting parse\n")); |
e9955c83 AD |
2001 | |
2002 | yystate = 0; | |
2003 | yyerrstatus = 0; | |
2004 | yynerrs = 0; | |
e021811a | 2005 | yychar = YYEMPTY; /* Cause a token to be read. */ |
e9955c83 AD |
2006 | |
2007 | /* Initialize stack pointers. | |
2008 | Waste one element of value and location stack | |
2009 | so that they stay on the same level as the state stack. | |
2010 | The wasted elements are never initialized. */ | |
e9955c83 AD |
2011 | yyssp = yyss; |
2012 | yyvsp = yyvs; | |
e9955c83 | 2013 | yylsp = yyls; |
e021811a | 2014 | |
1625df5b | 2015 | #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL |
8a8dc872 AD |
2016 | /* Initialize the default location before parsing starts. */ |
2017 | yylloc.first_line = yylloc.last_line = 1; | |
b3d9b5ba | 2018 | yylloc.first_column = yylloc.last_column = 1; |
8a8dc872 AD |
2019 | #endif |
2020 | ||
e021811a | 2021 | /* User initialization code. */ |
a9439670 | 2022 | /* Line 1505 of yacc.c */ |
398c298c | 2023 | #line 99 "src/parse-gram.y" |
cd3684cf AD |
2024 | { |
2025 | /* Bison's grammar can initial empty locations, hence a default | |
2026 | location is needed. */ | |
4a678af8 JD |
2027 | boundary_set (&yylloc.start, current_file, 1, 1); |
2028 | boundary_set (&yylloc.end, current_file, 1, 1); | |
cd3684cf | 2029 | } |
a9439670 | 2030 | /* Line 1505 of yacc.c */ |
415b8823 | 2031 | #line 2032 "src/parse-gram.c" |
5f6da1c0 | 2032 | yylsp[0] = yylloc; |
e021811a | 2033 | |
e9955c83 AD |
2034 | goto yysetstate; |
2035 | ||
2036 | /*------------------------------------------------------------. | |
2037 | | yynewstate -- Push a new state, which is found in yystate. | | |
2038 | `------------------------------------------------------------*/ | |
2039 | yynewstate: | |
2040 | /* In all cases, when you get here, the value and location stacks | |
3b0ffc7e | 2041 | have just been pushed. So pushing a state here evens the stacks. */ |
e9955c83 AD |
2042 | yyssp++; |
2043 | ||
2044 | yysetstate: | |
2045 | *yyssp = yystate; | |
2046 | ||
d33cb3ae | 2047 | if (yyss + yystacksize - 1 <= yyssp) |
e9955c83 AD |
2048 | { |
2049 | /* Get the current used size of the three stacks, in elements. */ | |
2050 | YYSIZE_T yysize = yyssp - yyss + 1; | |
2051 | ||
2052 | #ifdef yyoverflow | |
2053 | { | |
e9690142 JD |
2054 | /* Give user a chance to reallocate the stack. Use copies of |
2055 | these so that the &'s don't force the real ones into | |
2056 | memory. */ | |
2057 | YYSTYPE *yyvs1 = yyvs; | |
2058 | yytype_int16 *yyss1 = yyss; | |
2059 | YYLTYPE *yyls1 = yyls; | |
2060 | ||
2061 | /* Each stack pointer address is followed by the size of the | |
2062 | data in use in that stack, in bytes. This used to be a | |
2063 | conditional around just the two extra args, but that might | |
2064 | be undefined if yyoverflow is a macro. */ | |
2065 | yyoverflow (YY_("memory exhausted"), | |
2066 | &yyss1, yysize * sizeof (*yyssp), | |
2067 | &yyvs1, yysize * sizeof (*yyvsp), | |
2068 | &yyls1, yysize * sizeof (*yylsp), | |
2069 | &yystacksize); | |
2070 | ||
2071 | yyls = yyls1; | |
2072 | yyss = yyss1; | |
2073 | yyvs = yyvs1; | |
e9955c83 AD |
2074 | } |
2075 | #else /* no yyoverflow */ | |
2076 | # ifndef YYSTACK_RELOCATE | |
6088a2a0 | 2077 | goto yyexhaustedlab; |
e9955c83 AD |
2078 | # else |
2079 | /* Extend the stack our own way. */ | |
d33cb3ae | 2080 | if (YYMAXDEPTH <= yystacksize) |
e9690142 | 2081 | goto yyexhaustedlab; |
e9955c83 | 2082 | yystacksize *= 2; |
d33cb3ae | 2083 | if (YYMAXDEPTH < yystacksize) |
e9690142 | 2084 | yystacksize = YYMAXDEPTH; |
e9955c83 AD |
2085 | |
2086 | { | |
e9690142 JD |
2087 | yytype_int16 *yyss1 = yyss; |
2088 | union yyalloc *yyptr = | |
2089 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
2090 | if (! yyptr) | |
2091 | goto yyexhaustedlab; | |
2092 | YYSTACK_RELOCATE (yyss_alloc, yyss); | |
2093 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); | |
2094 | YYSTACK_RELOCATE (yyls_alloc, yyls); | |
1921f1d7 | 2095 | # undef YYSTACK_RELOCATE |
e9690142 JD |
2096 | if (yyss1 != yyssa) |
2097 | YYSTACK_FREE (yyss1); | |
e9955c83 AD |
2098 | } |
2099 | # endif | |
2100 | #endif /* no yyoverflow */ | |
2101 | ||
2102 | yyssp = yyss + yysize - 1; | |
2103 | yyvsp = yyvs + yysize - 1; | |
e9955c83 | 2104 | yylsp = yyls + yysize - 1; |
e9955c83 | 2105 | |
6088a2a0 | 2106 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
e9690142 | 2107 | (unsigned long int) yystacksize)); |
e9955c83 | 2108 | |
d33cb3ae | 2109 | if (yyss + yystacksize - 1 <= yyssp) |
e9690142 | 2110 | YYABORT; |
e9955c83 AD |
2111 | } |
2112 | ||
6088a2a0 | 2113 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
e9955c83 | 2114 | |
ec5479ce JD |
2115 | if (yystate == YYFINAL) |
2116 | YYACCEPT; | |
2117 | ||
e9955c83 AD |
2118 | goto yybackup; |
2119 | ||
2120 | /*-----------. | |
2121 | | yybackup. | | |
2122 | `-----------*/ | |
2123 | yybackup: | |
2124 | ||
3b0ffc7e | 2125 | /* Do appropriate processing given the current state. Read a |
9bc0dd67 | 2126 | lookahead token if we need one and don't already have one. */ |
e9955c83 | 2127 | |
9bc0dd67 | 2128 | /* First try to decide what to do without reference to lookahead token. */ |
e9955c83 | 2129 | yyn = yypact[yystate]; |
f2b30bdf | 2130 | if (yypact_value_is_default (yyn)) |
e9955c83 AD |
2131 | goto yydefault; |
2132 | ||
9bc0dd67 | 2133 | /* Not known => get a lookahead token if don't already have one. */ |
e9955c83 | 2134 | |
9bc0dd67 | 2135 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
73521d9f | 2136 | if (yychar == YYEMPTY) |
e9955c83 | 2137 | { |
74e543d2 | 2138 | YYDPRINTF ((stderr, "Reading a token: ")); |
e9955c83 AD |
2139 | yychar = YYLEX; |
2140 | } | |
2141 | ||
73521d9f | 2142 | if (yychar <= YYEOF) |
e9955c83 | 2143 | { |
73521d9f | 2144 | yychar = yytoken = YYEOF; |
74e543d2 | 2145 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
e9955c83 AD |
2146 | } |
2147 | else | |
2148 | { | |
73521d9f | 2149 | yytoken = YYTRANSLATE (yychar); |
6088a2a0 | 2150 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
e9955c83 AD |
2151 | } |
2152 | ||
886b69d1 | 2153 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
ae7453f2 | 2154 | detect an error, take that action. */ |
886b69d1 | 2155 | yyn += yytoken; |
219741d8 | 2156 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
107844a3 JD |
2157 | { |
2158 | YY_LAC_ESTABLISH; | |
2159 | goto yydefault; | |
2160 | } | |
e9955c83 | 2161 | yyn = yytable[yyn]; |
ae7453f2 | 2162 | if (yyn <= 0) |
e9955c83 | 2163 | { |
f2b30bdf | 2164 | if (yytable_value_is_error (yyn)) |
bf35c71c | 2165 | goto yyerrlab; |
107844a3 | 2166 | YY_LAC_ESTABLISH; |
e9955c83 AD |
2167 | yyn = -yyn; |
2168 | goto yyreduce; | |
2169 | } | |
e9955c83 | 2170 | |
3b0ffc7e PE |
2171 | /* Count tokens shifted since error; after three, turn off error |
2172 | status. */ | |
2173 | if (yyerrstatus) | |
2174 | yyerrstatus--; | |
2175 | ||
9bc0dd67 | 2176 | /* Shift the lookahead token. */ |
6088a2a0 | 2177 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
e9955c83 | 2178 | |
ec5479ce JD |
2179 | /* Discard the shifted token. */ |
2180 | yychar = YYEMPTY; | |
107844a3 | 2181 | YY_LAC_DISCARD ("shift"); |
e9955c83 | 2182 | |
3b0ffc7e | 2183 | yystate = yyn; |
e9955c83 | 2184 | *++yyvsp = yylval; |
e9955c83 | 2185 | *++yylsp = yylloc; |
e9955c83 AD |
2186 | goto yynewstate; |
2187 | ||
2188 | ||
2189 | /*-----------------------------------------------------------. | |
2190 | | yydefault -- do the default action for the current state. | | |
2191 | `-----------------------------------------------------------*/ | |
2192 | yydefault: | |
2193 | yyn = yydefact[yystate]; | |
2194 | if (yyn == 0) | |
2195 | goto yyerrlab; | |
2196 | goto yyreduce; | |
2197 | ||
2198 | ||
2199 | /*-----------------------------. | |
2200 | | yyreduce -- Do a reduction. | | |
2201 | `-----------------------------*/ | |
2202 | yyreduce: | |
2203 | /* yyn is the number of a rule to reduce with. */ | |
2204 | yylen = yyr2[yyn]; | |
2205 | ||
2206 | /* If YYLEN is nonzero, implement the default value of the action: | |
2207 | `$$ = $1'. | |
2208 | ||
04b6e11e PE |
2209 | Otherwise, the following line sets YYVAL to garbage. |
2210 | This behavior is undocumented and Bison | |
e9955c83 AD |
2211 | users should not rely upon it. Assigning to YYVAL |
2212 | unconditionally makes the parser a bit smaller, and it avoids a | |
2213 | GCC warning that YYVAL may be used uninitialized. */ | |
2214 | yyval = yyvsp[1-yylen]; | |
2215 | ||
3b0ffc7e | 2216 | /* Default location. */ |
bf8b3d98 | 2217 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
05d18c24 | 2218 | YY_REDUCE_PRINT (yyn); |
107844a3 JD |
2219 | { |
2220 | int yychar_backup = yychar; | |
2221 | switch (yyn) | |
2222 | { | |
2223 | case 6: | |
a9439670 | 2224 | /* Line 1721 of yacc.c */ |
398c298c | 2225 | #line 286 "src/parse-gram.y" |
7c0c6181 JD |
2226 | { |
2227 | code_props plain_code; | |
e3dda35c | 2228 | code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0])); |
7c0c6181 JD |
2229 | code_props_translate_code (&plain_code); |
2230 | gram_scanner_last_string_free (); | |
7ecec4dd | 2231 | muscle_code_grow (union_seen ? "post_prologue" : "pre_prologue", |
e3dda35c | 2232 | plain_code.code, (yylsp[0])); |
7c0c6181 JD |
2233 | code_scanner_last_string_free (); |
2234 | } | |
a9439670 | 2235 | /* Line 1721 of yacc.c */ |
415b8823 | 2236 | #line 2237 "src/parse-gram.c" |
1921f1d7 AD |
2237 | break; |
2238 | ||
8efe435c | 2239 | case 7: |
a9439670 | 2240 | /* Line 1721 of yacc.c */ |
398c298c | 2241 | #line 296 "src/parse-gram.y" |
b19ebeb3 | 2242 | { |
697c912f | 2243 | muscle_percent_define_ensure ((yyvsp[0].uniqstr), (yylsp[0]), true); |
b19ebeb3 | 2244 | } |
a9439670 | 2245 | /* Line 1721 of yacc.c */ |
415b8823 | 2246 | #line 2247 "src/parse-gram.c" |
9bc0dd67 JD |
2247 | break; |
2248 | ||
2cbe6b7f | 2249 | case 8: |
a9439670 | 2250 | /* Line 1721 of yacc.c */ |
398c298c | 2251 | #line 300 "src/parse-gram.y" |
7eb8a0bc | 2252 | { |
de5ab940 JD |
2253 | muscle_percent_define_insert ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), |
2254 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
7eb8a0bc | 2255 | } |
a9439670 | 2256 | /* Line 1721 of yacc.c */ |
415b8823 | 2257 | #line 2258 "src/parse-gram.c" |
1921f1d7 AD |
2258 | break; |
2259 | ||
2cbe6b7f | 2260 | case 9: |
a9439670 | 2261 | /* Line 1721 of yacc.c */ |
398c298c | 2262 | #line 304 "src/parse-gram.y" |
2ce4ed68 | 2263 | { defines_flag = true; } |
a9439670 | 2264 | /* Line 1721 of yacc.c */ |
415b8823 | 2265 | #line 2266 "src/parse-gram.c" |
e9955c83 | 2266 | break; |
1921f1d7 | 2267 | |
2cbe6b7f | 2268 | case 10: |
a9439670 | 2269 | /* Line 1721 of yacc.c */ |
398c298c | 2270 | #line 306 "src/parse-gram.y" |
02975b9a JD |
2271 | { |
2272 | defines_flag = true; | |
e3dda35c | 2273 | spec_defines_file = xstrdup ((yyvsp[0].chars)); |
02975b9a | 2274 | } |
a9439670 | 2275 | /* Line 1721 of yacc.c */ |
415b8823 | 2276 | #line 2277 "src/parse-gram.c" |
e9955c83 | 2277 | break; |
1921f1d7 | 2278 | |
2cbe6b7f | 2279 | case 11: |
a9439670 | 2280 | /* Line 1721 of yacc.c */ |
398c298c | 2281 | #line 311 "src/parse-gram.y" |
2f5b478e AD |
2282 | { |
2283 | muscle_percent_define_insert ("parse.error", (yylsp[0]), "verbose", | |
2284 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
2285 | } | |
a9439670 | 2286 | /* Line 1721 of yacc.c */ |
415b8823 | 2287 | #line 2288 "src/parse-gram.c" |
d6328241 PH |
2288 | break; |
2289 | ||
2cbe6b7f | 2290 | case 12: |
a9439670 | 2291 | /* Line 1721 of yacc.c */ |
398c298c | 2292 | #line 315 "src/parse-gram.y" |
2f5b478e | 2293 | { expected_sr_conflicts = (yyvsp[0].integer); } |
a9439670 | 2294 | /* Line 1721 of yacc.c */ |
415b8823 | 2295 | #line 2296 "src/parse-gram.c" |
fb9712a9 AD |
2296 | break; |
2297 | ||
2cbe6b7f | 2298 | case 13: |
a9439670 | 2299 | /* Line 1721 of yacc.c */ |
398c298c | 2300 | #line 316 "src/parse-gram.y" |
2f5b478e | 2301 | { expected_rr_conflicts = (yyvsp[0].integer); } |
a9439670 | 2302 | /* Line 1721 of yacc.c */ |
415b8823 | 2303 | #line 2304 "src/parse-gram.c" |
34f98f46 JD |
2304 | break; |
2305 | ||
2cbe6b7f | 2306 | case 14: |
a9439670 | 2307 | /* Line 1721 of yacc.c */ |
398c298c | 2308 | #line 317 "src/parse-gram.y" |
e3dda35c | 2309 | { spec_file_prefix = (yyvsp[0].chars); } |
a9439670 | 2310 | /* Line 1721 of yacc.c */ |
415b8823 | 2311 | #line 2312 "src/parse-gram.c" |
02975b9a JD |
2312 | break; |
2313 | ||
2314 | case 15: | |
a9439670 | 2315 | /* Line 1721 of yacc.c */ |
398c298c | 2316 | #line 318 "src/parse-gram.y" |
2f5b478e | 2317 | { spec_file_prefix = (yyvsp[0].chars); } |
a9439670 | 2318 | /* Line 1721 of yacc.c */ |
415b8823 | 2319 | #line 2320 "src/parse-gram.c" |
2f5b478e AD |
2320 | break; |
2321 | ||
2322 | case 16: | |
a9439670 | 2323 | /* Line 1721 of yacc.c */ |
398c298c | 2324 | #line 320 "src/parse-gram.y" |
cd3684cf | 2325 | { |
bf8b3d98 PE |
2326 | nondeterministic_parser = true; |
2327 | glr_parser = true; | |
2328 | } | |
a9439670 | 2329 | /* Line 1721 of yacc.c */ |
415b8823 | 2330 | #line 2331 "src/parse-gram.c" |
e9955c83 | 2331 | break; |
1921f1d7 | 2332 | |
2f5b478e | 2333 | case 17: |
a9439670 | 2334 | /* Line 1721 of yacc.c */ |
398c298c | 2335 | #line 325 "src/parse-gram.y" |
cd3684cf | 2336 | { |
7c0c6181 | 2337 | code_props action; |
e3dda35c | 2338 | code_props_symbol_action_init (&action, (yyvsp[0].code), (yylsp[0])); |
7c0c6181 JD |
2339 | code_props_translate_code (&action); |
2340 | gram_scanner_last_string_free (); | |
e3dda35c | 2341 | muscle_code_grow ("initial_action", action.code, (yylsp[0])); |
7c0c6181 | 2342 | code_scanner_last_string_free (); |
bf8b3d98 | 2343 | } |
a9439670 | 2344 | /* Line 1721 of yacc.c */ |
415b8823 | 2345 | #line 2346 "src/parse-gram.c" |
e9955c83 | 2346 | break; |
1921f1d7 | 2347 | |
2f5b478e | 2348 | case 18: |
a9439670 | 2349 | /* Line 1721 of yacc.c */ |
398c298c | 2350 | #line 333 "src/parse-gram.y" |
e3dda35c | 2351 | { language_argmatch ((yyvsp[0].chars), grammar_prio, (yylsp[-1])); } |
a9439670 | 2352 | /* Line 1721 of yacc.c */ |
415b8823 | 2353 | #line 2354 "src/parse-gram.c" |
e9955c83 | 2354 | break; |
1921f1d7 | 2355 | |
2f5b478e | 2356 | case 19: |
a9439670 | 2357 | /* Line 1721 of yacc.c */ |
398c298c | 2358 | #line 334 "src/parse-gram.y" |
b18cdd91 | 2359 | { spec_name_prefix = (yyvsp[0].chars); } |
a9439670 | 2360 | /* Line 1721 of yacc.c */ |
415b8823 | 2361 | #line 2362 "src/parse-gram.c" |
e9955c83 | 2362 | break; |
1921f1d7 | 2363 | |
2f5b478e | 2364 | case 20: |
a9439670 | 2365 | /* Line 1721 of yacc.c */ |
398c298c | 2366 | #line 335 "src/parse-gram.y" |
3583d96b | 2367 | { spec_name_prefix = (yyvsp[0].chars); } |
a9439670 | 2368 | /* Line 1721 of yacc.c */ |
415b8823 | 2369 | #line 2370 "src/parse-gram.c" |
02975b9a JD |
2370 | break; |
2371 | ||
2f5b478e | 2372 | case 21: |
a9439670 | 2373 | /* Line 1721 of yacc.c */ |
398c298c | 2374 | #line 336 "src/parse-gram.y" |
b18cdd91 | 2375 | { no_lines_flag = true; } |
a9439670 | 2376 | /* Line 1721 of yacc.c */ |
415b8823 | 2377 | #line 2378 "src/parse-gram.c" |
e9955c83 | 2378 | break; |
1921f1d7 | 2379 | |
2f5b478e | 2380 | case 22: |
a9439670 | 2381 | /* Line 1721 of yacc.c */ |
398c298c | 2382 | #line 337 "src/parse-gram.y" |
b18cdd91 | 2383 | { nondeterministic_parser = true; } |
a9439670 | 2384 | /* Line 1721 of yacc.c */ |
415b8823 | 2385 | #line 2386 "src/parse-gram.c" |
4cdb01db | 2386 | break; |
1921f1d7 | 2387 | |
2f5b478e | 2388 | case 23: |
a9439670 | 2389 | /* Line 1721 of yacc.c */ |
398c298c | 2390 | #line 338 "src/parse-gram.y" |
b18cdd91 | 2391 | { spec_outfile = (yyvsp[0].chars); } |
a9439670 | 2392 | /* Line 1721 of yacc.c */ |
415b8823 | 2393 | #line 2394 "src/parse-gram.c" |
4cdb01db | 2394 | break; |
1921f1d7 | 2395 | |
2f5b478e | 2396 | case 24: |
a9439670 | 2397 | /* Line 1721 of yacc.c */ |
398c298c | 2398 | #line 339 "src/parse-gram.y" |
3583d96b | 2399 | { spec_outfile = (yyvsp[0].chars); } |
a9439670 | 2400 | /* Line 1721 of yacc.c */ |
415b8823 | 2401 | #line 2402 "src/parse-gram.c" |
02975b9a JD |
2402 | break; |
2403 | ||
2f5b478e | 2404 | case 25: |
a9439670 | 2405 | /* Line 1721 of yacc.c */ |
398c298c | 2406 | #line 340 "src/parse-gram.y" |
dd875058 | 2407 | { current_param = (yyvsp[0].param); } |
a9439670 | 2408 | /* Line 1721 of yacc.c */ |
415b8823 | 2409 | #line 2410 "src/parse-gram.c" |
4cdb01db | 2410 | break; |
1921f1d7 | 2411 | |
2f5b478e | 2412 | case 26: |
a9439670 | 2413 | /* Line 1721 of yacc.c */ |
398c298c | 2414 | #line 340 "src/parse-gram.y" |
dd875058 | 2415 | { current_param = param_none; } |
a9439670 | 2416 | /* Line 1721 of yacc.c */ |
415b8823 | 2417 | #line 2418 "src/parse-gram.c" |
b50d2359 AD |
2418 | break; |
2419 | ||
b18cdd91 | 2420 | case 27: |
a9439670 | 2421 | /* Line 1721 of yacc.c */ |
398c298c | 2422 | #line 341 "src/parse-gram.y" |
dd875058 | 2423 | { version_check (&(yylsp[0]), (yyvsp[0].chars)); } |
a9439670 | 2424 | /* Line 1721 of yacc.c */ |
415b8823 | 2425 | #line 2426 "src/parse-gram.c" |
dd875058 AD |
2426 | break; |
2427 | ||
2428 | case 28: | |
a9439670 | 2429 | /* Line 1721 of yacc.c */ |
398c298c | 2430 | #line 343 "src/parse-gram.y" |
a7867f53 | 2431 | { |
e3dda35c | 2432 | char const *skeleton_user = (yyvsp[0].chars); |
84526bf3 | 2433 | if (strchr (skeleton_user, '/')) |
a7867f53 JD |
2434 | { |
2435 | size_t dir_length = strlen (current_file); | |
2436 | char *skeleton_build; | |
2437 | while (dir_length && current_file[dir_length - 1] != '/') | |
2438 | --dir_length; | |
2439 | while (dir_length && current_file[dir_length - 1] == '/') | |
2440 | --dir_length; | |
2441 | skeleton_build = | |
2442 | xmalloc (dir_length + 1 + strlen (skeleton_user) + 1); | |
2443 | if (dir_length > 0) | |
2444 | { | |
398c298c | 2445 | memcpy (skeleton_build, current_file, dir_length); |
a7867f53 JD |
2446 | skeleton_build[dir_length++] = '/'; |
2447 | } | |
2448 | strcpy (skeleton_build + dir_length, skeleton_user); | |
2449 | skeleton_user = uniqstr_new (skeleton_build); | |
2450 | free (skeleton_build); | |
2451 | } | |
e3dda35c | 2452 | skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1])); |
a7867f53 | 2453 | } |
a9439670 | 2454 | /* Line 1721 of yacc.c */ |
415b8823 | 2455 | #line 2456 "src/parse-gram.c" |
3fa3725a PE |
2456 | break; |
2457 | ||
dd875058 | 2458 | case 29: |
a9439670 | 2459 | /* Line 1721 of yacc.c */ |
398c298c | 2460 | #line 366 "src/parse-gram.y" |
7172e23e | 2461 | { token_table_flag = true; } |
a9439670 | 2462 | /* Line 1721 of yacc.c */ |
415b8823 | 2463 | #line 2464 "src/parse-gram.c" |
5e6feb86 PE |
2464 | break; |
2465 | ||
dd875058 | 2466 | case 30: |
a9439670 | 2467 | /* Line 1721 of yacc.c */ |
398c298c | 2468 | #line 367 "src/parse-gram.y" |
ef1b4273 | 2469 | { report_flag |= report_states; } |
a9439670 | 2470 | /* Line 1721 of yacc.c */ |
415b8823 | 2471 | #line 2472 "src/parse-gram.c" |
7172e23e JD |
2472 | break; |
2473 | ||
dd875058 | 2474 | case 31: |
a9439670 | 2475 | /* Line 1721 of yacc.c */ |
398c298c | 2476 | #line 368 "src/parse-gram.y" |
83a457be | 2477 | { yacc_flag = true; } |
a9439670 | 2478 | /* Line 1721 of yacc.c */ |
415b8823 | 2479 | #line 2480 "src/parse-gram.c" |
dd875058 AD |
2480 | break; |
2481 | ||
2482 | case 33: | |
a9439670 | 2483 | /* Line 1721 of yacc.c */ |
398c298c | 2484 | #line 373 "src/parse-gram.y" |
dd875058 | 2485 | { add_param (current_param, (yyvsp[0].code), (yylsp[0])); } |
a9439670 | 2486 | /* Line 1721 of yacc.c */ |
415b8823 | 2487 | #line 2488 "src/parse-gram.c" |
4cdb01db | 2488 | break; |
1921f1d7 | 2489 | |
b18cdd91 | 2490 | case 34: |
a9439670 | 2491 | /* Line 1721 of yacc.c */ |
398c298c | 2492 | #line 374 "src/parse-gram.y" |
dd875058 | 2493 | { add_param (current_param, (yyvsp[0].code), (yylsp[0])); } |
a9439670 | 2494 | /* Line 1721 of yacc.c */ |
415b8823 | 2495 | #line 2496 "src/parse-gram.c" |
dd875058 AD |
2496 | break; |
2497 | ||
2498 | case 37: | |
a9439670 | 2499 | /* Line 1721 of yacc.c */ |
398c298c | 2500 | #line 386 "src/parse-gram.y" |
1921f1d7 | 2501 | { |
e3dda35c | 2502 | grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0])); |
4cdb01db | 2503 | } |
a9439670 | 2504 | /* Line 1721 of yacc.c */ |
415b8823 | 2505 | #line 2506 "src/parse-gram.c" |
e9955c83 | 2506 | break; |
1921f1d7 | 2507 | |
dd875058 | 2508 | case 38: |
a9439670 | 2509 | /* Line 1721 of yacc.c */ |
398c298c | 2510 | #line 390 "src/parse-gram.y" |
1921f1d7 | 2511 | { |
05d18c24 | 2512 | symbol_list *list; |
e3dda35c | 2513 | for (list = (yyvsp[0].list); list; list = list->next) |
71da68b3 | 2514 | symbol_list_code_props_set (list, destructor, (yylsp[-1]), (yyvsp[-1].code)); |
e3dda35c | 2515 | symbol_list_free ((yyvsp[0].list)); |
4cdb01db | 2516 | } |
a9439670 | 2517 | /* Line 1721 of yacc.c */ |
415b8823 | 2518 | #line 2519 "src/parse-gram.c" |
e9955c83 | 2519 | break; |
1921f1d7 | 2520 | |
dd875058 | 2521 | case 39: |
a9439670 | 2522 | /* Line 1721 of yacc.c */ |
398c298c | 2523 | #line 397 "src/parse-gram.y" |
1921f1d7 | 2524 | { |
05d18c24 | 2525 | symbol_list *list; |
e3dda35c | 2526 | for (list = (yyvsp[0].list); list; list = list->next) |
71da68b3 | 2527 | symbol_list_code_props_set (list, printer, (yylsp[-1]), (yyvsp[-1].code)); |
e3dda35c | 2528 | symbol_list_free ((yyvsp[0].list)); |
4cdb01db | 2529 | } |
a9439670 | 2530 | /* Line 1721 of yacc.c */ |
415b8823 | 2531 | #line 2532 "src/parse-gram.c" |
e9955c83 | 2532 | break; |
1921f1d7 | 2533 | |
dd875058 | 2534 | case 40: |
a9439670 | 2535 | /* Line 1721 of yacc.c */ |
398c298c | 2536 | #line 404 "src/parse-gram.y" |
92f5e991 | 2537 | { |
66ef8b9d | 2538 | default_prec = true; |
92f5e991 | 2539 | } |
a9439670 | 2540 | /* Line 1721 of yacc.c */ |
415b8823 | 2541 | #line 2542 "src/parse-gram.c" |
9280d3ef AD |
2542 | break; |
2543 | ||
dd875058 | 2544 | case 41: |
a9439670 | 2545 | /* Line 1721 of yacc.c */ |
398c298c | 2546 | #line 408 "src/parse-gram.y" |
66ef8b9d PE |
2547 | { |
2548 | default_prec = false; | |
2549 | } | |
a9439670 | 2550 | /* Line 1721 of yacc.c */ |
415b8823 | 2551 | #line 2552 "src/parse-gram.c" |
92f5e991 AD |
2552 | break; |
2553 | ||
dd875058 | 2554 | case 42: |
a9439670 | 2555 | /* Line 1721 of yacc.c */ |
398c298c | 2556 | #line 412 "src/parse-gram.y" |
8e0a5e9e | 2557 | { |
9611cfa2 JD |
2558 | /* Do not invoke muscle_percent_code_grow here since it invokes |
2559 | muscle_user_name_list_grow. */ | |
e3dda35c | 2560 | muscle_code_grow ("percent_code()", (yyvsp[0].chars), (yylsp[0])); |
8e0a5e9e JD |
2561 | code_scanner_last_string_free (); |
2562 | } | |
a9439670 | 2563 | /* Line 1721 of yacc.c */ |
415b8823 | 2564 | #line 2565 "src/parse-gram.c" |
2cbe6b7f JD |
2565 | break; |
2566 | ||
dd875058 | 2567 | case 43: |
a9439670 | 2568 | /* Line 1721 of yacc.c */ |
398c298c | 2569 | #line 419 "src/parse-gram.y" |
8e0a5e9e | 2570 | { |
e3dda35c | 2571 | muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), (yylsp[0])); |
8e0a5e9e | 2572 | code_scanner_last_string_free (); |
8e0a5e9e | 2573 | } |
a9439670 | 2574 | /* Line 1721 of yacc.c */ |
415b8823 | 2575 | #line 2576 "src/parse-gram.c" |
58d7a1a1 AD |
2576 | break; |
2577 | ||
dd875058 | 2578 | case 44: |
a9439670 | 2579 | /* Line 1721 of yacc.c */ |
398c298c | 2580 | #line 433 "src/parse-gram.y" |
2cbe6b7f | 2581 | {} |
a9439670 | 2582 | /* Line 1721 of yacc.c */ |
415b8823 | 2583 | #line 2584 "src/parse-gram.c" |
66ef8b9d PE |
2584 | break; |
2585 | ||
dd875058 | 2586 | case 45: |
a9439670 | 2587 | /* Line 1721 of yacc.c */ |
398c298c | 2588 | #line 434 "src/parse-gram.y" |
e3dda35c | 2589 | { muscle_code_grow ("union_name", (yyvsp[0].uniqstr), (yylsp[0])); } |
a9439670 | 2590 | /* Line 1721 of yacc.c */ |
415b8823 | 2591 | #line 2592 "src/parse-gram.c" |
2cbe6b7f JD |
2592 | break; |
2593 | ||
dd875058 | 2594 | case 46: |
a9439670 | 2595 | /* Line 1721 of yacc.c */ |
398c298c | 2596 | #line 439 "src/parse-gram.y" |
9280d3ef | 2597 | { |
1f4cc0f4 | 2598 | union_seen = true; |
e3dda35c | 2599 | muscle_code_grow ("stype", (yyvsp[0].chars), (yylsp[0])); |
7ecec4dd | 2600 | code_scanner_last_string_free (); |
9280d3ef | 2601 | } |
a9439670 | 2602 | /* Line 1721 of yacc.c */ |
415b8823 | 2603 | #line 2604 "src/parse-gram.c" |
9280d3ef AD |
2604 | break; |
2605 | ||
dd875058 | 2606 | case 47: |
a9439670 | 2607 | /* Line 1721 of yacc.c */ |
398c298c | 2608 | #line 450 "src/parse-gram.y" |
58d7a1a1 | 2609 | { current_class = nterm_sym; } |
a9439670 | 2610 | /* Line 1721 of yacc.c */ |
415b8823 | 2611 | #line 2612 "src/parse-gram.c" |
366eea36 AD |
2612 | break; |
2613 | ||
dd875058 | 2614 | case 48: |
a9439670 | 2615 | /* Line 1721 of yacc.c */ |
398c298c | 2616 | #line 451 "src/parse-gram.y" |
366eea36 AD |
2617 | { |
2618 | current_class = unknown_sym; | |
2619 | current_type = NULL; | |
2620 | } | |
a9439670 | 2621 | /* Line 1721 of yacc.c */ |
415b8823 | 2622 | #line 2623 "src/parse-gram.c" |
366eea36 AD |
2623 | break; |
2624 | ||
dd875058 | 2625 | case 49: |
a9439670 | 2626 | /* Line 1721 of yacc.c */ |
398c298c | 2627 | #line 455 "src/parse-gram.y" |
58d7a1a1 | 2628 | { current_class = token_sym; } |
a9439670 | 2629 | /* Line 1721 of yacc.c */ |
415b8823 | 2630 | #line 2631 "src/parse-gram.c" |
58d7a1a1 AD |
2631 | break; |
2632 | ||
dd875058 | 2633 | case 50: |
a9439670 | 2634 | /* Line 1721 of yacc.c */ |
398c298c | 2635 | #line 456 "src/parse-gram.y" |
58d7a1a1 AD |
2636 | { |
2637 | current_class = unknown_sym; | |
2638 | current_type = NULL; | |
2639 | } | |
a9439670 | 2640 | /* Line 1721 of yacc.c */ |
415b8823 | 2641 | #line 2642 "src/parse-gram.c" |
58d7a1a1 AD |
2642 | break; |
2643 | ||
dd875058 | 2644 | case 51: |
a9439670 | 2645 | /* Line 1721 of yacc.c */ |
398c298c | 2646 | #line 461 "src/parse-gram.y" |
1e0bab92 | 2647 | { |
05d18c24 | 2648 | symbol_list *list; |
3acc0308 | 2649 | tag_seen = true; |
e3dda35c | 2650 | for (list = (yyvsp[0].list); list; list = list->next) |
e9690142 | 2651 | symbol_type_set (list->content.sym, (yyvsp[-1].uniqstr), (yylsp[-1])); |
e3dda35c | 2652 | symbol_list_free ((yyvsp[0].list)); |
1e0bab92 | 2653 | } |
a9439670 | 2654 | /* Line 1721 of yacc.c */ |
415b8823 | 2655 | #line 2656 "src/parse-gram.c" |
e9955c83 | 2656 | break; |
1921f1d7 | 2657 | |
dd875058 | 2658 | case 52: |
a9439670 | 2659 | /* Line 1721 of yacc.c */ |
398c298c | 2660 | #line 472 "src/parse-gram.y" |
1921f1d7 | 2661 | { |
05d18c24 | 2662 | symbol_list *list; |
1e0bab92 | 2663 | ++current_prec; |
e3dda35c | 2664 | for (list = (yyvsp[0].list); list; list = list->next) |
e9690142 JD |
2665 | { |
2666 | symbol_type_set (list->content.sym, current_type, (yylsp[-1])); | |
2667 | symbol_precedence_set (list->content.sym, current_prec, (yyvsp[-2].assoc), (yylsp[-2])); | |
2668 | } | |
e3dda35c | 2669 | symbol_list_free ((yyvsp[0].list)); |
2c569025 AD |
2670 | current_type = NULL; |
2671 | } | |
a9439670 | 2672 | /* Line 1721 of yacc.c */ |
415b8823 | 2673 | #line 2674 "src/parse-gram.c" |
e9955c83 | 2674 | break; |
1921f1d7 | 2675 | |
dd875058 | 2676 | case 53: |
a9439670 | 2677 | /* Line 1721 of yacc.c */ |
398c298c | 2678 | #line 486 "src/parse-gram.y" |
76dcf299 | 2679 | { (yyval.assoc) = left_assoc; } |
a9439670 | 2680 | /* Line 1721 of yacc.c */ |
415b8823 | 2681 | #line 2682 "src/parse-gram.c" |
e9955c83 | 2682 | break; |
1921f1d7 | 2683 | |
dd875058 | 2684 | case 54: |
a9439670 | 2685 | /* Line 1721 of yacc.c */ |
398c298c | 2686 | #line 487 "src/parse-gram.y" |
76dcf299 | 2687 | { (yyval.assoc) = right_assoc; } |
a9439670 | 2688 | /* Line 1721 of yacc.c */ |
415b8823 | 2689 | #line 2690 "src/parse-gram.c" |
e9955c83 | 2690 | break; |
1921f1d7 | 2691 | |
dd875058 | 2692 | case 55: |
a9439670 | 2693 | /* Line 1721 of yacc.c */ |
398c298c | 2694 | #line 488 "src/parse-gram.y" |
76dcf299 | 2695 | { (yyval.assoc) = non_assoc; } |
a9439670 | 2696 | /* Line 1721 of yacc.c */ |
415b8823 | 2697 | #line 2698 "src/parse-gram.c" |
4cdb01db | 2698 | break; |
1921f1d7 | 2699 | |
dd875058 | 2700 | case 56: |
a9439670 | 2701 | /* Line 1721 of yacc.c */ |
398c298c | 2702 | #line 489 "src/parse-gram.y" |
f7398526 | 2703 | { (yyval.assoc) = precedence_assoc; } |
a9439670 | 2704 | /* Line 1721 of yacc.c */ |
415b8823 | 2705 | #line 2706 "src/parse-gram.c" |
e9955c83 | 2706 | break; |
1921f1d7 | 2707 | |
dd875058 | 2708 | case 57: |
a9439670 | 2709 | /* Line 1721 of yacc.c */ |
398c298c | 2710 | #line 493 "src/parse-gram.y" |
f7398526 | 2711 | { current_type = NULL; } |
a9439670 | 2712 | /* Line 1721 of yacc.c */ |
415b8823 | 2713 | #line 2714 "src/parse-gram.c" |
e9955c83 | 2714 | break; |
1921f1d7 | 2715 | |
dd875058 | 2716 | case 58: |
a9439670 | 2717 | /* Line 1721 of yacc.c */ |
398c298c | 2718 | #line 494 "src/parse-gram.y" |
e3dda35c | 2719 | { current_type = (yyvsp[0].uniqstr); tag_seen = true; } |
a9439670 | 2720 | /* Line 1721 of yacc.c */ |
415b8823 | 2721 | #line 2722 "src/parse-gram.c" |
3be03b13 JD |
2722 | break; |
2723 | ||
dd875058 | 2724 | case 59: |
a9439670 | 2725 | /* Line 1721 of yacc.c */ |
398c298c | 2726 | #line 500 "src/parse-gram.y" |
e3dda35c | 2727 | { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } |
a9439670 | 2728 | /* Line 1721 of yacc.c */ |
415b8823 | 2729 | #line 2730 "src/parse-gram.c" |
3be03b13 JD |
2730 | break; |
2731 | ||
dd875058 | 2732 | case 60: |
a9439670 | 2733 | /* Line 1721 of yacc.c */ |
398c298c | 2734 | #line 502 "src/parse-gram.y" |
e3dda35c | 2735 | { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); } |
a9439670 | 2736 | /* Line 1721 of yacc.c */ |
415b8823 | 2737 | #line 2738 "src/parse-gram.c" |
4cdb01db | 2738 | break; |
1921f1d7 | 2739 | |
dd875058 | 2740 | case 61: |
a9439670 | 2741 | /* Line 1721 of yacc.c */ |
398c298c | 2742 | #line 506 "src/parse-gram.y" |
e3dda35c | 2743 | { (yyval.symbol) = (yyvsp[0].symbol); } |
a9439670 | 2744 | /* Line 1721 of yacc.c */ |
415b8823 | 2745 | #line 2746 "src/parse-gram.c" |
4cdb01db | 2746 | break; |
1921f1d7 | 2747 | |
dd875058 | 2748 | case 62: |
a9439670 | 2749 | /* Line 1721 of yacc.c */ |
398c298c | 2750 | #line 507 "src/parse-gram.y" |
e3dda35c | 2751 | { (yyval.symbol) = (yyvsp[-1].symbol); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); } |
a9439670 | 2752 | /* Line 1721 of yacc.c */ |
415b8823 | 2753 | #line 2754 "src/parse-gram.c" |
3be03b13 JD |
2754 | break; |
2755 | ||
dd875058 | 2756 | case 63: |
a9439670 | 2757 | /* Line 1721 of yacc.c */ |
398c298c | 2758 | #line 513 "src/parse-gram.y" |
e3dda35c | 2759 | { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } |
a9439670 | 2760 | /* Line 1721 of yacc.c */ |
415b8823 | 2761 | #line 2762 "src/parse-gram.c" |
3be03b13 JD |
2762 | break; |
2763 | ||
dd875058 | 2764 | case 64: |
a9439670 | 2765 | /* Line 1721 of yacc.c */ |
398c298c | 2766 | #line 515 "src/parse-gram.y" |
e3dda35c | 2767 | { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); } |
a9439670 | 2768 | /* Line 1721 of yacc.c */ |
415b8823 | 2769 | #line 2770 "src/parse-gram.c" |
3be03b13 JD |
2770 | break; |
2771 | ||
dd875058 | 2772 | case 65: |
a9439670 | 2773 | /* Line 1721 of yacc.c */ |
398c298c | 2774 | #line 519 "src/parse-gram.y" |
e3dda35c | 2775 | { (yyval.list) = (yyvsp[0].list); } |
a9439670 | 2776 | /* Line 1721 of yacc.c */ |
415b8823 | 2777 | #line 2778 "src/parse-gram.c" |
12e35840 JD |
2778 | break; |
2779 | ||
dd875058 | 2780 | case 66: |
a9439670 | 2781 | /* Line 1721 of yacc.c */ |
398c298c | 2782 | #line 520 "src/parse-gram.y" |
e3dda35c | 2783 | { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), (yyvsp[0].list)); } |
a9439670 | 2784 | /* Line 1721 of yacc.c */ |
415b8823 | 2785 | #line 2786 "src/parse-gram.c" |
ab7f29f8 JD |
2786 | break; |
2787 | ||
dd875058 | 2788 | case 67: |
a9439670 | 2789 | /* Line 1721 of yacc.c */ |
398c298c | 2790 | #line 524 "src/parse-gram.y" |
e3dda35c | 2791 | { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } |
a9439670 | 2792 | /* Line 1721 of yacc.c */ |
415b8823 | 2793 | #line 2794 "src/parse-gram.c" |
ab7f29f8 JD |
2794 | break; |
2795 | ||
dd875058 | 2796 | case 68: |
a9439670 | 2797 | /* Line 1721 of yacc.c */ |
398c298c | 2798 | #line 525 "src/parse-gram.y" |
e3dda35c | 2799 | { (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); } |
a9439670 | 2800 | /* Line 1721 of yacc.c */ |
415b8823 | 2801 | #line 2802 "src/parse-gram.c" |
ab7f29f8 JD |
2802 | break; |
2803 | ||
dd875058 | 2804 | case 69: |
a9439670 | 2805 | /* Line 1721 of yacc.c */ |
398c298c | 2806 | #line 526 "src/parse-gram.y" |
e501ea04 | 2807 | { (yyval.list) = symbol_list_type_new ("*", (yylsp[0])); } |
a9439670 | 2808 | /* Line 1721 of yacc.c */ |
415b8823 | 2809 | #line 2810 "src/parse-gram.c" |
ab7f29f8 JD |
2810 | break; |
2811 | ||
dd875058 | 2812 | case 70: |
a9439670 | 2813 | /* Line 1721 of yacc.c */ |
398c298c | 2814 | #line 527 "src/parse-gram.y" |
e501ea04 | 2815 | { (yyval.list) = symbol_list_type_new ("", (yylsp[0])); } |
a9439670 | 2816 | /* Line 1721 of yacc.c */ |
415b8823 | 2817 | #line 2818 "src/parse-gram.c" |
f7398526 AD |
2818 | break; |
2819 | ||
dd875058 | 2820 | case 71: |
a9439670 | 2821 | /* Line 1721 of yacc.c */ |
398c298c | 2822 | #line 533 "src/parse-gram.y" |
1921f1d7 | 2823 | { |
e3dda35c | 2824 | current_type = (yyvsp[0].uniqstr); |
1f4cc0f4 | 2825 | tag_seen = true; |
4cdb01db | 2826 | } |
a9439670 | 2827 | /* Line 1721 of yacc.c */ |
415b8823 | 2828 | #line 2829 "src/parse-gram.c" |
e9955c83 | 2829 | break; |
1921f1d7 | 2830 | |
dd875058 | 2831 | case 72: |
a9439670 | 2832 | /* Line 1721 of yacc.c */ |
398c298c | 2833 | #line 538 "src/parse-gram.y" |
1921f1d7 | 2834 | { |
e3dda35c AD |
2835 | symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true); |
2836 | symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0])); | |
4cdb01db | 2837 | } |
a9439670 | 2838 | /* Line 1721 of yacc.c */ |
415b8823 | 2839 | #line 2840 "src/parse-gram.c" |
e9955c83 | 2840 | break; |
1921f1d7 | 2841 | |
dd875058 | 2842 | case 73: |
a9439670 | 2843 | /* Line 1721 of yacc.c */ |
398c298c | 2844 | #line 543 "src/parse-gram.y" |
1921f1d7 | 2845 | { |
e3dda35c AD |
2846 | symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true); |
2847 | symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1])); | |
2848 | symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); | |
4cdb01db | 2849 | } |
a9439670 | 2850 | /* Line 1721 of yacc.c */ |
415b8823 | 2851 | #line 2852 "src/parse-gram.c" |
e9955c83 | 2852 | break; |
1921f1d7 | 2853 | |
dd875058 | 2854 | case 74: |
a9439670 | 2855 | /* Line 1721 of yacc.c */ |
398c298c | 2856 | #line 549 "src/parse-gram.y" |
1921f1d7 | 2857 | { |
e3dda35c AD |
2858 | symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true); |
2859 | symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1])); | |
2860 | symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc)); | |
4cdb01db | 2861 | } |
a9439670 | 2862 | /* Line 1721 of yacc.c */ |
415b8823 | 2863 | #line 2864 "src/parse-gram.c" |
e9955c83 | 2864 | break; |
1921f1d7 | 2865 | |
dd875058 | 2866 | case 75: |
a9439670 | 2867 | /* Line 1721 of yacc.c */ |
398c298c | 2868 | #line 555 "src/parse-gram.y" |
1921f1d7 | 2869 | { |
e3dda35c AD |
2870 | symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true); |
2871 | symbol_type_set ((yyvsp[-2].symbol), current_type, (yylsp[-2])); | |
2872 | symbol_user_token_number_set ((yyvsp[-2].symbol), (yyvsp[-1].integer), (yylsp[-1])); | |
2873 | symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc)); | |
4cdb01db | 2874 | } |
a9439670 | 2875 | /* Line 1721 of yacc.c */ |
415b8823 | 2876 | #line 2877 "src/parse-gram.c" |
e9955c83 | 2877 | break; |
1921f1d7 | 2878 | |
dd875058 | 2879 | case 82: |
a9439670 | 2880 | /* Line 1721 of yacc.c */ |
398c298c | 2881 | #line 585 "src/parse-gram.y" |
b275314e AD |
2882 | { |
2883 | yyerrok; | |
2884 | } | |
a9439670 | 2885 | /* Line 1721 of yacc.c */ |
415b8823 | 2886 | #line 2887 "src/parse-gram.c" |
e9955c83 | 2887 | break; |
1921f1d7 | 2888 | |
dd875058 | 2889 | case 83: |
a9439670 | 2890 | /* Line 1721 of yacc.c */ |
398c298c | 2891 | #line 591 "src/parse-gram.y" |
f9d52903 | 2892 | { current_lhs ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); } |
a9439670 | 2893 | /* Line 1721 of yacc.c */ |
415b8823 | 2894 | #line 2895 "src/parse-gram.c" |
f9d52903 JD |
2895 | break; |
2896 | ||
2897 | case 84: | |
a9439670 | 2898 | /* Line 1721 of yacc.c */ |
398c298c | 2899 | #line 592 "src/parse-gram.y" |
f9d52903 JD |
2900 | { |
2901 | /* Free the current lhs. */ | |
2902 | current_lhs (0, (yylsp[-3]), 0); | |
2903 | } | |
a9439670 | 2904 | /* Line 1721 of yacc.c */ |
415b8823 | 2905 | #line 2906 "src/parse-gram.c" |
e9955c83 | 2906 | break; |
1921f1d7 | 2907 | |
dd875058 | 2908 | case 85: |
a9439670 | 2909 | /* Line 1721 of yacc.c */ |
398c298c | 2910 | #line 599 "src/parse-gram.y" |
e3dda35c | 2911 | { grammar_current_rule_end ((yylsp[0])); } |
a9439670 | 2912 | /* Line 1721 of yacc.c */ |
415b8823 | 2913 | #line 2914 "src/parse-gram.c" |
4cdb01db | 2914 | break; |
1921f1d7 | 2915 | |
dd875058 | 2916 | case 86: |
a9439670 | 2917 | /* Line 1721 of yacc.c */ |
398c298c | 2918 | #line 600 "src/parse-gram.y" |
e3dda35c | 2919 | { grammar_current_rule_end ((yylsp[0])); } |
a9439670 | 2920 | /* Line 1721 of yacc.c */ |
415b8823 | 2921 | #line 2922 "src/parse-gram.c" |
e9955c83 | 2922 | break; |
1921f1d7 | 2923 | |
dd875058 | 2924 | case 88: |
a9439670 | 2925 | /* Line 1721 of yacc.c */ |
398c298c | 2926 | #line 606 "src/parse-gram.y" |
f9d52903 | 2927 | { grammar_current_rule_begin (current_lhs_symbol, current_lhs_location, |
e9690142 | 2928 | current_lhs_named_ref); } |
a9439670 | 2929 | /* Line 1721 of yacc.c */ |
415b8823 | 2930 | #line 2931 "src/parse-gram.c" |
e9071366 AD |
2931 | break; |
2932 | ||
dd875058 | 2933 | case 89: |
a9439670 | 2934 | /* Line 1721 of yacc.c */ |
398c298c | 2935 | #line 609 "src/parse-gram.y" |
d70059ec | 2936 | { grammar_current_rule_symbol_append ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); } |
a9439670 | 2937 | /* Line 1721 of yacc.c */ |
415b8823 | 2938 | #line 2939 "src/parse-gram.c" |
676385e2 PH |
2939 | break; |
2940 | ||
dd875058 | 2941 | case 90: |
a9439670 | 2942 | /* Line 1721 of yacc.c */ |
398c298c | 2943 | #line 611 "src/parse-gram.y" |
ca2a6d15 | 2944 | { grammar_current_rule_action_append ((yyvsp[-1].code), (yylsp[-1]), (yyvsp[0].named_ref), false); } |
a9439670 | 2945 | /* Line 1721 of yacc.c */ |
415b8823 | 2946 | #line 2947 "src/parse-gram.c" |
676385e2 PH |
2947 | break; |
2948 | ||
dd875058 | 2949 | case 91: |
a9439670 | 2950 | /* Line 1721 of yacc.c */ |
398c298c | 2951 | #line 613 "src/parse-gram.y" |
ca2a6d15 | 2952 | { grammar_current_rule_action_append ((yyvsp[0].code), (yylsp[0]), NULL, true); } |
a9439670 | 2953 | /* Line 1721 of yacc.c */ |
415b8823 | 2954 | #line 2955 "src/parse-gram.c" |
3fa3725a PE |
2955 | break; |
2956 | ||
dd875058 | 2957 | case 92: |
a9439670 | 2958 | /* Line 1721 of yacc.c */ |
398c298c | 2959 | #line 615 "src/parse-gram.y" |
ca2a6d15 | 2960 | { grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); } |
a9439670 | 2961 | /* Line 1721 of yacc.c */ |
415b8823 | 2962 | #line 2963 "src/parse-gram.c" |
5e6feb86 PE |
2963 | break; |
2964 | ||
dd875058 | 2965 | case 93: |
a9439670 | 2966 | /* Line 1721 of yacc.c */ |
398c298c | 2967 | #line 617 "src/parse-gram.y" |
ca2a6d15 | 2968 | { grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); } |
a9439670 | 2969 | /* Line 1721 of yacc.c */ |
415b8823 | 2970 | #line 2971 "src/parse-gram.c" |
b275314e AD |
2971 | break; |
2972 | ||
dd875058 | 2973 | case 94: |
a9439670 | 2974 | /* Line 1721 of yacc.c */ |
398c298c | 2975 | #line 619 "src/parse-gram.y" |
ca2a6d15 | 2976 | { grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); } |
a9439670 | 2977 | /* Line 1721 of yacc.c */ |
415b8823 | 2978 | #line 2979 "src/parse-gram.c" |
d70059ec AR |
2979 | break; |
2980 | ||
dd875058 | 2981 | case 95: |
a9439670 | 2982 | /* Line 1721 of yacc.c */ |
398c298c | 2983 | #line 623 "src/parse-gram.y" |
ca2a6d15 | 2984 | { (yyval.named_ref) = 0; } |
a9439670 | 2985 | /* Line 1721 of yacc.c */ |
415b8823 | 2986 | #line 2987 "src/parse-gram.c" |
ca2a6d15 PH |
2987 | break; |
2988 | ||
2989 | case 96: | |
a9439670 | 2990 | /* Line 1721 of yacc.c */ |
398c298c | 2991 | #line 625 "src/parse-gram.y" |
d70059ec | 2992 | { (yyval.named_ref) = named_ref_new((yyvsp[0].uniqstr), (yylsp[0])); } |
a9439670 | 2993 | /* Line 1721 of yacc.c */ |
415b8823 | 2994 | #line 2995 "src/parse-gram.c" |
d70059ec AR |
2995 | break; |
2996 | ||
ca2a6d15 | 2997 | case 98: |
a9439670 | 2998 | /* Line 1721 of yacc.c */ |
398c298c | 2999 | #line 636 "src/parse-gram.y" |
e3dda35c | 3000 | { (yyval.uniqstr) = uniqstr_new ((yyvsp[0].chars)); } |
a9439670 | 3001 | /* Line 1721 of yacc.c */ |
415b8823 | 3002 | #line 3003 "src/parse-gram.c" |
16dc6a9e JD |
3003 | break; |
3004 | ||
ca2a6d15 | 3005 | case 99: |
a9439670 | 3006 | /* Line 1721 of yacc.c */ |
398c298c | 3007 | #line 641 "src/parse-gram.y" |
1c729058 | 3008 | { (yyval.chars) = ""; } |
a9439670 | 3009 | /* Line 1721 of yacc.c */ |
415b8823 | 3010 | #line 3011 "src/parse-gram.c" |
2ce4ed68 AD |
3011 | break; |
3012 | ||
ca2a6d15 | 3013 | case 100: |
a9439670 | 3014 | /* Line 1721 of yacc.c */ |
398c298c | 3015 | #line 642 "src/parse-gram.y" |
cf499cff | 3016 | { (yyval.chars) = (yyvsp[0].uniqstr); } |
a9439670 | 3017 | /* Line 1721 of yacc.c */ |
415b8823 | 3018 | #line 3019 "src/parse-gram.c" |
cf499cff JD |
3019 | break; |
3020 | ||
ca2a6d15 | 3021 | case 102: |
a9439670 | 3022 | /* Line 1721 of yacc.c */ |
398c298c | 3023 | #line 653 "src/parse-gram.y" |
2ce4ed68 | 3024 | { |
7c0c6181 | 3025 | code_props plain_code; |
e3dda35c AD |
3026 | (yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n'; |
3027 | code_props_plain_init (&plain_code, (yyvsp[0].code)+1, (yylsp[0])); | |
7c0c6181 JD |
3028 | code_props_translate_code (&plain_code); |
3029 | gram_scanner_last_string_free (); | |
3030 | (yyval.chars) = plain_code.code; | |
2ce4ed68 | 3031 | } |
a9439670 | 3032 | /* Line 1721 of yacc.c */ |
415b8823 | 3033 | #line 3034 "src/parse-gram.c" |
2ce4ed68 AD |
3034 | break; |
3035 | ||
ca2a6d15 | 3036 | case 103: |
a9439670 | 3037 | /* Line 1721 of yacc.c */ |
398c298c | 3038 | #line 673 "src/parse-gram.y" |
e3dda35c | 3039 | { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } |
a9439670 | 3040 | /* Line 1721 of yacc.c */ |
415b8823 | 3041 | #line 3042 "src/parse-gram.c" |
916708d5 AD |
3042 | break; |
3043 | ||
ca2a6d15 | 3044 | case 104: |
a9439670 | 3045 | /* Line 1721 of yacc.c */ |
398c298c | 3046 | #line 675 "src/parse-gram.y" |
d2a1a60a | 3047 | { |
e3dda35c AD |
3048 | (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0])); |
3049 | symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); | |
3050 | symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0])); | |
d2a1a60a | 3051 | } |
a9439670 | 3052 | /* Line 1721 of yacc.c */ |
415b8823 | 3053 | #line 3054 "src/parse-gram.c" |
66ef8b9d PE |
3054 | break; |
3055 | ||
ca2a6d15 | 3056 | case 105: |
a9439670 | 3057 | /* Line 1721 of yacc.c */ |
398c298c | 3058 | #line 683 "src/parse-gram.y" |
e3dda35c | 3059 | { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } |
a9439670 | 3060 | /* Line 1721 of yacc.c */ |
415b8823 | 3061 | #line 3062 "src/parse-gram.c" |
58d7a1a1 AD |
3062 | break; |
3063 | ||
ca2a6d15 | 3064 | case 108: |
a9439670 | 3065 | /* Line 1721 of yacc.c */ |
398c298c | 3066 | #line 695 "src/parse-gram.y" |
1921f1d7 | 3067 | { |
e3dda35c AD |
3068 | (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0])); |
3069 | symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); | |
4cdb01db | 3070 | } |
a9439670 | 3071 | /* Line 1721 of yacc.c */ |
415b8823 | 3072 | #line 3073 "src/parse-gram.c" |
e9955c83 | 3073 | break; |
1921f1d7 | 3074 | |
ca2a6d15 | 3075 | case 110: |
a9439670 | 3076 | /* Line 1721 of yacc.c */ |
398c298c | 3077 | #line 704 "src/parse-gram.y" |
1921f1d7 | 3078 | { |
7c0c6181 | 3079 | code_props plain_code; |
e3dda35c | 3080 | code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0])); |
7c0c6181 | 3081 | code_props_translate_code (&plain_code); |
e9071366 | 3082 | gram_scanner_last_string_free (); |
e3dda35c | 3083 | muscle_code_grow ("epilogue", plain_code.code, (yylsp[0])); |
7c0c6181 | 3084 | code_scanner_last_string_free (); |
4cdb01db | 3085 | } |
a9439670 | 3086 | /* Line 1721 of yacc.c */ |
415b8823 | 3087 | #line 3088 "src/parse-gram.c" |
e9955c83 AD |
3088 | break; |
3089 | ||
3090 | ||
a9439670 | 3091 | /* Line 1721 of yacc.c */ |
415b8823 | 3092 | #line 3093 "src/parse-gram.c" |
107844a3 JD |
3093 | default: break; |
3094 | } | |
3095 | if (yychar_backup != yychar) | |
3096 | YY_LAC_DISCARD ("yychar change"); | |
3097 | } | |
df222dfa JD |
3098 | /* User semantic actions sometimes alter yychar, and that requires |
3099 | that yytoken be updated with the new translation. We take the | |
3100 | approach of translating immediately before every use of yytoken. | |
3101 | One alternative is translating here after every semantic action, | |
3102 | but that translation would be missed if the semantic action invokes | |
3103 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or | |
3104 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an | |
3105 | incorrect destructor might then be invoked immediately. In the | |
3106 | case of YYERROR or YYBACKUP, subsequent parser actions might lead | |
3107 | to an incorrect destructor call or verbose syntax error message | |
3108 | before the lookahead is translated. */ | |
66809587 | 3109 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
1921f1d7 | 3110 | |
3b0ffc7e PE |
3111 | YYPOPSTACK (yylen); |
3112 | yylen = 0; | |
05d18c24 | 3113 | YY_STACK_PRINT (yyss, yyssp); |
e9955c83 AD |
3114 | |
3115 | *++yyvsp = yyval; | |
e9955c83 | 3116 | *++yylsp = yyloc; |
e9955c83 AD |
3117 | |
3118 | /* Now `shift' the result of the reduction. Determine what state | |
3119 | that goes to, based on the state we popped back to and the rule | |
3120 | number reduced by. */ | |
3121 | ||
3122 | yyn = yyr1[yyn]; | |
3123 | ||
1921f1d7 | 3124 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
219741d8 | 3125 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
e9955c83 AD |
3126 | yystate = yytable[yystate]; |
3127 | else | |
1921f1d7 | 3128 | yystate = yydefgoto[yyn - YYNTOKENS]; |
e9955c83 AD |
3129 | |
3130 | goto yynewstate; | |
3131 | ||
3132 | ||
3133 | /*------------------------------------. | |
3134 | | yyerrlab -- here on detecting error | | |
3135 | `------------------------------------*/ | |
3136 | yyerrlab: | |
df222dfa JD |
3137 | /* Make sure we have latest lookahead translation. See comments at |
3138 | user semantic actions for why this is necessary. */ | |
d2060f06 | 3139 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
df222dfa | 3140 | |
e9955c83 AD |
3141 | /* If not already recovering from an error, report this error. */ |
3142 | if (!yyerrstatus) | |
3143 | { | |
3144 | ++yynerrs; | |
2abdfeef PE |
3145 | #if ! YYERROR_VERBOSE |
3146 | yyerror (YY_("syntax error")); | |
3147 | #else | |
107844a3 JD |
3148 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
3149 | yyesa, &yyes, &yyes_capacity, \ | |
3150 | yyssp, yytoken) | |
b4bbc4a0 JD |
3151 | { |
3152 | char const *yymsgp = YY_("syntax error"); | |
bf35c71c | 3153 | int yysyntax_error_status; |
107844a3 JD |
3154 | if (yychar != YYEMPTY) |
3155 | YY_LAC_ESTABLISH; | |
bf35c71c | 3156 | yysyntax_error_status = YYSYNTAX_ERROR; |
b4bbc4a0 JD |
3157 | if (yysyntax_error_status == 0) |
3158 | yymsgp = yymsg; | |
d2060f06 | 3159 | else if (yysyntax_error_status == 1) |
b4bbc4a0 JD |
3160 | { |
3161 | if (yymsg != yymsgbuf) | |
3162 | YYSTACK_FREE (yymsg); | |
3163 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); | |
3164 | if (!yymsg) | |
3165 | { | |
3166 | yymsg = yymsgbuf; | |
3167 | yymsg_alloc = sizeof yymsgbuf; | |
d2060f06 | 3168 | yysyntax_error_status = 2; |
b4bbc4a0 JD |
3169 | } |
3170 | else | |
3171 | { | |
3172 | yysyntax_error_status = YYSYNTAX_ERROR; | |
3173 | yymsgp = yymsg; | |
3174 | } | |
3175 | } | |
3176 | yyerror (yymsgp); | |
3177 | if (yysyntax_error_status == 2) | |
3178 | goto yyexhaustedlab; | |
3179 | } | |
3180 | # undef YYSYNTAX_ERROR | |
2abdfeef | 3181 | #endif |
e9955c83 | 3182 | } |
e9955c83 | 3183 | |
44c2b42d | 3184 | yyerror_range[1] = yylloc; |
78a00b7d | 3185 | |
e9955c83 AD |
3186 | if (yyerrstatus == 3) |
3187 | { | |
9bc0dd67 | 3188 | /* If just tried and failed to reuse lookahead token after an |
e9690142 | 3189 | error, discard it. */ |
e9955c83 | 3190 | |
465b4444 | 3191 | if (yychar <= YYEOF) |
e9690142 JD |
3192 | { |
3193 | /* Return failure if at end of input. */ | |
3194 | if (yychar == YYEOF) | |
3195 | YYABORT; | |
3196 | } | |
465b4444 | 3197 | else |
e9690142 JD |
3198 | { |
3199 | yydestruct ("Error: discarding", | |
3200 | yytoken, &yylval, &yylloc); | |
3201 | yychar = YYEMPTY; | |
3202 | } | |
e9955c83 AD |
3203 | } |
3204 | ||
9bc0dd67 | 3205 | /* Else will try to reuse lookahead token after shifting the error |
e9955c83 | 3206 | token. */ |
6d5aa694 | 3207 | goto yyerrlab1; |
e9955c83 | 3208 | |
05d18c24 | 3209 | |
465b4444 PE |
3210 | /*---------------------------------------------------. |
3211 | | yyerrorlab -- error raised explicitly by YYERROR. | | |
3212 | `---------------------------------------------------*/ | |
3213 | yyerrorlab: | |
3214 | ||
e1054895 PE |
3215 | /* Pacify compilers like GCC when the user code never invokes |
3216 | YYERROR and the label yyerrorlab therefore never appears in user | |
3217 | code. */ | |
e764d4df | 3218 | if (/*CONSTCOND*/ 0) |
465b4444 | 3219 | goto yyerrorlab; |
465b4444 | 3220 | |
44c2b42d | 3221 | yyerror_range[1] = yylsp[1-yylen]; |
3b0ffc7e PE |
3222 | /* Do not reclaim the symbols of the rule which action triggered |
3223 | this YYERROR. */ | |
3224 | YYPOPSTACK (yylen); | |
3225 | yylen = 0; | |
3226 | YY_STACK_PRINT (yyss, yyssp); | |
465b4444 | 3227 | yystate = *yyssp; |
465b4444 PE |
3228 | goto yyerrlab1; |
3229 | ||
3230 | ||
3231 | /*-------------------------------------------------------------. | |
3232 | | yyerrlab1 -- common code for both syntax error and YYERROR. | | |
3233 | `-------------------------------------------------------------*/ | |
05d18c24 | 3234 | yyerrlab1: |
e9690142 | 3235 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
e9955c83 | 3236 | |
1921f1d7 AD |
3237 | for (;;) |
3238 | { | |
3239 | yyn = yypact[yystate]; | |
f2b30bdf | 3240 | if (!yypact_value_is_default (yyn)) |
e9690142 JD |
3241 | { |
3242 | yyn += YYTERROR; | |
3243 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
3244 | { | |
3245 | yyn = yytable[yyn]; | |
3246 | if (0 < yyn) | |
3247 | break; | |
3248 | } | |
3249 | } | |
4cdb01db | 3250 | |
1921f1d7 AD |
3251 | /* Pop the current state because it cannot handle the error token. */ |
3252 | if (yyssp == yyss) | |
e9690142 | 3253 | YYABORT; |
0c15323d | 3254 | |
44c2b42d | 3255 | yyerror_range[1] = *yylsp; |
4b367315 | 3256 | yydestruct ("Error: popping", |
e9690142 | 3257 | yystos[yystate], yyvsp, yylsp); |
3b0ffc7e | 3258 | YYPOPSTACK (1); |
465b4444 | 3259 | yystate = *yyssp; |
05d18c24 | 3260 | YY_STACK_PRINT (yyss, yyssp); |
e9955c83 AD |
3261 | } |
3262 | ||
107844a3 JD |
3263 | /* If the stack popping above didn't lose the initial context for the |
3264 | current lookahead token, the shift below will for sure. */ | |
3265 | YY_LAC_DISCARD ("error recovery"); | |
3266 | ||
e9955c83 | 3267 | *++yyvsp = yylval; |
8a8dc872 | 3268 | |
44c2b42d | 3269 | yyerror_range[2] = yylloc; |
8a8dc872 | 3270 | /* Using YYLLOC is tempting, but would change the location of |
9bc0dd67 | 3271 | the lookahead. YYLOC is available though. */ |
44c2b42d | 3272 | YYLLOC_DEFAULT (yyloc, yyerror_range, 2); |
78a00b7d | 3273 | *++yylsp = yyloc; |
e9955c83 | 3274 | |
3b0ffc7e | 3275 | /* Shift the error token. */ |
6088a2a0 | 3276 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
8a8dc872 | 3277 | |
e9955c83 AD |
3278 | yystate = yyn; |
3279 | goto yynewstate; | |
3280 | ||
3281 | ||
3282 | /*-------------------------------------. | |
3283 | | yyacceptlab -- YYACCEPT comes here. | | |
3284 | `-------------------------------------*/ | |
3285 | yyacceptlab: | |
3286 | yyresult = 0; | |
3287 | goto yyreturn; | |
3288 | ||
3289 | /*-----------------------------------. | |
3290 | | yyabortlab -- YYABORT comes here. | | |
3291 | `-----------------------------------*/ | |
3292 | yyabortlab: | |
3293 | yyresult = 1; | |
3294 | goto yyreturn; | |
3295 | ||
107844a3 | 3296 | #if 1 |
6088a2a0 PE |
3297 | /*-------------------------------------------------. |
3298 | | yyexhaustedlab -- memory exhaustion comes here. | | |
3299 | `-------------------------------------------------*/ | |
3300 | yyexhaustedlab: | |
3301 | yyerror (YY_("memory exhausted")); | |
e9955c83 AD |
3302 | yyresult = 2; |
3303 | /* Fall through. */ | |
366eea36 | 3304 | #endif |
e9955c83 AD |
3305 | |
3306 | yyreturn: | |
ec5479ce | 3307 | if (yychar != YYEMPTY) |
df222dfa JD |
3308 | { |
3309 | /* Make sure we have latest lookahead translation. See comments at | |
3310 | user semantic actions for why this is necessary. */ | |
3311 | yytoken = YYTRANSLATE (yychar); | |
3312 | yydestruct ("Cleanup: discarding lookahead", | |
3313 | yytoken, &yylval, &yylloc); | |
3314 | } | |
3b0ffc7e PE |
3315 | /* Do not reclaim the symbols of the rule which action triggered |
3316 | this YYABORT or YYACCEPT. */ | |
3317 | YYPOPSTACK (yylen); | |
3318 | YY_STACK_PRINT (yyss, yyssp); | |
d11e0cfa PE |
3319 | while (yyssp != yyss) |
3320 | { | |
ec5d1a8a | 3321 | yydestruct ("Cleanup: popping", |
e9690142 | 3322 | yystos[*yyssp], yyvsp, yylsp); |
3b0ffc7e | 3323 | YYPOPSTACK (1); |
d11e0cfa | 3324 | } |
e9955c83 AD |
3325 | #ifndef yyoverflow |
3326 | if (yyss != yyssa) | |
3327 | YYSTACK_FREE (yyss); | |
2abdfeef | 3328 | #endif |
107844a3 JD |
3329 | if (yyes != yyesa) |
3330 | YYSTACK_FREE (yyes); | |
2abdfeef PE |
3331 | #if YYERROR_VERBOSE |
3332 | if (yymsg != yymsgbuf) | |
3333 | YYSTACK_FREE (yymsg); | |
e9955c83 | 3334 | #endif |
d2a1a60a PE |
3335 | /* Make sure YYID is used. */ |
3336 | return YYID (yyresult); | |
e9955c83 | 3337 | } |
1921f1d7 | 3338 | |
a9439670 | 3339 | /* Line 1981 of yacc.c */ |
398c298c | 3340 | #line 714 "src/parse-gram.y" |
05d18c24 PE |
3341 | |
3342 | ||
3343 | ||
3344 | /* Return the location of the left-hand side of a rule whose | |
3345 | right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in | |
3346 | the right-hand side, and return an empty location equal to the end | |
3347 | boundary of RHS[0] if the right-hand side is empty. */ | |
3348 | ||
3349 | static YYLTYPE | |
3350 | lloc_default (YYLTYPE const *rhs, int n) | |
3351 | { | |
3352 | int i; | |
1d64f0ba | 3353 | YYLTYPE loc; |
329d23c5 PE |
3354 | |
3355 | /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;". | |
3356 | The bug is fixed in 7.4.2m, but play it safe for now. */ | |
3357 | loc.start = rhs[n].end; | |
3358 | loc.end = rhs[n].end; | |
05d18c24 | 3359 | |
59420cd7 | 3360 | /* Ignore empty nonterminals the start of the right-hand side. |
73521d9f PE |
3361 | Do not bother to ignore them at the end of the right-hand side, |
3362 | since empty nonterminals have the same end as their predecessors. */ | |
05d18c24 PE |
3363 | for (i = 1; i <= n; i++) |
3364 | if (! equal_boundaries (rhs[i].start, rhs[i].end)) | |
3365 | { | |
e9690142 JD |
3366 | loc.start = rhs[i].start; |
3367 | break; | |
05d18c24 PE |
3368 | } |
3369 | ||
1d64f0ba | 3370 | return loc; |
05d18c24 PE |
3371 | } |
3372 | ||
3373 | ||
05d18c24 | 3374 | static void |
b18cdd91 | 3375 | add_param (param_type type, char *decl, location loc) |
05d18c24 | 3376 | { |
8a8dc872 | 3377 | static char const alphanum[26 + 26 + 1 + 10] = |
05d18c24 PE |
3378 | "abcdefghijklmnopqrstuvwxyz" |
3379 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
8a8dc872 AD |
3380 | "_" |
3381 | "0123456789"; | |
dd875058 | 3382 | |
05d18c24 | 3383 | char const *name_start = NULL; |
dd875058 AD |
3384 | { |
3385 | char *p; | |
3386 | /* Stop on last actual character. */ | |
3387 | for (p = decl; p[1]; p++) | |
3388 | if ((p == decl | |
3389 | || ! memchr (alphanum, p[-1], sizeof alphanum)) | |
3390 | && memchr (alphanum, p[0], sizeof alphanum - 10)) | |
3391 | name_start = p; | |
3392 | ||
3393 | /* Strip the surrounding '{' and '}', and any blanks just inside | |
3394 | the braces. */ | |
3395 | while (*--p == ' ' || *p == '\t') | |
3396 | continue; | |
3397 | p[1] = '\0'; | |
3398 | while (*++decl == ' ' || *decl == '\t') | |
3399 | continue; | |
3400 | } | |
73521d9f | 3401 | |
05d18c24 | 3402 | if (! name_start) |
415b8823 AD |
3403 | complain_at (loc, complaint, |
3404 | _("missing identifier in parameter declaration")); | |
05d18c24 PE |
3405 | else |
3406 | { | |
398c298c | 3407 | char *name = xmemdup0 (name_start, strspn (name_start, alphanum)); |
b18cdd91 AD |
3408 | if (type & param_lex) |
3409 | muscle_pair_list_grow ("lex_param", decl, name); | |
3410 | if (type & param_parse) | |
3411 | muscle_pair_list_grow ("parse_param", decl, name); | |
05d18c24 PE |
3412 | free (name); |
3413 | } | |
3414 | ||
e9071366 | 3415 | gram_scanner_last_string_free (); |
05d18c24 | 3416 | } |
e9955c83 | 3417 | |
2ce4ed68 | 3418 | |
b50d2359 AD |
3419 | static void |
3420 | version_check (location const *loc, char const *version) | |
3421 | { | |
3422 | if (strverscmp (version, PACKAGE_VERSION) > 0) | |
9b8a5ce0 | 3423 | { |
415b8823 | 3424 | complain_at (*loc, complaint, "require bison %s, but have %s", |
e9690142 | 3425 | version, PACKAGE_VERSION); |
6f8f253b | 3426 | exit (EX_MISMATCH); |
9b8a5ce0 | 3427 | } |
b50d2359 AD |
3428 | } |
3429 | ||
05d18c24 PE |
3430 | static void |
3431 | gram_error (location const *loc, char const *msg) | |
e9955c83 | 3432 | { |
415b8823 | 3433 | complain_at (*loc, complaint, "%s", msg); |
e9955c83 | 3434 | } |
1921f1d7 | 3435 | |
73521d9f PE |
3436 | char const * |
3437 | token_name (int type) | |
3438 | { | |
e0045d49 | 3439 | return yytname[YYTRANSLATE (type)]; |
73521d9f PE |
3440 | } |
3441 | ||
d2a1a60a PE |
3442 | static char const * |
3443 | char_name (char c) | |
3444 | { | |
3445 | if (c == '\'') | |
3446 | return "'\\''"; | |
3447 | else | |
3448 | { | |
3449 | char buf[4]; | |
3450 | buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0'; | |
3451 | return quotearg_style (escape_quoting_style, buf); | |
3452 | } | |
3453 | } |