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