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