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