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