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