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