1 /* A Bison parser, made by GNU Bison 2.7.1087-c21e-dirty. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 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.7.1087-c21e-dirty"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Substitute the type names. */
62 #define YYSTYPE GRAM_STYPE
63 #define YYLTYPE GRAM_LTYPE
64 /* Substitute the variable and function names. */
65 #define yyparse gram_parse
66 #define yylex gram_lex
67 #define yyerror gram_error
68 #define yydebug gram_debug
69 #define yynerrs gram_nerrs
72 /* Copy the first part of user declarations. */
73 #line 1 "src/parse-gram.y" /* yacc.c:357 */
74 /* Bison Grammar Parser -*- C -*-
76 Copyright (C) 2002-2013 Free Software Foundation, Inc.
78 This file is part of Bison, the GNU Compiler Compiler.
80 This program is free software: you can redistribute it and/or modify
81 it under the terms of the GNU General Public License as published by
82 the Free Software Foundation, either version 3 of the License, or
83 (at your option) any later version.
85 This program is distributed in the hope that it will be useful,
86 but WITHOUT ANY WARRANTY; without even the implied warranty of
87 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88 GNU General Public License for more details.
90 You should have received a copy of the GNU General Public License
91 along with this program. If not, see <http://www.gnu.org/licenses/>. */
98 #include "conflicts.h"
102 #include "muscle-tab.h"
103 #include "named-ref.h"
104 #include "quotearg.h"
108 #include "scan-gram.h"
109 #include "scan-code.h"
110 #include "xmemdup0.h"
112 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
113 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
115 #define YY_LOCATION_PRINT(File, Loc) \
116 location_print (Loc, File)
118 static void version_check (location
const *loc
, char const *version
);
120 static void gram_error (location
const *, char const *);
122 /* A string that describes a char (e.g., 'a' -> "'a'"). */
123 static char const *char_name (char);
125 #line 126 "src/parse-gram.c" /* yacc.c:357 */
128 # if defined __cplusplus && 201103L <= __cplusplus
129 # define YY_NULL nullptr
135 /* Enabling verbose error messages. */
136 #ifdef YYERROR_VERBOSE
137 # undef YYERROR_VERBOSE
138 # define YYERROR_VERBOSE 1
140 # define YYERROR_VERBOSE 1
143 /* In a future release of Bison, this section will be replaced
144 by #include "src/parse-gram.h". */
145 #ifndef YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
146 # define YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
151 # define GRAM_DEBUG 1
153 # define GRAM_DEBUG 0
155 # else /* ! defined YYDEBUG */
156 # define GRAM_DEBUG 1
157 # endif /* ! defined YYDEBUG */
158 #endif /* ! defined GRAM_DEBUG */
160 extern int gram_debug
;
162 /* "%code requires" blocks. */
163 #line 219 "src/parse-gram.y" /* yacc.c:373 */
171 param_parse
= 1 << 1,
172 param_both
= param_lex
| param_parse
177 #line 178 "src/parse-gram.c" /* yacc.c:373 */
180 #ifndef GRAM_TOKENTYPE
181 # define GRAM_TOKENTYPE
190 PERCENT_DESTRUCTOR
= 263,
191 PERCENT_PRINTER
= 264,
194 PERCENT_NONASSOC
= 267,
195 PERCENT_PRECEDENCE
= 268,
200 PERCENT_DEFAULT_PREC
= 273,
201 PERCENT_DEFINE
= 274,
202 PERCENT_DEFINES
= 275,
203 PERCENT_ERROR_VERBOSE
= 276,
204 PERCENT_EXPECT
= 277,
205 PERCENT_EXPECT_RR
= 278,
207 PERCENT_FILE_PREFIX
= 280,
208 PERCENT_GLR_PARSER
= 281,
209 PERCENT_INITIAL_ACTION
= 282,
210 PERCENT_LANGUAGE
= 283,
211 PERCENT_NAME_PREFIX
= 284,
212 PERCENT_NO_DEFAULT_PREC
= 285,
213 PERCENT_NO_LINES
= 286,
214 PERCENT_NONDETERMINISTIC_PARSER
= 287,
215 PERCENT_OUTPUT
= 288,
216 PERCENT_REQUIRE
= 289,
217 PERCENT_SKELETON
= 290,
219 PERCENT_TOKEN_TABLE
= 292,
220 PERCENT_VERBOSE
= 293,
223 BRACED_PREDICATE
= 296,
230 PERCENT_PERCENT
= 303,
246 #define PERCENT_TOKEN 260
247 #define PERCENT_NTERM 261
248 #define PERCENT_TYPE 262
249 #define PERCENT_DESTRUCTOR 263
250 #define PERCENT_PRINTER 264
251 #define PERCENT_LEFT 265
252 #define PERCENT_RIGHT 266
253 #define PERCENT_NONASSOC 267
254 #define PERCENT_PRECEDENCE 268
255 #define PERCENT_PREC 269
256 #define PERCENT_DPREC 270
257 #define PERCENT_MERGE 271
258 #define PERCENT_CODE 272
259 #define PERCENT_DEFAULT_PREC 273
260 #define PERCENT_DEFINE 274
261 #define PERCENT_DEFINES 275
262 #define PERCENT_ERROR_VERBOSE 276
263 #define PERCENT_EXPECT 277
264 #define PERCENT_EXPECT_RR 278
265 #define PERCENT_FLAG 279
266 #define PERCENT_FILE_PREFIX 280
267 #define PERCENT_GLR_PARSER 281
268 #define PERCENT_INITIAL_ACTION 282
269 #define PERCENT_LANGUAGE 283
270 #define PERCENT_NAME_PREFIX 284
271 #define PERCENT_NO_DEFAULT_PREC 285
272 #define PERCENT_NO_LINES 286
273 #define PERCENT_NONDETERMINISTIC_PARSER 287
274 #define PERCENT_OUTPUT 288
275 #define PERCENT_REQUIRE 289
276 #define PERCENT_SKELETON 290
277 #define PERCENT_START 291
278 #define PERCENT_TOKEN_TABLE 292
279 #define PERCENT_VERBOSE 293
280 #define PERCENT_YACC 294
281 #define BRACED_CODE 295
282 #define BRACED_PREDICATE 296
283 #define BRACKETED_ID 297
289 #define PERCENT_PERCENT 303
292 #define SEMICOLON 306
296 #define PERCENT_PARAM 310
297 #define PERCENT_UNION 311
298 #define PERCENT_EMPTY 312
301 #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
302 typedef union GRAM_STYPE GRAM_STYPE
;
305 #line 105 "src/parse-gram.y" /* yacc.c:373 */
311 named_ref
*named_ref
;
315 unsigned char character
;
317 #line 243 "src/parse-gram.y" /* yacc.c:373 */
321 #line 419 "src/parse-gram.y" /* yacc.c:373 */
322 code_props_type code_type
;
324 #line 325 "src/parse-gram.c" /* yacc.c:373 */
326 # define GRAM_STYPE_IS_TRIVIAL 1
327 # define GRAM_STYPE_IS_DECLARED 1
331 #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
332 typedef struct GRAM_LTYPE GRAM_LTYPE
;
340 # define GRAM_LTYPE_IS_DECLARED 1
341 # define GRAM_LTYPE_IS_TRIVIAL 1
346 int gram_parse (void);
348 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */
350 /* Copy the second part of user declarations. */
352 #line 353 "src/parse-gram.c" /* yacc.c:376 */
353 /* Unqualified %code blocks. */
354 #line 54 "src/parse-gram.y" /* yacc.c:377 */
356 static int current_prec
= 0;
357 static location current_lhs_location
;
358 static named_ref
*current_lhs_named_ref
;
359 static symbol
*current_lhs_symbol
;
360 static symbol_class current_class
= unknown_sym
;
361 static uniqstr current_type
= NULL
;
363 /** Set the new current left-hand side symbol, possibly common
364 * to several right-hand side parts of rule.
368 current_lhs (symbol
*sym
, location loc
, named_ref
*ref
)
370 current_lhs_symbol
= sym
;
371 current_lhs_location
= loc
;
372 /* In order to simplify memory management, named references for lhs
373 are always assigned by deep copy into the current symbol_list
374 node. This is because a single named-ref in the grammar may
375 result in several uses when the user factors lhs between several
376 rules using "|". Therefore free the parser's original copy. */
377 free (current_lhs_named_ref
);
378 current_lhs_named_ref
= ref
;
381 #define YYTYPE_INT16 int_fast16_t
382 #define YYTYPE_INT8 int_fast8_t
383 #define YYTYPE_UINT16 uint_fast16_t
384 #define YYTYPE_UINT8 uint_fast8_t
386 #line 232 "src/parse-gram.y" /* yacc.c:377 */
388 /** Add a lex-param and/or a parse-param.
390 * \param type where to push this formal argument.
391 * \param decl the formal argument. Destroyed.
392 * \param loc the location in the source.
394 static void add_param (param_type type
, char *decl
, location loc
);
395 static param_type current_param
= param_none
;
398 #line 399 "src/parse-gram.c" /* yacc.c:377 */
405 typedef YYTYPE_UINT8 yytype_uint8
;
407 typedef unsigned char yytype_uint8
;
411 typedef YYTYPE_INT8 yytype_int8
;
413 typedef signed char yytype_int8
;
417 typedef YYTYPE_UINT16 yytype_uint16
;
419 typedef unsigned short int yytype_uint16
;
423 typedef YYTYPE_INT16 yytype_int16
;
425 typedef short int yytype_int16
;
429 # ifdef __SIZE_TYPE__
430 # define YYSIZE_T __SIZE_TYPE__
431 # elif defined size_t
432 # define YYSIZE_T size_t
433 # elif ! defined YYSIZE_T
434 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
435 # define YYSIZE_T size_t
437 # define YYSIZE_T unsigned int
441 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
444 # if defined YYENABLE_NLS && YYENABLE_NLS
446 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
447 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
451 # define YY_(Msgid) Msgid
455 /* Suppress unused-variable warnings by "using" E. */
457 # define YYUSE(E) ((void) (E))
459 # define YYUSE(E) /* empty */
464 /* The parser invokes alloca or malloc; define the necessary symbols. */
466 # ifdef YYSTACK_ALLOC
467 /* Pacify GCC's 'empty if-body' warning. */
468 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
469 # ifndef YYSTACK_ALLOC_MAXIMUM
470 /* The OS might guarantee only one guard page at the bottom of the stack,
471 and a page size can be as small as 4096 bytes. So we cannot safely
472 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
473 to allow for a few compiler-allocated temporary stack slots. */
474 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
477 # define YYSTACK_ALLOC YYMALLOC
478 # define YYSTACK_FREE YYFREE
479 # ifndef YYSTACK_ALLOC_MAXIMUM
480 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
482 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
483 && ! ((defined YYMALLOC || defined malloc) \
484 && (defined YYFREE || defined free)))
485 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
486 # ifndef EXIT_SUCCESS
487 # define EXIT_SUCCESS 0
491 # define YYMALLOC malloc
492 # if ! defined malloc && ! defined EXIT_SUCCESS
493 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
498 # if ! defined free && ! defined EXIT_SUCCESS
499 void free (void *); /* INFRINGES ON USER NAME SPACE */
503 # define YYCOPY_NEEDED 1
507 #if (! defined yyoverflow \
508 && (! defined __cplusplus \
509 || (defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL \
510 && defined GRAM_STYPE_IS_TRIVIAL && GRAM_STYPE_IS_TRIVIAL)))
512 /* A type that is properly aligned for any stack member. */
515 yytype_int16 yyss_alloc
;
520 /* The size of the maximum gap between one aligned stack and the next. */
521 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
523 /* The size of an array large to enough to hold all stacks, each with
525 # define YYSTACK_BYTES(N) \
526 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
527 + 2 * YYSTACK_GAP_MAXIMUM)
529 # define YYCOPY_NEEDED 1
531 /* Relocate STACK from its old location to the new one. The
532 local variables YYSIZE and YYSTACKSIZE give the old and new number of
533 elements in the stack, and YYPTR gives the new location of the
534 stack. Advance YYPTR to a properly aligned location for the next
536 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
539 YYSIZE_T yynewbytes; \
540 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
541 Stack = &yyptr->Stack_alloc; \
542 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
543 yyptr += yynewbytes / sizeof (*yyptr); \
549 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
550 /* Copy COUNT objects from SRC to DST. The source and destination do
553 # if defined __GNUC__ && 1 < __GNUC__
554 # define YYCOPY(Dst, Src, Count) \
555 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
557 # define YYCOPY(Dst, Src, Count) \
561 for (yyi = 0; yyi < (Count); yyi++) \
562 (Dst)[yyi] = (Src)[yyi]; \
567 #endif /* !YYCOPY_NEEDED */
569 /* YYFINAL -- State number of the termination state. */
571 /* YYLAST -- Last index in YYTABLE. */
574 /* YYNTOKENS -- Number of terminals. */
576 /* YYNNTS -- Number of nonterminals. */
578 /* YYNRULES -- Number of rules. */
580 /* YYNSTATES -- Number of states. */
581 #define YYNSTATES 144
583 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
584 by yylex, with out-of-bounds checking. */
586 #define YYMAXUTOK 312
588 #define YYTRANSLATE(YYX) \
589 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
591 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
592 as returned by yylex, without out-of-bounds checking. */
593 static const yytype_uint8 yytranslate
[] =
595 0, 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, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
621 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
622 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
623 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
624 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
625 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
630 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
631 static const yytype_uint16 yyrline
[] =
633 0, 268, 268, 277, 278, 282, 283, 293, 297, 302,
634 303, 308, 313, 314, 315, 316, 321, 330, 331, 332,
635 333, 334, 335, 335, 336, 337, 361, 362, 363, 364,
636 368, 369, 378, 379, 380, 384, 396, 400, 404, 411,
637 422, 423, 433, 434, 438, 450, 450, 455, 455, 460,
638 471, 486, 487, 488, 489, 493, 494, 499, 501, 506,
639 507, 512, 514, 519, 520, 524, 525, 529, 530, 531,
640 536, 541, 546, 552, 558, 569, 570, 579, 580, 586,
641 587, 588, 595, 595, 603, 604, 605, 610, 613, 615,
642 617, 619, 621, 623, 625, 630, 631, 641, 642, 647,
643 648, 649, 658, 678, 680, 689, 694, 695, 700, 708,
648 #if GRAM_DEBUG || YYERROR_VERBOSE || 1
649 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
650 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
651 static const char *const yytname
[] =
653 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
654 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
655 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
656 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
657 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
658 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
659 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
660 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
661 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
662 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
663 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
664 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
665 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
666 "\"%param\"", "\"%union\"", "\"%empty\"", "$accept", "input",
667 "prologue_declarations", "prologue_declaration", "$@1", "params",
668 "grammar_declaration", "code_props_type", "union_name",
669 "symbol_declaration", "$@2", "$@3", "precedence_declaration",
670 "precedence_declarator", "tag.opt", "symbols.prec", "symbol.prec",
671 "symbols.1", "generic_symlist", "generic_symlist_item", "tag",
672 "symbol_def", "symbol_defs.1", "grammar", "rules_or_grammar_declaration",
673 "rules", "$@4", "rhses.1", "rhs", "named_ref.opt", "variable",
674 "content.opt", "braceless", "id", "id_colon", "symbol", "string_as_id",
675 "epilogue.opt", YY_NULL
680 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
681 (internal) symbol number NUM (which must be that of a token). */
682 static const yytype_uint16 yytoknum
[] =
684 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
685 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
686 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
687 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
688 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
689 305, 306, 307, 308, 309, 310, 311, 312
693 #define YYPACT_NINF -99
695 #define yypact_value_is_default(Yystate) \
696 (!!((Yystate) == (-99)))
698 #define YYTABLE_NINF -110
700 #define yytable_value_is_error(Yytable_value) \
703 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
705 static const yytype_int16 yypact
[] =
707 -99, 5, 102, -99, -99, -99, -48, -99, -99, -99,
708 -99, -99, -99, 19, -99, 27, 52, -99, 56, 60,
709 -99, 67, -99, 34, 73, 76, -99, -99, -99, 86,
710 87, 88, 0, -99, -99, -99, 15, -99, -99, -99,
711 46, -99, -99, 54, -99, -99, 45, 4, 4, 0,
712 -99, 58, -99, -99, -99, 31, -99, -99, -99, -99,
713 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
714 -99, -99, 49, -99, 50, 1, -99, -99, 61, 62,
715 -99, 58, 32, -99, 0, -99, -99, 4, 84, 4,
716 0, -99, -99, -99, -99, -99, -99, -99, 72, -99,
717 -99, -99, -99, -99, 64, -99, -99, -99, -99, 32,
718 -99, -99, -99, 0, -99, 101, -99, 114, -99, -99,
719 -99, -99, -99, -99, -99, -99, -99, 12, 26, -99,
720 -99, 0, 138, 66, 61, -99, -99, 61, 26, -99,
724 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
725 Performed when YYTABLE does not specify something else to do. Zero
726 means the default is an error. */
727 static const yytype_uint8 yydefact
[] =
729 3, 0, 0, 1, 47, 45, 0, 40, 41, 51,
730 52, 53, 54, 0, 36, 0, 9, 11, 0, 0,
731 7, 0, 15, 0, 0, 0, 37, 19, 20, 0,
732 0, 0, 0, 26, 27, 28, 0, 6, 29, 22,
733 42, 4, 5, 0, 33, 32, 55, 0, 0, 0,
734 102, 0, 38, 98, 97, 99, 10, 12, 13, 14,
735 16, 17, 18, 21, 24, 25, 108, 104, 103, 106,
736 34, 107, 0, 105, 0, 0, 77, 79, 95, 0,
737 43, 0, 0, 56, 0, 70, 75, 48, 71, 46,
738 49, 61, 39, 101, 100, 8, 81, 80, 0, 78,
739 2, 96, 82, 31, 23, 44, 67, 68, 69, 35,
740 63, 66, 65, 50, 57, 59, 76, 72, 73, 62,
741 110, 87, 30, 64, 58, 60, 74, 83, 84, 87,
742 86, 0, 0, 0, 95, 90, 91, 95, 85, 92,
746 /* YYPGOTO[NTERM-NUM]. */
747 static const yytype_int16 yypgoto
[] =
749 -99, -99, -99, -99, -99, -99, 141, -99, -99, -99,
750 -99, -99, -99, -99, -99, -99, 33, -99, -99, 35,
751 -99, -7, 97, -99, 74, -99, -99, -99, 18, -98,
752 -99, -99, -13, 6, -99, -32, -73, -99
755 /* YYDEFGOTO[NTERM-NUM]. */
756 static const yytype_int16 yydefgoto
[] =
758 -1, 1, 2, 41, 79, 104, 74, 43, 81, 44,
759 48, 47, 45, 46, 84, 113, 114, 90, 109, 110,
760 111, 86, 87, 75, 76, 77, 121, 127, 128, 102,
761 55, 95, 52, 69, 78, 112, 71, 100
764 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
765 positive, shift that token. If negative, reduce the rule whose
766 number is the opposite. If YYTABLE_NINF, syntax error. */
767 static const yytype_int16 yytable
[] =
769 70, -109, 72, 66, 49, 3, 4, 5, 6, 7,
770 8, 9, 10, 11, 12, 118, 72, 91, 13, 14,
771 4, 5, 6, 7, 8, 9, 10, 11, 12, 66,
772 53, 26, 13, 14, 93, 66, 142, 32, 92, 143,
773 131, 132, 133, 67, 126, 26, 68, 67, 73, 98,
774 68, 32, 115, 88, 88, 56, 85, 40, 119, 50,
775 57, 129, 73, 130, 58, 51, 134, 135, 105, 67,
776 59, 40, 68, 54, 60, 67, 61, 94, 68, 62,
777 116, 115, 116, 136, 106, 107, 108, 66, 117, 63,
778 64, 65, 80, 88, 82, 88, 137, 83, 50, 139,
779 96, 97, 103, 101, 122, 125, 137, 4, 5, 6,
780 7, 8, 9, 10, 11, 12, 120, 66, 141, 13,
781 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
782 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
783 34, 35, 140, 42, 123, 89, 124, 138, 0, 99,
784 36, 0, 37, 38, 0, 0, 0, 39, 40
787 static const yytype_int16 yycheck
[] =
789 32, 0, 1, 3, 52, 0, 5, 6, 7, 8,
790 9, 10, 11, 12, 13, 88, 1, 49, 17, 18,
791 5, 6, 7, 8, 9, 10, 11, 12, 13, 3,
792 3, 30, 17, 18, 3, 3, 134, 36, 51, 137,
793 14, 15, 16, 43, 117, 30, 46, 43, 47, 48,
794 46, 36, 84, 47, 48, 3, 52, 56, 90, 40,
795 4, 49, 47, 51, 4, 46, 40, 41, 81, 43,
796 3, 56, 46, 46, 40, 43, 3, 46, 46, 3,
797 87, 113, 89, 57, 52, 53, 54, 3, 4, 3,
798 3, 3, 46, 87, 40, 89, 128, 52, 40, 131,
799 51, 51, 40, 42, 40, 4, 138, 5, 6, 7,
800 8, 9, 10, 11, 12, 13, 44, 3, 52, 17,
801 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
802 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
803 38, 39, 4, 2, 109, 48, 113, 129, -1, 75,
804 48, -1, 50, 51, -1, -1, -1, 55, 56
807 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
808 symbol of state STATE-NUM. */
809 static const yytype_uint8 yystos
[] =
811 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
812 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
813 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
814 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
815 56, 61, 64, 65, 67, 70, 71, 69, 68, 52,
816 40, 46, 90, 3, 46, 88, 3, 4, 4, 3,
817 40, 3, 3, 3, 3, 3, 3, 43, 46, 91,
818 93, 94, 1, 47, 64, 81, 82, 83, 92, 62,
819 46, 66, 40, 52, 72, 52, 79, 80, 91, 80,
820 75, 93, 90, 3, 46, 89, 51, 51, 48, 82,
821 95, 42, 87, 40, 63, 90, 52, 53, 54, 76,
822 77, 78, 93, 73, 74, 93, 79, 4, 94, 93,
823 44, 84, 40, 77, 74, 4, 94, 85, 86, 49,
824 51, 14, 15, 16, 40, 41, 57, 93, 86, 93,
828 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
829 static const yytype_uint8 yyr1
[] =
831 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
832 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
833 61, 61, 62, 61, 61, 61, 61, 61, 61, 61,
834 63, 63, 64, 64, 64, 64, 64, 64, 64, 64,
835 65, 65, 66, 66, 64, 68, 67, 69, 67, 67,
836 70, 71, 71, 71, 71, 72, 72, 73, 73, 74,
837 74, 75, 75, 76, 76, 77, 77, 78, 78, 78,
838 79, 79, 79, 79, 79, 80, 80, 81, 81, 82,
839 82, 82, 84, 83, 85, 85, 85, 86, 86, 86,
840 86, 86, 86, 86, 86, 87, 87, 88, 88, 89,
841 89, 89, 90, 91, 91, 92, 93, 93, 94, 95,
845 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
846 static const yytype_uint8 yyr2
[] =
848 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
849 2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
850 1, 2, 0, 3, 2, 2, 1, 1, 1, 1,
851 2, 1, 1, 1, 2, 3, 1, 1, 2, 3,
852 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
853 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
854 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
855 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
856 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
857 2, 2, 3, 3, 3, 0, 1, 1, 1, 0,
858 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
863 #define yyerrok (yyerrstatus = 0)
864 #define yyclearin (yychar = YYEMPTY)
868 #define YYACCEPT goto yyacceptlab
869 #define YYABORT goto yyabortlab
870 #define YYERROR goto yyerrorlab
873 #define YYRECOVERING() (!!yyerrstatus)
875 #define YYBACKUP(Token, Value) \
877 if (yychar == YYEMPTY) \
881 YYPOPSTACK (yylen); \
883 YY_LAC_DISCARD ("YYBACKUP"); \
888 yyerror (&yylloc, YY_("syntax error: cannot back up")); \
893 /* Error token number */
895 #define YYERRCODE 256
898 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
899 If N is 0, then set CURRENT to the empty location which ends
900 the previous symbol: RHS[0] (always defined). */
902 #ifndef YYLLOC_DEFAULT
903 # define YYLLOC_DEFAULT(Current, Rhs, N) \
907 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
908 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
909 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
910 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
914 (Current).first_line = (Current).last_line = \
915 YYRHSLOC (Rhs, 0).last_line; \
916 (Current).first_column = (Current).last_column = \
917 YYRHSLOC (Rhs, 0).last_column; \
922 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
925 /* Enable debugging if requested. */
929 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
930 # define YYFPRINTF fprintf
933 # define YYDPRINTF(Args) \
940 /* YY_LOCATION_PRINT -- Print the location on the stream.
941 This macro was not mandated originally: define only if we know
942 we won't break user code: when these are the locations we know. */
944 #ifndef YY_LOCATION_PRINT
945 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
947 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
949 __attribute__((__unused__
))
951 yy_location_print_ (FILE *yyo
, YYLTYPE
const * const yylocp
)
954 int end_col
= 0 != yylocp
->last_column
? yylocp
->last_column
- 1 : 0;
955 if (0 <= yylocp
->first_line
)
957 res
+= YYFPRINTF (yyo
, "%d", yylocp
->first_line
);
958 if (0 <= yylocp
->first_column
)
959 res
+= YYFPRINTF (yyo
, ".%d", yylocp
->first_column
);
961 if (0 <= yylocp
->last_line
)
963 if (yylocp
->first_line
< yylocp
->last_line
)
965 res
+= YYFPRINTF (yyo
, "-%d", yylocp
->last_line
);
967 res
+= YYFPRINTF (yyo
, ".%d", end_col
);
969 else if (0 <= end_col
&& yylocp
->first_column
< end_col
)
970 res
+= YYFPRINTF (yyo
, "-%d", end_col
);
975 # define YY_LOCATION_PRINT(File, Loc) \
976 yy_location_print_ (File, &(Loc))
979 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
984 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
988 YYFPRINTF (stderr, "%s ", Title); \
989 yy_symbol_print (stderr, \
990 Type, Value, Location); \
991 YYFPRINTF (stderr, "\n"); \
996 /*--------------------------------.
997 | Print this symbol on YYOUTPUT. |
998 `--------------------------------*/
1001 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1003 FILE *yyo
= yyoutput
;
1005 YYUSE (yylocationp
);
1009 if (yytype
< YYNTOKENS
)
1010 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1014 case 3: /* "string" */
1015 #line 192 "src/parse-gram.y" /* yacc.c:707 */
1016 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
1017 #line 1018 "src/parse-gram.c" /* yacc.c:707 */
1020 case 4: /* "integer" */
1021 #line 205 "src/parse-gram.y" /* yacc.c:707 */
1022 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
1023 #line 1024 "src/parse-gram.c" /* yacc.c:707 */
1026 case 24: /* "%<flag>" */
1027 #line 201 "src/parse-gram.y" /* yacc.c:707 */
1028 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1029 #line 1030 "src/parse-gram.c" /* yacc.c:707 */
1032 case 40: /* "{...}" */
1033 #line 194 "src/parse-gram.y" /* yacc.c:707 */
1034 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1035 #line 1036 "src/parse-gram.c" /* yacc.c:707 */
1038 case 42: /* "[identifier]" */
1039 #line 199 "src/parse-gram.y" /* yacc.c:707 */
1040 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1041 #line 1042 "src/parse-gram.c" /* yacc.c:707 */
1044 case 43: /* "char" */
1045 #line 186 "src/parse-gram.y" /* yacc.c:707 */
1046 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
1047 #line 1048 "src/parse-gram.c" /* yacc.c:707 */
1050 case 44: /* "epilogue" */
1051 #line 194 "src/parse-gram.y" /* yacc.c:707 */
1052 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1053 #line 1054 "src/parse-gram.c" /* yacc.c:707 */
1056 case 46: /* "identifier" */
1057 #line 198 "src/parse-gram.y" /* yacc.c:707 */
1058 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1059 #line 1060 "src/parse-gram.c" /* yacc.c:707 */
1062 case 47: /* "identifier:" */
1063 #line 200 "src/parse-gram.y" /* yacc.c:707 */
1064 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
1065 #line 1066 "src/parse-gram.c" /* yacc.c:707 */
1068 case 50: /* "%{...%}" */
1069 #line 194 "src/parse-gram.y" /* yacc.c:707 */
1070 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1071 #line 1072 "src/parse-gram.c" /* yacc.c:707 */
1074 case 52: /* "<tag>" */
1075 #line 202 "src/parse-gram.y" /* yacc.c:707 */
1076 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1077 #line 1078 "src/parse-gram.c" /* yacc.c:707 */
1080 case 55: /* "%param" */
1081 #line 248 "src/parse-gram.y" /* yacc.c:707 */
1083 switch (((*yyvaluep
).param
))
1085 #define CASE(In, Out) \
1086 case param_ ## In: fputs ("%" #Out, stderr); break
1087 CASE (lex
, lex
-param
);
1088 CASE (parse
, parse
-param
);
1091 case param_none
: aver (false); break;
1094 #line 1095 "src/parse-gram.c" /* yacc.c:707 */
1097 case 65: /* code_props_type */
1098 #line 420 "src/parse-gram.y" /* yacc.c:707 */
1099 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1100 #line 1101 "src/parse-gram.c" /* yacc.c:707 */
1103 case 74: /* symbol.prec */
1104 #line 208 "src/parse-gram.y" /* yacc.c:707 */
1105 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1106 #line 1107 "src/parse-gram.c" /* yacc.c:707 */
1110 #line 202 "src/parse-gram.y" /* yacc.c:707 */
1111 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1112 #line 1113 "src/parse-gram.c" /* yacc.c:707 */
1115 case 88: /* variable */
1116 #line 198 "src/parse-gram.y" /* yacc.c:707 */
1117 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1118 #line 1119 "src/parse-gram.c" /* yacc.c:707 */
1121 case 89: /* content.opt */
1122 #line 194 "src/parse-gram.y" /* yacc.c:707 */
1123 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1124 #line 1125 "src/parse-gram.c" /* yacc.c:707 */
1127 case 90: /* braceless */
1128 #line 194 "src/parse-gram.y" /* yacc.c:707 */
1129 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1130 #line 1131 "src/parse-gram.c" /* yacc.c:707 */
1134 #line 208 "src/parse-gram.y" /* yacc.c:707 */
1135 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1136 #line 1137 "src/parse-gram.c" /* yacc.c:707 */
1139 case 92: /* id_colon */
1140 #line 209 "src/parse-gram.y" /* yacc.c:707 */
1141 { fprintf (yyo
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1142 #line 1143 "src/parse-gram.c" /* yacc.c:707 */
1145 case 93: /* symbol */
1146 #line 208 "src/parse-gram.y" /* yacc.c:707 */
1147 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1148 #line 1149 "src/parse-gram.c" /* yacc.c:707 */
1151 case 94: /* string_as_id */
1152 #line 208 "src/parse-gram.y" /* yacc.c:707 */
1153 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1154 #line 1155 "src/parse-gram.c" /* yacc.c:707 */
1163 /*--------------------------------.
1164 | Print this symbol on YYOUTPUT. |
1165 `--------------------------------*/
1168 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1170 YYFPRINTF (yyoutput
, "%s %s (",
1171 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
1173 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1174 YYFPRINTF (yyoutput
, ": ");
1175 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1176 YYFPRINTF (yyoutput
, ")");
1179 /*------------------------------------------------------------------.
1180 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1182 `------------------------------------------------------------------*/
1185 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1187 YYFPRINTF (stderr
, "Stack now");
1188 for (; yybottom
<= yytop
; yybottom
++)
1190 int yybot
= *yybottom
;
1191 YYFPRINTF (stderr
, " %d", yybot
);
1193 YYFPRINTF (stderr
, "\n");
1196 # define YY_STACK_PRINT(Bottom, Top) \
1199 yy_stack_print ((Bottom), (Top)); \
1203 /*------------------------------------------------.
1204 | Report that the YYRULE is going to be reduced. |
1205 `------------------------------------------------*/
1208 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1210 unsigned long int yylno
= yyrline
[yyrule
];
1211 int yynrhs
= yyr2
[yyrule
];
1213 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1215 /* The symbols being reduced. */
1216 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1218 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1219 yy_symbol_print (stderr
,
1220 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1221 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1222 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1223 YYFPRINTF (stderr
, "\n");
1227 # define YY_REDUCE_PRINT(Rule) \
1230 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1233 /* Nonzero means print parse trace. It is left uninitialized so that
1234 multiple parsers can coexist. */
1236 #else /* !GRAM_DEBUG */
1237 # define YYDPRINTF(Args)
1238 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1239 # define YY_STACK_PRINT(Bottom, Top)
1240 # define YY_REDUCE_PRINT(Rule)
1241 #endif /* !GRAM_DEBUG */
1244 /* YYINITDEPTH -- initial size of the parser's stacks. */
1246 # define YYINITDEPTH 200
1249 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1250 if the built-in stack extension method is used).
1252 Do not make this value too large; the results are undefined if
1253 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1254 evaluated with infinite-precision integer arithmetic. */
1257 # define YYMAXDEPTH 10000
1260 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1261 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1262 stack, and such that *YYCAPACITY is the maximum number of elements it
1263 can hold without a reallocation, make sure there is enough room to
1264 store YYADD more elements. If not, allocate a new stack using
1265 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1266 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1267 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1268 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1269 required. Return 1 if memory is exhausted. */
1271 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1273 char const *yydebug_prefix
,
1274 char const *yydebug_suffix
,
1276 yytype_int16
**yybottom
,
1277 yytype_int16
*yybottom_no_free
,
1278 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1280 YYSIZE_T yysize_old
=
1281 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1282 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1283 if (*yycapacity
< yysize_new
)
1285 YYSIZE_T yyalloc
= 2 * yysize_new
;
1286 yytype_int16
*yybottom_new
;
1287 /* Use YYMAXDEPTH for maximum stack size given that the stack
1288 should never need to grow larger than the main state stack
1289 needs to grow without LAC. */
1290 if (YYMAXDEPTH
< yysize_new
)
1292 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1296 if (YYMAXDEPTH
< yyalloc
)
1297 yyalloc
= YYMAXDEPTH
;
1299 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1302 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1306 if (*yytop
!= yytop_empty
)
1308 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1309 *yytop
= yybottom_new
+ (yysize_old
- 1);
1311 if (*yybottom
!= yybottom_no_free
)
1312 YYSTACK_FREE (*yybottom
);
1313 *yybottom
= yybottom_new
;
1314 *yycapacity
= yyalloc
;
1319 /* Establish the initial context for the current lookahead if no initial
1320 context is currently established.
1322 We define a context as a snapshot of the parser stacks. We define
1323 the initial context for a lookahead as the context in which the
1324 parser initially examines that lookahead in order to select a
1325 syntactic action. Thus, if the lookahead eventually proves
1326 syntactically unacceptable (possibly in a later context reached via a
1327 series of reductions), the initial context can be used to determine
1328 the exact set of tokens that would be syntactically acceptable in the
1329 lookahead's place. Moreover, it is the context after which any
1330 further semantic actions would be erroneous because they would be
1331 determined by a syntactically unacceptable token.
1333 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1334 performed in an inconsistent state (which, for the purposes of LAC,
1335 includes consistent states that don't know they're consistent because
1336 their default reductions have been disabled). Iff there is a
1337 lookahead token, it should also be invoked before reporting a syntax
1338 error. This latter case is for the sake of the debugging output.
1340 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1341 follows. If no initial context is currently established for the
1342 current lookahead, then check if that lookahead can eventually be
1343 shifted if syntactic actions continue from the current context.
1344 Report a syntax error if it cannot. */
1345 #define YY_LAC_ESTABLISH \
1347 if (!yy_lac_established) \
1349 YYDPRINTF ((stderr, \
1350 "LAC: initial context established for %s\n", \
1351 yytname[yytoken])); \
1352 yy_lac_established = 1; \
1354 int yy_lac_status = \
1355 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1356 if (yy_lac_status == 2) \
1357 goto yyexhaustedlab; \
1358 if (yy_lac_status == 1) \
1364 /* Discard any previous initial lookahead context because of Event,
1365 which may be a lookahead change or an invalidation of the currently
1366 established initial context for the current lookahead.
1368 The most common example of a lookahead change is a shift. An example
1369 of both cases is syntax error recovery. That is, a syntax error
1370 occurs when the lookahead is syntactically erroneous for the
1371 currently established initial context, so error recovery manipulates
1372 the parser stacks to try to find a new initial context in which the
1373 current lookahead is syntactically acceptable. If it fails to find
1374 such a context, it discards the lookahead. */
1376 # define YY_LAC_DISCARD(Event) \
1378 if (yy_lac_established) \
1381 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1383 yy_lac_established = 0; \
1387 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1390 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1391 eventually (after perhaps some reductions) be shifted, return 1 if
1392 not, or return 2 if memory is exhausted. As preconditions and
1393 postconditions: *YYES_CAPACITY is the allocated size of the array to
1394 which *YYES points, and either *YYES = YYESA or *YYES points to an
1395 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1396 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1397 any old *YYES other than YYESA. */
1399 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1400 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1402 yytype_int16
*yyes_prev
= yyssp
;
1403 yytype_int16
*yyesp
= yyes_prev
;
1404 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1405 if (yytoken
== YYUNDEFTOK
)
1407 YYDPRINTF ((stderr
, " Always Err\n"));
1412 int yyrule
= yypact
[*yyesp
];
1413 if (yypact_value_is_default (yyrule
)
1414 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1415 || yycheck
[yyrule
] != yytoken
)
1417 yyrule
= yydefact
[*yyesp
];
1420 YYDPRINTF ((stderr
, " Err\n"));
1426 yyrule
= yytable
[yyrule
];
1427 if (yytable_value_is_error (yyrule
))
1429 YYDPRINTF ((stderr
, " Err\n"));
1434 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1440 YYSIZE_T yylen
= yyr2
[yyrule
];
1441 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1442 if (yyesp
!= yyes_prev
)
1444 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1457 yyesp
= yyes_prev
-= yylen
;
1462 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1463 yystate
= yypgoto
[yylhs
] + *yyesp
;
1464 if (yystate
< 0 || YYLAST
< yystate
1465 || yycheck
[yystate
] != *yyesp
)
1466 yystate
= yydefgoto
[yylhs
];
1468 yystate
= yytable
[yystate
];
1470 if (yyesp
== yyes_prev
)
1477 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1481 yyes
, yyesa
, &yyesp
, yyes_prev
))
1483 YYDPRINTF ((stderr
, "\n"));
1488 YYDPRINTF ((stderr
, " G%d", yystate
));
1497 # if defined __GLIBC__ && defined _STRING_H
1498 # define yystrlen strlen
1500 /* Return the length of YYSTR. */
1502 yystrlen (const char *yystr
)
1505 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1513 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1514 # define yystpcpy stpcpy
1516 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1519 yystpcpy (char *yydest
, const char *yysrc
)
1522 const char *yys
= yysrc
;
1524 while ((*yyd
++ = *yys
++) != '\0')
1533 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1534 quotes and backslashes, so that it's suitable for yyerror. The
1535 heuristic is that double-quoting is unnecessary unless the string
1536 contains an apostrophe, a comma, or backslash (other than
1537 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1538 null, do not copy; instead, return the length of what the result
1541 yytnamerr (char *yyres
, const char *yystr
)
1546 char const *yyp
= yystr
;
1553 goto do_not_strip_quotes
;
1557 goto do_not_strip_quotes
;
1570 do_not_strip_quotes
: ;
1574 return yystrlen (yystr
);
1576 return yystpcpy (yyres
, yystr
) - yyres
;
1580 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1581 about the unexpected token YYTOKEN for the state stack whose top is
1582 YYSSP. In order to see if a particular token T is a
1583 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1585 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1586 not large enough to hold the message. In that case, also set
1587 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1588 required number of bytes is too large to store or if
1589 yy_lac returned 2. */
1591 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1592 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1593 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1595 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1596 YYSIZE_T yysize
= yysize0
;
1597 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1598 /* Internationalized format string. */
1599 const char *yyformat
= YY_NULL
;
1600 /* Arguments of yyformat. */
1601 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1602 /* Number of reported tokens (one for the "unexpected", one per
1606 /* There are many possibilities here to consider:
1607 - If this state is a consistent state with a default action, then
1608 the only way this function was invoked is if the default action
1609 is an error action. In that case, don't check for expected
1610 tokens because there are none.
1611 - The only way there can be no lookahead present (in yychar) is if
1612 this state is a consistent state with a default action. Thus,
1613 detecting the absence of a lookahead is sufficient to determine
1614 that there is no unexpected or expected token to report. In that
1615 case, just report a simple "syntax error".
1616 - Don't assume there isn't a lookahead just because this state is a
1617 consistent state with a default action. There might have been a
1618 previous inconsistent state, consistent state with a non-default
1619 action, or user semantic action that manipulated yychar.
1620 In the first two cases, it might appear that the current syntax
1621 error should have been detected in the previous state when yy_lac
1622 was invoked. However, at that time, there might have been a
1623 different syntax error that discarded a different initial context
1624 during error recovery, leaving behind the current lookahead.
1626 if (yytoken
!= YYEMPTY
)
1628 int yyn
= yypact
[*yyssp
];
1629 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1630 yyarg
[yycount
++] = yytname
[yytoken
];
1631 if (!yypact_value_is_default (yyn
))
1635 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1636 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1639 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1641 if (yy_lac_status
== 2)
1643 if (yy_lac_status
== 1)
1646 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1652 yyarg
[yycount
++] = yytname
[yyx
];
1654 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1655 if (! (yysize
<= yysize1
1656 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1664 YYFPRINTF (stderr
, "No expected tokens.\n");
1670 # define YYCASE_(N, S) \
1674 YYCASE_(0, YY_("syntax error"));
1675 YYCASE_(1, YY_("syntax error, unexpected %s"));
1676 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1677 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1678 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1679 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1684 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1685 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1690 if (*yymsg_alloc
< yysize
)
1692 *yymsg_alloc
= 2 * yysize
;
1693 if (! (yysize
<= *yymsg_alloc
1694 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1695 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1699 /* Avoid sprintf, as that infringes on the user's name space.
1700 Don't have undefined behavior even if the translation
1701 produced a string with the wrong number of "%s"s. */
1705 while ((*yyp
= *yyformat
) != '\0')
1706 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1708 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1719 #endif /* YYERROR_VERBOSE */
1721 /*-----------------------------------------------.
1722 | Release the memory associated to this symbol. |
1723 `-----------------------------------------------*/
1726 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1729 YYUSE (yylocationp
);
1732 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1751 /* The lookahead symbol. */
1755 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1756 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1757 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1758 _Pragma ("GCC diagnostic push") \
1759 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1760 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1761 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1762 _Pragma ("GCC diagnostic pop")
1764 /* Default value used for initialization, for pacifying older GCCs
1765 or non-GCC compilers. */
1766 static YYSTYPE yyval_default
;
1767 # define YY_INITIAL_VALUE(Value) = Value
1769 static YYLTYPE yyloc_default
1770 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
1774 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1775 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1776 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1778 #ifndef YY_INITIAL_VALUE
1779 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1782 /* The semantic value of the lookahead symbol. */
1783 YYSTYPE yylval
YY_INITIAL_VALUE(yyval_default
);
1785 /* Location data for the lookahead symbol. */
1786 YYLTYPE yylloc
= yyloc_default
;
1789 /* Number of syntax errors so far. */
1793 /* Number of tokens to shift before error messages enabled. */
1796 /* The stacks and their tools:
1797 'yyss': related to states.
1798 'yyvs': related to semantic values.
1799 'yyls': related to locations.
1801 Refer to the stacks through separate pointers, to allow yyoverflow
1802 to reallocate them elsewhere. */
1804 /* The state stack. */
1805 yytype_int16 yyssa
[YYINITDEPTH
];
1807 yytype_int16
*yyssp
;
1809 /* The semantic value stack. */
1810 YYSTYPE yyvsa
[YYINITDEPTH
];
1814 /* The location stack. */
1815 YYLTYPE yylsa
[YYINITDEPTH
];
1819 /* The locations where the error started and ended. */
1820 YYLTYPE yyerror_range
[3];
1822 YYSIZE_T yystacksize
;
1824 yytype_int16 yyesa
[20];
1826 YYSIZE_T yyes_capacity
;
1828 int yy_lac_established
= 0;
1831 /* Lookahead token as an internal (translated) token number. */
1833 /* The variables used to return semantic value and location from the
1839 /* Buffer for error messages, and its allocated size. */
1841 char *yymsg
= yymsgbuf
;
1842 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1845 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1847 /* The number of symbols on the RHS of the reduced rule.
1848 Keep to zero when no symbol should be popped. */
1851 yyssp
= yyss
= yyssa
;
1852 yyvsp
= yyvs
= yyvsa
;
1853 yylsp
= yyls
= yylsa
;
1854 yystacksize
= YYINITDEPTH
;
1857 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1858 if (YYMAXDEPTH
< yyes_capacity
)
1859 yyes_capacity
= YYMAXDEPTH
;
1861 YYDPRINTF ((stderr
, "Starting parse\n"));
1866 yychar
= YYEMPTY
; /* Cause a token to be read. */
1868 /* User initialization code. */
1869 #line 97 "src/parse-gram.y" /* yacc.c:1452 */
1871 /* Bison's grammar can initial empty locations, hence a default
1872 location is needed. */
1873 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1874 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1876 #line 1877 "src/parse-gram.c" /* yacc.c:1452 */
1880 /*------------------------------------------------------------.
1881 | yynewstate -- Push a new state, which is found in yystate. |
1882 `------------------------------------------------------------*/
1884 /* In all cases, when you get here, the value and location stacks
1885 have just been pushed. So pushing a state here evens the stacks. */
1891 if (yyss
+ yystacksize
- 1 <= yyssp
)
1893 /* Get the current used size of the three stacks, in elements. */
1894 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1898 /* Give user a chance to reallocate the stack. Use copies of
1899 these so that the &'s don't force the real ones into
1901 YYSTYPE
*yyvs1
= yyvs
;
1902 yytype_int16
*yyss1
= yyss
;
1903 YYLTYPE
*yyls1
= yyls
;
1905 /* Each stack pointer address is followed by the size of the
1906 data in use in that stack, in bytes. This used to be a
1907 conditional around just the two extra args, but that might
1908 be undefined if yyoverflow is a macro. */
1909 yyoverflow (YY_("memory exhausted"),
1910 &yyss1
, yysize
* sizeof (*yyssp
),
1911 &yyvs1
, yysize
* sizeof (*yyvsp
),
1912 &yyls1
, yysize
* sizeof (*yylsp
),
1919 #else /* no yyoverflow */
1920 # ifndef YYSTACK_RELOCATE
1921 goto yyexhaustedlab
;
1923 /* Extend the stack our own way. */
1924 if (YYMAXDEPTH
<= yystacksize
)
1925 goto yyexhaustedlab
;
1927 if (YYMAXDEPTH
< yystacksize
)
1928 yystacksize
= YYMAXDEPTH
;
1931 yytype_int16
*yyss1
= yyss
;
1932 union yyalloc
*yyptr
=
1933 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1935 goto yyexhaustedlab
;
1936 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1937 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1938 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1939 # undef YYSTACK_RELOCATE
1941 YYSTACK_FREE (yyss1
);
1944 #endif /* no yyoverflow */
1946 yyssp
= yyss
+ yysize
- 1;
1947 yyvsp
= yyvs
+ yysize
- 1;
1948 yylsp
= yyls
+ yysize
- 1;
1950 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1951 (unsigned long int) yystacksize
));
1953 if (yyss
+ yystacksize
- 1 <= yyssp
)
1957 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1959 if (yystate
== YYFINAL
)
1969 /* Do appropriate processing given the current state. Read a
1970 lookahead token if we need one and don't already have one. */
1972 /* First try to decide what to do without reference to lookahead token. */
1973 yyn
= yypact
[yystate
];
1974 if (yypact_value_is_default (yyn
))
1977 /* Not known => get a lookahead token if don't already have one. */
1979 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1980 if (yychar
== YYEMPTY
)
1982 YYDPRINTF ((stderr
, "Reading a token: "));
1983 yychar
= yylex (&yylval
, &yylloc
);
1986 if (yychar
<= YYEOF
)
1988 yychar
= yytoken
= YYEOF
;
1989 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1993 yytoken
= YYTRANSLATE (yychar
);
1994 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1997 /* If the proper action on seeing token YYTOKEN is to reduce or to
1998 detect an error, take that action. */
2000 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2008 if (yytable_value_is_error (yyn
))
2015 /* Count tokens shifted since error; after three, turn off error
2020 /* Shift the lookahead token. */
2021 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2023 /* Discard the shifted token. */
2025 YY_LAC_DISCARD ("shift");
2028 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2030 YY_IGNORE_MAYBE_UNINITIALIZED_END
2035 /*-----------------------------------------------------------.
2036 | yydefault -- do the default action for the current state. |
2037 `-----------------------------------------------------------*/
2039 yyn
= yydefact
[yystate
];
2045 /*-----------------------------.
2046 | yyreduce -- Do a reduction. |
2047 `-----------------------------*/
2049 /* yyn is the number of a rule to reduce with. */
2052 /* If YYLEN is nonzero, implement the default value of the action:
2055 Otherwise, the following line sets YYVAL to garbage.
2056 This behavior is undocumented and Bison
2057 users should not rely upon it. Assigning to YYVAL
2058 unconditionally makes the parser a bit smaller, and it avoids a
2059 GCC warning that YYVAL may be used uninitialized. */
2060 yyval
= yyvsp
[1-yylen
];
2062 /* Default location. */
2063 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2064 YY_REDUCE_PRINT (yyn
);
2066 int yychar_backup
= yychar
;
2070 #line 284 "src/parse-gram.y" /* yacc.c:1669 */
2072 code_props plain_code
;
2073 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2074 code_props_translate_code (&plain_code
);
2075 gram_scanner_last_string_free ();
2076 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2077 plain_code
.code
, (yylsp
[0]));
2078 code_scanner_last_string_free ();
2080 #line 2081 "src/parse-gram.c" /* yacc.c:1669 */
2084 #line 294 "src/parse-gram.y" /* yacc.c:1669 */
2086 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2088 #line 2089 "src/parse-gram.c" /* yacc.c:1669 */
2092 #line 298 "src/parse-gram.y" /* yacc.c:1669 */
2094 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2095 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2097 #line 2098 "src/parse-gram.c" /* yacc.c:1669 */
2101 #line 302 "src/parse-gram.y" /* yacc.c:1669 */
2102 { defines_flag
= true; }
2103 #line 2104 "src/parse-gram.c" /* yacc.c:1669 */
2107 #line 304 "src/parse-gram.y" /* yacc.c:1669 */
2109 defines_flag
= true;
2110 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2112 #line 2113 "src/parse-gram.c" /* yacc.c:1669 */
2116 #line 309 "src/parse-gram.y" /* yacc.c:1669 */
2118 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2119 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2121 #line 2122 "src/parse-gram.c" /* yacc.c:1669 */
2125 #line 313 "src/parse-gram.y" /* yacc.c:1669 */
2126 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2127 #line 2128 "src/parse-gram.c" /* yacc.c:1669 */
2131 #line 314 "src/parse-gram.y" /* yacc.c:1669 */
2132 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2133 #line 2134 "src/parse-gram.c" /* yacc.c:1669 */
2137 #line 315 "src/parse-gram.y" /* yacc.c:1669 */
2138 { spec_file_prefix
= (yyvsp
[0].chars
); }
2139 #line 2140 "src/parse-gram.c" /* yacc.c:1669 */
2143 #line 317 "src/parse-gram.y" /* yacc.c:1669 */
2145 nondeterministic_parser
= true;
2148 #line 2149 "src/parse-gram.c" /* yacc.c:1669 */
2152 #line 322 "src/parse-gram.y" /* yacc.c:1669 */
2155 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2156 code_props_translate_code (&action
);
2157 gram_scanner_last_string_free ();
2158 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2159 code_scanner_last_string_free ();
2161 #line 2162 "src/parse-gram.c" /* yacc.c:1669 */
2165 #line 330 "src/parse-gram.y" /* yacc.c:1669 */
2166 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2167 #line 2168 "src/parse-gram.c" /* yacc.c:1669 */
2171 #line 331 "src/parse-gram.y" /* yacc.c:1669 */
2172 { spec_name_prefix
= (yyvsp
[0].chars
); }
2173 #line 2174 "src/parse-gram.c" /* yacc.c:1669 */
2177 #line 332 "src/parse-gram.y" /* yacc.c:1669 */
2178 { no_lines_flag
= true; }
2179 #line 2180 "src/parse-gram.c" /* yacc.c:1669 */
2183 #line 333 "src/parse-gram.y" /* yacc.c:1669 */
2184 { nondeterministic_parser
= true; }
2185 #line 2186 "src/parse-gram.c" /* yacc.c:1669 */
2189 #line 334 "src/parse-gram.y" /* yacc.c:1669 */
2190 { spec_outfile
= (yyvsp
[0].chars
); }
2191 #line 2192 "src/parse-gram.c" /* yacc.c:1669 */
2195 #line 335 "src/parse-gram.y" /* yacc.c:1669 */
2196 { current_param
= (yyvsp
[0].param
); }
2197 #line 2198 "src/parse-gram.c" /* yacc.c:1669 */
2201 #line 335 "src/parse-gram.y" /* yacc.c:1669 */
2202 { current_param
= param_none
; }
2203 #line 2204 "src/parse-gram.c" /* yacc.c:1669 */
2207 #line 336 "src/parse-gram.y" /* yacc.c:1669 */
2208 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2209 #line 2210 "src/parse-gram.c" /* yacc.c:1669 */
2213 #line 338 "src/parse-gram.y" /* yacc.c:1669 */
2215 char const *skeleton_user
= (yyvsp
[0].chars
);
2216 if (strchr (skeleton_user
, '/'))
2218 size_t dir_length
= strlen (current_file
);
2219 char *skeleton_build
;
2220 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2222 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2225 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2228 memcpy (skeleton_build
, current_file
, dir_length
);
2229 skeleton_build
[dir_length
++] = '/';
2231 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2232 skeleton_user
= uniqstr_new (skeleton_build
);
2233 free (skeleton_build
);
2235 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2237 #line 2238 "src/parse-gram.c" /* yacc.c:1669 */
2241 #line 361 "src/parse-gram.y" /* yacc.c:1669 */
2242 { token_table_flag
= true; }
2243 #line 2244 "src/parse-gram.c" /* yacc.c:1669 */
2247 #line 362 "src/parse-gram.y" /* yacc.c:1669 */
2248 { report_flag
|= report_states
; }
2249 #line 2250 "src/parse-gram.c" /* yacc.c:1669 */
2253 #line 363 "src/parse-gram.y" /* yacc.c:1669 */
2254 { yacc_flag
= true; }
2255 #line 2256 "src/parse-gram.c" /* yacc.c:1669 */
2259 #line 368 "src/parse-gram.y" /* yacc.c:1669 */
2260 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2261 #line 2262 "src/parse-gram.c" /* yacc.c:1669 */
2265 #line 369 "src/parse-gram.y" /* yacc.c:1669 */
2266 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2267 #line 2268 "src/parse-gram.c" /* yacc.c:1669 */
2271 #line 381 "src/parse-gram.y" /* yacc.c:1669 */
2273 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2275 #line 2276 "src/parse-gram.c" /* yacc.c:1669 */
2279 #line 385 "src/parse-gram.y" /* yacc.c:1669 */
2282 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2283 code_props_translate_code (&code
);
2286 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2287 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2288 symbol_list_free ((yyvsp
[0].list
));
2291 #line 2292 "src/parse-gram.c" /* yacc.c:1669 */
2295 #line 397 "src/parse-gram.y" /* yacc.c:1669 */
2297 default_prec
= true;
2299 #line 2300 "src/parse-gram.c" /* yacc.c:1669 */
2303 #line 401 "src/parse-gram.y" /* yacc.c:1669 */
2305 default_prec
= false;
2307 #line 2308 "src/parse-gram.c" /* yacc.c:1669 */
2311 #line 405 "src/parse-gram.y" /* yacc.c:1669 */
2313 /* Do not invoke muscle_percent_code_grow here since it invokes
2314 muscle_user_name_list_grow. */
2315 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2316 code_scanner_last_string_free ();
2318 #line 2319 "src/parse-gram.c" /* yacc.c:1669 */
2322 #line 412 "src/parse-gram.y" /* yacc.c:1669 */
2324 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2325 code_scanner_last_string_free ();
2327 #line 2328 "src/parse-gram.c" /* yacc.c:1669 */
2331 #line 422 "src/parse-gram.y" /* yacc.c:1669 */
2332 { (yyval
.code_type
) = destructor
; }
2333 #line 2334 "src/parse-gram.c" /* yacc.c:1669 */
2337 #line 423 "src/parse-gram.y" /* yacc.c:1669 */
2338 { (yyval
.code_type
) = printer
; }
2339 #line 2340 "src/parse-gram.c" /* yacc.c:1669 */
2343 #line 433 "src/parse-gram.y" /* yacc.c:1669 */
2345 #line 2346 "src/parse-gram.c" /* yacc.c:1669 */
2349 #line 434 "src/parse-gram.y" /* yacc.c:1669 */
2350 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2351 #line 2352 "src/parse-gram.c" /* yacc.c:1669 */
2355 #line 439 "src/parse-gram.y" /* yacc.c:1669 */
2358 muscle_code_grow ("union_members", (yyvsp
[0].chars
), (yylsp
[0]));
2359 code_scanner_last_string_free ();
2361 #line 2362 "src/parse-gram.c" /* yacc.c:1669 */
2365 #line 450 "src/parse-gram.y" /* yacc.c:1669 */
2366 { current_class
= nterm_sym
; }
2367 #line 2368 "src/parse-gram.c" /* yacc.c:1669 */
2371 #line 451 "src/parse-gram.y" /* yacc.c:1669 */
2373 current_class
= unknown_sym
;
2374 current_type
= NULL
;
2376 #line 2377 "src/parse-gram.c" /* yacc.c:1669 */
2380 #line 455 "src/parse-gram.y" /* yacc.c:1669 */
2381 { current_class
= token_sym
; }
2382 #line 2383 "src/parse-gram.c" /* yacc.c:1669 */
2386 #line 456 "src/parse-gram.y" /* yacc.c:1669 */
2388 current_class
= unknown_sym
;
2389 current_type
= NULL
;
2391 #line 2392 "src/parse-gram.c" /* yacc.c:1669 */
2395 #line 461 "src/parse-gram.y" /* yacc.c:1669 */
2399 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2400 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2401 symbol_list_free ((yyvsp
[0].list
));
2403 #line 2404 "src/parse-gram.c" /* yacc.c:1669 */
2407 #line 472 "src/parse-gram.y" /* yacc.c:1669 */
2411 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2413 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2414 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2416 symbol_list_free ((yyvsp
[0].list
));
2417 current_type
= NULL
;
2419 #line 2420 "src/parse-gram.c" /* yacc.c:1669 */
2423 #line 486 "src/parse-gram.y" /* yacc.c:1669 */
2424 { (yyval
.assoc
) = left_assoc
; }
2425 #line 2426 "src/parse-gram.c" /* yacc.c:1669 */
2429 #line 487 "src/parse-gram.y" /* yacc.c:1669 */
2430 { (yyval
.assoc
) = right_assoc
; }
2431 #line 2432 "src/parse-gram.c" /* yacc.c:1669 */
2435 #line 488 "src/parse-gram.y" /* yacc.c:1669 */
2436 { (yyval
.assoc
) = non_assoc
; }
2437 #line 2438 "src/parse-gram.c" /* yacc.c:1669 */
2441 #line 489 "src/parse-gram.y" /* yacc.c:1669 */
2442 { (yyval
.assoc
) = precedence_assoc
; }
2443 #line 2444 "src/parse-gram.c" /* yacc.c:1669 */
2447 #line 493 "src/parse-gram.y" /* yacc.c:1669 */
2448 { current_type
= NULL
; }
2449 #line 2450 "src/parse-gram.c" /* yacc.c:1669 */
2453 #line 494 "src/parse-gram.y" /* yacc.c:1669 */
2454 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2455 #line 2456 "src/parse-gram.c" /* yacc.c:1669 */
2459 #line 500 "src/parse-gram.y" /* yacc.c:1669 */
2460 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2461 #line 2462 "src/parse-gram.c" /* yacc.c:1669 */
2465 #line 502 "src/parse-gram.y" /* yacc.c:1669 */
2466 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2467 #line 2468 "src/parse-gram.c" /* yacc.c:1669 */
2471 #line 506 "src/parse-gram.y" /* yacc.c:1669 */
2472 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2473 #line 2474 "src/parse-gram.c" /* yacc.c:1669 */
2477 #line 507 "src/parse-gram.y" /* yacc.c:1669 */
2478 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2479 #line 2480 "src/parse-gram.c" /* yacc.c:1669 */
2483 #line 513 "src/parse-gram.y" /* yacc.c:1669 */
2484 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2485 #line 2486 "src/parse-gram.c" /* yacc.c:1669 */
2489 #line 515 "src/parse-gram.y" /* yacc.c:1669 */
2490 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2491 #line 2492 "src/parse-gram.c" /* yacc.c:1669 */
2495 #line 519 "src/parse-gram.y" /* yacc.c:1669 */
2496 { (yyval
.list
) = (yyvsp
[0].list
); }
2497 #line 2498 "src/parse-gram.c" /* yacc.c:1669 */
2501 #line 520 "src/parse-gram.y" /* yacc.c:1669 */
2502 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2503 #line 2504 "src/parse-gram.c" /* yacc.c:1669 */
2507 #line 524 "src/parse-gram.y" /* yacc.c:1669 */
2508 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2509 #line 2510 "src/parse-gram.c" /* yacc.c:1669 */
2513 #line 525 "src/parse-gram.y" /* yacc.c:1669 */
2514 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2515 #line 2516 "src/parse-gram.c" /* yacc.c:1669 */
2519 #line 530 "src/parse-gram.y" /* yacc.c:1669 */
2520 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2521 #line 2522 "src/parse-gram.c" /* yacc.c:1669 */
2525 #line 531 "src/parse-gram.y" /* yacc.c:1669 */
2526 { (yyval
.uniqstr
) = uniqstr_new (""); }
2527 #line 2528 "src/parse-gram.c" /* yacc.c:1669 */
2531 #line 537 "src/parse-gram.y" /* yacc.c:1669 */
2533 current_type
= (yyvsp
[0].uniqstr
);
2536 #line 2537 "src/parse-gram.c" /* yacc.c:1669 */
2540 #line 542 "src/parse-gram.y" /* yacc.c:1669 */
2542 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2543 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2545 #line 2546 "src/parse-gram.c" /* yacc.c:1669 */
2549 #line 547 "src/parse-gram.y" /* yacc.c:1669 */
2551 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2552 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2553 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2555 #line 2556 "src/parse-gram.c" /* yacc.c:1669 */
2559 #line 553 "src/parse-gram.y" /* yacc.c:1669 */
2561 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2562 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2563 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2565 #line 2566 "src/parse-gram.c" /* yacc.c:1669 */
2569 #line 559 "src/parse-gram.y" /* yacc.c:1669 */
2571 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2572 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2573 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2574 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2576 #line 2577 "src/parse-gram.c" /* yacc.c:1669 */
2580 #line 589 "src/parse-gram.y" /* yacc.c:1669 */
2584 #line 2585 "src/parse-gram.c" /* yacc.c:1669 */
2588 #line 595 "src/parse-gram.y" /* yacc.c:1669 */
2589 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2590 #line 2591 "src/parse-gram.c" /* yacc.c:1669 */
2594 #line 596 "src/parse-gram.y" /* yacc.c:1669 */
2596 /* Free the current lhs. */
2597 current_lhs (0, (yylsp
[-3]), 0);
2599 #line 2600 "src/parse-gram.c" /* yacc.c:1669 */
2603 #line 603 "src/parse-gram.y" /* yacc.c:1669 */
2604 { grammar_current_rule_end ((yylsp
[0])); }
2605 #line 2606 "src/parse-gram.c" /* yacc.c:1669 */
2609 #line 604 "src/parse-gram.y" /* yacc.c:1669 */
2610 { grammar_current_rule_end ((yylsp
[0])); }
2611 #line 2612 "src/parse-gram.c" /* yacc.c:1669 */
2615 #line 611 "src/parse-gram.y" /* yacc.c:1669 */
2616 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2617 current_lhs_named_ref
); }
2618 #line 2619 "src/parse-gram.c" /* yacc.c:1669 */
2622 #line 614 "src/parse-gram.y" /* yacc.c:1669 */
2623 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2624 #line 2625 "src/parse-gram.c" /* yacc.c:1669 */
2628 #line 616 "src/parse-gram.y" /* yacc.c:1669 */
2629 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2630 #line 2631 "src/parse-gram.c" /* yacc.c:1669 */
2634 #line 618 "src/parse-gram.y" /* yacc.c:1669 */
2635 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2636 #line 2637 "src/parse-gram.c" /* yacc.c:1669 */
2640 #line 620 "src/parse-gram.y" /* yacc.c:1669 */
2641 { grammar_current_rule_empty_set ((yylsp
[0])); }
2642 #line 2643 "src/parse-gram.c" /* yacc.c:1669 */
2646 #line 622 "src/parse-gram.y" /* yacc.c:1669 */
2647 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2648 #line 2649 "src/parse-gram.c" /* yacc.c:1669 */
2652 #line 624 "src/parse-gram.y" /* yacc.c:1669 */
2653 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2654 #line 2655 "src/parse-gram.c" /* yacc.c:1669 */
2658 #line 626 "src/parse-gram.y" /* yacc.c:1669 */
2659 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2660 #line 2661 "src/parse-gram.c" /* yacc.c:1669 */
2664 #line 630 "src/parse-gram.y" /* yacc.c:1669 */
2665 { (yyval
.named_ref
) = 0; }
2666 #line 2667 "src/parse-gram.c" /* yacc.c:1669 */
2670 #line 631 "src/parse-gram.y" /* yacc.c:1669 */
2671 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2672 #line 2673 "src/parse-gram.c" /* yacc.c:1669 */
2676 #line 642 "src/parse-gram.y" /* yacc.c:1669 */
2677 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2678 #line 2679 "src/parse-gram.c" /* yacc.c:1669 */
2682 #line 647 "src/parse-gram.y" /* yacc.c:1669 */
2683 { (yyval
.chars
) = ""; }
2684 #line 2685 "src/parse-gram.c" /* yacc.c:1669 */
2688 #line 648 "src/parse-gram.y" /* yacc.c:1669 */
2689 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2690 #line 2691 "src/parse-gram.c" /* yacc.c:1669 */
2694 #line 649 "src/parse-gram.y" /* yacc.c:1669 */
2695 { (yyval
.chars
) = (yyvsp
[0].chars
); }
2696 #line 2697 "src/parse-gram.c" /* yacc.c:1669 */
2700 #line 659 "src/parse-gram.y" /* yacc.c:1669 */
2702 code_props plain_code
;
2703 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2704 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2705 code_props_translate_code (&plain_code
);
2706 gram_scanner_last_string_free ();
2707 (yyval
.chars
) = plain_code
.code
;
2709 #line 2710 "src/parse-gram.c" /* yacc.c:1669 */
2713 #line 679 "src/parse-gram.y" /* yacc.c:1669 */
2714 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2715 #line 2716 "src/parse-gram.c" /* yacc.c:1669 */
2719 #line 681 "src/parse-gram.y" /* yacc.c:1669 */
2721 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2722 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2723 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2725 #line 2726 "src/parse-gram.c" /* yacc.c:1669 */
2729 #line 689 "src/parse-gram.y" /* yacc.c:1669 */
2730 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2731 #line 2732 "src/parse-gram.c" /* yacc.c:1669 */
2735 #line 701 "src/parse-gram.y" /* yacc.c:1669 */
2737 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2738 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2740 #line 2741 "src/parse-gram.c" /* yacc.c:1669 */
2744 #line 710 "src/parse-gram.y" /* yacc.c:1669 */
2746 code_props plain_code
;
2747 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2748 code_props_translate_code (&plain_code
);
2749 gram_scanner_last_string_free ();
2750 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2751 code_scanner_last_string_free ();
2753 #line 2754 "src/parse-gram.c" /* yacc.c:1669 */
2757 #line 2758 "src/parse-gram.c" /* yacc.c:1669 */
2760 if (yychar_backup
!= yychar
)
2761 YY_LAC_DISCARD ("yychar change");
2763 /* User semantic actions sometimes alter yychar, and that requires
2764 that yytoken be updated with the new translation. We take the
2765 approach of translating immediately before every use of yytoken.
2766 One alternative is translating here after every semantic action,
2767 but that translation would be missed if the semantic action invokes
2768 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2769 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2770 incorrect destructor might then be invoked immediately. In the
2771 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2772 to an incorrect destructor call or verbose syntax error message
2773 before the lookahead is translated. */
2774 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2778 YY_STACK_PRINT (yyss
, yyssp
);
2783 /* Now 'shift' the result of the reduction. Determine what state
2784 that goes to, based on the state we popped back to and the rule
2785 number reduced by. */
2789 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2790 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2791 yystate
= yytable
[yystate
];
2793 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2798 /*--------------------------------------.
2799 | yyerrlab -- here on detecting error. |
2800 `--------------------------------------*/
2802 /* Make sure we have latest lookahead translation. See comments at
2803 user semantic actions for why this is necessary. */
2804 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2806 /* If not already recovering from an error, report this error. */
2810 #if ! YYERROR_VERBOSE
2811 yyerror (&yylloc
, YY_("syntax error"));
2813 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2814 yyesa, &yyes, &yyes_capacity, \
2817 char const *yymsgp
= YY_("syntax error");
2818 int yysyntax_error_status
;
2819 if (yychar
!= YYEMPTY
)
2821 yysyntax_error_status
= YYSYNTAX_ERROR
;
2822 if (yysyntax_error_status
== 0)
2824 else if (yysyntax_error_status
== 1)
2826 if (yymsg
!= yymsgbuf
)
2827 YYSTACK_FREE (yymsg
);
2828 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2832 yymsg_alloc
= sizeof yymsgbuf
;
2833 yysyntax_error_status
= 2;
2837 yysyntax_error_status
= YYSYNTAX_ERROR
;
2841 yyerror (&yylloc
, yymsgp
);
2842 if (yysyntax_error_status
== 2)
2843 goto yyexhaustedlab
;
2845 # undef YYSYNTAX_ERROR
2849 yyerror_range
[1] = yylloc
;
2851 if (yyerrstatus
== 3)
2853 /* If just tried and failed to reuse lookahead token after an
2854 error, discard it. */
2856 if (yychar
<= YYEOF
)
2858 /* Return failure if at end of input. */
2859 if (yychar
== YYEOF
)
2864 yydestruct ("Error: discarding",
2865 yytoken
, &yylval
, &yylloc
);
2870 /* Else will try to reuse lookahead token after shifting the error
2875 /*---------------------------------------------------.
2876 | yyerrorlab -- error raised explicitly by YYERROR. |
2877 `---------------------------------------------------*/
2880 /* Pacify compilers like GCC when the user code never invokes
2881 YYERROR and the label yyerrorlab therefore never appears in user
2883 if (/*CONSTCOND*/ 0)
2886 yyerror_range
[1] = yylsp
[1-yylen
];
2887 /* Do not reclaim the symbols of the rule whose action triggered
2891 YY_STACK_PRINT (yyss
, yyssp
);
2896 /*-------------------------------------------------------------.
2897 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2898 `-------------------------------------------------------------*/
2900 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2904 yyn
= yypact
[yystate
];
2905 if (!yypact_value_is_default (yyn
))
2908 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2916 /* Pop the current state because it cannot handle the error token. */
2920 yyerror_range
[1] = *yylsp
;
2921 yydestruct ("Error: popping",
2922 yystos
[yystate
], yyvsp
, yylsp
);
2925 YY_STACK_PRINT (yyss
, yyssp
);
2928 /* If the stack popping above didn't lose the initial context for the
2929 current lookahead token, the shift below will for sure. */
2930 YY_LAC_DISCARD ("error recovery");
2932 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2934 YY_IGNORE_MAYBE_UNINITIALIZED_END
2936 yyerror_range
[2] = yylloc
;
2937 /* Using YYLLOC is tempting, but would change the location of
2938 the lookahead. YYLOC is available though. */
2939 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2942 /* Shift the error token. */
2943 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2949 /*-------------------------------------.
2950 | yyacceptlab -- YYACCEPT comes here. |
2951 `-------------------------------------*/
2956 /*-----------------------------------.
2957 | yyabortlab -- YYABORT comes here. |
2958 `-----------------------------------*/
2964 /*-------------------------------------------------.
2965 | yyexhaustedlab -- memory exhaustion comes here. |
2966 `-------------------------------------------------*/
2968 yyerror (&yylloc
, YY_("memory exhausted"));
2974 if (yychar
!= YYEMPTY
)
2976 /* Make sure we have latest lookahead translation. See comments at
2977 user semantic actions for why this is necessary. */
2978 yytoken
= YYTRANSLATE (yychar
);
2979 yydestruct ("Cleanup: discarding lookahead",
2980 yytoken
, &yylval
, &yylloc
);
2982 /* Do not reclaim the symbols of the rule whose action triggered
2983 this YYABORT or YYACCEPT. */
2985 YY_STACK_PRINT (yyss
, yyssp
);
2986 while (yyssp
!= yyss
)
2988 yydestruct ("Cleanup: popping",
2989 yystos
[*yyssp
], yyvsp
, yylsp
);
2994 YYSTACK_FREE (yyss
);
2997 YYSTACK_FREE (yyes
);
2999 if (yymsg
!= yymsgbuf
)
3000 YYSTACK_FREE (yymsg
);
3004 #line 720 "src/parse-gram.y" /* yacc.c:1929 */
3007 /* Return the location of the left-hand side of a rule whose
3008 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3009 the right-hand side, and return an empty location equal to the end
3010 boundary of RHS[0] if the right-hand side is empty. */
3013 lloc_default (YYLTYPE
const *rhs
, int n
)
3018 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3019 The bug is fixed in 7.4.2m, but play it safe for now. */
3020 loc
.start
= rhs
[n
].end
;
3021 loc
.end
= rhs
[n
].end
;
3023 /* Ignore empty nonterminals the start of the right-hand side.
3024 Do not bother to ignore them at the end of the right-hand side,
3025 since empty nonterminals have the same end as their predecessors. */
3026 for (i
= 1; i
<= n
; i
++)
3027 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3029 loc
.start
= rhs
[i
].start
;
3038 add_param (param_type type
, char *decl
, location loc
)
3040 static char const alphanum
[26 + 26 + 1 + 10] =
3041 "abcdefghijklmnopqrstuvwxyz"
3042 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3046 char const *name_start
= NULL
;
3049 /* Stop on last actual character. */
3050 for (p
= decl
; p
[1]; p
++)
3052 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3053 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3056 /* Strip the surrounding '{' and '}', and any blanks just inside
3059 while (c_isspace ((unsigned char) *p
))
3063 while (c_isspace ((unsigned char) *decl
))
3068 complain (&loc
, complaint
, _("missing identifier in parameter declaration"));
3071 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3072 if (type
& param_lex
)
3073 muscle_pair_list_grow ("lex_param", decl
, name
);
3074 if (type
& param_parse
)
3075 muscle_pair_list_grow ("parse_param", decl
, name
);
3079 gram_scanner_last_string_free ();
3084 version_check (location
const *loc
, char const *version
)
3086 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3088 complain (loc
, complaint
, "require bison %s, but have %s",
3089 version
, PACKAGE_VERSION
);
3095 gram_error (location
const *loc
, char const *msg
)
3097 complain (loc
, complaint
, "%s", msg
);
3101 token_name (int type
)
3103 return yytname
[YYTRANSLATE (type
)];
3114 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3115 return quotearg_style (escape_quoting_style
, buf
);