]>
Commit | Line | Data |
---|---|---|
8ecac08f | 1 | /* A Bison parser, made by GNU Bison 2.7.1087-c21e-dirty. */ |
1c7b7e1d | 2 | |
fe3cae17 | 3 | /* Bison implementation for Yacc-like parsers in C |
21db118b | 4 | |
3f4bc2c1 | 5 | Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. |
21db118b | 6 | |
f16b0819 | 7 | This program is free software: you can redistribute it and/or modify |
1921f1d7 | 8 | it under the terms of the GNU General Public License as published by |
f16b0819 PE |
9 | the Free Software Foundation, either version 3 of the License, or |
10 | (at your option) any later version. | |
21db118b | 11 | |
1921f1d7 AD |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
21db118b | 16 | |
1921f1d7 | 17 | You should have received a copy of the GNU General Public License |
f16b0819 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
1921f1d7 | 19 | |
04c12cb8 PE |
20 | /* As a special exception, you may create a larger work that contains |
21 | part or all of the Bison parser skeleton and distribute that work | |
22 | under terms of your choice, so long as that work isn't itself a | |
23 | parser generator using the skeleton or a modified version thereof | |
24 | as a parser skeleton. Alternatively, if you modify or redistribute | |
25 | the parser skeleton itself, you may (at your option) remove this | |
26 | special exception, which will cause the skeleton and the resulting | |
27 | Bison output files to be licensed under the GNU General Public | |
28 | License without this special exception. | |
21db118b | 29 | |
04c12cb8 PE |
30 | This special exception was added by the Free Software Foundation in |
31 | version 2.2 of Bison. */ | |
1921f1d7 | 32 | |
66809587 PE |
33 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
34 | simplifying the original so-called "semantic" parser. */ | |
1921f1d7 AD |
35 | |
36 | /* All symbols defined below should begin with yy or YY, to avoid | |
37 | infringing on user name space. This should be done even for local | |
38 | variables, as they might otherwise be expanded by user macros. | |
39 | There are some unavoidable exceptions within include files to | |
40 | define necessary library symbols; they are noted "INFRINGES ON | |
41 | USER NAME SPACE" below. */ | |
42 | ||
43 | /* Identify Bison output. */ | |
62ddaef6 PE |
44 | #define YYBISON 1 |
45 | ||
f5109f5a | 46 | /* Bison version. */ |
8ecac08f | 47 | #define YYBISON_VERSION "2.7.1087-c21e-dirty" |
f5109f5a | 48 | |
62ddaef6 PE |
49 | /* Skeleton name. */ |
50 | #define YYSKELETON_NAME "yacc.c" | |
1921f1d7 AD |
51 | |
52 | /* Pure parsers. */ | |
246ff8c1 | 53 | #define YYPURE 2 |
1921f1d7 | 54 | |
e021811a JD |
55 | /* Push parsers. */ |
56 | #define YYPUSH 0 | |
57 | ||
58 | /* Pull parsers. */ | |
59 | #define YYPULL 1 | |
60 | ||
8d9cffff AD |
61 | /* Substitute the type names. */ |
62 | #define YYSTYPE GRAM_STYPE | |
63 | #define YYLTYPE GRAM_LTYPE | |
76dcf299 | 64 | /* Substitute the variable and function names. */ |
e021811a JD |
65 | #define yyparse gram_parse |
66 | #define yylex gram_lex | |
67 | #define yyerror gram_error | |
e021811a JD |
68 | #define yydebug gram_debug |
69 | #define yynerrs gram_nerrs | |
3f4bc2c1 | 70 | |
e9955c83 | 71 | |
1921f1d7 | 72 | /* Copy the first part of user declarations. */ |
3f4bc2c1 | 73 | #line 1 "src/parse-gram.y" /* yacc.c:357 */ |
a76ca263 PE |
74 | /* Bison Grammar Parser -*- C -*- |
75 | ||
3f4bc2c1 | 76 | Copyright (C) 2002-2013 Free Software Foundation, Inc. |
a76ca263 PE |
77 | |
78 | This file is part of Bison, the GNU Compiler Compiler. | |
79 | ||
f16b0819 | 80 | This program is free software: you can redistribute it and/or modify |
a76ca263 | 81 | it under the terms of the GNU General Public License as published by |
f16b0819 | 82 | the Free Software Foundation, either version 3 of the License, or |
a76ca263 PE |
83 | (at your option) any later version. |
84 | ||
85 | This program is distributed in the hope that it will be useful, | |
86 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
87 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
88 | GNU General Public License for more details. | |
89 | ||
90 | You should have received a copy of the GNU General Public License | |
f16b0819 | 91 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
e9955c83 | 92 | |
72c4d336 | 93 | #include <config.h> |
e9955c83 | 94 | #include "system.h" |
05d18c24 | 95 | |
457bf919 | 96 | #include "c-ctype.h" |
b275314e | 97 | #include "complain.h" |
05d18c24 | 98 | #include "conflicts.h" |
e9955c83 AD |
99 | #include "files.h" |
100 | #include "getargs.h" | |
e9955c83 | 101 | #include "gram.h" |
3583d96b | 102 | #include "muscle-tab.h" |
f7c0fe19 | 103 | #include "named-ref.h" |
2ce37586 | 104 | #include "quotearg.h" |
e9955c83 | 105 | #include "reader.h" |
05d18c24 | 106 | #include "symlist.h" |
0294b130 | 107 | #include "symtab.h" |
e9071366 AD |
108 | #include "scan-gram.h" |
109 | #include "scan-code.h" | |
398c298c | 110 | #include "xmemdup0.h" |
e9955c83 | 111 | |
05d18c24 PE |
112 | #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N) |
113 | static YYLTYPE lloc_default (YYLTYPE const *, int); | |
e9955c83 | 114 | |
8a8dc872 | 115 | #define YY_LOCATION_PRINT(File, Loc) \ |
74ce3cfb | 116 | location_print (Loc, File) |
8a8dc872 | 117 | |
b50d2359 AD |
118 | static void version_check (location const *loc, char const *version); |
119 | ||
05d18c24 | 120 | static void gram_error (location const *, char const *); |
e9955c83 | 121 | |
66c209cf | 122 | /* A string that describes a char (e.g., 'a' -> "'a'"). */ |
d2a1a60a PE |
123 | static char const *char_name (char); |
124 | ||
246ff8c1 | 125 | #line 126 "src/parse-gram.c" /* yacc.c:357 */ |
398c298c AD |
126 | |
127 | # ifndef YY_NULL | |
128 | # if defined __cplusplus && 201103L <= __cplusplus | |
129 | # define YY_NULL nullptr | |
130 | # else | |
131 | # define YY_NULL 0 | |
132 | # endif | |
133 | # endif | |
136a0f76 | 134 | |
1921f1d7 AD |
135 | /* Enabling verbose error messages. */ |
136 | #ifdef YYERROR_VERBOSE | |
137 | # undef YYERROR_VERBOSE | |
138 | # define YYERROR_VERBOSE 1 | |
139 | #else | |
cd3684cf | 140 | # define YYERROR_VERBOSE 1 |
1921f1d7 AD |
141 | #endif |
142 | ||
415b8823 AD |
143 | /* In a future release of Bison, this section will be replaced |
144 | by #include "src/parse-gram.h". */ | |
bb8e56ff TR |
145 | #ifndef YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED |
146 | # define YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED | |
0a9042a6 | 147 | /* Debug traces. */ |
8d9cffff AD |
148 | #ifndef GRAM_DEBUG |
149 | # if defined YYDEBUG | |
415b8823 | 150 | #if YYDEBUG |
8d9cffff AD |
151 | # define GRAM_DEBUG 1 |
152 | # else | |
153 | # define GRAM_DEBUG 0 | |
154 | # endif | |
155 | # else /* ! defined YYDEBUG */ | |
156 | # define GRAM_DEBUG 1 | |
157 | # endif /* ! defined YYDEBUG */ | |
158 | #endif /* ! defined GRAM_DEBUG */ | |
159 | #if GRAM_DEBUG | |
415b8823 AD |
160 | extern int gram_debug; |
161 | #endif | |
162 | /* "%code requires" blocks. */ | |
246ff8c1 | 163 | #line 219 "src/parse-gram.y" /* yacc.c:373 */ |
415b8823 AD |
164 | |
165 | # ifndef PARAM_TYPE | |
166 | # define PARAM_TYPE | |
167 | typedef enum | |
168 | { | |
169 | param_none = 0, | |
170 | param_lex = 1 << 0, | |
171 | param_parse = 1 << 1, | |
172 | param_both = param_lex | param_parse | |
173 | } param_type; | |
174 | # endif | |
175 | ||
176 | ||
246ff8c1 | 177 | #line 178 "src/parse-gram.c" /* yacc.c:373 */ |
415b8823 | 178 | |
0a9042a6 | 179 | /* Token type. */ |
8d9cffff AD |
180 | #ifndef GRAM_TOKENTYPE |
181 | # define GRAM_TOKENTYPE | |
8d9cffff | 182 | enum gram_tokentype |
a9439670 AD |
183 | { |
184 | GRAM_EOF = 0, | |
185 | STRING = 258, | |
186 | INT = 259, | |
187 | PERCENT_TOKEN = 260, | |
188 | PERCENT_NTERM = 261, | |
189 | PERCENT_TYPE = 262, | |
190 | PERCENT_DESTRUCTOR = 263, | |
191 | PERCENT_PRINTER = 264, | |
192 | PERCENT_LEFT = 265, | |
193 | PERCENT_RIGHT = 266, | |
194 | PERCENT_NONASSOC = 267, | |
195 | PERCENT_PRECEDENCE = 268, | |
196 | PERCENT_PREC = 269, | |
197 | PERCENT_DPREC = 270, | |
198 | PERCENT_MERGE = 271, | |
199 | PERCENT_CODE = 272, | |
200 | PERCENT_DEFAULT_PREC = 273, | |
201 | PERCENT_DEFINE = 274, | |
202 | PERCENT_DEFINES = 275, | |
203 | PERCENT_ERROR_VERBOSE = 276, | |
204 | PERCENT_EXPECT = 277, | |
205 | PERCENT_EXPECT_RR = 278, | |
206 | PERCENT_FLAG = 279, | |
207 | PERCENT_FILE_PREFIX = 280, | |
208 | PERCENT_GLR_PARSER = 281, | |
209 | PERCENT_INITIAL_ACTION = 282, | |
210 | PERCENT_LANGUAGE = 283, | |
211 | PERCENT_NAME_PREFIX = 284, | |
212 | PERCENT_NO_DEFAULT_PREC = 285, | |
213 | PERCENT_NO_LINES = 286, | |
214 | PERCENT_NONDETERMINISTIC_PARSER = 287, | |
215 | PERCENT_OUTPUT = 288, | |
216 | PERCENT_REQUIRE = 289, | |
217 | PERCENT_SKELETON = 290, | |
218 | PERCENT_START = 291, | |
219 | PERCENT_TOKEN_TABLE = 292, | |
220 | PERCENT_VERBOSE = 293, | |
221 | PERCENT_YACC = 294, | |
222 | BRACED_CODE = 295, | |
223 | BRACED_PREDICATE = 296, | |
224 | BRACKETED_ID = 297, | |
225 | CHAR = 298, | |
226 | EPILOGUE = 299, | |
227 | EQUAL = 300, | |
228 | ID = 301, | |
229 | ID_COLON = 302, | |
230 | PERCENT_PERCENT = 303, | |
231 | PIPE = 304, | |
232 | PROLOGUE = 305, | |
233 | SEMICOLON = 306, | |
234 | TAG = 307, | |
235 | TAG_ANY = 308, | |
236 | TAG_NONE = 309, | |
237 | PERCENT_PARAM = 310, | |
8ecac08f AD |
238 | PERCENT_UNION = 311, |
239 | PERCENT_EMPTY = 312 | |
a9439670 | 240 | }; |
415b8823 AD |
241 | #endif |
242 | /* Tokens. */ | |
243 | #define GRAM_EOF 0 | |
244 | #define STRING 258 | |
245 | #define INT 259 | |
246 | #define PERCENT_TOKEN 260 | |
247 | #define PERCENT_NTERM 261 | |
248 | #define PERCENT_TYPE 262 | |
249 | #define PERCENT_DESTRUCTOR 263 | |
250 | #define PERCENT_PRINTER 264 | |
251 | #define PERCENT_LEFT 265 | |
252 | #define PERCENT_RIGHT 266 | |
253 | #define PERCENT_NONASSOC 267 | |
254 | #define PERCENT_PRECEDENCE 268 | |
255 | #define PERCENT_PREC 269 | |
256 | #define PERCENT_DPREC 270 | |
257 | #define PERCENT_MERGE 271 | |
258 | #define PERCENT_CODE 272 | |
259 | #define PERCENT_DEFAULT_PREC 273 | |
260 | #define PERCENT_DEFINE 274 | |
261 | #define PERCENT_DEFINES 275 | |
262 | #define PERCENT_ERROR_VERBOSE 276 | |
263 | #define PERCENT_EXPECT 277 | |
264 | #define PERCENT_EXPECT_RR 278 | |
265 | #define PERCENT_FLAG 279 | |
266 | #define PERCENT_FILE_PREFIX 280 | |
267 | #define PERCENT_GLR_PARSER 281 | |
268 | #define PERCENT_INITIAL_ACTION 282 | |
269 | #define PERCENT_LANGUAGE 283 | |
270 | #define PERCENT_NAME_PREFIX 284 | |
271 | #define PERCENT_NO_DEFAULT_PREC 285 | |
272 | #define PERCENT_NO_LINES 286 | |
273 | #define PERCENT_NONDETERMINISTIC_PARSER 287 | |
274 | #define PERCENT_OUTPUT 288 | |
275 | #define PERCENT_REQUIRE 289 | |
276 | #define PERCENT_SKELETON 290 | |
277 | #define PERCENT_START 291 | |
278 | #define PERCENT_TOKEN_TABLE 292 | |
279 | #define PERCENT_VERBOSE 293 | |
280 | #define PERCENT_YACC 294 | |
281 | #define BRACED_CODE 295 | |
282 | #define BRACED_PREDICATE 296 | |
283 | #define BRACKETED_ID 297 | |
284 | #define CHAR 298 | |
285 | #define EPILOGUE 299 | |
286 | #define EQUAL 300 | |
287 | #define ID 301 | |
288 | #define ID_COLON 302 | |
289 | #define PERCENT_PERCENT 303 | |
290 | #define PIPE 304 | |
291 | #define PROLOGUE 305 | |
292 | #define SEMICOLON 306 | |
293 | #define TAG 307 | |
294 | #define TAG_ANY 308 | |
295 | #define TAG_NONE 309 | |
296 | #define PERCENT_PARAM 310 | |
297 | #define PERCENT_UNION 311 | |
8ecac08f | 298 | #define PERCENT_EMPTY 312 |
415b8823 | 299 | |
0a9042a6 | 300 | /* Value type. */ |
8d9cffff | 301 | #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED |
0a9042a6 AD |
302 | typedef union GRAM_STYPE GRAM_STYPE; |
303 | union GRAM_STYPE | |
415b8823 | 304 | { |
246ff8c1 | 305 | #line 105 "src/parse-gram.y" /* yacc.c:373 */ |
415b8823 AD |
306 | |
307 | assoc assoc; | |
308 | char *code; | |
309 | char const *chars; | |
310 | int integer; | |
311 | named_ref *named_ref; | |
312 | symbol *symbol; | |
313 | symbol_list *list; | |
314 | uniqstr uniqstr; | |
315 | unsigned char character; | |
316 | ||
246ff8c1 | 317 | #line 243 "src/parse-gram.y" /* yacc.c:373 */ |
415b8823 AD |
318 | |
319 | param_type param; | |
320 | ||
246ff8c1 | 321 | #line 419 "src/parse-gram.y" /* yacc.c:373 */ |
0294b130 | 322 | code_props_type code_type; |
415b8823 | 323 | |
8ecac08f | 324 | #line 325 "src/parse-gram.c" /* yacc.c:373 */ |
0a9042a6 | 325 | }; |
8d9cffff AD |
326 | # define GRAM_STYPE_IS_TRIVIAL 1 |
327 | # define GRAM_STYPE_IS_DECLARED 1 | |
415b8823 AD |
328 | #endif |
329 | ||
0a9042a6 | 330 | /* Location type. */ |
8d9cffff | 331 | #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED |
0a9042a6 AD |
332 | typedef struct GRAM_LTYPE GRAM_LTYPE; |
333 | struct GRAM_LTYPE | |
415b8823 AD |
334 | { |
335 | int first_line; | |
336 | int first_column; | |
337 | int last_line; | |
338 | int last_column; | |
0a9042a6 | 339 | }; |
8d9cffff AD |
340 | # define GRAM_LTYPE_IS_DECLARED 1 |
341 | # define GRAM_LTYPE_IS_TRIVIAL 1 | |
415b8823 AD |
342 | #endif |
343 | ||
344 | ||
0a9042a6 | 345 | |
415b8823 | 346 | int gram_parse (void); |
5f3df396 | 347 | |
bb8e56ff | 348 | #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */ |
73521d9f | 349 | |
1921f1d7 | 350 | /* Copy the second part of user declarations. */ |
0c15323d | 351 | |
8ecac08f | 352 | #line 353 "src/parse-gram.c" /* yacc.c:376 */ |
0a9042a6 | 353 | /* Unqualified %code blocks. */ |
246ff8c1 | 354 | #line 54 "src/parse-gram.y" /* yacc.c:377 */ |
b18cdd91 | 355 | |
dd875058 | 356 | static int current_prec = 0; |
b18cdd91 AD |
357 | static location current_lhs_location; |
358 | static named_ref *current_lhs_named_ref; | |
f9d52903 | 359 | static symbol *current_lhs_symbol; |
dd875058 AD |
360 | static symbol_class current_class = unknown_sym; |
361 | static uniqstr current_type = NULL; | |
b18cdd91 | 362 | |
f9d52903 JD |
363 | /** Set the new current left-hand side symbol, possibly common |
364 | * to several right-hand side parts of rule. | |
365 | */ | |
366 | static | |
367 | void | |
246ff8c1 | 368 | current_lhs (symbol *sym, location loc, named_ref *ref) |
f9d52903 JD |
369 | { |
370 | current_lhs_symbol = sym; | |
371 | current_lhs_location = loc; | |
372 | /* In order to simplify memory management, named references for lhs | |
373 | are always assigned by deep copy into the current symbol_list | |
374 | node. This is because a single named-ref in the grammar may | |
375 | result in several uses when the user factors lhs between several | |
376 | rules using "|". Therefore free the parser's original copy. */ | |
377 | free (current_lhs_named_ref); | |
378 | current_lhs_named_ref = ref; | |
379 | } | |
380 | ||
b18cdd91 AD |
381 | #define YYTYPE_INT16 int_fast16_t |
382 | #define YYTYPE_INT8 int_fast8_t | |
383 | #define YYTYPE_UINT16 uint_fast16_t | |
384 | #define YYTYPE_UINT8 uint_fast8_t | |
385 | ||
246ff8c1 | 386 | #line 232 "src/parse-gram.y" /* yacc.c:377 */ |
b18cdd91 AD |
387 | |
388 | /** Add a lex-param and/or a parse-param. | |
389 | * | |
390 | * \param type where to push this formal argument. | |
391 | * \param decl the formal argument. Destroyed. | |
392 | * \param loc the location in the source. | |
393 | */ | |
394 | static void add_param (param_type type, char *decl, location loc); | |
dd875058 | 395 | static param_type current_param = param_none; |
b18cdd91 AD |
396 | |
397 | ||
8ecac08f | 398 | #line 399 "src/parse-gram.c" /* yacc.c:377 */ |
bf8b3d98 PE |
399 | |
400 | #ifdef short | |
401 | # undef short | |
402 | #endif | |
403 | ||
404 | #ifdef YYTYPE_UINT8 | |
405 | typedef YYTYPE_UINT8 yytype_uint8; | |
406 | #else | |
407 | typedef unsigned char yytype_uint8; | |
408 | #endif | |
409 | ||
410 | #ifdef YYTYPE_INT8 | |
411 | typedef YYTYPE_INT8 yytype_int8; | |
bf8b3d98 | 412 | #else |
86027be9 | 413 | typedef signed char yytype_int8; |
bf8b3d98 PE |
414 | #endif |
415 | ||
416 | #ifdef YYTYPE_UINT16 | |
417 | typedef YYTYPE_UINT16 yytype_uint16; | |
418 | #else | |
419 | typedef unsigned short int yytype_uint16; | |
420 | #endif | |
421 | ||
422 | #ifdef YYTYPE_INT16 | |
423 | typedef YYTYPE_INT16 yytype_int16; | |
424 | #else | |
425 | typedef short int yytype_int16; | |
426 | #endif | |
2ed28444 | 427 | |
ac243428 | 428 | #ifndef YYSIZE_T |
bf8b3d98 | 429 | # ifdef __SIZE_TYPE__ |
ac243428 | 430 | # define YYSIZE_T __SIZE_TYPE__ |
bf8b3d98 | 431 | # elif defined size_t |
ac243428 | 432 | # define YYSIZE_T size_t |
86027be9 | 433 | # elif ! defined YYSIZE_T |
ac243428 PE |
434 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
435 | # define YYSIZE_T size_t | |
436 | # else | |
437 | # define YYSIZE_T unsigned int | |
438 | # endif | |
4b43d402 | 439 | #endif |
e9955c83 | 440 | |
2abdfeef PE |
441 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
442 | ||
6088a2a0 | 443 | #ifndef YY_ |
1625df5b | 444 | # if defined YYENABLE_NLS && YYENABLE_NLS |
6088a2a0 PE |
445 | # if ENABLE_NLS |
446 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | |
25b27513 | 447 | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
6088a2a0 PE |
448 | # endif |
449 | # endif | |
450 | # ifndef YY_ | |
25b27513 | 451 | # define YY_(Msgid) Msgid |
6088a2a0 PE |
452 | # endif |
453 | #endif | |
454 | ||
e764d4df | 455 | /* Suppress unused-variable warnings by "using" E. */ |
95dbea81 | 456 | #ifdef __GNUC__ |
25b27513 | 457 | # define YYUSE(E) ((void) (E)) |
7029f892 | 458 | #else |
25b27513 | 459 | # define YYUSE(E) /* empty */ |
7029f892 PE |
460 | #endif |
461 | ||
107844a3 | 462 | #if 1 |
cd3684cf | 463 | |
e9955c83 AD |
464 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
465 | ||
e9955c83 | 466 | # ifdef YYSTACK_ALLOC |
45eebca4 | 467 | /* Pacify GCC's 'empty if-body' warning. */ |
95dbea81 | 468 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
2ce37586 | 469 | # ifndef YYSTACK_ALLOC_MAXIMUM |
7768896a PE |
470 | /* The OS might guarantee only one guard page at the bottom of the stack, |
471 | and a page size can be as small as 4096 bytes. So we cannot safely | |
472 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number | |
473 | to allow for a few compiler-allocated temporary stack slots. */ | |
f52b276c | 474 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
2ce37586 | 475 | # endif |
e9955c83 | 476 | # else |
cd3684cf AD |
477 | # define YYSTACK_ALLOC YYMALLOC |
478 | # define YYSTACK_FREE YYFREE | |
2ce37586 | 479 | # ifndef YYSTACK_ALLOC_MAXIMUM |
2abdfeef | 480 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
2ce37586 | 481 | # endif |
8ff146cd | 482 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
765f22f0 | 483 | && ! ((defined YYMALLOC || defined malloc) \ |
e9690142 | 484 | && (defined YYFREE || defined free))) |
765f22f0 | 485 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
8ff146cd PE |
486 | # ifndef EXIT_SUCCESS |
487 | # define EXIT_SUCCESS 0 | |
765f22f0 | 488 | # endif |
0925ebb4 | 489 | # endif |
4b43d402 PE |
490 | # ifndef YYMALLOC |
491 | # define YYMALLOC malloc | |
86027be9 | 492 | # if ! defined malloc && ! defined EXIT_SUCCESS |
4b43d402 PE |
493 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
494 | # endif | |
495 | # endif | |
496 | # ifndef YYFREE | |
497 | # define YYFREE free | |
86027be9 | 498 | # if ! defined free && ! defined EXIT_SUCCESS |
4b43d402 PE |
499 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
500 | # endif | |
501 | # endif | |
e9955c83 | 502 | # endif |
107844a3 JD |
503 | # define YYCOPY_NEEDED 1 |
504 | #endif | |
e9955c83 AD |
505 | |
506 | ||
bf8b3d98 PE |
507 | #if (! defined yyoverflow \ |
508 | && (! defined __cplusplus \ | |
8d9cffff AD |
509 | || (defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL \ |
510 | && defined GRAM_STYPE_IS_TRIVIAL && GRAM_STYPE_IS_TRIVIAL))) | |
e9955c83 AD |
511 | |
512 | /* A type that is properly aligned for any stack member. */ | |
513 | union yyalloc | |
514 | { | |
e021811a JD |
515 | yytype_int16 yyss_alloc; |
516 | YYSTYPE yyvs_alloc; | |
517 | YYLTYPE yyls_alloc; | |
e9955c83 AD |
518 | }; |
519 | ||
520 | /* The size of the maximum gap between one aligned stack and the next. */ | |
05d18c24 | 521 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
e9955c83 AD |
522 | |
523 | /* The size of an array large to enough to hold all stacks, each with | |
524 | N elements. */ | |
366eea36 | 525 | # define YYSTACK_BYTES(N) \ |
bf8b3d98 | 526 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
05d18c24 | 527 | + 2 * YYSTACK_GAP_MAXIMUM) |
e9955c83 | 528 | |
107844a3 | 529 | # define YYCOPY_NEEDED 1 |
e9955c83 AD |
530 | |
531 | /* Relocate STACK from its old location to the new one. The | |
532 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
533 | elements in the stack, and YYPTR gives the new location of the | |
534 | stack. Advance YYPTR to a properly aligned location for the next | |
535 | stack. */ | |
e9690142 JD |
536 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
537 | do \ | |
538 | { \ | |
539 | YYSIZE_T yynewbytes; \ | |
540 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | |
541 | Stack = &yyptr->Stack_alloc; \ | |
542 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
543 | yyptr += yynewbytes / sizeof (*yyptr); \ | |
544 | } \ | |
95dbea81 | 545 | while (0) |
e9955c83 AD |
546 | |
547 | #endif | |
548 | ||
107844a3 | 549 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
e7b94cc3 | 550 | /* Copy COUNT objects from SRC to DST. The source and destination do |
107844a3 JD |
551 | not overlap. */ |
552 | # ifndef YYCOPY | |
553 | # if defined __GNUC__ && 1 < __GNUC__ | |
e7b94cc3 AD |
554 | # define YYCOPY(Dst, Src, Count) \ |
555 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) | |
107844a3 | 556 | # else |
e7b94cc3 | 557 | # define YYCOPY(Dst, Src, Count) \ |
e9690142 JD |
558 | do \ |
559 | { \ | |
560 | YYSIZE_T yyi; \ | |
561 | for (yyi = 0; yyi < (Count); yyi++) \ | |
e7b94cc3 | 562 | (Dst)[yyi] = (Src)[yyi]; \ |
e9690142 | 563 | } \ |
95dbea81 | 564 | while (0) |
107844a3 JD |
565 | # endif |
566 | # endif | |
567 | #endif /* !YYCOPY_NEEDED */ | |
568 | ||
3b0ffc7e | 569 | /* YYFINAL -- State number of the termination state. */ |
1921f1d7 | 570 | #define YYFINAL 3 |
d33cb3ae | 571 | /* YYLAST -- Last index in YYTABLE. */ |
8ecac08f | 572 | #define YYLAST 158 |
1921f1d7 | 573 | |
3b0ffc7e | 574 | /* YYNTOKENS -- Number of terminals. */ |
8ecac08f | 575 | #define YYNTOKENS 58 |
3b0ffc7e | 576 | /* YYNNTS -- Number of nonterminals. */ |
0294b130 | 577 | #define YYNNTS 38 |
3b0ffc7e | 578 | /* YYNRULES -- Number of rules. */ |
8ecac08f | 579 | #define YYNRULES 110 |
086fd113 | 580 | /* YYNSTATES -- Number of states. */ |
8ecac08f | 581 | #define YYNSTATES 144 |
1921f1d7 | 582 | |
2df9ec37 AD |
583 | /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned |
584 | by yylex, with out-of-bounds checking. */ | |
1921f1d7 | 585 | #define YYUNDEFTOK 2 |
8ecac08f | 586 | #define YYMAXUTOK 312 |
1921f1d7 | 587 | |
e9690142 | 588 | #define YYTRANSLATE(YYX) \ |
73521d9f | 589 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
1921f1d7 | 590 | |
2df9ec37 AD |
591 | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
592 | as returned by yylex, without out-of-bounds checking. */ | |
bf8b3d98 | 593 | static const yytype_uint8 yytranslate[] = |
1921f1d7 AD |
594 | { |
595 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
596 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
597 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
598 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
599 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
600 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
601 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
602 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
603 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
604 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
605 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
606 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
607 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
608 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
609 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
610 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
611 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
612 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
613 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
614 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
615 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
616 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
617 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
618 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
619 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
620 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | |
621 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | |
622 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | |
623 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | |
ae7453f2 | 624 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
d70059ec | 625 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
8ecac08f | 626 | 55, 56, 57 |
1921f1d7 AD |
627 | }; |
628 | ||
8d9cffff | 629 | #if GRAM_DEBUG |
0a9042a6 | 630 | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
bf8b3d98 | 631 | static const yytype_uint16 yyrline[] = |
1921f1d7 | 632 | { |
8ecac08f | 633 | 0, 268, 268, 277, 278, 282, 283, 293, 297, 302, |
246ff8c1 AD |
634 | 303, 308, 313, 314, 315, 316, 321, 330, 331, 332, |
635 | 333, 334, 335, 335, 336, 337, 361, 362, 363, 364, | |
636 | 368, 369, 378, 379, 380, 384, 396, 400, 404, 411, | |
637 | 422, 423, 433, 434, 438, 450, 450, 455, 455, 460, | |
638 | 471, 486, 487, 488, 489, 493, 494, 499, 501, 506, | |
639 | 507, 512, 514, 519, 520, 524, 525, 529, 530, 531, | |
640 | 536, 541, 546, 552, 558, 569, 570, 579, 580, 586, | |
8ecac08f AD |
641 | 587, 588, 595, 595, 603, 604, 605, 610, 613, 615, |
642 | 617, 619, 621, 623, 625, 630, 631, 641, 642, 647, | |
643 | 648, 649, 658, 678, 680, 689, 694, 695, 700, 708, | |
644 | 709 | |
1921f1d7 AD |
645 | }; |
646 | #endif | |
647 | ||
8d9cffff | 648 | #if GRAM_DEBUG || YYERROR_VERBOSE || 1 |
9cbfdc9e | 649 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
3b0ffc7e | 650 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
1921f1d7 AD |
651 | static const char *const yytname[] = |
652 | { | |
9cbfdc9e | 653 | "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"", |
e9071366 | 654 | "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"", |
f7398526 AD |
655 | "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", |
656 | "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"", | |
2f5b478e AD |
657 | "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"", |
658 | "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"", | |
659 | "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"", | |
b18cdd91 AD |
660 | "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"", |
661 | "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"", | |
662 | "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"", | |
ca2a6d15 PH |
663 | "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"", |
664 | "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", | |
665 | "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"", | |
8ecac08f AD |
666 | "\"%param\"", "\"%union\"", "\"%empty\"", "$accept", "input", |
667 | "prologue_declarations", "prologue_declaration", "$@1", "params", | |
668 | "grammar_declaration", "code_props_type", "union_name", | |
669 | "symbol_declaration", "$@2", "$@3", "precedence_declaration", | |
670 | "precedence_declarator", "tag.opt", "symbols.prec", "symbol.prec", | |
671 | "symbols.1", "generic_symlist", "generic_symlist_item", "tag", | |
672 | "symbol_def", "symbol_defs.1", "grammar", "rules_or_grammar_declaration", | |
673 | "rules", "$@4", "rhses.1", "rhs", "named_ref.opt", "variable", | |
674 | "content.opt", "braceless", "id", "id_colon", "symbol", "string_as_id", | |
675 | "epilogue.opt", YY_NULL | |
1921f1d7 AD |
676 | }; |
677 | #endif | |
678 | ||
3d38c03a | 679 | # ifdef YYPRINT |
2df9ec37 AD |
680 | /* YYTOKNUM[NUM] -- (External) token number corresponding to the |
681 | (internal) symbol number NUM (which must be that of a token). */ | |
bf8b3d98 | 682 | static const yytype_uint16 yytoknum[] = |
1921f1d7 AD |
683 | { |
684 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
685 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | |
686 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | |
687 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |
d6328241 | 688 | 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, |
8ecac08f | 689 | 305, 306, 307, 308, 309, 310, 311, 312 |
1921f1d7 | 690 | }; |
3d38c03a | 691 | # endif |
1921f1d7 | 692 | |
8ecac08f | 693 | #define YYPACT_NINF -99 |
1921f1d7 | 694 | |
25b27513 | 695 | #define yypact_value_is_default(Yystate) \ |
8ecac08f | 696 | (!!((Yystate) == (-99))) |
53f036ce | 697 | |
8ecac08f | 698 | #define YYTABLE_NINF -110 |
d12f8e49 | 699 | |
25b27513 | 700 | #define yytable_value_is_error(Yytable_value) \ |
95dbea81 | 701 | 0 |
53f036ce | 702 | |
d12f8e49 | 703 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
0a9042a6 | 704 | STATE-NUM. */ |
d12f8e49 | 705 | static const yytype_int16 yypact[] = |
1921f1d7 | 706 | { |
8ecac08f AD |
707 | -99, 5, 102, -99, -99, -99, -48, -99, -99, -99, |
708 | -99, -99, -99, 19, -99, 27, 52, -99, 56, 60, | |
709 | -99, 67, -99, 34, 73, 76, -99, -99, -99, 86, | |
710 | 87, 88, 0, -99, -99, -99, 15, -99, -99, -99, | |
711 | 46, -99, -99, 54, -99, -99, 45, 4, 4, 0, | |
712 | -99, 58, -99, -99, -99, 31, -99, -99, -99, -99, | |
713 | -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, | |
714 | -99, -99, 49, -99, 50, 1, -99, -99, 61, 62, | |
715 | -99, 58, 32, -99, 0, -99, -99, 4, 84, 4, | |
716 | 0, -99, -99, -99, -99, -99, -99, -99, 72, -99, | |
717 | -99, -99, -99, -99, 64, -99, -99, -99, -99, 32, | |
718 | -99, -99, -99, 0, -99, 101, -99, 114, -99, -99, | |
719 | -99, -99, -99, -99, -99, -99, -99, 12, 26, -99, | |
720 | -99, 0, 138, 66, 61, -99, -99, 61, 26, -99, | |
721 | -99, -99, -99, -99 | |
1921f1d7 AD |
722 | }; |
723 | ||
0a9042a6 AD |
724 | /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
725 | Performed when YYTABLE does not specify something else to do. Zero | |
726 | means the default is an error. */ | |
bf8b3d98 | 727 | static const yytype_uint8 yydefact[] = |
1921f1d7 | 728 | { |
25b27513 TR |
729 | 3, 0, 0, 1, 47, 45, 0, 40, 41, 51, |
730 | 52, 53, 54, 0, 36, 0, 9, 11, 0, 0, | |
731 | 7, 0, 15, 0, 0, 0, 37, 19, 20, 0, | |
732 | 0, 0, 0, 26, 27, 28, 0, 6, 29, 22, | |
733 | 42, 4, 5, 0, 33, 32, 55, 0, 0, 0, | |
8ecac08f AD |
734 | 102, 0, 38, 98, 97, 99, 10, 12, 13, 14, |
735 | 16, 17, 18, 21, 24, 25, 108, 104, 103, 106, | |
736 | 34, 107, 0, 105, 0, 0, 77, 79, 95, 0, | |
25b27513 | 737 | 43, 0, 0, 56, 0, 70, 75, 48, 71, 46, |
8ecac08f AD |
738 | 49, 61, 39, 101, 100, 8, 81, 80, 0, 78, |
739 | 2, 96, 82, 31, 23, 44, 67, 68, 69, 35, | |
25b27513 | 740 | 63, 66, 65, 50, 57, 59, 76, 72, 73, 62, |
8ecac08f AD |
741 | 110, 87, 30, 64, 58, 60, 74, 83, 84, 87, |
742 | 86, 0, 0, 0, 95, 90, 91, 95, 85, 92, | |
743 | 93, 94, 89, 88 | |
1921f1d7 AD |
744 | }; |
745 | ||
0a9042a6 | 746 | /* YYPGOTO[NTERM-NUM]. */ |
b143f404 | 747 | static const yytype_int16 yypgoto[] = |
1921f1d7 | 748 | { |
8ecac08f AD |
749 | -99, -99, -99, -99, -99, -99, 141, -99, -99, -99, |
750 | -99, -99, -99, -99, -99, -99, 33, -99, -99, 35, | |
751 | -99, -7, 97, -99, 74, -99, -99, -99, 18, -98, | |
752 | -99, -99, -13, 6, -99, -32, -73, -99 | |
1921f1d7 AD |
753 | }; |
754 | ||
0a9042a6 | 755 | /* YYDEFGOTO[NTERM-NUM]. */ |
d70059ec | 756 | static const yytype_int16 yydefgoto[] = |
d12f8e49 | 757 | { |
25b27513 TR |
758 | -1, 1, 2, 41, 79, 104, 74, 43, 81, 44, |
759 | 48, 47, 45, 46, 84, 113, 114, 90, 109, 110, | |
760 | 111, 86, 87, 75, 76, 77, 121, 127, 128, 102, | |
761 | 55, 95, 52, 69, 78, 112, 71, 100 | |
d12f8e49 AD |
762 | }; |
763 | ||
0a9042a6 AD |
764 | /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
765 | positive, shift that token. If negative, reduce the rule whose | |
766 | number is the opposite. If YYTABLE_NINF, syntax error. */ | |
2ce4ed68 | 767 | static const yytype_int16 yytable[] = |
1921f1d7 | 768 | { |
8ecac08f | 769 | 70, -109, 72, 66, 49, 3, 4, 5, 6, 7, |
25b27513 TR |
770 | 8, 9, 10, 11, 12, 118, 72, 91, 13, 14, |
771 | 4, 5, 6, 7, 8, 9, 10, 11, 12, 66, | |
8ecac08f AD |
772 | 53, 26, 13, 14, 93, 66, 142, 32, 92, 143, |
773 | 131, 132, 133, 67, 126, 26, 68, 67, 73, 98, | |
25b27513 | 774 | 68, 32, 115, 88, 88, 56, 85, 40, 119, 50, |
8ecac08f AD |
775 | 57, 129, 73, 130, 58, 51, 134, 135, 105, 67, |
776 | 59, 40, 68, 54, 60, 67, 61, 94, 68, 62, | |
777 | 116, 115, 116, 136, 106, 107, 108, 66, 117, 63, | |
778 | 64, 65, 80, 88, 82, 88, 137, 83, 50, 139, | |
779 | 96, 97, 103, 101, 122, 125, 137, 4, 5, 6, | |
780 | 7, 8, 9, 10, 11, 12, 120, 66, 141, 13, | |
781 | 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, | |
782 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, | |
783 | 34, 35, 140, 42, 123, 89, 124, 138, 0, 99, | |
784 | 36, 0, 37, 38, 0, 0, 0, 39, 40 | |
1921f1d7 AD |
785 | }; |
786 | ||
b18cdd91 | 787 | static const yytype_int16 yycheck[] = |
1921f1d7 | 788 | { |
8ecac08f | 789 | 32, 0, 1, 3, 52, 0, 5, 6, 7, 8, |
25b27513 TR |
790 | 9, 10, 11, 12, 13, 88, 1, 49, 17, 18, |
791 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 3, | |
8ecac08f AD |
792 | 3, 30, 17, 18, 3, 3, 134, 36, 51, 137, |
793 | 14, 15, 16, 43, 117, 30, 46, 43, 47, 48, | |
25b27513 | 794 | 46, 36, 84, 47, 48, 3, 52, 56, 90, 40, |
8ecac08f AD |
795 | 4, 49, 47, 51, 4, 46, 40, 41, 81, 43, |
796 | 3, 56, 46, 46, 40, 43, 3, 46, 46, 3, | |
797 | 87, 113, 89, 57, 52, 53, 54, 3, 4, 3, | |
798 | 3, 3, 46, 87, 40, 89, 128, 52, 40, 131, | |
799 | 51, 51, 40, 42, 40, 4, 138, 5, 6, 7, | |
800 | 8, 9, 10, 11, 12, 13, 44, 3, 52, 17, | |
801 | 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, | |
802 | 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, | |
803 | 38, 39, 4, 2, 109, 48, 113, 129, -1, 75, | |
804 | 48, -1, 50, 51, -1, -1, -1, 55, 56 | |
1921f1d7 AD |
805 | }; |
806 | ||
0a9042a6 AD |
807 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
808 | symbol of state STATE-NUM. */ | |
bf8b3d98 | 809 | static const yytype_uint8 yystos[] = |
1921f1d7 | 810 | { |
8ecac08f | 811 | 0, 59, 60, 0, 5, 6, 7, 8, 9, 10, |
3583d96b AD |
812 | 11, 12, 13, 17, 18, 19, 20, 21, 22, 23, |
813 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, | |
ca2a6d15 | 814 | 34, 35, 36, 37, 38, 39, 48, 50, 51, 55, |
8ecac08f AD |
815 | 56, 61, 64, 65, 67, 70, 71, 69, 68, 52, |
816 | 40, 46, 90, 3, 46, 88, 3, 4, 4, 3, | |
817 | 40, 3, 3, 3, 3, 3, 3, 43, 46, 91, | |
818 | 93, 94, 1, 47, 64, 81, 82, 83, 92, 62, | |
819 | 46, 66, 40, 52, 72, 52, 79, 80, 91, 80, | |
820 | 75, 93, 90, 3, 46, 89, 51, 51, 48, 82, | |
821 | 95, 42, 87, 40, 63, 90, 52, 53, 54, 76, | |
822 | 77, 78, 93, 73, 74, 93, 79, 4, 94, 93, | |
823 | 44, 84, 40, 77, 74, 4, 94, 85, 86, 49, | |
824 | 51, 14, 15, 16, 40, 41, 57, 93, 86, 93, | |
825 | 4, 52, 87, 87 | |
1921f1d7 | 826 | }; |
e9955c83 | 827 | |
0a9042a6 | 828 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
d12f8e49 AD |
829 | static const yytype_uint8 yyr1[] = |
830 | { | |
8ecac08f AD |
831 | 0, 58, 59, 60, 60, 61, 61, 61, 61, 61, |
832 | 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, | |
833 | 61, 61, 62, 61, 61, 61, 61, 61, 61, 61, | |
834 | 63, 63, 64, 64, 64, 64, 64, 64, 64, 64, | |
835 | 65, 65, 66, 66, 64, 68, 67, 69, 67, 67, | |
836 | 70, 71, 71, 71, 71, 72, 72, 73, 73, 74, | |
837 | 74, 75, 75, 76, 76, 77, 77, 78, 78, 78, | |
838 | 79, 79, 79, 79, 79, 80, 80, 81, 81, 82, | |
839 | 82, 82, 84, 83, 85, 85, 85, 86, 86, 86, | |
840 | 86, 86, 86, 86, 86, 87, 87, 88, 88, 89, | |
841 | 89, 89, 90, 91, 91, 92, 93, 93, 94, 95, | |
842 | 95 | |
d12f8e49 AD |
843 | }; |
844 | ||
0a9042a6 | 845 | /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
d12f8e49 AD |
846 | static const yytype_uint8 yyr2[] = |
847 | { | |
848 | 0, 2, 4, 0, 2, 1, 1, 1, 3, 1, | |
25b27513 TR |
849 | 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, |
850 | 1, 2, 0, 3, 2, 2, 1, 1, 1, 1, | |
851 | 2, 1, 1, 1, 2, 3, 1, 1, 2, 3, | |
852 | 1, 1, 0, 1, 3, 0, 3, 0, 3, 3, | |
853 | 3, 1, 1, 1, 1, 0, 1, 1, 2, 1, | |
854 | 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, | |
855 | 1, 1, 2, 2, 3, 1, 2, 1, 2, 1, | |
856 | 2, 2, 0, 4, 1, 3, 2, 0, 3, 3, | |
8ecac08f AD |
857 | 2, 2, 3, 3, 3, 0, 1, 1, 1, 0, |
858 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, | |
859 | 2 | |
d12f8e49 AD |
860 | }; |
861 | ||
862 | ||
e9690142 JD |
863 | #define yyerrok (yyerrstatus = 0) |
864 | #define yyclearin (yychar = YYEMPTY) | |
865 | #define YYEMPTY (-2) | |
866 | #define YYEOF 0 | |
1921f1d7 | 867 | |
e9690142 JD |
868 | #define YYACCEPT goto yyacceptlab |
869 | #define YYABORT goto yyabortlab | |
870 | #define YYERROR goto yyerrorlab | |
6d5aa694 | 871 | |
1921f1d7 | 872 | |
e9955c83 | 873 | #define YYRECOVERING() (!!yyerrstatus) |
1921f1d7 | 874 | |
e9690142 JD |
875 | #define YYBACKUP(Token, Value) \ |
876 | do \ | |
d9b968d8 | 877 | if (yychar == YYEMPTY) \ |
e9690142 JD |
878 | { \ |
879 | yychar = (Token); \ | |
880 | yylval = (Value); \ | |
d9b968d8 AD |
881 | YYPOPSTACK (yylen); \ |
882 | yystate = *yyssp; \ | |
e9690142 JD |
883 | YY_LAC_DISCARD ("YYBACKUP"); \ |
884 | goto yybackup; \ | |
885 | } \ | |
886 | else \ | |
887 | { \ | |
246ff8c1 | 888 | yyerror (&yylloc, YY_("syntax error: cannot back up")); \ |
e9690142 JD |
889 | YYERROR; \ |
890 | } \ | |
95dbea81 | 891 | while (0) |
e9955c83 | 892 | |
369342dd | 893 | /* Error token number */ |
e9690142 JD |
894 | #define YYTERROR 1 |
895 | #define YYERRCODE 256 | |
e9955c83 | 896 | |
8a8dc872 AD |
897 | |
898 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | |
899 | If N is 0, then set CURRENT to the empty location which ends | |
900 | the previous symbol: RHS[0] (always defined). */ | |
e9955c83 AD |
901 | |
902 | #ifndef YYLLOC_DEFAULT | |
e9690142 JD |
903 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
904 | do \ | |
95dbea81 | 905 | if (N) \ |
e9690142 JD |
906 | { \ |
907 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ | |
908 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ | |
909 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ | |
910 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ | |
911 | } \ | |
912 | else \ | |
913 | { \ | |
914 | (Current).first_line = (Current).last_line = \ | |
915 | YYRHSLOC (Rhs, 0).last_line; \ | |
916 | (Current).first_column = (Current).last_column = \ | |
917 | YYRHSLOC (Rhs, 0).last_column; \ | |
918 | } \ | |
95dbea81 | 919 | while (0) |
8a8dc872 AD |
920 | #endif |
921 | ||
a9439670 | 922 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
8a8dc872 | 923 | |
369342dd | 924 | |
c6a731ee AD |
925 | /* Enable debugging if requested. */ |
926 | #if GRAM_DEBUG | |
927 | ||
928 | # ifndef YYFPRINTF | |
929 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
930 | # define YYFPRINTF fprintf | |
931 | # endif | |
932 | ||
933 | # define YYDPRINTF(Args) \ | |
934 | do { \ | |
935 | if (yydebug) \ | |
936 | YYFPRINTF Args; \ | |
937 | } while (0) | |
938 | ||
939 | ||
8a8dc872 AD |
940 | /* YY_LOCATION_PRINT -- Print the location on the stream. |
941 | This macro was not mandated originally: define only if we know | |
942 | we won't break user code: when these are the locations we know. */ | |
943 | ||
944 | #ifndef YY_LOCATION_PRINT | |
8d9cffff | 945 | # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL |
0a9042a6 AD |
946 | |
947 | /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ | |
948 | ||
949 | __attribute__((__unused__)) | |
950 | static unsigned | |
951 | yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) | |
952 | { | |
953 | unsigned res = 0; | |
954 | int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; | |
955 | if (0 <= yylocp->first_line) | |
956 | { | |
c6a731ee | 957 | res += YYFPRINTF (yyo, "%d", yylocp->first_line); |
0a9042a6 | 958 | if (0 <= yylocp->first_column) |
c6a731ee | 959 | res += YYFPRINTF (yyo, ".%d", yylocp->first_column); |
0a9042a6 AD |
960 | } |
961 | if (0 <= yylocp->last_line) | |
962 | { | |
963 | if (yylocp->first_line < yylocp->last_line) | |
964 | { | |
c6a731ee | 965 | res += YYFPRINTF (yyo, "-%d", yylocp->last_line); |
0a9042a6 | 966 | if (0 <= end_col) |
c6a731ee | 967 | res += YYFPRINTF (yyo, ".%d", end_col); |
0a9042a6 AD |
968 | } |
969 | else if (0 <= end_col && yylocp->first_column < end_col) | |
c6a731ee | 970 | res += YYFPRINTF (yyo, "-%d", end_col); |
0a9042a6 AD |
971 | } |
972 | return res; | |
973 | } | |
974 | ||
c6a731ee | 975 | # define YY_LOCATION_PRINT(File, Loc) \ |
0a9042a6 AD |
976 | yy_location_print_ (File, &(Loc)) |
977 | ||
8a8dc872 AD |
978 | # else |
979 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | |
980 | # endif | |
e9955c83 AD |
981 | #endif |
982 | ||
8a8dc872 | 983 | |
e9690142 JD |
984 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
985 | do { \ | |
986 | if (yydebug) \ | |
987 | { \ | |
988 | YYFPRINTF (stderr, "%s ", Title); \ | |
989 | yy_symbol_print (stderr, \ | |
990 | Type, Value, Location); \ | |
991 | YYFPRINTF (stderr, "\n"); \ | |
992 | } \ | |
95dbea81 | 993 | } while (0) |
f0616f0b | 994 | |
3b0ffc7e | 995 | |
66809587 PE |
996 | /*--------------------------------. |
997 | | Print this symbol on YYOUTPUT. | | |
998 | `--------------------------------*/ | |
999 | ||
66809587 | 1000 | static void |
d2a1a60a | 1001 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) |
66809587 | 1002 | { |
398c298c | 1003 | FILE *yyo = yyoutput; |
3f4bc2c1 | 1004 | YYUSE (yyo); |
d9b968d8 | 1005 | YYUSE (yylocationp); |
bf8b3d98 PE |
1006 | if (!yyvaluep) |
1007 | return; | |
66809587 PE |
1008 | # ifdef YYPRINT |
1009 | if (yytype < YYNTOKENS) | |
1010 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
1011 | # endif | |
1012 | switch (yytype) | |
1013 | { | |
258b45c8 | 1014 | case 3: /* "string" */ |
246ff8c1 | 1015 | #line 192 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1016 | { fputs (quotearg_style (c_quoting_style, ((*yyvaluep).chars)), yyo); } |
8ecac08f | 1017 | #line 1018 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1018 | break; |
136a0f76 | 1019 | |
258b45c8 | 1020 | case 4: /* "integer" */ |
246ff8c1 | 1021 | #line 205 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1022 | { fprintf (yyo, "%d", ((*yyvaluep).integer)); } |
8ecac08f | 1023 | #line 1024 "src/parse-gram.c" /* yacc.c:707 */ |
86cfae0a AD |
1024 | break; |
1025 | ||
258b45c8 | 1026 | case 24: /* "%<flag>" */ |
246ff8c1 | 1027 | #line 201 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1028 | { fprintf (yyo, "%%%s", ((*yyvaluep).uniqstr)); } |
8ecac08f | 1029 | #line 1030 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1030 | break; |
136a0f76 | 1031 | |
258b45c8 | 1032 | case 40: /* "{...}" */ |
246ff8c1 | 1033 | #line 194 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1034 | { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).code)); } |
8ecac08f | 1035 | #line 1036 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1036 | break; |
136a0f76 | 1037 | |
258b45c8 | 1038 | case 42: /* "[identifier]" */ |
246ff8c1 | 1039 | #line 199 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1040 | { fprintf (yyo, "[%s]", ((*yyvaluep).uniqstr)); } |
8ecac08f | 1041 | #line 1042 "src/parse-gram.c" /* yacc.c:707 */ |
b143f404 JD |
1042 | break; |
1043 | ||
258b45c8 | 1044 | case 43: /* "char" */ |
246ff8c1 | 1045 | #line 186 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1046 | { fputs (char_name (((*yyvaluep).character)), yyo); } |
8ecac08f | 1047 | #line 1048 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1048 | break; |
136a0f76 | 1049 | |
258b45c8 | 1050 | case 44: /* "epilogue" */ |
246ff8c1 | 1051 | #line 194 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1052 | { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).chars)); } |
8ecac08f | 1053 | #line 1054 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1054 | break; |
136a0f76 | 1055 | |
258b45c8 | 1056 | case 46: /* "identifier" */ |
246ff8c1 | 1057 | #line 198 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1058 | { fputs (((*yyvaluep).uniqstr), yyo); } |
8ecac08f | 1059 | #line 1060 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1060 | break; |
136a0f76 | 1061 | |
258b45c8 | 1062 | case 47: /* "identifier:" */ |
246ff8c1 | 1063 | #line 200 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1064 | { fprintf (yyo, "%s:", ((*yyvaluep).uniqstr)); } |
8ecac08f | 1065 | #line 1066 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1066 | break; |
136a0f76 | 1067 | |
258b45c8 | 1068 | case 50: /* "%{...%}" */ |
246ff8c1 | 1069 | #line 194 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1070 | { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).chars)); } |
8ecac08f | 1071 | #line 1072 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1072 | break; |
136a0f76 | 1073 | |
258b45c8 | 1074 | case 52: /* "<tag>" */ |
246ff8c1 | 1075 | #line 202 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1076 | { fprintf (yyo, "<%s>", ((*yyvaluep).uniqstr)); } |
8ecac08f | 1077 | #line 1078 "src/parse-gram.c" /* yacc.c:707 */ |
b18cdd91 AD |
1078 | break; |
1079 | ||
258b45c8 | 1080 | case 55: /* "%param" */ |
246ff8c1 | 1081 | #line 248 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1082 | { |
b18cdd91 AD |
1083 | switch (((*yyvaluep).param)) |
1084 | { | |
1085 | #define CASE(In, Out) \ | |
dd875058 | 1086 | case param_ ## In: fputs ("%" #Out, stderr); break |
246ff8c1 AD |
1087 | CASE (lex, lex-param); |
1088 | CASE (parse, parse-param); | |
1089 | CASE (both, param); | |
b18cdd91 | 1090 | #undef CASE |
2d399888 | 1091 | case param_none: aver (false); break; |
dd875058 | 1092 | } |
b18cdd91 | 1093 | } |
8ecac08f | 1094 | #line 1095 "src/parse-gram.c" /* yacc.c:707 */ |
b143f404 JD |
1095 | break; |
1096 | ||
8ecac08f | 1097 | case 65: /* code_props_type */ |
246ff8c1 | 1098 | #line 420 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1099 | { fprintf (yyo, "%s", code_props_type_string (((*yyvaluep).code_type))); } |
8ecac08f | 1100 | #line 1101 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1101 | break; |
136a0f76 | 1102 | |
8ecac08f | 1103 | case 74: /* symbol.prec */ |
246ff8c1 | 1104 | #line 208 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1105 | { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); } |
8ecac08f | 1106 | #line 1107 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1107 | break; |
136a0f76 | 1108 | |
8ecac08f | 1109 | case 78: /* tag */ |
246ff8c1 | 1110 | #line 202 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1111 | { fprintf (yyo, "<%s>", ((*yyvaluep).uniqstr)); } |
8ecac08f | 1112 | #line 1113 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1113 | break; |
136a0f76 | 1114 | |
8ecac08f | 1115 | case 88: /* variable */ |
246ff8c1 | 1116 | #line 198 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1117 | { fputs (((*yyvaluep).uniqstr), yyo); } |
8ecac08f | 1118 | #line 1119 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1119 | break; |
16dc6a9e | 1120 | |
8ecac08f | 1121 | case 89: /* content.opt */ |
246ff8c1 | 1122 | #line 194 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1123 | { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).chars)); } |
8ecac08f | 1124 | #line 1125 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1125 | break; |
136a0f76 | 1126 | |
8ecac08f | 1127 | case 90: /* braceless */ |
246ff8c1 | 1128 | #line 194 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1129 | { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).chars)); } |
8ecac08f | 1130 | #line 1131 "src/parse-gram.c" /* yacc.c:707 */ |
0294b130 | 1131 | break; |
136a0f76 | 1132 | |
8ecac08f | 1133 | case 91: /* id */ |
246ff8c1 | 1134 | #line 208 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1135 | { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); } |
8ecac08f | 1136 | #line 1137 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1137 | break; |
136a0f76 | 1138 | |
8ecac08f | 1139 | case 92: /* id_colon */ |
246ff8c1 | 1140 | #line 209 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1141 | { fprintf (yyo, "%s:", ((*yyvaluep).symbol)->tag); } |
8ecac08f | 1142 | #line 1143 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1143 | break; |
136a0f76 | 1144 | |
8ecac08f | 1145 | case 93: /* symbol */ |
246ff8c1 | 1146 | #line 208 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1147 | { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); } |
8ecac08f | 1148 | #line 1149 "src/parse-gram.c" /* yacc.c:707 */ |
0294b130 | 1149 | break; |
136a0f76 | 1150 | |
8ecac08f | 1151 | case 94: /* string_as_id */ |
246ff8c1 | 1152 | #line 208 "src/parse-gram.y" /* yacc.c:707 */ |
258b45c8 | 1153 | { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); } |
8ecac08f | 1154 | #line 1155 "src/parse-gram.c" /* yacc.c:707 */ |
dc450175 | 1155 | break; |
136a0f76 | 1156 | |
66809587 | 1157 | default: |
e9690142 | 1158 | break; |
66809587 | 1159 | } |
3b0ffc7e PE |
1160 | } |
1161 | ||
1162 | ||
1163 | /*--------------------------------. | |
1164 | | Print this symbol on YYOUTPUT. | | |
1165 | `--------------------------------*/ | |
1166 | ||
3b0ffc7e | 1167 | static void |
d2a1a60a | 1168 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) |
3b0ffc7e | 1169 | { |
c6a731ee AD |
1170 | YYFPRINTF (yyoutput, "%s %s (", |
1171 | yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); | |
3b0ffc7e PE |
1172 | |
1173 | YY_LOCATION_PRINT (yyoutput, *yylocationp); | |
1174 | YYFPRINTF (yyoutput, ": "); | |
1175 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp); | |
66809587 PE |
1176 | YYFPRINTF (yyoutput, ")"); |
1177 | } | |
1178 | ||
05d18c24 PE |
1179 | /*------------------------------------------------------------------. |
1180 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
cd3684cf | 1181 | | TOP (included). | |
05d18c24 PE |
1182 | `------------------------------------------------------------------*/ |
1183 | ||
05d18c24 | 1184 | static void |
3b452f4e | 1185 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
05d18c24 | 1186 | { |
74e543d2 | 1187 | YYFPRINTF (stderr, "Stack now"); |
3b452f4e JD |
1188 | for (; yybottom <= yytop; yybottom++) |
1189 | { | |
1190 | int yybot = *yybottom; | |
1191 | YYFPRINTF (stderr, " %d", yybot); | |
1192 | } | |
74e543d2 | 1193 | YYFPRINTF (stderr, "\n"); |
05d18c24 PE |
1194 | } |
1195 | ||
e9690142 JD |
1196 | # define YY_STACK_PRINT(Bottom, Top) \ |
1197 | do { \ | |
1198 | if (yydebug) \ | |
1199 | yy_stack_print ((Bottom), (Top)); \ | |
95dbea81 | 1200 | } while (0) |
05d18c24 PE |
1201 | |
1202 | ||
1203 | /*------------------------------------------------. | |
1204 | | Report that the YYRULE is going to be reduced. | | |
1205 | `------------------------------------------------*/ | |
1206 | ||
05d18c24 | 1207 | static void |
d12f8e49 | 1208 | yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) |
05d18c24 | 1209 | { |
d12f8e49 | 1210 | unsigned long int yylno = yyrline[yyrule]; |
66809587 | 1211 | int yynrhs = yyr2[yyrule]; |
05d18c24 | 1212 | int yyi; |
66809587 | 1213 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
d12f8e49 | 1214 | yyrule - 1, yylno); |
66809587 PE |
1215 | /* The symbols being reduced. */ |
1216 | for (yyi = 0; yyi < yynrhs; yyi++) | |
1217 | { | |
0bf92491 | 1218 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
d12f8e49 AD |
1219 | yy_symbol_print (stderr, |
1220 | yystos[yyssp[yyi + 1 - yynrhs]], | |
1221 | &(yyvsp[(yyi + 1) - (yynrhs)]) | |
1222 | , &(yylsp[(yyi + 1) - (yynrhs)]) ); | |
0bf92491 | 1223 | YYFPRINTF (stderr, "\n"); |
66809587 | 1224 | } |
05d18c24 PE |
1225 | } |
1226 | ||
e9690142 JD |
1227 | # define YY_REDUCE_PRINT(Rule) \ |
1228 | do { \ | |
1229 | if (yydebug) \ | |
d12f8e49 | 1230 | yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \ |
95dbea81 | 1231 | } while (0) |
05d18c24 | 1232 | |
e9955c83 AD |
1233 | /* Nonzero means print parse trace. It is left uninitialized so that |
1234 | multiple parsers can coexist. */ | |
1235 | int yydebug; | |
8d9cffff | 1236 | #else /* !GRAM_DEBUG */ |
e9955c83 | 1237 | # define YYDPRINTF(Args) |
8a8dc872 | 1238 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
05d18c24 PE |
1239 | # define YY_STACK_PRINT(Bottom, Top) |
1240 | # define YY_REDUCE_PRINT(Rule) | |
8d9cffff | 1241 | #endif /* !GRAM_DEBUG */ |
e9955c83 | 1242 | |
05d18c24 | 1243 | |
e9955c83 | 1244 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
e9690142 | 1245 | #ifndef YYINITDEPTH |
e9955c83 AD |
1246 | # define YYINITDEPTH 200 |
1247 | #endif | |
1248 | ||
1249 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only | |
1250 | if the built-in stack extension method is used). | |
1251 | ||
1252 | Do not make this value too large; the results are undefined if | |
2ce37586 | 1253 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
e9955c83 AD |
1254 | evaluated with infinite-precision integer arithmetic. */ |
1255 | ||
e9955c83 AD |
1256 | #ifndef YYMAXDEPTH |
1257 | # define YYMAXDEPTH 10000 | |
1258 | #endif | |
1921f1d7 | 1259 | |
107844a3 JD |
1260 | /* Given a state stack such that *YYBOTTOM is its bottom, such that |
1261 | *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty | |
1262 | stack, and such that *YYCAPACITY is the maximum number of elements it | |
1263 | can hold without a reallocation, make sure there is enough room to | |
1264 | store YYADD more elements. If not, allocate a new stack using | |
1265 | YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM, | |
1266 | *YYTOP, and *YYCAPACITY to reflect the new capacity and memory | |
1267 | location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack | |
1268 | using YYSTACK_FREE. Return 0 if successful or if no reallocation is | |
1269 | required. Return 1 if memory is exhausted. */ | |
1270 | static int | |
1271 | yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd, | |
8d9cffff | 1272 | #if GRAM_DEBUG |
107844a3 JD |
1273 | char const *yydebug_prefix, |
1274 | char const *yydebug_suffix, | |
1275 | #endif | |
1276 | yytype_int16 **yybottom, | |
1277 | yytype_int16 *yybottom_no_free, | |
1278 | yytype_int16 **yytop, yytype_int16 *yytop_empty) | |
1279 | { | |
1280 | YYSIZE_T yysize_old = | |
1281 | *yytop == yytop_empty ? 0 : *yytop - *yybottom + 1; | |
1282 | YYSIZE_T yysize_new = yysize_old + yyadd; | |
1283 | if (*yycapacity < yysize_new) | |
1284 | { | |
1285 | YYSIZE_T yyalloc = 2 * yysize_new; | |
1286 | yytype_int16 *yybottom_new; | |
1287 | /* Use YYMAXDEPTH for maximum stack size given that the stack | |
1288 | should never need to grow larger than the main state stack | |
1289 | needs to grow without LAC. */ | |
1290 | if (YYMAXDEPTH < yysize_new) | |
1291 | { | |
1292 | YYDPRINTF ((stderr, "%smax size exceeded%s", yydebug_prefix, | |
1293 | yydebug_suffix)); | |
1294 | return 1; | |
1295 | } | |
1296 | if (YYMAXDEPTH < yyalloc) | |
1297 | yyalloc = YYMAXDEPTH; | |
1298 | yybottom_new = | |
1299 | (yytype_int16*) YYSTACK_ALLOC (yyalloc * sizeof *yybottom_new); | |
1300 | if (!yybottom_new) | |
1301 | { | |
1302 | YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix, | |
1303 | yydebug_suffix)); | |
1304 | return 1; | |
1305 | } | |
1306 | if (*yytop != yytop_empty) | |
1307 | { | |
1308 | YYCOPY (yybottom_new, *yybottom, yysize_old); | |
1309 | *yytop = yybottom_new + (yysize_old - 1); | |
1310 | } | |
1311 | if (*yybottom != yybottom_no_free) | |
1312 | YYSTACK_FREE (*yybottom); | |
1313 | *yybottom = yybottom_new; | |
1314 | *yycapacity = yyalloc; | |
1315 | } | |
1316 | return 0; | |
1317 | } | |
1318 | ||
1319 | /* Establish the initial context for the current lookahead if no initial | |
1320 | context is currently established. | |
1321 | ||
1322 | We define a context as a snapshot of the parser stacks. We define | |
1323 | the initial context for a lookahead as the context in which the | |
1324 | parser initially examines that lookahead in order to select a | |
1325 | syntactic action. Thus, if the lookahead eventually proves | |
1326 | syntactically unacceptable (possibly in a later context reached via a | |
1327 | series of reductions), the initial context can be used to determine | |
1328 | the exact set of tokens that would be syntactically acceptable in the | |
1329 | lookahead's place. Moreover, it is the context after which any | |
1330 | further semantic actions would be erroneous because they would be | |
1331 | determined by a syntactically unacceptable token. | |
1332 | ||
1333 | YY_LAC_ESTABLISH should be invoked when a reduction is about to be | |
1334 | performed in an inconsistent state (which, for the purposes of LAC, | |
1335 | includes consistent states that don't know they're consistent because | |
1336 | their default reductions have been disabled). Iff there is a | |
1337 | lookahead token, it should also be invoked before reporting a syntax | |
1338 | error. This latter case is for the sake of the debugging output. | |
1339 | ||
1340 | For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as | |
1341 | follows. If no initial context is currently established for the | |
1342 | current lookahead, then check if that lookahead can eventually be | |
1343 | shifted if syntactic actions continue from the current context. | |
1344 | Report a syntax error if it cannot. */ | |
1345 | #define YY_LAC_ESTABLISH \ | |
1346 | do { \ | |
1347 | if (!yy_lac_established) \ | |
1348 | { \ | |
1349 | YYDPRINTF ((stderr, \ | |
1350 | "LAC: initial context established for %s\n", \ | |
1351 | yytname[yytoken])); \ | |
1352 | yy_lac_established = 1; \ | |
1353 | { \ | |
1354 | int yy_lac_status = \ | |
1355 | yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \ | |
1356 | if (yy_lac_status == 2) \ | |
1357 | goto yyexhaustedlab; \ | |
1358 | if (yy_lac_status == 1) \ | |
1359 | goto yyerrlab; \ | |
1360 | } \ | |
1361 | } \ | |
95dbea81 | 1362 | } while (0) |
107844a3 JD |
1363 | |
1364 | /* Discard any previous initial lookahead context because of Event, | |
1365 | which may be a lookahead change or an invalidation of the currently | |
1366 | established initial context for the current lookahead. | |
1367 | ||
1368 | The most common example of a lookahead change is a shift. An example | |
1369 | of both cases is syntax error recovery. That is, a syntax error | |
1370 | occurs when the lookahead is syntactically erroneous for the | |
1371 | currently established initial context, so error recovery manipulates | |
1372 | the parser stacks to try to find a new initial context in which the | |
1373 | current lookahead is syntactically acceptable. If it fails to find | |
1374 | such a context, it discards the lookahead. */ | |
8d9cffff | 1375 | #if GRAM_DEBUG |
107844a3 JD |
1376 | # define YY_LAC_DISCARD(Event) \ |
1377 | do { \ | |
1378 | if (yy_lac_established) \ | |
1379 | { \ | |
1380 | if (yydebug) \ | |
1381 | YYFPRINTF (stderr, "LAC: initial context discarded due to " \ | |
1382 | Event "\n"); \ | |
1383 | yy_lac_established = 0; \ | |
1384 | } \ | |
95dbea81 | 1385 | } while (0) |
107844a3 JD |
1386 | #else |
1387 | # define YY_LAC_DISCARD(Event) yy_lac_established = 0 | |
1388 | #endif | |
1389 | ||
1390 | /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can | |
1391 | eventually (after perhaps some reductions) be shifted, return 1 if | |
1392 | not, or return 2 if memory is exhausted. As preconditions and | |
1393 | postconditions: *YYES_CAPACITY is the allocated size of the array to | |
1394 | which *YYES points, and either *YYES = YYESA or *YYES points to an | |
1395 | array allocated with YYSTACK_ALLOC. yy_lac may overwrite the | |
1396 | contents of either array, alter *YYES and *YYES_CAPACITY, and free | |
1397 | any old *YYES other than YYESA. */ | |
1398 | static int | |
1399 | yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes, | |
1400 | YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken) | |
1401 | { | |
1402 | yytype_int16 *yyes_prev = yyssp; | |
1403 | yytype_int16 *yyesp = yyes_prev; | |
1404 | YYDPRINTF ((stderr, "LAC: checking lookahead %s:", yytname[yytoken])); | |
1405 | if (yytoken == YYUNDEFTOK) | |
1406 | { | |
1407 | YYDPRINTF ((stderr, " Always Err\n")); | |
1408 | return 1; | |
1409 | } | |
1410 | while (1) | |
1411 | { | |
1412 | int yyrule = yypact[*yyesp]; | |
1413 | if (yypact_value_is_default (yyrule) | |
1414 | || (yyrule += yytoken) < 0 || YYLAST < yyrule | |
1415 | || yycheck[yyrule] != yytoken) | |
1416 | { | |
1417 | yyrule = yydefact[*yyesp]; | |
1418 | if (yyrule == 0) | |
1419 | { | |
1420 | YYDPRINTF ((stderr, " Err\n")); | |
1421 | return 1; | |
1422 | } | |
1423 | } | |
1424 | else | |
1425 | { | |
1426 | yyrule = yytable[yyrule]; | |
1427 | if (yytable_value_is_error (yyrule)) | |
1428 | { | |
1429 | YYDPRINTF ((stderr, " Err\n")); | |
1430 | return 1; | |
1431 | } | |
1432 | if (0 < yyrule) | |
1433 | { | |
1434 | YYDPRINTF ((stderr, " S%d\n", yyrule)); | |
1435 | return 0; | |
1436 | } | |
1437 | yyrule = -yyrule; | |
1438 | } | |
1439 | { | |
1440 | YYSIZE_T yylen = yyr2[yyrule]; | |
1441 | YYDPRINTF ((stderr, " R%d", yyrule - 1)); | |
1442 | if (yyesp != yyes_prev) | |
1443 | { | |
1444 | YYSIZE_T yysize = yyesp - *yyes + 1; | |
1445 | if (yylen < yysize) | |
1446 | { | |
1447 | yyesp -= yylen; | |
1448 | yylen = 0; | |
1449 | } | |
1450 | else | |
1451 | { | |
1452 | yylen -= yysize; | |
1453 | yyesp = yyes_prev; | |
1454 | } | |
1455 | } | |
1456 | if (yylen) | |
1457 | yyesp = yyes_prev -= yylen; | |
1458 | } | |
1459 | { | |
1460 | int yystate; | |
1461 | { | |
1462 | int yylhs = yyr1[yyrule] - YYNTOKENS; | |
1463 | yystate = yypgoto[yylhs] + *yyesp; | |
1464 | if (yystate < 0 || YYLAST < yystate | |
1465 | || yycheck[yystate] != *yyesp) | |
1466 | yystate = yydefgoto[yylhs]; | |
1467 | else | |
1468 | yystate = yytable[yystate]; | |
1469 | } | |
1470 | if (yyesp == yyes_prev) | |
1471 | { | |
1472 | yyesp = *yyes; | |
1473 | *yyesp = yystate; | |
1474 | } | |
1475 | else | |
1476 | { | |
1477 | if (yy_lac_stack_realloc (yyes_capacity, 1, | |
8d9cffff | 1478 | #if GRAM_DEBUG |
107844a3 JD |
1479 | " (", ")", |
1480 | #endif | |
1481 | yyes, yyesa, &yyesp, yyes_prev)) | |
1482 | { | |
1483 | YYDPRINTF ((stderr, "\n")); | |
1484 | return 2; | |
1485 | } | |
1486 | *++yyesp = yystate; | |
1487 | } | |
3c9b20ff | 1488 | YYDPRINTF ((stderr, " G%d", yystate)); |
107844a3 JD |
1489 | } |
1490 | } | |
1491 | } | |
1492 | ||
1921f1d7 AD |
1493 | |
1494 | #if YYERROR_VERBOSE | |
e9955c83 AD |
1495 | |
1496 | # ifndef yystrlen | |
bf8b3d98 | 1497 | # if defined __GLIBC__ && defined _STRING_H |
e9955c83 AD |
1498 | # define yystrlen strlen |
1499 | # else | |
1500 | /* Return the length of YYSTR. */ | |
1501 | static YYSIZE_T | |
e9955c83 | 1502 | yystrlen (const char *yystr) |
e9955c83 | 1503 | { |
7029f892 PE |
1504 | YYSIZE_T yylen; |
1505 | for (yylen = 0; yystr[yylen]; yylen++) | |
e9955c83 | 1506 | continue; |
7029f892 | 1507 | return yylen; |
e9955c83 AD |
1508 | } |
1509 | # endif | |
1510 | # endif | |
1511 | ||
1512 | # ifndef yystpcpy | |
bf8b3d98 | 1513 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
e9955c83 AD |
1514 | # define yystpcpy stpcpy |
1515 | # else | |
1516 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
1517 | YYDEST. */ | |
1518 | static char * | |
e9955c83 | 1519 | yystpcpy (char *yydest, const char *yysrc) |
e9955c83 | 1520 | { |
b4fb989f PE |
1521 | char *yyd = yydest; |
1522 | const char *yys = yysrc; | |
e9955c83 AD |
1523 | |
1524 | while ((*yyd++ = *yys++) != '\0') | |
1525 | continue; | |
1526 | ||
1527 | return yyd - 1; | |
1528 | } | |
1529 | # endif | |
1530 | # endif | |
0c15323d | 1531 | |
9cbfdc9e PE |
1532 | # ifndef yytnamerr |
1533 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary | |
1534 | quotes and backslashes, so that it's suitable for yyerror. The | |
1535 | heuristic is that double-quoting is unnecessary unless the string | |
1536 | contains an apostrophe, a comma, or backslash (other than | |
1537 | backslash-backslash). YYSTR is taken from yytname. If YYRES is | |
1538 | null, do not copy; instead, return the length of what the result | |
1539 | would have been. */ | |
1540 | static YYSIZE_T | |
1541 | yytnamerr (char *yyres, const char *yystr) | |
1542 | { | |
1543 | if (*yystr == '"') | |
1544 | { | |
d2a1a60a | 1545 | YYSIZE_T yyn = 0; |
9cbfdc9e PE |
1546 | char const *yyp = yystr; |
1547 | ||
1548 | for (;;) | |
e9690142 JD |
1549 | switch (*++yyp) |
1550 | { | |
1551 | case '\'': | |
1552 | case ',': | |
1553 | goto do_not_strip_quotes; | |
1554 | ||
1555 | case '\\': | |
1556 | if (*++yyp != '\\') | |
1557 | goto do_not_strip_quotes; | |
1558 | /* Fall through. */ | |
1559 | default: | |
1560 | if (yyres) | |
1561 | yyres[yyn] = *yyp; | |
1562 | yyn++; | |
1563 | break; | |
1564 | ||
1565 | case '"': | |
1566 | if (yyres) | |
1567 | yyres[yyn] = '\0'; | |
1568 | return yyn; | |
1569 | } | |
9cbfdc9e PE |
1570 | do_not_strip_quotes: ; |
1571 | } | |
1572 | ||
1573 | if (! yyres) | |
1574 | return yystrlen (yystr); | |
1575 | ||
1576 | return yystpcpy (yyres, yystr) - yyres; | |
1577 | } | |
1578 | # endif | |
1579 | ||
45319f13 | 1580 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
bf35c71c | 1581 | about the unexpected token YYTOKEN for the state stack whose top is |
107844a3 JD |
1582 | YYSSP. In order to see if a particular token T is a |
1583 | valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T). | |
45319f13 | 1584 | |
d2060f06 JD |
1585 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
1586 | not large enough to hold the message. In that case, also set | |
1587 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the | |
107844a3 JD |
1588 | required number of bytes is too large to store or if |
1589 | yy_lac returned 2. */ | |
45319f13 JD |
1590 | static int |
1591 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |
107844a3 JD |
1592 | yytype_int16 *yyesa, yytype_int16 **yyes, |
1593 | YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken) | |
b4bbc4a0 | 1594 | { |
398c298c | 1595 | YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); |
b4bbc4a0 | 1596 | YYSIZE_T yysize = yysize0; |
b4bbc4a0 JD |
1597 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
1598 | /* Internationalized format string. */ | |
398c298c | 1599 | const char *yyformat = YY_NULL; |
b4bbc4a0 JD |
1600 | /* Arguments of yyformat. */ |
1601 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |
d2060f06 JD |
1602 | /* Number of reported tokens (one for the "unexpected", one per |
1603 | "expected"). */ | |
1604 | int yycount = 0; | |
b4bbc4a0 | 1605 | |
d2060f06 | 1606 | /* There are many possibilities here to consider: |
d2060f06 JD |
1607 | - If this state is a consistent state with a default action, then |
1608 | the only way this function was invoked is if the default action | |
1609 | is an error action. In that case, don't check for expected | |
1610 | tokens because there are none. | |
1611 | - The only way there can be no lookahead present (in yychar) is if | |
1612 | this state is a consistent state with a default action. Thus, | |
1613 | detecting the absence of a lookahead is sufficient to determine | |
1614 | that there is no unexpected or expected token to report. In that | |
1615 | case, just report a simple "syntax error". | |
1616 | - Don't assume there isn't a lookahead just because this state is a | |
1617 | consistent state with a default action. There might have been a | |
1618 | previous inconsistent state, consistent state with a non-default | |
1619 | action, or user semantic action that manipulated yychar. | |
107844a3 JD |
1620 | In the first two cases, it might appear that the current syntax |
1621 | error should have been detected in the previous state when yy_lac | |
1622 | was invoked. However, at that time, there might have been a | |
1623 | different syntax error that discarded a different initial context | |
1624 | during error recovery, leaving behind the current lookahead. | |
d2060f06 JD |
1625 | */ |
1626 | if (yytoken != YYEMPTY) | |
1627 | { | |
bf35c71c | 1628 | int yyn = yypact[*yyssp]; |
107844a3 | 1629 | YYDPRINTF ((stderr, "Constructing syntax error message\n")); |
d2060f06 JD |
1630 | yyarg[yycount++] = yytname[yytoken]; |
1631 | if (!yypact_value_is_default (yyn)) | |
1632 | { | |
b4bbc4a0 | 1633 | int yyx; |
bf35c71c | 1634 | |
107844a3 JD |
1635 | for (yyx = 0; yyx < YYNTOKENS; ++yyx) |
1636 | if (yyx != YYTERROR && yyx != YYUNDEFTOK) | |
b4bbc4a0 | 1637 | { |
107844a3 JD |
1638 | { |
1639 | int yy_lac_status = yy_lac (yyesa, yyes, yyes_capacity, | |
1640 | yyssp, yyx); | |
1641 | if (yy_lac_status == 2) | |
1642 | return 2; | |
1643 | if (yy_lac_status == 1) | |
1644 | continue; | |
1645 | } | |
b4bbc4a0 JD |
1646 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
1647 | { | |
1648 | yycount = 1; | |
1649 | yysize = yysize0; | |
1650 | break; | |
1651 | } | |
1652 | yyarg[yycount++] = yytname[yyx]; | |
0a9042a6 AD |
1653 | { |
1654 | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); | |
1655 | if (! (yysize <= yysize1 | |
1656 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1657 | return 2; | |
1658 | yysize = yysize1; | |
1659 | } | |
b4bbc4a0 | 1660 | } |
d2060f06 | 1661 | } |
8d9cffff | 1662 | # if GRAM_DEBUG |
107844a3 JD |
1663 | else if (yydebug) |
1664 | YYFPRINTF (stderr, "No expected tokens.\n"); | |
1665 | # endif | |
d2060f06 | 1666 | } |
b4bbc4a0 JD |
1667 | |
1668 | switch (yycount) | |
2abdfeef | 1669 | { |
bf35c71c | 1670 | # define YYCASE_(N, S) \ |
b4bbc4a0 JD |
1671 | case N: \ |
1672 | yyformat = S; \ | |
1673 | break | |
d2060f06 | 1674 | YYCASE_(0, YY_("syntax error")); |
b4bbc4a0 JD |
1675 | YYCASE_(1, YY_("syntax error, unexpected %s")); |
1676 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | |
1677 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | |
1678 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | |
1679 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | |
bf35c71c | 1680 | # undef YYCASE_ |
b4bbc4a0 | 1681 | } |
dc450175 | 1682 | |
0a9042a6 AD |
1683 | { |
1684 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); | |
1685 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1686 | return 2; | |
1687 | yysize = yysize1; | |
1688 | } | |
b4bbc4a0 JD |
1689 | |
1690 | if (*yymsg_alloc < yysize) | |
1691 | { | |
1692 | *yymsg_alloc = 2 * yysize; | |
1693 | if (! (yysize <= *yymsg_alloc | |
1694 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) | |
1695 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; | |
d2060f06 | 1696 | return 1; |
b4bbc4a0 JD |
1697 | } |
1698 | ||
1699 | /* Avoid sprintf, as that infringes on the user's name space. | |
1700 | Don't have undefined behavior even if the translation | |
1701 | produced a string with the wrong number of "%s"s. */ | |
1702 | { | |
1703 | char *yyp = *yymsg; | |
1704 | int yyi = 0; | |
1705 | while ((*yyp = *yyformat) != '\0') | |
1706 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | |
45319f13 | 1707 | { |
b4bbc4a0 JD |
1708 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
1709 | yyformat += 2; | |
45319f13 | 1710 | } |
b4bbc4a0 | 1711 | else |
45319f13 | 1712 | { |
b4bbc4a0 JD |
1713 | yyp++; |
1714 | yyformat++; | |
45319f13 | 1715 | } |
b4bbc4a0 JD |
1716 | } |
1717 | return 0; | |
1718 | } | |
2abdfeef | 1719 | #endif /* YYERROR_VERBOSE */ |
e9955c83 | 1720 | |
04b6e11e PE |
1721 | /*-----------------------------------------------. |
1722 | | Release the memory associated to this symbol. | | |
1723 | `-----------------------------------------------*/ | |
1724 | ||
d33cb3ae | 1725 | static void |
8a8dc872 | 1726 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) |
04b6e11e | 1727 | { |
3f4bc2c1 | 1728 | YYUSE (yyvaluep); |
e764d4df | 1729 | YYUSE (yylocationp); |
8a8dc872 AD |
1730 | if (!yymsg) |
1731 | yymsg = "Deleting"; | |
1732 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
1733 | ||
04b6e11e PE |
1734 | switch (yytype) |
1735 | { | |
1736 | default: | |
e9690142 | 1737 | break; |
04b6e11e PE |
1738 | } |
1739 | } | |
04b6e11e | 1740 | |
bb31eb56 | 1741 | |
e776192e | 1742 | |
e9955c83 | 1743 | |
bb31eb56 JD |
1744 | /*----------. |
1745 | | yyparse. | | |
1746 | `----------*/ | |
d33cb3ae | 1747 | |
d33cb3ae PE |
1748 | int |
1749 | yyparse (void) | |
e9955c83 | 1750 | { |
e021811a | 1751 | /* The lookahead symbol. */ |
366eea36 AD |
1752 | int yychar; |
1753 | ||
25b27513 | 1754 | |
369342dd | 1755 | #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ |
25b27513 TR |
1756 | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
1757 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ | |
1758 | _Pragma ("GCC diagnostic push") \ | |
369342dd | 1759 | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ |
25b27513 TR |
1760 | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
1761 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ | |
1762 | _Pragma ("GCC diagnostic pop") | |
1763 | #else | |
1764 | /* Default value used for initialization, for pacifying older GCCs | |
1765 | or non-GCC compilers. */ | |
1766 | static YYSTYPE yyval_default; | |
369342dd | 1767 | # define YY_INITIAL_VALUE(Value) = Value |
25b27513 | 1768 | #endif |
0a9042a6 AD |
1769 | static YYLTYPE yyloc_default |
1770 | # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL | |
1771 | = { 1, 1, 1, 1 } | |
1772 | # endif | |
1773 | ; | |
25b27513 TR |
1774 | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1775 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | |
1776 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END | |
1777 | #endif | |
369342dd AD |
1778 | #ifndef YY_INITIAL_VALUE |
1779 | # define YY_INITIAL_VALUE(Value) /* Nothing. */ | |
1780 | #endif | |
25b27513 | 1781 | |
9bc0dd67 | 1782 | /* The semantic value of the lookahead symbol. */ |
369342dd | 1783 | YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); |
366eea36 | 1784 | |
9bc0dd67 | 1785 | /* Location data for the lookahead symbol. */ |
0a9042a6 | 1786 | YYLTYPE yylloc = yyloc_default; |
369342dd | 1787 | |
e9955c83 | 1788 | |
e021811a JD |
1789 | /* Number of syntax errors so far. */ |
1790 | int yynerrs; | |
e9955c83 | 1791 | |
e021811a JD |
1792 | int yystate; |
1793 | /* Number of tokens to shift before error messages enabled. */ | |
1794 | int yyerrstatus; | |
e9955c83 | 1795 | |
e021811a | 1796 | /* The stacks and their tools: |
45eebca4 AD |
1797 | 'yyss': related to states. |
1798 | 'yyvs': related to semantic values. | |
1799 | 'yyls': related to locations. | |
e9955c83 | 1800 | |
cbdb6d91 | 1801 | Refer to the stacks through separate pointers, to allow yyoverflow |
e021811a | 1802 | to reallocate them elsewhere. */ |
e9955c83 | 1803 | |
e021811a JD |
1804 | /* The state stack. */ |
1805 | yytype_int16 yyssa[YYINITDEPTH]; | |
1806 | yytype_int16 *yyss; | |
1807 | yytype_int16 *yyssp; | |
e9955c83 | 1808 | |
e021811a JD |
1809 | /* The semantic value stack. */ |
1810 | YYSTYPE yyvsa[YYINITDEPTH]; | |
1811 | YYSTYPE *yyvs; | |
1812 | YYSTYPE *yyvsp; | |
e9955c83 | 1813 | |
e021811a JD |
1814 | /* The location stack. */ |
1815 | YYLTYPE yylsa[YYINITDEPTH]; | |
1816 | YYLTYPE *yyls; | |
1817 | YYLTYPE *yylsp; | |
1818 | ||
1819 | /* The locations where the error started and ended. */ | |
44c2b42d | 1820 | YYLTYPE yyerror_range[3]; |
e9955c83 | 1821 | |
e021811a | 1822 | YYSIZE_T yystacksize; |
e9955c83 | 1823 | |
107844a3 JD |
1824 | yytype_int16 yyesa[20]; |
1825 | yytype_int16 *yyes; | |
1826 | YYSIZE_T yyes_capacity; | |
1827 | ||
1828 | int yy_lac_established = 0; | |
e021811a JD |
1829 | int yyn; |
1830 | int yyresult; | |
1831 | /* Lookahead token as an internal (translated) token number. */ | |
47f6a236 | 1832 | int yytoken = 0; |
e9955c83 AD |
1833 | /* The variables used to return semantic value and location from the |
1834 | action routines. */ | |
1835 | YYSTYPE yyval; | |
e9955c83 | 1836 | YYLTYPE yyloc; |
e9955c83 | 1837 | |
e021811a JD |
1838 | #if YYERROR_VERBOSE |
1839 | /* Buffer for error messages, and its allocated size. */ | |
1840 | char yymsgbuf[128]; | |
1841 | char *yymsg = yymsgbuf; | |
1842 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
1843 | #endif | |
1844 | ||
1845 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) | |
1846 | ||
3b0ffc7e PE |
1847 | /* The number of symbols on the RHS of the reduced rule. |
1848 | Keep to zero when no symbol should be popped. */ | |
1849 | int yylen = 0; | |
e9955c83 | 1850 | |
369342dd AD |
1851 | yyssp = yyss = yyssa; |
1852 | yyvsp = yyvs = yyvsa; | |
1853 | yylsp = yyls = yylsa; | |
e021811a JD |
1854 | yystacksize = YYINITDEPTH; |
1855 | ||
107844a3 JD |
1856 | yyes = yyesa; |
1857 | yyes_capacity = sizeof yyesa / sizeof *yyes; | |
1858 | if (YYMAXDEPTH < yyes_capacity) | |
1859 | yyes_capacity = YYMAXDEPTH; | |
1860 | ||
74e543d2 | 1861 | YYDPRINTF ((stderr, "Starting parse\n")); |
e9955c83 AD |
1862 | |
1863 | yystate = 0; | |
1864 | yyerrstatus = 0; | |
1865 | yynerrs = 0; | |
e021811a | 1866 | yychar = YYEMPTY; /* Cause a token to be read. */ |
e9955c83 | 1867 | |
e021811a | 1868 | /* User initialization code. */ |
246ff8c1 | 1869 | #line 97 "src/parse-gram.y" /* yacc.c:1452 */ |
cd3684cf AD |
1870 | { |
1871 | /* Bison's grammar can initial empty locations, hence a default | |
1872 | location is needed. */ | |
4a678af8 JD |
1873 | boundary_set (&yylloc.start, current_file, 1, 1); |
1874 | boundary_set (&yylloc.end, current_file, 1, 1); | |
cd3684cf | 1875 | } |
8ecac08f | 1876 | #line 1877 "src/parse-gram.c" /* yacc.c:1452 */ |
5f6da1c0 | 1877 | yylsp[0] = yylloc; |
e9955c83 AD |
1878 | goto yysetstate; |
1879 | ||
1880 | /*------------------------------------------------------------. | |
1881 | | yynewstate -- Push a new state, which is found in yystate. | | |
1882 | `------------------------------------------------------------*/ | |
1883 | yynewstate: | |
1884 | /* In all cases, when you get here, the value and location stacks | |
3b0ffc7e | 1885 | have just been pushed. So pushing a state here evens the stacks. */ |
e9955c83 AD |
1886 | yyssp++; |
1887 | ||
1888 | yysetstate: | |
1889 | *yyssp = yystate; | |
1890 | ||
d33cb3ae | 1891 | if (yyss + yystacksize - 1 <= yyssp) |
e9955c83 AD |
1892 | { |
1893 | /* Get the current used size of the three stacks, in elements. */ | |
1894 | YYSIZE_T yysize = yyssp - yyss + 1; | |
1895 | ||
1896 | #ifdef yyoverflow | |
1897 | { | |
e9690142 JD |
1898 | /* Give user a chance to reallocate the stack. Use copies of |
1899 | these so that the &'s don't force the real ones into | |
1900 | memory. */ | |
1901 | YYSTYPE *yyvs1 = yyvs; | |
1902 | yytype_int16 *yyss1 = yyss; | |
1903 | YYLTYPE *yyls1 = yyls; | |
1904 | ||
1905 | /* Each stack pointer address is followed by the size of the | |
1906 | data in use in that stack, in bytes. This used to be a | |
1907 | conditional around just the two extra args, but that might | |
1908 | be undefined if yyoverflow is a macro. */ | |
1909 | yyoverflow (YY_("memory exhausted"), | |
1910 | &yyss1, yysize * sizeof (*yyssp), | |
1911 | &yyvs1, yysize * sizeof (*yyvsp), | |
1912 | &yyls1, yysize * sizeof (*yylsp), | |
1913 | &yystacksize); | |
1914 | ||
1915 | yyls = yyls1; | |
1916 | yyss = yyss1; | |
1917 | yyvs = yyvs1; | |
e9955c83 AD |
1918 | } |
1919 | #else /* no yyoverflow */ | |
1920 | # ifndef YYSTACK_RELOCATE | |
6088a2a0 | 1921 | goto yyexhaustedlab; |
e9955c83 AD |
1922 | # else |
1923 | /* Extend the stack our own way. */ | |
d33cb3ae | 1924 | if (YYMAXDEPTH <= yystacksize) |
e9690142 | 1925 | goto yyexhaustedlab; |
e9955c83 | 1926 | yystacksize *= 2; |
d33cb3ae | 1927 | if (YYMAXDEPTH < yystacksize) |
e9690142 | 1928 | yystacksize = YYMAXDEPTH; |
e9955c83 AD |
1929 | |
1930 | { | |
e9690142 JD |
1931 | yytype_int16 *yyss1 = yyss; |
1932 | union yyalloc *yyptr = | |
1933 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
1934 | if (! yyptr) | |
1935 | goto yyexhaustedlab; | |
1936 | YYSTACK_RELOCATE (yyss_alloc, yyss); | |
1937 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); | |
1938 | YYSTACK_RELOCATE (yyls_alloc, yyls); | |
1921f1d7 | 1939 | # undef YYSTACK_RELOCATE |
e9690142 JD |
1940 | if (yyss1 != yyssa) |
1941 | YYSTACK_FREE (yyss1); | |
e9955c83 AD |
1942 | } |
1943 | # endif | |
1944 | #endif /* no yyoverflow */ | |
1945 | ||
1946 | yyssp = yyss + yysize - 1; | |
1947 | yyvsp = yyvs + yysize - 1; | |
e9955c83 | 1948 | yylsp = yyls + yysize - 1; |
e9955c83 | 1949 | |
6088a2a0 | 1950 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
e9690142 | 1951 | (unsigned long int) yystacksize)); |
e9955c83 | 1952 | |
d33cb3ae | 1953 | if (yyss + yystacksize - 1 <= yyssp) |
e9690142 | 1954 | YYABORT; |
e9955c83 AD |
1955 | } |
1956 | ||
6088a2a0 | 1957 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
e9955c83 | 1958 | |
ec5479ce JD |
1959 | if (yystate == YYFINAL) |
1960 | YYACCEPT; | |
1961 | ||
e9955c83 AD |
1962 | goto yybackup; |
1963 | ||
1964 | /*-----------. | |
1965 | | yybackup. | | |
1966 | `-----------*/ | |
1967 | yybackup: | |
1968 | ||
3b0ffc7e | 1969 | /* Do appropriate processing given the current state. Read a |
9bc0dd67 | 1970 | lookahead token if we need one and don't already have one. */ |
e9955c83 | 1971 | |
9bc0dd67 | 1972 | /* First try to decide what to do without reference to lookahead token. */ |
e9955c83 | 1973 | yyn = yypact[yystate]; |
f2b30bdf | 1974 | if (yypact_value_is_default (yyn)) |
e9955c83 AD |
1975 | goto yydefault; |
1976 | ||
9bc0dd67 | 1977 | /* Not known => get a lookahead token if don't already have one. */ |
e9955c83 | 1978 | |
9bc0dd67 | 1979 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
73521d9f | 1980 | if (yychar == YYEMPTY) |
e9955c83 | 1981 | { |
74e543d2 | 1982 | YYDPRINTF ((stderr, "Reading a token: ")); |
0a9042a6 | 1983 | yychar = yylex (&yylval, &yylloc); |
e9955c83 AD |
1984 | } |
1985 | ||
73521d9f | 1986 | if (yychar <= YYEOF) |
e9955c83 | 1987 | { |
73521d9f | 1988 | yychar = yytoken = YYEOF; |
74e543d2 | 1989 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
e9955c83 AD |
1990 | } |
1991 | else | |
1992 | { | |
73521d9f | 1993 | yytoken = YYTRANSLATE (yychar); |
6088a2a0 | 1994 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
e9955c83 AD |
1995 | } |
1996 | ||
886b69d1 | 1997 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
ae7453f2 | 1998 | detect an error, take that action. */ |
886b69d1 | 1999 | yyn += yytoken; |
219741d8 | 2000 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
107844a3 JD |
2001 | { |
2002 | YY_LAC_ESTABLISH; | |
2003 | goto yydefault; | |
2004 | } | |
e9955c83 | 2005 | yyn = yytable[yyn]; |
ae7453f2 | 2006 | if (yyn <= 0) |
e9955c83 | 2007 | { |
f2b30bdf | 2008 | if (yytable_value_is_error (yyn)) |
bf35c71c | 2009 | goto yyerrlab; |
107844a3 | 2010 | YY_LAC_ESTABLISH; |
e9955c83 AD |
2011 | yyn = -yyn; |
2012 | goto yyreduce; | |
2013 | } | |
e9955c83 | 2014 | |
3b0ffc7e PE |
2015 | /* Count tokens shifted since error; after three, turn off error |
2016 | status. */ | |
2017 | if (yyerrstatus) | |
2018 | yyerrstatus--; | |
2019 | ||
9bc0dd67 | 2020 | /* Shift the lookahead token. */ |
6088a2a0 | 2021 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
e9955c83 | 2022 | |
ec5479ce JD |
2023 | /* Discard the shifted token. */ |
2024 | yychar = YYEMPTY; | |
107844a3 | 2025 | YY_LAC_DISCARD ("shift"); |
e9955c83 | 2026 | |
3b0ffc7e | 2027 | yystate = yyn; |
25b27513 | 2028 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
e9955c83 | 2029 | *++yyvsp = yylval; |
25b27513 | 2030 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
e9955c83 | 2031 | *++yylsp = yylloc; |
e9955c83 AD |
2032 | goto yynewstate; |
2033 | ||
2034 | ||
2035 | /*-----------------------------------------------------------. | |
2036 | | yydefault -- do the default action for the current state. | | |
2037 | `-----------------------------------------------------------*/ | |
2038 | yydefault: | |
2039 | yyn = yydefact[yystate]; | |
2040 | if (yyn == 0) | |
2041 | goto yyerrlab; | |
2042 | goto yyreduce; | |
2043 | ||
2044 | ||
2045 | /*-----------------------------. | |
2046 | | yyreduce -- Do a reduction. | | |
2047 | `-----------------------------*/ | |
2048 | yyreduce: | |
2049 | /* yyn is the number of a rule to reduce with. */ | |
2050 | yylen = yyr2[yyn]; | |
2051 | ||
2052 | /* If YYLEN is nonzero, implement the default value of the action: | |
45eebca4 | 2053 | '$$ = $1'. |
e9955c83 | 2054 | |
04b6e11e PE |
2055 | Otherwise, the following line sets YYVAL to garbage. |
2056 | This behavior is undocumented and Bison | |
e9955c83 AD |
2057 | users should not rely upon it. Assigning to YYVAL |
2058 | unconditionally makes the parser a bit smaller, and it avoids a | |
2059 | GCC warning that YYVAL may be used uninitialized. */ | |
2060 | yyval = yyvsp[1-yylen]; | |
2061 | ||
3b0ffc7e | 2062 | /* Default location. */ |
bf8b3d98 | 2063 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
05d18c24 | 2064 | YY_REDUCE_PRINT (yyn); |
107844a3 JD |
2065 | { |
2066 | int yychar_backup = yychar; | |
2067 | switch (yyn) | |
2068 | { | |
2069 | case 6: | |
246ff8c1 | 2070 | #line 284 "src/parse-gram.y" /* yacc.c:1669 */ |
7c0c6181 JD |
2071 | { |
2072 | code_props plain_code; | |
e3dda35c | 2073 | code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0])); |
7c0c6181 JD |
2074 | code_props_translate_code (&plain_code); |
2075 | gram_scanner_last_string_free (); | |
7ecec4dd | 2076 | muscle_code_grow (union_seen ? "post_prologue" : "pre_prologue", |
e3dda35c | 2077 | plain_code.code, (yylsp[0])); |
7c0c6181 JD |
2078 | code_scanner_last_string_free (); |
2079 | } | |
8ecac08f | 2080 | #line 2081 "src/parse-gram.c" /* yacc.c:1669 */ |
1921f1d7 AD |
2081 | break; |
2082 | ||
8efe435c | 2083 | case 7: |
246ff8c1 | 2084 | #line 294 "src/parse-gram.y" /* yacc.c:1669 */ |
b19ebeb3 | 2085 | { |
697c912f | 2086 | muscle_percent_define_ensure ((yyvsp[0].uniqstr), (yylsp[0]), true); |
b19ebeb3 | 2087 | } |
8ecac08f | 2088 | #line 2089 "src/parse-gram.c" /* yacc.c:1669 */ |
9bc0dd67 JD |
2089 | break; |
2090 | ||
2cbe6b7f | 2091 | case 8: |
246ff8c1 | 2092 | #line 298 "src/parse-gram.y" /* yacc.c:1669 */ |
7eb8a0bc | 2093 | { |
de5ab940 JD |
2094 | muscle_percent_define_insert ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), |
2095 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
7eb8a0bc | 2096 | } |
8ecac08f | 2097 | #line 2098 "src/parse-gram.c" /* yacc.c:1669 */ |
1921f1d7 AD |
2098 | break; |
2099 | ||
2cbe6b7f | 2100 | case 9: |
246ff8c1 | 2101 | #line 302 "src/parse-gram.y" /* yacc.c:1669 */ |
2ce4ed68 | 2102 | { defines_flag = true; } |
8ecac08f | 2103 | #line 2104 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2104 | break; |
1921f1d7 | 2105 | |
2cbe6b7f | 2106 | case 10: |
246ff8c1 | 2107 | #line 304 "src/parse-gram.y" /* yacc.c:1669 */ |
02975b9a JD |
2108 | { |
2109 | defines_flag = true; | |
e3dda35c | 2110 | spec_defines_file = xstrdup ((yyvsp[0].chars)); |
02975b9a | 2111 | } |
8ecac08f | 2112 | #line 2113 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2113 | break; |
1921f1d7 | 2114 | |
2cbe6b7f | 2115 | case 11: |
246ff8c1 | 2116 | #line 309 "src/parse-gram.y" /* yacc.c:1669 */ |
2f5b478e AD |
2117 | { |
2118 | muscle_percent_define_insert ("parse.error", (yylsp[0]), "verbose", | |
2119 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
2120 | } | |
8ecac08f | 2121 | #line 2122 "src/parse-gram.c" /* yacc.c:1669 */ |
d6328241 PH |
2122 | break; |
2123 | ||
2cbe6b7f | 2124 | case 12: |
246ff8c1 | 2125 | #line 313 "src/parse-gram.y" /* yacc.c:1669 */ |
2f5b478e | 2126 | { expected_sr_conflicts = (yyvsp[0].integer); } |
8ecac08f | 2127 | #line 2128 "src/parse-gram.c" /* yacc.c:1669 */ |
fb9712a9 AD |
2128 | break; |
2129 | ||
2cbe6b7f | 2130 | case 13: |
246ff8c1 | 2131 | #line 314 "src/parse-gram.y" /* yacc.c:1669 */ |
2f5b478e | 2132 | { expected_rr_conflicts = (yyvsp[0].integer); } |
8ecac08f | 2133 | #line 2134 "src/parse-gram.c" /* yacc.c:1669 */ |
34f98f46 JD |
2134 | break; |
2135 | ||
2cbe6b7f | 2136 | case 14: |
246ff8c1 | 2137 | #line 315 "src/parse-gram.y" /* yacc.c:1669 */ |
e3dda35c | 2138 | { spec_file_prefix = (yyvsp[0].chars); } |
8ecac08f | 2139 | #line 2140 "src/parse-gram.c" /* yacc.c:1669 */ |
02975b9a JD |
2140 | break; |
2141 | ||
2142 | case 15: | |
246ff8c1 | 2143 | #line 317 "src/parse-gram.y" /* yacc.c:1669 */ |
cd3684cf | 2144 | { |
bf8b3d98 PE |
2145 | nondeterministic_parser = true; |
2146 | glr_parser = true; | |
2147 | } | |
8ecac08f | 2148 | #line 2149 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2149 | break; |
1921f1d7 | 2150 | |
25b27513 | 2151 | case 16: |
246ff8c1 | 2152 | #line 322 "src/parse-gram.y" /* yacc.c:1669 */ |
cd3684cf | 2153 | { |
7c0c6181 | 2154 | code_props action; |
e3dda35c | 2155 | code_props_symbol_action_init (&action, (yyvsp[0].code), (yylsp[0])); |
7c0c6181 JD |
2156 | code_props_translate_code (&action); |
2157 | gram_scanner_last_string_free (); | |
e3dda35c | 2158 | muscle_code_grow ("initial_action", action.code, (yylsp[0])); |
7c0c6181 | 2159 | code_scanner_last_string_free (); |
bf8b3d98 | 2160 | } |
8ecac08f | 2161 | #line 2162 "src/parse-gram.c" /* yacc.c:1669 */ |
25b27513 TR |
2162 | break; |
2163 | ||
2164 | case 17: | |
246ff8c1 | 2165 | #line 330 "src/parse-gram.y" /* yacc.c:1669 */ |
25b27513 | 2166 | { language_argmatch ((yyvsp[0].chars), grammar_prio, (yylsp[-1])); } |
8ecac08f | 2167 | #line 2168 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2168 | break; |
1921f1d7 | 2169 | |
2f5b478e | 2170 | case 18: |
246ff8c1 | 2171 | #line 331 "src/parse-gram.y" /* yacc.c:1669 */ |
25b27513 | 2172 | { spec_name_prefix = (yyvsp[0].chars); } |
8ecac08f | 2173 | #line 2174 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2174 | break; |
1921f1d7 | 2175 | |
2f5b478e | 2176 | case 19: |
246ff8c1 | 2177 | #line 332 "src/parse-gram.y" /* yacc.c:1669 */ |
25b27513 | 2178 | { no_lines_flag = true; } |
8ecac08f | 2179 | #line 2180 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2180 | break; |
1921f1d7 | 2181 | |
2f5b478e | 2182 | case 20: |
246ff8c1 | 2183 | #line 333 "src/parse-gram.y" /* yacc.c:1669 */ |
25b27513 | 2184 | { nondeterministic_parser = true; } |
8ecac08f | 2185 | #line 2186 "src/parse-gram.c" /* yacc.c:1669 */ |
02975b9a JD |
2186 | break; |
2187 | ||
2f5b478e | 2188 | case 21: |
246ff8c1 | 2189 | #line 334 "src/parse-gram.y" /* yacc.c:1669 */ |
25b27513 | 2190 | { spec_outfile = (yyvsp[0].chars); } |
8ecac08f | 2191 | #line 2192 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2192 | break; |
1921f1d7 | 2193 | |
2f5b478e | 2194 | case 22: |
246ff8c1 | 2195 | #line 335 "src/parse-gram.y" /* yacc.c:1669 */ |
25b27513 | 2196 | { current_param = (yyvsp[0].param); } |
8ecac08f | 2197 | #line 2198 "src/parse-gram.c" /* yacc.c:1669 */ |
4cdb01db | 2198 | break; |
1921f1d7 | 2199 | |
2f5b478e | 2200 | case 23: |
246ff8c1 | 2201 | #line 335 "src/parse-gram.y" /* yacc.c:1669 */ |
25b27513 | 2202 | { current_param = param_none; } |
8ecac08f | 2203 | #line 2204 "src/parse-gram.c" /* yacc.c:1669 */ |
4cdb01db | 2204 | break; |
1921f1d7 | 2205 | |
2f5b478e | 2206 | case 24: |
246ff8c1 | 2207 | #line 336 "src/parse-gram.y" /* yacc.c:1669 */ |
25b27513 | 2208 | { version_check (&(yylsp[0]), (yyvsp[0].chars)); } |
8ecac08f | 2209 | #line 2210 "src/parse-gram.c" /* yacc.c:1669 */ |
02975b9a JD |
2210 | break; |
2211 | ||
2f5b478e | 2212 | case 25: |
246ff8c1 | 2213 | #line 338 "src/parse-gram.y" /* yacc.c:1669 */ |
a7867f53 | 2214 | { |
e3dda35c | 2215 | char const *skeleton_user = (yyvsp[0].chars); |
84526bf3 | 2216 | if (strchr (skeleton_user, '/')) |
a7867f53 JD |
2217 | { |
2218 | size_t dir_length = strlen (current_file); | |
2219 | char *skeleton_build; | |
2220 | while (dir_length && current_file[dir_length - 1] != '/') | |
2221 | --dir_length; | |
2222 | while (dir_length && current_file[dir_length - 1] == '/') | |
2223 | --dir_length; | |
2224 | skeleton_build = | |
2225 | xmalloc (dir_length + 1 + strlen (skeleton_user) + 1); | |
2226 | if (dir_length > 0) | |
2227 | { | |
398c298c | 2228 | memcpy (skeleton_build, current_file, dir_length); |
a7867f53 JD |
2229 | skeleton_build[dir_length++] = '/'; |
2230 | } | |
2231 | strcpy (skeleton_build + dir_length, skeleton_user); | |
2232 | skeleton_user = uniqstr_new (skeleton_build); | |
2233 | free (skeleton_build); | |
2234 | } | |
e3dda35c | 2235 | skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1])); |
a7867f53 | 2236 | } |
8ecac08f | 2237 | #line 2238 "src/parse-gram.c" /* yacc.c:1669 */ |
3fa3725a PE |
2238 | break; |
2239 | ||
25b27513 | 2240 | case 26: |
246ff8c1 | 2241 | #line 361 "src/parse-gram.y" /* yacc.c:1669 */ |
7172e23e | 2242 | { token_table_flag = true; } |
8ecac08f | 2243 | #line 2244 "src/parse-gram.c" /* yacc.c:1669 */ |
5e6feb86 PE |
2244 | break; |
2245 | ||
25b27513 | 2246 | case 27: |
246ff8c1 | 2247 | #line 362 "src/parse-gram.y" /* yacc.c:1669 */ |
ef1b4273 | 2248 | { report_flag |= report_states; } |
8ecac08f | 2249 | #line 2250 "src/parse-gram.c" /* yacc.c:1669 */ |
7172e23e JD |
2250 | break; |
2251 | ||
25b27513 | 2252 | case 28: |
246ff8c1 | 2253 | #line 363 "src/parse-gram.y" /* yacc.c:1669 */ |
83a457be | 2254 | { yacc_flag = true; } |
8ecac08f | 2255 | #line 2256 "src/parse-gram.c" /* yacc.c:1669 */ |
dd875058 AD |
2256 | break; |
2257 | ||
25b27513 | 2258 | case 30: |
246ff8c1 | 2259 | #line 368 "src/parse-gram.y" /* yacc.c:1669 */ |
dd875058 | 2260 | { add_param (current_param, (yyvsp[0].code), (yylsp[0])); } |
8ecac08f | 2261 | #line 2262 "src/parse-gram.c" /* yacc.c:1669 */ |
4cdb01db | 2262 | break; |
1921f1d7 | 2263 | |
25b27513 | 2264 | case 31: |
246ff8c1 | 2265 | #line 369 "src/parse-gram.y" /* yacc.c:1669 */ |
dd875058 | 2266 | { add_param (current_param, (yyvsp[0].code), (yylsp[0])); } |
8ecac08f | 2267 | #line 2268 "src/parse-gram.c" /* yacc.c:1669 */ |
dd875058 AD |
2268 | break; |
2269 | ||
25b27513 | 2270 | case 34: |
246ff8c1 | 2271 | #line 381 "src/parse-gram.y" /* yacc.c:1669 */ |
1921f1d7 | 2272 | { |
e3dda35c | 2273 | grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0])); |
4cdb01db | 2274 | } |
8ecac08f | 2275 | #line 2276 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2276 | break; |
1921f1d7 | 2277 | |
25b27513 | 2278 | case 35: |
246ff8c1 | 2279 | #line 385 "src/parse-gram.y" /* yacc.c:1669 */ |
1921f1d7 | 2280 | { |
7cb40fd2 AD |
2281 | code_props code; |
2282 | code_props_symbol_action_init (&code, (yyvsp[-1].code), (yylsp[-1])); | |
2283 | code_props_translate_code (&code); | |
2284 | { | |
2285 | symbol_list *list; | |
2286 | for (list = (yyvsp[0].list); list; list = list->next) | |
2287 | symbol_list_code_props_set (list, (yyvsp[-2].code_type), &code); | |
2288 | symbol_list_free ((yyvsp[0].list)); | |
2289 | } | |
4cdb01db | 2290 | } |
8ecac08f | 2291 | #line 2292 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2292 | break; |
1921f1d7 | 2293 | |
25b27513 | 2294 | case 36: |
246ff8c1 | 2295 | #line 397 "src/parse-gram.y" /* yacc.c:1669 */ |
1921f1d7 | 2296 | { |
0294b130 | 2297 | default_prec = true; |
4cdb01db | 2298 | } |
8ecac08f | 2299 | #line 2300 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2300 | break; |
1921f1d7 | 2301 | |
25b27513 | 2302 | case 37: |
246ff8c1 | 2303 | #line 401 "src/parse-gram.y" /* yacc.c:1669 */ |
92f5e991 | 2304 | { |
0294b130 | 2305 | default_prec = false; |
92f5e991 | 2306 | } |
8ecac08f | 2307 | #line 2308 "src/parse-gram.c" /* yacc.c:1669 */ |
9280d3ef AD |
2308 | break; |
2309 | ||
25b27513 | 2310 | case 38: |
246ff8c1 | 2311 | #line 405 "src/parse-gram.y" /* yacc.c:1669 */ |
66ef8b9d | 2312 | { |
0294b130 AD |
2313 | /* Do not invoke muscle_percent_code_grow here since it invokes |
2314 | muscle_user_name_list_grow. */ | |
2315 | muscle_code_grow ("percent_code()", (yyvsp[0].chars), (yylsp[0])); | |
2316 | code_scanner_last_string_free (); | |
66ef8b9d | 2317 | } |
8ecac08f | 2318 | #line 2319 "src/parse-gram.c" /* yacc.c:1669 */ |
92f5e991 AD |
2319 | break; |
2320 | ||
25b27513 | 2321 | case 39: |
246ff8c1 | 2322 | #line 412 "src/parse-gram.y" /* yacc.c:1669 */ |
8e0a5e9e | 2323 | { |
0294b130 | 2324 | muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), (yylsp[0])); |
8e0a5e9e JD |
2325 | code_scanner_last_string_free (); |
2326 | } | |
8ecac08f | 2327 | #line 2328 "src/parse-gram.c" /* yacc.c:1669 */ |
2cbe6b7f JD |
2328 | break; |
2329 | ||
25b27513 | 2330 | case 40: |
246ff8c1 | 2331 | #line 422 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2332 | { (yyval.code_type) = destructor; } |
8ecac08f | 2333 | #line 2334 "src/parse-gram.c" /* yacc.c:1669 */ |
58d7a1a1 AD |
2334 | break; |
2335 | ||
25b27513 | 2336 | case 41: |
246ff8c1 | 2337 | #line 423 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2338 | { (yyval.code_type) = printer; } |
8ecac08f | 2339 | #line 2340 "src/parse-gram.c" /* yacc.c:1669 */ |
66ef8b9d PE |
2340 | break; |
2341 | ||
25b27513 | 2342 | case 42: |
246ff8c1 | 2343 | #line 433 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2344 | {} |
8ecac08f | 2345 | #line 2346 "src/parse-gram.c" /* yacc.c:1669 */ |
2cbe6b7f JD |
2346 | break; |
2347 | ||
25b27513 | 2348 | case 43: |
246ff8c1 | 2349 | #line 434 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2350 | { muscle_code_grow ("union_name", (yyvsp[0].uniqstr), (yylsp[0])); } |
8ecac08f | 2351 | #line 2352 "src/parse-gram.c" /* yacc.c:1669 */ |
0294b130 AD |
2352 | break; |
2353 | ||
25b27513 | 2354 | case 44: |
246ff8c1 | 2355 | #line 439 "src/parse-gram.y" /* yacc.c:1669 */ |
9280d3ef | 2356 | { |
1f4cc0f4 | 2357 | union_seen = true; |
c5dbd909 | 2358 | muscle_code_grow ("union_members", (yyvsp[0].chars), (yylsp[0])); |
7ecec4dd | 2359 | code_scanner_last_string_free (); |
9280d3ef | 2360 | } |
8ecac08f | 2361 | #line 2362 "src/parse-gram.c" /* yacc.c:1669 */ |
9280d3ef AD |
2362 | break; |
2363 | ||
25b27513 | 2364 | case 45: |
246ff8c1 | 2365 | #line 450 "src/parse-gram.y" /* yacc.c:1669 */ |
58d7a1a1 | 2366 | { current_class = nterm_sym; } |
8ecac08f | 2367 | #line 2368 "src/parse-gram.c" /* yacc.c:1669 */ |
366eea36 AD |
2368 | break; |
2369 | ||
25b27513 | 2370 | case 46: |
246ff8c1 | 2371 | #line 451 "src/parse-gram.y" /* yacc.c:1669 */ |
366eea36 AD |
2372 | { |
2373 | current_class = unknown_sym; | |
2374 | current_type = NULL; | |
2375 | } | |
8ecac08f | 2376 | #line 2377 "src/parse-gram.c" /* yacc.c:1669 */ |
366eea36 AD |
2377 | break; |
2378 | ||
25b27513 | 2379 | case 47: |
246ff8c1 | 2380 | #line 455 "src/parse-gram.y" /* yacc.c:1669 */ |
58d7a1a1 | 2381 | { current_class = token_sym; } |
8ecac08f | 2382 | #line 2383 "src/parse-gram.c" /* yacc.c:1669 */ |
58d7a1a1 AD |
2383 | break; |
2384 | ||
25b27513 | 2385 | case 48: |
246ff8c1 | 2386 | #line 456 "src/parse-gram.y" /* yacc.c:1669 */ |
58d7a1a1 AD |
2387 | { |
2388 | current_class = unknown_sym; | |
2389 | current_type = NULL; | |
2390 | } | |
8ecac08f | 2391 | #line 2392 "src/parse-gram.c" /* yacc.c:1669 */ |
58d7a1a1 AD |
2392 | break; |
2393 | ||
25b27513 | 2394 | case 49: |
246ff8c1 | 2395 | #line 461 "src/parse-gram.y" /* yacc.c:1669 */ |
1e0bab92 | 2396 | { |
05d18c24 | 2397 | symbol_list *list; |
3acc0308 | 2398 | tag_seen = true; |
e3dda35c | 2399 | for (list = (yyvsp[0].list); list; list = list->next) |
e9690142 | 2400 | symbol_type_set (list->content.sym, (yyvsp[-1].uniqstr), (yylsp[-1])); |
e3dda35c | 2401 | symbol_list_free ((yyvsp[0].list)); |
1e0bab92 | 2402 | } |
8ecac08f | 2403 | #line 2404 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2404 | break; |
1921f1d7 | 2405 | |
25b27513 | 2406 | case 50: |
246ff8c1 | 2407 | #line 472 "src/parse-gram.y" /* yacc.c:1669 */ |
1921f1d7 | 2408 | { |
05d18c24 | 2409 | symbol_list *list; |
1e0bab92 | 2410 | ++current_prec; |
e3dda35c | 2411 | for (list = (yyvsp[0].list); list; list = list->next) |
e9690142 JD |
2412 | { |
2413 | symbol_type_set (list->content.sym, current_type, (yylsp[-1])); | |
2414 | symbol_precedence_set (list->content.sym, current_prec, (yyvsp[-2].assoc), (yylsp[-2])); | |
2415 | } | |
e3dda35c | 2416 | symbol_list_free ((yyvsp[0].list)); |
2c569025 AD |
2417 | current_type = NULL; |
2418 | } | |
8ecac08f | 2419 | #line 2420 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2420 | break; |
1921f1d7 | 2421 | |
25b27513 | 2422 | case 51: |
246ff8c1 | 2423 | #line 486 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2424 | { (yyval.assoc) = left_assoc; } |
8ecac08f | 2425 | #line 2426 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2426 | break; |
1921f1d7 | 2427 | |
25b27513 | 2428 | case 52: |
246ff8c1 | 2429 | #line 487 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2430 | { (yyval.assoc) = right_assoc; } |
8ecac08f | 2431 | #line 2432 "src/parse-gram.c" /* yacc.c:1669 */ |
4cdb01db | 2432 | break; |
1921f1d7 | 2433 | |
25b27513 | 2434 | case 53: |
246ff8c1 | 2435 | #line 488 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2436 | { (yyval.assoc) = non_assoc; } |
8ecac08f | 2437 | #line 2438 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2438 | break; |
1921f1d7 | 2439 | |
25b27513 | 2440 | case 54: |
246ff8c1 | 2441 | #line 489 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2442 | { (yyval.assoc) = precedence_assoc; } |
8ecac08f | 2443 | #line 2444 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2444 | break; |
1921f1d7 | 2445 | |
25b27513 | 2446 | case 55: |
246ff8c1 | 2447 | #line 493 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2448 | { current_type = NULL; } |
8ecac08f | 2449 | #line 2450 "src/parse-gram.c" /* yacc.c:1669 */ |
3be03b13 JD |
2450 | break; |
2451 | ||
25b27513 | 2452 | case 56: |
246ff8c1 | 2453 | #line 494 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2454 | { current_type = (yyvsp[0].uniqstr); tag_seen = true; } |
8ecac08f | 2455 | #line 2456 "src/parse-gram.c" /* yacc.c:1669 */ |
3be03b13 JD |
2456 | break; |
2457 | ||
25b27513 | 2458 | case 57: |
246ff8c1 | 2459 | #line 500 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2460 | { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } |
8ecac08f | 2461 | #line 2462 "src/parse-gram.c" /* yacc.c:1669 */ |
4cdb01db | 2462 | break; |
1921f1d7 | 2463 | |
25b27513 | 2464 | case 58: |
246ff8c1 | 2465 | #line 502 "src/parse-gram.y" /* yacc.c:1669 */ |
c6a731ee | 2466 | { (yyval.list) = symbol_list_append ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); } |
8ecac08f | 2467 | #line 2468 "src/parse-gram.c" /* yacc.c:1669 */ |
4cdb01db | 2468 | break; |
1921f1d7 | 2469 | |
25b27513 | 2470 | case 59: |
246ff8c1 | 2471 | #line 506 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2472 | { (yyval.symbol) = (yyvsp[0].symbol); } |
8ecac08f | 2473 | #line 2474 "src/parse-gram.c" /* yacc.c:1669 */ |
3be03b13 JD |
2474 | break; |
2475 | ||
25b27513 | 2476 | case 60: |
246ff8c1 | 2477 | #line 507 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2478 | { (yyval.symbol) = (yyvsp[-1].symbol); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); } |
8ecac08f | 2479 | #line 2480 "src/parse-gram.c" /* yacc.c:1669 */ |
3be03b13 JD |
2480 | break; |
2481 | ||
25b27513 | 2482 | case 61: |
246ff8c1 | 2483 | #line 513 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2484 | { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } |
8ecac08f | 2485 | #line 2486 "src/parse-gram.c" /* yacc.c:1669 */ |
3be03b13 JD |
2486 | break; |
2487 | ||
25b27513 | 2488 | case 62: |
246ff8c1 | 2489 | #line 515 "src/parse-gram.y" /* yacc.c:1669 */ |
c6a731ee | 2490 | { (yyval.list) = symbol_list_append ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); } |
8ecac08f | 2491 | #line 2492 "src/parse-gram.c" /* yacc.c:1669 */ |
12e35840 JD |
2492 | break; |
2493 | ||
25b27513 | 2494 | case 63: |
246ff8c1 | 2495 | #line 519 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2496 | { (yyval.list) = (yyvsp[0].list); } |
8ecac08f | 2497 | #line 2498 "src/parse-gram.c" /* yacc.c:1669 */ |
ab7f29f8 JD |
2498 | break; |
2499 | ||
25b27513 | 2500 | case 64: |
246ff8c1 | 2501 | #line 520 "src/parse-gram.y" /* yacc.c:1669 */ |
c6a731ee | 2502 | { (yyval.list) = symbol_list_append ((yyvsp[-1].list), (yyvsp[0].list)); } |
8ecac08f | 2503 | #line 2504 "src/parse-gram.c" /* yacc.c:1669 */ |
ab7f29f8 JD |
2504 | break; |
2505 | ||
25b27513 | 2506 | case 65: |
246ff8c1 | 2507 | #line 524 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2508 | { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } |
8ecac08f | 2509 | #line 2510 "src/parse-gram.c" /* yacc.c:1669 */ |
ab7f29f8 JD |
2510 | break; |
2511 | ||
25b27513 | 2512 | case 66: |
246ff8c1 | 2513 | #line 525 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2514 | { (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); } |
8ecac08f | 2515 | #line 2516 "src/parse-gram.c" /* yacc.c:1669 */ |
ab7f29f8 JD |
2516 | break; |
2517 | ||
25b27513 | 2518 | case 68: |
246ff8c1 | 2519 | #line 530 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2520 | { (yyval.uniqstr) = uniqstr_new ("*"); } |
8ecac08f | 2521 | #line 2522 "src/parse-gram.c" /* yacc.c:1669 */ |
f7398526 AD |
2522 | break; |
2523 | ||
25b27513 | 2524 | case 69: |
246ff8c1 | 2525 | #line 531 "src/parse-gram.y" /* yacc.c:1669 */ |
0294b130 | 2526 | { (yyval.uniqstr) = uniqstr_new (""); } |
8ecac08f | 2527 | #line 2528 "src/parse-gram.c" /* yacc.c:1669 */ |
0294b130 AD |
2528 | break; |
2529 | ||
25b27513 | 2530 | case 70: |
246ff8c1 | 2531 | #line 537 "src/parse-gram.y" /* yacc.c:1669 */ |
1921f1d7 | 2532 | { |
74ce3cfb AD |
2533 | current_type = (yyvsp[0].uniqstr); |
2534 | tag_seen = true; | |
2535 | } | |
8ecac08f | 2536 | #line 2537 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2537 | break; |
1921f1d7 | 2538 | |
25b27513 | 2539 | case 71: |
246ff8c1 | 2540 | #line 542 "src/parse-gram.y" /* yacc.c:1669 */ |
1921f1d7 | 2541 | { |
74ce3cfb AD |
2542 | symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true); |
2543 | symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0])); | |
2544 | } | |
8ecac08f | 2545 | #line 2546 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2546 | break; |
1921f1d7 | 2547 | |
25b27513 | 2548 | case 72: |
246ff8c1 | 2549 | #line 547 "src/parse-gram.y" /* yacc.c:1669 */ |
1921f1d7 | 2550 | { |
e3dda35c AD |
2551 | symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true); |
2552 | symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1])); | |
2553 | symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); | |
4cdb01db | 2554 | } |
8ecac08f | 2555 | #line 2556 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2556 | break; |
1921f1d7 | 2557 | |
25b27513 | 2558 | case 73: |
246ff8c1 | 2559 | #line 553 "src/parse-gram.y" /* yacc.c:1669 */ |
1921f1d7 | 2560 | { |
e3dda35c AD |
2561 | symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true); |
2562 | symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1])); | |
2563 | symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc)); | |
4cdb01db | 2564 | } |
8ecac08f | 2565 | #line 2566 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2566 | break; |
1921f1d7 | 2567 | |
25b27513 | 2568 | case 74: |
246ff8c1 | 2569 | #line 559 "src/parse-gram.y" /* yacc.c:1669 */ |
1921f1d7 | 2570 | { |
e3dda35c AD |
2571 | symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true); |
2572 | symbol_type_set ((yyvsp[-2].symbol), current_type, (yylsp[-2])); | |
2573 | symbol_user_token_number_set ((yyvsp[-2].symbol), (yyvsp[-1].integer), (yylsp[-1])); | |
2574 | symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc)); | |
4cdb01db | 2575 | } |
8ecac08f | 2576 | #line 2577 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2577 | break; |
1921f1d7 | 2578 | |
25b27513 | 2579 | case 81: |
246ff8c1 | 2580 | #line 589 "src/parse-gram.y" /* yacc.c:1669 */ |
b275314e AD |
2581 | { |
2582 | yyerrok; | |
2583 | } | |
8ecac08f | 2584 | #line 2585 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2585 | break; |
1921f1d7 | 2586 | |
25b27513 | 2587 | case 82: |
246ff8c1 | 2588 | #line 595 "src/parse-gram.y" /* yacc.c:1669 */ |
f9d52903 | 2589 | { current_lhs ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); } |
8ecac08f | 2590 | #line 2591 "src/parse-gram.c" /* yacc.c:1669 */ |
f9d52903 JD |
2591 | break; |
2592 | ||
25b27513 | 2593 | case 83: |
246ff8c1 | 2594 | #line 596 "src/parse-gram.y" /* yacc.c:1669 */ |
f9d52903 JD |
2595 | { |
2596 | /* Free the current lhs. */ | |
2597 | current_lhs (0, (yylsp[-3]), 0); | |
2598 | } | |
8ecac08f | 2599 | #line 2600 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2600 | break; |
1921f1d7 | 2601 | |
25b27513 | 2602 | case 84: |
246ff8c1 | 2603 | #line 603 "src/parse-gram.y" /* yacc.c:1669 */ |
e3dda35c | 2604 | { grammar_current_rule_end ((yylsp[0])); } |
8ecac08f | 2605 | #line 2606 "src/parse-gram.c" /* yacc.c:1669 */ |
4cdb01db | 2606 | break; |
1921f1d7 | 2607 | |
25b27513 | 2608 | case 85: |
246ff8c1 | 2609 | #line 604 "src/parse-gram.y" /* yacc.c:1669 */ |
e3dda35c | 2610 | { grammar_current_rule_end ((yylsp[0])); } |
8ecac08f | 2611 | #line 2612 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2612 | break; |
1921f1d7 | 2613 | |
25b27513 | 2614 | case 87: |
8ecac08f | 2615 | #line 611 "src/parse-gram.y" /* yacc.c:1669 */ |
f9d52903 | 2616 | { grammar_current_rule_begin (current_lhs_symbol, current_lhs_location, |
e9690142 | 2617 | current_lhs_named_ref); } |
8ecac08f | 2618 | #line 2619 "src/parse-gram.c" /* yacc.c:1669 */ |
e9071366 AD |
2619 | break; |
2620 | ||
25b27513 | 2621 | case 88: |
8ecac08f | 2622 | #line 614 "src/parse-gram.y" /* yacc.c:1669 */ |
d70059ec | 2623 | { grammar_current_rule_symbol_append ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); } |
8ecac08f | 2624 | #line 2625 "src/parse-gram.c" /* yacc.c:1669 */ |
676385e2 PH |
2625 | break; |
2626 | ||
25b27513 | 2627 | case 89: |
8ecac08f | 2628 | #line 616 "src/parse-gram.y" /* yacc.c:1669 */ |
ca2a6d15 | 2629 | { grammar_current_rule_action_append ((yyvsp[-1].code), (yylsp[-1]), (yyvsp[0].named_ref), false); } |
8ecac08f | 2630 | #line 2631 "src/parse-gram.c" /* yacc.c:1669 */ |
676385e2 PH |
2631 | break; |
2632 | ||
25b27513 | 2633 | case 90: |
8ecac08f | 2634 | #line 618 "src/parse-gram.y" /* yacc.c:1669 */ |
ca2a6d15 | 2635 | { grammar_current_rule_action_append ((yyvsp[0].code), (yylsp[0]), NULL, true); } |
8ecac08f | 2636 | #line 2637 "src/parse-gram.c" /* yacc.c:1669 */ |
3fa3725a PE |
2637 | break; |
2638 | ||
25b27513 | 2639 | case 91: |
8ecac08f AD |
2640 | #line 620 "src/parse-gram.y" /* yacc.c:1669 */ |
2641 | { grammar_current_rule_empty_set ((yylsp[0])); } | |
2642 | #line 2643 "src/parse-gram.c" /* yacc.c:1669 */ | |
5e6feb86 PE |
2643 | break; |
2644 | ||
25b27513 | 2645 | case 92: |
8ecac08f AD |
2646 | #line 622 "src/parse-gram.y" /* yacc.c:1669 */ |
2647 | { grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); } | |
2648 | #line 2649 "src/parse-gram.c" /* yacc.c:1669 */ | |
b275314e AD |
2649 | break; |
2650 | ||
25b27513 | 2651 | case 93: |
8ecac08f AD |
2652 | #line 624 "src/parse-gram.y" /* yacc.c:1669 */ |
2653 | { grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); } | |
2654 | #line 2655 "src/parse-gram.c" /* yacc.c:1669 */ | |
d70059ec AR |
2655 | break; |
2656 | ||
25b27513 | 2657 | case 94: |
8ecac08f AD |
2658 | #line 626 "src/parse-gram.y" /* yacc.c:1669 */ |
2659 | { grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); } | |
2660 | #line 2661 "src/parse-gram.c" /* yacc.c:1669 */ | |
ca2a6d15 PH |
2661 | break; |
2662 | ||
25b27513 | 2663 | case 95: |
8ecac08f AD |
2664 | #line 630 "src/parse-gram.y" /* yacc.c:1669 */ |
2665 | { (yyval.named_ref) = 0; } | |
2666 | #line 2667 "src/parse-gram.c" /* yacc.c:1669 */ | |
d70059ec AR |
2667 | break; |
2668 | ||
8ecac08f AD |
2669 | case 96: |
2670 | #line 631 "src/parse-gram.y" /* yacc.c:1669 */ | |
2671 | { (yyval.named_ref) = named_ref_new((yyvsp[0].uniqstr), (yylsp[0])); } | |
2672 | #line 2673 "src/parse-gram.c" /* yacc.c:1669 */ | |
16dc6a9e JD |
2673 | break; |
2674 | ||
25b27513 | 2675 | case 98: |
8ecac08f AD |
2676 | #line 642 "src/parse-gram.y" /* yacc.c:1669 */ |
2677 | { (yyval.uniqstr) = uniqstr_new ((yyvsp[0].chars)); } | |
2678 | #line 2679 "src/parse-gram.c" /* yacc.c:1669 */ | |
2ce4ed68 AD |
2679 | break; |
2680 | ||
25b27513 | 2681 | case 99: |
8ecac08f AD |
2682 | #line 647 "src/parse-gram.y" /* yacc.c:1669 */ |
2683 | { (yyval.chars) = ""; } | |
2684 | #line 2685 "src/parse-gram.c" /* yacc.c:1669 */ | |
2685 | break; | |
2686 | ||
2687 | case 100: | |
2688 | #line 648 "src/parse-gram.y" /* yacc.c:1669 */ | |
cf499cff | 2689 | { (yyval.chars) = (yyvsp[0].uniqstr); } |
8ecac08f | 2690 | #line 2691 "src/parse-gram.c" /* yacc.c:1669 */ |
cf499cff JD |
2691 | break; |
2692 | ||
25b27513 | 2693 | case 101: |
8ecac08f AD |
2694 | #line 649 "src/parse-gram.y" /* yacc.c:1669 */ |
2695 | { (yyval.chars) = (yyvsp[0].chars); } | |
2696 | #line 2697 "src/parse-gram.c" /* yacc.c:1669 */ | |
2697 | break; | |
2698 | ||
2699 | case 102: | |
2700 | #line 659 "src/parse-gram.y" /* yacc.c:1669 */ | |
2ce4ed68 | 2701 | { |
7c0c6181 | 2702 | code_props plain_code; |
e3dda35c AD |
2703 | (yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n'; |
2704 | code_props_plain_init (&plain_code, (yyvsp[0].code)+1, (yylsp[0])); | |
7c0c6181 JD |
2705 | code_props_translate_code (&plain_code); |
2706 | gram_scanner_last_string_free (); | |
2707 | (yyval.chars) = plain_code.code; | |
2ce4ed68 | 2708 | } |
8ecac08f | 2709 | #line 2710 "src/parse-gram.c" /* yacc.c:1669 */ |
2ce4ed68 AD |
2710 | break; |
2711 | ||
8ecac08f AD |
2712 | case 103: |
2713 | #line 679 "src/parse-gram.y" /* yacc.c:1669 */ | |
e3dda35c | 2714 | { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } |
8ecac08f | 2715 | #line 2716 "src/parse-gram.c" /* yacc.c:1669 */ |
916708d5 AD |
2716 | break; |
2717 | ||
8ecac08f AD |
2718 | case 104: |
2719 | #line 681 "src/parse-gram.y" /* yacc.c:1669 */ | |
d2a1a60a | 2720 | { |
e3dda35c AD |
2721 | (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0])); |
2722 | symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); | |
2723 | symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0])); | |
d2a1a60a | 2724 | } |
8ecac08f | 2725 | #line 2726 "src/parse-gram.c" /* yacc.c:1669 */ |
66ef8b9d PE |
2726 | break; |
2727 | ||
8ecac08f AD |
2728 | case 105: |
2729 | #line 689 "src/parse-gram.y" /* yacc.c:1669 */ | |
e3dda35c | 2730 | { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } |
8ecac08f | 2731 | #line 2732 "src/parse-gram.c" /* yacc.c:1669 */ |
58d7a1a1 AD |
2732 | break; |
2733 | ||
8ecac08f AD |
2734 | case 108: |
2735 | #line 701 "src/parse-gram.y" /* yacc.c:1669 */ | |
1921f1d7 | 2736 | { |
e3dda35c AD |
2737 | (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0])); |
2738 | symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); | |
4cdb01db | 2739 | } |
8ecac08f | 2740 | #line 2741 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 | 2741 | break; |
1921f1d7 | 2742 | |
8ecac08f AD |
2743 | case 110: |
2744 | #line 710 "src/parse-gram.y" /* yacc.c:1669 */ | |
1921f1d7 | 2745 | { |
7c0c6181 | 2746 | code_props plain_code; |
e3dda35c | 2747 | code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0])); |
7c0c6181 | 2748 | code_props_translate_code (&plain_code); |
e9071366 | 2749 | gram_scanner_last_string_free (); |
e3dda35c | 2750 | muscle_code_grow ("epilogue", plain_code.code, (yylsp[0])); |
7c0c6181 | 2751 | code_scanner_last_string_free (); |
4cdb01db | 2752 | } |
8ecac08f | 2753 | #line 2754 "src/parse-gram.c" /* yacc.c:1669 */ |
e9955c83 AD |
2754 | break; |
2755 | ||
2756 | ||
8ecac08f | 2757 | #line 2758 "src/parse-gram.c" /* yacc.c:1669 */ |
107844a3 JD |
2758 | default: break; |
2759 | } | |
2760 | if (yychar_backup != yychar) | |
2761 | YY_LAC_DISCARD ("yychar change"); | |
2762 | } | |
df222dfa JD |
2763 | /* User semantic actions sometimes alter yychar, and that requires |
2764 | that yytoken be updated with the new translation. We take the | |
2765 | approach of translating immediately before every use of yytoken. | |
2766 | One alternative is translating here after every semantic action, | |
2767 | but that translation would be missed if the semantic action invokes | |
2768 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or | |
2769 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an | |
2770 | incorrect destructor might then be invoked immediately. In the | |
2771 | case of YYERROR or YYBACKUP, subsequent parser actions might lead | |
2772 | to an incorrect destructor call or verbose syntax error message | |
2773 | before the lookahead is translated. */ | |
66809587 | 2774 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
1921f1d7 | 2775 | |
3b0ffc7e PE |
2776 | YYPOPSTACK (yylen); |
2777 | yylen = 0; | |
05d18c24 | 2778 | YY_STACK_PRINT (yyss, yyssp); |
e9955c83 AD |
2779 | |
2780 | *++yyvsp = yyval; | |
e9955c83 | 2781 | *++yylsp = yyloc; |
e9955c83 | 2782 | |
45eebca4 | 2783 | /* Now 'shift' the result of the reduction. Determine what state |
e9955c83 AD |
2784 | that goes to, based on the state we popped back to and the rule |
2785 | number reduced by. */ | |
2786 | ||
2787 | yyn = yyr1[yyn]; | |
2788 | ||
1921f1d7 | 2789 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
219741d8 | 2790 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
e9955c83 AD |
2791 | yystate = yytable[yystate]; |
2792 | else | |
1921f1d7 | 2793 | yystate = yydefgoto[yyn - YYNTOKENS]; |
e9955c83 AD |
2794 | |
2795 | goto yynewstate; | |
2796 | ||
2797 | ||
007c5908 AD |
2798 | /*--------------------------------------. |
2799 | | yyerrlab -- here on detecting error. | | |
2800 | `--------------------------------------*/ | |
e9955c83 | 2801 | yyerrlab: |
df222dfa JD |
2802 | /* Make sure we have latest lookahead translation. See comments at |
2803 | user semantic actions for why this is necessary. */ | |
d2060f06 | 2804 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
df222dfa | 2805 | |
e9955c83 AD |
2806 | /* If not already recovering from an error, report this error. */ |
2807 | if (!yyerrstatus) | |
2808 | { | |
2809 | ++yynerrs; | |
2abdfeef | 2810 | #if ! YYERROR_VERBOSE |
246ff8c1 | 2811 | yyerror (&yylloc, YY_("syntax error")); |
2abdfeef | 2812 | #else |
107844a3 JD |
2813 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
2814 | yyesa, &yyes, &yyes_capacity, \ | |
2815 | yyssp, yytoken) | |
b4bbc4a0 JD |
2816 | { |
2817 | char const *yymsgp = YY_("syntax error"); | |
bf35c71c | 2818 | int yysyntax_error_status; |
107844a3 JD |
2819 | if (yychar != YYEMPTY) |
2820 | YY_LAC_ESTABLISH; | |
bf35c71c | 2821 | yysyntax_error_status = YYSYNTAX_ERROR; |
b4bbc4a0 JD |
2822 | if (yysyntax_error_status == 0) |
2823 | yymsgp = yymsg; | |
d2060f06 | 2824 | else if (yysyntax_error_status == 1) |
b4bbc4a0 JD |
2825 | { |
2826 | if (yymsg != yymsgbuf) | |
2827 | YYSTACK_FREE (yymsg); | |
2828 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); | |
2829 | if (!yymsg) | |
2830 | { | |
2831 | yymsg = yymsgbuf; | |
2832 | yymsg_alloc = sizeof yymsgbuf; | |
d2060f06 | 2833 | yysyntax_error_status = 2; |
b4bbc4a0 JD |
2834 | } |
2835 | else | |
2836 | { | |
2837 | yysyntax_error_status = YYSYNTAX_ERROR; | |
2838 | yymsgp = yymsg; | |
2839 | } | |
2840 | } | |
246ff8c1 | 2841 | yyerror (&yylloc, yymsgp); |
b4bbc4a0 JD |
2842 | if (yysyntax_error_status == 2) |
2843 | goto yyexhaustedlab; | |
2844 | } | |
2845 | # undef YYSYNTAX_ERROR | |
2abdfeef | 2846 | #endif |
e9955c83 | 2847 | } |
e9955c83 | 2848 | |
44c2b42d | 2849 | yyerror_range[1] = yylloc; |
78a00b7d | 2850 | |
e9955c83 AD |
2851 | if (yyerrstatus == 3) |
2852 | { | |
9bc0dd67 | 2853 | /* If just tried and failed to reuse lookahead token after an |
e9690142 | 2854 | error, discard it. */ |
e9955c83 | 2855 | |
465b4444 | 2856 | if (yychar <= YYEOF) |
e9690142 JD |
2857 | { |
2858 | /* Return failure if at end of input. */ | |
2859 | if (yychar == YYEOF) | |
2860 | YYABORT; | |
2861 | } | |
465b4444 | 2862 | else |
e9690142 JD |
2863 | { |
2864 | yydestruct ("Error: discarding", | |
2865 | yytoken, &yylval, &yylloc); | |
2866 | yychar = YYEMPTY; | |
2867 | } | |
e9955c83 AD |
2868 | } |
2869 | ||
9bc0dd67 | 2870 | /* Else will try to reuse lookahead token after shifting the error |
e9955c83 | 2871 | token. */ |
6d5aa694 | 2872 | goto yyerrlab1; |
e9955c83 | 2873 | |
05d18c24 | 2874 | |
465b4444 PE |
2875 | /*---------------------------------------------------. |
2876 | | yyerrorlab -- error raised explicitly by YYERROR. | | |
2877 | `---------------------------------------------------*/ | |
2878 | yyerrorlab: | |
2879 | ||
e1054895 PE |
2880 | /* Pacify compilers like GCC when the user code never invokes |
2881 | YYERROR and the label yyerrorlab therefore never appears in user | |
2882 | code. */ | |
e764d4df | 2883 | if (/*CONSTCOND*/ 0) |
465b4444 | 2884 | goto yyerrorlab; |
465b4444 | 2885 | |
44c2b42d | 2886 | yyerror_range[1] = yylsp[1-yylen]; |
0a9042a6 | 2887 | /* Do not reclaim the symbols of the rule whose action triggered |
3b0ffc7e PE |
2888 | this YYERROR. */ |
2889 | YYPOPSTACK (yylen); | |
2890 | yylen = 0; | |
2891 | YY_STACK_PRINT (yyss, yyssp); | |
465b4444 | 2892 | yystate = *yyssp; |
465b4444 PE |
2893 | goto yyerrlab1; |
2894 | ||
2895 | ||
2896 | /*-------------------------------------------------------------. | |
2897 | | yyerrlab1 -- common code for both syntax error and YYERROR. | | |
2898 | `-------------------------------------------------------------*/ | |
05d18c24 | 2899 | yyerrlab1: |
e9690142 | 2900 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
e9955c83 | 2901 | |
1921f1d7 AD |
2902 | for (;;) |
2903 | { | |
2904 | yyn = yypact[yystate]; | |
f2b30bdf | 2905 | if (!yypact_value_is_default (yyn)) |
e9690142 JD |
2906 | { |
2907 | yyn += YYTERROR; | |
2908 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
2909 | { | |
2910 | yyn = yytable[yyn]; | |
2911 | if (0 < yyn) | |
2912 | break; | |
2913 | } | |
2914 | } | |
4cdb01db | 2915 | |
1921f1d7 AD |
2916 | /* Pop the current state because it cannot handle the error token. */ |
2917 | if (yyssp == yyss) | |
e9690142 | 2918 | YYABORT; |
0c15323d | 2919 | |
44c2b42d | 2920 | yyerror_range[1] = *yylsp; |
4b367315 | 2921 | yydestruct ("Error: popping", |
e9690142 | 2922 | yystos[yystate], yyvsp, yylsp); |
3b0ffc7e | 2923 | YYPOPSTACK (1); |
465b4444 | 2924 | yystate = *yyssp; |
05d18c24 | 2925 | YY_STACK_PRINT (yyss, yyssp); |
e9955c83 AD |
2926 | } |
2927 | ||
107844a3 JD |
2928 | /* If the stack popping above didn't lose the initial context for the |
2929 | current lookahead token, the shift below will for sure. */ | |
2930 | YY_LAC_DISCARD ("error recovery"); | |
2931 | ||
25b27513 | 2932 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
e9955c83 | 2933 | *++yyvsp = yylval; |
25b27513 | 2934 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
8a8dc872 | 2935 | |
44c2b42d | 2936 | yyerror_range[2] = yylloc; |
8a8dc872 | 2937 | /* Using YYLLOC is tempting, but would change the location of |
9bc0dd67 | 2938 | the lookahead. YYLOC is available though. */ |
44c2b42d | 2939 | YYLLOC_DEFAULT (yyloc, yyerror_range, 2); |
78a00b7d | 2940 | *++yylsp = yyloc; |
e9955c83 | 2941 | |
3b0ffc7e | 2942 | /* Shift the error token. */ |
6088a2a0 | 2943 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
8a8dc872 | 2944 | |
e9955c83 AD |
2945 | yystate = yyn; |
2946 | goto yynewstate; | |
2947 | ||
2948 | ||
2949 | /*-------------------------------------. | |
2950 | | yyacceptlab -- YYACCEPT comes here. | | |
2951 | `-------------------------------------*/ | |
2952 | yyacceptlab: | |
2953 | yyresult = 0; | |
2954 | goto yyreturn; | |
2955 | ||
2956 | /*-----------------------------------. | |
2957 | | yyabortlab -- YYABORT comes here. | | |
2958 | `-----------------------------------*/ | |
2959 | yyabortlab: | |
2960 | yyresult = 1; | |
2961 | goto yyreturn; | |
2962 | ||
107844a3 | 2963 | #if 1 |
6088a2a0 PE |
2964 | /*-------------------------------------------------. |
2965 | | yyexhaustedlab -- memory exhaustion comes here. | | |
2966 | `-------------------------------------------------*/ | |
2967 | yyexhaustedlab: | |
246ff8c1 | 2968 | yyerror (&yylloc, YY_("memory exhausted")); |
e9955c83 AD |
2969 | yyresult = 2; |
2970 | /* Fall through. */ | |
366eea36 | 2971 | #endif |
e9955c83 AD |
2972 | |
2973 | yyreturn: | |
ec5479ce | 2974 | if (yychar != YYEMPTY) |
df222dfa JD |
2975 | { |
2976 | /* Make sure we have latest lookahead translation. See comments at | |
2977 | user semantic actions for why this is necessary. */ | |
2978 | yytoken = YYTRANSLATE (yychar); | |
2979 | yydestruct ("Cleanup: discarding lookahead", | |
2980 | yytoken, &yylval, &yylloc); | |
2981 | } | |
0a9042a6 | 2982 | /* Do not reclaim the symbols of the rule whose action triggered |
3b0ffc7e PE |
2983 | this YYABORT or YYACCEPT. */ |
2984 | YYPOPSTACK (yylen); | |
2985 | YY_STACK_PRINT (yyss, yyssp); | |
d11e0cfa PE |
2986 | while (yyssp != yyss) |
2987 | { | |
ec5d1a8a | 2988 | yydestruct ("Cleanup: popping", |
e9690142 | 2989 | yystos[*yyssp], yyvsp, yylsp); |
3b0ffc7e | 2990 | YYPOPSTACK (1); |
d11e0cfa | 2991 | } |
e9955c83 AD |
2992 | #ifndef yyoverflow |
2993 | if (yyss != yyssa) | |
2994 | YYSTACK_FREE (yyss); | |
2abdfeef | 2995 | #endif |
107844a3 JD |
2996 | if (yyes != yyesa) |
2997 | YYSTACK_FREE (yyes); | |
2abdfeef PE |
2998 | #if YYERROR_VERBOSE |
2999 | if (yymsg != yymsgbuf) | |
3000 | YYSTACK_FREE (yymsg); | |
e9955c83 | 3001 | #endif |
95dbea81 | 3002 | return yyresult; |
e9955c83 | 3003 | } |
8ecac08f | 3004 | #line 720 "src/parse-gram.y" /* yacc.c:1929 */ |
05d18c24 PE |
3005 | |
3006 | ||
3007 | /* Return the location of the left-hand side of a rule whose | |
3008 | right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in | |
3009 | the right-hand side, and return an empty location equal to the end | |
3010 | boundary of RHS[0] if the right-hand side is empty. */ | |
3011 | ||
3012 | static YYLTYPE | |
3013 | lloc_default (YYLTYPE const *rhs, int n) | |
3014 | { | |
3015 | int i; | |
1d64f0ba | 3016 | YYLTYPE loc; |
329d23c5 PE |
3017 | |
3018 | /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;". | |
3019 | The bug is fixed in 7.4.2m, but play it safe for now. */ | |
3020 | loc.start = rhs[n].end; | |
3021 | loc.end = rhs[n].end; | |
05d18c24 | 3022 | |
59420cd7 | 3023 | /* Ignore empty nonterminals the start of the right-hand side. |
73521d9f PE |
3024 | Do not bother to ignore them at the end of the right-hand side, |
3025 | since empty nonterminals have the same end as their predecessors. */ | |
05d18c24 PE |
3026 | for (i = 1; i <= n; i++) |
3027 | if (! equal_boundaries (rhs[i].start, rhs[i].end)) | |
3028 | { | |
e9690142 JD |
3029 | loc.start = rhs[i].start; |
3030 | break; | |
05d18c24 PE |
3031 | } |
3032 | ||
1d64f0ba | 3033 | return loc; |
05d18c24 PE |
3034 | } |
3035 | ||
3036 | ||
05d18c24 | 3037 | static void |
b18cdd91 | 3038 | add_param (param_type type, char *decl, location loc) |
05d18c24 | 3039 | { |
8a8dc872 | 3040 | static char const alphanum[26 + 26 + 1 + 10] = |
05d18c24 PE |
3041 | "abcdefghijklmnopqrstuvwxyz" |
3042 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
8a8dc872 AD |
3043 | "_" |
3044 | "0123456789"; | |
dd875058 | 3045 | |
05d18c24 | 3046 | char const *name_start = NULL; |
dd875058 AD |
3047 | { |
3048 | char *p; | |
3049 | /* Stop on last actual character. */ | |
3050 | for (p = decl; p[1]; p++) | |
3051 | if ((p == decl | |
3052 | || ! memchr (alphanum, p[-1], sizeof alphanum)) | |
3053 | && memchr (alphanum, p[0], sizeof alphanum - 10)) | |
3054 | name_start = p; | |
3055 | ||
3056 | /* Strip the surrounding '{' and '}', and any blanks just inside | |
3057 | the braces. */ | |
52cc1ebd | 3058 | --p; |
6b5a7489 | 3059 | while (c_isspace ((unsigned char) *p)) |
52cc1ebd | 3060 | --p; |
dd875058 | 3061 | p[1] = '\0'; |
52cc1ebd | 3062 | ++decl; |
6b5a7489 | 3063 | while (c_isspace ((unsigned char) *decl)) |
52cc1ebd | 3064 | ++decl; |
dd875058 | 3065 | } |
73521d9f | 3066 | |
05d18c24 | 3067 | if (! name_start) |
bb8e56ff | 3068 | complain (&loc, complaint, _("missing identifier in parameter declaration")); |
05d18c24 PE |
3069 | else |
3070 | { | |
398c298c | 3071 | char *name = xmemdup0 (name_start, strspn (name_start, alphanum)); |
b18cdd91 AD |
3072 | if (type & param_lex) |
3073 | muscle_pair_list_grow ("lex_param", decl, name); | |
3074 | if (type & param_parse) | |
3075 | muscle_pair_list_grow ("parse_param", decl, name); | |
05d18c24 PE |
3076 | free (name); |
3077 | } | |
3078 | ||
e9071366 | 3079 | gram_scanner_last_string_free (); |
05d18c24 | 3080 | } |
e9955c83 | 3081 | |
2ce4ed68 | 3082 | |
b50d2359 AD |
3083 | static void |
3084 | version_check (location const *loc, char const *version) | |
3085 | { | |
3086 | if (strverscmp (version, PACKAGE_VERSION) > 0) | |
9b8a5ce0 | 3087 | { |
bb8e56ff TR |
3088 | complain (loc, complaint, "require bison %s, but have %s", |
3089 | version, PACKAGE_VERSION); | |
6f8f253b | 3090 | exit (EX_MISMATCH); |
9b8a5ce0 | 3091 | } |
b50d2359 AD |
3092 | } |
3093 | ||
05d18c24 PE |
3094 | static void |
3095 | gram_error (location const *loc, char const *msg) | |
e9955c83 | 3096 | { |
bb8e56ff | 3097 | complain (loc, complaint, "%s", msg); |
e9955c83 | 3098 | } |
1921f1d7 | 3099 | |
73521d9f PE |
3100 | char const * |
3101 | token_name (int type) | |
3102 | { | |
e0045d49 | 3103 | return yytname[YYTRANSLATE (type)]; |
73521d9f PE |
3104 | } |
3105 | ||
d2a1a60a PE |
3106 | static char const * |
3107 | char_name (char c) | |
3108 | { | |
3109 | if (c == '\'') | |
3110 | return "'\\''"; | |
3111 | else | |
3112 | { | |
3113 | char buf[4]; | |
3114 | buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0'; | |
3115 | return quotearg_style (escape_quoting_style, buf); | |
3116 | } | |
3117 | } |