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