1 /* A Bison parser, made by GNU Bison 2.5.118-ae42b. */
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.118-ae42b"
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"
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_symbol
;
142 static location current_lhs_location
;
143 static named_ref
*current_lhs_named_ref
;
144 static int current_prec
= 0;
146 /** Set the new current left-hand side symbol, possibly common
147 * to several right-hand side parts of rule.
151 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
153 current_lhs_symbol
= sym
;
154 current_lhs_location
= loc
;
155 /* In order to simplify memory management, named references for lhs
156 are always assigned by deep copy into the current symbol_list
157 node. This is because a single named-ref in the grammar may
158 result in several uses when the user factors lhs between several
159 rules using "|". Therefore free the parser's original copy. */
160 free (current_lhs_named_ref
);
161 current_lhs_named_ref
= ref
;
165 #define YYTYPE_INT16 int_fast16_t
166 #define YYTYPE_INT8 int_fast8_t
167 #define YYTYPE_UINT16 uint_fast16_t
168 #define YYTYPE_UINT8 uint_fast8_t
171 /* Line 268 of yacc.c */
172 #line 173 "parse-gram.c"
175 # if defined __cplusplus && 201103L <= __cplusplus
176 # define YY_NULL nullptr
182 /* Enabling traces. */
187 /* Enabling verbose error messages. */
188 #ifdef YYERROR_VERBOSE
189 # undef YYERROR_VERBOSE
190 # define YYERROR_VERBOSE 1
192 # define YYERROR_VERBOSE 1
195 /* Enabling the token table. */
196 #ifndef YYTOKEN_TABLE
197 # define YYTOKEN_TABLE 0
204 /* Put the tokens into the symbol table, so that GDB and other debuggers
213 PERCENT_DESTRUCTOR
= 263,
214 PERCENT_PRINTER
= 264,
217 PERCENT_NONASSOC
= 267,
223 PERCENT_DEFAULT_PREC
= 273,
224 PERCENT_DEFINE
= 274,
225 PERCENT_DEFINES
= 275,
226 PERCENT_ERROR_VERBOSE
= 276,
227 PERCENT_EXPECT
= 277,
228 PERCENT_EXPECT_RR
= 278,
229 PERCENT_FILE_PREFIX
= 279,
230 PERCENT_GLR_PARSER
= 280,
231 PERCENT_INITIAL_ACTION
= 281,
232 PERCENT_LANGUAGE
= 282,
233 PERCENT_LEX_PARAM
= 283,
234 PERCENT_LOCATIONS
= 284,
235 PERCENT_NAME_PREFIX
= 285,
236 PERCENT_NO_DEFAULT_PREC
= 286,
237 PERCENT_NO_LINES
= 287,
238 PERCENT_NONDETERMINISTIC_PARSER
= 288,
239 PERCENT_OUTPUT
= 289,
240 PERCENT_PARSE_PARAM
= 290,
241 PERCENT_PURE_PARSER
= 291,
242 PERCENT_REQUIRE
= 292,
243 PERCENT_SKELETON
= 293,
245 PERCENT_TOKEN_TABLE
= 295,
246 PERCENT_VERBOSE
= 296,
255 PERCENT_PERCENT
= 305,
269 #define PERCENT_TOKEN 260
270 #define PERCENT_NTERM 261
271 #define PERCENT_TYPE 262
272 #define PERCENT_DESTRUCTOR 263
273 #define PERCENT_PRINTER 264
274 #define PERCENT_LEFT 265
275 #define PERCENT_RIGHT 266
276 #define PERCENT_NONASSOC 267
277 #define PERCENT_PREC 268
278 #define PERCENT_DPREC 269
279 #define PERCENT_MERGE 270
280 #define PERCENT_CODE 271
281 #define PERCENT_DEBUG 272
282 #define PERCENT_DEFAULT_PREC 273
283 #define PERCENT_DEFINE 274
284 #define PERCENT_DEFINES 275
285 #define PERCENT_ERROR_VERBOSE 276
286 #define PERCENT_EXPECT 277
287 #define PERCENT_EXPECT_RR 278
288 #define PERCENT_FILE_PREFIX 279
289 #define PERCENT_GLR_PARSER 280
290 #define PERCENT_INITIAL_ACTION 281
291 #define PERCENT_LANGUAGE 282
292 #define PERCENT_LEX_PARAM 283
293 #define PERCENT_LOCATIONS 284
294 #define PERCENT_NAME_PREFIX 285
295 #define PERCENT_NO_DEFAULT_PREC 286
296 #define PERCENT_NO_LINES 287
297 #define PERCENT_NONDETERMINISTIC_PARSER 288
298 #define PERCENT_OUTPUT 289
299 #define PERCENT_PARSE_PARAM 290
300 #define PERCENT_PURE_PARSER 291
301 #define PERCENT_REQUIRE 292
302 #define PERCENT_SKELETON 293
303 #define PERCENT_START 294
304 #define PERCENT_TOKEN_TABLE 295
305 #define PERCENT_VERBOSE 296
306 #define PERCENT_YACC 297
307 #define BRACED_CODE 298
308 #define BRACKETED_ID 299
314 #define PERCENT_PERCENT 305
317 #define SEMICOLON 308
319 #define TYPE_TAG_ANY 310
320 #define TYPE_TAG_NONE 311
321 #define PERCENT_UNION 312
326 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
327 typedef union YYSTYPE
330 /* Line 295 of yacc.c */
331 #line 113 "parse-gram.y"
340 unsigned char character
;
341 named_ref
*named_ref
;
345 /* Line 295 of yacc.c */
346 #line 347 "parse-gram.c"
348 # define YYSTYPE_IS_TRIVIAL 1
349 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
350 # define YYSTYPE_IS_DECLARED 1
353 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
354 typedef struct YYLTYPE
361 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
362 # define YYLTYPE_IS_DECLARED 1
363 # define YYLTYPE_IS_TRIVIAL 1
367 /* Copy the second part of user declarations. */
370 /* Line 345 of yacc.c */
371 #line 372 "parse-gram.c"
378 typedef YYTYPE_UINT8 yytype_uint8
;
380 typedef unsigned char yytype_uint8
;
384 typedef YYTYPE_INT8 yytype_int8
;
385 #elif (defined __STDC__ || defined __C99__FUNC__ \
386 || defined __cplusplus || defined _MSC_VER)
387 typedef signed char yytype_int8
;
389 typedef short int yytype_int8
;
393 typedef YYTYPE_UINT16 yytype_uint16
;
395 typedef unsigned short int yytype_uint16
;
399 typedef YYTYPE_INT16 yytype_int16
;
401 typedef short int yytype_int16
;
405 # ifdef __SIZE_TYPE__
406 # define YYSIZE_T __SIZE_TYPE__
407 # elif defined size_t
408 # define YYSIZE_T size_t
409 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
410 || defined __cplusplus || defined _MSC_VER)
411 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
412 # define YYSIZE_T size_t
414 # define YYSIZE_T unsigned int
418 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
421 # if defined YYENABLE_NLS && YYENABLE_NLS
423 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
424 # define YY_(msgid) dgettext ("bison-runtime", msgid)
428 # define YY_(msgid) msgid
432 /* Suppress unused-variable warnings by "using" E. */
433 #if ! defined lint || defined __GNUC__
434 # define YYUSE(e) ((void) (e))
436 # define YYUSE(e) /* empty */
439 /* Identity function, used to suppress warnings about constant conditions. */
443 #if (defined __STDC__ || defined __C99__FUNC__ \
444 || defined __cplusplus || defined _MSC_VER)
459 /* The parser invokes alloca or malloc; define the necessary symbols. */
461 # ifdef YYSTACK_ALLOC
462 /* Pacify GCC's `empty if-body' warning. */
463 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
464 # ifndef YYSTACK_ALLOC_MAXIMUM
465 /* The OS might guarantee only one guard page at the bottom of the stack,
466 and a page size can be as small as 4096 bytes. So we cannot safely
467 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
468 to allow for a few compiler-allocated temporary stack slots. */
469 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
472 # define YYSTACK_ALLOC YYMALLOC
473 # define YYSTACK_FREE YYFREE
474 # ifndef YYSTACK_ALLOC_MAXIMUM
475 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
477 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
478 && ! ((defined YYMALLOC || defined malloc) \
479 && (defined YYFREE || defined free)))
480 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
481 # ifndef EXIT_SUCCESS
482 # define EXIT_SUCCESS 0
486 # define YYMALLOC malloc
487 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
488 || defined __cplusplus || defined _MSC_VER)
489 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
494 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
495 || defined __cplusplus || defined _MSC_VER)
496 void free (void *); /* INFRINGES ON USER NAME SPACE */
500 # define YYCOPY_NEEDED 1
504 #if (! defined yyoverflow \
505 && (! defined __cplusplus \
506 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
507 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
509 /* A type that is properly aligned for any stack member. */
512 yytype_int16 yyss_alloc
;
517 /* The size of the maximum gap between one aligned stack and the next. */
518 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
520 /* The size of an array large to enough to hold all stacks, each with
522 # define YYSTACK_BYTES(N) \
523 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
524 + 2 * YYSTACK_GAP_MAXIMUM)
526 # define YYCOPY_NEEDED 1
528 /* Relocate STACK from its old location to the new one. The
529 local variables YYSIZE and YYSTACKSIZE give the old and new number of
530 elements in the stack, and YYPTR gives the new location of the
531 stack. Advance YYPTR to a properly aligned location for the next
533 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
536 YYSIZE_T yynewbytes; \
537 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
538 Stack = &yyptr->Stack_alloc; \
539 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
540 yyptr += yynewbytes / sizeof (*yyptr); \
546 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
547 /* Copy COUNT objects from SRC to DST. The source and destination do
550 # if defined __GNUC__ && 1 < __GNUC__
551 # define YYCOPY(Dst, Src, Count) \
552 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
554 # define YYCOPY(Dst, Src, Count) \
558 for (yyi = 0; yyi < (Count); yyi++) \
559 (Dst)[yyi] = (Src)[yyi]; \
564 #endif /* !YYCOPY_NEEDED */
566 /* YYFINAL -- State number of the termination state. */
568 /* YYLAST -- Last index in YYTABLE. */
571 /* YYNTOKENS -- Number of terminals. */
573 /* YYNNTS -- Number of nonterminals. */
575 /* YYNRULES -- Number of rules. */
577 /* YYNRULES -- Number of states. */
578 #define YYNSTATES 148
580 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
582 #define YYMAXUTOK 312
584 #define YYTRANSLATE(YYX) \
585 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
587 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
588 static const yytype_uint8 yytranslate
[] =
590 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
616 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
617 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
618 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
619 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
620 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
625 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
627 static const yytype_uint16 yyprhs
[] =
629 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
630 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
631 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
632 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
633 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
634 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
635 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
636 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
637 206, 209, 212, 213, 218, 220, 224, 227, 228, 232,
638 236, 240, 244, 248, 249, 251, 253, 255, 256, 258,
639 260, 262, 264, 266, 268, 270, 272, 274, 275
642 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
643 static const yytype_int8 yyrhs
[] =
645 59, 0, -1, 60, 50, 77, 91, -1, -1, 60,
646 61, -1, 62, -1, 52, -1, 17, -1, 19, 84,
647 85, -1, 20, -1, 20, 3, -1, 21, -1, 22,
648 4, -1, 23, 4, -1, 24, 3, -1, 24, 47,
649 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
650 28, 43, -1, 29, -1, 30, 3, -1, 30, 47,
651 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
652 47, 3, -1, 35, 43, -1, 36, -1, 37, 3,
653 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
654 53, -1, 67, -1, 64, -1, 39, 89, -1, 8,
655 43, 73, -1, 9, 43, 73, -1, 18, -1, 31,
656 -1, 16, 86, -1, 16, 48, 86, -1, -1, 48,
657 -1, 57, 63, 86, -1, -1, 6, 65, 76, -1,
658 -1, 5, 66, 76, -1, 7, 54, 72, -1, 68,
659 69, 70, -1, 10, -1, 11, -1, 12, -1, -1,
660 54, -1, 71, -1, 70, 71, -1, 89, -1, 89,
661 4, -1, 89, -1, 72, 89, -1, 74, -1, 73,
662 74, -1, 89, -1, 54, -1, 55, -1, 56, -1,
663 54, -1, 87, -1, 87, 4, -1, 87, 90, -1,
664 87, 4, 90, -1, 75, -1, 76, 75, -1, 78,
665 -1, 77, 78, -1, 79, -1, 62, 53, -1, 1,
666 53, -1, -1, 88, 83, 80, 81, -1, 82, -1,
667 81, 51, 82, -1, 81, 53, -1, -1, 82, 89,
668 83, -1, 82, 43, 83, -1, 82, 13, 89, -1,
669 82, 14, 4, -1, 82, 15, 54, -1, -1, 44,
670 -1, 48, -1, 3, -1, -1, 48, -1, 3, -1,
671 43, -1, 48, -1, 45, -1, 49, -1, 87, -1,
672 90, -1, 3, -1, -1, 50, 46, -1
675 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
676 static const yytype_uint16 yyrline
[] =
678 0, 228, 228, 236, 238, 242, 243, 253, 254, 259,
679 260, 265, 266, 267, 268, 269, 270, 275, 284, 285,
680 286, 287, 288, 289, 290, 291, 292, 293, 294, 309,
681 310, 334, 335, 336, 337, 341, 342, 343, 347, 354,
682 361, 365, 369, 376, 391, 392, 396, 408, 408, 413,
683 413, 418, 429, 444, 445, 446, 450, 451, 456, 458,
684 463, 464, 469, 471, 476, 477, 481, 482, 483, 484,
685 489, 494, 499, 505, 511, 522, 523, 532, 533, 539,
686 540, 541, 548, 548, 556, 557, 558, 563, 565, 567,
687 569, 571, 573, 578, 580, 591, 592, 597, 598, 599,
688 608, 628, 630, 639, 644, 645, 650, 657, 659
692 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
693 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
694 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
695 static const char *const yytname
[] =
697 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
698 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
699 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
700 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
701 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
702 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
703 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
704 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
705 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
706 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
707 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
708 "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"", "\"=\"",
709 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
710 "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
711 "input", "prologue_declarations", "prologue_declaration",
712 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
713 "precedence_declaration", "precedence_declarator", "type.opt",
714 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
715 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
716 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
717 "named_ref.opt", "variable", "content.opt", "braceless", "id",
718 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
723 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
725 static const yytype_uint16 yytoknum
[] =
727 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
728 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
729 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
730 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
731 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
732 305, 306, 307, 308, 309, 310, 311, 312
736 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
737 static const yytype_uint8 yyr1
[] =
739 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
740 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
741 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
742 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
743 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
744 64, 64, 67, 68, 68, 68, 69, 69, 70, 70,
745 71, 71, 72, 72, 73, 73, 74, 74, 74, 74,
746 75, 75, 75, 75, 75, 76, 76, 77, 77, 78,
747 78, 78, 80, 79, 81, 81, 81, 82, 82, 82,
748 82, 82, 82, 83, 83, 84, 84, 85, 85, 85,
749 86, 87, 87, 88, 89, 89, 90, 91, 91
752 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
753 static const yytype_uint8 yyr2
[] =
755 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
756 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
757 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
758 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
759 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
760 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
761 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
762 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
763 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
764 3, 3, 3, 0, 1, 1, 1, 0, 1, 1,
765 1, 1, 1, 1, 1, 1, 1, 0, 2
768 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
769 Performed when YYTABLE doesn't specify something else to do. Zero
770 means the default is an error. */
771 static const yytype_uint8 yydefact
[] =
773 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
774 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
775 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
776 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
777 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
778 0, 0, 0, 100, 0, 42, 96, 95, 97, 10,
779 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
780 0, 27, 29, 30, 106, 102, 101, 104, 37, 105,
781 0, 103, 0, 0, 77, 79, 93, 45, 0, 57,
782 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
783 69, 38, 64, 66, 39, 43, 99, 98, 8, 15,
784 22, 26, 81, 80, 0, 78, 2, 94, 82, 46,
785 52, 58, 60, 76, 72, 73, 63, 65, 108, 87,
786 59, 61, 74, 83, 84, 87, 86, 0, 0, 0,
787 93, 93, 85, 90, 91, 92, 89, 88
790 /* YYDEFGOTO[NTERM-NUM]. */
791 static const yytype_int16 yydefgoto
[] =
793 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
794 47, 90, 120, 121, 96, 101, 102, 92, 93, 83,
795 84, 85, 129, 133, 134, 118, 58, 108, 55, 77,
799 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
801 #define YYPACT_NINF -91
802 static const yytype_int16 yypact
[] =
804 -91, 3, 103, -91, -91, -91, -36, 2, 10, -91,
805 -91, -91, 9, -91, -91, 32, 60, -91, 65, 67,
806 27, -91, 41, 73, 51, -91, 39, -91, -91, -91,
807 40, 52, -91, 93, 95, 33, -91, -91, -91, 15,
808 -91, -91, 53, -91, -91, -91, -91, 46, 43, 43,
809 33, 11, 11, -91, 61, -91, -91, -91, 35, -91,
810 -91, -91, -91, 100, -91, -91, -91, -91, 102, -91,
811 113, -91, -91, -91, -91, -91, -91, -91, -91, -91,
812 64, -91, 94, 1, -91, -91, 62, -91, 61, -91,
813 33, -91, -91, 43, 86, 43, 33, -91, -91, -91,
814 -91, 11, -91, -91, 11, -91, -91, -91, -91, -91,
815 -91, -91, -91, -91, 72, -91, -91, -91, -91, -91,
816 33, -91, 142, -91, 145, -91, -91, -91, -91, -91,
817 -91, -91, -91, 17, 34, -91, -91, 33, 146, 97,
818 62, 62, 34, -91, -91, -91, -91, -91
821 /* YYPGOTO[NTERM-NUM]. */
822 static const yytype_int16 yypgoto
[] =
824 -91, -91, -91, -91, 147, -91, -91, -91, -91, -91,
825 -91, -91, -91, 37, -91, 106, -60, -33, 105, -91,
826 69, -91, -91, -91, 24, -48, -91, -91, -49, -20,
830 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
831 positive, shift that token. If negative, reduce the rule which
832 number is the opposite. If YYTABLE_NINF, syntax error. */
833 #define YYTABLE_NINF -108
834 static const yytype_int16 yytable
[] =
836 78, -107, 80, 3, 125, 105, 4, 5, 6, 7,
837 8, 9, 10, 11, 74, 97, 80, 12, 50, 14,
838 4, 5, 6, 7, 8, 9, 10, 11, 94, 94,
839 62, 12, 27, 14, 132, 56, 74, 74, 106, 119,
840 35, 127, 67, 69, 127, 51, 27, 137, 138, 139,
841 81, 114, 53, 52, 35, 122, 75, 54, 42, 76,
842 123, 126, 123, 59, 81, 98, 99, 100, 135, 60,
843 136, 61, 42, 94, 63, 94, 65, 140, 75, 75,
844 57, 76, 76, 107, 64, 122, 68, 70, 75, 74,
845 124, 76, 146, 147, 66, 71, 72, 91, 73, 141,
846 89, 87, 143, 109, 53, 110, 117, 141, 4, 5,
847 6, 7, 8, 9, 10, 11, 111, 112, 128, 12,
848 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
849 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
850 33, 34, 35, 36, 37, 38, 131, 113, 74, 44,
851 144, 145, 115, 39, 95, 40, 41, 130, 104, 142,
855 #define yypact_value_is_default(yystate) \
858 #define yytable_value_is_error(yytable_value) \
861 static const yytype_uint8 yycheck
[] =
863 35, 0, 1, 0, 94, 54, 5, 6, 7, 8,
864 9, 10, 11, 12, 3, 50, 1, 16, 54, 18,
865 5, 6, 7, 8, 9, 10, 11, 12, 48, 49,
866 3, 16, 31, 18, 124, 3, 3, 3, 3, 88,
867 39, 101, 3, 3, 104, 43, 31, 13, 14, 15,
868 49, 50, 43, 43, 39, 90, 45, 48, 57, 48,
869 93, 96, 95, 3, 49, 54, 55, 56, 51, 4,
870 53, 4, 57, 93, 47, 95, 3, 43, 45, 45,
871 48, 48, 48, 48, 43, 120, 47, 47, 45, 3,
872 4, 48, 140, 141, 43, 43, 3, 54, 3, 134,
873 54, 48, 137, 3, 43, 3, 44, 142, 5, 6,
874 7, 8, 9, 10, 11, 12, 3, 53, 46, 16,
875 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
876 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
877 37, 38, 39, 40, 41, 42, 4, 53, 3, 2,
878 4, 54, 83, 50, 49, 52, 53, 120, 52, 135,
882 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
883 symbol of state STATE-NUM. */
884 static const yytype_uint8 yystos
[] =
886 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
887 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
888 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
889 34, 35, 36, 37, 38, 39, 40, 41, 42, 50,
890 52, 53, 57, 61, 62, 64, 67, 68, 66, 65,
891 54, 43, 43, 43, 48, 86, 3, 48, 84, 3,
892 4, 4, 3, 47, 43, 3, 43, 3, 47, 3,
893 47, 43, 3, 3, 3, 45, 48, 87, 89, 90,
894 1, 49, 62, 77, 78, 79, 88, 48, 63, 54,
895 69, 54, 75, 76, 87, 76, 72, 89, 54, 55,
896 56, 73, 74, 89, 73, 86, 3, 48, 85, 3,
897 3, 3, 53, 53, 50, 78, 91, 44, 83, 86,
898 70, 71, 89, 75, 4, 90, 89, 74, 46, 80,
899 71, 4, 90, 81, 82, 51, 53, 13, 14, 15,
900 43, 89, 82, 89, 4, 54, 83, 83
903 #define yyerrok (yyerrstatus = 0)
904 #define yyclearin (yychar = YYEMPTY)
908 #define YYACCEPT goto yyacceptlab
909 #define YYABORT goto yyabortlab
910 #define YYERROR goto yyerrorlab
913 /* Like YYERROR except do call yyerror. This remains here temporarily
914 to ease the transition to the new meaning of YYERROR, for GCC.
915 Once GCC version 2 has supplanted version 1, this can go. However,
916 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
917 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
920 #define YYFAIL goto yyerrlab
922 /* This is here to suppress warnings from the GCC cpp's
923 -Wunused-macros. Normally we don't worry about that warning, but
924 some users do, and we want to make it easy for users to remove
925 YYFAIL uses, which will produce warnings from Bison 2.5. */
928 #define YYRECOVERING() (!!yyerrstatus)
930 #define YYBACKUP(Token, Value) \
932 if (yychar == YYEMPTY) \
936 YYPOPSTACK (yylen); \
938 YY_LAC_DISCARD ("YYBACKUP"); \
943 yyerror (YY_("syntax error: cannot back up")); \
950 #define YYERRCODE 256
953 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
954 If N is 0, then set CURRENT to the empty location which ends
955 the previous symbol: RHS[0] (always defined). */
957 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
958 #ifndef YYLLOC_DEFAULT
959 # define YYLLOC_DEFAULT(Current, Rhs, N) \
963 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
964 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
965 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
966 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
970 (Current).first_line = (Current).last_line = \
971 YYRHSLOC (Rhs, 0).last_line; \
972 (Current).first_column = (Current).last_column = \
973 YYRHSLOC (Rhs, 0).last_column; \
979 /* YY_LOCATION_PRINT -- Print the location on the stream.
980 This macro was not mandated originally: define only if we know
981 we won't break user code: when these are the locations we know. */
983 #ifndef YY_LOCATION_PRINT
984 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
985 # define YY_LOCATION_PRINT(File, Loc) \
986 fprintf (File, "%d.%d-%d.%d", \
987 (Loc).first_line, (Loc).first_column, \
988 (Loc).last_line, (Loc).last_column)
990 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
995 /* YYLEX -- calling `yylex' with the right arguments. */
998 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1000 # define YYLEX yylex (&yylval, &yylloc)
1003 /* Enable debugging if requested. */
1007 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1008 # define YYFPRINTF fprintf
1011 # define YYDPRINTF(Args) \
1017 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1021 YYFPRINTF (stderr, "%s ", Title); \
1022 yy_symbol_print (stderr, \
1023 Type, Value, Location); \
1024 YYFPRINTF (stderr, "\n"); \
1029 /*--------------------------------.
1030 | Print this symbol on YYOUTPUT. |
1031 `--------------------------------*/
1034 #if (defined __STDC__ || defined __C99__FUNC__ \
1035 || defined __cplusplus || defined _MSC_VER)
1037 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1040 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1043 YYSTYPE
const * const yyvaluep
;
1044 YYLTYPE
const * const yylocationp
;
1047 FILE *yyo
= yyoutput
;
1051 YYUSE (yylocationp
);
1053 if (yytype
< YYNTOKENS
)
1054 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1060 case 3: /* "\"string\"" */
1062 /* Line 823 of yacc.c */
1063 #line 203 "parse-gram.y"
1064 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1066 /* Line 823 of yacc.c */
1067 #line 1068 "parse-gram.c"
1069 case 4: /* "\"integer\"" */
1071 /* Line 823 of yacc.c */
1072 #line 215 "parse-gram.y"
1073 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1075 /* Line 823 of yacc.c */
1076 #line 1077 "parse-gram.c"
1078 case 43: /* "\"{...}\"" */
1080 /* Line 823 of yacc.c */
1081 #line 205 "parse-gram.y"
1082 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1084 /* Line 823 of yacc.c */
1085 #line 1086 "parse-gram.c"
1087 case 44: /* "\"[identifier]\"" */
1089 /* Line 823 of yacc.c */
1090 #line 210 "parse-gram.y"
1091 { fprintf (stderr
, "[%s]", (yyvaluep
->uniqstr
)); };
1093 /* Line 823 of yacc.c */
1094 #line 1095 "parse-gram.c"
1096 case 45: /* "\"char\"" */
1098 /* Line 823 of yacc.c */
1099 #line 197 "parse-gram.y"
1100 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1102 /* Line 823 of yacc.c */
1103 #line 1104 "parse-gram.c"
1105 case 46: /* "\"epilogue\"" */
1107 /* Line 823 of yacc.c */
1108 #line 205 "parse-gram.y"
1109 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1111 /* Line 823 of yacc.c */
1112 #line 1113 "parse-gram.c"
1114 case 48: /* "\"identifier\"" */
1116 /* Line 823 of yacc.c */
1117 #line 209 "parse-gram.y"
1118 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1120 /* Line 823 of yacc.c */
1121 #line 1122 "parse-gram.c"
1123 case 49: /* "\"identifier:\"" */
1125 /* Line 823 of yacc.c */
1126 #line 211 "parse-gram.y"
1127 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1129 /* Line 823 of yacc.c */
1130 #line 1131 "parse-gram.c"
1132 case 52: /* "\"%{...%}\"" */
1134 /* Line 823 of yacc.c */
1135 #line 205 "parse-gram.y"
1136 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1138 /* Line 823 of yacc.c */
1139 #line 1140 "parse-gram.c"
1141 case 54: /* "\"type\"" */
1143 /* Line 823 of yacc.c */
1144 #line 212 "parse-gram.y"
1145 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1147 /* Line 823 of yacc.c */
1148 #line 1149 "parse-gram.c"
1150 case 71: /* "symbol.prec" */
1152 /* Line 823 of yacc.c */
1153 #line 218 "parse-gram.y"
1154 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1156 /* Line 823 of yacc.c */
1157 #line 1158 "parse-gram.c"
1159 case 84: /* "variable" */
1161 /* Line 823 of yacc.c */
1162 #line 209 "parse-gram.y"
1163 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1165 /* Line 823 of yacc.c */
1166 #line 1167 "parse-gram.c"
1168 case 85: /* "content.opt" */
1170 /* Line 823 of yacc.c */
1171 #line 205 "parse-gram.y"
1172 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1174 /* Line 823 of yacc.c */
1175 #line 1176 "parse-gram.c"
1177 case 86: /* "braceless" */
1179 /* Line 823 of yacc.c */
1180 #line 205 "parse-gram.y"
1181 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1183 /* Line 823 of yacc.c */
1184 #line 1185 "parse-gram.c"
1188 /* Line 823 of yacc.c */
1189 #line 218 "parse-gram.y"
1190 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1192 /* Line 823 of yacc.c */
1193 #line 1194 "parse-gram.c"
1195 case 88: /* "id_colon" */
1197 /* Line 823 of yacc.c */
1198 #line 219 "parse-gram.y"
1199 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1201 /* Line 823 of yacc.c */
1202 #line 1203 "parse-gram.c"
1204 case 89: /* "symbol" */
1206 /* Line 823 of yacc.c */
1207 #line 218 "parse-gram.y"
1208 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1210 /* Line 823 of yacc.c */
1211 #line 1212 "parse-gram.c"
1213 case 90: /* "string_as_id" */
1215 /* Line 823 of yacc.c */
1216 #line 218 "parse-gram.y"
1217 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1219 /* Line 823 of yacc.c */
1220 #line 1221 "parse-gram.c"
1228 /*--------------------------------.
1229 | Print this symbol on YYOUTPUT. |
1230 `--------------------------------*/
1232 #if (defined __STDC__ || defined __C99__FUNC__ \
1233 || defined __cplusplus || defined _MSC_VER)
1235 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1238 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1241 YYSTYPE
const * const yyvaluep
;
1242 YYLTYPE
const * const yylocationp
;
1245 if (yytype
< YYNTOKENS
)
1246 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1248 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1250 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1251 YYFPRINTF (yyoutput
, ": ");
1252 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1253 YYFPRINTF (yyoutput
, ")");
1256 /*------------------------------------------------------------------.
1257 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1259 `------------------------------------------------------------------*/
1261 #if (defined __STDC__ || defined __C99__FUNC__ \
1262 || defined __cplusplus || defined _MSC_VER)
1264 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1267 yy_stack_print (yybottom
, yytop
)
1268 yytype_int16
*yybottom
;
1269 yytype_int16
*yytop
;
1272 YYFPRINTF (stderr
, "Stack now");
1273 for (; yybottom
<= yytop
; yybottom
++)
1275 int yybot
= *yybottom
;
1276 YYFPRINTF (stderr
, " %d", yybot
);
1278 YYFPRINTF (stderr
, "\n");
1281 # define YY_STACK_PRINT(Bottom, Top) \
1284 yy_stack_print ((Bottom), (Top)); \
1288 /*------------------------------------------------.
1289 | Report that the YYRULE is going to be reduced. |
1290 `------------------------------------------------*/
1292 #if (defined __STDC__ || defined __C99__FUNC__ \
1293 || defined __cplusplus || defined _MSC_VER)
1295 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1298 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1304 int yynrhs
= yyr2
[yyrule
];
1306 unsigned long int yylno
= yyrline
[yyrule
];
1307 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1309 /* The symbols being reduced. */
1310 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1312 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1313 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1314 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1315 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1316 YYFPRINTF (stderr
, "\n");
1320 # define YY_REDUCE_PRINT(Rule) \
1323 yy_reduce_print (yyvsp, yylsp, Rule); \
1326 /* Nonzero means print parse trace. It is left uninitialized so that
1327 multiple parsers can coexist. */
1329 #else /* !YYDEBUG */
1330 # define YYDPRINTF(Args)
1331 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1332 # define YY_STACK_PRINT(Bottom, Top)
1333 # define YY_REDUCE_PRINT(Rule)
1334 #endif /* !YYDEBUG */
1337 /* YYINITDEPTH -- initial size of the parser's stacks. */
1339 # define YYINITDEPTH 200
1342 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1343 if the built-in stack extension method is used).
1345 Do not make this value too large; the results are undefined if
1346 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1347 evaluated with infinite-precision integer arithmetic. */
1350 # define YYMAXDEPTH 10000
1353 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1354 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1355 stack, and such that *YYCAPACITY is the maximum number of elements it
1356 can hold without a reallocation, make sure there is enough room to
1357 store YYADD more elements. If not, allocate a new stack using
1358 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1359 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1360 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1361 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1362 required. Return 1 if memory is exhausted. */
1364 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1366 char const *yydebug_prefix
,
1367 char const *yydebug_suffix
,
1369 yytype_int16
**yybottom
,
1370 yytype_int16
*yybottom_no_free
,
1371 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1373 YYSIZE_T yysize_old
=
1374 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1375 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1376 if (*yycapacity
< yysize_new
)
1378 YYSIZE_T yyalloc
= 2 * yysize_new
;
1379 yytype_int16
*yybottom_new
;
1380 /* Use YYMAXDEPTH for maximum stack size given that the stack
1381 should never need to grow larger than the main state stack
1382 needs to grow without LAC. */
1383 if (YYMAXDEPTH
< yysize_new
)
1385 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1389 if (YYMAXDEPTH
< yyalloc
)
1390 yyalloc
= YYMAXDEPTH
;
1392 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1395 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1399 if (*yytop
!= yytop_empty
)
1401 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1402 *yytop
= yybottom_new
+ (yysize_old
- 1);
1404 if (*yybottom
!= yybottom_no_free
)
1405 YYSTACK_FREE (*yybottom
);
1406 *yybottom
= yybottom_new
;
1407 *yycapacity
= yyalloc
;
1412 /* Establish the initial context for the current lookahead if no initial
1413 context is currently established.
1415 We define a context as a snapshot of the parser stacks. We define
1416 the initial context for a lookahead as the context in which the
1417 parser initially examines that lookahead in order to select a
1418 syntactic action. Thus, if the lookahead eventually proves
1419 syntactically unacceptable (possibly in a later context reached via a
1420 series of reductions), the initial context can be used to determine
1421 the exact set of tokens that would be syntactically acceptable in the
1422 lookahead's place. Moreover, it is the context after which any
1423 further semantic actions would be erroneous because they would be
1424 determined by a syntactically unacceptable token.
1426 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1427 performed in an inconsistent state (which, for the purposes of LAC,
1428 includes consistent states that don't know they're consistent because
1429 their default reductions have been disabled). Iff there is a
1430 lookahead token, it should also be invoked before reporting a syntax
1431 error. This latter case is for the sake of the debugging output.
1433 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1434 follows. If no initial context is currently established for the
1435 current lookahead, then check if that lookahead can eventually be
1436 shifted if syntactic actions continue from the current context.
1437 Report a syntax error if it cannot. */
1438 #define YY_LAC_ESTABLISH \
1440 if (!yy_lac_established) \
1442 YYDPRINTF ((stderr, \
1443 "LAC: initial context established for %s\n", \
1444 yytname[yytoken])); \
1445 yy_lac_established = 1; \
1447 int yy_lac_status = \
1448 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1449 if (yy_lac_status == 2) \
1450 goto yyexhaustedlab; \
1451 if (yy_lac_status == 1) \
1457 /* Discard any previous initial lookahead context because of Event,
1458 which may be a lookahead change or an invalidation of the currently
1459 established initial context for the current lookahead.
1461 The most common example of a lookahead change is a shift. An example
1462 of both cases is syntax error recovery. That is, a syntax error
1463 occurs when the lookahead is syntactically erroneous for the
1464 currently established initial context, so error recovery manipulates
1465 the parser stacks to try to find a new initial context in which the
1466 current lookahead is syntactically acceptable. If it fails to find
1467 such a context, it discards the lookahead. */
1469 # define YY_LAC_DISCARD(Event) \
1471 if (yy_lac_established) \
1474 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1476 yy_lac_established = 0; \
1480 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1483 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1484 eventually (after perhaps some reductions) be shifted, return 1 if
1485 not, or return 2 if memory is exhausted. As preconditions and
1486 postconditions: *YYES_CAPACITY is the allocated size of the array to
1487 which *YYES points, and either *YYES = YYESA or *YYES points to an
1488 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1489 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1490 any old *YYES other than YYESA. */
1492 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1493 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1495 yytype_int16
*yyes_prev
= yyssp
;
1496 yytype_int16
*yyesp
= yyes_prev
;
1497 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1498 if (yytoken
== YYUNDEFTOK
)
1500 YYDPRINTF ((stderr
, " Always Err\n"));
1505 int yyrule
= yypact
[*yyesp
];
1506 if (yypact_value_is_default (yyrule
)
1507 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1508 || yycheck
[yyrule
] != yytoken
)
1510 yyrule
= yydefact
[*yyesp
];
1513 YYDPRINTF ((stderr
, " Err\n"));
1519 yyrule
= yytable
[yyrule
];
1520 if (yytable_value_is_error (yyrule
))
1522 YYDPRINTF ((stderr
, " Err\n"));
1527 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1533 YYSIZE_T yylen
= yyr2
[yyrule
];
1534 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1535 if (yyesp
!= yyes_prev
)
1537 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1550 yyesp
= yyes_prev
-= yylen
;
1555 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1556 yystate
= yypgoto
[yylhs
] + *yyesp
;
1557 if (yystate
< 0 || YYLAST
< yystate
1558 || yycheck
[yystate
] != *yyesp
)
1559 yystate
= yydefgoto
[yylhs
];
1561 yystate
= yytable
[yystate
];
1563 if (yyesp
== yyes_prev
)
1570 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1574 yyes
, yyesa
, &yyesp
, yyes_prev
))
1576 YYDPRINTF ((stderr
, "\n"));
1581 YYDPRINTF ((stderr
, " G%d", yystate
));
1590 # if defined __GLIBC__ && defined _STRING_H
1591 # define yystrlen strlen
1593 /* Return the length of YYSTR. */
1594 #if (defined __STDC__ || defined __C99__FUNC__ \
1595 || defined __cplusplus || defined _MSC_VER)
1597 yystrlen (const char *yystr
)
1605 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1613 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1614 # define yystpcpy stpcpy
1616 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1618 #if (defined __STDC__ || defined __C99__FUNC__ \
1619 || defined __cplusplus || defined _MSC_VER)
1621 yystpcpy (char *yydest
, const char *yysrc
)
1624 yystpcpy (yydest
, yysrc
)
1630 const char *yys
= yysrc
;
1632 while ((*yyd
++ = *yys
++) != '\0')
1641 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1642 quotes and backslashes, so that it's suitable for yyerror. The
1643 heuristic is that double-quoting is unnecessary unless the string
1644 contains an apostrophe, a comma, or backslash (other than
1645 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1646 null, do not copy; instead, return the length of what the result
1649 yytnamerr (char *yyres
, const char *yystr
)
1654 char const *yyp
= yystr
;
1661 goto do_not_strip_quotes
;
1665 goto do_not_strip_quotes
;
1678 do_not_strip_quotes
: ;
1682 return yystrlen (yystr
);
1684 return yystpcpy (yyres
, yystr
) - yyres
;
1688 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1689 about the unexpected token YYTOKEN for the state stack whose top is
1690 YYSSP. In order to see if a particular token T is a
1691 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1693 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1694 not large enough to hold the message. In that case, also set
1695 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1696 required number of bytes is too large to store or if
1697 yy_lac returned 2. */
1699 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1700 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1701 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1703 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1704 YYSIZE_T yysize
= yysize0
;
1706 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1707 /* Internationalized format string. */
1708 const char *yyformat
= YY_NULL
;
1709 /* Arguments of yyformat. */
1710 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1711 /* Number of reported tokens (one for the "unexpected", one per
1715 /* There are many possibilities here to consider:
1716 - Assume YYFAIL is not used. It's too flawed to consider. See
1717 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1718 for details. YYERROR is fine as it does not invoke this
1720 - If this state is a consistent state with a default action, then
1721 the only way this function was invoked is if the default action
1722 is an error action. In that case, don't check for expected
1723 tokens because there are none.
1724 - The only way there can be no lookahead present (in yychar) is if
1725 this state is a consistent state with a default action. Thus,
1726 detecting the absence of a lookahead is sufficient to determine
1727 that there is no unexpected or expected token to report. In that
1728 case, just report a simple "syntax error".
1729 - Don't assume there isn't a lookahead just because this state is a
1730 consistent state with a default action. There might have been a
1731 previous inconsistent state, consistent state with a non-default
1732 action, or user semantic action that manipulated yychar.
1733 In the first two cases, it might appear that the current syntax
1734 error should have been detected in the previous state when yy_lac
1735 was invoked. However, at that time, there might have been a
1736 different syntax error that discarded a different initial context
1737 during error recovery, leaving behind the current lookahead.
1739 if (yytoken
!= YYEMPTY
)
1741 int yyn
= yypact
[*yyssp
];
1742 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1743 yyarg
[yycount
++] = yytname
[yytoken
];
1744 if (!yypact_value_is_default (yyn
))
1748 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1749 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1752 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1754 if (yy_lac_status
== 2)
1756 if (yy_lac_status
== 1)
1759 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1765 yyarg
[yycount
++] = yytname
[yyx
];
1766 yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1767 if (! (yysize
<= yysize1
1768 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1775 YYFPRINTF (stderr
, "No expected tokens.\n");
1781 # define YYCASE_(N, S) \
1785 YYCASE_(0, YY_("syntax error"));
1786 YYCASE_(1, YY_("syntax error, unexpected %s"));
1787 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1788 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1789 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1790 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1794 yysize1
= yysize
+ yystrlen (yyformat
);
1795 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1799 if (*yymsg_alloc
< yysize
)
1801 *yymsg_alloc
= 2 * yysize
;
1802 if (! (yysize
<= *yymsg_alloc
1803 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1804 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1808 /* Avoid sprintf, as that infringes on the user's name space.
1809 Don't have undefined behavior even if the translation
1810 produced a string with the wrong number of "%s"s. */
1814 while ((*yyp
= *yyformat
) != '\0')
1815 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1817 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1828 #endif /* YYERROR_VERBOSE */
1830 /*-----------------------------------------------.
1831 | Release the memory associated to this symbol. |
1832 `-----------------------------------------------*/
1835 #if (defined __STDC__ || defined __C99__FUNC__ \
1836 || defined __cplusplus || defined _MSC_VER)
1838 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1841 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1845 YYLTYPE
*yylocationp
;
1849 YYUSE (yylocationp
);
1853 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1864 /* Prevent warnings from -Wmissing-prototypes. */
1865 #ifdef YYPARSE_PARAM
1866 #if defined __STDC__ || defined __cplusplus
1867 int yyparse (void *YYPARSE_PARAM
);
1871 #else /* ! YYPARSE_PARAM */
1872 #if defined __STDC__ || defined __cplusplus
1877 #endif /* ! YYPARSE_PARAM */
1884 #ifdef YYPARSE_PARAM
1885 #if (defined __STDC__ || defined __C99__FUNC__ \
1886 || defined __cplusplus || defined _MSC_VER)
1888 yyparse (void *YYPARSE_PARAM
)
1891 yyparse (YYPARSE_PARAM
)
1892 void *YYPARSE_PARAM
;
1894 #else /* ! YYPARSE_PARAM */
1895 #if (defined __STDC__ || defined __C99__FUNC__ \
1896 || defined __cplusplus || defined _MSC_VER)
1906 /* The lookahead symbol. */
1909 /* The semantic value of the lookahead symbol. */
1912 /* Location data for the lookahead symbol. */
1915 /* Number of syntax errors so far. */
1919 /* Number of tokens to shift before error messages enabled. */
1922 /* The stacks and their tools:
1923 `yyss': related to states.
1924 `yyvs': related to semantic values.
1925 `yyls': related to locations.
1927 Refer to the stacks thru separate pointers, to allow yyoverflow
1928 to reallocate them elsewhere. */
1930 /* The state stack. */
1931 yytype_int16 yyssa
[YYINITDEPTH
];
1933 yytype_int16
*yyssp
;
1935 /* The semantic value stack. */
1936 YYSTYPE yyvsa
[YYINITDEPTH
];
1940 /* The location stack. */
1941 YYLTYPE yylsa
[YYINITDEPTH
];
1945 /* The locations where the error started and ended. */
1946 YYLTYPE yyerror_range
[3];
1948 YYSIZE_T yystacksize
;
1950 yytype_int16 yyesa
[20];
1952 YYSIZE_T yyes_capacity
;
1954 int yy_lac_established
= 0;
1957 /* Lookahead token as an internal (translated) token number. */
1959 /* The variables used to return semantic value and location from the
1965 /* Buffer for error messages, and its allocated size. */
1967 char *yymsg
= yymsgbuf
;
1968 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1971 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1973 /* The number of symbols on the RHS of the reduced rule.
1974 Keep to zero when no symbol should be popped. */
1981 yystacksize
= YYINITDEPTH
;
1984 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1985 if (YYMAXDEPTH
< yyes_capacity
)
1986 yyes_capacity
= YYMAXDEPTH
;
1988 YYDPRINTF ((stderr
, "Starting parse\n"));
1993 yychar
= YYEMPTY
; /* Cause a token to be read. */
1995 /* Initialize stack pointers.
1996 Waste one element of value and location stack
1997 so that they stay on the same level as the state stack.
1998 The wasted elements are never initialized. */
2003 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2004 /* Initialize the default location before parsing starts. */
2005 yylloc
.first_line
= yylloc
.last_line
= 1;
2006 yylloc
.first_column
= yylloc
.last_column
= 1;
2009 /* User initialization code. */
2011 /* Line 1594 of yacc.c */
2012 #line 105 "parse-gram.y"
2014 /* Bison's grammar can initial empty locations, hence a default
2015 location is needed. */
2016 boundary_set (&yylloc
.start
, current_file
, 1, 1);
2017 boundary_set (&yylloc
.end
, current_file
, 1, 1);
2020 /* Line 1594 of yacc.c */
2021 #line 2022 "parse-gram.c"
2026 /*------------------------------------------------------------.
2027 | yynewstate -- Push a new state, which is found in yystate. |
2028 `------------------------------------------------------------*/
2030 /* In all cases, when you get here, the value and location stacks
2031 have just been pushed. So pushing a state here evens the stacks. */
2037 if (yyss
+ yystacksize
- 1 <= yyssp
)
2039 /* Get the current used size of the three stacks, in elements. */
2040 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2044 /* Give user a chance to reallocate the stack. Use copies of
2045 these so that the &'s don't force the real ones into
2047 YYSTYPE
*yyvs1
= yyvs
;
2048 yytype_int16
*yyss1
= yyss
;
2049 YYLTYPE
*yyls1
= yyls
;
2051 /* Each stack pointer address is followed by the size of the
2052 data in use in that stack, in bytes. This used to be a
2053 conditional around just the two extra args, but that might
2054 be undefined if yyoverflow is a macro. */
2055 yyoverflow (YY_("memory exhausted"),
2056 &yyss1
, yysize
* sizeof (*yyssp
),
2057 &yyvs1
, yysize
* sizeof (*yyvsp
),
2058 &yyls1
, yysize
* sizeof (*yylsp
),
2065 #else /* no yyoverflow */
2066 # ifndef YYSTACK_RELOCATE
2067 goto yyexhaustedlab
;
2069 /* Extend the stack our own way. */
2070 if (YYMAXDEPTH
<= yystacksize
)
2071 goto yyexhaustedlab
;
2073 if (YYMAXDEPTH
< yystacksize
)
2074 yystacksize
= YYMAXDEPTH
;
2077 yytype_int16
*yyss1
= yyss
;
2078 union yyalloc
*yyptr
=
2079 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2081 goto yyexhaustedlab
;
2082 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2083 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2084 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2085 # undef YYSTACK_RELOCATE
2087 YYSTACK_FREE (yyss1
);
2090 #endif /* no yyoverflow */
2092 yyssp
= yyss
+ yysize
- 1;
2093 yyvsp
= yyvs
+ yysize
- 1;
2094 yylsp
= yyls
+ yysize
- 1;
2096 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2097 (unsigned long int) yystacksize
));
2099 if (yyss
+ yystacksize
- 1 <= yyssp
)
2103 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2105 if (yystate
== YYFINAL
)
2115 /* Do appropriate processing given the current state. Read a
2116 lookahead token if we need one and don't already have one. */
2118 /* First try to decide what to do without reference to lookahead token. */
2119 yyn
= yypact
[yystate
];
2120 if (yypact_value_is_default (yyn
))
2123 /* Not known => get a lookahead token if don't already have one. */
2125 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2126 if (yychar
== YYEMPTY
)
2128 YYDPRINTF ((stderr
, "Reading a token: "));
2132 if (yychar
<= YYEOF
)
2134 yychar
= yytoken
= YYEOF
;
2135 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2139 yytoken
= YYTRANSLATE (yychar
);
2140 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2143 /* If the proper action on seeing token YYTOKEN is to reduce or to
2144 detect an error, take that action. */
2146 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2154 if (yytable_value_is_error (yyn
))
2161 /* Count tokens shifted since error; after three, turn off error
2166 /* Shift the lookahead token. */
2167 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2169 /* Discard the shifted token. */
2171 YY_LAC_DISCARD ("shift");
2179 /*-----------------------------------------------------------.
2180 | yydefault -- do the default action for the current state. |
2181 `-----------------------------------------------------------*/
2183 yyn
= yydefact
[yystate
];
2189 /*-----------------------------.
2190 | yyreduce -- Do a reduction. |
2191 `-----------------------------*/
2193 /* yyn is the number of a rule to reduce with. */
2196 /* If YYLEN is nonzero, implement the default value of the action:
2199 Otherwise, the following line sets YYVAL to garbage.
2200 This behavior is undocumented and Bison
2201 users should not rely upon it. Assigning to YYVAL
2202 unconditionally makes the parser a bit smaller, and it avoids a
2203 GCC warning that YYVAL may be used uninitialized. */
2204 yyval
= yyvsp
[1-yylen
];
2206 /* Default location. */
2207 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2208 YY_REDUCE_PRINT (yyn
);
2210 int yychar_backup
= yychar
;
2215 /* Line 1810 of yacc.c */
2216 #line 244 "parse-gram.y"
2218 code_props plain_code
;
2219 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
2220 code_props_translate_code (&plain_code
);
2221 gram_scanner_last_string_free ();
2222 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2223 plain_code
.code
, (yylsp
[(1) - (1)]));
2224 code_scanner_last_string_free ();
2230 /* Line 1810 of yacc.c */
2231 #line 253 "parse-gram.y"
2232 { debug_flag
= true; }
2237 /* Line 1810 of yacc.c */
2238 #line 255 "parse-gram.y"
2240 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
),
2241 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2247 /* Line 1810 of yacc.c */
2248 #line 259 "parse-gram.y"
2249 { defines_flag
= true; }
2254 /* Line 1810 of yacc.c */
2255 #line 261 "parse-gram.y"
2257 defines_flag
= true;
2258 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
2264 /* Line 1810 of yacc.c */
2265 #line 265 "parse-gram.y"
2266 { error_verbose
= true; }
2271 /* Line 1810 of yacc.c */
2272 #line 266 "parse-gram.y"
2273 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2278 /* Line 1810 of yacc.c */
2279 #line 267 "parse-gram.y"
2280 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2285 /* Line 1810 of yacc.c */
2286 #line 268 "parse-gram.y"
2287 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
2292 /* Line 1810 of yacc.c */
2293 #line 269 "parse-gram.y"
2294 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
2299 /* Line 1810 of yacc.c */
2300 #line 271 "parse-gram.y"
2302 nondeterministic_parser
= true;
2309 /* Line 1810 of yacc.c */
2310 #line 276 "parse-gram.y"
2313 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
2314 code_props_translate_code (&action
);
2315 gram_scanner_last_string_free ();
2316 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2317 code_scanner_last_string_free ();
2323 /* Line 1810 of yacc.c */
2324 #line 284 "parse-gram.y"
2325 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, (yylsp
[(1) - (2)])); }
2330 /* Line 1810 of yacc.c */
2331 #line 285 "parse-gram.y"
2332 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2337 /* Line 1810 of yacc.c */
2338 #line 286 "parse-gram.y"
2339 { locations_flag
= true; }
2344 /* Line 1810 of yacc.c */
2345 #line 287 "parse-gram.y"
2346 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2351 /* Line 1810 of yacc.c */
2352 #line 288 "parse-gram.y"
2353 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2358 /* Line 1810 of yacc.c */
2359 #line 289 "parse-gram.y"
2360 { no_lines_flag
= true; }
2365 /* Line 1810 of yacc.c */
2366 #line 290 "parse-gram.y"
2367 { nondeterministic_parser
= true; }
2372 /* Line 1810 of yacc.c */
2373 #line 291 "parse-gram.y"
2374 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2379 /* Line 1810 of yacc.c */
2380 #line 292 "parse-gram.y"
2381 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2386 /* Line 1810 of yacc.c */
2387 #line 293 "parse-gram.y"
2388 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2393 /* Line 1810 of yacc.c */
2394 #line 295 "parse-gram.y"
2396 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2397 `%define api.pure' in a backward-compatible manner here. First, don't
2398 complain if %pure-parser is specified multiple times. */
2399 if (!muscle_find_const ("percent_define(api.pure)"))
2400 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2401 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2402 /* In all cases, use api.pure now so that the backend doesn't complain if
2403 the skeleton ignores api.pure, but do warn now if there's a previous
2404 conflicting definition from an actual %define. */
2405 if (!muscle_percent_define_flag_if ("api.pure"))
2406 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2407 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2413 /* Line 1810 of yacc.c */
2414 #line 309 "parse-gram.y"
2415 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2420 /* Line 1810 of yacc.c */
2421 #line 311 "parse-gram.y"
2423 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2424 if (mbschr (skeleton_user
, '/'))
2426 size_t dir_length
= strlen (current_file
);
2427 char *skeleton_build
;
2428 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2430 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2433 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2436 memcpy (skeleton_build
, current_file
, dir_length
);
2437 skeleton_build
[dir_length
++] = '/';
2439 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2440 skeleton_user
= uniqstr_new (skeleton_build
);
2441 free (skeleton_build
);
2443 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[(1) - (2)]));
2449 /* Line 1810 of yacc.c */
2450 #line 334 "parse-gram.y"
2451 { token_table_flag
= true; }
2456 /* Line 1810 of yacc.c */
2457 #line 335 "parse-gram.y"
2458 { report_flag
|= report_states
; }
2463 /* Line 1810 of yacc.c */
2464 #line 336 "parse-gram.y"
2465 { yacc_flag
= true; }
2470 /* Line 1810 of yacc.c */
2471 #line 344 "parse-gram.y"
2473 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2479 /* Line 1810 of yacc.c */
2480 #line 348 "parse-gram.y"
2483 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2484 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2485 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2491 /* Line 1810 of yacc.c */
2492 #line 355 "parse-gram.y"
2495 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2496 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2497 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2503 /* Line 1810 of yacc.c */
2504 #line 362 "parse-gram.y"
2506 default_prec
= true;
2512 /* Line 1810 of yacc.c */
2513 #line 366 "parse-gram.y"
2515 default_prec
= false;
2521 /* Line 1810 of yacc.c */
2522 #line 370 "parse-gram.y"
2524 /* Do not invoke muscle_percent_code_grow here since it invokes
2525 muscle_user_name_list_grow. */
2526 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2527 code_scanner_last_string_free ();
2533 /* Line 1810 of yacc.c */
2534 #line 377 "parse-gram.y"
2536 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2537 code_scanner_last_string_free ();
2543 /* Line 1810 of yacc.c */
2544 #line 391 "parse-gram.y"
2550 /* Line 1810 of yacc.c */
2551 #line 392 "parse-gram.y"
2552 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2557 /* Line 1810 of yacc.c */
2558 #line 397 "parse-gram.y"
2561 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2562 code_scanner_last_string_free ();
2568 /* Line 1810 of yacc.c */
2569 #line 408 "parse-gram.y"
2570 { current_class
= nterm_sym
; }
2575 /* Line 1810 of yacc.c */
2576 #line 409 "parse-gram.y"
2578 current_class
= unknown_sym
;
2579 current_type
= NULL
;
2585 /* Line 1810 of yacc.c */
2586 #line 413 "parse-gram.y"
2587 { current_class
= token_sym
; }
2592 /* Line 1810 of yacc.c */
2593 #line 414 "parse-gram.y"
2595 current_class
= unknown_sym
;
2596 current_type
= NULL
;
2602 /* Line 1810 of yacc.c */
2603 #line 419 "parse-gram.y"
2607 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2608 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2609 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2615 /* Line 1810 of yacc.c */
2616 #line 430 "parse-gram.y"
2620 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2622 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2623 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2625 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2626 current_type
= NULL
;
2632 /* Line 1810 of yacc.c */
2633 #line 444 "parse-gram.y"
2634 { (yyval
.assoc
) = left_assoc
; }
2639 /* Line 1810 of yacc.c */
2640 #line 445 "parse-gram.y"
2641 { (yyval
.assoc
) = right_assoc
; }
2646 /* Line 1810 of yacc.c */
2647 #line 446 "parse-gram.y"
2648 { (yyval
.assoc
) = non_assoc
; }
2653 /* Line 1810 of yacc.c */
2654 #line 450 "parse-gram.y"
2655 { current_type
= NULL
; }
2660 /* Line 1810 of yacc.c */
2661 #line 451 "parse-gram.y"
2662 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2667 /* Line 1810 of yacc.c */
2668 #line 457 "parse-gram.y"
2669 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2674 /* Line 1810 of yacc.c */
2675 #line 459 "parse-gram.y"
2676 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2681 /* Line 1810 of yacc.c */
2682 #line 463 "parse-gram.y"
2683 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2688 /* Line 1810 of yacc.c */
2689 #line 464 "parse-gram.y"
2690 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2695 /* Line 1810 of yacc.c */
2696 #line 470 "parse-gram.y"
2697 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2702 /* Line 1810 of yacc.c */
2703 #line 472 "parse-gram.y"
2704 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2709 /* Line 1810 of yacc.c */
2710 #line 476 "parse-gram.y"
2711 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2716 /* Line 1810 of yacc.c */
2717 #line 477 "parse-gram.y"
2718 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2723 /* Line 1810 of yacc.c */
2724 #line 481 "parse-gram.y"
2725 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2730 /* Line 1810 of yacc.c */
2731 #line 482 "parse-gram.y"
2732 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2737 /* Line 1810 of yacc.c */
2738 #line 483 "parse-gram.y"
2739 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2744 /* Line 1810 of yacc.c */
2745 #line 484 "parse-gram.y"
2746 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2751 /* Line 1810 of yacc.c */
2752 #line 490 "parse-gram.y"
2754 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2761 /* Line 1810 of yacc.c */
2762 #line 495 "parse-gram.y"
2764 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2765 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2771 /* Line 1810 of yacc.c */
2772 #line 500 "parse-gram.y"
2774 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2775 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2776 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2782 /* Line 1810 of yacc.c */
2783 #line 506 "parse-gram.y"
2785 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2786 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2787 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2793 /* Line 1810 of yacc.c */
2794 #line 512 "parse-gram.y"
2796 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2797 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2798 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2799 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2805 /* Line 1810 of yacc.c */
2806 #line 542 "parse-gram.y"
2814 /* Line 1810 of yacc.c */
2815 #line 548 "parse-gram.y"
2816 { current_lhs ((yyvsp
[(1) - (2)].symbol
), (yylsp
[(1) - (2)]), (yyvsp
[(2) - (2)].named_ref
)); }
2821 /* Line 1810 of yacc.c */
2822 #line 549 "parse-gram.y"
2824 /* Free the current lhs. */
2825 current_lhs (0, (yylsp
[(1) - (4)]), 0);
2831 /* Line 1810 of yacc.c */
2832 #line 556 "parse-gram.y"
2833 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2838 /* Line 1810 of yacc.c */
2839 #line 557 "parse-gram.y"
2840 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2845 /* Line 1810 of yacc.c */
2846 #line 563 "parse-gram.y"
2847 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2848 current_lhs_named_ref
); }
2853 /* Line 1810 of yacc.c */
2854 #line 566 "parse-gram.y"
2855 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (3)].symbol
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2860 /* Line 1810 of yacc.c */
2861 #line 568 "parse-gram.y"
2862 { grammar_current_rule_action_append ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2867 /* Line 1810 of yacc.c */
2868 #line 570 "parse-gram.y"
2869 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2874 /* Line 1810 of yacc.c */
2875 #line 572 "parse-gram.y"
2876 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2881 /* Line 1810 of yacc.c */
2882 #line 574 "parse-gram.y"
2883 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2888 /* Line 1810 of yacc.c */
2889 #line 578 "parse-gram.y"
2890 { (yyval
.named_ref
) = 0; }
2895 /* Line 1810 of yacc.c */
2896 #line 580 "parse-gram.y"
2897 { (yyval
.named_ref
) = named_ref_new((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2902 /* Line 1810 of yacc.c */
2903 #line 592 "parse-gram.y"
2904 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2909 /* Line 1810 of yacc.c */
2910 #line 597 "parse-gram.y"
2911 { (yyval
.chars
) = ""; }
2916 /* Line 1810 of yacc.c */
2917 #line 598 "parse-gram.y"
2918 { (yyval
.chars
) = (yyvsp
[(1) - (1)].uniqstr
); }
2923 /* Line 1810 of yacc.c */
2924 #line 609 "parse-gram.y"
2926 code_props plain_code
;
2927 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2928 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2929 code_props_translate_code (&plain_code
);
2930 gram_scanner_last_string_free ();
2931 (yyval
.chars
) = plain_code
.code
;
2937 /* Line 1810 of yacc.c */
2938 #line 629 "parse-gram.y"
2939 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2944 /* Line 1810 of yacc.c */
2945 #line 631 "parse-gram.y"
2947 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2948 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2949 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2955 /* Line 1810 of yacc.c */
2956 #line 639 "parse-gram.y"
2957 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2962 /* Line 1810 of yacc.c */
2963 #line 651 "parse-gram.y"
2965 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2966 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2972 /* Line 1810 of yacc.c */
2973 #line 660 "parse-gram.y"
2975 code_props plain_code
;
2976 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2977 code_props_translate_code (&plain_code
);
2978 gram_scanner_last_string_free ();
2979 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2980 code_scanner_last_string_free ();
2986 /* Line 1810 of yacc.c */
2987 #line 2988 "parse-gram.c"
2990 if (yychar_backup
!= yychar
)
2991 YY_LAC_DISCARD ("yychar change");
2993 /* User semantic actions sometimes alter yychar, and that requires
2994 that yytoken be updated with the new translation. We take the
2995 approach of translating immediately before every use of yytoken.
2996 One alternative is translating here after every semantic action,
2997 but that translation would be missed if the semantic action invokes
2998 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2999 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3000 incorrect destructor might then be invoked immediately. In the
3001 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3002 to an incorrect destructor call or verbose syntax error message
3003 before the lookahead is translated. */
3004 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3008 YY_STACK_PRINT (yyss
, yyssp
);
3013 /* Now `shift' the result of the reduction. Determine what state
3014 that goes to, based on the state we popped back to and the rule
3015 number reduced by. */
3019 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3020 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3021 yystate
= yytable
[yystate
];
3023 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3028 /*------------------------------------.
3029 | yyerrlab -- here on detecting error |
3030 `------------------------------------*/
3032 /* Make sure we have latest lookahead translation. See comments at
3033 user semantic actions for why this is necessary. */
3034 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3036 /* If not already recovering from an error, report this error. */
3040 #if ! YYERROR_VERBOSE
3041 yyerror (YY_("syntax error"));
3043 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3044 yyesa, &yyes, &yyes_capacity, \
3047 char const *yymsgp
= YY_("syntax error");
3048 int yysyntax_error_status
;
3049 if (yychar
!= YYEMPTY
)
3051 yysyntax_error_status
= YYSYNTAX_ERROR
;
3052 if (yysyntax_error_status
== 0)
3054 else if (yysyntax_error_status
== 1)
3056 if (yymsg
!= yymsgbuf
)
3057 YYSTACK_FREE (yymsg
);
3058 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3062 yymsg_alloc
= sizeof yymsgbuf
;
3063 yysyntax_error_status
= 2;
3067 yysyntax_error_status
= YYSYNTAX_ERROR
;
3072 if (yysyntax_error_status
== 2)
3073 goto yyexhaustedlab
;
3075 # undef YYSYNTAX_ERROR
3079 yyerror_range
[1] = yylloc
;
3081 if (yyerrstatus
== 3)
3083 /* If just tried and failed to reuse lookahead token after an
3084 error, discard it. */
3086 if (yychar
<= YYEOF
)
3088 /* Return failure if at end of input. */
3089 if (yychar
== YYEOF
)
3094 yydestruct ("Error: discarding",
3095 yytoken
, &yylval
, &yylloc
);
3100 /* Else will try to reuse lookahead token after shifting the error
3105 /*---------------------------------------------------.
3106 | yyerrorlab -- error raised explicitly by YYERROR. |
3107 `---------------------------------------------------*/
3110 /* Pacify compilers like GCC when the user code never invokes
3111 YYERROR and the label yyerrorlab therefore never appears in user
3113 if (/*CONSTCOND*/ 0)
3116 yyerror_range
[1] = yylsp
[1-yylen
];
3117 /* Do not reclaim the symbols of the rule which action triggered
3121 YY_STACK_PRINT (yyss
, yyssp
);
3126 /*-------------------------------------------------------------.
3127 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3128 `-------------------------------------------------------------*/
3130 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3134 yyn
= yypact
[yystate
];
3135 if (!yypact_value_is_default (yyn
))
3138 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3146 /* Pop the current state because it cannot handle the error token. */
3150 yyerror_range
[1] = *yylsp
;
3151 yydestruct ("Error: popping",
3152 yystos
[yystate
], yyvsp
, yylsp
);
3155 YY_STACK_PRINT (yyss
, yyssp
);
3158 /* If the stack popping above didn't lose the initial context for the
3159 current lookahead token, the shift below will for sure. */
3160 YY_LAC_DISCARD ("error recovery");
3164 yyerror_range
[2] = yylloc
;
3165 /* Using YYLLOC is tempting, but would change the location of
3166 the lookahead. YYLOC is available though. */
3167 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3170 /* Shift the error token. */
3171 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3177 /*-------------------------------------.
3178 | yyacceptlab -- YYACCEPT comes here. |
3179 `-------------------------------------*/
3184 /*-----------------------------------.
3185 | yyabortlab -- YYABORT comes here. |
3186 `-----------------------------------*/
3192 /*-------------------------------------------------.
3193 | yyexhaustedlab -- memory exhaustion comes here. |
3194 `-------------------------------------------------*/
3196 yyerror (YY_("memory exhausted"));
3202 if (yychar
!= YYEMPTY
)
3204 /* Make sure we have latest lookahead translation. See comments at
3205 user semantic actions for why this is necessary. */
3206 yytoken
= YYTRANSLATE (yychar
);
3207 yydestruct ("Cleanup: discarding lookahead",
3208 yytoken
, &yylval
, &yylloc
);
3210 /* Do not reclaim the symbols of the rule which action triggered
3211 this YYABORT or YYACCEPT. */
3213 YY_STACK_PRINT (yyss
, yyssp
);
3214 while (yyssp
!= yyss
)
3216 yydestruct ("Cleanup: popping",
3217 yystos
[*yyssp
], yyvsp
, yylsp
);
3222 YYSTACK_FREE (yyss
);
3225 YYSTACK_FREE (yyes
);
3227 if (yymsg
!= yymsgbuf
)
3228 YYSTACK_FREE (yymsg
);
3230 /* Make sure YYID is used. */
3231 return YYID (yyresult
);
3236 /* Line 2071 of yacc.c */
3237 #line 670 "parse-gram.y"
3241 /* Return the location of the left-hand side of a rule whose
3242 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3243 the right-hand side, and return an empty location equal to the end
3244 boundary of RHS[0] if the right-hand side is empty. */
3247 lloc_default (YYLTYPE
const *rhs
, int n
)
3252 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3253 The bug is fixed in 7.4.2m, but play it safe for now. */
3254 loc
.start
= rhs
[n
].end
;
3255 loc
.end
= rhs
[n
].end
;
3257 /* Ignore empty nonterminals the start of the right-hand side.
3258 Do not bother to ignore them at the end of the right-hand side,
3259 since empty nonterminals have the same end as their predecessors. */
3260 for (i
= 1; i
<= n
; i
++)
3261 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3263 loc
.start
= rhs
[i
].start
;
3271 /* Add a lex-param or a parse-param (depending on TYPE) with
3272 declaration DECL and location LOC. */
3275 add_param (char const *type
, char *decl
, location loc
)
3277 static char const alphanum
[26 + 26 + 1 + 10] =
3278 "abcdefghijklmnopqrstuvwxyz"
3279 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3282 char const *name_start
= NULL
;
3285 /* Stop on last actual character. */
3286 for (p
= decl
; p
[1]; p
++)
3288 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3289 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3292 /* Strip the surrounding '{' and '}', and any blanks just inside
3294 while (*--p
== ' ' || *p
== '\t')
3297 while (*++decl
== ' ' || *decl
== '\t')
3301 complain_at (loc
, _("missing identifier in parameter declaration"));
3304 size_t name_len
= strspn (name_start
, alphanum
);
3305 char *name
= xmemdup (name_start
, name_len
+ 1);
3306 name
[name_len
] = '\0';
3307 muscle_pair_list_grow (type
, decl
, name
);
3311 gram_scanner_last_string_free ();
3316 version_check (location
const *loc
, char const *version
)
3318 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3320 complain_at (*loc
, "require bison %s, but have %s",
3321 version
, PACKAGE_VERSION
);
3327 gram_error (location
const *loc
, char const *msg
)
3329 complain_at (*loc
, "%s", msg
);
3333 token_name (int type
)
3335 return yytname
[YYTRANSLATE (type
)];
3346 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3347 return quotearg_style (escape_quoting_style
, buf
);