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