1 /* A Bison parser, made by GNU Bison 2.3a. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
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)
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.
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. */
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.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
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. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3a"
53 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 1
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
74 /* Copy the first part of user declarations. */
75 /* Line 164 of yacc.c. */
76 #line 1 "parse-gram.y"
77 /* Bison Grammar Parser -*- C -*-
79 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
81 This file is part of Bison, the GNU Compiler Compiler.
83 This program is free software; you can redistribute it and/or modify
84 it under the terms of the GNU General Public License as published by
85 the Free Software Foundation; either version 2 of the License, or
86 (at your option) any later version.
88 This program is distributed in the hope that it will be useful,
89 but WITHOUT ANY WARRANTY; without even the implied warranty of
90 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91 GNU General Public License for more details.
93 You should have received a copy of the GNU General Public License
94 along with this program; if not, write to the Free Software
95 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
102 #include <strverscmp.h>
104 #include "complain.h"
105 #include "conflicts.h"
109 #include "muscle_tab.h"
110 #include "quotearg.h"
113 #include "scan-gram.h"
114 #include "scan-code.h"
116 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
117 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
119 #define YY_LOCATION_PRINT(File, Loc) \
120 location_print (File, Loc)
122 static void version_check (location
const *loc
, char const *version
);
124 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
125 FIXME: depends on the undocumented availability of YYLLOC. */
127 #define yyerror(Msg) \
128 gram_error (&yylloc, Msg)
129 static void gram_error (location
const *, char const *);
131 static char const *char_name (char);
133 /** Add a lex-param or a parse-param.
135 * \param type \a lex_param or \a parse_param
136 * \param decl the formal argument
137 * \param loc the location in the source.
139 static void add_param (char const *type
, char *decl
, location loc
);
142 static symbol_class current_class
= unknown_sym
;
143 static uniqstr current_type
= NULL
;
144 static symbol
*current_lhs
;
145 static location current_lhs_location
;
146 static int current_prec
= 0;
148 #define YYTYPE_INT16 int_fast16_t
149 #define YYTYPE_INT8 int_fast8_t
150 #define YYTYPE_UINT16 uint_fast16_t
151 #define YYTYPE_UINT8 uint_fast8_t
154 /* Enabling traces. */
159 /* Enabling verbose error messages. */
160 #ifdef YYERROR_VERBOSE
161 # undef YYERROR_VERBOSE
162 # define YYERROR_VERBOSE 1
164 # define YYERROR_VERBOSE 1
167 /* Enabling the token table. */
168 #ifndef YYTOKEN_TABLE
169 # define YYTOKEN_TABLE 0
176 /* Put the tokens into the symbol table, so that GDB and other debuggers
185 PERCENT_DESTRUCTOR
= 263,
186 PERCENT_PRINTER
= 264,
187 PERCENT_SYMBOL_DEFAULT
= 265,
190 PERCENT_NONASSOC
= 268,
194 PERCENT_AFTER_HEADER
= 272,
195 PERCENT_BEFORE_HEADER
= 273,
197 PERCENT_DEFAULT_PREC
= 275,
198 PERCENT_DEFINE
= 276,
199 PERCENT_DEFINES
= 277,
200 PERCENT_END_HEADER
= 278,
201 PERCENT_ERROR_VERBOSE
= 279,
202 PERCENT_EXPECT
= 280,
203 PERCENT_EXPECT_RR
= 281,
204 PERCENT_FILE_PREFIX
= 282,
205 PERCENT_GLR_PARSER
= 283,
206 PERCENT_INITIAL_ACTION
= 284,
207 PERCENT_LEX_PARAM
= 285,
208 PERCENT_LOCATIONS
= 286,
209 PERCENT_NAME_PREFIX
= 287,
210 PERCENT_NO_DEFAULT_PREC
= 288,
211 PERCENT_NO_LINES
= 289,
212 PERCENT_NONDETERMINISTIC_PARSER
= 290,
213 PERCENT_OUTPUT
= 291,
214 PERCENT_PARSE_PARAM
= 292,
215 PERCENT_PURE_PARSER
= 293,
216 PERCENT_PUSH_PARSER
= 294,
217 PERCENT_REQUIRE
= 295,
218 PERCENT_SKELETON
= 296,
220 PERCENT_START_HEADER
= 298,
221 PERCENT_TOKEN_TABLE
= 299,
222 PERCENT_VERBOSE
= 300,
230 PERCENT_PERCENT
= 308,
242 #define PERCENT_TOKEN 260
243 #define PERCENT_NTERM 261
244 #define PERCENT_TYPE 262
245 #define PERCENT_DESTRUCTOR 263
246 #define PERCENT_PRINTER 264
247 #define PERCENT_SYMBOL_DEFAULT 265
248 #define PERCENT_LEFT 266
249 #define PERCENT_RIGHT 267
250 #define PERCENT_NONASSOC 268
251 #define PERCENT_PREC 269
252 #define PERCENT_DPREC 270
253 #define PERCENT_MERGE 271
254 #define PERCENT_AFTER_HEADER 272
255 #define PERCENT_BEFORE_HEADER 273
256 #define PERCENT_DEBUG 274
257 #define PERCENT_DEFAULT_PREC 275
258 #define PERCENT_DEFINE 276
259 #define PERCENT_DEFINES 277
260 #define PERCENT_END_HEADER 278
261 #define PERCENT_ERROR_VERBOSE 279
262 #define PERCENT_EXPECT 280
263 #define PERCENT_EXPECT_RR 281
264 #define PERCENT_FILE_PREFIX 282
265 #define PERCENT_GLR_PARSER 283
266 #define PERCENT_INITIAL_ACTION 284
267 #define PERCENT_LEX_PARAM 285
268 #define PERCENT_LOCATIONS 286
269 #define PERCENT_NAME_PREFIX 287
270 #define PERCENT_NO_DEFAULT_PREC 288
271 #define PERCENT_NO_LINES 289
272 #define PERCENT_NONDETERMINISTIC_PARSER 290
273 #define PERCENT_OUTPUT 291
274 #define PERCENT_PARSE_PARAM 292
275 #define PERCENT_PURE_PARSER 293
276 #define PERCENT_PUSH_PARSER 294
277 #define PERCENT_REQUIRE 295
278 #define PERCENT_SKELETON 296
279 #define PERCENT_START 297
280 #define PERCENT_START_HEADER 298
281 #define PERCENT_TOKEN_TABLE 299
282 #define PERCENT_VERBOSE 300
283 #define PERCENT_YACC 301
284 #define BRACED_CODE 302
290 #define PERCENT_PERCENT 308
293 #define SEMICOLON 311
295 #define PERCENT_UNION 313
300 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
301 typedef union YYSTYPE
302 {/* Line 198 of yacc.c. */
303 #line 98 "parse-gram.y"
311 unsigned char character
;
313 /* Line 198 of yacc.c. */
314 #line 315 "parse-gram.c"
316 # define YYSTYPE_IS_TRIVIAL 1
317 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
318 # define YYSTYPE_IS_DECLARED 1
321 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
322 typedef struct YYLTYPE
329 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
330 # define YYLTYPE_IS_DECLARED 1
331 # define YYLTYPE_IS_TRIVIAL 1
335 /* Copy the second part of user declarations. */
337 /* Line 221 of yacc.c. */
338 #line 339 "parse-gram.c"
345 typedef YYTYPE_UINT8 yytype_uint8
;
347 typedef unsigned char yytype_uint8
;
351 typedef YYTYPE_INT8 yytype_int8
;
352 #elif (defined __STDC__ || defined __C99__FUNC__ \
353 || defined __cplusplus || defined _MSC_VER)
354 typedef signed char yytype_int8
;
356 typedef short int yytype_int8
;
360 typedef YYTYPE_UINT16 yytype_uint16
;
362 typedef unsigned short int yytype_uint16
;
366 typedef YYTYPE_INT16 yytype_int16
;
368 typedef short int yytype_int16
;
372 # ifdef __SIZE_TYPE__
373 # define YYSIZE_T __SIZE_TYPE__
374 # elif defined size_t
375 # define YYSIZE_T size_t
376 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
377 || defined __cplusplus || defined _MSC_VER)
378 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
379 # define YYSIZE_T size_t
381 # define YYSIZE_T unsigned int
385 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
390 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
391 # define YY_(msgid) dgettext ("bison-runtime", msgid)
395 # define YY_(msgid) msgid
399 /* Suppress unused-variable warnings by "using" E. */
400 #if ! defined lint || defined __GNUC__
401 # define YYUSE(e) ((void) (e))
403 # define YYUSE(e) /* empty */
406 /* Identity function, used to suppress warnings about constant conditions. */
410 #if (defined __STDC__ || defined __C99__FUNC__ \
411 || defined __cplusplus || defined _MSC_VER)
424 #if ! defined yyoverflow || YYERROR_VERBOSE
426 /* The parser invokes alloca or malloc; define the necessary symbols. */
428 # ifdef YYSTACK_USE_ALLOCA
429 # if YYSTACK_USE_ALLOCA
431 # define YYSTACK_ALLOC __builtin_alloca
432 # elif defined __BUILTIN_VA_ARG_INCR
433 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
435 # define YYSTACK_ALLOC __alloca
436 # elif defined _MSC_VER
437 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
438 # define alloca _alloca
440 # define YYSTACK_ALLOC alloca
441 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
442 || defined __cplusplus || defined _MSC_VER)
443 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
452 # ifdef YYSTACK_ALLOC
453 /* Pacify GCC's `empty if-body' warning. */
454 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
455 # ifndef YYSTACK_ALLOC_MAXIMUM
456 /* The OS might guarantee only one guard page at the bottom of the stack,
457 and a page size can be as small as 4096 bytes. So we cannot safely
458 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
459 to allow for a few compiler-allocated temporary stack slots. */
460 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
463 # define YYSTACK_ALLOC YYMALLOC
464 # define YYSTACK_FREE YYFREE
465 # ifndef YYSTACK_ALLOC_MAXIMUM
466 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
468 # if (defined __cplusplus && ! defined _STDLIB_H \
469 && ! ((defined YYMALLOC || defined malloc) \
470 && (defined YYFREE || defined free)))
471 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
477 # define YYMALLOC malloc
478 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
479 || defined __cplusplus || defined _MSC_VER)
480 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
485 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
486 || defined __cplusplus || defined _MSC_VER)
487 void free (void *); /* INFRINGES ON USER NAME SPACE */
491 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
494 #if (! defined yyoverflow \
495 && (! defined __cplusplus \
496 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
497 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
499 /* A type that is properly aligned for any stack member. */
507 /* The size of the maximum gap between one aligned stack and the next. */
508 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
510 /* The size of an array large to enough to hold all stacks, each with
512 # define YYSTACK_BYTES(N) \
513 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
514 + 2 * YYSTACK_GAP_MAXIMUM)
516 /* Copy COUNT objects from FROM to TO. The source and destination do
519 # if defined __GNUC__ && 1 < __GNUC__
520 # define YYCOPY(To, From, Count) \
521 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
523 # define YYCOPY(To, From, Count) \
527 for (yyi = 0; yyi < (Count); yyi++) \
528 (To)[yyi] = (From)[yyi]; \
534 /* Relocate STACK from its old location to the new one. The
535 local variables YYSIZE and YYSTACKSIZE give the old and new number of
536 elements in the stack, and YYPTR gives the new location of the
537 stack. Advance YYPTR to a properly aligned location for the next
539 # define YYSTACK_RELOCATE(Stack) \
542 YYSIZE_T yynewbytes; \
543 YYCOPY (&yyptr->Stack, Stack, yysize); \
544 Stack = &yyptr->Stack; \
545 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
546 yyptr += yynewbytes / sizeof (*yyptr); \
552 /* YYFINAL -- State number of the termination state. */
554 /* YYLAST -- Last index in YYTABLE. */
557 /* YYNTOKENS -- Number of terminals. */
559 /* YYNNTS -- Number of nonterminals. */
561 /* YYNRULES -- Number of rules. */
563 /* YYNRULES -- Number of states. */
564 #define YYNSTATES 137
566 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
568 #define YYMAXUTOK 313
570 #define YYTRANSLATE(YYX) \
571 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
573 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
574 static const yytype_uint8 yytranslate
[] =
576 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
602 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
603 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
604 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
605 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
606 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
611 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
613 static const yytype_uint8 yyprhs
[] =
615 0, 0, 3, 8, 9, 12, 14, 16, 19, 22,
616 24, 28, 30, 33, 35, 38, 41, 45, 47, 50,
617 53, 55, 59, 61, 63, 67, 70, 72, 74, 77,
618 80, 83, 85, 87, 89, 91, 93, 95, 98, 102,
619 106, 108, 110, 111, 113, 117, 118, 122, 123, 127,
620 131, 135, 137, 139, 141, 142, 144, 146, 149, 151,
621 154, 156, 158, 160, 162, 164, 167, 170, 174, 176,
622 179, 181, 184, 186, 189, 192, 193, 197, 199, 203,
623 206, 207, 210, 213, 217, 221, 225, 227, 229, 230,
624 232, 234, 236, 238, 240, 242, 244, 246, 247
627 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
628 static const yytype_int8 yyrhs
[] =
630 60, 0, -1, 61, 53, 76, 89, -1, -1, 61,
631 62, -1, 63, -1, 55, -1, 17, 84, -1, 18,
632 84, -1, 19, -1, 21, 3, 83, -1, 22, -1,
633 23, 84, -1, 24, -1, 25, 4, -1, 26, 4,
634 -1, 27, 50, 3, -1, 28, -1, 29, 47, -1,
635 30, 47, -1, 31, -1, 32, 50, 3, -1, 34,
636 -1, 35, -1, 36, 50, 3, -1, 37, 47, -1,
637 38, -1, 39, -1, 40, 3, -1, 41, 3, -1,
638 43, 84, -1, 44, -1, 45, -1, 46, -1, 56,
639 -1, 68, -1, 65, -1, 42, 87, -1, 8, 47,
640 72, -1, 9, 47, 72, -1, 20, -1, 33, -1,
641 -1, 51, -1, 58, 64, 47, -1, -1, 6, 66,
642 75, -1, -1, 5, 67, 75, -1, 7, 57, 71,
643 -1, 69, 70, 71, -1, 11, -1, 12, -1, 13,
644 -1, -1, 57, -1, 87, -1, 71, 87, -1, 73,
645 -1, 72, 73, -1, 87, -1, 57, -1, 10, -1,
646 57, -1, 85, -1, 85, 4, -1, 85, 88, -1,
647 85, 4, 88, -1, 74, -1, 75, 74, -1, 77,
648 -1, 76, 77, -1, 78, -1, 63, 56, -1, 1,
649 56, -1, -1, 86, 79, 80, -1, 81, -1, 80,
650 54, 81, -1, 80, 56, -1, -1, 81, 87, -1,
651 81, 47, -1, 81, 14, 87, -1, 81, 15, 4,
652 -1, 81, 16, 57, -1, 3, -1, 84, -1, -1,
653 82, -1, 47, -1, 51, -1, 48, -1, 52, -1,
654 85, -1, 88, -1, 3, -1, -1, 53, 49, -1
657 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
658 static const yytype_uint16 yyrline
[] =
660 0, 209, 209, 217, 219, 223, 224, 225, 226, 227,
661 228, 229, 230, 231, 232, 233, 234, 235, 240, 244,
662 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
663 255, 256, 257, 258, 259, 263, 264, 265, 269, 277,
664 285, 289, 303, 304, 308, 336, 336, 341, 341, 346,
665 357, 372, 373, 374, 378, 379, 384, 386, 391, 392,
666 396, 397, 398, 403, 408, 413, 419, 425, 436, 437,
667 446, 447, 453, 454, 455, 462, 462, 466, 467, 468,
668 473, 474, 476, 478, 480, 482, 492, 493, 499, 503,
669 508, 524, 526, 535, 540, 541, 546, 553, 555
673 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
674 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
675 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
676 static const char *const yytname
[] =
678 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
679 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
680 "\"%printer\"", "\"%symbol-default\"", "\"%left\"", "\"%right\"",
681 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"",
682 "\"%after-header\"", "\"%before-header\"", "\"%debug\"",
683 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%end-header\"",
684 "\"%error-verbose\"", "\"%expect\"", "\"%expect-rr\"",
685 "\"%file-prefix\"", "\"%glr-parser\"", "\"%initial-action\"",
686 "\"%lex-param\"", "\"%locations\"", "\"%name-prefix\"",
687 "\"%no-default-prec\"", "\"%no-lines\"", "\"%nondeterministic-parser\"",
688 "\"%output\"", "\"%parse-param\"", "\"%pure-parser\"",
689 "\"%push-parser\"", "\"%require\"", "\"%skeleton\"", "\"%start\"",
690 "\"%start-header\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
691 "\"{...}\"", "\"char\"", "\"epilogue\"", "\"=\"", "\"identifier\"",
692 "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"",
693 "\"%union\"", "$accept", "input", "prologue_declarations",
694 "prologue_declaration", "grammar_declaration", "union_name",
695 "symbol_declaration", "@1", "@2", "precedence_declaration",
696 "precedence_declarator", "type.opt", "symbols.1", "generic_symlist",
697 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
698 "rules_or_grammar_declaration", "rules", "@3", "rhses.1", "rhs",
699 "content", "content.opt", "braceless", "id", "id_colon", "symbol",
700 "string_as_id", "epilogue.opt", 0
705 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
707 static const yytype_uint16 yytoknum
[] =
709 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
710 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
711 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
712 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
713 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
714 305, 306, 307, 308, 309, 310, 311, 312, 313
718 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
719 static const yytype_uint8 yyr1
[] =
721 0, 59, 60, 61, 61, 62, 62, 62, 62, 62,
722 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
723 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
724 62, 62, 62, 62, 62, 63, 63, 63, 63, 63,
725 63, 63, 64, 64, 63, 66, 65, 67, 65, 65,
726 68, 69, 69, 69, 70, 70, 71, 71, 72, 72,
727 73, 73, 73, 74, 74, 74, 74, 74, 75, 75,
728 76, 76, 77, 77, 77, 79, 78, 80, 80, 80,
729 81, 81, 81, 81, 81, 81, 82, 82, 83, 83,
730 84, 85, 85, 86, 87, 87, 88, 89, 89
733 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
734 static const yytype_uint8 yyr2
[] =
736 0, 2, 4, 0, 2, 1, 1, 2, 2, 1,
737 3, 1, 2, 1, 2, 2, 3, 1, 2, 2,
738 1, 3, 1, 1, 3, 2, 1, 1, 2, 2,
739 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
740 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
741 3, 1, 1, 1, 0, 1, 1, 2, 1, 2,
742 1, 1, 1, 1, 1, 2, 2, 3, 1, 2,
743 1, 2, 1, 2, 2, 0, 3, 1, 3, 2,
744 0, 2, 2, 3, 3, 3, 1, 1, 0, 1,
745 1, 1, 1, 1, 1, 1, 1, 0, 2
748 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
749 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
750 means the default is an error. */
751 static const yytype_uint8 yydefact
[] =
753 3, 0, 0, 1, 47, 45, 0, 0, 0, 51,
754 52, 53, 0, 0, 9, 40, 0, 11, 0, 13,
755 0, 0, 0, 17, 0, 0, 20, 0, 41, 22,
756 23, 0, 0, 26, 27, 0, 0, 0, 0, 31,
757 32, 33, 0, 6, 34, 42, 4, 5, 36, 35,
758 54, 0, 0, 0, 0, 0, 90, 7, 8, 88,
759 12, 14, 15, 0, 18, 19, 0, 0, 25, 28,
760 29, 96, 92, 91, 94, 37, 95, 30, 0, 93,
761 0, 0, 70, 72, 75, 43, 0, 55, 0, 63,
762 68, 48, 64, 46, 49, 56, 62, 61, 38, 58,
763 60, 39, 86, 89, 10, 87, 16, 21, 24, 74,
764 73, 0, 71, 2, 80, 44, 50, 69, 65, 66,
765 57, 59, 98, 76, 77, 67, 80, 79, 0, 0,
766 0, 82, 81, 78, 83, 84, 85
769 /* YYDEFGOTO[NTERM-NUM]. */
770 static const yytype_int8 yydefgoto
[] =
772 -1, 1, 2, 46, 80, 86, 48, 52, 51, 49,
773 50, 88, 94, 98, 99, 90, 91, 81, 82, 83,
774 114, 123, 124, 103, 104, 57, 74, 84, 100, 76,
778 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
780 #define YYPACT_NINF -90
781 static const yytype_int8 yypact
[] =
783 -90, 23, 92, -90, -90, -90, -24, -10, -6, -90,
784 -90, -90, -2, -2, -90, -90, 47, -90, -2, -90,
785 62, 64, 20, -90, 25, 27, -90, 26, -90, -90,
786 -90, 28, 35, -90, -90, 72, 80, 14, -2, -90,
787 -90, -90, 19, -90, -90, 34, -90, -90, -90, -90,
788 29, 16, 16, 14, 12, 12, -90, -90, -90, 8,
789 -90, -90, -90, 85, -90, -90, 86, 87, -90, -90,
790 -90, -90, -90, -90, -90, -90, -90, -90, 36, -90,
791 37, 1, -90, -90, -90, -90, 48, -90, 14, -90,
792 -90, 16, 15, 16, 14, -90, -90, -90, 12, -90,
793 -90, 12, -90, -90, -90, -90, -90, -90, -90, -90,
794 -90, 45, -90, -90, -90, -90, 14, -90, 99, -90,
795 -90, -90, -90, -14, 33, -90, -90, -90, 14, 102,
796 50, -90, -90, 33, -90, -90, -90
799 /* YYPGOTO[NTERM-NUM]. */
800 static const yytype_int8 yypgoto
[] =
802 -90, -90, -90, -90, 106, -90, -90, -90, -90, -90,
803 -90, -90, 52, 88, -63, -35, 89, -90, 61, -90,
804 -90, -90, 30, -90, -90, 126, -47, -90, -37, -89,
808 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
809 positive, shift that token. If negative, reduce the rule which
810 number is the opposite. If zero, do what YYDEFACT says.
811 If YYTABLE_NINF, syntax error. */
812 #define YYTABLE_NINF -98
813 static const yytype_int16 yytable
[] =
815 75, -97, 78, 119, 92, 92, 4, 5, 6, 7,
816 8, 102, 9, 10, 11, 71, 95, 71, 71, 118,
817 78, 15, 96, 3, 4, 5, 6, 7, 8, 125,
818 9, 10, 11, 53, 28, 121, 71, 54, 121, 15,
819 126, 55, 127, 37, 92, 56, 92, 128, 129, 130,
820 59, 95, 28, 79, 111, 56, 117, 120, 117, 45,
821 72, 37, 72, 73, 72, 73, 61, 73, 62, 97,
822 63, 79, 64, 89, 65, 69, 66, 45, 67, 120,
823 131, 72, 68, 70, 73, 85, 87, 132, 106, 107,
824 108, 134, 109, 110, 122, 115, 132, 4, 5, 6,
825 7, 8, 71, 9, 10, 11, 135, 136, 47, 12,
826 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
827 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
828 33, 34, 35, 36, 37, 38, 39, 40, 41, 58,
829 116, 93, 112, 101, 60, 42, 0, 43, 44, 0,
830 45, 0, 0, 0, 0, 0, 133, 0, 0, 0,
831 0, 0, 0, 0, 77, 0, 0, 0, 0, 0,
832 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
836 static const yytype_int16 yycheck
[] =
838 37, 0, 1, 92, 51, 52, 5, 6, 7, 8,
839 9, 3, 11, 12, 13, 3, 53, 3, 3, 4,
840 1, 20, 10, 0, 5, 6, 7, 8, 9, 118,
841 11, 12, 13, 57, 33, 98, 3, 47, 101, 20,
842 54, 47, 56, 42, 91, 47, 93, 14, 15, 16,
843 3, 88, 33, 52, 53, 47, 91, 94, 93, 58,
844 48, 42, 48, 51, 48, 51, 4, 51, 4, 57,
845 50, 52, 47, 57, 47, 3, 50, 58, 50, 116,
846 47, 48, 47, 3, 51, 51, 57, 124, 3, 3,
847 3, 128, 56, 56, 49, 47, 133, 5, 6, 7,
848 8, 9, 3, 11, 12, 13, 4, 57, 2, 17,
849 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
850 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
851 38, 39, 40, 41, 42, 43, 44, 45, 46, 13,
852 88, 52, 81, 55, 18, 53, -1, 55, 56, -1,
853 58, -1, -1, -1, -1, -1, 126, -1, -1, -1,
854 -1, -1, -1, -1, 38, -1, -1, -1, -1, -1,
855 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
856 -1, -1, -1, -1, -1, 59
859 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
860 symbol of state STATE-NUM. */
861 static const yytype_uint8 yystos
[] =
863 0, 60, 61, 0, 5, 6, 7, 8, 9, 11,
864 12, 13, 17, 18, 19, 20, 21, 22, 23, 24,
865 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
866 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
867 45, 46, 53, 55, 56, 58, 62, 63, 65, 68,
868 69, 67, 66, 57, 47, 47, 47, 84, 84, 3,
869 84, 4, 4, 50, 47, 47, 50, 50, 47, 3,
870 3, 3, 48, 51, 85, 87, 88, 84, 1, 52,
871 63, 76, 77, 78, 86, 51, 64, 57, 70, 57,
872 74, 75, 85, 75, 71, 87, 10, 57, 72, 73,
873 87, 72, 3, 82, 83, 84, 3, 3, 3, 56,
874 56, 53, 77, 89, 79, 47, 71, 74, 4, 88,
875 87, 73, 49, 80, 81, 88, 54, 56, 14, 15,
876 16, 47, 87, 81, 87, 4, 57
879 #define yyerrok (yyerrstatus = 0)
880 #define yyclearin (yychar = YYEMPTY)
884 #define YYACCEPT goto yyacceptlab
885 #define YYABORT goto yyabortlab
886 #define YYERROR goto yyerrorlab
889 /* Like YYERROR except do call yyerror. This remains here temporarily
890 to ease the transition to the new meaning of YYERROR, for GCC.
891 Once GCC version 2 has supplanted version 1, this can go. */
893 #define YYFAIL goto yyerrlab
895 #define YYRECOVERING() (!!yyerrstatus)
897 #define YYBACKUP(Token, Value) \
899 if (yychar == YYEMPTY && yylen == 1) \
903 yytoken = YYTRANSLATE (yychar); \
909 yyerror (YY_("syntax error: cannot back up")); \
916 #define YYERRCODE 256
919 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
920 If N is 0, then set CURRENT to the empty location which ends
921 the previous symbol: RHS[0] (always defined). */
923 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
924 #ifndef YYLLOC_DEFAULT
925 # define YYLLOC_DEFAULT(Current, Rhs, N) \
929 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
930 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
931 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
932 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
936 (Current).first_line = (Current).last_line = \
937 YYRHSLOC (Rhs, 0).last_line; \
938 (Current).first_column = (Current).last_column = \
939 YYRHSLOC (Rhs, 0).last_column; \
945 /* YY_LOCATION_PRINT -- Print the location on the stream.
946 This macro was not mandated originally: define only if we know
947 we won't break user code: when these are the locations we know. */
949 #ifndef YY_LOCATION_PRINT
950 # if YYLTYPE_IS_TRIVIAL
951 # define YY_LOCATION_PRINT(File, Loc) \
952 fprintf (File, "%d.%d-%d.%d", \
953 (Loc).first_line, (Loc).first_column, \
954 (Loc).last_line, (Loc).last_column)
956 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
961 /* YYLEX -- calling `yylex' with the right arguments. */
964 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
966 # define YYLEX yylex (&yylval, &yylloc)
969 /* Enable debugging if requested. */
973 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
974 # define YYFPRINTF fprintf
977 # define YYDPRINTF(Args) \
983 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
987 YYFPRINTF (stderr, "%s ", Title); \
988 yy_symbol_print (stderr, \
989 Type, Value, Location); \
990 YYFPRINTF (stderr, "\n"); \
995 /*--------------------------------.
996 | Print this symbol on YYOUTPUT. |
997 `--------------------------------*/
1000 #if (defined __STDC__ || defined __C99__FUNC__ \
1001 || defined __cplusplus || defined _MSC_VER)
1003 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1006 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1009 YYSTYPE
const * const yyvaluep
;
1010 YYLTYPE
const * const yylocationp
;
1015 YYUSE (yylocationp
);
1017 if (yytype
< YYNTOKENS
)
1018 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1024 case 3: /* "\"string\"" */
1025 /* Line 670 of yacc.c. */
1026 #line 187 "parse-gram.y"
1027 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1028 /* Line 670 of yacc.c. */
1029 #line 1030 "parse-gram.c"
1031 case 4: /* "\"integer\"" */
1032 /* Line 670 of yacc.c. */
1033 #line 198 "parse-gram.y"
1034 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1035 /* Line 670 of yacc.c. */
1036 #line 1037 "parse-gram.c"
1038 case 47: /* "\"{...}\"" */
1039 /* Line 670 of yacc.c. */
1040 #line 189 "parse-gram.y"
1041 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1042 /* Line 670 of yacc.c. */
1043 #line 1044 "parse-gram.c"
1045 case 48: /* "\"char\"" */
1046 /* Line 670 of yacc.c. */
1047 #line 182 "parse-gram.y"
1048 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1049 /* Line 670 of yacc.c. */
1050 #line 1051 "parse-gram.c"
1052 case 49: /* "\"epilogue\"" */
1053 /* Line 670 of yacc.c. */
1054 #line 189 "parse-gram.y"
1055 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1056 /* Line 670 of yacc.c. */
1057 #line 1058 "parse-gram.c"
1059 case 51: /* "\"identifier\"" */
1060 /* Line 670 of yacc.c. */
1061 #line 194 "parse-gram.y"
1062 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1063 /* Line 670 of yacc.c. */
1064 #line 1065 "parse-gram.c"
1066 case 52: /* "\"identifier:\"" */
1067 /* Line 670 of yacc.c. */
1068 #line 195 "parse-gram.y"
1069 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1070 /* Line 670 of yacc.c. */
1071 #line 1072 "parse-gram.c"
1073 case 55: /* "\"%{...%}\"" */
1074 /* Line 670 of yacc.c. */
1075 #line 189 "parse-gram.y"
1076 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1077 /* Line 670 of yacc.c. */
1078 #line 1079 "parse-gram.c"
1080 case 57: /* "\"type\"" */
1081 /* Line 670 of yacc.c. */
1082 #line 193 "parse-gram.y"
1083 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1084 /* Line 670 of yacc.c. */
1085 #line 1086 "parse-gram.c"
1087 case 82: /* "content" */
1088 /* Line 670 of yacc.c. */
1089 #line 189 "parse-gram.y"
1090 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1091 /* Line 670 of yacc.c. */
1092 #line 1093 "parse-gram.c"
1094 case 83: /* "content.opt" */
1095 /* Line 670 of yacc.c. */
1096 #line 189 "parse-gram.y"
1097 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1098 /* Line 670 of yacc.c. */
1099 #line 1100 "parse-gram.c"
1101 case 84: /* "braceless" */
1102 /* Line 670 of yacc.c. */
1103 #line 189 "parse-gram.y"
1104 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1105 /* Line 670 of yacc.c. */
1106 #line 1107 "parse-gram.c"
1109 /* Line 670 of yacc.c. */
1110 #line 201 "parse-gram.y"
1111 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1112 /* Line 670 of yacc.c. */
1113 #line 1114 "parse-gram.c"
1115 case 86: /* "id_colon" */
1116 /* Line 670 of yacc.c. */
1117 #line 202 "parse-gram.y"
1118 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1119 /* Line 670 of yacc.c. */
1120 #line 1121 "parse-gram.c"
1122 case 87: /* "symbol" */
1123 /* Line 670 of yacc.c. */
1124 #line 201 "parse-gram.y"
1125 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1126 /* Line 670 of yacc.c. */
1127 #line 1128 "parse-gram.c"
1129 case 88: /* "string_as_id" */
1130 /* Line 670 of yacc.c. */
1131 #line 201 "parse-gram.y"
1132 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1133 /* Line 670 of yacc.c. */
1134 #line 1135 "parse-gram.c"
1142 /*--------------------------------.
1143 | Print this symbol on YYOUTPUT. |
1144 `--------------------------------*/
1146 #if (defined __STDC__ || defined __C99__FUNC__ \
1147 || defined __cplusplus || defined _MSC_VER)
1149 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1152 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1155 YYSTYPE
const * const yyvaluep
;
1156 YYLTYPE
const * const yylocationp
;
1159 if (yytype
< YYNTOKENS
)
1160 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1162 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1164 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1165 YYFPRINTF (yyoutput
, ": ");
1166 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1167 YYFPRINTF (yyoutput
, ")");
1170 /*------------------------------------------------------------------.
1171 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1173 `------------------------------------------------------------------*/
1175 #if (defined __STDC__ || defined __C99__FUNC__ \
1176 || defined __cplusplus || defined _MSC_VER)
1178 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1181 yy_stack_print (yybottom
, yytop
)
1182 yytype_int16
*yybottom
;
1183 yytype_int16
*yytop
;
1186 YYFPRINTF (stderr
, "Stack now");
1187 for (; yybottom
<= yytop
; yybottom
++)
1189 int yybot
= *yybottom
;
1190 YYFPRINTF (stderr
, " %d", yybot
);
1192 YYFPRINTF (stderr
, "\n");
1195 # define YY_STACK_PRINT(Bottom, Top) \
1198 yy_stack_print ((Bottom), (Top)); \
1202 /*------------------------------------------------.
1203 | Report that the YYRULE is going to be reduced. |
1204 `------------------------------------------------*/
1206 #if (defined __STDC__ || defined __C99__FUNC__ \
1207 || defined __cplusplus || defined _MSC_VER)
1209 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1212 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1218 int yynrhs
= yyr2
[yyrule
];
1220 unsigned long int yylno
= yyrline
[yyrule
];
1221 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1223 /* The symbols being reduced. */
1224 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1226 fprintf (stderr
, " $%d = ", yyi
+ 1);
1227 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1228 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1229 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1230 fprintf (stderr
, "\n");
1234 # define YY_REDUCE_PRINT(Rule) \
1237 yy_reduce_print (yyvsp, yylsp, Rule); \
1240 /* Nonzero means print parse trace. It is left uninitialized so that
1241 multiple parsers can coexist. */
1243 #else /* !YYDEBUG */
1244 # define YYDPRINTF(Args)
1245 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1246 # define YY_STACK_PRINT(Bottom, Top)
1247 # define YY_REDUCE_PRINT(Rule)
1248 #endif /* !YYDEBUG */
1251 /* YYINITDEPTH -- initial size of the parser's stacks. */
1253 # define YYINITDEPTH 200
1256 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1257 if the built-in stack extension method is used).
1259 Do not make this value too large; the results are undefined if
1260 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1261 evaluated with infinite-precision integer arithmetic. */
1264 # define YYMAXDEPTH 10000
1272 # if defined __GLIBC__ && defined _STRING_H
1273 # define yystrlen strlen
1275 /* Return the length of YYSTR. */
1276 #if (defined __STDC__ || defined __C99__FUNC__ \
1277 || defined __cplusplus || defined _MSC_VER)
1279 yystrlen (const char *yystr
)
1287 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1295 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1296 # define yystpcpy stpcpy
1298 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1300 #if (defined __STDC__ || defined __C99__FUNC__ \
1301 || defined __cplusplus || defined _MSC_VER)
1303 yystpcpy (char *yydest
, const char *yysrc
)
1306 yystpcpy (yydest
, yysrc
)
1312 const char *yys
= yysrc
;
1314 while ((*yyd
++ = *yys
++) != '\0')
1323 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1324 quotes and backslashes, so that it's suitable for yyerror. The
1325 heuristic is that double-quoting is unnecessary unless the string
1326 contains an apostrophe, a comma, or backslash (other than
1327 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1328 null, do not copy; instead, return the length of what the result
1331 yytnamerr (char *yyres
, const char *yystr
)
1336 char const *yyp
= yystr
;
1343 goto do_not_strip_quotes
;
1347 goto do_not_strip_quotes
;
1360 do_not_strip_quotes
: ;
1364 return yystrlen (yystr
);
1366 return yystpcpy (yyres
, yystr
) - yyres
;
1370 /* Copy into YYRESULT an error message about the unexpected token
1371 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1372 including the terminating null byte. If YYRESULT is null, do not
1373 copy anything; just return the number of bytes that would be
1374 copied. As a special case, return 0 if an ordinary "syntax error"
1375 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1376 size calculation. */
1378 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1380 int yyn
= yypact
[yystate
];
1382 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1386 int yytype
= YYTRANSLATE (yychar
);
1387 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1388 YYSIZE_T yysize
= yysize0
;
1390 int yysize_overflow
= 0;
1391 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1392 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1396 /* This is so xgettext sees the translatable formats that are
1397 constructed on the fly. */
1398 YY_("syntax error, unexpected %s");
1399 YY_("syntax error, unexpected %s, expecting %s");
1400 YY_("syntax error, unexpected %s, expecting %s or %s");
1401 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1402 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1406 static char const yyunexpected
[] = "syntax error, unexpected %s";
1407 static char const yyexpecting
[] = ", expecting %s";
1408 static char const yyor
[] = " or %s";
1409 char yyformat
[sizeof yyunexpected
1410 + sizeof yyexpecting
- 1
1411 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1412 * (sizeof yyor
- 1))];
1413 char const *yyprefix
= yyexpecting
;
1415 /* Start YYX at -YYN if negative to avoid negative indexes in
1417 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1419 /* Stay within bounds of both yycheck and yytname. */
1420 int yychecklim
= YYLAST
- yyn
+ 1;
1421 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1424 yyarg
[0] = yytname
[yytype
];
1425 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1427 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1428 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1430 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1434 yyformat
[sizeof yyunexpected
- 1] = '\0';
1437 yyarg
[yycount
++] = yytname
[yyx
];
1438 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1439 yysize_overflow
|= (yysize1
< yysize
);
1441 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1445 yyf
= YY_(yyformat
);
1446 yysize1
= yysize
+ yystrlen (yyf
);
1447 yysize_overflow
|= (yysize1
< yysize
);
1450 if (yysize_overflow
)
1451 return YYSIZE_MAXIMUM
;
1455 /* Avoid sprintf, as that infringes on the user's name space.
1456 Don't have undefined behavior even if the translation
1457 produced a string with the wrong number of "%s"s. */
1458 char *yyp
= yyresult
;
1460 while ((*yyp
= *yyf
) != '\0')
1462 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1464 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1477 #endif /* YYERROR_VERBOSE */
1480 /*-----------------------------------------------.
1481 | Release the memory associated to this symbol. |
1482 `-----------------------------------------------*/
1485 #if (defined __STDC__ || defined __C99__FUNC__ \
1486 || defined __cplusplus || defined _MSC_VER)
1488 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1491 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1495 YYLTYPE
*yylocationp
;
1499 YYUSE (yylocationp
);
1503 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1514 /* Prevent warnings from -Wmissing-prototypes. */
1516 #ifdef YYPARSE_PARAM
1517 #if defined __STDC__ || defined __cplusplus
1518 int yyparse (void *YYPARSE_PARAM
);
1522 #else /* ! YYPARSE_PARAM */
1523 #if defined __STDC__ || defined __cplusplus
1528 #endif /* ! YYPARSE_PARAM */
1539 #ifdef YYPARSE_PARAM
1540 #if (defined __STDC__ || defined __C99__FUNC__ \
1541 || defined __cplusplus || defined _MSC_VER)
1543 yyparse (void *YYPARSE_PARAM
)
1546 yyparse (YYPARSE_PARAM
)
1547 void *YYPARSE_PARAM
;
1549 #else /* ! YYPARSE_PARAM */
1550 #if (defined __STDC__ || defined __C99__FUNC__ \
1551 || defined __cplusplus || defined _MSC_VER)
1561 /* The lookahead symbol. */
1564 /* The semantic value of the lookahead symbol. */
1567 /* Number of syntax errors so far. */
1569 /* Location data for the lookahead symbol. */
1575 /* Number of tokens to shift before error messages enabled. */
1577 /* Lookahead token as an internal (translated) token number. */
1580 /* Buffer for error messages, and its allocated size. */
1582 char *yymsg
= yymsgbuf
;
1583 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1586 /* Three stacks and their tools:
1587 `yyss': related to states,
1588 `yyvs': related to semantic values,
1589 `yyls': related to locations.
1591 Refer to the stacks thru separate pointers, to allow yyoverflow
1592 to reallocate them elsewhere. */
1594 /* The state stack. */
1595 yytype_int16 yyssa
[YYINITDEPTH
];
1596 yytype_int16
*yyss
= yyssa
;
1597 yytype_int16
*yyssp
;
1599 /* The semantic value stack. */
1600 YYSTYPE yyvsa
[YYINITDEPTH
];
1601 YYSTYPE
*yyvs
= yyvsa
;
1604 /* The location stack. */
1605 YYLTYPE yylsa
[YYINITDEPTH
];
1606 YYLTYPE
*yyls
= yylsa
;
1608 /* The locations where the error started and ended. */
1609 YYLTYPE yyerror_range
[2];
1611 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1613 YYSIZE_T yystacksize
= YYINITDEPTH
;
1615 /* The variables used to return semantic value and location from the
1620 /* The number of symbols on the RHS of the reduced rule.
1621 Keep to zero when no symbol should be popped. */
1624 YYDPRINTF ((stderr
, "Starting parse\n"));
1629 yychar
= YYEMPTY
; /* Cause a token to be read. */
1631 /* Initialize stack pointers.
1632 Waste one element of value and location stack
1633 so that they stay on the same level as the state stack.
1634 The wasted elements are never initialized. */
1639 #if YYLTYPE_IS_TRIVIAL
1640 /* Initialize the default location before parsing starts. */
1641 yylloc
.first_line
= yylloc
.last_line
= 1;
1642 yylloc
.first_column
= yylloc
.last_column
= 1;
1646 /* User initialization code. */
1647 /* Line 1082 of yacc.c. */
1648 #line 89 "parse-gram.y"
1650 /* Bison's grammar can initial empty locations, hence a default
1651 location is needed. */
1652 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1653 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1655 /* Line 1082 of yacc.c. */
1656 #line 1657 "parse-gram.c"
1660 /*------------------------------------------------------------.
1661 | yynewstate -- Push a new state, which is found in yystate. |
1662 `------------------------------------------------------------*/
1664 /* In all cases, when you get here, the value and location stacks
1665 have just been pushed. So pushing a state here evens the stacks. */
1671 if (yyss
+ yystacksize
- 1 <= yyssp
)
1673 /* Get the current used size of the three stacks, in elements. */
1674 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1678 /* Give user a chance to reallocate the stack. Use copies of
1679 these so that the &'s don't force the real ones into
1681 YYSTYPE
*yyvs1
= yyvs
;
1682 yytype_int16
*yyss1
= yyss
;
1683 YYLTYPE
*yyls1
= yyls
;
1685 /* Each stack pointer address is followed by the size of the
1686 data in use in that stack, in bytes. This used to be a
1687 conditional around just the two extra args, but that might
1688 be undefined if yyoverflow is a macro. */
1689 yyoverflow (YY_("memory exhausted"),
1690 &yyss1
, yysize
* sizeof (*yyssp
),
1691 &yyvs1
, yysize
* sizeof (*yyvsp
),
1692 &yyls1
, yysize
* sizeof (*yylsp
),
1698 #else /* no yyoverflow */
1699 # ifndef YYSTACK_RELOCATE
1700 goto yyexhaustedlab
;
1702 /* Extend the stack our own way. */
1703 if (YYMAXDEPTH
<= yystacksize
)
1704 goto yyexhaustedlab
;
1706 if (YYMAXDEPTH
< yystacksize
)
1707 yystacksize
= YYMAXDEPTH
;
1710 yytype_int16
*yyss1
= yyss
;
1711 union yyalloc
*yyptr
=
1712 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1714 goto yyexhaustedlab
;
1715 YYSTACK_RELOCATE (yyss
);
1716 YYSTACK_RELOCATE (yyvs
);
1717 YYSTACK_RELOCATE (yyls
);
1718 # undef YYSTACK_RELOCATE
1720 YYSTACK_FREE (yyss1
);
1723 #endif /* no yyoverflow */
1725 yyssp
= yyss
+ yysize
- 1;
1726 yyvsp
= yyvs
+ yysize
- 1;
1727 yylsp
= yyls
+ yysize
- 1;
1729 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1730 (unsigned long int) yystacksize
));
1732 if (yyss
+ yystacksize
- 1 <= yyssp
)
1736 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1738 if (yystate
== YYFINAL
)
1748 /* Do appropriate processing given the current state. Read a
1749 lookahead token if we need one and don't already have one. */
1751 /* First try to decide what to do without reference to lookahead token. */
1752 yyn
= yypact
[yystate
];
1753 if (yyn
== YYPACT_NINF
)
1756 /* Not known => get a lookahead token if don't already have one. */
1758 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1759 if (yychar
== YYEMPTY
)
1761 YYDPRINTF ((stderr
, "Reading a token: "));
1765 if (yychar
<= YYEOF
)
1767 yychar
= yytoken
= YYEOF
;
1768 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1772 yytoken
= YYTRANSLATE (yychar
);
1773 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1776 /* If the proper action on seeing token YYTOKEN is to reduce or to
1777 detect an error, take that action. */
1779 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1784 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1790 /* Count tokens shifted since error; after three, turn off error
1795 /* Shift the lookahead token. */
1796 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1798 /* Discard the shifted token. */
1807 /*-----------------------------------------------------------.
1808 | yydefault -- do the default action for the current state. |
1809 `-----------------------------------------------------------*/
1811 yyn
= yydefact
[yystate
];
1817 /*-----------------------------.
1818 | yyreduce -- Do a reduction. |
1819 `-----------------------------*/
1821 /* yyn is the number of a rule to reduce with. */
1824 /* If YYLEN is nonzero, implement the default value of the action:
1827 Otherwise, the following line sets YYVAL to garbage.
1828 This behavior is undocumented and Bison
1829 users should not rely upon it. Assigning to YYVAL
1830 unconditionally makes the parser a bit smaller, and it avoids a
1831 GCC warning that YYVAL may be used uninitialized. */
1832 yyval
= yyvsp
[1-yylen
];
1834 /* Default location. */
1835 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1836 YY_REDUCE_PRINT (yyn
);
1840 /* Line 1269 of yacc.c. */
1841 #line 224 "parse-gram.y"
1842 { prologue_augment (translate_code ((yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)])), (yylsp
[(1) - (1)]), union_seen
); }
1846 /* Line 1269 of yacc.c. */
1847 #line 225 "parse-gram.y"
1848 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), true); }
1852 /* Line 1269 of yacc.c. */
1853 #line 226 "parse-gram.y"
1854 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), false); }
1858 /* Line 1269 of yacc.c. */
1859 #line 227 "parse-gram.y"
1860 { debug_flag
= true; }
1864 /* Line 1269 of yacc.c. */
1865 #line 228 "parse-gram.y"
1866 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1870 /* Line 1269 of yacc.c. */
1871 #line 229 "parse-gram.y"
1872 { defines_flag
= true; }
1876 /* Line 1269 of yacc.c. */
1877 #line 230 "parse-gram.y"
1878 { muscle_code_grow ("end_header", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1882 /* Line 1269 of yacc.c. */
1883 #line 231 "parse-gram.y"
1884 { error_verbose
= true; }
1888 /* Line 1269 of yacc.c. */
1889 #line 232 "parse-gram.y"
1890 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1894 /* Line 1269 of yacc.c. */
1895 #line 233 "parse-gram.y"
1896 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1900 /* Line 1269 of yacc.c. */
1901 #line 234 "parse-gram.y"
1902 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1906 /* Line 1269 of yacc.c. */
1907 #line 236 "parse-gram.y"
1909 nondeterministic_parser
= true;
1915 /* Line 1269 of yacc.c. */
1916 #line 241 "parse-gram.y"
1918 muscle_code_grow ("initial_action", translate_symbol_action ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1923 /* Line 1269 of yacc.c. */
1924 #line 244 "parse-gram.y"
1925 { add_param ("lex_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1929 /* Line 1269 of yacc.c. */
1930 #line 245 "parse-gram.y"
1931 { locations_flag
= true; }
1935 /* Line 1269 of yacc.c. */
1936 #line 246 "parse-gram.y"
1937 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
1941 /* Line 1269 of yacc.c. */
1942 #line 247 "parse-gram.y"
1943 { no_lines_flag
= true; }
1947 /* Line 1269 of yacc.c. */
1948 #line 248 "parse-gram.y"
1949 { nondeterministic_parser
= true; }
1953 /* Line 1269 of yacc.c. */
1954 #line 249 "parse-gram.y"
1955 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
1959 /* Line 1269 of yacc.c. */
1960 #line 250 "parse-gram.y"
1961 { add_param ("parse_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1965 /* Line 1269 of yacc.c. */
1966 #line 251 "parse-gram.y"
1967 { pure_parser
= true; }
1971 /* Line 1269 of yacc.c. */
1972 #line 252 "parse-gram.y"
1973 { push_parser
= true; }
1977 /* Line 1269 of yacc.c. */
1978 #line 253 "parse-gram.y"
1979 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
1983 /* Line 1269 of yacc.c. */
1984 #line 254 "parse-gram.y"
1985 { skeleton
= (yyvsp
[(2) - (2)].chars
); }
1989 /* Line 1269 of yacc.c. */
1990 #line 255 "parse-gram.y"
1991 { muscle_code_grow ("start_header", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1995 /* Line 1269 of yacc.c. */
1996 #line 256 "parse-gram.y"
1997 { token_table_flag
= true; }
2001 /* Line 1269 of yacc.c. */
2002 #line 257 "parse-gram.y"
2003 { report_flag
= report_states
; }
2007 /* Line 1269 of yacc.c. */
2008 #line 258 "parse-gram.y"
2009 { yacc_flag
= true; }
2013 /* Line 1269 of yacc.c. */
2014 #line 266 "parse-gram.y"
2016 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2021 /* Line 1269 of yacc.c. */
2022 #line 270 "parse-gram.y"
2025 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2026 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2027 symbol_list_destructor_set (list
, action
, (yylsp
[(2) - (3)]));
2028 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2033 /* Line 1269 of yacc.c. */
2034 #line 278 "parse-gram.y"
2037 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2038 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2039 symbol_list_printer_set (list
, action
, (yylsp
[(2) - (3)]));
2040 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2045 /* Line 1269 of yacc.c. */
2046 #line 286 "parse-gram.y"
2048 default_prec
= true;
2053 /* Line 1269 of yacc.c. */
2054 #line 290 "parse-gram.y"
2056 default_prec
= false;
2061 /* Line 1269 of yacc.c. */
2062 #line 303 "parse-gram.y"
2067 /* Line 1269 of yacc.c. */
2068 #line 304 "parse-gram.y"
2069 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2073 /* Line 1269 of yacc.c. */
2074 #line 309 "parse-gram.y"
2076 char const *body
= (yyvsp
[(3) - (3)].chars
);
2078 /* Concatenate the %union bodies. If this is the first %union, make sure
2079 the synchronization line appears after the opening '{' so as not to
2080 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2081 into '\n', and omit the new %union's leading '{'. */
2084 muscle_grow ("stype", "{", "");
2088 char *code
= muscle_find ("stype");
2089 code
[strlen (code
) - 1] = '\n';
2094 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2099 /* Line 1269 of yacc.c. */
2100 #line 336 "parse-gram.y"
2101 { current_class
= nterm_sym
; }
2105 /* Line 1269 of yacc.c. */
2106 #line 337 "parse-gram.y"
2108 current_class
= unknown_sym
;
2109 current_type
= NULL
;
2114 /* Line 1269 of yacc.c. */
2115 #line 341 "parse-gram.y"
2116 { current_class
= token_sym
; }
2120 /* Line 1269 of yacc.c. */
2121 #line 342 "parse-gram.y"
2123 current_class
= unknown_sym
;
2124 current_type
= NULL
;
2129 /* Line 1269 of yacc.c. */
2130 #line 347 "parse-gram.y"
2134 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2135 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2136 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2141 /* Line 1269 of yacc.c. */
2142 #line 358 "parse-gram.y"
2146 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2148 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2149 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2151 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2152 current_type
= NULL
;
2157 /* Line 1269 of yacc.c. */
2158 #line 372 "parse-gram.y"
2159 { (yyval
.assoc
) = left_assoc
; }
2163 /* Line 1269 of yacc.c. */
2164 #line 373 "parse-gram.y"
2165 { (yyval
.assoc
) = right_assoc
; }
2169 /* Line 1269 of yacc.c. */
2170 #line 374 "parse-gram.y"
2171 { (yyval
.assoc
) = non_assoc
; }
2175 /* Line 1269 of yacc.c. */
2176 #line 378 "parse-gram.y"
2177 { current_type
= NULL
; }
2181 /* Line 1269 of yacc.c. */
2182 #line 379 "parse-gram.y"
2183 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2187 /* Line 1269 of yacc.c. */
2188 #line 385 "parse-gram.y"
2189 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2193 /* Line 1269 of yacc.c. */
2194 #line 387 "parse-gram.y"
2195 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2199 /* Line 1269 of yacc.c. */
2200 #line 391 "parse-gram.y"
2201 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2205 /* Line 1269 of yacc.c. */
2206 #line 392 "parse-gram.y"
2207 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2211 /* Line 1269 of yacc.c. */
2212 #line 396 "parse-gram.y"
2213 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2217 /* Line 1269 of yacc.c. */
2218 #line 397 "parse-gram.y"
2219 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2223 /* Line 1269 of yacc.c. */
2224 #line 398 "parse-gram.y"
2225 { (yyval
.list
) = symbol_list_default_new ((yylsp
[(1) - (1)])); }
2229 /* Line 1269 of yacc.c. */
2230 #line 404 "parse-gram.y"
2232 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2238 /* Line 1269 of yacc.c. */
2239 #line 409 "parse-gram.y"
2241 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2242 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2247 /* Line 1269 of yacc.c. */
2248 #line 414 "parse-gram.y"
2250 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2251 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2252 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2257 /* Line 1269 of yacc.c. */
2258 #line 420 "parse-gram.y"
2260 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2261 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2262 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2267 /* Line 1269 of yacc.c. */
2268 #line 426 "parse-gram.y"
2270 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2271 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2272 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2273 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2278 /* Line 1269 of yacc.c. */
2279 #line 456 "parse-gram.y"
2286 /* Line 1269 of yacc.c. */
2287 #line 462 "parse-gram.y"
2288 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2292 /* Line 1269 of yacc.c. */
2293 #line 466 "parse-gram.y"
2294 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2298 /* Line 1269 of yacc.c. */
2299 #line 467 "parse-gram.y"
2300 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2304 /* Line 1269 of yacc.c. */
2305 #line 473 "parse-gram.y"
2306 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2310 /* Line 1269 of yacc.c. */
2311 #line 475 "parse-gram.y"
2312 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2316 /* Line 1269 of yacc.c. */
2317 #line 477 "parse-gram.y"
2318 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2322 /* Line 1269 of yacc.c. */
2323 #line 479 "parse-gram.y"
2324 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2328 /* Line 1269 of yacc.c. */
2329 #line 481 "parse-gram.y"
2330 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2334 /* Line 1269 of yacc.c. */
2335 #line 483 "parse-gram.y"
2336 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2340 /* Line 1269 of yacc.c. */
2341 #line 499 "parse-gram.y"
2343 static char one
[] = "1";
2344 (yyval
.chars
) = one
;
2349 /* Line 1269 of yacc.c. */
2350 #line 509 "parse-gram.y"
2352 (yyvsp
[(1) - (1)].chars
)[strlen ((yyvsp
[(1) - (1)].chars
)) - 1] = '\n';
2353 (yyval
.chars
) = translate_code ((yyvsp
[(1) - (1)].chars
) + 1, (yylsp
[(1) - (1)]));
2358 /* Line 1269 of yacc.c. */
2359 #line 525 "parse-gram.y"
2360 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2364 /* Line 1269 of yacc.c. */
2365 #line 527 "parse-gram.y"
2367 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2368 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2369 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2374 /* Line 1269 of yacc.c. */
2375 #line 535 "parse-gram.y"
2376 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2380 /* Line 1269 of yacc.c. */
2381 #line 547 "parse-gram.y"
2383 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2384 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2389 /* Line 1269 of yacc.c. */
2390 #line 556 "parse-gram.y"
2392 muscle_code_grow ("epilogue", translate_code ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
2393 gram_scanner_last_string_free ();
2398 /* Line 1269 of yacc.c. */
2399 #line 2400 "parse-gram.c"
2402 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2406 YY_STACK_PRINT (yyss
, yyssp
);
2411 /* Now `shift' the result of the reduction. Determine what state
2412 that goes to, based on the state we popped back to and the rule
2413 number reduced by. */
2417 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2418 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2419 yystate
= yytable
[yystate
];
2421 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2426 /*------------------------------------.
2427 | yyerrlab -- here on detecting error |
2428 `------------------------------------*/
2430 /* If not already recovering from an error, report this error. */
2434 #if ! YYERROR_VERBOSE
2435 yyerror (YY_("syntax error"));
2438 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2439 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2441 YYSIZE_T yyalloc
= 2 * yysize
;
2442 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2443 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2444 if (yymsg
!= yymsgbuf
)
2445 YYSTACK_FREE (yymsg
);
2446 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2448 yymsg_alloc
= yyalloc
;
2452 yymsg_alloc
= sizeof yymsgbuf
;
2456 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2458 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2463 yyerror (YY_("syntax error"));
2465 goto yyexhaustedlab
;
2471 yyerror_range
[0] = yylloc
;
2473 if (yyerrstatus
== 3)
2475 /* If just tried and failed to reuse lookahead token after an
2476 error, discard it. */
2478 if (yychar
<= YYEOF
)
2480 /* Return failure if at end of input. */
2481 if (yychar
== YYEOF
)
2486 yydestruct ("Error: discarding",
2487 yytoken
, &yylval
, &yylloc
);
2492 /* Else will try to reuse lookahead token after shifting the error
2497 /*---------------------------------------------------.
2498 | yyerrorlab -- error raised explicitly by YYERROR. |
2499 `---------------------------------------------------*/
2502 /* Pacify compilers like GCC when the user code never invokes
2503 YYERROR and the label yyerrorlab therefore never appears in user
2505 if (/*CONSTCOND*/ 0)
2508 yyerror_range
[0] = yylsp
[1-yylen
];
2509 /* Do not reclaim the symbols of the rule which action triggered
2513 YY_STACK_PRINT (yyss
, yyssp
);
2518 /*-------------------------------------------------------------.
2519 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2520 `-------------------------------------------------------------*/
2522 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2526 yyn
= yypact
[yystate
];
2527 if (yyn
!= YYPACT_NINF
)
2530 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2538 /* Pop the current state because it cannot handle the error token. */
2542 yyerror_range
[0] = *yylsp
;
2543 yydestruct ("Error: popping",
2544 yystos
[yystate
], yyvsp
, yylsp
);
2547 YY_STACK_PRINT (yyss
, yyssp
);
2552 yyerror_range
[1] = yylloc
;
2553 /* Using YYLLOC is tempting, but would change the location of
2554 the lookahead. YYLOC is available though. */
2555 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2558 /* Shift the error token. */
2559 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2565 /*-------------------------------------.
2566 | yyacceptlab -- YYACCEPT comes here. |
2567 `-------------------------------------*/
2572 /*-----------------------------------.
2573 | yyabortlab -- YYABORT comes here. |
2574 `-----------------------------------*/
2580 /*-------------------------------------------------.
2581 | yyexhaustedlab -- memory exhaustion comes here. |
2582 `-------------------------------------------------*/
2584 yyerror (YY_("memory exhausted"));
2590 if (yychar
!= YYEMPTY
)
2591 yydestruct ("Cleanup: discarding lookahead",
2592 yytoken
, &yylval
, &yylloc
);
2593 /* Do not reclaim the symbols of the rule which action triggered
2594 this YYABORT or YYACCEPT. */
2596 YY_STACK_PRINT (yyss
, yyssp
);
2597 while (yyssp
!= yyss
)
2599 yydestruct ("Cleanup: popping",
2600 yystos
[*yyssp
], yyvsp
, yylsp
);
2605 YYSTACK_FREE (yyss
);
2608 if (yymsg
!= yymsgbuf
)
2609 YYSTACK_FREE (yymsg
);
2611 /* Make sure YYID is used. */
2612 return YYID (yyresult
);
2616 /* Line 1486 of yacc.c. */
2617 #line 562 "parse-gram.y"
2621 /* Return the location of the left-hand side of a rule whose
2622 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2623 the right-hand side, and return an empty location equal to the end
2624 boundary of RHS[0] if the right-hand side is empty. */
2627 lloc_default (YYLTYPE
const *rhs
, int n
)
2632 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2633 The bug is fixed in 7.4.2m, but play it safe for now. */
2634 loc
.start
= rhs
[n
].end
;
2635 loc
.end
= rhs
[n
].end
;
2637 /* Ignore empty nonterminals the start of the the right-hand side.
2638 Do not bother to ignore them at the end of the right-hand side,
2639 since empty nonterminals have the same end as their predecessors. */
2640 for (i
= 1; i
<= n
; i
++)
2641 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2643 loc
.start
= rhs
[i
].start
;
2651 /* Add a lex-param or a parse-param (depending on TYPE) with
2652 declaration DECL and location LOC. */
2655 add_param (char const *type
, char *decl
, location loc
)
2657 static char const alphanum
[26 + 26 + 1 + 10] =
2658 "abcdefghijklmnopqrstuvwxyz"
2659 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2662 char const *name_start
= NULL
;
2665 /* Stop on last actual character. */
2666 for (p
= decl
; p
[1]; p
++)
2668 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2669 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2672 /* Strip the surrounding '{' and '}', and any blanks just inside
2674 while (*--p
== ' ' || *p
== '\t')
2677 while (*++decl
== ' ' || *decl
== '\t')
2681 complain_at (loc
, _("missing identifier in parameter declaration"));
2688 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2692 name
= xmalloc (name_len
+ 1);
2693 memcpy (name
, name_start
, name_len
);
2694 name
[name_len
] = '\0';
2695 muscle_pair_list_grow (type
, decl
, name
);
2699 gram_scanner_last_string_free ();
2704 version_check (location
const *loc
, char const *version
)
2706 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2708 complain_at (*loc
, "require bison %s, but have %s",
2709 version
, PACKAGE_VERSION
);
2715 gram_error (location
const *loc
, char const *msg
)
2717 complain_at (*loc
, "%s", msg
);
2721 token_name (int type
)
2723 return yytname
[YYTRANSLATE (type
)];
2734 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2735 return quotearg_style (escape_quoting_style
, buf
);