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