1 /* A Bison parser, made by GNU Bison 2.5.127-8555-dirty. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2012 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.5.127-8555-dirty"
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-2012 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"
112 #include "xmemdup0.h"
114 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
115 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
117 #define YY_LOCATION_PRINT(File, Loc) \
118 location_print (File, Loc)
120 static void version_check (location
const *loc
, char const *version
);
122 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
123 FIXME: depends on the undocumented availability of YYLLOC. */
125 #define yyerror(Msg) \
126 gram_error (&yylloc, Msg)
127 static void gram_error (location
const *, char const *);
129 static char const *char_name (char);
131 /** Add a lex-param or a parse-param.
133 * \param type \a lex_param or \a parse_param
134 * \param decl the formal argument
135 * \param loc the location in the source.
137 static void add_param (char const *type
, char *decl
, location loc
);
140 static symbol_class current_class
= unknown_sym
;
141 static uniqstr current_type
= NULL
;
142 static symbol
*current_lhs_symbol
;
143 static location current_lhs_location
;
144 static named_ref
*current_lhs_named_ref
;
145 static int current_prec
= 0;
147 /** Set the new current left-hand side symbol, possibly common
148 * to several right-hand side parts of rule.
152 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
154 current_lhs_symbol
= sym
;
155 current_lhs_location
= loc
;
156 /* In order to simplify memory management, named references for lhs
157 are always assigned by deep copy into the current symbol_list
158 node. This is because a single named-ref in the grammar may
159 result in several uses when the user factors lhs between several
160 rules using "|". Therefore free the parser's original copy. */
161 free (current_lhs_named_ref
);
162 current_lhs_named_ref
= ref
;
166 #define YYTYPE_INT16 int_fast16_t
167 #define YYTYPE_INT8 int_fast8_t
168 #define YYTYPE_UINT16 uint_fast16_t
169 #define YYTYPE_UINT8 uint_fast8_t
172 /* Line 268 of yacc.c */
173 #line 174 "parse-gram.c"
176 # if defined __cplusplus && 201103L <= __cplusplus
177 # define YY_NULL nullptr
183 /* Enabling traces. */
188 /* Enabling verbose error messages. */
189 #ifdef YYERROR_VERBOSE
190 # undef YYERROR_VERBOSE
191 # define YYERROR_VERBOSE 1
193 # define YYERROR_VERBOSE 1
196 /* Enabling the token table. */
197 #ifndef YYTOKEN_TABLE
198 # define YYTOKEN_TABLE 0
205 /* Put the tokens into the symbol table, so that GDB and other debuggers
214 PERCENT_DESTRUCTOR
= 263,
215 PERCENT_PRINTER
= 264,
218 PERCENT_NONASSOC
= 267,
224 PERCENT_DEFAULT_PREC
= 273,
225 PERCENT_DEFINE
= 274,
226 PERCENT_DEFINES
= 275,
227 PERCENT_ERROR_VERBOSE
= 276,
228 PERCENT_EXPECT
= 277,
229 PERCENT_EXPECT_RR
= 278,
230 PERCENT_FILE_PREFIX
= 279,
231 PERCENT_GLR_PARSER
= 280,
232 PERCENT_INITIAL_ACTION
= 281,
233 PERCENT_LANGUAGE
= 282,
234 PERCENT_LEX_PARAM
= 283,
235 PERCENT_LOCATIONS
= 284,
236 PERCENT_NAME_PREFIX
= 285,
237 PERCENT_NO_DEFAULT_PREC
= 286,
238 PERCENT_NO_LINES
= 287,
239 PERCENT_NONDETERMINISTIC_PARSER
= 288,
240 PERCENT_OUTPUT
= 289,
241 PERCENT_PARSE_PARAM
= 290,
242 PERCENT_PURE_PARSER
= 291,
243 PERCENT_REQUIRE
= 292,
244 PERCENT_SKELETON
= 293,
246 PERCENT_TOKEN_TABLE
= 295,
247 PERCENT_VERBOSE
= 296,
256 PERCENT_PERCENT
= 305,
270 #define PERCENT_TOKEN 260
271 #define PERCENT_NTERM 261
272 #define PERCENT_TYPE 262
273 #define PERCENT_DESTRUCTOR 263
274 #define PERCENT_PRINTER 264
275 #define PERCENT_LEFT 265
276 #define PERCENT_RIGHT 266
277 #define PERCENT_NONASSOC 267
278 #define PERCENT_PREC 268
279 #define PERCENT_DPREC 269
280 #define PERCENT_MERGE 270
281 #define PERCENT_CODE 271
282 #define PERCENT_DEBUG 272
283 #define PERCENT_DEFAULT_PREC 273
284 #define PERCENT_DEFINE 274
285 #define PERCENT_DEFINES 275
286 #define PERCENT_ERROR_VERBOSE 276
287 #define PERCENT_EXPECT 277
288 #define PERCENT_EXPECT_RR 278
289 #define PERCENT_FILE_PREFIX 279
290 #define PERCENT_GLR_PARSER 280
291 #define PERCENT_INITIAL_ACTION 281
292 #define PERCENT_LANGUAGE 282
293 #define PERCENT_LEX_PARAM 283
294 #define PERCENT_LOCATIONS 284
295 #define PERCENT_NAME_PREFIX 285
296 #define PERCENT_NO_DEFAULT_PREC 286
297 #define PERCENT_NO_LINES 287
298 #define PERCENT_NONDETERMINISTIC_PARSER 288
299 #define PERCENT_OUTPUT 289
300 #define PERCENT_PARSE_PARAM 290
301 #define PERCENT_PURE_PARSER 291
302 #define PERCENT_REQUIRE 292
303 #define PERCENT_SKELETON 293
304 #define PERCENT_START 294
305 #define PERCENT_TOKEN_TABLE 295
306 #define PERCENT_VERBOSE 296
307 #define PERCENT_YACC 297
308 #define BRACED_CODE 298
309 #define BRACKETED_ID 299
315 #define PERCENT_PERCENT 305
318 #define SEMICOLON 308
320 #define TYPE_TAG_ANY 310
321 #define TYPE_TAG_NONE 311
322 #define PERCENT_UNION 312
327 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
328 typedef union YYSTYPE
331 /* Line 295 of yacc.c */
332 #line 114 "parse-gram.y"
341 unsigned char character
;
342 named_ref
*named_ref
;
346 /* Line 295 of yacc.c */
347 #line 348 "parse-gram.c"
349 # define YYSTYPE_IS_TRIVIAL 1
350 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
351 # define YYSTYPE_IS_DECLARED 1
354 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
355 typedef struct YYLTYPE
362 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
363 # define YYLTYPE_IS_DECLARED 1
364 # define YYLTYPE_IS_TRIVIAL 1
368 /* Copy the second part of user declarations. */
371 /* Line 345 of yacc.c */
372 #line 373 "parse-gram.c"
379 typedef YYTYPE_UINT8 yytype_uint8
;
381 typedef unsigned char yytype_uint8
;
385 typedef YYTYPE_INT8 yytype_int8
;
386 #elif (defined __STDC__ || defined __C99__FUNC__ \
387 || defined __cplusplus || defined _MSC_VER)
388 typedef signed char yytype_int8
;
390 typedef short int yytype_int8
;
394 typedef YYTYPE_UINT16 yytype_uint16
;
396 typedef unsigned short int yytype_uint16
;
400 typedef YYTYPE_INT16 yytype_int16
;
402 typedef short int yytype_int16
;
406 # ifdef __SIZE_TYPE__
407 # define YYSIZE_T __SIZE_TYPE__
408 # elif defined size_t
409 # define YYSIZE_T size_t
410 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
411 || defined __cplusplus || defined _MSC_VER)
412 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
413 # define YYSIZE_T size_t
415 # define YYSIZE_T unsigned int
419 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
422 # if defined YYENABLE_NLS && YYENABLE_NLS
424 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
425 # define YY_(msgid) dgettext ("bison-runtime", msgid)
429 # define YY_(msgid) msgid
433 /* Suppress unused-variable warnings by "using" E. */
434 #if ! defined lint || defined __GNUC__
435 # define YYUSE(e) ((void) (e))
437 # define YYUSE(e) /* empty */
440 /* Identity function, used to suppress warnings about constant conditions. */
444 #if (defined __STDC__ || defined __C99__FUNC__ \
445 || defined __cplusplus || defined _MSC_VER)
460 /* The parser invokes alloca or malloc; define the necessary symbols. */
462 # ifdef YYSTACK_ALLOC
463 /* Pacify GCC's `empty if-body' warning. */
464 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
465 # ifndef YYSTACK_ALLOC_MAXIMUM
466 /* The OS might guarantee only one guard page at the bottom of the stack,
467 and a page size can be as small as 4096 bytes. So we cannot safely
468 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
469 to allow for a few compiler-allocated temporary stack slots. */
470 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
473 # define YYSTACK_ALLOC YYMALLOC
474 # define YYSTACK_FREE YYFREE
475 # ifndef YYSTACK_ALLOC_MAXIMUM
476 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
478 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
479 && ! ((defined YYMALLOC || defined malloc) \
480 && (defined YYFREE || defined free)))
481 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
482 # ifndef EXIT_SUCCESS
483 # define EXIT_SUCCESS 0
487 # define YYMALLOC malloc
488 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
489 || defined __cplusplus || defined _MSC_VER)
490 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
495 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
496 || defined __cplusplus || defined _MSC_VER)
497 void free (void *); /* INFRINGES ON USER NAME SPACE */
501 # define YYCOPY_NEEDED 1
505 #if (! defined yyoverflow \
506 && (! defined __cplusplus \
507 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
508 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
510 /* A type that is properly aligned for any stack member. */
513 yytype_int16 yyss_alloc
;
518 /* The size of the maximum gap between one aligned stack and the next. */
519 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
521 /* The size of an array large to enough to hold all stacks, each with
523 # define YYSTACK_BYTES(N) \
524 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
525 + 2 * YYSTACK_GAP_MAXIMUM)
527 # define YYCOPY_NEEDED 1
529 /* Relocate STACK from its old location to the new one. The
530 local variables YYSIZE and YYSTACKSIZE give the old and new number of
531 elements in the stack, and YYPTR gives the new location of the
532 stack. Advance YYPTR to a properly aligned location for the next
534 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
537 YYSIZE_T yynewbytes; \
538 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
539 Stack = &yyptr->Stack_alloc; \
540 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
541 yyptr += yynewbytes / sizeof (*yyptr); \
547 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
548 /* Copy COUNT objects from SRC to DST. The source and destination do
551 # if defined __GNUC__ && 1 < __GNUC__
552 # define YYCOPY(Dst, Src, Count) \
553 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
555 # define YYCOPY(Dst, Src, Count) \
559 for (yyi = 0; yyi < (Count); yyi++) \
560 (Dst)[yyi] = (Src)[yyi]; \
565 #endif /* !YYCOPY_NEEDED */
567 /* YYFINAL -- State number of the termination state. */
569 /* YYLAST -- Last index in YYTABLE. */
572 /* YYNTOKENS -- Number of terminals. */
574 /* YYNNTS -- Number of nonterminals. */
576 /* YYNRULES -- Number of rules. */
578 /* YYNRULES -- Number of states. */
579 #define YYNSTATES 148
581 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
583 #define YYMAXUTOK 312
585 #define YYTRANSLATE(YYX) \
586 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
588 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
589 static const yytype_uint8 yytranslate
[] =
591 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
617 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
618 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
619 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
620 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
621 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
626 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
628 static const yytype_uint16 yyprhs
[] =
630 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
631 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
632 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
633 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
634 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
635 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
636 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
637 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
638 206, 209, 212, 213, 218, 220, 224, 227, 228, 232,
639 236, 240, 244, 248, 249, 251, 253, 255, 256, 258,
640 260, 262, 264, 266, 268, 270, 272, 274, 275
643 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
644 static const yytype_int8 yyrhs
[] =
646 59, 0, -1, 60, 50, 77, 91, -1, -1, 60,
647 61, -1, 62, -1, 52, -1, 17, -1, 19, 84,
648 85, -1, 20, -1, 20, 3, -1, 21, -1, 22,
649 4, -1, 23, 4, -1, 24, 3, -1, 24, 47,
650 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
651 28, 43, -1, 29, -1, 30, 3, -1, 30, 47,
652 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
653 47, 3, -1, 35, 43, -1, 36, -1, 37, 3,
654 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
655 53, -1, 67, -1, 64, -1, 39, 89, -1, 8,
656 43, 73, -1, 9, 43, 73, -1, 18, -1, 31,
657 -1, 16, 86, -1, 16, 48, 86, -1, -1, 48,
658 -1, 57, 63, 86, -1, -1, 6, 65, 76, -1,
659 -1, 5, 66, 76, -1, 7, 54, 72, -1, 68,
660 69, 70, -1, 10, -1, 11, -1, 12, -1, -1,
661 54, -1, 71, -1, 70, 71, -1, 89, -1, 89,
662 4, -1, 89, -1, 72, 89, -1, 74, -1, 73,
663 74, -1, 89, -1, 54, -1, 55, -1, 56, -1,
664 54, -1, 87, -1, 87, 4, -1, 87, 90, -1,
665 87, 4, 90, -1, 75, -1, 76, 75, -1, 78,
666 -1, 77, 78, -1, 79, -1, 62, 53, -1, 1,
667 53, -1, -1, 88, 83, 80, 81, -1, 82, -1,
668 81, 51, 82, -1, 81, 53, -1, -1, 82, 89,
669 83, -1, 82, 43, 83, -1, 82, 13, 89, -1,
670 82, 14, 4, -1, 82, 15, 54, -1, -1, 44,
671 -1, 48, -1, 3, -1, -1, 48, -1, 3, -1,
672 43, -1, 48, -1, 45, -1, 49, -1, 87, -1,
673 90, -1, 3, -1, -1, 50, 46, -1
676 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
677 static const yytype_uint16 yyrline
[] =
679 0, 229, 229, 237, 239, 243, 244, 254, 255, 260,
680 261, 266, 267, 268, 269, 270, 271, 276, 285, 286,
681 287, 288, 289, 290, 291, 292, 293, 294, 295, 310,
682 311, 335, 336, 337, 338, 342, 343, 344, 348, 355,
683 362, 366, 370, 377, 392, 393, 397, 409, 409, 414,
684 414, 419, 430, 445, 446, 447, 451, 452, 457, 459,
685 464, 465, 470, 472, 477, 478, 482, 483, 484, 485,
686 490, 495, 500, 506, 512, 523, 524, 533, 534, 540,
687 541, 542, 549, 549, 557, 558, 559, 564, 566, 568,
688 570, 572, 574, 579, 581, 592, 593, 598, 599, 600,
689 609, 629, 631, 640, 645, 646, 651, 658, 660
693 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
694 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
695 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
696 static const char *const yytname
[] =
698 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
699 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
700 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
701 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
702 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
703 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
704 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
705 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
706 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
707 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
708 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
709 "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"", "\"=\"",
710 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
711 "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
712 "input", "prologue_declarations", "prologue_declaration",
713 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
714 "precedence_declaration", "precedence_declarator", "type.opt",
715 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
716 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
717 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
718 "named_ref.opt", "variable", "content.opt", "braceless", "id",
719 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
724 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
726 static const yytype_uint16 yytoknum
[] =
728 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
729 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
730 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
731 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
732 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
733 305, 306, 307, 308, 309, 310, 311, 312
737 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
738 static const yytype_uint8 yyr1
[] =
740 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
741 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
742 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
743 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
744 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
745 64, 64, 67, 68, 68, 68, 69, 69, 70, 70,
746 71, 71, 72, 72, 73, 73, 74, 74, 74, 74,
747 75, 75, 75, 75, 75, 76, 76, 77, 77, 78,
748 78, 78, 80, 79, 81, 81, 81, 82, 82, 82,
749 82, 82, 82, 83, 83, 84, 84, 85, 85, 85,
750 86, 87, 87, 88, 89, 89, 90, 91, 91
753 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
754 static const yytype_uint8 yyr2
[] =
756 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
757 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
758 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
759 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
760 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
761 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
762 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
763 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
764 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
765 3, 3, 3, 0, 1, 1, 1, 0, 1, 1,
766 1, 1, 1, 1, 1, 1, 1, 0, 2
769 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
770 Performed when YYTABLE doesn't specify something else to do. Zero
771 means the default is an error. */
772 static const yytype_uint8 yydefact
[] =
774 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
775 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
776 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
777 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
778 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
779 0, 0, 0, 100, 0, 42, 96, 95, 97, 10,
780 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
781 0, 27, 29, 30, 106, 102, 101, 104, 37, 105,
782 0, 103, 0, 0, 77, 79, 93, 45, 0, 57,
783 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
784 69, 38, 64, 66, 39, 43, 99, 98, 8, 15,
785 22, 26, 81, 80, 0, 78, 2, 94, 82, 46,
786 52, 58, 60, 76, 72, 73, 63, 65, 108, 87,
787 59, 61, 74, 83, 84, 87, 86, 0, 0, 0,
788 93, 93, 85, 90, 91, 92, 89, 88
791 /* YYDEFGOTO[NTERM-NUM]. */
792 static const yytype_int16 yydefgoto
[] =
794 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
795 47, 90, 120, 121, 96, 101, 102, 92, 93, 83,
796 84, 85, 129, 133, 134, 118, 58, 108, 55, 77,
800 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
802 #define YYPACT_NINF -91
803 static const yytype_int16 yypact
[] =
805 -91, 3, 103, -91, -91, -91, -36, 2, 10, -91,
806 -91, -91, 9, -91, -91, 32, 60, -91, 65, 67,
807 27, -91, 41, 73, 51, -91, 39, -91, -91, -91,
808 40, 52, -91, 93, 95, 33, -91, -91, -91, 15,
809 -91, -91, 53, -91, -91, -91, -91, 46, 43, 43,
810 33, 11, 11, -91, 61, -91, -91, -91, 35, -91,
811 -91, -91, -91, 100, -91, -91, -91, -91, 102, -91,
812 113, -91, -91, -91, -91, -91, -91, -91, -91, -91,
813 64, -91, 94, 1, -91, -91, 62, -91, 61, -91,
814 33, -91, -91, 43, 86, 43, 33, -91, -91, -91,
815 -91, 11, -91, -91, 11, -91, -91, -91, -91, -91,
816 -91, -91, -91, -91, 72, -91, -91, -91, -91, -91,
817 33, -91, 142, -91, 145, -91, -91, -91, -91, -91,
818 -91, -91, -91, 17, 34, -91, -91, 33, 146, 97,
819 62, 62, 34, -91, -91, -91, -91, -91
822 /* YYPGOTO[NTERM-NUM]. */
823 static const yytype_int16 yypgoto
[] =
825 -91, -91, -91, -91, 147, -91, -91, -91, -91, -91,
826 -91, -91, -91, 37, -91, 106, -60, -33, 105, -91,
827 69, -91, -91, -91, 24, -48, -91, -91, -49, -20,
831 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
832 positive, shift that token. If negative, reduce the rule which
833 number is the opposite. If YYTABLE_NINF, syntax error. */
834 #define YYTABLE_NINF -108
835 static const yytype_int16 yytable
[] =
837 78, -107, 80, 3, 125, 105, 4, 5, 6, 7,
838 8, 9, 10, 11, 74, 97, 80, 12, 50, 14,
839 4, 5, 6, 7, 8, 9, 10, 11, 94, 94,
840 62, 12, 27, 14, 132, 56, 74, 74, 106, 119,
841 35, 127, 67, 69, 127, 51, 27, 137, 138, 139,
842 81, 114, 53, 52, 35, 122, 75, 54, 42, 76,
843 123, 126, 123, 59, 81, 98, 99, 100, 135, 60,
844 136, 61, 42, 94, 63, 94, 65, 140, 75, 75,
845 57, 76, 76, 107, 64, 122, 68, 70, 75, 74,
846 124, 76, 146, 147, 66, 71, 72, 91, 73, 141,
847 89, 87, 143, 109, 53, 110, 117, 141, 4, 5,
848 6, 7, 8, 9, 10, 11, 111, 112, 128, 12,
849 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
850 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
851 33, 34, 35, 36, 37, 38, 131, 113, 74, 44,
852 144, 145, 115, 39, 95, 40, 41, 130, 104, 142,
856 #define yypact_value_is_default(yystate) \
859 #define yytable_value_is_error(yytable_value) \
862 static const yytype_uint8 yycheck
[] =
864 35, 0, 1, 0, 94, 54, 5, 6, 7, 8,
865 9, 10, 11, 12, 3, 50, 1, 16, 54, 18,
866 5, 6, 7, 8, 9, 10, 11, 12, 48, 49,
867 3, 16, 31, 18, 124, 3, 3, 3, 3, 88,
868 39, 101, 3, 3, 104, 43, 31, 13, 14, 15,
869 49, 50, 43, 43, 39, 90, 45, 48, 57, 48,
870 93, 96, 95, 3, 49, 54, 55, 56, 51, 4,
871 53, 4, 57, 93, 47, 95, 3, 43, 45, 45,
872 48, 48, 48, 48, 43, 120, 47, 47, 45, 3,
873 4, 48, 140, 141, 43, 43, 3, 54, 3, 134,
874 54, 48, 137, 3, 43, 3, 44, 142, 5, 6,
875 7, 8, 9, 10, 11, 12, 3, 53, 46, 16,
876 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
877 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
878 37, 38, 39, 40, 41, 42, 4, 53, 3, 2,
879 4, 54, 83, 50, 49, 52, 53, 120, 52, 135,
883 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
884 symbol of state STATE-NUM. */
885 static const yytype_uint8 yystos
[] =
887 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
888 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
889 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
890 34, 35, 36, 37, 38, 39, 40, 41, 42, 50,
891 52, 53, 57, 61, 62, 64, 67, 68, 66, 65,
892 54, 43, 43, 43, 48, 86, 3, 48, 84, 3,
893 4, 4, 3, 47, 43, 3, 43, 3, 47, 3,
894 47, 43, 3, 3, 3, 45, 48, 87, 89, 90,
895 1, 49, 62, 77, 78, 79, 88, 48, 63, 54,
896 69, 54, 75, 76, 87, 76, 72, 89, 54, 55,
897 56, 73, 74, 89, 73, 86, 3, 48, 85, 3,
898 3, 3, 53, 53, 50, 78, 91, 44, 83, 86,
899 70, 71, 89, 75, 4, 90, 89, 74, 46, 80,
900 71, 4, 90, 81, 82, 51, 53, 13, 14, 15,
901 43, 89, 82, 89, 4, 54, 83, 83
904 #define yyerrok (yyerrstatus = 0)
905 #define yyclearin (yychar = YYEMPTY)
909 #define YYACCEPT goto yyacceptlab
910 #define YYABORT goto yyabortlab
911 #define YYERROR goto yyerrorlab
914 /* Like YYERROR except do call yyerror. This remains here temporarily
915 to ease the transition to the new meaning of YYERROR, for GCC.
916 Once GCC version 2 has supplanted version 1, this can go. However,
917 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
918 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
921 #define YYFAIL goto yyerrlab
923 /* This is here to suppress warnings from the GCC cpp's
924 -Wunused-macros. Normally we don't worry about that warning, but
925 some users do, and we want to make it easy for users to remove
926 YYFAIL uses, which will produce warnings from Bison 2.5. */
929 #define YYRECOVERING() (!!yyerrstatus)
931 #define YYBACKUP(Token, Value) \
933 if (yychar == YYEMPTY) \
937 YYPOPSTACK (yylen); \
939 YY_LAC_DISCARD ("YYBACKUP"); \
944 yyerror (YY_("syntax error: cannot back up")); \
951 #define YYERRCODE 256
954 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
955 If N is 0, then set CURRENT to the empty location which ends
956 the previous symbol: RHS[0] (always defined). */
958 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
959 #ifndef YYLLOC_DEFAULT
960 # define YYLLOC_DEFAULT(Current, Rhs, N) \
964 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
965 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
966 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
967 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
971 (Current).first_line = (Current).last_line = \
972 YYRHSLOC (Rhs, 0).last_line; \
973 (Current).first_column = (Current).last_column = \
974 YYRHSLOC (Rhs, 0).last_column; \
980 /* YY_LOCATION_PRINT -- Print the location on the stream.
981 This macro was not mandated originally: define only if we know
982 we won't break user code: when these are the locations we know. */
984 #ifndef YY_LOCATION_PRINT
985 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
986 # define YY_LOCATION_PRINT(File, Loc) \
987 fprintf (File, "%d.%d-%d.%d", \
988 (Loc).first_line, (Loc).first_column, \
989 (Loc).last_line, (Loc).last_column)
991 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
996 /* YYLEX -- calling `yylex' with the right arguments. */
999 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1001 # define YYLEX yylex (&yylval, &yylloc)
1004 /* Enable debugging if requested. */
1008 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1009 # define YYFPRINTF fprintf
1012 # define YYDPRINTF(Args) \
1018 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1022 YYFPRINTF (stderr, "%s ", Title); \
1023 yy_symbol_print (stderr, \
1024 Type, Value, Location); \
1025 YYFPRINTF (stderr, "\n"); \
1030 /*--------------------------------.
1031 | Print this symbol on YYOUTPUT. |
1032 `--------------------------------*/
1035 #if (defined __STDC__ || defined __C99__FUNC__ \
1036 || defined __cplusplus || defined _MSC_VER)
1038 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1041 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1044 YYSTYPE
const * const yyvaluep
;
1045 YYLTYPE
const * const yylocationp
;
1048 FILE *yyo
= yyoutput
;
1052 YYUSE (yylocationp
);
1054 if (yytype
< YYNTOKENS
)
1055 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1061 case 3: /* "\"string\"" */
1063 /* Line 823 of yacc.c */
1064 #line 204 "parse-gram.y"
1065 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1067 /* Line 823 of yacc.c */
1068 #line 1069 "parse-gram.c"
1070 case 4: /* "\"integer\"" */
1072 /* Line 823 of yacc.c */
1073 #line 216 "parse-gram.y"
1074 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1076 /* Line 823 of yacc.c */
1077 #line 1078 "parse-gram.c"
1079 case 43: /* "\"{...}\"" */
1081 /* Line 823 of yacc.c */
1082 #line 206 "parse-gram.y"
1083 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1085 /* Line 823 of yacc.c */
1086 #line 1087 "parse-gram.c"
1088 case 44: /* "\"[identifier]\"" */
1090 /* Line 823 of yacc.c */
1091 #line 211 "parse-gram.y"
1092 { fprintf (stderr
, "[%s]", (yyvaluep
->uniqstr
)); };
1094 /* Line 823 of yacc.c */
1095 #line 1096 "parse-gram.c"
1097 case 45: /* "\"char\"" */
1099 /* Line 823 of yacc.c */
1100 #line 198 "parse-gram.y"
1101 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1103 /* Line 823 of yacc.c */
1104 #line 1105 "parse-gram.c"
1106 case 46: /* "\"epilogue\"" */
1108 /* Line 823 of yacc.c */
1109 #line 206 "parse-gram.y"
1110 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1112 /* Line 823 of yacc.c */
1113 #line 1114 "parse-gram.c"
1115 case 48: /* "\"identifier\"" */
1117 /* Line 823 of yacc.c */
1118 #line 210 "parse-gram.y"
1119 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1121 /* Line 823 of yacc.c */
1122 #line 1123 "parse-gram.c"
1124 case 49: /* "\"identifier:\"" */
1126 /* Line 823 of yacc.c */
1127 #line 212 "parse-gram.y"
1128 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1130 /* Line 823 of yacc.c */
1131 #line 1132 "parse-gram.c"
1133 case 52: /* "\"%{...%}\"" */
1135 /* Line 823 of yacc.c */
1136 #line 206 "parse-gram.y"
1137 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1139 /* Line 823 of yacc.c */
1140 #line 1141 "parse-gram.c"
1142 case 54: /* "\"type\"" */
1144 /* Line 823 of yacc.c */
1145 #line 213 "parse-gram.y"
1146 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1148 /* Line 823 of yacc.c */
1149 #line 1150 "parse-gram.c"
1151 case 71: /* "symbol.prec" */
1153 /* Line 823 of yacc.c */
1154 #line 219 "parse-gram.y"
1155 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1157 /* Line 823 of yacc.c */
1158 #line 1159 "parse-gram.c"
1160 case 84: /* "variable" */
1162 /* Line 823 of yacc.c */
1163 #line 210 "parse-gram.y"
1164 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1166 /* Line 823 of yacc.c */
1167 #line 1168 "parse-gram.c"
1169 case 85: /* "content.opt" */
1171 /* Line 823 of yacc.c */
1172 #line 206 "parse-gram.y"
1173 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1175 /* Line 823 of yacc.c */
1176 #line 1177 "parse-gram.c"
1178 case 86: /* "braceless" */
1180 /* Line 823 of yacc.c */
1181 #line 206 "parse-gram.y"
1182 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1184 /* Line 823 of yacc.c */
1185 #line 1186 "parse-gram.c"
1189 /* Line 823 of yacc.c */
1190 #line 219 "parse-gram.y"
1191 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1193 /* Line 823 of yacc.c */
1194 #line 1195 "parse-gram.c"
1196 case 88: /* "id_colon" */
1198 /* Line 823 of yacc.c */
1199 #line 220 "parse-gram.y"
1200 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1202 /* Line 823 of yacc.c */
1203 #line 1204 "parse-gram.c"
1205 case 89: /* "symbol" */
1207 /* Line 823 of yacc.c */
1208 #line 219 "parse-gram.y"
1209 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1211 /* Line 823 of yacc.c */
1212 #line 1213 "parse-gram.c"
1214 case 90: /* "string_as_id" */
1216 /* Line 823 of yacc.c */
1217 #line 219 "parse-gram.y"
1218 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1220 /* Line 823 of yacc.c */
1221 #line 1222 "parse-gram.c"
1229 /*--------------------------------.
1230 | Print this symbol on YYOUTPUT. |
1231 `--------------------------------*/
1233 #if (defined __STDC__ || defined __C99__FUNC__ \
1234 || defined __cplusplus || defined _MSC_VER)
1236 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1239 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1242 YYSTYPE
const * const yyvaluep
;
1243 YYLTYPE
const * const yylocationp
;
1246 if (yytype
< YYNTOKENS
)
1247 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1249 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1251 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1252 YYFPRINTF (yyoutput
, ": ");
1253 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1254 YYFPRINTF (yyoutput
, ")");
1257 /*------------------------------------------------------------------.
1258 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1260 `------------------------------------------------------------------*/
1262 #if (defined __STDC__ || defined __C99__FUNC__ \
1263 || defined __cplusplus || defined _MSC_VER)
1265 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1268 yy_stack_print (yybottom
, yytop
)
1269 yytype_int16
*yybottom
;
1270 yytype_int16
*yytop
;
1273 YYFPRINTF (stderr
, "Stack now");
1274 for (; yybottom
<= yytop
; yybottom
++)
1276 int yybot
= *yybottom
;
1277 YYFPRINTF (stderr
, " %d", yybot
);
1279 YYFPRINTF (stderr
, "\n");
1282 # define YY_STACK_PRINT(Bottom, Top) \
1285 yy_stack_print ((Bottom), (Top)); \
1289 /*------------------------------------------------.
1290 | Report that the YYRULE is going to be reduced. |
1291 `------------------------------------------------*/
1293 #if (defined __STDC__ || defined __C99__FUNC__ \
1294 || defined __cplusplus || defined _MSC_VER)
1296 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1299 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1305 int yynrhs
= yyr2
[yyrule
];
1307 unsigned long int yylno
= yyrline
[yyrule
];
1308 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1310 /* The symbols being reduced. */
1311 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1313 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1314 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1315 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1316 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1317 YYFPRINTF (stderr
, "\n");
1321 # define YY_REDUCE_PRINT(Rule) \
1324 yy_reduce_print (yyvsp, yylsp, Rule); \
1327 /* Nonzero means print parse trace. It is left uninitialized so that
1328 multiple parsers can coexist. */
1330 #else /* !YYDEBUG */
1331 # define YYDPRINTF(Args)
1332 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1333 # define YY_STACK_PRINT(Bottom, Top)
1334 # define YY_REDUCE_PRINT(Rule)
1335 #endif /* !YYDEBUG */
1338 /* YYINITDEPTH -- initial size of the parser's stacks. */
1340 # define YYINITDEPTH 200
1343 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1344 if the built-in stack extension method is used).
1346 Do not make this value too large; the results are undefined if
1347 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1348 evaluated with infinite-precision integer arithmetic. */
1351 # define YYMAXDEPTH 10000
1354 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1355 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1356 stack, and such that *YYCAPACITY is the maximum number of elements it
1357 can hold without a reallocation, make sure there is enough room to
1358 store YYADD more elements. If not, allocate a new stack using
1359 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1360 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1361 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1362 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1363 required. Return 1 if memory is exhausted. */
1365 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1367 char const *yydebug_prefix
,
1368 char const *yydebug_suffix
,
1370 yytype_int16
**yybottom
,
1371 yytype_int16
*yybottom_no_free
,
1372 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1374 YYSIZE_T yysize_old
=
1375 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1376 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1377 if (*yycapacity
< yysize_new
)
1379 YYSIZE_T yyalloc
= 2 * yysize_new
;
1380 yytype_int16
*yybottom_new
;
1381 /* Use YYMAXDEPTH for maximum stack size given that the stack
1382 should never need to grow larger than the main state stack
1383 needs to grow without LAC. */
1384 if (YYMAXDEPTH
< yysize_new
)
1386 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1390 if (YYMAXDEPTH
< yyalloc
)
1391 yyalloc
= YYMAXDEPTH
;
1393 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1396 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1400 if (*yytop
!= yytop_empty
)
1402 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1403 *yytop
= yybottom_new
+ (yysize_old
- 1);
1405 if (*yybottom
!= yybottom_no_free
)
1406 YYSTACK_FREE (*yybottom
);
1407 *yybottom
= yybottom_new
;
1408 *yycapacity
= yyalloc
;
1413 /* Establish the initial context for the current lookahead if no initial
1414 context is currently established.
1416 We define a context as a snapshot of the parser stacks. We define
1417 the initial context for a lookahead as the context in which the
1418 parser initially examines that lookahead in order to select a
1419 syntactic action. Thus, if the lookahead eventually proves
1420 syntactically unacceptable (possibly in a later context reached via a
1421 series of reductions), the initial context can be used to determine
1422 the exact set of tokens that would be syntactically acceptable in the
1423 lookahead's place. Moreover, it is the context after which any
1424 further semantic actions would be erroneous because they would be
1425 determined by a syntactically unacceptable token.
1427 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1428 performed in an inconsistent state (which, for the purposes of LAC,
1429 includes consistent states that don't know they're consistent because
1430 their default reductions have been disabled). Iff there is a
1431 lookahead token, it should also be invoked before reporting a syntax
1432 error. This latter case is for the sake of the debugging output.
1434 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1435 follows. If no initial context is currently established for the
1436 current lookahead, then check if that lookahead can eventually be
1437 shifted if syntactic actions continue from the current context.
1438 Report a syntax error if it cannot. */
1439 #define YY_LAC_ESTABLISH \
1441 if (!yy_lac_established) \
1443 YYDPRINTF ((stderr, \
1444 "LAC: initial context established for %s\n", \
1445 yytname[yytoken])); \
1446 yy_lac_established = 1; \
1448 int yy_lac_status = \
1449 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1450 if (yy_lac_status == 2) \
1451 goto yyexhaustedlab; \
1452 if (yy_lac_status == 1) \
1458 /* Discard any previous initial lookahead context because of Event,
1459 which may be a lookahead change or an invalidation of the currently
1460 established initial context for the current lookahead.
1462 The most common example of a lookahead change is a shift. An example
1463 of both cases is syntax error recovery. That is, a syntax error
1464 occurs when the lookahead is syntactically erroneous for the
1465 currently established initial context, so error recovery manipulates
1466 the parser stacks to try to find a new initial context in which the
1467 current lookahead is syntactically acceptable. If it fails to find
1468 such a context, it discards the lookahead. */
1470 # define YY_LAC_DISCARD(Event) \
1472 if (yy_lac_established) \
1475 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1477 yy_lac_established = 0; \
1481 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1484 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1485 eventually (after perhaps some reductions) be shifted, return 1 if
1486 not, or return 2 if memory is exhausted. As preconditions and
1487 postconditions: *YYES_CAPACITY is the allocated size of the array to
1488 which *YYES points, and either *YYES = YYESA or *YYES points to an
1489 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1490 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1491 any old *YYES other than YYESA. */
1493 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1494 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1496 yytype_int16
*yyes_prev
= yyssp
;
1497 yytype_int16
*yyesp
= yyes_prev
;
1498 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1499 if (yytoken
== YYUNDEFTOK
)
1501 YYDPRINTF ((stderr
, " Always Err\n"));
1506 int yyrule
= yypact
[*yyesp
];
1507 if (yypact_value_is_default (yyrule
)
1508 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1509 || yycheck
[yyrule
] != yytoken
)
1511 yyrule
= yydefact
[*yyesp
];
1514 YYDPRINTF ((stderr
, " Err\n"));
1520 yyrule
= yytable
[yyrule
];
1521 if (yytable_value_is_error (yyrule
))
1523 YYDPRINTF ((stderr
, " Err\n"));
1528 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1534 YYSIZE_T yylen
= yyr2
[yyrule
];
1535 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1536 if (yyesp
!= yyes_prev
)
1538 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1551 yyesp
= yyes_prev
-= yylen
;
1556 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1557 yystate
= yypgoto
[yylhs
] + *yyesp
;
1558 if (yystate
< 0 || YYLAST
< yystate
1559 || yycheck
[yystate
] != *yyesp
)
1560 yystate
= yydefgoto
[yylhs
];
1562 yystate
= yytable
[yystate
];
1564 if (yyesp
== yyes_prev
)
1571 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1575 yyes
, yyesa
, &yyesp
, yyes_prev
))
1577 YYDPRINTF ((stderr
, "\n"));
1582 YYDPRINTF ((stderr
, " G%d", yystate
));
1591 # if defined __GLIBC__ && defined _STRING_H
1592 # define yystrlen strlen
1594 /* Return the length of YYSTR. */
1595 #if (defined __STDC__ || defined __C99__FUNC__ \
1596 || defined __cplusplus || defined _MSC_VER)
1598 yystrlen (const char *yystr
)
1606 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1614 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1615 # define yystpcpy stpcpy
1617 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1619 #if (defined __STDC__ || defined __C99__FUNC__ \
1620 || defined __cplusplus || defined _MSC_VER)
1622 yystpcpy (char *yydest
, const char *yysrc
)
1625 yystpcpy (yydest
, yysrc
)
1631 const char *yys
= yysrc
;
1633 while ((*yyd
++ = *yys
++) != '\0')
1642 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1643 quotes and backslashes, so that it's suitable for yyerror. The
1644 heuristic is that double-quoting is unnecessary unless the string
1645 contains an apostrophe, a comma, or backslash (other than
1646 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1647 null, do not copy; instead, return the length of what the result
1650 yytnamerr (char *yyres
, const char *yystr
)
1655 char const *yyp
= yystr
;
1662 goto do_not_strip_quotes
;
1666 goto do_not_strip_quotes
;
1679 do_not_strip_quotes
: ;
1683 return yystrlen (yystr
);
1685 return yystpcpy (yyres
, yystr
) - yyres
;
1689 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1690 about the unexpected token YYTOKEN for the state stack whose top is
1691 YYSSP. In order to see if a particular token T is a
1692 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1694 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1695 not large enough to hold the message. In that case, also set
1696 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1697 required number of bytes is too large to store or if
1698 yy_lac returned 2. */
1700 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1701 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1702 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1704 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1705 YYSIZE_T yysize
= yysize0
;
1707 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1708 /* Internationalized format string. */
1709 const char *yyformat
= YY_NULL
;
1710 /* Arguments of yyformat. */
1711 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1712 /* Number of reported tokens (one for the "unexpected", one per
1716 /* There are many possibilities here to consider:
1717 - Assume YYFAIL is not used. It's too flawed to consider. See
1718 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1719 for details. YYERROR is fine as it does not invoke this
1721 - If this state is a consistent state with a default action, then
1722 the only way this function was invoked is if the default action
1723 is an error action. In that case, don't check for expected
1724 tokens because there are none.
1725 - The only way there can be no lookahead present (in yychar) is if
1726 this state is a consistent state with a default action. Thus,
1727 detecting the absence of a lookahead is sufficient to determine
1728 that there is no unexpected or expected token to report. In that
1729 case, just report a simple "syntax error".
1730 - Don't assume there isn't a lookahead just because this state is a
1731 consistent state with a default action. There might have been a
1732 previous inconsistent state, consistent state with a non-default
1733 action, or user semantic action that manipulated yychar.
1734 In the first two cases, it might appear that the current syntax
1735 error should have been detected in the previous state when yy_lac
1736 was invoked. However, at that time, there might have been a
1737 different syntax error that discarded a different initial context
1738 during error recovery, leaving behind the current lookahead.
1740 if (yytoken
!= YYEMPTY
)
1742 int yyn
= yypact
[*yyssp
];
1743 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1744 yyarg
[yycount
++] = yytname
[yytoken
];
1745 if (!yypact_value_is_default (yyn
))
1749 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1750 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1753 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1755 if (yy_lac_status
== 2)
1757 if (yy_lac_status
== 1)
1760 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1766 yyarg
[yycount
++] = yytname
[yyx
];
1767 yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1768 if (! (yysize
<= yysize1
1769 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1776 YYFPRINTF (stderr
, "No expected tokens.\n");
1782 # define YYCASE_(N, S) \
1786 YYCASE_(0, YY_("syntax error"));
1787 YYCASE_(1, YY_("syntax error, unexpected %s"));
1788 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1789 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1790 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1791 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1795 yysize1
= yysize
+ yystrlen (yyformat
);
1796 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1800 if (*yymsg_alloc
< yysize
)
1802 *yymsg_alloc
= 2 * yysize
;
1803 if (! (yysize
<= *yymsg_alloc
1804 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1805 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1809 /* Avoid sprintf, as that infringes on the user's name space.
1810 Don't have undefined behavior even if the translation
1811 produced a string with the wrong number of "%s"s. */
1815 while ((*yyp
= *yyformat
) != '\0')
1816 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1818 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1829 #endif /* YYERROR_VERBOSE */
1831 /*-----------------------------------------------.
1832 | Release the memory associated to this symbol. |
1833 `-----------------------------------------------*/
1836 #if (defined __STDC__ || defined __C99__FUNC__ \
1837 || defined __cplusplus || defined _MSC_VER)
1839 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1842 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1846 YYLTYPE
*yylocationp
;
1850 YYUSE (yylocationp
);
1854 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1865 /* Prevent warnings from -Wmissing-prototypes. */
1866 #ifdef YYPARSE_PARAM
1867 #if defined __STDC__ || defined __cplusplus
1868 int yyparse (void *YYPARSE_PARAM
);
1872 #else /* ! YYPARSE_PARAM */
1873 #if defined __STDC__ || defined __cplusplus
1878 #endif /* ! YYPARSE_PARAM */
1885 #ifdef YYPARSE_PARAM
1886 #if (defined __STDC__ || defined __C99__FUNC__ \
1887 || defined __cplusplus || defined _MSC_VER)
1889 yyparse (void *YYPARSE_PARAM
)
1892 yyparse (YYPARSE_PARAM
)
1893 void *YYPARSE_PARAM
;
1895 #else /* ! YYPARSE_PARAM */
1896 #if (defined __STDC__ || defined __C99__FUNC__ \
1897 || defined __cplusplus || defined _MSC_VER)
1907 /* The lookahead symbol. */
1910 /* The semantic value of the lookahead symbol. */
1913 /* Location data for the lookahead symbol. */
1916 /* Number of syntax errors so far. */
1920 /* Number of tokens to shift before error messages enabled. */
1923 /* The stacks and their tools:
1924 `yyss': related to states.
1925 `yyvs': related to semantic values.
1926 `yyls': related to locations.
1928 Refer to the stacks thru separate pointers, to allow yyoverflow
1929 to reallocate them elsewhere. */
1931 /* The state stack. */
1932 yytype_int16 yyssa
[YYINITDEPTH
];
1934 yytype_int16
*yyssp
;
1936 /* The semantic value stack. */
1937 YYSTYPE yyvsa
[YYINITDEPTH
];
1941 /* The location stack. */
1942 YYLTYPE yylsa
[YYINITDEPTH
];
1946 /* The locations where the error started and ended. */
1947 YYLTYPE yyerror_range
[3];
1949 YYSIZE_T yystacksize
;
1951 yytype_int16 yyesa
[20];
1953 YYSIZE_T yyes_capacity
;
1955 int yy_lac_established
= 0;
1958 /* Lookahead token as an internal (translated) token number. */
1960 /* The variables used to return semantic value and location from the
1966 /* Buffer for error messages, and its allocated size. */
1968 char *yymsg
= yymsgbuf
;
1969 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1972 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1974 /* The number of symbols on the RHS of the reduced rule.
1975 Keep to zero when no symbol should be popped. */
1982 yystacksize
= YYINITDEPTH
;
1985 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1986 if (YYMAXDEPTH
< yyes_capacity
)
1987 yyes_capacity
= YYMAXDEPTH
;
1989 YYDPRINTF ((stderr
, "Starting parse\n"));
1994 yychar
= YYEMPTY
; /* Cause a token to be read. */
1996 /* Initialize stack pointers.
1997 Waste one element of value and location stack
1998 so that they stay on the same level as the state stack.
1999 The wasted elements are never initialized. */
2004 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2005 /* Initialize the default location before parsing starts. */
2006 yylloc
.first_line
= yylloc
.last_line
= 1;
2007 yylloc
.first_column
= yylloc
.last_column
= 1;
2010 /* User initialization code. */
2012 /* Line 1594 of yacc.c */
2013 #line 106 "parse-gram.y"
2015 /* Bison's grammar can initial empty locations, hence a default
2016 location is needed. */
2017 boundary_set (&yylloc
.start
, current_file
, 1, 1);
2018 boundary_set (&yylloc
.end
, current_file
, 1, 1);
2021 /* Line 1594 of yacc.c */
2022 #line 2023 "parse-gram.c"
2027 /*------------------------------------------------------------.
2028 | yynewstate -- Push a new state, which is found in yystate. |
2029 `------------------------------------------------------------*/
2031 /* In all cases, when you get here, the value and location stacks
2032 have just been pushed. So pushing a state here evens the stacks. */
2038 if (yyss
+ yystacksize
- 1 <= yyssp
)
2040 /* Get the current used size of the three stacks, in elements. */
2041 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2045 /* Give user a chance to reallocate the stack. Use copies of
2046 these so that the &'s don't force the real ones into
2048 YYSTYPE
*yyvs1
= yyvs
;
2049 yytype_int16
*yyss1
= yyss
;
2050 YYLTYPE
*yyls1
= yyls
;
2052 /* Each stack pointer address is followed by the size of the
2053 data in use in that stack, in bytes. This used to be a
2054 conditional around just the two extra args, but that might
2055 be undefined if yyoverflow is a macro. */
2056 yyoverflow (YY_("memory exhausted"),
2057 &yyss1
, yysize
* sizeof (*yyssp
),
2058 &yyvs1
, yysize
* sizeof (*yyvsp
),
2059 &yyls1
, yysize
* sizeof (*yylsp
),
2066 #else /* no yyoverflow */
2067 # ifndef YYSTACK_RELOCATE
2068 goto yyexhaustedlab
;
2070 /* Extend the stack our own way. */
2071 if (YYMAXDEPTH
<= yystacksize
)
2072 goto yyexhaustedlab
;
2074 if (YYMAXDEPTH
< yystacksize
)
2075 yystacksize
= YYMAXDEPTH
;
2078 yytype_int16
*yyss1
= yyss
;
2079 union yyalloc
*yyptr
=
2080 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2082 goto yyexhaustedlab
;
2083 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2084 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2085 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2086 # undef YYSTACK_RELOCATE
2088 YYSTACK_FREE (yyss1
);
2091 #endif /* no yyoverflow */
2093 yyssp
= yyss
+ yysize
- 1;
2094 yyvsp
= yyvs
+ yysize
- 1;
2095 yylsp
= yyls
+ yysize
- 1;
2097 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2098 (unsigned long int) yystacksize
));
2100 if (yyss
+ yystacksize
- 1 <= yyssp
)
2104 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2106 if (yystate
== YYFINAL
)
2116 /* Do appropriate processing given the current state. Read a
2117 lookahead token if we need one and don't already have one. */
2119 /* First try to decide what to do without reference to lookahead token. */
2120 yyn
= yypact
[yystate
];
2121 if (yypact_value_is_default (yyn
))
2124 /* Not known => get a lookahead token if don't already have one. */
2126 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2127 if (yychar
== YYEMPTY
)
2129 YYDPRINTF ((stderr
, "Reading a token: "));
2133 if (yychar
<= YYEOF
)
2135 yychar
= yytoken
= YYEOF
;
2136 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2140 yytoken
= YYTRANSLATE (yychar
);
2141 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2144 /* If the proper action on seeing token YYTOKEN is to reduce or to
2145 detect an error, take that action. */
2147 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2155 if (yytable_value_is_error (yyn
))
2162 /* Count tokens shifted since error; after three, turn off error
2167 /* Shift the lookahead token. */
2168 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2170 /* Discard the shifted token. */
2172 YY_LAC_DISCARD ("shift");
2180 /*-----------------------------------------------------------.
2181 | yydefault -- do the default action for the current state. |
2182 `-----------------------------------------------------------*/
2184 yyn
= yydefact
[yystate
];
2190 /*-----------------------------.
2191 | yyreduce -- Do a reduction. |
2192 `-----------------------------*/
2194 /* yyn is the number of a rule to reduce with. */
2197 /* If YYLEN is nonzero, implement the default value of the action:
2200 Otherwise, the following line sets YYVAL to garbage.
2201 This behavior is undocumented and Bison
2202 users should not rely upon it. Assigning to YYVAL
2203 unconditionally makes the parser a bit smaller, and it avoids a
2204 GCC warning that YYVAL may be used uninitialized. */
2205 yyval
= yyvsp
[1-yylen
];
2207 /* Default location. */
2208 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2209 YY_REDUCE_PRINT (yyn
);
2211 int yychar_backup
= yychar
;
2216 /* Line 1810 of yacc.c */
2217 #line 245 "parse-gram.y"
2219 code_props plain_code
;
2220 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
2221 code_props_translate_code (&plain_code
);
2222 gram_scanner_last_string_free ();
2223 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2224 plain_code
.code
, (yylsp
[(1) - (1)]));
2225 code_scanner_last_string_free ();
2231 /* Line 1810 of yacc.c */
2232 #line 254 "parse-gram.y"
2233 { debug_flag
= true; }
2238 /* Line 1810 of yacc.c */
2239 #line 256 "parse-gram.y"
2241 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
),
2242 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2248 /* Line 1810 of yacc.c */
2249 #line 260 "parse-gram.y"
2250 { defines_flag
= true; }
2255 /* Line 1810 of yacc.c */
2256 #line 262 "parse-gram.y"
2258 defines_flag
= true;
2259 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
2265 /* Line 1810 of yacc.c */
2266 #line 266 "parse-gram.y"
2267 { error_verbose
= true; }
2272 /* Line 1810 of yacc.c */
2273 #line 267 "parse-gram.y"
2274 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2279 /* Line 1810 of yacc.c */
2280 #line 268 "parse-gram.y"
2281 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2286 /* Line 1810 of yacc.c */
2287 #line 269 "parse-gram.y"
2288 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
2293 /* Line 1810 of yacc.c */
2294 #line 270 "parse-gram.y"
2295 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
2300 /* Line 1810 of yacc.c */
2301 #line 272 "parse-gram.y"
2303 nondeterministic_parser
= true;
2310 /* Line 1810 of yacc.c */
2311 #line 277 "parse-gram.y"
2314 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
2315 code_props_translate_code (&action
);
2316 gram_scanner_last_string_free ();
2317 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2318 code_scanner_last_string_free ();
2324 /* Line 1810 of yacc.c */
2325 #line 285 "parse-gram.y"
2326 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, (yylsp
[(1) - (2)])); }
2331 /* Line 1810 of yacc.c */
2332 #line 286 "parse-gram.y"
2333 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2338 /* Line 1810 of yacc.c */
2339 #line 287 "parse-gram.y"
2340 { locations_flag
= true; }
2345 /* Line 1810 of yacc.c */
2346 #line 288 "parse-gram.y"
2347 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2352 /* Line 1810 of yacc.c */
2353 #line 289 "parse-gram.y"
2354 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2359 /* Line 1810 of yacc.c */
2360 #line 290 "parse-gram.y"
2361 { no_lines_flag
= true; }
2366 /* Line 1810 of yacc.c */
2367 #line 291 "parse-gram.y"
2368 { nondeterministic_parser
= true; }
2373 /* Line 1810 of yacc.c */
2374 #line 292 "parse-gram.y"
2375 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2380 /* Line 1810 of yacc.c */
2381 #line 293 "parse-gram.y"
2382 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2387 /* Line 1810 of yacc.c */
2388 #line 294 "parse-gram.y"
2389 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2394 /* Line 1810 of yacc.c */
2395 #line 296 "parse-gram.y"
2397 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2398 `%define api.pure' in a backward-compatible manner here. First, don't
2399 complain if %pure-parser is specified multiple times. */
2400 if (!muscle_find_const ("percent_define(api.pure)"))
2401 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2402 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2403 /* In all cases, use api.pure now so that the backend doesn't complain if
2404 the skeleton ignores api.pure, but do warn now if there's a previous
2405 conflicting definition from an actual %define. */
2406 if (!muscle_percent_define_flag_if ("api.pure"))
2407 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2408 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2414 /* Line 1810 of yacc.c */
2415 #line 310 "parse-gram.y"
2416 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2421 /* Line 1810 of yacc.c */
2422 #line 312 "parse-gram.y"
2424 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2425 if (mbschr (skeleton_user
, '/'))
2427 size_t dir_length
= strlen (current_file
);
2428 char *skeleton_build
;
2429 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2431 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2434 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2437 memcpy (skeleton_build
, current_file
, dir_length
);
2438 skeleton_build
[dir_length
++] = '/';
2440 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2441 skeleton_user
= uniqstr_new (skeleton_build
);
2442 free (skeleton_build
);
2444 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[(1) - (2)]));
2450 /* Line 1810 of yacc.c */
2451 #line 335 "parse-gram.y"
2452 { token_table_flag
= true; }
2457 /* Line 1810 of yacc.c */
2458 #line 336 "parse-gram.y"
2459 { report_flag
|= report_states
; }
2464 /* Line 1810 of yacc.c */
2465 #line 337 "parse-gram.y"
2466 { yacc_flag
= true; }
2471 /* Line 1810 of yacc.c */
2472 #line 345 "parse-gram.y"
2474 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2480 /* Line 1810 of yacc.c */
2481 #line 349 "parse-gram.y"
2484 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2485 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2486 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2492 /* Line 1810 of yacc.c */
2493 #line 356 "parse-gram.y"
2496 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2497 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2498 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2504 /* Line 1810 of yacc.c */
2505 #line 363 "parse-gram.y"
2507 default_prec
= true;
2513 /* Line 1810 of yacc.c */
2514 #line 367 "parse-gram.y"
2516 default_prec
= false;
2522 /* Line 1810 of yacc.c */
2523 #line 371 "parse-gram.y"
2525 /* Do not invoke muscle_percent_code_grow here since it invokes
2526 muscle_user_name_list_grow. */
2527 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2528 code_scanner_last_string_free ();
2534 /* Line 1810 of yacc.c */
2535 #line 378 "parse-gram.y"
2537 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2538 code_scanner_last_string_free ();
2544 /* Line 1810 of yacc.c */
2545 #line 392 "parse-gram.y"
2551 /* Line 1810 of yacc.c */
2552 #line 393 "parse-gram.y"
2553 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2558 /* Line 1810 of yacc.c */
2559 #line 398 "parse-gram.y"
2562 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2563 code_scanner_last_string_free ();
2569 /* Line 1810 of yacc.c */
2570 #line 409 "parse-gram.y"
2571 { current_class
= nterm_sym
; }
2576 /* Line 1810 of yacc.c */
2577 #line 410 "parse-gram.y"
2579 current_class
= unknown_sym
;
2580 current_type
= NULL
;
2586 /* Line 1810 of yacc.c */
2587 #line 414 "parse-gram.y"
2588 { current_class
= token_sym
; }
2593 /* Line 1810 of yacc.c */
2594 #line 415 "parse-gram.y"
2596 current_class
= unknown_sym
;
2597 current_type
= NULL
;
2603 /* Line 1810 of yacc.c */
2604 #line 420 "parse-gram.y"
2608 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2609 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2610 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2616 /* Line 1810 of yacc.c */
2617 #line 431 "parse-gram.y"
2621 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2623 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2624 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2626 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2627 current_type
= NULL
;
2633 /* Line 1810 of yacc.c */
2634 #line 445 "parse-gram.y"
2635 { (yyval
.assoc
) = left_assoc
; }
2640 /* Line 1810 of yacc.c */
2641 #line 446 "parse-gram.y"
2642 { (yyval
.assoc
) = right_assoc
; }
2647 /* Line 1810 of yacc.c */
2648 #line 447 "parse-gram.y"
2649 { (yyval
.assoc
) = non_assoc
; }
2654 /* Line 1810 of yacc.c */
2655 #line 451 "parse-gram.y"
2656 { current_type
= NULL
; }
2661 /* Line 1810 of yacc.c */
2662 #line 452 "parse-gram.y"
2663 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2668 /* Line 1810 of yacc.c */
2669 #line 458 "parse-gram.y"
2670 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2675 /* Line 1810 of yacc.c */
2676 #line 460 "parse-gram.y"
2677 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2682 /* Line 1810 of yacc.c */
2683 #line 464 "parse-gram.y"
2684 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2689 /* Line 1810 of yacc.c */
2690 #line 465 "parse-gram.y"
2691 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2696 /* Line 1810 of yacc.c */
2697 #line 471 "parse-gram.y"
2698 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2703 /* Line 1810 of yacc.c */
2704 #line 473 "parse-gram.y"
2705 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2710 /* Line 1810 of yacc.c */
2711 #line 477 "parse-gram.y"
2712 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2717 /* Line 1810 of yacc.c */
2718 #line 478 "parse-gram.y"
2719 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2724 /* Line 1810 of yacc.c */
2725 #line 482 "parse-gram.y"
2726 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2731 /* Line 1810 of yacc.c */
2732 #line 483 "parse-gram.y"
2733 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2738 /* Line 1810 of yacc.c */
2739 #line 484 "parse-gram.y"
2740 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2745 /* Line 1810 of yacc.c */
2746 #line 485 "parse-gram.y"
2747 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2752 /* Line 1810 of yacc.c */
2753 #line 491 "parse-gram.y"
2755 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2762 /* Line 1810 of yacc.c */
2763 #line 496 "parse-gram.y"
2765 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2766 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2772 /* Line 1810 of yacc.c */
2773 #line 501 "parse-gram.y"
2775 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2776 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2777 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2783 /* Line 1810 of yacc.c */
2784 #line 507 "parse-gram.y"
2786 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2787 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2788 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2794 /* Line 1810 of yacc.c */
2795 #line 513 "parse-gram.y"
2797 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2798 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2799 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2800 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2806 /* Line 1810 of yacc.c */
2807 #line 543 "parse-gram.y"
2815 /* Line 1810 of yacc.c */
2816 #line 549 "parse-gram.y"
2817 { current_lhs ((yyvsp
[(1) - (2)].symbol
), (yylsp
[(1) - (2)]), (yyvsp
[(2) - (2)].named_ref
)); }
2822 /* Line 1810 of yacc.c */
2823 #line 550 "parse-gram.y"
2825 /* Free the current lhs. */
2826 current_lhs (0, (yylsp
[(1) - (4)]), 0);
2832 /* Line 1810 of yacc.c */
2833 #line 557 "parse-gram.y"
2834 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2839 /* Line 1810 of yacc.c */
2840 #line 558 "parse-gram.y"
2841 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2846 /* Line 1810 of yacc.c */
2847 #line 564 "parse-gram.y"
2848 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2849 current_lhs_named_ref
); }
2854 /* Line 1810 of yacc.c */
2855 #line 567 "parse-gram.y"
2856 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (3)].symbol
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2861 /* Line 1810 of yacc.c */
2862 #line 569 "parse-gram.y"
2863 { grammar_current_rule_action_append ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2868 /* Line 1810 of yacc.c */
2869 #line 571 "parse-gram.y"
2870 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2875 /* Line 1810 of yacc.c */
2876 #line 573 "parse-gram.y"
2877 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2882 /* Line 1810 of yacc.c */
2883 #line 575 "parse-gram.y"
2884 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2889 /* Line 1810 of yacc.c */
2890 #line 579 "parse-gram.y"
2891 { (yyval
.named_ref
) = 0; }
2896 /* Line 1810 of yacc.c */
2897 #line 581 "parse-gram.y"
2898 { (yyval
.named_ref
) = named_ref_new((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2903 /* Line 1810 of yacc.c */
2904 #line 593 "parse-gram.y"
2905 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2910 /* Line 1810 of yacc.c */
2911 #line 598 "parse-gram.y"
2912 { (yyval
.chars
) = ""; }
2917 /* Line 1810 of yacc.c */
2918 #line 599 "parse-gram.y"
2919 { (yyval
.chars
) = (yyvsp
[(1) - (1)].uniqstr
); }
2924 /* Line 1810 of yacc.c */
2925 #line 610 "parse-gram.y"
2927 code_props plain_code
;
2928 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2929 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2930 code_props_translate_code (&plain_code
);
2931 gram_scanner_last_string_free ();
2932 (yyval
.chars
) = plain_code
.code
;
2938 /* Line 1810 of yacc.c */
2939 #line 630 "parse-gram.y"
2940 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2945 /* Line 1810 of yacc.c */
2946 #line 632 "parse-gram.y"
2948 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2949 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2950 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2956 /* Line 1810 of yacc.c */
2957 #line 640 "parse-gram.y"
2958 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2963 /* Line 1810 of yacc.c */
2964 #line 652 "parse-gram.y"
2966 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2967 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2973 /* Line 1810 of yacc.c */
2974 #line 661 "parse-gram.y"
2976 code_props plain_code
;
2977 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2978 code_props_translate_code (&plain_code
);
2979 gram_scanner_last_string_free ();
2980 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2981 code_scanner_last_string_free ();
2987 /* Line 1810 of yacc.c */
2988 #line 2989 "parse-gram.c"
2991 if (yychar_backup
!= yychar
)
2992 YY_LAC_DISCARD ("yychar change");
2994 /* User semantic actions sometimes alter yychar, and that requires
2995 that yytoken be updated with the new translation. We take the
2996 approach of translating immediately before every use of yytoken.
2997 One alternative is translating here after every semantic action,
2998 but that translation would be missed if the semantic action invokes
2999 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3000 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3001 incorrect destructor might then be invoked immediately. In the
3002 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3003 to an incorrect destructor call or verbose syntax error message
3004 before the lookahead is translated. */
3005 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3009 YY_STACK_PRINT (yyss
, yyssp
);
3014 /* Now `shift' the result of the reduction. Determine what state
3015 that goes to, based on the state we popped back to and the rule
3016 number reduced by. */
3020 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3021 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3022 yystate
= yytable
[yystate
];
3024 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3029 /*------------------------------------.
3030 | yyerrlab -- here on detecting error |
3031 `------------------------------------*/
3033 /* Make sure we have latest lookahead translation. See comments at
3034 user semantic actions for why this is necessary. */
3035 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3037 /* If not already recovering from an error, report this error. */
3041 #if ! YYERROR_VERBOSE
3042 yyerror (YY_("syntax error"));
3044 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3045 yyesa, &yyes, &yyes_capacity, \
3048 char const *yymsgp
= YY_("syntax error");
3049 int yysyntax_error_status
;
3050 if (yychar
!= YYEMPTY
)
3052 yysyntax_error_status
= YYSYNTAX_ERROR
;
3053 if (yysyntax_error_status
== 0)
3055 else if (yysyntax_error_status
== 1)
3057 if (yymsg
!= yymsgbuf
)
3058 YYSTACK_FREE (yymsg
);
3059 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3063 yymsg_alloc
= sizeof yymsgbuf
;
3064 yysyntax_error_status
= 2;
3068 yysyntax_error_status
= YYSYNTAX_ERROR
;
3073 if (yysyntax_error_status
== 2)
3074 goto yyexhaustedlab
;
3076 # undef YYSYNTAX_ERROR
3080 yyerror_range
[1] = yylloc
;
3082 if (yyerrstatus
== 3)
3084 /* If just tried and failed to reuse lookahead token after an
3085 error, discard it. */
3087 if (yychar
<= YYEOF
)
3089 /* Return failure if at end of input. */
3090 if (yychar
== YYEOF
)
3095 yydestruct ("Error: discarding",
3096 yytoken
, &yylval
, &yylloc
);
3101 /* Else will try to reuse lookahead token after shifting the error
3106 /*---------------------------------------------------.
3107 | yyerrorlab -- error raised explicitly by YYERROR. |
3108 `---------------------------------------------------*/
3111 /* Pacify compilers like GCC when the user code never invokes
3112 YYERROR and the label yyerrorlab therefore never appears in user
3114 if (/*CONSTCOND*/ 0)
3117 yyerror_range
[1] = yylsp
[1-yylen
];
3118 /* Do not reclaim the symbols of the rule which action triggered
3122 YY_STACK_PRINT (yyss
, yyssp
);
3127 /*-------------------------------------------------------------.
3128 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3129 `-------------------------------------------------------------*/
3131 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3135 yyn
= yypact
[yystate
];
3136 if (!yypact_value_is_default (yyn
))
3139 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3147 /* Pop the current state because it cannot handle the error token. */
3151 yyerror_range
[1] = *yylsp
;
3152 yydestruct ("Error: popping",
3153 yystos
[yystate
], yyvsp
, yylsp
);
3156 YY_STACK_PRINT (yyss
, yyssp
);
3159 /* If the stack popping above didn't lose the initial context for the
3160 current lookahead token, the shift below will for sure. */
3161 YY_LAC_DISCARD ("error recovery");
3165 yyerror_range
[2] = yylloc
;
3166 /* Using YYLLOC is tempting, but would change the location of
3167 the lookahead. YYLOC is available though. */
3168 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3171 /* Shift the error token. */
3172 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3178 /*-------------------------------------.
3179 | yyacceptlab -- YYACCEPT comes here. |
3180 `-------------------------------------*/
3185 /*-----------------------------------.
3186 | yyabortlab -- YYABORT comes here. |
3187 `-----------------------------------*/
3193 /*-------------------------------------------------.
3194 | yyexhaustedlab -- memory exhaustion comes here. |
3195 `-------------------------------------------------*/
3197 yyerror (YY_("memory exhausted"));
3203 if (yychar
!= YYEMPTY
)
3205 /* Make sure we have latest lookahead translation. See comments at
3206 user semantic actions for why this is necessary. */
3207 yytoken
= YYTRANSLATE (yychar
);
3208 yydestruct ("Cleanup: discarding lookahead",
3209 yytoken
, &yylval
, &yylloc
);
3211 /* Do not reclaim the symbols of the rule which action triggered
3212 this YYABORT or YYACCEPT. */
3214 YY_STACK_PRINT (yyss
, yyssp
);
3215 while (yyssp
!= yyss
)
3217 yydestruct ("Cleanup: popping",
3218 yystos
[*yyssp
], yyvsp
, yylsp
);
3223 YYSTACK_FREE (yyss
);
3226 YYSTACK_FREE (yyes
);
3228 if (yymsg
!= yymsgbuf
)
3229 YYSTACK_FREE (yymsg
);
3231 /* Make sure YYID is used. */
3232 return YYID (yyresult
);
3237 /* Line 2071 of yacc.c */
3238 #line 671 "parse-gram.y"
3242 /* Return the location of the left-hand side of a rule whose
3243 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3244 the right-hand side, and return an empty location equal to the end
3245 boundary of RHS[0] if the right-hand side is empty. */
3248 lloc_default (YYLTYPE
const *rhs
, int n
)
3253 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3254 The bug is fixed in 7.4.2m, but play it safe for now. */
3255 loc
.start
= rhs
[n
].end
;
3256 loc
.end
= rhs
[n
].end
;
3258 /* Ignore empty nonterminals the start of the right-hand side.
3259 Do not bother to ignore them at the end of the right-hand side,
3260 since empty nonterminals have the same end as their predecessors. */
3261 for (i
= 1; i
<= n
; i
++)
3262 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3264 loc
.start
= rhs
[i
].start
;
3272 /* Add a lex-param or a parse-param (depending on TYPE) with
3273 declaration DECL and location LOC. */
3276 add_param (char const *type
, char *decl
, location loc
)
3278 static char const alphanum
[26 + 26 + 1 + 10] =
3279 "abcdefghijklmnopqrstuvwxyz"
3280 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3283 char const *name_start
= NULL
;
3286 /* Stop on last actual character. */
3287 for (p
= decl
; p
[1]; p
++)
3289 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3290 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3293 /* Strip the surrounding '{' and '}', and any blanks just inside
3295 while (*--p
== ' ' || *p
== '\t')
3298 while (*++decl
== ' ' || *decl
== '\t')
3302 complain_at (loc
, _("missing identifier in parameter declaration"));
3305 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3306 muscle_pair_list_grow (type
, decl
, name
);
3310 gram_scanner_last_string_free ();
3315 version_check (location
const *loc
, char const *version
)
3317 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3319 complain_at (*loc
, "require bison %s, but have %s",
3320 version
, PACKAGE_VERSION
);
3326 gram_error (location
const *loc
, char const *msg
)
3328 complain_at (*loc
, "%s", msg
);
3332 token_name (int type
)
3334 return yytname
[YYTRANSLATE (type
)];
3345 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3346 return quotearg_style (escape_quoting_style
, buf
);