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