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