1 /* A Bison parser, made by GNU Bison 2.4.1.259-f52e1. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.4.1.259-f52e1"
50 #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. */
76 /* Line 268 of yacc.c */
77 #line 1 "parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
80 Copyright (C) 2002-2011 Free Software Foundation, Inc.
82 This file is part of Bison, the GNU Compiler Compiler.
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 3 of the License, or
87 (at your option) any later version.
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.
94 You should have received a copy of the GNU General Public License
95 along with this program. If not, see <http://www.gnu.org/licenses/>. */
100 #include "complain.h"
101 #include "conflicts.h"
105 #include "muscle-tab.h"
106 #include "named-ref.h"
107 #include "quotearg.h"
110 #include "scan-gram.h"
111 #include "scan-code.h"
113 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
114 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
116 #define YY_LOCATION_PRINT(File, Loc) \
117 location_print (File, Loc)
119 static void version_check (location
const *loc
, char const *version
);
121 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
122 FIXME: depends on the undocumented availability of YYLLOC. */
124 #define yyerror(Msg) \
125 gram_error (&yylloc, Msg)
126 static void gram_error (location
const *, char const *);
128 static char const *char_name (char);
130 /** Add a lex-param or a parse-param.
132 * \param type \a lex_param or \a parse_param
133 * \param decl the formal argument
134 * \param loc the location in the source.
136 static void add_param (char const *type
, char *decl
, location loc
);
139 static symbol_class current_class
= unknown_sym
;
140 static uniqstr current_type
= NULL
;
141 static symbol
*current_lhs
;
142 static location current_lhs_location
;
143 static named_ref
*current_lhs_named_ref
;
144 static int current_prec
= 0;
146 #define YYTYPE_INT16 int_fast16_t
147 #define YYTYPE_INT8 int_fast8_t
148 #define YYTYPE_UINT16 uint_fast16_t
149 #define YYTYPE_UINT8 uint_fast8_t
152 /* Line 268 of yacc.c */
153 #line 154 "parse-gram.c"
155 /* Enabling traces. */
160 /* Enabling verbose error messages. */
161 #ifdef YYERROR_VERBOSE
162 # undef YYERROR_VERBOSE
163 # define YYERROR_VERBOSE 1
165 # define YYERROR_VERBOSE 1
168 /* Enabling the token table. */
169 #ifndef YYTOKEN_TABLE
170 # define YYTOKEN_TABLE 0
177 /* Put the tokens into the symbol table, so that GDB and other debuggers
186 PERCENT_DESTRUCTOR
= 263,
187 PERCENT_PRINTER
= 264,
190 PERCENT_NONASSOC
= 267,
196 PERCENT_DEFAULT_PREC
= 273,
197 PERCENT_DEFINE
= 274,
198 PERCENT_DEFINES
= 275,
199 PERCENT_ERROR_VERBOSE
= 276,
200 PERCENT_EXPECT
= 277,
201 PERCENT_EXPECT_RR
= 278,
202 PERCENT_FILE_PREFIX
= 279,
203 PERCENT_GLR_PARSER
= 280,
204 PERCENT_INITIAL_ACTION
= 281,
205 PERCENT_LANGUAGE
= 282,
206 PERCENT_LEX_PARAM
= 283,
207 PERCENT_LOCATIONS
= 284,
208 PERCENT_NAME_PREFIX
= 285,
209 PERCENT_NO_DEFAULT_PREC
= 286,
210 PERCENT_NO_LINES
= 287,
211 PERCENT_NONDETERMINISTIC_PARSER
= 288,
212 PERCENT_OUTPUT
= 289,
213 PERCENT_PARSE_PARAM
= 290,
214 PERCENT_PURE_PARSER
= 291,
215 PERCENT_REQUIRE
= 292,
216 PERCENT_SKELETON
= 293,
218 PERCENT_TOKEN_TABLE
= 295,
219 PERCENT_VERBOSE
= 296,
228 PERCENT_PERCENT
= 305,
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_LEFT 265
248 #define PERCENT_RIGHT 266
249 #define PERCENT_NONASSOC 267
250 #define PERCENT_PREC 268
251 #define PERCENT_DPREC 269
252 #define PERCENT_MERGE 270
253 #define PERCENT_CODE 271
254 #define PERCENT_DEBUG 272
255 #define PERCENT_DEFAULT_PREC 273
256 #define PERCENT_DEFINE 274
257 #define PERCENT_DEFINES 275
258 #define PERCENT_ERROR_VERBOSE 276
259 #define PERCENT_EXPECT 277
260 #define PERCENT_EXPECT_RR 278
261 #define PERCENT_FILE_PREFIX 279
262 #define PERCENT_GLR_PARSER 280
263 #define PERCENT_INITIAL_ACTION 281
264 #define PERCENT_LANGUAGE 282
265 #define PERCENT_LEX_PARAM 283
266 #define PERCENT_LOCATIONS 284
267 #define PERCENT_NAME_PREFIX 285
268 #define PERCENT_NO_DEFAULT_PREC 286
269 #define PERCENT_NO_LINES 287
270 #define PERCENT_NONDETERMINISTIC_PARSER 288
271 #define PERCENT_OUTPUT 289
272 #define PERCENT_PARSE_PARAM 290
273 #define PERCENT_PURE_PARSER 291
274 #define PERCENT_REQUIRE 292
275 #define PERCENT_SKELETON 293
276 #define PERCENT_START 294
277 #define PERCENT_TOKEN_TABLE 295
278 #define PERCENT_VERBOSE 296
279 #define PERCENT_YACC 297
280 #define BRACED_CODE 298
281 #define BRACKETED_ID 299
287 #define PERCENT_PERCENT 305
290 #define SEMICOLON 308
292 #define TYPE_TAG_ANY 310
293 #define TYPE_TAG_NONE 311
294 #define PERCENT_UNION 312
299 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
300 typedef union YYSTYPE
303 /* Line 293 of yacc.c */
304 #line 94 "parse-gram.y"
313 unsigned char character
;
314 named_ref
*named_ref
;
318 /* Line 293 of yacc.c */
319 #line 320 "parse-gram.c"
321 # define YYSTYPE_IS_TRIVIAL 1
322 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
323 # define YYSTYPE_IS_DECLARED 1
326 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
327 typedef struct YYLTYPE
334 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
335 # define YYLTYPE_IS_DECLARED 1
336 # define YYLTYPE_IS_TRIVIAL 1
340 /* Copy the second part of user declarations. */
343 /* Line 343 of yacc.c */
344 #line 345 "parse-gram.c"
351 typedef YYTYPE_UINT8 yytype_uint8
;
353 typedef unsigned char yytype_uint8
;
357 typedef YYTYPE_INT8 yytype_int8
;
358 #elif (defined __STDC__ || defined __C99__FUNC__ \
359 || defined __cplusplus || defined _MSC_VER)
360 typedef signed char yytype_int8
;
362 typedef short int yytype_int8
;
366 typedef YYTYPE_UINT16 yytype_uint16
;
368 typedef unsigned short int yytype_uint16
;
372 typedef YYTYPE_INT16 yytype_int16
;
374 typedef short int yytype_int16
;
378 # ifdef __SIZE_TYPE__
379 # define YYSIZE_T __SIZE_TYPE__
380 # elif defined size_t
381 # define YYSIZE_T size_t
382 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
385 # define YYSIZE_T size_t
387 # define YYSIZE_T unsigned int
391 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
394 # if defined YYENABLE_NLS && YYENABLE_NLS
396 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
397 # define YY_(msgid) dgettext ("bison-runtime", msgid)
401 # define YY_(msgid) msgid
405 /* Suppress unused-variable warnings by "using" E. */
406 #if ! defined lint || defined __GNUC__
407 # define YYUSE(e) ((void) (e))
409 # define YYUSE(e) /* empty */
412 /* Identity function, used to suppress warnings about constant conditions. */
416 #if (defined __STDC__ || defined __C99__FUNC__ \
417 || defined __cplusplus || defined _MSC_VER)
432 /* The parser invokes alloca or malloc; define the necessary symbols. */
434 # ifdef YYSTACK_ALLOC
435 /* Pacify GCC's `empty if-body' warning. */
436 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
437 # ifndef YYSTACK_ALLOC_MAXIMUM
438 /* The OS might guarantee only one guard page at the bottom of the stack,
439 and a page size can be as small as 4096 bytes. So we cannot safely
440 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
441 to allow for a few compiler-allocated temporary stack slots. */
442 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
445 # define YYSTACK_ALLOC YYMALLOC
446 # define YYSTACK_FREE YYFREE
447 # ifndef YYSTACK_ALLOC_MAXIMUM
448 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
450 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
451 && ! ((defined YYMALLOC || defined malloc) \
452 && (defined YYFREE || defined free)))
453 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
454 # ifndef EXIT_SUCCESS
455 # define EXIT_SUCCESS 0
459 # define YYMALLOC malloc
460 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
461 || defined __cplusplus || defined _MSC_VER)
462 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
467 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
468 || defined __cplusplus || defined _MSC_VER)
469 void free (void *); /* INFRINGES ON USER NAME SPACE */
473 # define YYCOPY_NEEDED 1
477 #if (! defined yyoverflow \
478 && (! defined __cplusplus \
479 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
480 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
482 /* A type that is properly aligned for any stack member. */
485 yytype_int16 yyss_alloc
;
490 /* The size of the maximum gap between one aligned stack and the next. */
491 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
493 /* The size of an array large to enough to hold all stacks, each with
495 # define YYSTACK_BYTES(N) \
496 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
497 + 2 * YYSTACK_GAP_MAXIMUM)
499 # define YYCOPY_NEEDED 1
501 /* Relocate STACK from its old location to the new one. The
502 local variables YYSIZE and YYSTACKSIZE give the old and new number of
503 elements in the stack, and YYPTR gives the new location of the
504 stack. Advance YYPTR to a properly aligned location for the next
506 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
509 YYSIZE_T yynewbytes; \
510 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
511 Stack = &yyptr->Stack_alloc; \
512 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
513 yyptr += yynewbytes / sizeof (*yyptr); \
519 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
520 /* Copy COUNT objects from FROM to TO. The source and destination do
523 # if defined __GNUC__ && 1 < __GNUC__
524 # define YYCOPY(To, From, Count) \
525 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
527 # define YYCOPY(To, From, Count) \
531 for (yyi = 0; yyi < (Count); yyi++) \
532 (To)[yyi] = (From)[yyi]; \
537 #endif /* !YYCOPY_NEEDED */
539 /* YYFINAL -- State number of the termination state. */
541 /* YYLAST -- Last index in YYTABLE. */
544 /* YYNTOKENS -- Number of terminals. */
546 /* YYNNTS -- Number of nonterminals. */
548 /* YYNRULES -- Number of rules. */
550 /* YYNRULES -- Number of states. */
551 #define YYNSTATES 148
553 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
555 #define YYMAXUTOK 312
557 #define YYTRANSLATE(YYX) \
558 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
560 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
561 static const yytype_uint8 yytranslate
[] =
563 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 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, 1, 2, 3, 4,
589 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
590 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
591 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
592 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
593 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
598 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
600 static const yytype_uint16 yyprhs
[] =
602 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
603 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
604 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
605 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
606 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
607 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
608 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
609 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
610 206, 209, 212, 213, 218, 220, 224, 227, 228, 232,
611 236, 240, 244, 248, 249, 251, 253, 255, 256, 258,
612 260, 262, 264, 266, 268, 270, 272, 274, 275
615 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
616 static const yytype_int8 yyrhs
[] =
618 59, 0, -1, 60, 50, 77, 91, -1, -1, 60,
619 61, -1, 62, -1, 52, -1, 17, -1, 19, 84,
620 85, -1, 20, -1, 20, 3, -1, 21, -1, 22,
621 4, -1, 23, 4, -1, 24, 3, -1, 24, 47,
622 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
623 28, 43, -1, 29, -1, 30, 3, -1, 30, 47,
624 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
625 47, 3, -1, 35, 43, -1, 36, -1, 37, 3,
626 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
627 53, -1, 67, -1, 64, -1, 39, 89, -1, 8,
628 43, 73, -1, 9, 43, 73, -1, 18, -1, 31,
629 -1, 16, 86, -1, 16, 48, 86, -1, -1, 48,
630 -1, 57, 63, 86, -1, -1, 6, 65, 76, -1,
631 -1, 5, 66, 76, -1, 7, 54, 72, -1, 68,
632 69, 70, -1, 10, -1, 11, -1, 12, -1, -1,
633 54, -1, 71, -1, 70, 71, -1, 89, -1, 89,
634 4, -1, 89, -1, 72, 89, -1, 74, -1, 73,
635 74, -1, 89, -1, 54, -1, 55, -1, 56, -1,
636 54, -1, 87, -1, 87, 4, -1, 87, 90, -1,
637 87, 4, 90, -1, 75, -1, 76, 75, -1, 78,
638 -1, 77, 78, -1, 79, -1, 62, 53, -1, 1,
639 53, -1, -1, 88, 83, 80, 81, -1, 82, -1,
640 81, 51, 82, -1, 81, 53, -1, -1, 82, 89,
641 83, -1, 82, 43, 83, -1, 82, 13, 89, -1,
642 82, 14, 4, -1, 82, 15, 54, -1, -1, 44,
643 -1, 48, -1, 3, -1, -1, 48, -1, 3, -1,
644 43, -1, 48, -1, 45, -1, 49, -1, 87, -1,
645 90, -1, 3, -1, -1, 50, 46, -1
648 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
649 static const yytype_uint16 yyrline
[] =
651 0, 209, 209, 217, 219, 223, 224, 234, 235, 240,
652 241, 246, 247, 248, 249, 250, 251, 256, 265, 266,
653 267, 268, 269, 270, 271, 272, 273, 274, 275, 290,
654 291, 315, 316, 317, 318, 322, 323, 324, 328, 335,
655 342, 346, 350, 357, 372, 373, 377, 389, 389, 394,
656 394, 399, 410, 425, 426, 427, 431, 432, 437, 439,
657 444, 445, 450, 452, 457, 458, 462, 463, 464, 465,
658 470, 475, 480, 486, 492, 503, 504, 513, 514, 520,
659 521, 522, 529, 529, 534, 535, 536, 541, 543, 545,
660 547, 549, 551, 556, 558, 569, 570, 575, 576, 577,
661 586, 606, 608, 617, 622, 623, 628, 635, 637
665 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
666 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
667 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
668 static const char *const yytname
[] =
670 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
671 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
672 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
673 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
674 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
675 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
676 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
677 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
678 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
679 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
680 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
681 "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"", "\"=\"",
682 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
683 "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
684 "input", "prologue_declarations", "prologue_declaration",
685 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
686 "precedence_declaration", "precedence_declarator", "type.opt",
687 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
688 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
689 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
690 "named_ref.opt", "variable", "content.opt", "braceless", "id",
691 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
696 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
698 static const yytype_uint16 yytoknum
[] =
700 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
701 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
702 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
703 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
704 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
705 305, 306, 307, 308, 309, 310, 311, 312
709 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
710 static const yytype_uint8 yyr1
[] =
712 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
713 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
714 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
715 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
716 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
717 64, 64, 67, 68, 68, 68, 69, 69, 70, 70,
718 71, 71, 72, 72, 73, 73, 74, 74, 74, 74,
719 75, 75, 75, 75, 75, 76, 76, 77, 77, 78,
720 78, 78, 80, 79, 81, 81, 81, 82, 82, 82,
721 82, 82, 82, 83, 83, 84, 84, 85, 85, 85,
722 86, 87, 87, 88, 89, 89, 90, 91, 91
725 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
726 static const yytype_uint8 yyr2
[] =
728 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
729 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
730 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
731 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
732 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
733 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
734 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
735 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
736 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
737 3, 3, 3, 0, 1, 1, 1, 0, 1, 1,
738 1, 1, 1, 1, 1, 1, 1, 0, 2
741 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
742 Performed when YYTABLE doesn't specify something else to do. Zero
743 means the default is an error. */
744 static const yytype_uint8 yydefact
[] =
746 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
747 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
748 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
749 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
750 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
751 0, 0, 0, 100, 0, 42, 96, 95, 97, 10,
752 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
753 0, 27, 29, 30, 106, 102, 101, 104, 37, 105,
754 0, 103, 0, 0, 77, 79, 93, 45, 0, 57,
755 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
756 69, 38, 64, 66, 39, 43, 99, 98, 8, 15,
757 22, 26, 81, 80, 0, 78, 2, 94, 82, 46,
758 52, 58, 60, 76, 72, 73, 63, 65, 108, 87,
759 59, 61, 74, 83, 84, 87, 86, 0, 0, 0,
760 93, 93, 85, 90, 91, 92, 89, 88
763 /* YYDEFGOTO[NTERM-NUM]. */
764 static const yytype_int16 yydefgoto
[] =
766 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
767 47, 90, 120, 121, 96, 101, 102, 92, 93, 83,
768 84, 85, 129, 133, 134, 118, 58, 108, 55, 77,
772 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
774 #define YYPACT_NINF -91
775 static const yytype_int16 yypact
[] =
777 -91, 3, 103, -91, -91, -91, -36, 2, 10, -91,
778 -91, -91, 9, -91, -91, 32, 60, -91, 65, 67,
779 27, -91, 41, 73, 51, -91, 39, -91, -91, -91,
780 40, 52, -91, 93, 95, 33, -91, -91, -91, 15,
781 -91, -91, 53, -91, -91, -91, -91, 46, 43, 43,
782 33, 11, 11, -91, 61, -91, -91, -91, 35, -91,
783 -91, -91, -91, 100, -91, -91, -91, -91, 102, -91,
784 113, -91, -91, -91, -91, -91, -91, -91, -91, -91,
785 64, -91, 94, 1, -91, -91, 62, -91, 61, -91,
786 33, -91, -91, 43, 86, 43, 33, -91, -91, -91,
787 -91, 11, -91, -91, 11, -91, -91, -91, -91, -91,
788 -91, -91, -91, -91, 72, -91, -91, -91, -91, -91,
789 33, -91, 142, -91, 145, -91, -91, -91, -91, -91,
790 -91, -91, -91, 17, 34, -91, -91, 33, 146, 97,
791 62, 62, 34, -91, -91, -91, -91, -91
794 /* YYPGOTO[NTERM-NUM]. */
795 static const yytype_int16 yypgoto
[] =
797 -91, -91, -91, -91, 147, -91, -91, -91, -91, -91,
798 -91, -91, -91, 37, -91, 106, -60, -33, 105, -91,
799 69, -91, -91, -91, 24, -48, -91, -91, -49, -20,
803 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
804 positive, shift that token. If negative, reduce the rule which
805 number is the opposite. If YYTABLE_NINF, syntax error. */
806 #define YYTABLE_NINF -108
807 static const yytype_int16 yytable
[] =
809 78, -107, 80, 3, 125, 105, 4, 5, 6, 7,
810 8, 9, 10, 11, 74, 97, 80, 12, 50, 14,
811 4, 5, 6, 7, 8, 9, 10, 11, 94, 94,
812 62, 12, 27, 14, 132, 56, 74, 74, 106, 119,
813 35, 127, 67, 69, 127, 51, 27, 137, 138, 139,
814 81, 114, 53, 52, 35, 122, 75, 54, 42, 76,
815 123, 126, 123, 59, 81, 98, 99, 100, 135, 60,
816 136, 61, 42, 94, 63, 94, 65, 140, 75, 75,
817 57, 76, 76, 107, 64, 122, 68, 70, 75, 74,
818 124, 76, 146, 147, 66, 71, 72, 91, 73, 141,
819 89, 87, 143, 109, 53, 110, 117, 141, 4, 5,
820 6, 7, 8, 9, 10, 11, 111, 112, 128, 12,
821 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
822 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
823 33, 34, 35, 36, 37, 38, 131, 113, 74, 44,
824 144, 145, 115, 39, 95, 40, 41, 130, 104, 142,
828 #define yypact_value_is_default(yystate) \
831 #define yytable_value_is_error(yytable_value) \
834 static const yytype_uint8 yycheck
[] =
836 35, 0, 1, 0, 94, 54, 5, 6, 7, 8,
837 9, 10, 11, 12, 3, 50, 1, 16, 54, 18,
838 5, 6, 7, 8, 9, 10, 11, 12, 48, 49,
839 3, 16, 31, 18, 124, 3, 3, 3, 3, 88,
840 39, 101, 3, 3, 104, 43, 31, 13, 14, 15,
841 49, 50, 43, 43, 39, 90, 45, 48, 57, 48,
842 93, 96, 95, 3, 49, 54, 55, 56, 51, 4,
843 53, 4, 57, 93, 47, 95, 3, 43, 45, 45,
844 48, 48, 48, 48, 43, 120, 47, 47, 45, 3,
845 4, 48, 140, 141, 43, 43, 3, 54, 3, 134,
846 54, 48, 137, 3, 43, 3, 44, 142, 5, 6,
847 7, 8, 9, 10, 11, 12, 3, 53, 46, 16,
848 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
849 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
850 37, 38, 39, 40, 41, 42, 4, 53, 3, 2,
851 4, 54, 83, 50, 49, 52, 53, 120, 52, 135,
855 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
856 symbol of state STATE-NUM. */
857 static const yytype_uint8 yystos
[] =
859 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
860 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
861 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
862 34, 35, 36, 37, 38, 39, 40, 41, 42, 50,
863 52, 53, 57, 61, 62, 64, 67, 68, 66, 65,
864 54, 43, 43, 43, 48, 86, 3, 48, 84, 3,
865 4, 4, 3, 47, 43, 3, 43, 3, 47, 3,
866 47, 43, 3, 3, 3, 45, 48, 87, 89, 90,
867 1, 49, 62, 77, 78, 79, 88, 48, 63, 54,
868 69, 54, 75, 76, 87, 76, 72, 89, 54, 55,
869 56, 73, 74, 89, 73, 86, 3, 48, 85, 3,
870 3, 3, 53, 53, 50, 78, 91, 44, 83, 86,
871 70, 71, 89, 75, 4, 90, 89, 74, 46, 80,
872 71, 4, 90, 81, 82, 51, 53, 13, 14, 15,
873 43, 89, 82, 89, 4, 54, 83, 83
876 #define yyerrok (yyerrstatus = 0)
877 #define yyclearin (yychar = YYEMPTY)
881 #define YYACCEPT goto yyacceptlab
882 #define YYABORT goto yyabortlab
883 #define YYERROR goto yyerrorlab
886 /* Like YYERROR except do call yyerror. This remains here temporarily
887 to ease the transition to the new meaning of YYERROR, for GCC.
888 Once GCC version 2 has supplanted version 1, this can go. However,
889 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
890 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
893 #define YYFAIL goto yyerrlab
895 /* This is here to suppress warnings from the GCC cpp's
896 -Wunused-macros. Normally we don't worry about that warning, but
897 some users do, and we want to make it easy for users to remove
898 YYFAIL uses, which will produce warnings from Bison 2.5. */
901 #define YYRECOVERING() (!!yyerrstatus)
903 #define YYBACKUP(Token, Value) \
905 if (yychar == YYEMPTY && yylen == 1) \
910 YY_LAC_DISCARD ("YYBACKUP"); \
915 yyerror (YY_("syntax error: cannot back up")); \
922 #define YYERRCODE 256
925 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
926 If N is 0, then set CURRENT to the empty location which ends
927 the previous symbol: RHS[0] (always defined). */
929 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
930 #ifndef YYLLOC_DEFAULT
931 # define YYLLOC_DEFAULT(Current, Rhs, N) \
935 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
936 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
937 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
938 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
942 (Current).first_line = (Current).last_line = \
943 YYRHSLOC (Rhs, 0).last_line; \
944 (Current).first_column = (Current).last_column = \
945 YYRHSLOC (Rhs, 0).last_column; \
951 /* YY_LOCATION_PRINT -- Print the location on the stream.
952 This macro was not mandated originally: define only if we know
953 we won't break user code: when these are the locations we know. */
955 #ifndef YY_LOCATION_PRINT
956 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
957 # define YY_LOCATION_PRINT(File, Loc) \
958 fprintf (File, "%d.%d-%d.%d", \
959 (Loc).first_line, (Loc).first_column, \
960 (Loc).last_line, (Loc).last_column)
962 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
967 /* YYLEX -- calling `yylex' with the right arguments. */
970 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
972 # define YYLEX yylex (&yylval, &yylloc)
975 /* Enable debugging if requested. */
979 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
980 # define YYFPRINTF fprintf
983 # define YYDPRINTF(Args) \
989 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
993 YYFPRINTF (stderr, "%s ", Title); \
994 yy_symbol_print (stderr, \
995 Type, Value, Location); \
996 YYFPRINTF (stderr, "\n"); \
1001 /*--------------------------------.
1002 | Print this symbol on YYOUTPUT. |
1003 `--------------------------------*/
1006 #if (defined __STDC__ || defined __C99__FUNC__ \
1007 || defined __cplusplus || defined _MSC_VER)
1009 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1012 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1015 YYSTYPE
const * const yyvaluep
;
1016 YYLTYPE
const * const yylocationp
;
1021 YYUSE (yylocationp
);
1023 if (yytype
< YYNTOKENS
)
1024 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1030 case 3: /* "\"string\"" */
1032 /* Line 819 of yacc.c */
1033 #line 184 "parse-gram.y"
1034 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1036 /* Line 819 of yacc.c */
1037 #line 1038 "parse-gram.c"
1039 case 4: /* "\"integer\"" */
1041 /* Line 819 of yacc.c */
1042 #line 196 "parse-gram.y"
1043 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1045 /* Line 819 of yacc.c */
1046 #line 1047 "parse-gram.c"
1048 case 43: /* "\"{...}\"" */
1050 /* Line 819 of yacc.c */
1051 #line 186 "parse-gram.y"
1052 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1054 /* Line 819 of yacc.c */
1055 #line 1056 "parse-gram.c"
1057 case 44: /* "\"[identifier]\"" */
1059 /* Line 819 of yacc.c */
1060 #line 191 "parse-gram.y"
1061 { fprintf (stderr
, "[%s]", (yyvaluep
->uniqstr
)); };
1063 /* Line 819 of yacc.c */
1064 #line 1065 "parse-gram.c"
1066 case 45: /* "\"char\"" */
1068 /* Line 819 of yacc.c */
1069 #line 178 "parse-gram.y"
1070 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1072 /* Line 819 of yacc.c */
1073 #line 1074 "parse-gram.c"
1075 case 46: /* "\"epilogue\"" */
1077 /* Line 819 of yacc.c */
1078 #line 186 "parse-gram.y"
1079 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1081 /* Line 819 of yacc.c */
1082 #line 1083 "parse-gram.c"
1084 case 48: /* "\"identifier\"" */
1086 /* Line 819 of yacc.c */
1087 #line 190 "parse-gram.y"
1088 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1090 /* Line 819 of yacc.c */
1091 #line 1092 "parse-gram.c"
1093 case 49: /* "\"identifier:\"" */
1095 /* Line 819 of yacc.c */
1096 #line 192 "parse-gram.y"
1097 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1099 /* Line 819 of yacc.c */
1100 #line 1101 "parse-gram.c"
1102 case 52: /* "\"%{...%}\"" */
1104 /* Line 819 of yacc.c */
1105 #line 186 "parse-gram.y"
1106 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1108 /* Line 819 of yacc.c */
1109 #line 1110 "parse-gram.c"
1111 case 54: /* "\"type\"" */
1113 /* Line 819 of yacc.c */
1114 #line 193 "parse-gram.y"
1115 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1117 /* Line 819 of yacc.c */
1118 #line 1119 "parse-gram.c"
1120 case 71: /* "symbol.prec" */
1122 /* Line 819 of yacc.c */
1123 #line 199 "parse-gram.y"
1124 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1126 /* Line 819 of yacc.c */
1127 #line 1128 "parse-gram.c"
1129 case 84: /* "variable" */
1131 /* Line 819 of yacc.c */
1132 #line 190 "parse-gram.y"
1133 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1135 /* Line 819 of yacc.c */
1136 #line 1137 "parse-gram.c"
1138 case 85: /* "content.opt" */
1140 /* Line 819 of yacc.c */
1141 #line 186 "parse-gram.y"
1142 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1144 /* Line 819 of yacc.c */
1145 #line 1146 "parse-gram.c"
1147 case 86: /* "braceless" */
1149 /* Line 819 of yacc.c */
1150 #line 186 "parse-gram.y"
1151 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1153 /* Line 819 of yacc.c */
1154 #line 1155 "parse-gram.c"
1158 /* Line 819 of yacc.c */
1159 #line 199 "parse-gram.y"
1160 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1162 /* Line 819 of yacc.c */
1163 #line 1164 "parse-gram.c"
1165 case 88: /* "id_colon" */
1167 /* Line 819 of yacc.c */
1168 #line 200 "parse-gram.y"
1169 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1171 /* Line 819 of yacc.c */
1172 #line 1173 "parse-gram.c"
1174 case 89: /* "symbol" */
1176 /* Line 819 of yacc.c */
1177 #line 199 "parse-gram.y"
1178 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1180 /* Line 819 of yacc.c */
1181 #line 1182 "parse-gram.c"
1183 case 90: /* "string_as_id" */
1185 /* Line 819 of yacc.c */
1186 #line 199 "parse-gram.y"
1187 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1189 /* Line 819 of yacc.c */
1190 #line 1191 "parse-gram.c"
1198 /*--------------------------------.
1199 | Print this symbol on YYOUTPUT. |
1200 `--------------------------------*/
1202 #if (defined __STDC__ || defined __C99__FUNC__ \
1203 || defined __cplusplus || defined _MSC_VER)
1205 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1208 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1211 YYSTYPE
const * const yyvaluep
;
1212 YYLTYPE
const * const yylocationp
;
1215 if (yytype
< YYNTOKENS
)
1216 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1218 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1220 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1221 YYFPRINTF (yyoutput
, ": ");
1222 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1223 YYFPRINTF (yyoutput
, ")");
1226 /*------------------------------------------------------------------.
1227 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1229 `------------------------------------------------------------------*/
1231 #if (defined __STDC__ || defined __C99__FUNC__ \
1232 || defined __cplusplus || defined _MSC_VER)
1234 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1237 yy_stack_print (yybottom
, yytop
)
1238 yytype_int16
*yybottom
;
1239 yytype_int16
*yytop
;
1242 YYFPRINTF (stderr
, "Stack now");
1243 for (; yybottom
<= yytop
; yybottom
++)
1245 int yybot
= *yybottom
;
1246 YYFPRINTF (stderr
, " %d", yybot
);
1248 YYFPRINTF (stderr
, "\n");
1251 # define YY_STACK_PRINT(Bottom, Top) \
1254 yy_stack_print ((Bottom), (Top)); \
1258 /*------------------------------------------------.
1259 | Report that the YYRULE is going to be reduced. |
1260 `------------------------------------------------*/
1262 #if (defined __STDC__ || defined __C99__FUNC__ \
1263 || defined __cplusplus || defined _MSC_VER)
1265 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1268 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1274 int yynrhs
= yyr2
[yyrule
];
1276 unsigned long int yylno
= yyrline
[yyrule
];
1277 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1279 /* The symbols being reduced. */
1280 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1282 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1283 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1284 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1285 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1286 YYFPRINTF (stderr
, "\n");
1290 # define YY_REDUCE_PRINT(Rule) \
1293 yy_reduce_print (yyvsp, yylsp, Rule); \
1296 /* Nonzero means print parse trace. It is left uninitialized so that
1297 multiple parsers can coexist. */
1299 #else /* !YYDEBUG */
1300 # define YYDPRINTF(Args)
1301 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1302 # define YY_STACK_PRINT(Bottom, Top)
1303 # define YY_REDUCE_PRINT(Rule)
1304 #endif /* !YYDEBUG */
1307 /* YYINITDEPTH -- initial size of the parser's stacks. */
1309 # define YYINITDEPTH 200
1312 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1313 if the built-in stack extension method is used).
1315 Do not make this value too large; the results are undefined if
1316 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1317 evaluated with infinite-precision integer arithmetic. */
1320 # define YYMAXDEPTH 10000
1323 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1324 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1325 stack, and such that *YYCAPACITY is the maximum number of elements it
1326 can hold without a reallocation, make sure there is enough room to
1327 store YYADD more elements. If not, allocate a new stack using
1328 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1329 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1330 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1331 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1332 required. Return 1 if memory is exhausted. */
1334 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1336 char const *yydebug_prefix
,
1337 char const *yydebug_suffix
,
1339 yytype_int16
**yybottom
,
1340 yytype_int16
*yybottom_no_free
,
1341 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1343 YYSIZE_T yysize_old
=
1344 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1345 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1346 if (*yycapacity
< yysize_new
)
1348 YYSIZE_T yyalloc
= 2 * yysize_new
;
1349 yytype_int16
*yybottom_new
;
1350 /* Use YYMAXDEPTH for maximum stack size given that the stack
1351 should never need to grow larger than the main state stack
1352 needs to grow without LAC. */
1353 if (YYMAXDEPTH
< yysize_new
)
1355 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1359 if (YYMAXDEPTH
< yyalloc
)
1360 yyalloc
= YYMAXDEPTH
;
1362 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1365 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1369 if (*yytop
!= yytop_empty
)
1371 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1372 *yytop
= yybottom_new
+ (yysize_old
- 1);
1374 if (*yybottom
!= yybottom_no_free
)
1375 YYSTACK_FREE (*yybottom
);
1376 *yybottom
= yybottom_new
;
1377 *yycapacity
= yyalloc
;
1382 /* Establish the initial context for the current lookahead if no initial
1383 context is currently established.
1385 We define a context as a snapshot of the parser stacks. We define
1386 the initial context for a lookahead as the context in which the
1387 parser initially examines that lookahead in order to select a
1388 syntactic action. Thus, if the lookahead eventually proves
1389 syntactically unacceptable (possibly in a later context reached via a
1390 series of reductions), the initial context can be used to determine
1391 the exact set of tokens that would be syntactically acceptable in the
1392 lookahead's place. Moreover, it is the context after which any
1393 further semantic actions would be erroneous because they would be
1394 determined by a syntactically unacceptable token.
1396 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1397 performed in an inconsistent state (which, for the purposes of LAC,
1398 includes consistent states that don't know they're consistent because
1399 their default reductions have been disabled). Iff there is a
1400 lookahead token, it should also be invoked before reporting a syntax
1401 error. This latter case is for the sake of the debugging output.
1403 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1404 follows. If no initial context is currently established for the
1405 current lookahead, then check if that lookahead can eventually be
1406 shifted if syntactic actions continue from the current context.
1407 Report a syntax error if it cannot. */
1408 #define YY_LAC_ESTABLISH \
1410 if (!yy_lac_established) \
1412 YYDPRINTF ((stderr, \
1413 "LAC: initial context established for %s\n", \
1414 yytname[yytoken])); \
1415 yy_lac_established = 1; \
1417 int yy_lac_status = \
1418 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1419 if (yy_lac_status == 2) \
1420 goto yyexhaustedlab; \
1421 if (yy_lac_status == 1) \
1427 /* Discard any previous initial lookahead context because of Event,
1428 which may be a lookahead change or an invalidation of the currently
1429 established initial context for the current lookahead.
1431 The most common example of a lookahead change is a shift. An example
1432 of both cases is syntax error recovery. That is, a syntax error
1433 occurs when the lookahead is syntactically erroneous for the
1434 currently established initial context, so error recovery manipulates
1435 the parser stacks to try to find a new initial context in which the
1436 current lookahead is syntactically acceptable. If it fails to find
1437 such a context, it discards the lookahead. */
1439 # define YY_LAC_DISCARD(Event) \
1441 if (yy_lac_established) \
1444 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1446 yy_lac_established = 0; \
1450 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1453 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1454 eventually (after perhaps some reductions) be shifted, return 1 if
1455 not, or return 2 if memory is exhausted. As preconditions and
1456 postconditions: *YYES_CAPACITY is the allocated size of the array to
1457 which *YYES points, and either *YYES = YYESA or *YYES points to an
1458 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1459 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1460 any old *YYES other than YYESA. */
1462 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1463 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1465 yytype_int16
*yyes_prev
= yyssp
;
1466 yytype_int16
*yyesp
= yyes_prev
;
1467 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1468 if (yytoken
== YYUNDEFTOK
)
1470 YYDPRINTF ((stderr
, " Always Err\n"));
1475 int yyrule
= yypact
[*yyesp
];
1476 if (yypact_value_is_default (yyrule
)
1477 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1478 || yycheck
[yyrule
] != yytoken
)
1480 yyrule
= yydefact
[*yyesp
];
1483 YYDPRINTF ((stderr
, " Err\n"));
1489 yyrule
= yytable
[yyrule
];
1490 if (yytable_value_is_error (yyrule
))
1492 YYDPRINTF ((stderr
, " Err\n"));
1497 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1503 YYSIZE_T yylen
= yyr2
[yyrule
];
1504 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1505 if (yyesp
!= yyes_prev
)
1507 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1520 yyesp
= yyes_prev
-= yylen
;
1525 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1526 yystate
= yypgoto
[yylhs
] + *yyesp
;
1527 if (yystate
< 0 || YYLAST
< yystate
1528 || yycheck
[yystate
] != *yyesp
)
1529 yystate
= yydefgoto
[yylhs
];
1531 yystate
= yytable
[yystate
];
1533 if (yyesp
== yyes_prev
)
1540 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1544 yyes
, yyesa
, &yyesp
, yyes_prev
))
1546 YYDPRINTF ((stderr
, "\n"));
1551 YYDPRINTF ((stderr
, " G%d", *yyesp
));
1560 # if defined __GLIBC__ && defined _STRING_H
1561 # define yystrlen strlen
1563 /* Return the length of YYSTR. */
1564 #if (defined __STDC__ || defined __C99__FUNC__ \
1565 || defined __cplusplus || defined _MSC_VER)
1567 yystrlen (const char *yystr
)
1575 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1583 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1584 # define yystpcpy stpcpy
1586 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1588 #if (defined __STDC__ || defined __C99__FUNC__ \
1589 || defined __cplusplus || defined _MSC_VER)
1591 yystpcpy (char *yydest
, const char *yysrc
)
1594 yystpcpy (yydest
, yysrc
)
1600 const char *yys
= yysrc
;
1602 while ((*yyd
++ = *yys
++) != '\0')
1611 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1612 quotes and backslashes, so that it's suitable for yyerror. The
1613 heuristic is that double-quoting is unnecessary unless the string
1614 contains an apostrophe, a comma, or backslash (other than
1615 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1616 null, do not copy; instead, return the length of what the result
1619 yytnamerr (char *yyres
, const char *yystr
)
1624 char const *yyp
= yystr
;
1631 goto do_not_strip_quotes
;
1635 goto do_not_strip_quotes
;
1648 do_not_strip_quotes
: ;
1652 return yystrlen (yystr
);
1654 return yystpcpy (yyres
, yystr
) - yyres
;
1658 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1659 about the unexpected token YYTOKEN for the state stack whose top is
1660 YYSSP. In order to see if a particular token T is a
1661 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1663 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1664 not large enough to hold the message. In that case, also set
1665 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1666 required number of bytes is too large to store or if
1667 yy_lac returned 2. */
1669 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1670 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1671 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1673 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1674 YYSIZE_T yysize
= yysize0
;
1676 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1677 /* Internationalized format string. */
1678 const char *yyformat
= 0;
1679 /* Arguments of yyformat. */
1680 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1681 /* Number of reported tokens (one for the "unexpected", one per
1685 /* There are many possibilities here to consider:
1686 - Assume YYFAIL is not used. It's too flawed to consider. See
1687 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1688 for details. YYERROR is fine as it does not invoke this
1690 - If this state is a consistent state with a default action, then
1691 the only way this function was invoked is if the default action
1692 is an error action. In that case, don't check for expected
1693 tokens because there are none.
1694 - The only way there can be no lookahead present (in yychar) is if
1695 this state is a consistent state with a default action. Thus,
1696 detecting the absence of a lookahead is sufficient to determine
1697 that there is no unexpected or expected token to report. In that
1698 case, just report a simple "syntax error".
1699 - Don't assume there isn't a lookahead just because this state is a
1700 consistent state with a default action. There might have been a
1701 previous inconsistent state, consistent state with a non-default
1702 action, or user semantic action that manipulated yychar.
1703 In the first two cases, it might appear that the current syntax
1704 error should have been detected in the previous state when yy_lac
1705 was invoked. However, at that time, there might have been a
1706 different syntax error that discarded a different initial context
1707 during error recovery, leaving behind the current lookahead.
1709 if (yytoken
!= YYEMPTY
)
1711 int yyn
= yypact
[*yyssp
];
1712 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1713 yyarg
[yycount
++] = yytname
[yytoken
];
1714 if (!yypact_value_is_default (yyn
))
1718 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1719 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1722 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1724 if (yy_lac_status
== 2)
1726 if (yy_lac_status
== 1)
1729 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1735 yyarg
[yycount
++] = yytname
[yyx
];
1736 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1737 if (! (yysize
<= yysize1
1738 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1745 YYFPRINTF (stderr
, "No expected tokens.\n");
1751 # define YYCASE_(N, S) \
1755 YYCASE_(0, YY_("syntax error"));
1756 YYCASE_(1, YY_("syntax error, unexpected %s"));
1757 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1758 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1759 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1760 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1764 yysize1
= yysize
+ yystrlen (yyformat
);
1765 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1769 if (*yymsg_alloc
< yysize
)
1771 *yymsg_alloc
= 2 * yysize
;
1772 if (! (yysize
<= *yymsg_alloc
1773 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1774 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1778 /* Avoid sprintf, as that infringes on the user's name space.
1779 Don't have undefined behavior even if the translation
1780 produced a string with the wrong number of "%s"s. */
1784 while ((*yyp
= *yyformat
) != '\0')
1785 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1787 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1798 #endif /* YYERROR_VERBOSE */
1800 /*-----------------------------------------------.
1801 | Release the memory associated to this symbol. |
1802 `-----------------------------------------------*/
1805 #if (defined __STDC__ || defined __C99__FUNC__ \
1806 || defined __cplusplus || defined _MSC_VER)
1808 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1811 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1815 YYLTYPE
*yylocationp
;
1819 YYUSE (yylocationp
);
1823 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1834 /* Prevent warnings from -Wmissing-prototypes. */
1835 #ifdef YYPARSE_PARAM
1836 #if defined __STDC__ || defined __cplusplus
1837 int yyparse (void *YYPARSE_PARAM
);
1841 #else /* ! YYPARSE_PARAM */
1842 #if defined __STDC__ || defined __cplusplus
1847 #endif /* ! YYPARSE_PARAM */
1854 #ifdef YYPARSE_PARAM
1855 #if (defined __STDC__ || defined __C99__FUNC__ \
1856 || defined __cplusplus || defined _MSC_VER)
1858 yyparse (void *YYPARSE_PARAM
)
1861 yyparse (YYPARSE_PARAM
)
1862 void *YYPARSE_PARAM
;
1864 #else /* ! YYPARSE_PARAM */
1865 #if (defined __STDC__ || defined __C99__FUNC__ \
1866 || defined __cplusplus || defined _MSC_VER)
1876 /* The lookahead symbol. */
1879 /* The semantic value of the lookahead symbol. */
1882 /* Location data for the lookahead symbol. */
1885 /* Number of syntax errors so far. */
1889 /* Number of tokens to shift before error messages enabled. */
1892 /* The stacks and their tools:
1893 `yyss': related to states.
1894 `yyvs': related to semantic values.
1895 `yyls': related to locations.
1897 Refer to the stacks thru separate pointers, to allow yyoverflow
1898 to reallocate them elsewhere. */
1900 /* The state stack. */
1901 yytype_int16 yyssa
[YYINITDEPTH
];
1903 yytype_int16
*yyssp
;
1905 /* The semantic value stack. */
1906 YYSTYPE yyvsa
[YYINITDEPTH
];
1910 /* The location stack. */
1911 YYLTYPE yylsa
[YYINITDEPTH
];
1915 /* The locations where the error started and ended. */
1916 YYLTYPE yyerror_range
[3];
1918 YYSIZE_T yystacksize
;
1920 yytype_int16 yyesa
[20];
1922 YYSIZE_T yyes_capacity
;
1924 int yy_lac_established
= 0;
1927 /* Lookahead token as an internal (translated) token number. */
1929 /* The variables used to return semantic value and location from the
1935 /* Buffer for error messages, and its allocated size. */
1937 char *yymsg
= yymsgbuf
;
1938 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1941 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1943 /* The number of symbols on the RHS of the reduced rule.
1944 Keep to zero when no symbol should be popped. */
1951 yystacksize
= YYINITDEPTH
;
1954 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1955 if (YYMAXDEPTH
< yyes_capacity
)
1956 yyes_capacity
= YYMAXDEPTH
;
1958 YYDPRINTF ((stderr
, "Starting parse\n"));
1963 yychar
= YYEMPTY
; /* Cause a token to be read. */
1965 /* Initialize stack pointers.
1966 Waste one element of value and location stack
1967 so that they stay on the same level as the state stack.
1968 The wasted elements are never initialized. */
1973 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1974 /* Initialize the default location before parsing starts. */
1975 yylloc
.first_line
= yylloc
.last_line
= 1;
1976 yylloc
.first_column
= yylloc
.last_column
= 1;
1979 /* User initialization code. */
1981 /* Line 1590 of yacc.c */
1982 #line 86 "parse-gram.y"
1984 /* Bison's grammar can initial empty locations, hence a default
1985 location is needed. */
1986 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1987 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1990 /* Line 1590 of yacc.c */
1991 #line 1992 "parse-gram.c"
1996 /*------------------------------------------------------------.
1997 | yynewstate -- Push a new state, which is found in yystate. |
1998 `------------------------------------------------------------*/
2000 /* In all cases, when you get here, the value and location stacks
2001 have just been pushed. So pushing a state here evens the stacks. */
2007 if (yyss
+ yystacksize
- 1 <= yyssp
)
2009 /* Get the current used size of the three stacks, in elements. */
2010 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2014 /* Give user a chance to reallocate the stack. Use copies of
2015 these so that the &'s don't force the real ones into
2017 YYSTYPE
*yyvs1
= yyvs
;
2018 yytype_int16
*yyss1
= yyss
;
2019 YYLTYPE
*yyls1
= yyls
;
2021 /* Each stack pointer address is followed by the size of the
2022 data in use in that stack, in bytes. This used to be a
2023 conditional around just the two extra args, but that might
2024 be undefined if yyoverflow is a macro. */
2025 yyoverflow (YY_("memory exhausted"),
2026 &yyss1
, yysize
* sizeof (*yyssp
),
2027 &yyvs1
, yysize
* sizeof (*yyvsp
),
2028 &yyls1
, yysize
* sizeof (*yylsp
),
2035 #else /* no yyoverflow */
2036 # ifndef YYSTACK_RELOCATE
2037 goto yyexhaustedlab
;
2039 /* Extend the stack our own way. */
2040 if (YYMAXDEPTH
<= yystacksize
)
2041 goto yyexhaustedlab
;
2043 if (YYMAXDEPTH
< yystacksize
)
2044 yystacksize
= YYMAXDEPTH
;
2047 yytype_int16
*yyss1
= yyss
;
2048 union yyalloc
*yyptr
=
2049 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2051 goto yyexhaustedlab
;
2052 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2053 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2054 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2055 # undef YYSTACK_RELOCATE
2057 YYSTACK_FREE (yyss1
);
2060 #endif /* no yyoverflow */
2062 yyssp
= yyss
+ yysize
- 1;
2063 yyvsp
= yyvs
+ yysize
- 1;
2064 yylsp
= yyls
+ yysize
- 1;
2066 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2067 (unsigned long int) yystacksize
));
2069 if (yyss
+ yystacksize
- 1 <= yyssp
)
2073 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2075 if (yystate
== YYFINAL
)
2085 /* Do appropriate processing given the current state. Read a
2086 lookahead token if we need one and don't already have one. */
2088 /* First try to decide what to do without reference to lookahead token. */
2089 yyn
= yypact
[yystate
];
2090 if (yypact_value_is_default (yyn
))
2093 /* Not known => get a lookahead token if don't already have one. */
2095 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2096 if (yychar
== YYEMPTY
)
2098 YYDPRINTF ((stderr
, "Reading a token: "));
2102 if (yychar
<= YYEOF
)
2104 yychar
= yytoken
= YYEOF
;
2105 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2109 yytoken
= YYTRANSLATE (yychar
);
2110 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2113 /* If the proper action on seeing token YYTOKEN is to reduce or to
2114 detect an error, take that action. */
2116 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2124 if (yytable_value_is_error (yyn
))
2131 /* Count tokens shifted since error; after three, turn off error
2136 /* Shift the lookahead token. */
2137 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2139 /* Discard the shifted token. */
2141 YY_LAC_DISCARD ("shift");
2149 /*-----------------------------------------------------------.
2150 | yydefault -- do the default action for the current state. |
2151 `-----------------------------------------------------------*/
2153 yyn
= yydefact
[yystate
];
2159 /*-----------------------------.
2160 | yyreduce -- Do a reduction. |
2161 `-----------------------------*/
2163 /* yyn is the number of a rule to reduce with. */
2166 /* If YYLEN is nonzero, implement the default value of the action:
2169 Otherwise, the following line sets YYVAL to garbage.
2170 This behavior is undocumented and Bison
2171 users should not rely upon it. Assigning to YYVAL
2172 unconditionally makes the parser a bit smaller, and it avoids a
2173 GCC warning that YYVAL may be used uninitialized. */
2174 yyval
= yyvsp
[1-yylen
];
2176 /* Default location. */
2177 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2178 YY_REDUCE_PRINT (yyn
);
2180 int yychar_backup
= yychar
;
2185 /* Line 1806 of yacc.c */
2186 #line 225 "parse-gram.y"
2188 code_props plain_code
;
2189 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
2190 code_props_translate_code (&plain_code
);
2191 gram_scanner_last_string_free ();
2192 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2193 plain_code
.code
, (yylsp
[(1) - (1)]));
2194 code_scanner_last_string_free ();
2200 /* Line 1806 of yacc.c */
2201 #line 234 "parse-gram.y"
2202 { debug_flag
= true; }
2207 /* Line 1806 of yacc.c */
2208 #line 236 "parse-gram.y"
2210 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
),
2211 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2217 /* Line 1806 of yacc.c */
2218 #line 240 "parse-gram.y"
2219 { defines_flag
= true; }
2224 /* Line 1806 of yacc.c */
2225 #line 242 "parse-gram.y"
2227 defines_flag
= true;
2228 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
2234 /* Line 1806 of yacc.c */
2235 #line 246 "parse-gram.y"
2236 { error_verbose
= true; }
2241 /* Line 1806 of yacc.c */
2242 #line 247 "parse-gram.y"
2243 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2248 /* Line 1806 of yacc.c */
2249 #line 248 "parse-gram.y"
2250 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2255 /* Line 1806 of yacc.c */
2256 #line 249 "parse-gram.y"
2257 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
2262 /* Line 1806 of yacc.c */
2263 #line 250 "parse-gram.y"
2264 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
2269 /* Line 1806 of yacc.c */
2270 #line 252 "parse-gram.y"
2272 nondeterministic_parser
= true;
2279 /* Line 1806 of yacc.c */
2280 #line 257 "parse-gram.y"
2283 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
2284 code_props_translate_code (&action
);
2285 gram_scanner_last_string_free ();
2286 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2287 code_scanner_last_string_free ();
2293 /* Line 1806 of yacc.c */
2294 #line 265 "parse-gram.y"
2295 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, (yylsp
[(1) - (2)])); }
2300 /* Line 1806 of yacc.c */
2301 #line 266 "parse-gram.y"
2302 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2307 /* Line 1806 of yacc.c */
2308 #line 267 "parse-gram.y"
2309 { locations_flag
= true; }
2314 /* Line 1806 of yacc.c */
2315 #line 268 "parse-gram.y"
2316 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2321 /* Line 1806 of yacc.c */
2322 #line 269 "parse-gram.y"
2323 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2328 /* Line 1806 of yacc.c */
2329 #line 270 "parse-gram.y"
2330 { no_lines_flag
= true; }
2335 /* Line 1806 of yacc.c */
2336 #line 271 "parse-gram.y"
2337 { nondeterministic_parser
= true; }
2342 /* Line 1806 of yacc.c */
2343 #line 272 "parse-gram.y"
2344 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2349 /* Line 1806 of yacc.c */
2350 #line 273 "parse-gram.y"
2351 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2356 /* Line 1806 of yacc.c */
2357 #line 274 "parse-gram.y"
2358 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2363 /* Line 1806 of yacc.c */
2364 #line 276 "parse-gram.y"
2366 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2367 `%define api.pure' in a backward-compatible manner here. First, don't
2368 complain if %pure-parser is specified multiple times. */
2369 if (!muscle_find_const ("percent_define(api.pure)"))
2370 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2371 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2372 /* In all cases, use api.pure now so that the backend doesn't complain if
2373 the skeleton ignores api.pure, but do warn now if there's a previous
2374 conflicting definition from an actual %define. */
2375 if (!muscle_percent_define_flag_if ("api.pure"))
2376 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2377 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2383 /* Line 1806 of yacc.c */
2384 #line 290 "parse-gram.y"
2385 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2390 /* Line 1806 of yacc.c */
2391 #line 292 "parse-gram.y"
2393 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2394 if (strchr (skeleton_user
, '/'))
2396 size_t dir_length
= strlen (current_file
);
2397 char *skeleton_build
;
2398 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2400 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2403 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2406 strncpy (skeleton_build
, current_file
, dir_length
);
2407 skeleton_build
[dir_length
++] = '/';
2409 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2410 skeleton_user
= uniqstr_new (skeleton_build
);
2411 free (skeleton_build
);
2413 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[(1) - (2)]));
2419 /* Line 1806 of yacc.c */
2420 #line 315 "parse-gram.y"
2421 { token_table_flag
= true; }
2426 /* Line 1806 of yacc.c */
2427 #line 316 "parse-gram.y"
2428 { report_flag
|= report_states
; }
2433 /* Line 1806 of yacc.c */
2434 #line 317 "parse-gram.y"
2435 { yacc_flag
= true; }
2440 /* Line 1806 of yacc.c */
2441 #line 325 "parse-gram.y"
2443 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2449 /* Line 1806 of yacc.c */
2450 #line 329 "parse-gram.y"
2453 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2454 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2455 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2461 /* Line 1806 of yacc.c */
2462 #line 336 "parse-gram.y"
2465 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2466 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2467 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2473 /* Line 1806 of yacc.c */
2474 #line 343 "parse-gram.y"
2476 default_prec
= true;
2482 /* Line 1806 of yacc.c */
2483 #line 347 "parse-gram.y"
2485 default_prec
= false;
2491 /* Line 1806 of yacc.c */
2492 #line 351 "parse-gram.y"
2494 /* Do not invoke muscle_percent_code_grow here since it invokes
2495 muscle_user_name_list_grow. */
2496 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2497 code_scanner_last_string_free ();
2503 /* Line 1806 of yacc.c */
2504 #line 358 "parse-gram.y"
2506 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2507 code_scanner_last_string_free ();
2513 /* Line 1806 of yacc.c */
2514 #line 372 "parse-gram.y"
2520 /* Line 1806 of yacc.c */
2521 #line 373 "parse-gram.y"
2522 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2527 /* Line 1806 of yacc.c */
2528 #line 378 "parse-gram.y"
2531 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2532 code_scanner_last_string_free ();
2538 /* Line 1806 of yacc.c */
2539 #line 389 "parse-gram.y"
2540 { current_class
= nterm_sym
; }
2545 /* Line 1806 of yacc.c */
2546 #line 390 "parse-gram.y"
2548 current_class
= unknown_sym
;
2549 current_type
= NULL
;
2555 /* Line 1806 of yacc.c */
2556 #line 394 "parse-gram.y"
2557 { current_class
= token_sym
; }
2562 /* Line 1806 of yacc.c */
2563 #line 395 "parse-gram.y"
2565 current_class
= unknown_sym
;
2566 current_type
= NULL
;
2572 /* Line 1806 of yacc.c */
2573 #line 400 "parse-gram.y"
2577 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2578 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2579 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2585 /* Line 1806 of yacc.c */
2586 #line 411 "parse-gram.y"
2590 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2592 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2593 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2595 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2596 current_type
= NULL
;
2602 /* Line 1806 of yacc.c */
2603 #line 425 "parse-gram.y"
2604 { (yyval
.assoc
) = left_assoc
; }
2609 /* Line 1806 of yacc.c */
2610 #line 426 "parse-gram.y"
2611 { (yyval
.assoc
) = right_assoc
; }
2616 /* Line 1806 of yacc.c */
2617 #line 427 "parse-gram.y"
2618 { (yyval
.assoc
) = non_assoc
; }
2623 /* Line 1806 of yacc.c */
2624 #line 431 "parse-gram.y"
2625 { current_type
= NULL
; }
2630 /* Line 1806 of yacc.c */
2631 #line 432 "parse-gram.y"
2632 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2637 /* Line 1806 of yacc.c */
2638 #line 438 "parse-gram.y"
2639 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2644 /* Line 1806 of yacc.c */
2645 #line 440 "parse-gram.y"
2646 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2651 /* Line 1806 of yacc.c */
2652 #line 444 "parse-gram.y"
2653 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2658 /* Line 1806 of yacc.c */
2659 #line 445 "parse-gram.y"
2660 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2665 /* Line 1806 of yacc.c */
2666 #line 451 "parse-gram.y"
2667 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2672 /* Line 1806 of yacc.c */
2673 #line 453 "parse-gram.y"
2674 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2679 /* Line 1806 of yacc.c */
2680 #line 457 "parse-gram.y"
2681 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2686 /* Line 1806 of yacc.c */
2687 #line 458 "parse-gram.y"
2688 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2693 /* Line 1806 of yacc.c */
2694 #line 462 "parse-gram.y"
2695 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2700 /* Line 1806 of yacc.c */
2701 #line 463 "parse-gram.y"
2702 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2707 /* Line 1806 of yacc.c */
2708 #line 464 "parse-gram.y"
2709 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2714 /* Line 1806 of yacc.c */
2715 #line 465 "parse-gram.y"
2716 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2721 /* Line 1806 of yacc.c */
2722 #line 471 "parse-gram.y"
2724 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2731 /* Line 1806 of yacc.c */
2732 #line 476 "parse-gram.y"
2734 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2735 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2741 /* Line 1806 of yacc.c */
2742 #line 481 "parse-gram.y"
2744 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2745 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2746 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2752 /* Line 1806 of yacc.c */
2753 #line 487 "parse-gram.y"
2755 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2756 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2757 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2763 /* Line 1806 of yacc.c */
2764 #line 493 "parse-gram.y"
2766 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2767 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2768 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2769 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2775 /* Line 1806 of yacc.c */
2776 #line 523 "parse-gram.y"
2784 /* Line 1806 of yacc.c */
2785 #line 529 "parse-gram.y"
2786 { current_lhs
= (yyvsp
[(1) - (2)].symbol
); current_lhs_location
= (yylsp
[(1) - (2)]);
2787 current_lhs_named_ref
= (yyvsp
[(2) - (2)].named_ref
); }
2792 /* Line 1806 of yacc.c */
2793 #line 534 "parse-gram.y"
2794 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2799 /* Line 1806 of yacc.c */
2800 #line 535 "parse-gram.y"
2801 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2806 /* Line 1806 of yacc.c */
2807 #line 541 "parse-gram.y"
2808 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2809 current_lhs_named_ref
); }
2814 /* Line 1806 of yacc.c */
2815 #line 544 "parse-gram.y"
2816 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (3)].symbol
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2821 /* Line 1806 of yacc.c */
2822 #line 546 "parse-gram.y"
2823 { grammar_current_rule_action_append ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2828 /* Line 1806 of yacc.c */
2829 #line 548 "parse-gram.y"
2830 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2835 /* Line 1806 of yacc.c */
2836 #line 550 "parse-gram.y"
2837 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2842 /* Line 1806 of yacc.c */
2843 #line 552 "parse-gram.y"
2844 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2849 /* Line 1806 of yacc.c */
2850 #line 556 "parse-gram.y"
2851 { (yyval
.named_ref
) = 0; }
2856 /* Line 1806 of yacc.c */
2857 #line 558 "parse-gram.y"
2858 { (yyval
.named_ref
) = named_ref_new((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2863 /* Line 1806 of yacc.c */
2864 #line 570 "parse-gram.y"
2865 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2870 /* Line 1806 of yacc.c */
2871 #line 575 "parse-gram.y"
2872 { (yyval
.chars
) = ""; }
2877 /* Line 1806 of yacc.c */
2878 #line 576 "parse-gram.y"
2879 { (yyval
.chars
) = (yyvsp
[(1) - (1)].uniqstr
); }
2884 /* Line 1806 of yacc.c */
2885 #line 587 "parse-gram.y"
2887 code_props plain_code
;
2888 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2889 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2890 code_props_translate_code (&plain_code
);
2891 gram_scanner_last_string_free ();
2892 (yyval
.chars
) = plain_code
.code
;
2898 /* Line 1806 of yacc.c */
2899 #line 607 "parse-gram.y"
2900 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2905 /* Line 1806 of yacc.c */
2906 #line 609 "parse-gram.y"
2908 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2909 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2910 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2916 /* Line 1806 of yacc.c */
2917 #line 617 "parse-gram.y"
2918 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2923 /* Line 1806 of yacc.c */
2924 #line 629 "parse-gram.y"
2926 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2927 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2933 /* Line 1806 of yacc.c */
2934 #line 638 "parse-gram.y"
2936 code_props plain_code
;
2937 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2938 code_props_translate_code (&plain_code
);
2939 gram_scanner_last_string_free ();
2940 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2941 code_scanner_last_string_free ();
2947 /* Line 1806 of yacc.c */
2948 #line 2949 "parse-gram.c"
2951 if (yychar_backup
!= yychar
)
2952 YY_LAC_DISCARD ("yychar change");
2954 /* User semantic actions sometimes alter yychar, and that requires
2955 that yytoken be updated with the new translation. We take the
2956 approach of translating immediately before every use of yytoken.
2957 One alternative is translating here after every semantic action,
2958 but that translation would be missed if the semantic action invokes
2959 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2960 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2961 incorrect destructor might then be invoked immediately. In the
2962 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2963 to an incorrect destructor call or verbose syntax error message
2964 before the lookahead is translated. */
2965 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2969 YY_STACK_PRINT (yyss
, yyssp
);
2974 /* Now `shift' the result of the reduction. Determine what state
2975 that goes to, based on the state we popped back to and the rule
2976 number reduced by. */
2980 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2981 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2982 yystate
= yytable
[yystate
];
2984 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2989 /*------------------------------------.
2990 | yyerrlab -- here on detecting error |
2991 `------------------------------------*/
2993 /* Make sure we have latest lookahead translation. See comments at
2994 user semantic actions for why this is necessary. */
2995 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2997 /* If not already recovering from an error, report this error. */
3001 #if ! YYERROR_VERBOSE
3002 yyerror (YY_("syntax error"));
3004 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3005 yyesa, &yyes, &yyes_capacity, \
3008 char const *yymsgp
= YY_("syntax error");
3009 int yysyntax_error_status
;
3010 if (yychar
!= YYEMPTY
)
3012 yysyntax_error_status
= YYSYNTAX_ERROR
;
3013 if (yysyntax_error_status
== 0)
3015 else if (yysyntax_error_status
== 1)
3017 if (yymsg
!= yymsgbuf
)
3018 YYSTACK_FREE (yymsg
);
3019 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3023 yymsg_alloc
= sizeof yymsgbuf
;
3024 yysyntax_error_status
= 2;
3028 yysyntax_error_status
= YYSYNTAX_ERROR
;
3033 if (yysyntax_error_status
== 2)
3034 goto yyexhaustedlab
;
3036 # undef YYSYNTAX_ERROR
3040 yyerror_range
[1] = yylloc
;
3042 if (yyerrstatus
== 3)
3044 /* If just tried and failed to reuse lookahead token after an
3045 error, discard it. */
3047 if (yychar
<= YYEOF
)
3049 /* Return failure if at end of input. */
3050 if (yychar
== YYEOF
)
3055 yydestruct ("Error: discarding",
3056 yytoken
, &yylval
, &yylloc
);
3061 /* Else will try to reuse lookahead token after shifting the error
3066 /*---------------------------------------------------.
3067 | yyerrorlab -- error raised explicitly by YYERROR. |
3068 `---------------------------------------------------*/
3071 /* Pacify compilers like GCC when the user code never invokes
3072 YYERROR and the label yyerrorlab therefore never appears in user
3074 if (/*CONSTCOND*/ 0)
3077 yyerror_range
[1] = yylsp
[1-yylen
];
3078 /* Do not reclaim the symbols of the rule which action triggered
3082 YY_STACK_PRINT (yyss
, yyssp
);
3087 /*-------------------------------------------------------------.
3088 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3089 `-------------------------------------------------------------*/
3091 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3095 yyn
= yypact
[yystate
];
3096 if (!yypact_value_is_default (yyn
))
3099 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3107 /* Pop the current state because it cannot handle the error token. */
3111 yyerror_range
[1] = *yylsp
;
3112 yydestruct ("Error: popping",
3113 yystos
[yystate
], yyvsp
, yylsp
);
3116 YY_STACK_PRINT (yyss
, yyssp
);
3119 /* If the stack popping above didn't lose the initial context for the
3120 current lookahead token, the shift below will for sure. */
3121 YY_LAC_DISCARD ("error recovery");
3125 yyerror_range
[2] = yylloc
;
3126 /* Using YYLLOC is tempting, but would change the location of
3127 the lookahead. YYLOC is available though. */
3128 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3131 /* Shift the error token. */
3132 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3138 /*-------------------------------------.
3139 | yyacceptlab -- YYACCEPT comes here. |
3140 `-------------------------------------*/
3145 /*-----------------------------------.
3146 | yyabortlab -- YYABORT comes here. |
3147 `-----------------------------------*/
3153 /*-------------------------------------------------.
3154 | yyexhaustedlab -- memory exhaustion comes here. |
3155 `-------------------------------------------------*/
3157 yyerror (YY_("memory exhausted"));
3163 if (yychar
!= YYEMPTY
)
3165 /* Make sure we have latest lookahead translation. See comments at
3166 user semantic actions for why this is necessary. */
3167 yytoken
= YYTRANSLATE (yychar
);
3168 yydestruct ("Cleanup: discarding lookahead",
3169 yytoken
, &yylval
, &yylloc
);
3171 /* Do not reclaim the symbols of the rule which action triggered
3172 this YYABORT or YYACCEPT. */
3174 YY_STACK_PRINT (yyss
, yyssp
);
3175 while (yyssp
!= yyss
)
3177 yydestruct ("Cleanup: popping",
3178 yystos
[*yyssp
], yyvsp
, yylsp
);
3183 YYSTACK_FREE (yyss
);
3186 YYSTACK_FREE (yyes
);
3188 if (yymsg
!= yymsgbuf
)
3189 YYSTACK_FREE (yymsg
);
3191 /* Make sure YYID is used. */
3192 return YYID (yyresult
);
3197 /* Line 2067 of yacc.c */
3198 #line 648 "parse-gram.y"
3202 /* Return the location of the left-hand side of a rule whose
3203 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3204 the right-hand side, and return an empty location equal to the end
3205 boundary of RHS[0] if the right-hand side is empty. */
3208 lloc_default (YYLTYPE
const *rhs
, int n
)
3213 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3214 The bug is fixed in 7.4.2m, but play it safe for now. */
3215 loc
.start
= rhs
[n
].end
;
3216 loc
.end
= rhs
[n
].end
;
3218 /* Ignore empty nonterminals the start of the the right-hand side.
3219 Do not bother to ignore them at the end of the right-hand side,
3220 since empty nonterminals have the same end as their predecessors. */
3221 for (i
= 1; i
<= n
; i
++)
3222 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3224 loc
.start
= rhs
[i
].start
;
3232 /* Add a lex-param or a parse-param (depending on TYPE) with
3233 declaration DECL and location LOC. */
3236 add_param (char const *type
, char *decl
, location loc
)
3238 static char const alphanum
[26 + 26 + 1 + 10] =
3239 "abcdefghijklmnopqrstuvwxyz"
3240 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3243 char const *name_start
= NULL
;
3246 /* Stop on last actual character. */
3247 for (p
= decl
; p
[1]; p
++)
3249 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3250 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3253 /* Strip the surrounding '{' and '}', and any blanks just inside
3255 while (*--p
== ' ' || *p
== '\t')
3258 while (*++decl
== ' ' || *decl
== '\t')
3262 complain_at (loc
, _("missing identifier in parameter declaration"));
3269 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3273 name
= xmalloc (name_len
+ 1);
3274 memcpy (name
, name_start
, name_len
);
3275 name
[name_len
] = '\0';
3276 muscle_pair_list_grow (type
, decl
, name
);
3280 gram_scanner_last_string_free ();
3285 version_check (location
const *loc
, char const *version
)
3287 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3289 complain_at (*loc
, "require bison %s, but have %s",
3290 version
, PACKAGE_VERSION
);
3296 gram_error (location
const *loc
, char const *msg
)
3298 complain_at (*loc
, "%s", msg
);
3302 token_name (int type
)
3304 return yytname
[YYTRANSLATE (type
)];
3315 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3316 return quotearg_style (escape_quoting_style
, buf
);