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