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