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