1 /* A Bison parser, made by GNU Bison 2.7.1081-93af. */
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.1081-93af"
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,
245 #define PERCENT_TOKEN 260
246 #define PERCENT_NTERM 261
247 #define PERCENT_TYPE 262
248 #define PERCENT_DESTRUCTOR 263
249 #define PERCENT_PRINTER 264
250 #define PERCENT_LEFT 265
251 #define PERCENT_RIGHT 266
252 #define PERCENT_NONASSOC 267
253 #define PERCENT_PRECEDENCE 268
254 #define PERCENT_PREC 269
255 #define PERCENT_DPREC 270
256 #define PERCENT_MERGE 271
257 #define PERCENT_CODE 272
258 #define PERCENT_DEFAULT_PREC 273
259 #define PERCENT_DEFINE 274
260 #define PERCENT_DEFINES 275
261 #define PERCENT_ERROR_VERBOSE 276
262 #define PERCENT_EXPECT 277
263 #define PERCENT_EXPECT_RR 278
264 #define PERCENT_FLAG 279
265 #define PERCENT_FILE_PREFIX 280
266 #define PERCENT_GLR_PARSER 281
267 #define PERCENT_INITIAL_ACTION 282
268 #define PERCENT_LANGUAGE 283
269 #define PERCENT_NAME_PREFIX 284
270 #define PERCENT_NO_DEFAULT_PREC 285
271 #define PERCENT_NO_LINES 286
272 #define PERCENT_NONDETERMINISTIC_PARSER 287
273 #define PERCENT_OUTPUT 288
274 #define PERCENT_REQUIRE 289
275 #define PERCENT_SKELETON 290
276 #define PERCENT_START 291
277 #define PERCENT_TOKEN_TABLE 292
278 #define PERCENT_VERBOSE 293
279 #define PERCENT_YACC 294
280 #define BRACED_CODE 295
281 #define BRACED_PREDICATE 296
282 #define BRACKETED_ID 297
288 #define PERCENT_PERCENT 303
291 #define SEMICOLON 306
295 #define PERCENT_PARAM 310
296 #define PERCENT_UNION 311
299 #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
300 typedef union GRAM_STYPE GRAM_STYPE
;
303 #line 105 "src/parse-gram.y" /* yacc.c:373 */
309 named_ref
*named_ref
;
313 unsigned char character
;
315 #line 243 "src/parse-gram.y" /* yacc.c:373 */
319 #line 419 "src/parse-gram.y" /* yacc.c:373 */
320 code_props_type code_type
;
322 #line 323 "src/parse-gram.c" /* yacc.c:373 */
324 # define GRAM_STYPE_IS_TRIVIAL 1
325 # define GRAM_STYPE_IS_DECLARED 1
329 #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
330 typedef struct GRAM_LTYPE GRAM_LTYPE
;
338 # define GRAM_LTYPE_IS_DECLARED 1
339 # define GRAM_LTYPE_IS_TRIVIAL 1
344 int gram_parse (void);
346 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */
348 /* Copy the second part of user declarations. */
350 #line 351 "src/parse-gram.c" /* yacc.c:376 */
351 /* Unqualified %code blocks. */
352 #line 54 "src/parse-gram.y" /* yacc.c:377 */
354 static int current_prec
= 0;
355 static location current_lhs_location
;
356 static named_ref
*current_lhs_named_ref
;
357 static symbol
*current_lhs_symbol
;
358 static symbol_class current_class
= unknown_sym
;
359 static uniqstr current_type
= NULL
;
361 /** Set the new current left-hand side symbol, possibly common
362 * to several right-hand side parts of rule.
366 current_lhs (symbol
*sym
, location loc
, named_ref
*ref
)
368 current_lhs_symbol
= sym
;
369 current_lhs_location
= loc
;
370 /* In order to simplify memory management, named references for lhs
371 are always assigned by deep copy into the current symbol_list
372 node. This is because a single named-ref in the grammar may
373 result in several uses when the user factors lhs between several
374 rules using "|". Therefore free the parser's original copy. */
375 free (current_lhs_named_ref
);
376 current_lhs_named_ref
= ref
;
379 #define YYTYPE_INT16 int_fast16_t
380 #define YYTYPE_INT8 int_fast8_t
381 #define YYTYPE_UINT16 uint_fast16_t
382 #define YYTYPE_UINT8 uint_fast8_t
384 #line 232 "src/parse-gram.y" /* yacc.c:377 */
386 /** Add a lex-param and/or a parse-param.
388 * \param type where to push this formal argument.
389 * \param decl the formal argument. Destroyed.
390 * \param loc the location in the source.
392 static void add_param (param_type type
, char *decl
, location loc
);
393 static param_type current_param
= param_none
;
396 #line 397 "src/parse-gram.c" /* yacc.c:377 */
403 typedef YYTYPE_UINT8 yytype_uint8
;
405 typedef unsigned char yytype_uint8
;
409 typedef YYTYPE_INT8 yytype_int8
;
411 typedef signed char yytype_int8
;
415 typedef YYTYPE_UINT16 yytype_uint16
;
417 typedef unsigned short int yytype_uint16
;
421 typedef YYTYPE_INT16 yytype_int16
;
423 typedef short int yytype_int16
;
427 # ifdef __SIZE_TYPE__
428 # define YYSIZE_T __SIZE_TYPE__
429 # elif defined size_t
430 # define YYSIZE_T size_t
431 # elif ! defined YYSIZE_T
432 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
433 # define YYSIZE_T size_t
435 # define YYSIZE_T unsigned int
439 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
442 # if defined YYENABLE_NLS && YYENABLE_NLS
444 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
445 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
449 # define YY_(Msgid) Msgid
453 /* Suppress unused-variable warnings by "using" E. */
455 # define YYUSE(E) ((void) (E))
457 # define YYUSE(E) /* empty */
462 /* The parser invokes alloca or malloc; define the necessary symbols. */
464 # ifdef YYSTACK_ALLOC
465 /* Pacify GCC's `empty if-body' warning. */
466 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
467 # ifndef YYSTACK_ALLOC_MAXIMUM
468 /* The OS might guarantee only one guard page at the bottom of the stack,
469 and a page size can be as small as 4096 bytes. So we cannot safely
470 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
471 to allow for a few compiler-allocated temporary stack slots. */
472 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
475 # define YYSTACK_ALLOC YYMALLOC
476 # define YYSTACK_FREE YYFREE
477 # ifndef YYSTACK_ALLOC_MAXIMUM
478 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
480 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
481 && ! ((defined YYMALLOC || defined malloc) \
482 && (defined YYFREE || defined free)))
483 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
484 # ifndef EXIT_SUCCESS
485 # define EXIT_SUCCESS 0
489 # define YYMALLOC malloc
490 # if ! defined malloc && ! defined EXIT_SUCCESS
491 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
496 # if ! defined free && ! defined EXIT_SUCCESS
497 void free (void *); /* INFRINGES ON USER NAME SPACE */
501 # define YYCOPY_NEEDED 1
505 #if (! defined yyoverflow \
506 && (! defined __cplusplus \
507 || (defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL \
508 && defined GRAM_STYPE_IS_TRIVIAL && GRAM_STYPE_IS_TRIVIAL)))
510 /* A type that is properly aligned for any stack member. */
513 yytype_int16 yyss_alloc
;
518 /* The size of the maximum gap between one aligned stack and the next. */
519 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
521 /* The size of an array large to enough to hold all stacks, each with
523 # define YYSTACK_BYTES(N) \
524 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
525 + 2 * YYSTACK_GAP_MAXIMUM)
527 # define YYCOPY_NEEDED 1
529 /* Relocate STACK from its old location to the new one. The
530 local variables YYSIZE and YYSTACKSIZE give the old and new number of
531 elements in the stack, and YYPTR gives the new location of the
532 stack. Advance YYPTR to a properly aligned location for the next
534 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
537 YYSIZE_T yynewbytes; \
538 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
539 Stack = &yyptr->Stack_alloc; \
540 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
541 yyptr += yynewbytes / sizeof (*yyptr); \
547 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
548 /* Copy COUNT objects from SRC to DST. The source and destination do
551 # if defined __GNUC__ && 1 < __GNUC__
552 # define YYCOPY(Dst, Src, Count) \
553 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
555 # define YYCOPY(Dst, Src, Count) \
559 for (yyi = 0; yyi < (Count); yyi++) \
560 (Dst)[yyi] = (Src)[yyi]; \
565 #endif /* !YYCOPY_NEEDED */
567 /* YYFINAL -- State number of the termination state. */
569 /* YYLAST -- Last index in YYTABLE. */
572 /* YYNTOKENS -- Number of terminals. */
574 /* YYNNTS -- Number of nonterminals. */
576 /* YYNRULES -- Number of rules. */
578 /* YYNSTATES -- Number of states. */
579 #define YYNSTATES 143
581 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
582 by yylex, with out-of-bounds checking. */
584 #define YYMAXUTOK 311
586 #define YYTRANSLATE(YYX) \
587 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
589 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
590 as returned by yylex, without out-of-bounds checking. */
591 static const yytype_uint8 yytranslate
[] =
593 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
619 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
620 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
621 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
622 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
623 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
628 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
629 static const yytype_uint16 yyrline
[] =
631 0, 268, 268, 276, 278, 282, 283, 293, 297, 302,
632 303, 308, 313, 314, 315, 316, 321, 330, 331, 332,
633 333, 334, 335, 335, 336, 337, 361, 362, 363, 364,
634 368, 369, 378, 379, 380, 384, 396, 400, 404, 411,
635 422, 423, 433, 434, 438, 450, 450, 455, 455, 460,
636 471, 486, 487, 488, 489, 493, 494, 499, 501, 506,
637 507, 512, 514, 519, 520, 524, 525, 529, 530, 531,
638 536, 541, 546, 552, 558, 569, 570, 579, 580, 586,
639 587, 588, 595, 595, 603, 604, 605, 610, 612, 614,
640 616, 618, 620, 622, 627, 629, 639, 640, 645, 646,
641 647, 656, 676, 678, 687, 692, 693, 698, 705, 707
645 #if GRAM_DEBUG || YYERROR_VERBOSE || 1
646 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
647 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
648 static const char *const yytname
[] =
650 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
651 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
652 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
653 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
654 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
655 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
656 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
657 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
658 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
659 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
660 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
661 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
662 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
663 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
664 "prologue_declaration", "$@1", "params", "grammar_declaration",
665 "code_props_type", "union_name", "symbol_declaration", "$@2", "$@3",
666 "precedence_declaration", "precedence_declarator", "tag.opt",
667 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
668 "generic_symlist_item", "tag", "symbol_def", "symbol_defs.1", "grammar",
669 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
670 "named_ref.opt", "variable", "content.opt", "braceless", "id",
671 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
676 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
677 (internal) symbol number NUM (which must be that of a token). */
678 static const yytype_uint16 yytoknum
[] =
680 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
681 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
682 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
683 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
684 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
685 305, 306, 307, 308, 309, 310, 311
689 #define YYPACT_NINF -74
691 #define yypact_value_is_default(Yystate) \
692 (!!((Yystate) == (-74)))
694 #define YYTABLE_NINF -109
696 #define yytable_value_is_error(Yytable_value) \
699 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
701 static const yytype_int16 yypact
[] =
703 -74, 40, 101, -74, -74, -74, -48, -74, -74, -74,
704 -74, -74, -74, 19, -74, 0, 52, -74, 56, 79,
705 -74, 81, -74, 45, 83, 84, -74, -74, -74, 85,
706 86, 87, 31, -74, -74, -74, 15, -74, -74, -74,
707 46, -74, -74, 51, -74, -74, 42, 4, 4, 31,
708 -74, 57, -74, -74, -74, 36, -74, -74, -74, -74,
709 -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
710 -74, -74, 47, -74, 49, 1, -74, -74, 59, 62,
711 -74, 57, 26, -74, 31, -74, -74, 4, 72, 4,
712 31, -74, -74, -74, -74, -74, -74, -74, 60, -74,
713 -74, -74, -74, -74, 63, -74, -74, -74, -74, 26,
714 -74, -74, -74, 31, -74, 111, -74, 113, -74, -74,
715 -74, -74, -74, -74, -74, -74, -74, -13, 27, -74,
716 -74, 31, 137, 65, 59, -74, 59, 27, -74, -74,
720 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
721 Performed when YYTABLE does not specify something else to do. Zero
722 means the default is an error. */
723 static const yytype_uint8 yydefact
[] =
725 3, 0, 0, 1, 47, 45, 0, 40, 41, 51,
726 52, 53, 54, 0, 36, 0, 9, 11, 0, 0,
727 7, 0, 15, 0, 0, 0, 37, 19, 20, 0,
728 0, 0, 0, 26, 27, 28, 0, 6, 29, 22,
729 42, 4, 5, 0, 33, 32, 55, 0, 0, 0,
730 101, 0, 38, 97, 96, 98, 10, 12, 13, 14,
731 16, 17, 18, 21, 24, 25, 107, 103, 102, 105,
732 34, 106, 0, 104, 0, 0, 77, 79, 94, 0,
733 43, 0, 0, 56, 0, 70, 75, 48, 71, 46,
734 49, 61, 39, 100, 99, 8, 81, 80, 0, 78,
735 2, 95, 82, 31, 23, 44, 67, 68, 69, 35,
736 63, 66, 65, 50, 57, 59, 76, 72, 73, 62,
737 109, 87, 30, 64, 58, 60, 74, 83, 84, 87,
738 86, 0, 0, 0, 94, 90, 94, 85, 91, 92,
742 /* YYPGOTO[NTERM-NUM]. */
743 static const yytype_int16 yypgoto
[] =
745 -74, -74, -74, -74, -74, -74, 140, -74, -74, -74,
746 -74, -74, -74, -74, -74, -74, 30, -74, -74, 35,
747 -74, -26, 97, -74, 71, -74, -74, -74, 18, -70,
748 -74, -74, -46, 6, -74, -32, -73, -74
751 /* YYDEFGOTO[NTERM-NUM]. */
752 static const yytype_int16 yydefgoto
[] =
754 -1, 1, 2, 41, 79, 104, 74, 43, 81, 44,
755 48, 47, 45, 46, 84, 113, 114, 90, 109, 110,
756 111, 86, 87, 75, 76, 77, 121, 127, 128, 102,
757 55, 95, 52, 69, 78, 112, 71, 100
760 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
761 positive, shift that token. If negative, reduce the rule whose
762 number is the opposite. If YYTABLE_NINF, syntax error. */
763 static const yytype_int16 yytable
[] =
765 70, -108, 72, 53, 49, 92, 4, 5, 6, 7,
766 8, 9, 10, 11, 12, 118, 72, 91, 13, 14,
767 4, 5, 6, 7, 8, 9, 10, 11, 12, 66,
768 66, 26, 13, 14, 66, 105, 129, 32, 130, 93,
769 3, 131, 132, 133, 126, 26, 54, 67, 73, 98,
770 68, 32, 115, 88, 88, 56, 85, 40, 119, 50,
771 57, 116, 73, 116, 141, 51, 142, 134, 135, 67,
772 67, 40, 68, 68, 67, 66, 117, 68, 106, 107,
773 108, 115, 94, 58, 59, 60, 61, 62, 63, 64,
774 65, 82, 80, 88, 83, 88, 136, 50, 96, 138,
775 97, 101, 103, 122, 120, 136, 4, 5, 6, 7,
776 8, 9, 10, 11, 12, 125, 66, 140, 13, 14,
777 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
778 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
779 35, 139, 42, 124, 123, 89, 99, 137, 0, 36,
780 0, 37, 38, 0, 0, 0, 39, 40
783 static const yytype_int16 yycheck
[] =
785 32, 0, 1, 3, 52, 51, 5, 6, 7, 8,
786 9, 10, 11, 12, 13, 88, 1, 49, 17, 18,
787 5, 6, 7, 8, 9, 10, 11, 12, 13, 3,
788 3, 30, 17, 18, 3, 81, 49, 36, 51, 3,
789 0, 14, 15, 16, 117, 30, 46, 43, 47, 48,
790 46, 36, 84, 47, 48, 3, 52, 56, 90, 40,
791 4, 87, 47, 89, 134, 46, 136, 40, 41, 43,
792 43, 56, 46, 46, 43, 3, 4, 46, 52, 53,
793 54, 113, 46, 4, 3, 40, 3, 3, 3, 3,
794 3, 40, 46, 87, 52, 89, 128, 40, 51, 131,
795 51, 42, 40, 40, 44, 137, 5, 6, 7, 8,
796 9, 10, 11, 12, 13, 4, 3, 52, 17, 18,
797 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
798 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
799 39, 4, 2, 113, 109, 48, 75, 129, -1, 48,
800 -1, 50, 51, -1, -1, -1, 55, 56
803 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
804 symbol of state STATE-NUM. */
805 static const yytype_uint8 yystos
[] =
807 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
808 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
809 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
810 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
811 56, 60, 63, 64, 66, 69, 70, 68, 67, 52,
812 40, 46, 89, 3, 46, 87, 3, 4, 4, 3,
813 40, 3, 3, 3, 3, 3, 3, 43, 46, 90,
814 92, 93, 1, 47, 63, 80, 81, 82, 91, 61,
815 46, 65, 40, 52, 71, 52, 78, 79, 90, 79,
816 74, 92, 89, 3, 46, 88, 51, 51, 48, 81,
817 94, 42, 86, 40, 62, 89, 52, 53, 54, 75,
818 76, 77, 92, 72, 73, 92, 78, 4, 93, 92,
819 44, 83, 40, 76, 73, 4, 93, 84, 85, 49,
820 51, 14, 15, 16, 40, 41, 92, 85, 92, 4,
824 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
825 static const yytype_uint8 yyr1
[] =
827 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
828 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
829 60, 60, 61, 60, 60, 60, 60, 60, 60, 60,
830 62, 62, 63, 63, 63, 63, 63, 63, 63, 63,
831 64, 64, 65, 65, 63, 67, 66, 68, 66, 66,
832 69, 70, 70, 70, 70, 71, 71, 72, 72, 73,
833 73, 74, 74, 75, 75, 76, 76, 77, 77, 77,
834 78, 78, 78, 78, 78, 79, 79, 80, 80, 81,
835 81, 81, 83, 82, 84, 84, 84, 85, 85, 85,
836 85, 85, 85, 85, 86, 86, 87, 87, 88, 88,
837 88, 89, 90, 90, 91, 92, 92, 93, 94, 94
840 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
841 static const yytype_uint8 yyr2
[] =
843 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
844 2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
845 1, 2, 0, 3, 2, 2, 1, 1, 1, 1,
846 2, 1, 1, 1, 2, 3, 1, 1, 2, 3,
847 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
848 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
849 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
850 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
851 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
852 2, 3, 3, 3, 0, 1, 1, 1, 0, 1,
853 1, 1, 1, 1, 1, 1, 1, 1, 0, 2
857 #define yyerrok (yyerrstatus = 0)
858 #define yyclearin (yychar = YYEMPTY)
862 #define YYACCEPT goto yyacceptlab
863 #define YYABORT goto yyabortlab
864 #define YYERROR goto yyerrorlab
867 #define YYRECOVERING() (!!yyerrstatus)
869 #define YYBACKUP(Token, Value) \
871 if (yychar == YYEMPTY) \
875 YYPOPSTACK (yylen); \
877 YY_LAC_DISCARD ("YYBACKUP"); \
882 yyerror (&yylloc, YY_("syntax error: cannot back up")); \
887 /* Error token number */
889 #define YYERRCODE 256
892 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
893 If N is 0, then set CURRENT to the empty location which ends
894 the previous symbol: RHS[0] (always defined). */
896 #ifndef YYLLOC_DEFAULT
897 # define YYLLOC_DEFAULT(Current, Rhs, N) \
901 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
902 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
903 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
904 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
908 (Current).first_line = (Current).last_line = \
909 YYRHSLOC (Rhs, 0).last_line; \
910 (Current).first_column = (Current).last_column = \
911 YYRHSLOC (Rhs, 0).last_column; \
916 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
919 /* Enable debugging if requested. */
923 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
924 # define YYFPRINTF fprintf
927 # define YYDPRINTF(Args) \
934 /* YY_LOCATION_PRINT -- Print the location on the stream.
935 This macro was not mandated originally: define only if we know
936 we won't break user code: when these are the locations we know. */
938 #ifndef YY_LOCATION_PRINT
939 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
941 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
943 __attribute__((__unused__
))
945 yy_location_print_ (FILE *yyo
, YYLTYPE
const * const yylocp
)
948 int end_col
= 0 != yylocp
->last_column
? yylocp
->last_column
- 1 : 0;
949 if (0 <= yylocp
->first_line
)
951 res
+= YYFPRINTF (yyo
, "%d", yylocp
->first_line
);
952 if (0 <= yylocp
->first_column
)
953 res
+= YYFPRINTF (yyo
, ".%d", yylocp
->first_column
);
955 if (0 <= yylocp
->last_line
)
957 if (yylocp
->first_line
< yylocp
->last_line
)
959 res
+= YYFPRINTF (yyo
, "-%d", yylocp
->last_line
);
961 res
+= YYFPRINTF (yyo
, ".%d", end_col
);
963 else if (0 <= end_col
&& yylocp
->first_column
< end_col
)
964 res
+= YYFPRINTF (yyo
, "-%d", end_col
);
969 # define YY_LOCATION_PRINT(File, Loc) \
970 yy_location_print_ (File, &(Loc))
973 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
978 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
982 YYFPRINTF (stderr, "%s ", Title); \
983 yy_symbol_print (stderr, \
984 Type, Value, Location); \
985 YYFPRINTF (stderr, "\n"); \
990 /*--------------------------------.
991 | Print this symbol on YYOUTPUT. |
992 `--------------------------------*/
995 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
997 FILE *yyo
= yyoutput
;
1003 if (yytype
< YYNTOKENS
)
1004 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1008 case 3: /* "string" */
1009 #line 192 "src/parse-gram.y" /* yacc.c:707 */
1010 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
1011 #line 1012 "src/parse-gram.c" /* yacc.c:707 */
1014 case 4: /* "integer" */
1015 #line 205 "src/parse-gram.y" /* yacc.c:707 */
1016 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
1017 #line 1018 "src/parse-gram.c" /* yacc.c:707 */
1020 case 24: /* "%<flag>" */
1021 #line 201 "src/parse-gram.y" /* yacc.c:707 */
1022 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1023 #line 1024 "src/parse-gram.c" /* yacc.c:707 */
1026 case 40: /* "{...}" */
1027 #line 194 "src/parse-gram.y" /* yacc.c:707 */
1028 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1029 #line 1030 "src/parse-gram.c" /* yacc.c:707 */
1032 case 42: /* "[identifier]" */
1033 #line 199 "src/parse-gram.y" /* yacc.c:707 */
1034 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1035 #line 1036 "src/parse-gram.c" /* yacc.c:707 */
1038 case 43: /* "char" */
1039 #line 186 "src/parse-gram.y" /* yacc.c:707 */
1040 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
1041 #line 1042 "src/parse-gram.c" /* yacc.c:707 */
1044 case 44: /* "epilogue" */
1045 #line 194 "src/parse-gram.y" /* yacc.c:707 */
1046 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1047 #line 1048 "src/parse-gram.c" /* yacc.c:707 */
1050 case 46: /* "identifier" */
1051 #line 198 "src/parse-gram.y" /* yacc.c:707 */
1052 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1053 #line 1054 "src/parse-gram.c" /* yacc.c:707 */
1056 case 47: /* "identifier:" */
1057 #line 200 "src/parse-gram.y" /* yacc.c:707 */
1058 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
1059 #line 1060 "src/parse-gram.c" /* yacc.c:707 */
1062 case 50: /* "%{...%}" */
1063 #line 194 "src/parse-gram.y" /* yacc.c:707 */
1064 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1065 #line 1066 "src/parse-gram.c" /* yacc.c:707 */
1068 case 52: /* "<tag>" */
1069 #line 202 "src/parse-gram.y" /* yacc.c:707 */
1070 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1071 #line 1072 "src/parse-gram.c" /* yacc.c:707 */
1074 case 55: /* "%param" */
1075 #line 248 "src/parse-gram.y" /* yacc.c:707 */
1077 switch (((*yyvaluep
).param
))
1079 #define CASE(In, Out) \
1080 case param_ ## In: fputs ("%" #Out, stderr); break
1081 CASE (lex
, lex
-param
);
1082 CASE (parse
, parse
-param
);
1085 case param_none
: aver (false); break;
1088 #line 1089 "src/parse-gram.c" /* yacc.c:707 */
1091 case 64: /* code_props_type */
1092 #line 420 "src/parse-gram.y" /* yacc.c:707 */
1093 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1094 #line 1095 "src/parse-gram.c" /* yacc.c:707 */
1097 case 73: /* symbol.prec */
1098 #line 208 "src/parse-gram.y" /* yacc.c:707 */
1099 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1100 #line 1101 "src/parse-gram.c" /* yacc.c:707 */
1104 #line 202 "src/parse-gram.y" /* yacc.c:707 */
1105 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1106 #line 1107 "src/parse-gram.c" /* yacc.c:707 */
1109 case 87: /* variable */
1110 #line 198 "src/parse-gram.y" /* yacc.c:707 */
1111 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1112 #line 1113 "src/parse-gram.c" /* yacc.c:707 */
1115 case 88: /* content.opt */
1116 #line 194 "src/parse-gram.y" /* yacc.c:707 */
1117 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1118 #line 1119 "src/parse-gram.c" /* yacc.c:707 */
1121 case 89: /* braceless */
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 */
1128 #line 208 "src/parse-gram.y" /* yacc.c:707 */
1129 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1130 #line 1131 "src/parse-gram.c" /* yacc.c:707 */
1133 case 91: /* id_colon */
1134 #line 209 "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: /* symbol */
1140 #line 208 "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: /* string_as_id */
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 */
1157 /*--------------------------------.
1158 | Print this symbol on YYOUTPUT. |
1159 `--------------------------------*/
1162 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1164 YYFPRINTF (yyoutput
, "%s %s (",
1165 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
1167 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1168 YYFPRINTF (yyoutput
, ": ");
1169 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1170 YYFPRINTF (yyoutput
, ")");
1173 /*------------------------------------------------------------------.
1174 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1176 `------------------------------------------------------------------*/
1179 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1181 YYFPRINTF (stderr
, "Stack now");
1182 for (; yybottom
<= yytop
; yybottom
++)
1184 int yybot
= *yybottom
;
1185 YYFPRINTF (stderr
, " %d", yybot
);
1187 YYFPRINTF (stderr
, "\n");
1190 # define YY_STACK_PRINT(Bottom, Top) \
1193 yy_stack_print ((Bottom), (Top)); \
1197 /*------------------------------------------------.
1198 | Report that the YYRULE is going to be reduced. |
1199 `------------------------------------------------*/
1202 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1204 unsigned long int yylno
= yyrline
[yyrule
];
1205 int yynrhs
= yyr2
[yyrule
];
1207 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1209 /* The symbols being reduced. */
1210 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1212 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1213 yy_symbol_print (stderr
,
1214 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1215 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1216 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1217 YYFPRINTF (stderr
, "\n");
1221 # define YY_REDUCE_PRINT(Rule) \
1224 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1227 /* Nonzero means print parse trace. It is left uninitialized so that
1228 multiple parsers can coexist. */
1230 #else /* !GRAM_DEBUG */
1231 # define YYDPRINTF(Args)
1232 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1233 # define YY_STACK_PRINT(Bottom, Top)
1234 # define YY_REDUCE_PRINT(Rule)
1235 #endif /* !GRAM_DEBUG */
1238 /* YYINITDEPTH -- initial size of the parser's stacks. */
1240 # define YYINITDEPTH 200
1243 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1244 if the built-in stack extension method is used).
1246 Do not make this value too large; the results are undefined if
1247 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1248 evaluated with infinite-precision integer arithmetic. */
1251 # define YYMAXDEPTH 10000
1254 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1255 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1256 stack, and such that *YYCAPACITY is the maximum number of elements it
1257 can hold without a reallocation, make sure there is enough room to
1258 store YYADD more elements. If not, allocate a new stack using
1259 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1260 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1261 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1262 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1263 required. Return 1 if memory is exhausted. */
1265 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1267 char const *yydebug_prefix
,
1268 char const *yydebug_suffix
,
1270 yytype_int16
**yybottom
,
1271 yytype_int16
*yybottom_no_free
,
1272 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1274 YYSIZE_T yysize_old
=
1275 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1276 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1277 if (*yycapacity
< yysize_new
)
1279 YYSIZE_T yyalloc
= 2 * yysize_new
;
1280 yytype_int16
*yybottom_new
;
1281 /* Use YYMAXDEPTH for maximum stack size given that the stack
1282 should never need to grow larger than the main state stack
1283 needs to grow without LAC. */
1284 if (YYMAXDEPTH
< yysize_new
)
1286 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1290 if (YYMAXDEPTH
< yyalloc
)
1291 yyalloc
= YYMAXDEPTH
;
1293 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1296 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1300 if (*yytop
!= yytop_empty
)
1302 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1303 *yytop
= yybottom_new
+ (yysize_old
- 1);
1305 if (*yybottom
!= yybottom_no_free
)
1306 YYSTACK_FREE (*yybottom
);
1307 *yybottom
= yybottom_new
;
1308 *yycapacity
= yyalloc
;
1313 /* Establish the initial context for the current lookahead if no initial
1314 context is currently established.
1316 We define a context as a snapshot of the parser stacks. We define
1317 the initial context for a lookahead as the context in which the
1318 parser initially examines that lookahead in order to select a
1319 syntactic action. Thus, if the lookahead eventually proves
1320 syntactically unacceptable (possibly in a later context reached via a
1321 series of reductions), the initial context can be used to determine
1322 the exact set of tokens that would be syntactically acceptable in the
1323 lookahead's place. Moreover, it is the context after which any
1324 further semantic actions would be erroneous because they would be
1325 determined by a syntactically unacceptable token.
1327 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1328 performed in an inconsistent state (which, for the purposes of LAC,
1329 includes consistent states that don't know they're consistent because
1330 their default reductions have been disabled). Iff there is a
1331 lookahead token, it should also be invoked before reporting a syntax
1332 error. This latter case is for the sake of the debugging output.
1334 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1335 follows. If no initial context is currently established for the
1336 current lookahead, then check if that lookahead can eventually be
1337 shifted if syntactic actions continue from the current context.
1338 Report a syntax error if it cannot. */
1339 #define YY_LAC_ESTABLISH \
1341 if (!yy_lac_established) \
1343 YYDPRINTF ((stderr, \
1344 "LAC: initial context established for %s\n", \
1345 yytname[yytoken])); \
1346 yy_lac_established = 1; \
1348 int yy_lac_status = \
1349 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1350 if (yy_lac_status == 2) \
1351 goto yyexhaustedlab; \
1352 if (yy_lac_status == 1) \
1358 /* Discard any previous initial lookahead context because of Event,
1359 which may be a lookahead change or an invalidation of the currently
1360 established initial context for the current lookahead.
1362 The most common example of a lookahead change is a shift. An example
1363 of both cases is syntax error recovery. That is, a syntax error
1364 occurs when the lookahead is syntactically erroneous for the
1365 currently established initial context, so error recovery manipulates
1366 the parser stacks to try to find a new initial context in which the
1367 current lookahead is syntactically acceptable. If it fails to find
1368 such a context, it discards the lookahead. */
1370 # define YY_LAC_DISCARD(Event) \
1372 if (yy_lac_established) \
1375 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1377 yy_lac_established = 0; \
1381 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1384 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1385 eventually (after perhaps some reductions) be shifted, return 1 if
1386 not, or return 2 if memory is exhausted. As preconditions and
1387 postconditions: *YYES_CAPACITY is the allocated size of the array to
1388 which *YYES points, and either *YYES = YYESA or *YYES points to an
1389 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1390 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1391 any old *YYES other than YYESA. */
1393 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1394 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1396 yytype_int16
*yyes_prev
= yyssp
;
1397 yytype_int16
*yyesp
= yyes_prev
;
1398 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1399 if (yytoken
== YYUNDEFTOK
)
1401 YYDPRINTF ((stderr
, " Always Err\n"));
1406 int yyrule
= yypact
[*yyesp
];
1407 if (yypact_value_is_default (yyrule
)
1408 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1409 || yycheck
[yyrule
] != yytoken
)
1411 yyrule
= yydefact
[*yyesp
];
1414 YYDPRINTF ((stderr
, " Err\n"));
1420 yyrule
= yytable
[yyrule
];
1421 if (yytable_value_is_error (yyrule
))
1423 YYDPRINTF ((stderr
, " Err\n"));
1428 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1434 YYSIZE_T yylen
= yyr2
[yyrule
];
1435 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1436 if (yyesp
!= yyes_prev
)
1438 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1451 yyesp
= yyes_prev
-= yylen
;
1456 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1457 yystate
= yypgoto
[yylhs
] + *yyesp
;
1458 if (yystate
< 0 || YYLAST
< yystate
1459 || yycheck
[yystate
] != *yyesp
)
1460 yystate
= yydefgoto
[yylhs
];
1462 yystate
= yytable
[yystate
];
1464 if (yyesp
== yyes_prev
)
1471 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1475 yyes
, yyesa
, &yyesp
, yyes_prev
))
1477 YYDPRINTF ((stderr
, "\n"));
1482 YYDPRINTF ((stderr
, " G%d", yystate
));
1491 # if defined __GLIBC__ && defined _STRING_H
1492 # define yystrlen strlen
1494 /* Return the length of YYSTR. */
1496 yystrlen (const char *yystr
)
1499 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1507 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1508 # define yystpcpy stpcpy
1510 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1513 yystpcpy (char *yydest
, const char *yysrc
)
1516 const char *yys
= yysrc
;
1518 while ((*yyd
++ = *yys
++) != '\0')
1527 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1528 quotes and backslashes, so that it's suitable for yyerror. The
1529 heuristic is that double-quoting is unnecessary unless the string
1530 contains an apostrophe, a comma, or backslash (other than
1531 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1532 null, do not copy; instead, return the length of what the result
1535 yytnamerr (char *yyres
, const char *yystr
)
1540 char const *yyp
= yystr
;
1547 goto do_not_strip_quotes
;
1551 goto do_not_strip_quotes
;
1564 do_not_strip_quotes
: ;
1568 return yystrlen (yystr
);
1570 return yystpcpy (yyres
, yystr
) - yyres
;
1574 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1575 about the unexpected token YYTOKEN for the state stack whose top is
1576 YYSSP. In order to see if a particular token T is a
1577 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1579 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1580 not large enough to hold the message. In that case, also set
1581 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1582 required number of bytes is too large to store or if
1583 yy_lac returned 2. */
1585 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1586 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1587 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1589 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1590 YYSIZE_T yysize
= yysize0
;
1591 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1592 /* Internationalized format string. */
1593 const char *yyformat
= YY_NULL
;
1594 /* Arguments of yyformat. */
1595 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1596 /* Number of reported tokens (one for the "unexpected", one per
1600 /* There are many possibilities here to consider:
1601 - If this state is a consistent state with a default action, then
1602 the only way this function was invoked is if the default action
1603 is an error action. In that case, don't check for expected
1604 tokens because there are none.
1605 - The only way there can be no lookahead present (in yychar) is if
1606 this state is a consistent state with a default action. Thus,
1607 detecting the absence of a lookahead is sufficient to determine
1608 that there is no unexpected or expected token to report. In that
1609 case, just report a simple "syntax error".
1610 - Don't assume there isn't a lookahead just because this state is a
1611 consistent state with a default action. There might have been a
1612 previous inconsistent state, consistent state with a non-default
1613 action, or user semantic action that manipulated yychar.
1614 In the first two cases, it might appear that the current syntax
1615 error should have been detected in the previous state when yy_lac
1616 was invoked. However, at that time, there might have been a
1617 different syntax error that discarded a different initial context
1618 during error recovery, leaving behind the current lookahead.
1620 if (yytoken
!= YYEMPTY
)
1622 int yyn
= yypact
[*yyssp
];
1623 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1624 yyarg
[yycount
++] = yytname
[yytoken
];
1625 if (!yypact_value_is_default (yyn
))
1629 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1630 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1633 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1635 if (yy_lac_status
== 2)
1637 if (yy_lac_status
== 1)
1640 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1646 yyarg
[yycount
++] = yytname
[yyx
];
1648 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1649 if (! (yysize
<= yysize1
1650 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1658 YYFPRINTF (stderr
, "No expected tokens.\n");
1664 # define YYCASE_(N, S) \
1668 YYCASE_(0, YY_("syntax error"));
1669 YYCASE_(1, YY_("syntax error, unexpected %s"));
1670 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1671 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1672 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1673 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1678 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1679 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1684 if (*yymsg_alloc
< yysize
)
1686 *yymsg_alloc
= 2 * yysize
;
1687 if (! (yysize
<= *yymsg_alloc
1688 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1689 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1693 /* Avoid sprintf, as that infringes on the user's name space.
1694 Don't have undefined behavior even if the translation
1695 produced a string with the wrong number of "%s"s. */
1699 while ((*yyp
= *yyformat
) != '\0')
1700 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1702 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1713 #endif /* YYERROR_VERBOSE */
1715 /*-----------------------------------------------.
1716 | Release the memory associated to this symbol. |
1717 `-----------------------------------------------*/
1720 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1723 YYUSE (yylocationp
);
1726 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1745 /* The lookahead symbol. */
1749 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1750 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1751 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1752 _Pragma ("GCC diagnostic push") \
1753 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1754 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1755 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1756 _Pragma ("GCC diagnostic pop")
1758 /* Default value used for initialization, for pacifying older GCCs
1759 or non-GCC compilers. */
1760 static YYSTYPE yyval_default
;
1761 # define YY_INITIAL_VALUE(Value) = Value
1763 static YYLTYPE yyloc_default
1764 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
1768 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1769 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1770 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1772 #ifndef YY_INITIAL_VALUE
1773 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1776 /* The semantic value of the lookahead symbol. */
1777 YYSTYPE yylval
YY_INITIAL_VALUE(yyval_default
);
1779 /* Location data for the lookahead symbol. */
1780 YYLTYPE yylloc
= yyloc_default
;
1783 /* Number of syntax errors so far. */
1787 /* Number of tokens to shift before error messages enabled. */
1790 /* The stacks and their tools:
1791 `yyss': related to states.
1792 `yyvs': related to semantic values.
1793 `yyls': related to locations.
1795 Refer to the stacks through separate pointers, to allow yyoverflow
1796 to reallocate them elsewhere. */
1798 /* The state stack. */
1799 yytype_int16 yyssa
[YYINITDEPTH
];
1801 yytype_int16
*yyssp
;
1803 /* The semantic value stack. */
1804 YYSTYPE yyvsa
[YYINITDEPTH
];
1808 /* The location stack. */
1809 YYLTYPE yylsa
[YYINITDEPTH
];
1813 /* The locations where the error started and ended. */
1814 YYLTYPE yyerror_range
[3];
1816 YYSIZE_T yystacksize
;
1818 yytype_int16 yyesa
[20];
1820 YYSIZE_T yyes_capacity
;
1822 int yy_lac_established
= 0;
1825 /* Lookahead token as an internal (translated) token number. */
1827 /* The variables used to return semantic value and location from the
1833 /* Buffer for error messages, and its allocated size. */
1835 char *yymsg
= yymsgbuf
;
1836 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1839 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1841 /* The number of symbols on the RHS of the reduced rule.
1842 Keep to zero when no symbol should be popped. */
1845 yyssp
= yyss
= yyssa
;
1846 yyvsp
= yyvs
= yyvsa
;
1847 yylsp
= yyls
= yylsa
;
1848 yystacksize
= YYINITDEPTH
;
1851 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1852 if (YYMAXDEPTH
< yyes_capacity
)
1853 yyes_capacity
= YYMAXDEPTH
;
1855 YYDPRINTF ((stderr
, "Starting parse\n"));
1860 yychar
= YYEMPTY
; /* Cause a token to be read. */
1862 /* User initialization code. */
1863 #line 97 "src/parse-gram.y" /* yacc.c:1452 */
1865 /* Bison's grammar can initial empty locations, hence a default
1866 location is needed. */
1867 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1868 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1870 #line 1871 "src/parse-gram.c" /* yacc.c:1452 */
1874 /*------------------------------------------------------------.
1875 | yynewstate -- Push a new state, which is found in yystate. |
1876 `------------------------------------------------------------*/
1878 /* In all cases, when you get here, the value and location stacks
1879 have just been pushed. So pushing a state here evens the stacks. */
1885 if (yyss
+ yystacksize
- 1 <= yyssp
)
1887 /* Get the current used size of the three stacks, in elements. */
1888 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1892 /* Give user a chance to reallocate the stack. Use copies of
1893 these so that the &'s don't force the real ones into
1895 YYSTYPE
*yyvs1
= yyvs
;
1896 yytype_int16
*yyss1
= yyss
;
1897 YYLTYPE
*yyls1
= yyls
;
1899 /* Each stack pointer address is followed by the size of the
1900 data in use in that stack, in bytes. This used to be a
1901 conditional around just the two extra args, but that might
1902 be undefined if yyoverflow is a macro. */
1903 yyoverflow (YY_("memory exhausted"),
1904 &yyss1
, yysize
* sizeof (*yyssp
),
1905 &yyvs1
, yysize
* sizeof (*yyvsp
),
1906 &yyls1
, yysize
* sizeof (*yylsp
),
1913 #else /* no yyoverflow */
1914 # ifndef YYSTACK_RELOCATE
1915 goto yyexhaustedlab
;
1917 /* Extend the stack our own way. */
1918 if (YYMAXDEPTH
<= yystacksize
)
1919 goto yyexhaustedlab
;
1921 if (YYMAXDEPTH
< yystacksize
)
1922 yystacksize
= YYMAXDEPTH
;
1925 yytype_int16
*yyss1
= yyss
;
1926 union yyalloc
*yyptr
=
1927 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1929 goto yyexhaustedlab
;
1930 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1931 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1932 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1933 # undef YYSTACK_RELOCATE
1935 YYSTACK_FREE (yyss1
);
1938 #endif /* no yyoverflow */
1940 yyssp
= yyss
+ yysize
- 1;
1941 yyvsp
= yyvs
+ yysize
- 1;
1942 yylsp
= yyls
+ yysize
- 1;
1944 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1945 (unsigned long int) yystacksize
));
1947 if (yyss
+ yystacksize
- 1 <= yyssp
)
1951 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1953 if (yystate
== YYFINAL
)
1963 /* Do appropriate processing given the current state. Read a
1964 lookahead token if we need one and don't already have one. */
1966 /* First try to decide what to do without reference to lookahead token. */
1967 yyn
= yypact
[yystate
];
1968 if (yypact_value_is_default (yyn
))
1971 /* Not known => get a lookahead token if don't already have one. */
1973 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1974 if (yychar
== YYEMPTY
)
1976 YYDPRINTF ((stderr
, "Reading a token: "));
1977 yychar
= yylex (&yylval
, &yylloc
);
1980 if (yychar
<= YYEOF
)
1982 yychar
= yytoken
= YYEOF
;
1983 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1987 yytoken
= YYTRANSLATE (yychar
);
1988 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1991 /* If the proper action on seeing token YYTOKEN is to reduce or to
1992 detect an error, take that action. */
1994 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2002 if (yytable_value_is_error (yyn
))
2009 /* Count tokens shifted since error; after three, turn off error
2014 /* Shift the lookahead token. */
2015 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2017 /* Discard the shifted token. */
2019 YY_LAC_DISCARD ("shift");
2022 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2024 YY_IGNORE_MAYBE_UNINITIALIZED_END
2029 /*-----------------------------------------------------------.
2030 | yydefault -- do the default action for the current state. |
2031 `-----------------------------------------------------------*/
2033 yyn
= yydefact
[yystate
];
2039 /*-----------------------------.
2040 | yyreduce -- Do a reduction. |
2041 `-----------------------------*/
2043 /* yyn is the number of a rule to reduce with. */
2046 /* If YYLEN is nonzero, implement the default value of the action:
2049 Otherwise, the following line sets YYVAL to garbage.
2050 This behavior is undocumented and Bison
2051 users should not rely upon it. Assigning to YYVAL
2052 unconditionally makes the parser a bit smaller, and it avoids a
2053 GCC warning that YYVAL may be used uninitialized. */
2054 yyval
= yyvsp
[1-yylen
];
2056 /* Default location. */
2057 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2058 YY_REDUCE_PRINT (yyn
);
2060 int yychar_backup
= yychar
;
2064 #line 284 "src/parse-gram.y" /* yacc.c:1669 */
2066 code_props plain_code
;
2067 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2068 code_props_translate_code (&plain_code
);
2069 gram_scanner_last_string_free ();
2070 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2071 plain_code
.code
, (yylsp
[0]));
2072 code_scanner_last_string_free ();
2074 #line 2075 "src/parse-gram.c" /* yacc.c:1669 */
2078 #line 294 "src/parse-gram.y" /* yacc.c:1669 */
2080 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2082 #line 2083 "src/parse-gram.c" /* yacc.c:1669 */
2086 #line 298 "src/parse-gram.y" /* yacc.c:1669 */
2088 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2089 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2091 #line 2092 "src/parse-gram.c" /* yacc.c:1669 */
2095 #line 302 "src/parse-gram.y" /* yacc.c:1669 */
2096 { defines_flag
= true; }
2097 #line 2098 "src/parse-gram.c" /* yacc.c:1669 */
2101 #line 304 "src/parse-gram.y" /* yacc.c:1669 */
2103 defines_flag
= true;
2104 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2106 #line 2107 "src/parse-gram.c" /* yacc.c:1669 */
2110 #line 309 "src/parse-gram.y" /* yacc.c:1669 */
2112 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2113 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2115 #line 2116 "src/parse-gram.c" /* yacc.c:1669 */
2119 #line 313 "src/parse-gram.y" /* yacc.c:1669 */
2120 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2121 #line 2122 "src/parse-gram.c" /* yacc.c:1669 */
2125 #line 314 "src/parse-gram.y" /* yacc.c:1669 */
2126 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2127 #line 2128 "src/parse-gram.c" /* yacc.c:1669 */
2131 #line 315 "src/parse-gram.y" /* yacc.c:1669 */
2132 { spec_file_prefix
= (yyvsp
[0].chars
); }
2133 #line 2134 "src/parse-gram.c" /* yacc.c:1669 */
2137 #line 317 "src/parse-gram.y" /* yacc.c:1669 */
2139 nondeterministic_parser
= true;
2142 #line 2143 "src/parse-gram.c" /* yacc.c:1669 */
2146 #line 322 "src/parse-gram.y" /* yacc.c:1669 */
2149 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2150 code_props_translate_code (&action
);
2151 gram_scanner_last_string_free ();
2152 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2153 code_scanner_last_string_free ();
2155 #line 2156 "src/parse-gram.c" /* yacc.c:1669 */
2159 #line 330 "src/parse-gram.y" /* yacc.c:1669 */
2160 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2161 #line 2162 "src/parse-gram.c" /* yacc.c:1669 */
2165 #line 331 "src/parse-gram.y" /* yacc.c:1669 */
2166 { spec_name_prefix
= (yyvsp
[0].chars
); }
2167 #line 2168 "src/parse-gram.c" /* yacc.c:1669 */
2171 #line 332 "src/parse-gram.y" /* yacc.c:1669 */
2172 { no_lines_flag
= true; }
2173 #line 2174 "src/parse-gram.c" /* yacc.c:1669 */
2177 #line 333 "src/parse-gram.y" /* yacc.c:1669 */
2178 { nondeterministic_parser
= true; }
2179 #line 2180 "src/parse-gram.c" /* yacc.c:1669 */
2183 #line 334 "src/parse-gram.y" /* yacc.c:1669 */
2184 { spec_outfile
= (yyvsp
[0].chars
); }
2185 #line 2186 "src/parse-gram.c" /* yacc.c:1669 */
2189 #line 335 "src/parse-gram.y" /* yacc.c:1669 */
2190 { current_param
= (yyvsp
[0].param
); }
2191 #line 2192 "src/parse-gram.c" /* yacc.c:1669 */
2195 #line 335 "src/parse-gram.y" /* yacc.c:1669 */
2196 { current_param
= param_none
; }
2197 #line 2198 "src/parse-gram.c" /* yacc.c:1669 */
2201 #line 336 "src/parse-gram.y" /* yacc.c:1669 */
2202 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2203 #line 2204 "src/parse-gram.c" /* yacc.c:1669 */
2207 #line 338 "src/parse-gram.y" /* yacc.c:1669 */
2209 char const *skeleton_user
= (yyvsp
[0].chars
);
2210 if (strchr (skeleton_user
, '/'))
2212 size_t dir_length
= strlen (current_file
);
2213 char *skeleton_build
;
2214 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2216 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2219 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2222 memcpy (skeleton_build
, current_file
, dir_length
);
2223 skeleton_build
[dir_length
++] = '/';
2225 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2226 skeleton_user
= uniqstr_new (skeleton_build
);
2227 free (skeleton_build
);
2229 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2231 #line 2232 "src/parse-gram.c" /* yacc.c:1669 */
2235 #line 361 "src/parse-gram.y" /* yacc.c:1669 */
2236 { token_table_flag
= true; }
2237 #line 2238 "src/parse-gram.c" /* yacc.c:1669 */
2241 #line 362 "src/parse-gram.y" /* yacc.c:1669 */
2242 { report_flag
|= report_states
; }
2243 #line 2244 "src/parse-gram.c" /* yacc.c:1669 */
2247 #line 363 "src/parse-gram.y" /* yacc.c:1669 */
2248 { yacc_flag
= true; }
2249 #line 2250 "src/parse-gram.c" /* yacc.c:1669 */
2253 #line 368 "src/parse-gram.y" /* yacc.c:1669 */
2254 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2255 #line 2256 "src/parse-gram.c" /* yacc.c:1669 */
2259 #line 369 "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 381 "src/parse-gram.y" /* yacc.c:1669 */
2267 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2269 #line 2270 "src/parse-gram.c" /* yacc.c:1669 */
2273 #line 385 "src/parse-gram.y" /* yacc.c:1669 */
2276 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2277 code_props_translate_code (&code
);
2280 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2281 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2282 symbol_list_free ((yyvsp
[0].list
));
2285 #line 2286 "src/parse-gram.c" /* yacc.c:1669 */
2289 #line 397 "src/parse-gram.y" /* yacc.c:1669 */
2291 default_prec
= true;
2293 #line 2294 "src/parse-gram.c" /* yacc.c:1669 */
2297 #line 401 "src/parse-gram.y" /* yacc.c:1669 */
2299 default_prec
= false;
2301 #line 2302 "src/parse-gram.c" /* yacc.c:1669 */
2305 #line 405 "src/parse-gram.y" /* yacc.c:1669 */
2307 /* Do not invoke muscle_percent_code_grow here since it invokes
2308 muscle_user_name_list_grow. */
2309 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2310 code_scanner_last_string_free ();
2312 #line 2313 "src/parse-gram.c" /* yacc.c:1669 */
2316 #line 412 "src/parse-gram.y" /* yacc.c:1669 */
2318 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2319 code_scanner_last_string_free ();
2321 #line 2322 "src/parse-gram.c" /* yacc.c:1669 */
2325 #line 422 "src/parse-gram.y" /* yacc.c:1669 */
2326 { (yyval
.code_type
) = destructor
; }
2327 #line 2328 "src/parse-gram.c" /* yacc.c:1669 */
2331 #line 423 "src/parse-gram.y" /* yacc.c:1669 */
2332 { (yyval
.code_type
) = printer
; }
2333 #line 2334 "src/parse-gram.c" /* yacc.c:1669 */
2337 #line 433 "src/parse-gram.y" /* yacc.c:1669 */
2339 #line 2340 "src/parse-gram.c" /* yacc.c:1669 */
2343 #line 434 "src/parse-gram.y" /* yacc.c:1669 */
2344 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2345 #line 2346 "src/parse-gram.c" /* yacc.c:1669 */
2349 #line 439 "src/parse-gram.y" /* yacc.c:1669 */
2352 muscle_code_grow ("union_members", (yyvsp
[0].chars
), (yylsp
[0]));
2353 code_scanner_last_string_free ();
2355 #line 2356 "src/parse-gram.c" /* yacc.c:1669 */
2359 #line 450 "src/parse-gram.y" /* yacc.c:1669 */
2360 { current_class
= nterm_sym
; }
2361 #line 2362 "src/parse-gram.c" /* yacc.c:1669 */
2365 #line 451 "src/parse-gram.y" /* yacc.c:1669 */
2367 current_class
= unknown_sym
;
2368 current_type
= NULL
;
2370 #line 2371 "src/parse-gram.c" /* yacc.c:1669 */
2374 #line 455 "src/parse-gram.y" /* yacc.c:1669 */
2375 { current_class
= token_sym
; }
2376 #line 2377 "src/parse-gram.c" /* yacc.c:1669 */
2380 #line 456 "src/parse-gram.y" /* yacc.c:1669 */
2382 current_class
= unknown_sym
;
2383 current_type
= NULL
;
2385 #line 2386 "src/parse-gram.c" /* yacc.c:1669 */
2389 #line 461 "src/parse-gram.y" /* yacc.c:1669 */
2393 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2394 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2395 symbol_list_free ((yyvsp
[0].list
));
2397 #line 2398 "src/parse-gram.c" /* yacc.c:1669 */
2401 #line 472 "src/parse-gram.y" /* yacc.c:1669 */
2405 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2407 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2408 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2410 symbol_list_free ((yyvsp
[0].list
));
2411 current_type
= NULL
;
2413 #line 2414 "src/parse-gram.c" /* yacc.c:1669 */
2417 #line 486 "src/parse-gram.y" /* yacc.c:1669 */
2418 { (yyval
.assoc
) = left_assoc
; }
2419 #line 2420 "src/parse-gram.c" /* yacc.c:1669 */
2423 #line 487 "src/parse-gram.y" /* yacc.c:1669 */
2424 { (yyval
.assoc
) = right_assoc
; }
2425 #line 2426 "src/parse-gram.c" /* yacc.c:1669 */
2429 #line 488 "src/parse-gram.y" /* yacc.c:1669 */
2430 { (yyval
.assoc
) = non_assoc
; }
2431 #line 2432 "src/parse-gram.c" /* yacc.c:1669 */
2435 #line 489 "src/parse-gram.y" /* yacc.c:1669 */
2436 { (yyval
.assoc
) = precedence_assoc
; }
2437 #line 2438 "src/parse-gram.c" /* yacc.c:1669 */
2441 #line 493 "src/parse-gram.y" /* yacc.c:1669 */
2442 { current_type
= NULL
; }
2443 #line 2444 "src/parse-gram.c" /* yacc.c:1669 */
2447 #line 494 "src/parse-gram.y" /* yacc.c:1669 */
2448 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2449 #line 2450 "src/parse-gram.c" /* yacc.c:1669 */
2453 #line 500 "src/parse-gram.y" /* yacc.c:1669 */
2454 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2455 #line 2456 "src/parse-gram.c" /* yacc.c:1669 */
2459 #line 502 "src/parse-gram.y" /* yacc.c:1669 */
2460 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2461 #line 2462 "src/parse-gram.c" /* yacc.c:1669 */
2465 #line 506 "src/parse-gram.y" /* yacc.c:1669 */
2466 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2467 #line 2468 "src/parse-gram.c" /* yacc.c:1669 */
2471 #line 507 "src/parse-gram.y" /* yacc.c:1669 */
2472 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2473 #line 2474 "src/parse-gram.c" /* yacc.c:1669 */
2477 #line 513 "src/parse-gram.y" /* yacc.c:1669 */
2478 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2479 #line 2480 "src/parse-gram.c" /* yacc.c:1669 */
2483 #line 515 "src/parse-gram.y" /* yacc.c:1669 */
2484 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2485 #line 2486 "src/parse-gram.c" /* yacc.c:1669 */
2489 #line 519 "src/parse-gram.y" /* yacc.c:1669 */
2490 { (yyval
.list
) = (yyvsp
[0].list
); }
2491 #line 2492 "src/parse-gram.c" /* yacc.c:1669 */
2495 #line 520 "src/parse-gram.y" /* yacc.c:1669 */
2496 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2497 #line 2498 "src/parse-gram.c" /* yacc.c:1669 */
2501 #line 524 "src/parse-gram.y" /* yacc.c:1669 */
2502 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2503 #line 2504 "src/parse-gram.c" /* yacc.c:1669 */
2507 #line 525 "src/parse-gram.y" /* yacc.c:1669 */
2508 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2509 #line 2510 "src/parse-gram.c" /* yacc.c:1669 */
2513 #line 530 "src/parse-gram.y" /* yacc.c:1669 */
2514 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2515 #line 2516 "src/parse-gram.c" /* yacc.c:1669 */
2519 #line 531 "src/parse-gram.y" /* yacc.c:1669 */
2520 { (yyval
.uniqstr
) = uniqstr_new (""); }
2521 #line 2522 "src/parse-gram.c" /* yacc.c:1669 */
2525 #line 537 "src/parse-gram.y" /* yacc.c:1669 */
2527 current_type
= (yyvsp
[0].uniqstr
);
2530 #line 2531 "src/parse-gram.c" /* yacc.c:1669 */
2534 #line 542 "src/parse-gram.y" /* yacc.c:1669 */
2536 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2537 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2539 #line 2540 "src/parse-gram.c" /* yacc.c:1669 */
2543 #line 547 "src/parse-gram.y" /* yacc.c:1669 */
2545 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2546 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2547 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2549 #line 2550 "src/parse-gram.c" /* yacc.c:1669 */
2553 #line 553 "src/parse-gram.y" /* yacc.c:1669 */
2555 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2556 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2557 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2559 #line 2560 "src/parse-gram.c" /* yacc.c:1669 */
2563 #line 559 "src/parse-gram.y" /* yacc.c:1669 */
2565 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2566 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2567 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2568 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2570 #line 2571 "src/parse-gram.c" /* yacc.c:1669 */
2574 #line 589 "src/parse-gram.y" /* yacc.c:1669 */
2578 #line 2579 "src/parse-gram.c" /* yacc.c:1669 */
2582 #line 595 "src/parse-gram.y" /* yacc.c:1669 */
2583 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2584 #line 2585 "src/parse-gram.c" /* yacc.c:1669 */
2588 #line 596 "src/parse-gram.y" /* yacc.c:1669 */
2590 /* Free the current lhs. */
2591 current_lhs (0, (yylsp
[-3]), 0);
2593 #line 2594 "src/parse-gram.c" /* yacc.c:1669 */
2597 #line 603 "src/parse-gram.y" /* yacc.c:1669 */
2598 { grammar_current_rule_end ((yylsp
[0])); }
2599 #line 2600 "src/parse-gram.c" /* yacc.c:1669 */
2603 #line 604 "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 610 "src/parse-gram.y" /* yacc.c:1669 */
2610 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2611 current_lhs_named_ref
); }
2612 #line 2613 "src/parse-gram.c" /* yacc.c:1669 */
2616 #line 613 "src/parse-gram.y" /* yacc.c:1669 */
2617 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2618 #line 2619 "src/parse-gram.c" /* yacc.c:1669 */
2622 #line 615 "src/parse-gram.y" /* yacc.c:1669 */
2623 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2624 #line 2625 "src/parse-gram.c" /* yacc.c:1669 */
2628 #line 617 "src/parse-gram.y" /* yacc.c:1669 */
2629 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2630 #line 2631 "src/parse-gram.c" /* yacc.c:1669 */
2634 #line 619 "src/parse-gram.y" /* yacc.c:1669 */
2635 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2636 #line 2637 "src/parse-gram.c" /* yacc.c:1669 */
2640 #line 621 "src/parse-gram.y" /* yacc.c:1669 */
2641 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2642 #line 2643 "src/parse-gram.c" /* yacc.c:1669 */
2646 #line 623 "src/parse-gram.y" /* yacc.c:1669 */
2647 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2648 #line 2649 "src/parse-gram.c" /* yacc.c:1669 */
2652 #line 627 "src/parse-gram.y" /* yacc.c:1669 */
2653 { (yyval
.named_ref
) = 0; }
2654 #line 2655 "src/parse-gram.c" /* yacc.c:1669 */
2658 #line 629 "src/parse-gram.y" /* yacc.c:1669 */
2659 { (yyval
.named_ref
) = named_ref_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2660 #line 2661 "src/parse-gram.c" /* yacc.c:1669 */
2664 #line 640 "src/parse-gram.y" /* yacc.c:1669 */
2665 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2666 #line 2667 "src/parse-gram.c" /* yacc.c:1669 */
2670 #line 645 "src/parse-gram.y" /* yacc.c:1669 */
2671 { (yyval
.chars
) = ""; }
2672 #line 2673 "src/parse-gram.c" /* yacc.c:1669 */
2676 #line 646 "src/parse-gram.y" /* yacc.c:1669 */
2677 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2678 #line 2679 "src/parse-gram.c" /* yacc.c:1669 */
2682 #line 657 "src/parse-gram.y" /* yacc.c:1669 */
2684 code_props plain_code
;
2685 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2686 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2687 code_props_translate_code (&plain_code
);
2688 gram_scanner_last_string_free ();
2689 (yyval
.chars
) = plain_code
.code
;
2691 #line 2692 "src/parse-gram.c" /* yacc.c:1669 */
2695 #line 677 "src/parse-gram.y" /* yacc.c:1669 */
2696 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2697 #line 2698 "src/parse-gram.c" /* yacc.c:1669 */
2701 #line 679 "src/parse-gram.y" /* yacc.c:1669 */
2703 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2704 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2705 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2707 #line 2708 "src/parse-gram.c" /* yacc.c:1669 */
2711 #line 687 "src/parse-gram.y" /* yacc.c:1669 */
2712 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2713 #line 2714 "src/parse-gram.c" /* yacc.c:1669 */
2717 #line 699 "src/parse-gram.y" /* yacc.c:1669 */
2719 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2720 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2722 #line 2723 "src/parse-gram.c" /* yacc.c:1669 */
2726 #line 708 "src/parse-gram.y" /* yacc.c:1669 */
2728 code_props plain_code
;
2729 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2730 code_props_translate_code (&plain_code
);
2731 gram_scanner_last_string_free ();
2732 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2733 code_scanner_last_string_free ();
2735 #line 2736 "src/parse-gram.c" /* yacc.c:1669 */
2739 #line 2740 "src/parse-gram.c" /* yacc.c:1669 */
2742 if (yychar_backup
!= yychar
)
2743 YY_LAC_DISCARD ("yychar change");
2745 /* User semantic actions sometimes alter yychar, and that requires
2746 that yytoken be updated with the new translation. We take the
2747 approach of translating immediately before every use of yytoken.
2748 One alternative is translating here after every semantic action,
2749 but that translation would be missed if the semantic action invokes
2750 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2751 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2752 incorrect destructor might then be invoked immediately. In the
2753 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2754 to an incorrect destructor call or verbose syntax error message
2755 before the lookahead is translated. */
2756 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2760 YY_STACK_PRINT (yyss
, yyssp
);
2765 /* Now `shift' the result of the reduction. Determine what state
2766 that goes to, based on the state we popped back to and the rule
2767 number reduced by. */
2771 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2772 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2773 yystate
= yytable
[yystate
];
2775 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2780 /*--------------------------------------.
2781 | yyerrlab -- here on detecting error. |
2782 `--------------------------------------*/
2784 /* Make sure we have latest lookahead translation. See comments at
2785 user semantic actions for why this is necessary. */
2786 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2788 /* If not already recovering from an error, report this error. */
2792 #if ! YYERROR_VERBOSE
2793 yyerror (&yylloc
, YY_("syntax error"));
2795 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2796 yyesa, &yyes, &yyes_capacity, \
2799 char const *yymsgp
= YY_("syntax error");
2800 int yysyntax_error_status
;
2801 if (yychar
!= YYEMPTY
)
2803 yysyntax_error_status
= YYSYNTAX_ERROR
;
2804 if (yysyntax_error_status
== 0)
2806 else if (yysyntax_error_status
== 1)
2808 if (yymsg
!= yymsgbuf
)
2809 YYSTACK_FREE (yymsg
);
2810 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2814 yymsg_alloc
= sizeof yymsgbuf
;
2815 yysyntax_error_status
= 2;
2819 yysyntax_error_status
= YYSYNTAX_ERROR
;
2823 yyerror (&yylloc
, yymsgp
);
2824 if (yysyntax_error_status
== 2)
2825 goto yyexhaustedlab
;
2827 # undef YYSYNTAX_ERROR
2831 yyerror_range
[1] = yylloc
;
2833 if (yyerrstatus
== 3)
2835 /* If just tried and failed to reuse lookahead token after an
2836 error, discard it. */
2838 if (yychar
<= YYEOF
)
2840 /* Return failure if at end of input. */
2841 if (yychar
== YYEOF
)
2846 yydestruct ("Error: discarding",
2847 yytoken
, &yylval
, &yylloc
);
2852 /* Else will try to reuse lookahead token after shifting the error
2857 /*---------------------------------------------------.
2858 | yyerrorlab -- error raised explicitly by YYERROR. |
2859 `---------------------------------------------------*/
2862 /* Pacify compilers like GCC when the user code never invokes
2863 YYERROR and the label yyerrorlab therefore never appears in user
2865 if (/*CONSTCOND*/ 0)
2868 yyerror_range
[1] = yylsp
[1-yylen
];
2869 /* Do not reclaim the symbols of the rule whose action triggered
2873 YY_STACK_PRINT (yyss
, yyssp
);
2878 /*-------------------------------------------------------------.
2879 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2880 `-------------------------------------------------------------*/
2882 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2886 yyn
= yypact
[yystate
];
2887 if (!yypact_value_is_default (yyn
))
2890 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2898 /* Pop the current state because it cannot handle the error token. */
2902 yyerror_range
[1] = *yylsp
;
2903 yydestruct ("Error: popping",
2904 yystos
[yystate
], yyvsp
, yylsp
);
2907 YY_STACK_PRINT (yyss
, yyssp
);
2910 /* If the stack popping above didn't lose the initial context for the
2911 current lookahead token, the shift below will for sure. */
2912 YY_LAC_DISCARD ("error recovery");
2914 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2916 YY_IGNORE_MAYBE_UNINITIALIZED_END
2918 yyerror_range
[2] = yylloc
;
2919 /* Using YYLLOC is tempting, but would change the location of
2920 the lookahead. YYLOC is available though. */
2921 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2924 /* Shift the error token. */
2925 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2931 /*-------------------------------------.
2932 | yyacceptlab -- YYACCEPT comes here. |
2933 `-------------------------------------*/
2938 /*-----------------------------------.
2939 | yyabortlab -- YYABORT comes here. |
2940 `-----------------------------------*/
2946 /*-------------------------------------------------.
2947 | yyexhaustedlab -- memory exhaustion comes here. |
2948 `-------------------------------------------------*/
2950 yyerror (&yylloc
, YY_("memory exhausted"));
2956 if (yychar
!= YYEMPTY
)
2958 /* Make sure we have latest lookahead translation. See comments at
2959 user semantic actions for why this is necessary. */
2960 yytoken
= YYTRANSLATE (yychar
);
2961 yydestruct ("Cleanup: discarding lookahead",
2962 yytoken
, &yylval
, &yylloc
);
2964 /* Do not reclaim the symbols of the rule whose action triggered
2965 this YYABORT or YYACCEPT. */
2967 YY_STACK_PRINT (yyss
, yyssp
);
2968 while (yyssp
!= yyss
)
2970 yydestruct ("Cleanup: popping",
2971 yystos
[*yyssp
], yyvsp
, yylsp
);
2976 YYSTACK_FREE (yyss
);
2979 YYSTACK_FREE (yyes
);
2981 if (yymsg
!= yymsgbuf
)
2982 YYSTACK_FREE (yymsg
);
2986 #line 718 "src/parse-gram.y" /* yacc.c:1929 */
2989 /* Return the location of the left-hand side of a rule whose
2990 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2991 the right-hand side, and return an empty location equal to the end
2992 boundary of RHS[0] if the right-hand side is empty. */
2995 lloc_default (YYLTYPE
const *rhs
, int n
)
3000 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3001 The bug is fixed in 7.4.2m, but play it safe for now. */
3002 loc
.start
= rhs
[n
].end
;
3003 loc
.end
= rhs
[n
].end
;
3005 /* Ignore empty nonterminals the start of the right-hand side.
3006 Do not bother to ignore them at the end of the right-hand side,
3007 since empty nonterminals have the same end as their predecessors. */
3008 for (i
= 1; i
<= n
; i
++)
3009 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3011 loc
.start
= rhs
[i
].start
;
3020 add_param (param_type type
, char *decl
, location loc
)
3022 static char const alphanum
[26 + 26 + 1 + 10] =
3023 "abcdefghijklmnopqrstuvwxyz"
3024 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3028 char const *name_start
= NULL
;
3031 /* Stop on last actual character. */
3032 for (p
= decl
; p
[1]; p
++)
3034 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3035 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3038 /* Strip the surrounding '{' and '}', and any blanks just inside
3041 while (c_isspace ((unsigned char) *p
))
3045 while (c_isspace ((unsigned char) *decl
))
3050 complain (&loc
, complaint
, _("missing identifier in parameter declaration"));
3053 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3054 if (type
& param_lex
)
3055 muscle_pair_list_grow ("lex_param", decl
, name
);
3056 if (type
& param_parse
)
3057 muscle_pair_list_grow ("parse_param", decl
, name
);
3061 gram_scanner_last_string_free ();
3066 version_check (location
const *loc
, char const *version
)
3068 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3070 complain (loc
, complaint
, "require bison %s, but have %s",
3071 version
, PACKAGE_VERSION
);
3077 gram_error (location
const *loc
, char const *msg
)
3079 complain (loc
, complaint
, "%s", msg
);
3083 token_name (int type
)
3085 return yytname
[YYTRANSLATE (type
)];
3096 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3097 return quotearg_style (escape_quoting_style
, buf
);