1 /* A Bison parser, made by GNU Bison 2.7.1127-02879-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.1127-02879-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:356 */
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:356 */
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:372 */
171 param_parse
= 1 << 1,
172 param_both
= param_lex
| param_parse
177 #line 178 "src/parse-gram.c" /* yacc.c:372 */
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,
244 #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
245 typedef union GRAM_STYPE GRAM_STYPE
;
248 #line 105 "src/parse-gram.y" /* yacc.c:372 */
254 named_ref
*named_ref
;
258 unsigned char character
;
260 #line 243 "src/parse-gram.y" /* yacc.c:372 */
264 #line 419 "src/parse-gram.y" /* yacc.c:372 */
265 code_props_type code_type
;
267 #line 268 "src/parse-gram.c" /* yacc.c:372 */
269 # define GRAM_STYPE_IS_TRIVIAL 1
270 # define GRAM_STYPE_IS_DECLARED 1
274 #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
275 typedef struct GRAM_LTYPE GRAM_LTYPE
;
283 # define GRAM_LTYPE_IS_DECLARED 1
284 # define GRAM_LTYPE_IS_TRIVIAL 1
289 int gram_parse (void);
291 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */
293 /* Copy the second part of user declarations. */
295 #line 296 "src/parse-gram.c" /* yacc.c:375 */
296 /* Unqualified %code blocks. */
297 #line 54 "src/parse-gram.y" /* yacc.c:376 */
299 static int current_prec
= 0;
300 static location current_lhs_location
;
301 static named_ref
*current_lhs_named_ref
;
302 static symbol
*current_lhs_symbol
;
303 static symbol_class current_class
= unknown_sym
;
304 static uniqstr current_type
= NULL
;
306 /** Set the new current left-hand side symbol, possibly common
307 * to several right-hand side parts of rule.
311 current_lhs (symbol
*sym
, location loc
, named_ref
*ref
)
313 current_lhs_symbol
= sym
;
314 current_lhs_location
= loc
;
315 /* In order to simplify memory management, named references for lhs
316 are always assigned by deep copy into the current symbol_list
317 node. This is because a single named-ref in the grammar may
318 result in several uses when the user factors lhs between several
319 rules using "|". Therefore free the parser's original copy. */
320 free (current_lhs_named_ref
);
321 current_lhs_named_ref
= ref
;
324 #define YYTYPE_INT16 int_fast16_t
325 #define YYTYPE_INT8 int_fast8_t
326 #define YYTYPE_UINT16 uint_fast16_t
327 #define YYTYPE_UINT8 uint_fast8_t
329 #line 232 "src/parse-gram.y" /* yacc.c:376 */
331 /** Add a lex-param and/or a parse-param.
333 * \param type where to push this formal argument.
334 * \param decl the formal argument. Destroyed.
335 * \param loc the location in the source.
337 static void add_param (param_type type
, char *decl
, location loc
);
338 static param_type current_param
= param_none
;
341 #line 342 "src/parse-gram.c" /* yacc.c:376 */
348 typedef YYTYPE_UINT8 yytype_uint8
;
350 typedef unsigned char yytype_uint8
;
354 typedef YYTYPE_INT8 yytype_int8
;
356 typedef signed char yytype_int8
;
360 typedef YYTYPE_UINT16 yytype_uint16
;
362 typedef unsigned short int yytype_uint16
;
366 typedef YYTYPE_INT16 yytype_int16
;
368 typedef short int yytype_int16
;
372 # ifdef __SIZE_TYPE__
373 # define YYSIZE_T __SIZE_TYPE__
374 # elif defined size_t
375 # define YYSIZE_T size_t
376 # elif ! defined YYSIZE_T
377 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
378 # define YYSIZE_T size_t
380 # define YYSIZE_T unsigned int
384 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
387 # if defined YYENABLE_NLS && YYENABLE_NLS
389 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
390 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
394 # define YY_(Msgid) Msgid
398 /* Suppress unused-variable warnings by "using" E. */
400 # define YYUSE(E) ((void) (E))
402 # define YYUSE(E) /* empty */
407 /* The parser invokes alloca or malloc; define the necessary symbols. */
409 # ifdef YYSTACK_ALLOC
410 /* Pacify GCC's 'empty if-body' warning. */
411 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
412 # ifndef YYSTACK_ALLOC_MAXIMUM
413 /* The OS might guarantee only one guard page at the bottom of the stack,
414 and a page size can be as small as 4096 bytes. So we cannot safely
415 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
416 to allow for a few compiler-allocated temporary stack slots. */
417 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
420 # define YYSTACK_ALLOC YYMALLOC
421 # define YYSTACK_FREE YYFREE
422 # ifndef YYSTACK_ALLOC_MAXIMUM
423 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
425 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
426 && ! ((defined YYMALLOC || defined malloc) \
427 && (defined YYFREE || defined free)))
428 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
429 # ifndef EXIT_SUCCESS
430 # define EXIT_SUCCESS 0
434 # define YYMALLOC malloc
435 # if ! defined malloc && ! defined EXIT_SUCCESS
436 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
441 # if ! defined free && ! defined EXIT_SUCCESS
442 void free (void *); /* INFRINGES ON USER NAME SPACE */
446 # define YYCOPY_NEEDED 1
450 #if (! defined yyoverflow \
451 && (! defined __cplusplus \
452 || (defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL \
453 && defined GRAM_STYPE_IS_TRIVIAL && GRAM_STYPE_IS_TRIVIAL)))
455 /* A type that is properly aligned for any stack member. */
458 yytype_int16 yyss_alloc
;
463 /* The size of the maximum gap between one aligned stack and the next. */
464 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
466 /* The size of an array large to enough to hold all stacks, each with
468 # define YYSTACK_BYTES(N) \
469 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
470 + 2 * YYSTACK_GAP_MAXIMUM)
472 # define YYCOPY_NEEDED 1
474 /* Relocate STACK from its old location to the new one. The
475 local variables YYSIZE and YYSTACKSIZE give the old and new number of
476 elements in the stack, and YYPTR gives the new location of the
477 stack. Advance YYPTR to a properly aligned location for the next
479 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
482 YYSIZE_T yynewbytes; \
483 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
484 Stack = &yyptr->Stack_alloc; \
485 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
486 yyptr += yynewbytes / sizeof (*yyptr); \
492 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
493 /* Copy COUNT objects from SRC to DST. The source and destination do
496 # if defined __GNUC__ && 1 < __GNUC__
497 # define YYCOPY(Dst, Src, Count) \
498 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
500 # define YYCOPY(Dst, Src, Count) \
504 for (yyi = 0; yyi < (Count); yyi++) \
505 (Dst)[yyi] = (Src)[yyi]; \
510 #endif /* !YYCOPY_NEEDED */
512 /* YYFINAL -- State number of the termination state. */
514 /* YYLAST -- Last index in YYTABLE. */
517 /* YYNTOKENS -- Number of terminals. */
519 /* YYNNTS -- Number of nonterminals. */
521 /* YYNRULES -- Number of rules. */
523 /* YYNSTATES -- Number of states. */
524 #define YYNSTATES 144
526 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
527 by yylex, with out-of-bounds checking. */
529 #define YYMAXUTOK 312
531 #define YYTRANSLATE(YYX) \
532 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
534 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
535 as returned by yylex, without out-of-bounds checking. */
536 static const yytype_uint8 yytranslate
[] =
538 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
564 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
565 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
566 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
567 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
568 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
573 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
574 static const yytype_uint16 yyrline
[] =
576 0, 268, 268, 277, 278, 282, 283, 293, 297, 302,
577 303, 308, 313, 314, 315, 316, 321, 330, 331, 332,
578 333, 334, 335, 335, 336, 337, 361, 362, 363, 364,
579 368, 369, 378, 379, 380, 384, 396, 400, 404, 411,
580 422, 423, 433, 434, 438, 450, 450, 455, 455, 460,
581 471, 486, 487, 488, 489, 493, 494, 499, 501, 506,
582 511, 521, 523, 528, 529, 533, 534, 538, 539, 540,
583 545, 550, 555, 561, 567, 578, 579, 588, 589, 595,
584 596, 597, 604, 604, 612, 613, 614, 619, 622, 624,
585 626, 628, 630, 632, 634, 639, 640, 650, 651, 656,
586 657, 658, 667, 687, 689, 698, 703, 704, 709, 717,
591 #if GRAM_DEBUG || YYERROR_VERBOSE || 1
592 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
593 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
594 static const char *const yytname
[] =
596 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
597 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
598 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
599 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
600 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
601 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
602 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
603 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
604 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
605 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
606 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
607 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
608 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
609 "\"%param\"", "\"%union\"", "\"%empty\"", "$accept", "input",
610 "prologue_declarations", "prologue_declaration", "$@1", "params",
611 "grammar_declaration", "code_props_type", "union_name",
612 "symbol_declaration", "$@2", "$@3", "precedence_declaration",
613 "precedence_declarator", "tag.opt", "symbols.prec", "symbol.prec",
614 "symbols.1", "generic_symlist", "generic_symlist_item", "tag",
615 "symbol_def", "symbol_defs.1", "grammar", "rules_or_grammar_declaration",
616 "rules", "$@4", "rhses.1", "rhs", "named_ref.opt", "variable",
617 "content.opt", "braceless", "id", "id_colon", "symbol", "string_as_id",
618 "epilogue.opt", YY_NULL
623 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
624 (internal) symbol number NUM (which must be that of a token). */
625 static const yytype_uint16 yytoknum
[] =
627 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
628 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
629 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
630 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
631 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
632 305, 306, 307, 308, 309, 310, 311, 312
636 #define YYPACT_NINF -99
638 #define yypact_value_is_default(Yystate) \
639 (!!((Yystate) == (-99)))
641 #define YYTABLE_NINF -110
643 #define yytable_value_is_error(Yytable_value) \
646 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
648 static const yytype_int16 yypact
[] =
650 -99, 5, 102, -99, -99, -99, -48, -99, -99, -99,
651 -99, -99, -99, 19, -99, 27, 52, -99, 56, 60,
652 -99, 67, -99, 34, 73, 76, -99, -99, -99, 86,
653 87, 88, 0, -99, -99, -99, 15, -99, -99, -99,
654 46, -99, -99, 54, -99, -99, 45, 4, 4, 0,
655 -99, 58, -99, -99, -99, 31, -99, -99, -99, -99,
656 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
657 -99, -99, 49, -99, 50, 1, -99, -99, 61, 62,
658 -99, 58, 32, -99, 0, -99, -99, 4, 84, 4,
659 0, -99, -99, -99, -99, -99, -99, -99, 72, -99,
660 -99, -99, -99, -99, 64, -99, -99, -99, -99, 32,
661 -99, -99, -99, 0, -99, 101, -99, 114, -99, -99,
662 -99, -99, -99, -99, -99, -99, -99, 12, 26, -99,
663 -99, 0, 138, 66, 61, -99, -99, 61, 26, -99,
667 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
668 Performed when YYTABLE does not specify something else to do. Zero
669 means the default is an error. */
670 static const yytype_uint8 yydefact
[] =
672 3, 0, 0, 1, 47, 45, 0, 40, 41, 51,
673 52, 53, 54, 0, 36, 0, 9, 11, 0, 0,
674 7, 0, 15, 0, 0, 0, 37, 19, 20, 0,
675 0, 0, 0, 26, 27, 28, 0, 6, 29, 22,
676 42, 4, 5, 0, 33, 32, 55, 0, 0, 0,
677 102, 0, 38, 98, 97, 99, 10, 12, 13, 14,
678 16, 17, 18, 21, 24, 25, 108, 104, 103, 106,
679 34, 107, 0, 105, 0, 0, 77, 79, 95, 0,
680 43, 0, 0, 56, 0, 70, 75, 48, 71, 46,
681 49, 61, 39, 101, 100, 8, 81, 80, 0, 78,
682 2, 96, 82, 31, 23, 44, 67, 68, 69, 35,
683 63, 66, 65, 50, 57, 59, 76, 72, 73, 62,
684 110, 87, 30, 64, 58, 60, 74, 83, 84, 87,
685 86, 0, 0, 0, 95, 90, 91, 95, 85, 92,
689 /* YYPGOTO[NTERM-NUM]. */
690 static const yytype_int16 yypgoto
[] =
692 -99, -99, -99, -99, -99, -99, 141, -99, -99, -99,
693 -99, -99, -99, -99, -99, -99, 33, -99, -99, 35,
694 -99, -7, 97, -99, 74, -99, -99, -99, 18, -98,
695 -99, -99, -13, 6, -99, -32, -73, -99
698 /* YYDEFGOTO[NTERM-NUM]. */
699 static const yytype_int16 yydefgoto
[] =
701 -1, 1, 2, 41, 79, 104, 74, 43, 81, 44,
702 48, 47, 45, 46, 84, 113, 114, 90, 109, 110,
703 111, 86, 87, 75, 76, 77, 121, 127, 128, 102,
704 55, 95, 52, 69, 78, 112, 71, 100
707 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
708 positive, shift that token. If negative, reduce the rule whose
709 number is the opposite. If YYTABLE_NINF, syntax error. */
710 static const yytype_int16 yytable
[] =
712 70, -109, 72, 66, 49, 3, 4, 5, 6, 7,
713 8, 9, 10, 11, 12, 118, 72, 91, 13, 14,
714 4, 5, 6, 7, 8, 9, 10, 11, 12, 66,
715 53, 26, 13, 14, 93, 66, 142, 32, 92, 143,
716 131, 132, 133, 67, 126, 26, 68, 67, 73, 98,
717 68, 32, 115, 88, 88, 56, 85, 40, 119, 50,
718 57, 129, 73, 130, 58, 51, 134, 135, 105, 67,
719 59, 40, 68, 54, 60, 67, 61, 94, 68, 62,
720 116, 115, 116, 136, 106, 107, 108, 66, 117, 63,
721 64, 65, 80, 88, 82, 88, 137, 83, 50, 139,
722 96, 97, 103, 101, 122, 125, 137, 4, 5, 6,
723 7, 8, 9, 10, 11, 12, 120, 66, 141, 13,
724 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
725 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
726 34, 35, 140, 42, 123, 89, 124, 138, 0, 99,
727 36, 0, 37, 38, 0, 0, 0, 39, 40
730 static const yytype_int16 yycheck
[] =
732 32, 0, 1, 3, 52, 0, 5, 6, 7, 8,
733 9, 10, 11, 12, 13, 88, 1, 49, 17, 18,
734 5, 6, 7, 8, 9, 10, 11, 12, 13, 3,
735 3, 30, 17, 18, 3, 3, 134, 36, 51, 137,
736 14, 15, 16, 43, 117, 30, 46, 43, 47, 48,
737 46, 36, 84, 47, 48, 3, 52, 56, 90, 40,
738 4, 49, 47, 51, 4, 46, 40, 41, 81, 43,
739 3, 56, 46, 46, 40, 43, 3, 46, 46, 3,
740 87, 113, 89, 57, 52, 53, 54, 3, 4, 3,
741 3, 3, 46, 87, 40, 89, 128, 52, 40, 131,
742 51, 51, 40, 42, 40, 4, 138, 5, 6, 7,
743 8, 9, 10, 11, 12, 13, 44, 3, 52, 17,
744 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
745 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
746 38, 39, 4, 2, 109, 48, 113, 129, -1, 75,
747 48, -1, 50, 51, -1, -1, -1, 55, 56
750 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
751 symbol of state STATE-NUM. */
752 static const yytype_uint8 yystos
[] =
754 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
755 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
756 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
757 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
758 56, 61, 64, 65, 67, 70, 71, 69, 68, 52,
759 40, 46, 90, 3, 46, 88, 3, 4, 4, 3,
760 40, 3, 3, 3, 3, 3, 3, 43, 46, 91,
761 93, 94, 1, 47, 64, 81, 82, 83, 92, 62,
762 46, 66, 40, 52, 72, 52, 79, 80, 91, 80,
763 75, 93, 90, 3, 46, 89, 51, 51, 48, 82,
764 95, 42, 87, 40, 63, 90, 52, 53, 54, 76,
765 77, 78, 93, 73, 74, 93, 79, 4, 94, 93,
766 44, 84, 40, 77, 74, 4, 94, 85, 86, 49,
767 51, 14, 15, 16, 40, 41, 57, 93, 86, 93,
771 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
772 static const yytype_uint8 yyr1
[] =
774 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
775 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
776 61, 61, 62, 61, 61, 61, 61, 61, 61, 61,
777 63, 63, 64, 64, 64, 64, 64, 64, 64, 64,
778 65, 65, 66, 66, 64, 68, 67, 69, 67, 67,
779 70, 71, 71, 71, 71, 72, 72, 73, 73, 74,
780 74, 75, 75, 76, 76, 77, 77, 78, 78, 78,
781 79, 79, 79, 79, 79, 80, 80, 81, 81, 82,
782 82, 82, 84, 83, 85, 85, 85, 86, 86, 86,
783 86, 86, 86, 86, 86, 87, 87, 88, 88, 89,
784 89, 89, 90, 91, 91, 92, 93, 93, 94, 95,
788 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
789 static const yytype_uint8 yyr2
[] =
791 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
792 2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
793 1, 2, 0, 3, 2, 2, 1, 1, 1, 1,
794 2, 1, 1, 1, 2, 3, 1, 1, 2, 3,
795 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
796 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
797 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
798 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
799 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
800 2, 2, 3, 3, 3, 0, 1, 1, 1, 0,
801 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
806 #define yyerrok (yyerrstatus = 0)
807 #define yyclearin (yychar = YYEMPTY)
811 #define YYACCEPT goto yyacceptlab
812 #define YYABORT goto yyabortlab
813 #define YYERROR goto yyerrorlab
816 #define YYRECOVERING() (!!yyerrstatus)
818 #define YYBACKUP(Token, Value) \
820 if (yychar == YYEMPTY) \
824 YYPOPSTACK (yylen); \
826 YY_LAC_DISCARD ("YYBACKUP"); \
831 yyerror (&yylloc, YY_("syntax error: cannot back up")); \
836 /* Error token number */
838 #define YYERRCODE 256
841 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
842 If N is 0, then set CURRENT to the empty location which ends
843 the previous symbol: RHS[0] (always defined). */
845 #ifndef YYLLOC_DEFAULT
846 # define YYLLOC_DEFAULT(Current, Rhs, N) \
850 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
851 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
852 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
853 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
857 (Current).first_line = (Current).last_line = \
858 YYRHSLOC (Rhs, 0).last_line; \
859 (Current).first_column = (Current).last_column = \
860 YYRHSLOC (Rhs, 0).last_column; \
865 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
868 /* Enable debugging if requested. */
872 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
873 # define YYFPRINTF fprintf
876 # define YYDPRINTF(Args) \
883 /* YY_LOCATION_PRINT -- Print the location on the stream.
884 This macro was not mandated originally: define only if we know
885 we won't break user code: when these are the locations we know. */
887 #ifndef YY_LOCATION_PRINT
888 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
890 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
892 __attribute__((__unused__
))
894 yy_location_print_ (FILE *yyo
, YYLTYPE
const * const yylocp
)
897 int end_col
= 0 != yylocp
->last_column
? yylocp
->last_column
- 1 : 0;
898 if (0 <= yylocp
->first_line
)
900 res
+= YYFPRINTF (yyo
, "%d", yylocp
->first_line
);
901 if (0 <= yylocp
->first_column
)
902 res
+= YYFPRINTF (yyo
, ".%d", yylocp
->first_column
);
904 if (0 <= yylocp
->last_line
)
906 if (yylocp
->first_line
< yylocp
->last_line
)
908 res
+= YYFPRINTF (yyo
, "-%d", yylocp
->last_line
);
910 res
+= YYFPRINTF (yyo
, ".%d", end_col
);
912 else if (0 <= end_col
&& yylocp
->first_column
< end_col
)
913 res
+= YYFPRINTF (yyo
, "-%d", end_col
);
918 # define YY_LOCATION_PRINT(File, Loc) \
919 yy_location_print_ (File, &(Loc))
922 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
927 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
931 YYFPRINTF (stderr, "%s ", Title); \
932 yy_symbol_print (stderr, \
933 Type, Value, Location); \
934 YYFPRINTF (stderr, "\n"); \
939 /*--------------------------------.
940 | Print this symbol on YYOUTPUT. |
941 `--------------------------------*/
944 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
946 FILE *yyo
= yyoutput
;
952 if (yytype
< YYNTOKENS
)
953 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
957 case 3: /* "string" */
958 #line 192 "src/parse-gram.y" /* yacc.c:706 */
959 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
960 #line 961 "src/parse-gram.c" /* yacc.c:706 */
963 case 4: /* "integer" */
964 #line 205 "src/parse-gram.y" /* yacc.c:706 */
965 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
966 #line 967 "src/parse-gram.c" /* yacc.c:706 */
969 case 24: /* "%<flag>" */
970 #line 201 "src/parse-gram.y" /* yacc.c:706 */
971 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
972 #line 973 "src/parse-gram.c" /* yacc.c:706 */
975 case 40: /* "{...}" */
976 #line 194 "src/parse-gram.y" /* yacc.c:706 */
977 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
978 #line 979 "src/parse-gram.c" /* yacc.c:706 */
981 case 42: /* "[identifier]" */
982 #line 199 "src/parse-gram.y" /* yacc.c:706 */
983 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
984 #line 985 "src/parse-gram.c" /* yacc.c:706 */
987 case 43: /* "char" */
988 #line 186 "src/parse-gram.y" /* yacc.c:706 */
989 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
990 #line 991 "src/parse-gram.c" /* yacc.c:706 */
993 case 44: /* "epilogue" */
994 #line 194 "src/parse-gram.y" /* yacc.c:706 */
995 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
996 #line 997 "src/parse-gram.c" /* yacc.c:706 */
999 case 46: /* "identifier" */
1000 #line 198 "src/parse-gram.y" /* yacc.c:706 */
1001 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1002 #line 1003 "src/parse-gram.c" /* yacc.c:706 */
1005 case 47: /* "identifier:" */
1006 #line 200 "src/parse-gram.y" /* yacc.c:706 */
1007 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
1008 #line 1009 "src/parse-gram.c" /* yacc.c:706 */
1011 case 50: /* "%{...%}" */
1012 #line 194 "src/parse-gram.y" /* yacc.c:706 */
1013 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1014 #line 1015 "src/parse-gram.c" /* yacc.c:706 */
1017 case 52: /* "<tag>" */
1018 #line 202 "src/parse-gram.y" /* yacc.c:706 */
1019 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1020 #line 1021 "src/parse-gram.c" /* yacc.c:706 */
1023 case 55: /* "%param" */
1024 #line 248 "src/parse-gram.y" /* yacc.c:706 */
1026 switch (((*yyvaluep
).param
))
1028 #define CASE(In, Out) \
1029 case param_ ## In: fputs ("%" #Out, stderr); break
1030 CASE (lex
, lex
-param
);
1031 CASE (parse
, parse
-param
);
1034 case param_none
: aver (false); break;
1037 #line 1038 "src/parse-gram.c" /* yacc.c:706 */
1040 case 65: /* code_props_type */
1041 #line 420 "src/parse-gram.y" /* yacc.c:706 */
1042 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1043 #line 1044 "src/parse-gram.c" /* yacc.c:706 */
1046 case 74: /* symbol.prec */
1047 #line 208 "src/parse-gram.y" /* yacc.c:706 */
1048 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1049 #line 1050 "src/parse-gram.c" /* yacc.c:706 */
1053 #line 202 "src/parse-gram.y" /* yacc.c:706 */
1054 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1055 #line 1056 "src/parse-gram.c" /* yacc.c:706 */
1058 case 88: /* variable */
1059 #line 198 "src/parse-gram.y" /* yacc.c:706 */
1060 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1061 #line 1062 "src/parse-gram.c" /* yacc.c:706 */
1064 case 89: /* content.opt */
1065 #line 194 "src/parse-gram.y" /* yacc.c:706 */
1066 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1067 #line 1068 "src/parse-gram.c" /* yacc.c:706 */
1070 case 90: /* braceless */
1071 #line 194 "src/parse-gram.y" /* yacc.c:706 */
1072 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1073 #line 1074 "src/parse-gram.c" /* yacc.c:706 */
1077 #line 208 "src/parse-gram.y" /* yacc.c:706 */
1078 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1079 #line 1080 "src/parse-gram.c" /* yacc.c:706 */
1082 case 92: /* id_colon */
1083 #line 209 "src/parse-gram.y" /* yacc.c:706 */
1084 { fprintf (yyo
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1085 #line 1086 "src/parse-gram.c" /* yacc.c:706 */
1088 case 93: /* symbol */
1089 #line 208 "src/parse-gram.y" /* yacc.c:706 */
1090 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1091 #line 1092 "src/parse-gram.c" /* yacc.c:706 */
1094 case 94: /* string_as_id */
1095 #line 208 "src/parse-gram.y" /* yacc.c:706 */
1096 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1097 #line 1098 "src/parse-gram.c" /* yacc.c:706 */
1106 /*--------------------------------.
1107 | Print this symbol on YYOUTPUT. |
1108 `--------------------------------*/
1111 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1113 YYFPRINTF (yyoutput
, "%s %s (",
1114 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
1116 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1117 YYFPRINTF (yyoutput
, ": ");
1118 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1119 YYFPRINTF (yyoutput
, ")");
1122 /*------------------------------------------------------------------.
1123 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1125 `------------------------------------------------------------------*/
1128 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1130 YYFPRINTF (stderr
, "Stack now");
1131 for (; yybottom
<= yytop
; yybottom
++)
1133 int yybot
= *yybottom
;
1134 YYFPRINTF (stderr
, " %d", yybot
);
1136 YYFPRINTF (stderr
, "\n");
1139 # define YY_STACK_PRINT(Bottom, Top) \
1142 yy_stack_print ((Bottom), (Top)); \
1146 /*------------------------------------------------.
1147 | Report that the YYRULE is going to be reduced. |
1148 `------------------------------------------------*/
1151 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1153 unsigned long int yylno
= yyrline
[yyrule
];
1154 int yynrhs
= yyr2
[yyrule
];
1156 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1158 /* The symbols being reduced. */
1159 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1161 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1162 yy_symbol_print (stderr
,
1163 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1164 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1165 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1166 YYFPRINTF (stderr
, "\n");
1170 # define YY_REDUCE_PRINT(Rule) \
1173 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1176 /* Nonzero means print parse trace. It is left uninitialized so that
1177 multiple parsers can coexist. */
1179 #else /* !GRAM_DEBUG */
1180 # define YYDPRINTF(Args)
1181 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1182 # define YY_STACK_PRINT(Bottom, Top)
1183 # define YY_REDUCE_PRINT(Rule)
1184 #endif /* !GRAM_DEBUG */
1187 /* YYINITDEPTH -- initial size of the parser's stacks. */
1189 # define YYINITDEPTH 200
1192 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1193 if the built-in stack extension method is used).
1195 Do not make this value too large; the results are undefined if
1196 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1197 evaluated with infinite-precision integer arithmetic. */
1200 # define YYMAXDEPTH 10000
1203 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1204 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1205 stack, and such that *YYCAPACITY is the maximum number of elements it
1206 can hold without a reallocation, make sure there is enough room to
1207 store YYADD more elements. If not, allocate a new stack using
1208 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1209 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1210 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1211 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1212 required. Return 1 if memory is exhausted. */
1214 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1216 char const *yydebug_prefix
,
1217 char const *yydebug_suffix
,
1219 yytype_int16
**yybottom
,
1220 yytype_int16
*yybottom_no_free
,
1221 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1223 YYSIZE_T yysize_old
=
1224 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1225 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1226 if (*yycapacity
< yysize_new
)
1228 YYSIZE_T yyalloc
= 2 * yysize_new
;
1229 yytype_int16
*yybottom_new
;
1230 /* Use YYMAXDEPTH for maximum stack size given that the stack
1231 should never need to grow larger than the main state stack
1232 needs to grow without LAC. */
1233 if (YYMAXDEPTH
< yysize_new
)
1235 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1239 if (YYMAXDEPTH
< yyalloc
)
1240 yyalloc
= YYMAXDEPTH
;
1242 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1245 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1249 if (*yytop
!= yytop_empty
)
1251 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1252 *yytop
= yybottom_new
+ (yysize_old
- 1);
1254 if (*yybottom
!= yybottom_no_free
)
1255 YYSTACK_FREE (*yybottom
);
1256 *yybottom
= yybottom_new
;
1257 *yycapacity
= yyalloc
;
1262 /* Establish the initial context for the current lookahead if no initial
1263 context is currently established.
1265 We define a context as a snapshot of the parser stacks. We define
1266 the initial context for a lookahead as the context in which the
1267 parser initially examines that lookahead in order to select a
1268 syntactic action. Thus, if the lookahead eventually proves
1269 syntactically unacceptable (possibly in a later context reached via a
1270 series of reductions), the initial context can be used to determine
1271 the exact set of tokens that would be syntactically acceptable in the
1272 lookahead's place. Moreover, it is the context after which any
1273 further semantic actions would be erroneous because they would be
1274 determined by a syntactically unacceptable token.
1276 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1277 performed in an inconsistent state (which, for the purposes of LAC,
1278 includes consistent states that don't know they're consistent because
1279 their default reductions have been disabled). Iff there is a
1280 lookahead token, it should also be invoked before reporting a syntax
1281 error. This latter case is for the sake of the debugging output.
1283 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1284 follows. If no initial context is currently established for the
1285 current lookahead, then check if that lookahead can eventually be
1286 shifted if syntactic actions continue from the current context.
1287 Report a syntax error if it cannot. */
1288 #define YY_LAC_ESTABLISH \
1290 if (!yy_lac_established) \
1292 YYDPRINTF ((stderr, \
1293 "LAC: initial context established for %s\n", \
1294 yytname[yytoken])); \
1295 yy_lac_established = 1; \
1297 int yy_lac_status = \
1298 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1299 if (yy_lac_status == 2) \
1300 goto yyexhaustedlab; \
1301 if (yy_lac_status == 1) \
1307 /* Discard any previous initial lookahead context because of Event,
1308 which may be a lookahead change or an invalidation of the currently
1309 established initial context for the current lookahead.
1311 The most common example of a lookahead change is a shift. An example
1312 of both cases is syntax error recovery. That is, a syntax error
1313 occurs when the lookahead is syntactically erroneous for the
1314 currently established initial context, so error recovery manipulates
1315 the parser stacks to try to find a new initial context in which the
1316 current lookahead is syntactically acceptable. If it fails to find
1317 such a context, it discards the lookahead. */
1319 # define YY_LAC_DISCARD(Event) \
1321 if (yy_lac_established) \
1324 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1326 yy_lac_established = 0; \
1330 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1333 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1334 eventually (after perhaps some reductions) be shifted, return 1 if
1335 not, or return 2 if memory is exhausted. As preconditions and
1336 postconditions: *YYES_CAPACITY is the allocated size of the array to
1337 which *YYES points, and either *YYES = YYESA or *YYES points to an
1338 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1339 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1340 any old *YYES other than YYESA. */
1342 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1343 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1345 yytype_int16
*yyes_prev
= yyssp
;
1346 yytype_int16
*yyesp
= yyes_prev
;
1347 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1348 if (yytoken
== YYUNDEFTOK
)
1350 YYDPRINTF ((stderr
, " Always Err\n"));
1355 int yyrule
= yypact
[*yyesp
];
1356 if (yypact_value_is_default (yyrule
)
1357 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1358 || yycheck
[yyrule
] != yytoken
)
1360 yyrule
= yydefact
[*yyesp
];
1363 YYDPRINTF ((stderr
, " Err\n"));
1369 yyrule
= yytable
[yyrule
];
1370 if (yytable_value_is_error (yyrule
))
1372 YYDPRINTF ((stderr
, " Err\n"));
1377 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1383 YYSIZE_T yylen
= yyr2
[yyrule
];
1384 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1385 if (yyesp
!= yyes_prev
)
1387 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1400 yyesp
= yyes_prev
-= yylen
;
1405 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1406 yystate
= yypgoto
[yylhs
] + *yyesp
;
1407 if (yystate
< 0 || YYLAST
< yystate
1408 || yycheck
[yystate
] != *yyesp
)
1409 yystate
= yydefgoto
[yylhs
];
1411 yystate
= yytable
[yystate
];
1413 if (yyesp
== yyes_prev
)
1420 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1424 yyes
, yyesa
, &yyesp
, yyes_prev
))
1426 YYDPRINTF ((stderr
, "\n"));
1431 YYDPRINTF ((stderr
, " G%d", yystate
));
1440 # if defined __GLIBC__ && defined _STRING_H
1441 # define yystrlen strlen
1443 /* Return the length of YYSTR. */
1445 yystrlen (const char *yystr
)
1448 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1456 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1457 # define yystpcpy stpcpy
1459 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1462 yystpcpy (char *yydest
, const char *yysrc
)
1465 const char *yys
= yysrc
;
1467 while ((*yyd
++ = *yys
++) != '\0')
1476 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1477 quotes and backslashes, so that it's suitable for yyerror. The
1478 heuristic is that double-quoting is unnecessary unless the string
1479 contains an apostrophe, a comma, or backslash (other than
1480 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1481 null, do not copy; instead, return the length of what the result
1484 yytnamerr (char *yyres
, const char *yystr
)
1489 char const *yyp
= yystr
;
1496 goto do_not_strip_quotes
;
1500 goto do_not_strip_quotes
;
1513 do_not_strip_quotes
: ;
1517 return yystrlen (yystr
);
1519 return yystpcpy (yyres
, yystr
) - yyres
;
1523 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1524 about the unexpected token YYTOKEN for the state stack whose top is
1525 YYSSP. In order to see if a particular token T is a
1526 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1528 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1529 not large enough to hold the message. In that case, also set
1530 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1531 required number of bytes is too large to store or if
1532 yy_lac returned 2. */
1534 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1535 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1536 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1538 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1539 YYSIZE_T yysize
= yysize0
;
1540 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1541 /* Internationalized format string. */
1542 const char *yyformat
= YY_NULL
;
1543 /* Arguments of yyformat. */
1544 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1545 /* Number of reported tokens (one for the "unexpected", one per
1549 /* There are many possibilities here to consider:
1550 - If this state is a consistent state with a default action, then
1551 the only way this function was invoked is if the default action
1552 is an error action. In that case, don't check for expected
1553 tokens because there are none.
1554 - The only way there can be no lookahead present (in yychar) is if
1555 this state is a consistent state with a default action. Thus,
1556 detecting the absence of a lookahead is sufficient to determine
1557 that there is no unexpected or expected token to report. In that
1558 case, just report a simple "syntax error".
1559 - Don't assume there isn't a lookahead just because this state is a
1560 consistent state with a default action. There might have been a
1561 previous inconsistent state, consistent state with a non-default
1562 action, or user semantic action that manipulated yychar.
1563 In the first two cases, it might appear that the current syntax
1564 error should have been detected in the previous state when yy_lac
1565 was invoked. However, at that time, there might have been a
1566 different syntax error that discarded a different initial context
1567 during error recovery, leaving behind the current lookahead.
1569 if (yytoken
!= YYEMPTY
)
1571 int yyn
= yypact
[*yyssp
];
1572 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1573 yyarg
[yycount
++] = yytname
[yytoken
];
1574 if (!yypact_value_is_default (yyn
))
1578 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1579 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1582 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1584 if (yy_lac_status
== 2)
1586 if (yy_lac_status
== 1)
1589 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1595 yyarg
[yycount
++] = yytname
[yyx
];
1597 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1598 if (! (yysize
<= yysize1
1599 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1607 YYFPRINTF (stderr
, "No expected tokens.\n");
1613 # define YYCASE_(N, S) \
1617 YYCASE_(0, YY_("syntax error"));
1618 YYCASE_(1, YY_("syntax error, unexpected %s"));
1619 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1620 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1621 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1622 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1627 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1628 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1633 if (*yymsg_alloc
< yysize
)
1635 *yymsg_alloc
= 2 * yysize
;
1636 if (! (yysize
<= *yymsg_alloc
1637 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1638 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1642 /* Avoid sprintf, as that infringes on the user's name space.
1643 Don't have undefined behavior even if the translation
1644 produced a string with the wrong number of "%s"s. */
1648 while ((*yyp
= *yyformat
) != '\0')
1649 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1651 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1662 #endif /* YYERROR_VERBOSE */
1664 /*-----------------------------------------------.
1665 | Release the memory associated to this symbol. |
1666 `-----------------------------------------------*/
1669 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1672 YYUSE (yylocationp
);
1675 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1694 /* The lookahead symbol. */
1698 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1699 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1700 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1701 _Pragma ("GCC diagnostic push") \
1702 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1703 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1704 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1705 _Pragma ("GCC diagnostic pop")
1707 /* Default value used for initialization, for pacifying older GCCs
1708 or non-GCC compilers. */
1709 static YYSTYPE yyval_default
;
1710 # define YY_INITIAL_VALUE(Value) = Value
1712 static YYLTYPE yyloc_default
1713 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
1717 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1718 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1719 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1721 #ifndef YY_INITIAL_VALUE
1722 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1725 /* The semantic value of the lookahead symbol. */
1726 YYSTYPE yylval
YY_INITIAL_VALUE(yyval_default
);
1728 /* Location data for the lookahead symbol. */
1729 YYLTYPE yylloc
= yyloc_default
;
1732 /* Number of syntax errors so far. */
1736 /* Number of tokens to shift before error messages enabled. */
1739 /* The stacks and their tools:
1740 'yyss': related to states.
1741 'yyvs': related to semantic values.
1742 'yyls': related to locations.
1744 Refer to the stacks through separate pointers, to allow yyoverflow
1745 to reallocate them elsewhere. */
1747 /* The state stack. */
1748 yytype_int16 yyssa
[YYINITDEPTH
];
1750 yytype_int16
*yyssp
;
1752 /* The semantic value stack. */
1753 YYSTYPE yyvsa
[YYINITDEPTH
];
1757 /* The location stack. */
1758 YYLTYPE yylsa
[YYINITDEPTH
];
1762 /* The locations where the error started and ended. */
1763 YYLTYPE yyerror_range
[3];
1765 YYSIZE_T yystacksize
;
1767 yytype_int16 yyesa
[20];
1769 YYSIZE_T yyes_capacity
;
1771 int yy_lac_established
= 0;
1774 /* Lookahead token as an internal (translated) token number. */
1776 /* The variables used to return semantic value and location from the
1782 /* Buffer for error messages, and its allocated size. */
1784 char *yymsg
= yymsgbuf
;
1785 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1788 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1790 /* The number of symbols on the RHS of the reduced rule.
1791 Keep to zero when no symbol should be popped. */
1794 yyssp
= yyss
= yyssa
;
1795 yyvsp
= yyvs
= yyvsa
;
1796 yylsp
= yyls
= yylsa
;
1797 yystacksize
= YYINITDEPTH
;
1800 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1801 if (YYMAXDEPTH
< yyes_capacity
)
1802 yyes_capacity
= YYMAXDEPTH
;
1804 YYDPRINTF ((stderr
, "Starting parse\n"));
1809 yychar
= YYEMPTY
; /* Cause a token to be read. */
1811 /* User initialization code. */
1812 #line 97 "src/parse-gram.y" /* yacc.c:1451 */
1814 /* Bison's grammar can initial empty locations, hence a default
1815 location is needed. */
1816 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1817 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1819 #line 1820 "src/parse-gram.c" /* yacc.c:1451 */
1823 /*------------------------------------------------------------.
1824 | yynewstate -- Push a new state, which is found in yystate. |
1825 `------------------------------------------------------------*/
1827 /* In all cases, when you get here, the value and location stacks
1828 have just been pushed. So pushing a state here evens the stacks. */
1834 if (yyss
+ yystacksize
- 1 <= yyssp
)
1836 /* Get the current used size of the three stacks, in elements. */
1837 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1841 /* Give user a chance to reallocate the stack. Use copies of
1842 these so that the &'s don't force the real ones into
1844 YYSTYPE
*yyvs1
= yyvs
;
1845 yytype_int16
*yyss1
= yyss
;
1846 YYLTYPE
*yyls1
= yyls
;
1848 /* Each stack pointer address is followed by the size of the
1849 data in use in that stack, in bytes. This used to be a
1850 conditional around just the two extra args, but that might
1851 be undefined if yyoverflow is a macro. */
1852 yyoverflow (YY_("memory exhausted"),
1853 &yyss1
, yysize
* sizeof (*yyssp
),
1854 &yyvs1
, yysize
* sizeof (*yyvsp
),
1855 &yyls1
, yysize
* sizeof (*yylsp
),
1862 #else /* no yyoverflow */
1863 # ifndef YYSTACK_RELOCATE
1864 goto yyexhaustedlab
;
1866 /* Extend the stack our own way. */
1867 if (YYMAXDEPTH
<= yystacksize
)
1868 goto yyexhaustedlab
;
1870 if (YYMAXDEPTH
< yystacksize
)
1871 yystacksize
= YYMAXDEPTH
;
1874 yytype_int16
*yyss1
= yyss
;
1875 union yyalloc
*yyptr
=
1876 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1878 goto yyexhaustedlab
;
1879 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1880 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1881 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1882 # undef YYSTACK_RELOCATE
1884 YYSTACK_FREE (yyss1
);
1887 #endif /* no yyoverflow */
1889 yyssp
= yyss
+ yysize
- 1;
1890 yyvsp
= yyvs
+ yysize
- 1;
1891 yylsp
= yyls
+ yysize
- 1;
1893 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1894 (unsigned long int) yystacksize
));
1896 if (yyss
+ yystacksize
- 1 <= yyssp
)
1900 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1902 if (yystate
== YYFINAL
)
1912 /* Do appropriate processing given the current state. Read a
1913 lookahead token if we need one and don't already have one. */
1915 /* First try to decide what to do without reference to lookahead token. */
1916 yyn
= yypact
[yystate
];
1917 if (yypact_value_is_default (yyn
))
1920 /* Not known => get a lookahead token if don't already have one. */
1922 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1923 if (yychar
== YYEMPTY
)
1925 YYDPRINTF ((stderr
, "Reading a token: "));
1926 yychar
= yylex (&yylval
, &yylloc
);
1929 if (yychar
<= YYEOF
)
1931 yychar
= yytoken
= YYEOF
;
1932 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1936 yytoken
= YYTRANSLATE (yychar
);
1937 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1940 /* If the proper action on seeing token YYTOKEN is to reduce or to
1941 detect an error, take that action. */
1943 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1951 if (yytable_value_is_error (yyn
))
1958 /* Count tokens shifted since error; after three, turn off error
1963 /* Shift the lookahead token. */
1964 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1966 /* Discard the shifted token. */
1968 YY_LAC_DISCARD ("shift");
1971 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1973 YY_IGNORE_MAYBE_UNINITIALIZED_END
1978 /*-----------------------------------------------------------.
1979 | yydefault -- do the default action for the current state. |
1980 `-----------------------------------------------------------*/
1982 yyn
= yydefact
[yystate
];
1988 /*-----------------------------.
1989 | yyreduce -- Do a reduction. |
1990 `-----------------------------*/
1992 /* yyn is the number of a rule to reduce with. */
1995 /* If YYLEN is nonzero, implement the default value of the action:
1998 Otherwise, the following line sets YYVAL to garbage.
1999 This behavior is undocumented and Bison
2000 users should not rely upon it. Assigning to YYVAL
2001 unconditionally makes the parser a bit smaller, and it avoids a
2002 GCC warning that YYVAL may be used uninitialized. */
2003 yyval
= yyvsp
[1-yylen
];
2005 /* Default location. */
2006 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2007 YY_REDUCE_PRINT (yyn
);
2009 int yychar_backup
= yychar
;
2013 #line 284 "src/parse-gram.y" /* yacc.c:1668 */
2015 code_props plain_code
;
2016 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2017 code_props_translate_code (&plain_code
);
2018 gram_scanner_last_string_free ();
2019 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2020 plain_code
.code
, (yylsp
[0]));
2021 code_scanner_last_string_free ();
2023 #line 2024 "src/parse-gram.c" /* yacc.c:1668 */
2027 #line 294 "src/parse-gram.y" /* yacc.c:1668 */
2029 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2031 #line 2032 "src/parse-gram.c" /* yacc.c:1668 */
2035 #line 298 "src/parse-gram.y" /* yacc.c:1668 */
2037 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2038 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2040 #line 2041 "src/parse-gram.c" /* yacc.c:1668 */
2044 #line 302 "src/parse-gram.y" /* yacc.c:1668 */
2045 { defines_flag
= true; }
2046 #line 2047 "src/parse-gram.c" /* yacc.c:1668 */
2050 #line 304 "src/parse-gram.y" /* yacc.c:1668 */
2052 defines_flag
= true;
2053 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2055 #line 2056 "src/parse-gram.c" /* yacc.c:1668 */
2059 #line 309 "src/parse-gram.y" /* yacc.c:1668 */
2061 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2062 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2064 #line 2065 "src/parse-gram.c" /* yacc.c:1668 */
2068 #line 313 "src/parse-gram.y" /* yacc.c:1668 */
2069 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2070 #line 2071 "src/parse-gram.c" /* yacc.c:1668 */
2074 #line 314 "src/parse-gram.y" /* yacc.c:1668 */
2075 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2076 #line 2077 "src/parse-gram.c" /* yacc.c:1668 */
2080 #line 315 "src/parse-gram.y" /* yacc.c:1668 */
2081 { spec_file_prefix
= (yyvsp
[0].chars
); }
2082 #line 2083 "src/parse-gram.c" /* yacc.c:1668 */
2086 #line 317 "src/parse-gram.y" /* yacc.c:1668 */
2088 nondeterministic_parser
= true;
2091 #line 2092 "src/parse-gram.c" /* yacc.c:1668 */
2095 #line 322 "src/parse-gram.y" /* yacc.c:1668 */
2098 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2099 code_props_translate_code (&action
);
2100 gram_scanner_last_string_free ();
2101 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2102 code_scanner_last_string_free ();
2104 #line 2105 "src/parse-gram.c" /* yacc.c:1668 */
2108 #line 330 "src/parse-gram.y" /* yacc.c:1668 */
2109 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2110 #line 2111 "src/parse-gram.c" /* yacc.c:1668 */
2114 #line 331 "src/parse-gram.y" /* yacc.c:1668 */
2115 { spec_name_prefix
= (yyvsp
[0].chars
); }
2116 #line 2117 "src/parse-gram.c" /* yacc.c:1668 */
2120 #line 332 "src/parse-gram.y" /* yacc.c:1668 */
2121 { no_lines_flag
= true; }
2122 #line 2123 "src/parse-gram.c" /* yacc.c:1668 */
2126 #line 333 "src/parse-gram.y" /* yacc.c:1668 */
2127 { nondeterministic_parser
= true; }
2128 #line 2129 "src/parse-gram.c" /* yacc.c:1668 */
2132 #line 334 "src/parse-gram.y" /* yacc.c:1668 */
2133 { spec_outfile
= (yyvsp
[0].chars
); }
2134 #line 2135 "src/parse-gram.c" /* yacc.c:1668 */
2138 #line 335 "src/parse-gram.y" /* yacc.c:1668 */
2139 { current_param
= (yyvsp
[0].param
); }
2140 #line 2141 "src/parse-gram.c" /* yacc.c:1668 */
2144 #line 335 "src/parse-gram.y" /* yacc.c:1668 */
2145 { current_param
= param_none
; }
2146 #line 2147 "src/parse-gram.c" /* yacc.c:1668 */
2150 #line 336 "src/parse-gram.y" /* yacc.c:1668 */
2151 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2152 #line 2153 "src/parse-gram.c" /* yacc.c:1668 */
2156 #line 338 "src/parse-gram.y" /* yacc.c:1668 */
2158 char const *skeleton_user
= (yyvsp
[0].chars
);
2159 if (strchr (skeleton_user
, '/'))
2161 size_t dir_length
= strlen (current_file
);
2162 char *skeleton_build
;
2163 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2165 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2168 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2171 memcpy (skeleton_build
, current_file
, dir_length
);
2172 skeleton_build
[dir_length
++] = '/';
2174 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2175 skeleton_user
= uniqstr_new (skeleton_build
);
2176 free (skeleton_build
);
2178 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2180 #line 2181 "src/parse-gram.c" /* yacc.c:1668 */
2184 #line 361 "src/parse-gram.y" /* yacc.c:1668 */
2185 { token_table_flag
= true; }
2186 #line 2187 "src/parse-gram.c" /* yacc.c:1668 */
2190 #line 362 "src/parse-gram.y" /* yacc.c:1668 */
2191 { report_flag
|= report_states
; }
2192 #line 2193 "src/parse-gram.c" /* yacc.c:1668 */
2196 #line 363 "src/parse-gram.y" /* yacc.c:1668 */
2197 { yacc_flag
= true; }
2198 #line 2199 "src/parse-gram.c" /* yacc.c:1668 */
2202 #line 368 "src/parse-gram.y" /* yacc.c:1668 */
2203 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2204 #line 2205 "src/parse-gram.c" /* yacc.c:1668 */
2208 #line 369 "src/parse-gram.y" /* yacc.c:1668 */
2209 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2210 #line 2211 "src/parse-gram.c" /* yacc.c:1668 */
2214 #line 381 "src/parse-gram.y" /* yacc.c:1668 */
2216 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2218 #line 2219 "src/parse-gram.c" /* yacc.c:1668 */
2222 #line 385 "src/parse-gram.y" /* yacc.c:1668 */
2225 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2226 code_props_translate_code (&code
);
2229 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2230 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2231 symbol_list_free ((yyvsp
[0].list
));
2234 #line 2235 "src/parse-gram.c" /* yacc.c:1668 */
2238 #line 397 "src/parse-gram.y" /* yacc.c:1668 */
2240 default_prec
= true;
2242 #line 2243 "src/parse-gram.c" /* yacc.c:1668 */
2246 #line 401 "src/parse-gram.y" /* yacc.c:1668 */
2248 default_prec
= false;
2250 #line 2251 "src/parse-gram.c" /* yacc.c:1668 */
2254 #line 405 "src/parse-gram.y" /* yacc.c:1668 */
2256 /* Do not invoke muscle_percent_code_grow here since it invokes
2257 muscle_user_name_list_grow. */
2258 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2259 code_scanner_last_string_free ();
2261 #line 2262 "src/parse-gram.c" /* yacc.c:1668 */
2265 #line 412 "src/parse-gram.y" /* yacc.c:1668 */
2267 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2268 code_scanner_last_string_free ();
2270 #line 2271 "src/parse-gram.c" /* yacc.c:1668 */
2274 #line 422 "src/parse-gram.y" /* yacc.c:1668 */
2275 { (yyval
.code_type
) = destructor
; }
2276 #line 2277 "src/parse-gram.c" /* yacc.c:1668 */
2280 #line 423 "src/parse-gram.y" /* yacc.c:1668 */
2281 { (yyval
.code_type
) = printer
; }
2282 #line 2283 "src/parse-gram.c" /* yacc.c:1668 */
2286 #line 433 "src/parse-gram.y" /* yacc.c:1668 */
2288 #line 2289 "src/parse-gram.c" /* yacc.c:1668 */
2292 #line 434 "src/parse-gram.y" /* yacc.c:1668 */
2293 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2294 #line 2295 "src/parse-gram.c" /* yacc.c:1668 */
2298 #line 439 "src/parse-gram.y" /* yacc.c:1668 */
2301 muscle_code_grow ("union_members", (yyvsp
[0].chars
), (yylsp
[0]));
2302 code_scanner_last_string_free ();
2304 #line 2305 "src/parse-gram.c" /* yacc.c:1668 */
2308 #line 450 "src/parse-gram.y" /* yacc.c:1668 */
2309 { current_class
= nterm_sym
; }
2310 #line 2311 "src/parse-gram.c" /* yacc.c:1668 */
2314 #line 451 "src/parse-gram.y" /* yacc.c:1668 */
2316 current_class
= unknown_sym
;
2317 current_type
= NULL
;
2319 #line 2320 "src/parse-gram.c" /* yacc.c:1668 */
2323 #line 455 "src/parse-gram.y" /* yacc.c:1668 */
2324 { current_class
= token_sym
; }
2325 #line 2326 "src/parse-gram.c" /* yacc.c:1668 */
2329 #line 456 "src/parse-gram.y" /* yacc.c:1668 */
2331 current_class
= unknown_sym
;
2332 current_type
= NULL
;
2334 #line 2335 "src/parse-gram.c" /* yacc.c:1668 */
2338 #line 461 "src/parse-gram.y" /* yacc.c:1668 */
2342 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2343 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2344 symbol_list_free ((yyvsp
[0].list
));
2346 #line 2347 "src/parse-gram.c" /* yacc.c:1668 */
2350 #line 472 "src/parse-gram.y" /* yacc.c:1668 */
2354 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2356 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2357 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2359 symbol_list_free ((yyvsp
[0].list
));
2360 current_type
= NULL
;
2362 #line 2363 "src/parse-gram.c" /* yacc.c:1668 */
2366 #line 486 "src/parse-gram.y" /* yacc.c:1668 */
2367 { (yyval
.assoc
) = left_assoc
; }
2368 #line 2369 "src/parse-gram.c" /* yacc.c:1668 */
2372 #line 487 "src/parse-gram.y" /* yacc.c:1668 */
2373 { (yyval
.assoc
) = right_assoc
; }
2374 #line 2375 "src/parse-gram.c" /* yacc.c:1668 */
2378 #line 488 "src/parse-gram.y" /* yacc.c:1668 */
2379 { (yyval
.assoc
) = non_assoc
; }
2380 #line 2381 "src/parse-gram.c" /* yacc.c:1668 */
2384 #line 489 "src/parse-gram.y" /* yacc.c:1668 */
2385 { (yyval
.assoc
) = precedence_assoc
; }
2386 #line 2387 "src/parse-gram.c" /* yacc.c:1668 */
2390 #line 493 "src/parse-gram.y" /* yacc.c:1668 */
2391 { current_type
= NULL
; }
2392 #line 2393 "src/parse-gram.c" /* yacc.c:1668 */
2396 #line 494 "src/parse-gram.y" /* yacc.c:1668 */
2397 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2398 #line 2399 "src/parse-gram.c" /* yacc.c:1668 */
2402 #line 500 "src/parse-gram.y" /* yacc.c:1668 */
2403 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2404 #line 2405 "src/parse-gram.c" /* yacc.c:1668 */
2408 #line 502 "src/parse-gram.y" /* yacc.c:1668 */
2409 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2410 #line 2411 "src/parse-gram.c" /* yacc.c:1668 */
2414 #line 507 "src/parse-gram.y" /* yacc.c:1668 */
2416 (yyval
.symbol
) = (yyvsp
[0].symbol
);
2417 symbol_class_set ((yyvsp
[0].symbol
), token_sym
, (yylsp
[0]), false);
2419 #line 2420 "src/parse-gram.c" /* yacc.c:1668 */
2423 #line 512 "src/parse-gram.y" /* yacc.c:1668 */
2425 (yyval
.symbol
) = (yyvsp
[-1].symbol
);
2426 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2427 symbol_class_set ((yyvsp
[-1].symbol
), token_sym
, (yylsp
[-1]), false);
2429 #line 2430 "src/parse-gram.c" /* yacc.c:1668 */
2433 #line 522 "src/parse-gram.y" /* yacc.c:1668 */
2434 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2435 #line 2436 "src/parse-gram.c" /* yacc.c:1668 */
2439 #line 524 "src/parse-gram.y" /* yacc.c:1668 */
2440 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2441 #line 2442 "src/parse-gram.c" /* yacc.c:1668 */
2445 #line 528 "src/parse-gram.y" /* yacc.c:1668 */
2446 { (yyval
.list
) = (yyvsp
[0].list
); }
2447 #line 2448 "src/parse-gram.c" /* yacc.c:1668 */
2451 #line 529 "src/parse-gram.y" /* yacc.c:1668 */
2452 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2453 #line 2454 "src/parse-gram.c" /* yacc.c:1668 */
2457 #line 533 "src/parse-gram.y" /* yacc.c:1668 */
2458 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2459 #line 2460 "src/parse-gram.c" /* yacc.c:1668 */
2463 #line 534 "src/parse-gram.y" /* yacc.c:1668 */
2464 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2465 #line 2466 "src/parse-gram.c" /* yacc.c:1668 */
2469 #line 539 "src/parse-gram.y" /* yacc.c:1668 */
2470 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2471 #line 2472 "src/parse-gram.c" /* yacc.c:1668 */
2475 #line 540 "src/parse-gram.y" /* yacc.c:1668 */
2476 { (yyval
.uniqstr
) = uniqstr_new (""); }
2477 #line 2478 "src/parse-gram.c" /* yacc.c:1668 */
2481 #line 546 "src/parse-gram.y" /* yacc.c:1668 */
2483 current_type
= (yyvsp
[0].uniqstr
);
2486 #line 2487 "src/parse-gram.c" /* yacc.c:1668 */
2490 #line 551 "src/parse-gram.y" /* yacc.c:1668 */
2492 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2493 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2495 #line 2496 "src/parse-gram.c" /* yacc.c:1668 */
2499 #line 556 "src/parse-gram.y" /* yacc.c:1668 */
2501 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2502 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2503 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2505 #line 2506 "src/parse-gram.c" /* yacc.c:1668 */
2509 #line 562 "src/parse-gram.y" /* yacc.c:1668 */
2511 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2512 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2513 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2515 #line 2516 "src/parse-gram.c" /* yacc.c:1668 */
2519 #line 568 "src/parse-gram.y" /* yacc.c:1668 */
2521 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2522 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2523 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2524 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2526 #line 2527 "src/parse-gram.c" /* yacc.c:1668 */
2530 #line 598 "src/parse-gram.y" /* yacc.c:1668 */
2534 #line 2535 "src/parse-gram.c" /* yacc.c:1668 */
2538 #line 604 "src/parse-gram.y" /* yacc.c:1668 */
2539 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2540 #line 2541 "src/parse-gram.c" /* yacc.c:1668 */
2544 #line 605 "src/parse-gram.y" /* yacc.c:1668 */
2546 /* Free the current lhs. */
2547 current_lhs (0, (yylsp
[-3]), 0);
2549 #line 2550 "src/parse-gram.c" /* yacc.c:1668 */
2553 #line 612 "src/parse-gram.y" /* yacc.c:1668 */
2554 { grammar_current_rule_end ((yylsp
[0])); }
2555 #line 2556 "src/parse-gram.c" /* yacc.c:1668 */
2559 #line 613 "src/parse-gram.y" /* yacc.c:1668 */
2560 { grammar_current_rule_end ((yylsp
[0])); }
2561 #line 2562 "src/parse-gram.c" /* yacc.c:1668 */
2565 #line 620 "src/parse-gram.y" /* yacc.c:1668 */
2566 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2567 current_lhs_named_ref
); }
2568 #line 2569 "src/parse-gram.c" /* yacc.c:1668 */
2572 #line 623 "src/parse-gram.y" /* yacc.c:1668 */
2573 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2574 #line 2575 "src/parse-gram.c" /* yacc.c:1668 */
2578 #line 625 "src/parse-gram.y" /* yacc.c:1668 */
2579 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2580 #line 2581 "src/parse-gram.c" /* yacc.c:1668 */
2584 #line 627 "src/parse-gram.y" /* yacc.c:1668 */
2585 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2586 #line 2587 "src/parse-gram.c" /* yacc.c:1668 */
2590 #line 629 "src/parse-gram.y" /* yacc.c:1668 */
2591 { grammar_current_rule_empty_set ((yylsp
[0])); }
2592 #line 2593 "src/parse-gram.c" /* yacc.c:1668 */
2596 #line 631 "src/parse-gram.y" /* yacc.c:1668 */
2597 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2598 #line 2599 "src/parse-gram.c" /* yacc.c:1668 */
2602 #line 633 "src/parse-gram.y" /* yacc.c:1668 */
2603 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2604 #line 2605 "src/parse-gram.c" /* yacc.c:1668 */
2608 #line 635 "src/parse-gram.y" /* yacc.c:1668 */
2609 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2610 #line 2611 "src/parse-gram.c" /* yacc.c:1668 */
2614 #line 639 "src/parse-gram.y" /* yacc.c:1668 */
2615 { (yyval
.named_ref
) = 0; }
2616 #line 2617 "src/parse-gram.c" /* yacc.c:1668 */
2620 #line 640 "src/parse-gram.y" /* yacc.c:1668 */
2621 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2622 #line 2623 "src/parse-gram.c" /* yacc.c:1668 */
2626 #line 651 "src/parse-gram.y" /* yacc.c:1668 */
2627 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2628 #line 2629 "src/parse-gram.c" /* yacc.c:1668 */
2632 #line 656 "src/parse-gram.y" /* yacc.c:1668 */
2633 { (yyval
.chars
) = ""; }
2634 #line 2635 "src/parse-gram.c" /* yacc.c:1668 */
2638 #line 657 "src/parse-gram.y" /* yacc.c:1668 */
2639 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2640 #line 2641 "src/parse-gram.c" /* yacc.c:1668 */
2644 #line 658 "src/parse-gram.y" /* yacc.c:1668 */
2645 { (yyval
.chars
) = (yyvsp
[0].chars
); }
2646 #line 2647 "src/parse-gram.c" /* yacc.c:1668 */
2650 #line 668 "src/parse-gram.y" /* yacc.c:1668 */
2652 code_props plain_code
;
2653 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2654 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2655 code_props_translate_code (&plain_code
);
2656 gram_scanner_last_string_free ();
2657 (yyval
.chars
) = plain_code
.code
;
2659 #line 2660 "src/parse-gram.c" /* yacc.c:1668 */
2663 #line 688 "src/parse-gram.y" /* yacc.c:1668 */
2664 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2665 #line 2666 "src/parse-gram.c" /* yacc.c:1668 */
2669 #line 690 "src/parse-gram.y" /* yacc.c:1668 */
2671 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2672 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2673 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2675 #line 2676 "src/parse-gram.c" /* yacc.c:1668 */
2679 #line 698 "src/parse-gram.y" /* yacc.c:1668 */
2680 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2681 #line 2682 "src/parse-gram.c" /* yacc.c:1668 */
2685 #line 710 "src/parse-gram.y" /* yacc.c:1668 */
2687 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2688 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2690 #line 2691 "src/parse-gram.c" /* yacc.c:1668 */
2694 #line 719 "src/parse-gram.y" /* yacc.c:1668 */
2696 code_props plain_code
;
2697 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2698 code_props_translate_code (&plain_code
);
2699 gram_scanner_last_string_free ();
2700 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2701 code_scanner_last_string_free ();
2703 #line 2704 "src/parse-gram.c" /* yacc.c:1668 */
2707 #line 2708 "src/parse-gram.c" /* yacc.c:1668 */
2710 if (yychar_backup
!= yychar
)
2711 YY_LAC_DISCARD ("yychar change");
2713 /* User semantic actions sometimes alter yychar, and that requires
2714 that yytoken be updated with the new translation. We take the
2715 approach of translating immediately before every use of yytoken.
2716 One alternative is translating here after every semantic action,
2717 but that translation would be missed if the semantic action invokes
2718 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2719 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2720 incorrect destructor might then be invoked immediately. In the
2721 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2722 to an incorrect destructor call or verbose syntax error message
2723 before the lookahead is translated. */
2724 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2728 YY_STACK_PRINT (yyss
, yyssp
);
2733 /* Now 'shift' the result of the reduction. Determine what state
2734 that goes to, based on the state we popped back to and the rule
2735 number reduced by. */
2739 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2740 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2741 yystate
= yytable
[yystate
];
2743 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2748 /*--------------------------------------.
2749 | yyerrlab -- here on detecting error. |
2750 `--------------------------------------*/
2752 /* Make sure we have latest lookahead translation. See comments at
2753 user semantic actions for why this is necessary. */
2754 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2756 /* If not already recovering from an error, report this error. */
2760 #if ! YYERROR_VERBOSE
2761 yyerror (&yylloc
, YY_("syntax error"));
2763 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2764 yyesa, &yyes, &yyes_capacity, \
2767 char const *yymsgp
= YY_("syntax error");
2768 int yysyntax_error_status
;
2769 if (yychar
!= YYEMPTY
)
2771 yysyntax_error_status
= YYSYNTAX_ERROR
;
2772 if (yysyntax_error_status
== 0)
2774 else if (yysyntax_error_status
== 1)
2776 if (yymsg
!= yymsgbuf
)
2777 YYSTACK_FREE (yymsg
);
2778 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2782 yymsg_alloc
= sizeof yymsgbuf
;
2783 yysyntax_error_status
= 2;
2787 yysyntax_error_status
= YYSYNTAX_ERROR
;
2791 yyerror (&yylloc
, yymsgp
);
2792 if (yysyntax_error_status
== 2)
2793 goto yyexhaustedlab
;
2795 # undef YYSYNTAX_ERROR
2799 yyerror_range
[1] = yylloc
;
2801 if (yyerrstatus
== 3)
2803 /* If just tried and failed to reuse lookahead token after an
2804 error, discard it. */
2806 if (yychar
<= YYEOF
)
2808 /* Return failure if at end of input. */
2809 if (yychar
== YYEOF
)
2814 yydestruct ("Error: discarding",
2815 yytoken
, &yylval
, &yylloc
);
2820 /* Else will try to reuse lookahead token after shifting the error
2825 /*---------------------------------------------------.
2826 | yyerrorlab -- error raised explicitly by YYERROR. |
2827 `---------------------------------------------------*/
2830 /* Pacify compilers like GCC when the user code never invokes
2831 YYERROR and the label yyerrorlab therefore never appears in user
2833 if (/*CONSTCOND*/ 0)
2836 yyerror_range
[1] = yylsp
[1-yylen
];
2837 /* Do not reclaim the symbols of the rule whose action triggered
2841 YY_STACK_PRINT (yyss
, yyssp
);
2846 /*-------------------------------------------------------------.
2847 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2848 `-------------------------------------------------------------*/
2850 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2854 yyn
= yypact
[yystate
];
2855 if (!yypact_value_is_default (yyn
))
2858 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2866 /* Pop the current state because it cannot handle the error token. */
2870 yyerror_range
[1] = *yylsp
;
2871 yydestruct ("Error: popping",
2872 yystos
[yystate
], yyvsp
, yylsp
);
2875 YY_STACK_PRINT (yyss
, yyssp
);
2878 /* If the stack popping above didn't lose the initial context for the
2879 current lookahead token, the shift below will for sure. */
2880 YY_LAC_DISCARD ("error recovery");
2882 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2884 YY_IGNORE_MAYBE_UNINITIALIZED_END
2886 yyerror_range
[2] = yylloc
;
2887 /* Using YYLLOC is tempting, but would change the location of
2888 the lookahead. YYLOC is available though. */
2889 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2892 /* Shift the error token. */
2893 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2899 /*-------------------------------------.
2900 | yyacceptlab -- YYACCEPT comes here. |
2901 `-------------------------------------*/
2906 /*-----------------------------------.
2907 | yyabortlab -- YYABORT comes here. |
2908 `-----------------------------------*/
2914 /*-------------------------------------------------.
2915 | yyexhaustedlab -- memory exhaustion comes here. |
2916 `-------------------------------------------------*/
2918 yyerror (&yylloc
, YY_("memory exhausted"));
2924 if (yychar
!= YYEMPTY
)
2926 /* Make sure we have latest lookahead translation. See comments at
2927 user semantic actions for why this is necessary. */
2928 yytoken
= YYTRANSLATE (yychar
);
2929 yydestruct ("Cleanup: discarding lookahead",
2930 yytoken
, &yylval
, &yylloc
);
2932 /* Do not reclaim the symbols of the rule whose action triggered
2933 this YYABORT or YYACCEPT. */
2935 YY_STACK_PRINT (yyss
, yyssp
);
2936 while (yyssp
!= yyss
)
2938 yydestruct ("Cleanup: popping",
2939 yystos
[*yyssp
], yyvsp
, yylsp
);
2944 YYSTACK_FREE (yyss
);
2947 YYSTACK_FREE (yyes
);
2949 if (yymsg
!= yymsgbuf
)
2950 YYSTACK_FREE (yymsg
);
2954 #line 729 "src/parse-gram.y" /* yacc.c:1928 */
2957 /* Return the location of the left-hand side of a rule whose
2958 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2959 the right-hand side, and return an empty location equal to the end
2960 boundary of RHS[0] if the right-hand side is empty. */
2963 lloc_default (YYLTYPE
const *rhs
, int n
)
2968 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2969 The bug is fixed in 7.4.2m, but play it safe for now. */
2970 loc
.start
= rhs
[n
].end
;
2971 loc
.end
= rhs
[n
].end
;
2973 /* Ignore empty nonterminals the start of the right-hand side.
2974 Do not bother to ignore them at the end of the right-hand side,
2975 since empty nonterminals have the same end as their predecessors. */
2976 for (i
= 1; i
<= n
; i
++)
2977 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2979 loc
.start
= rhs
[i
].start
;
2988 add_param (param_type type
, char *decl
, location loc
)
2990 static char const alphanum
[26 + 26 + 1 + 10] =
2991 "abcdefghijklmnopqrstuvwxyz"
2992 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2996 char const *name_start
= NULL
;
2999 /* Stop on last actual character. */
3000 for (p
= decl
; p
[1]; p
++)
3002 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3003 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3006 /* Strip the surrounding '{' and '}', and any blanks just inside
3009 while (c_isspace ((unsigned char) *p
))
3013 while (c_isspace ((unsigned char) *decl
))
3018 complain (&loc
, complaint
, _("missing identifier in parameter declaration"));
3021 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3022 if (type
& param_lex
)
3023 muscle_pair_list_grow ("lex_param", decl
, name
);
3024 if (type
& param_parse
)
3025 muscle_pair_list_grow ("parse_param", decl
, name
);
3029 gram_scanner_last_string_free ();
3034 version_check (location
const *loc
, char const *version
)
3036 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3038 complain (loc
, complaint
, "require bison %s, but have %s",
3039 version
, PACKAGE_VERSION
);
3045 gram_error (location
const *loc
, char const *msg
)
3047 complain (loc
, complaint
, "%s", msg
);
3051 token_name (int type
)
3053 return yytname
[YYTRANSLATE (type
)];
3064 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3065 return quotearg_style (escape_quoting_style
, buf
);