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