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