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