1 /* A Bison parser, made by GNU Bison 2.6.2.950-7c7ce-dirty. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.6.2.950-7c7ce-dirty"
50 #define YYSKELETON_NAME "yacc.c"
62 /* Substitute the variable and function names. */
63 #define yyparse gram_parse
64 #define yylex gram_lex
65 #define yyerror gram_error
66 #define yylval gram_lval
67 #define yychar gram_char
68 #define yydebug gram_debug
69 #define yynerrs gram_nerrs
70 #define yylloc gram_lloc
72 /* Copy the first part of user declarations. */
73 /* Line 353 of yacc.c */
74 #line 1 "src/parse-gram.y"
75 /* Bison Grammar Parser -*- C -*-
77 Copyright (C) 2002-2012 Free Software Foundation, Inc.
79 This file is part of Bison, the GNU Compiler Compiler.
81 This program is free software: you can redistribute it and/or modify
82 it under the terms of the GNU General Public License as published by
83 the Free Software Foundation, either version 3 of the License, or
84 (at your option) any later version.
86 This program is distributed in the hope that it will be useful,
87 but WITHOUT ANY WARRANTY; without even the implied warranty of
88 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
89 GNU General Public License for more details.
91 You should have received a copy of the GNU General Public License
92 along with this program. If not, see <http://www.gnu.org/licenses/>. */
99 #include "conflicts.h"
103 #include "muscle-tab.h"
104 #include "named-ref.h"
105 #include "quotearg.h"
109 #include "scan-gram.h"
110 #include "scan-code.h"
111 #include "xmemdup0.h"
113 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
114 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
116 #define YY_LOCATION_PRINT(File, Loc) \
117 location_print (File, Loc)
119 static void version_check (location
const *loc
, char const *version
);
121 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
122 FIXME: depends on the undocumented availability of YYLLOC. */
124 #define yyerror(Msg) \
125 gram_error (&yylloc, Msg)
126 static void gram_error (location
const *, char const *);
128 static char const *char_name (char);
130 /* Line 353 of yacc.c */
131 #line 132 "src/parse-gram.c"
134 # if defined __cplusplus && 201103L <= __cplusplus
135 # define YY_NULL nullptr
141 /* Enabling verbose error messages. */
142 #ifdef YYERROR_VERBOSE
143 # undef YYERROR_VERBOSE
144 # define YYERROR_VERBOSE 1
146 # define YYERROR_VERBOSE 1
149 /* In a future release of Bison, this section will be replaced
150 by #include "src/parse-gram.h". */
151 #ifndef YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
152 # define YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
153 /* Enabling traces. */
158 extern int gram_debug
;
160 /* "%code requires" blocks. */
161 /* Line 369 of yacc.c */
162 #line 223 "src/parse-gram.y"
170 param_parse
= 1 << 1,
171 param_both
= param_lex
| param_parse
176 /* Line 369 of yacc.c */
177 #line 178 "src/parse-gram.c"
182 /* Put the tokens into the symbol table, so that GDB and other debuggers
192 PERCENT_DESTRUCTOR
= 263,
193 PERCENT_PRINTER
= 264,
196 PERCENT_NONASSOC
= 267,
197 PERCENT_PRECEDENCE
= 268,
202 PERCENT_DEFAULT_PREC
= 273,
203 PERCENT_DEFINE
= 274,
204 PERCENT_DEFINES
= 275,
205 PERCENT_ERROR_VERBOSE
= 276,
206 PERCENT_EXPECT
= 277,
207 PERCENT_EXPECT_RR
= 278,
209 PERCENT_FILE_PREFIX
= 280,
210 PERCENT_GLR_PARSER
= 281,
211 PERCENT_INITIAL_ACTION
= 282,
212 PERCENT_LANGUAGE
= 283,
213 PERCENT_NAME_PREFIX
= 284,
214 PERCENT_NO_DEFAULT_PREC
= 285,
215 PERCENT_NO_LINES
= 286,
216 PERCENT_NONDETERMINISTIC_PARSER
= 287,
217 PERCENT_OUTPUT
= 288,
218 PERCENT_REQUIRE
= 289,
219 PERCENT_SKELETON
= 290,
221 PERCENT_TOKEN_TABLE
= 292,
222 PERCENT_VERBOSE
= 293,
225 BRACED_PREDICATE
= 296,
232 PERCENT_PERCENT
= 303,
247 #define PERCENT_TOKEN 260
248 #define PERCENT_NTERM 261
249 #define PERCENT_TYPE 262
250 #define PERCENT_DESTRUCTOR 263
251 #define PERCENT_PRINTER 264
252 #define PERCENT_LEFT 265
253 #define PERCENT_RIGHT 266
254 #define PERCENT_NONASSOC 267
255 #define PERCENT_PRECEDENCE 268
256 #define PERCENT_PREC 269
257 #define PERCENT_DPREC 270
258 #define PERCENT_MERGE 271
259 #define PERCENT_CODE 272
260 #define PERCENT_DEFAULT_PREC 273
261 #define PERCENT_DEFINE 274
262 #define PERCENT_DEFINES 275
263 #define PERCENT_ERROR_VERBOSE 276
264 #define PERCENT_EXPECT 277
265 #define PERCENT_EXPECT_RR 278
266 #define PERCENT_FLAG 279
267 #define PERCENT_FILE_PREFIX 280
268 #define PERCENT_GLR_PARSER 281
269 #define PERCENT_INITIAL_ACTION 282
270 #define PERCENT_LANGUAGE 283
271 #define PERCENT_NAME_PREFIX 284
272 #define PERCENT_NO_DEFAULT_PREC 285
273 #define PERCENT_NO_LINES 286
274 #define PERCENT_NONDETERMINISTIC_PARSER 287
275 #define PERCENT_OUTPUT 288
276 #define PERCENT_REQUIRE 289
277 #define PERCENT_SKELETON 290
278 #define PERCENT_START 291
279 #define PERCENT_TOKEN_TABLE 292
280 #define PERCENT_VERBOSE 293
281 #define PERCENT_YACC 294
282 #define BRACED_CODE 295
283 #define BRACED_PREDICATE 296
284 #define BRACKETED_ID 297
290 #define PERCENT_PERCENT 303
293 #define SEMICOLON 306
297 #define PERCENT_PARAM 310
298 #define PERCENT_UNION 311
300 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
301 typedef union YYSTYPE
303 /* Line 369 of yacc.c */
304 #line 109 "src/parse-gram.y"
310 named_ref
*named_ref
;
314 unsigned char character
;
316 /* Line 369 of yacc.c */
317 #line 247 "src/parse-gram.y"
321 /* Line 369 of yacc.c */
322 #line 423 "src/parse-gram.y"
323 code_props_type code_type
;
325 /* Line 369 of yacc.c */
326 #line 327 "src/parse-gram.c"
328 # define YYSTYPE_IS_TRIVIAL 1
329 # define YYSTYPE_IS_DECLARED 1
332 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
333 typedef struct YYLTYPE
340 # define YYLTYPE_IS_DECLARED 1
341 # define YYLTYPE_IS_TRIVIAL 1
345 int gram_parse (void);
347 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */
349 /* Copy the second part of user declarations. */
351 /* Line 372 of yacc.c */
352 #line 353 "src/parse-gram.c"
353 /* Unqualified %code blocks. */
354 /* Line 373 of yacc.c */
355 #line 58 "src/parse-gram.y"
357 static int current_prec
= 0;
358 static location current_lhs_location
;
359 static named_ref
*current_lhs_named_ref
;
360 static symbol
*current_lhs_symbol
;
361 static symbol_class current_class
= unknown_sym
;
362 static uniqstr current_type
= NULL
;
364 /** Set the new current left-hand side symbol, possibly common
365 * to several right-hand side parts of rule.
369 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
371 current_lhs_symbol
= sym
;
372 current_lhs_location
= loc
;
373 /* In order to simplify memory management, named references for lhs
374 are always assigned by deep copy into the current symbol_list
375 node. This is because a single named-ref in the grammar may
376 result in several uses when the user factors lhs between several
377 rules using "|". Therefore free the parser's original copy. */
378 free (current_lhs_named_ref
);
379 current_lhs_named_ref
= ref
;
382 #define YYTYPE_INT16 int_fast16_t
383 #define YYTYPE_INT8 int_fast8_t
384 #define YYTYPE_UINT16 uint_fast16_t
385 #define YYTYPE_UINT8 uint_fast8_t
387 /* Line 373 of yacc.c */
388 #line 236 "src/parse-gram.y"
390 /** Add a lex-param and/or a parse-param.
392 * \param type where to push this formal argument.
393 * \param decl the formal argument. Destroyed.
394 * \param loc the location in the source.
396 static void add_param (param_type type
, char *decl
, location loc
);
397 static param_type current_param
= param_none
;
400 /* Line 373 of yacc.c */
401 #line 402 "src/parse-gram.c"
408 typedef YYTYPE_UINT8 yytype_uint8
;
410 typedef unsigned char yytype_uint8
;
414 typedef YYTYPE_INT8 yytype_int8
;
416 typedef signed char yytype_int8
;
420 typedef YYTYPE_UINT16 yytype_uint16
;
422 typedef unsigned short int yytype_uint16
;
426 typedef YYTYPE_INT16 yytype_int16
;
428 typedef short int yytype_int16
;
432 # ifdef __SIZE_TYPE__
433 # define YYSIZE_T __SIZE_TYPE__
434 # elif defined size_t
435 # define YYSIZE_T size_t
436 # elif ! defined YYSIZE_T
437 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
438 # define YYSIZE_T size_t
440 # define YYSIZE_T unsigned int
444 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
447 # if defined YYENABLE_NLS && YYENABLE_NLS
449 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
450 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
454 # define YY_(Msgid) Msgid
458 /* Suppress unused-variable warnings by "using" E. */
460 # define YYUSE(E) ((void) (E))
462 # define YYUSE(E) /* empty */
467 /* The parser invokes alloca or malloc; define the necessary symbols. */
469 # ifdef YYSTACK_ALLOC
470 /* Pacify GCC's `empty if-body' warning. */
471 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
472 # ifndef YYSTACK_ALLOC_MAXIMUM
473 /* The OS might guarantee only one guard page at the bottom of the stack,
474 and a page size can be as small as 4096 bytes. So we cannot safely
475 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
476 to allow for a few compiler-allocated temporary stack slots. */
477 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
480 # define YYSTACK_ALLOC YYMALLOC
481 # define YYSTACK_FREE YYFREE
482 # ifndef YYSTACK_ALLOC_MAXIMUM
483 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
485 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
486 && ! ((defined YYMALLOC || defined malloc) \
487 && (defined YYFREE || defined free)))
488 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
489 # ifndef EXIT_SUCCESS
490 # define EXIT_SUCCESS 0
494 # define YYMALLOC malloc
495 # if ! defined malloc && ! defined EXIT_SUCCESS
496 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
501 # if ! defined free && ! defined EXIT_SUCCESS
502 void free (void *); /* INFRINGES ON USER NAME SPACE */
506 # define YYCOPY_NEEDED 1
510 #if (! defined yyoverflow \
511 && (! defined __cplusplus \
512 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
513 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
515 /* A type that is properly aligned for any stack member. */
518 yytype_int16 yyss_alloc
;
523 /* The size of the maximum gap between one aligned stack and the next. */
524 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
526 /* The size of an array large to enough to hold all stacks, each with
528 # define YYSTACK_BYTES(N) \
529 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
530 + 2 * YYSTACK_GAP_MAXIMUM)
532 # define YYCOPY_NEEDED 1
534 /* Relocate STACK from its old location to the new one. The
535 local variables YYSIZE and YYSTACKSIZE give the old and new number of
536 elements in the stack, and YYPTR gives the new location of the
537 stack. Advance YYPTR to a properly aligned location for the next
539 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
542 YYSIZE_T yynewbytes; \
543 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
544 Stack = &yyptr->Stack_alloc; \
545 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
546 yyptr += yynewbytes / sizeof (*yyptr); \
552 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
553 /* Copy COUNT objects from SRC to DST. The source and destination do
556 # if defined __GNUC__ && 1 < __GNUC__
557 # define YYCOPY(Dst, Src, Count) \
558 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
560 # define YYCOPY(Dst, Src, Count) \
564 for (yyi = 0; yyi < (Count); yyi++) \
565 (Dst)[yyi] = (Src)[yyi]; \
570 #endif /* !YYCOPY_NEEDED */
572 /* YYFINAL -- State number of the termination state. */
574 /* YYLAST -- Last index in YYTABLE. */
577 /* YYNTOKENS -- Number of terminals. */
579 /* YYNNTS -- Number of nonterminals. */
581 /* YYNRULES -- Number of rules. */
583 /* YYNSTATES -- Number of states. */
584 #define YYNSTATES 143
586 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
587 by yylex, with out-of-bounds checking. */
589 #define YYMAXUTOK 311
591 #define YYTRANSLATE(YYX) \
592 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
594 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
595 as returned by yylex, without out-of-bounds checking. */
596 static const yytype_uint8 yytranslate
[] =
598 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
624 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
625 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
626 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
627 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
628 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
633 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
634 static const yytype_uint16 yyrline
[] =
636 0, 272, 272, 280, 282, 286, 287, 297, 301, 306,
637 307, 312, 317, 318, 319, 320, 325, 334, 335, 336,
638 337, 338, 339, 339, 340, 341, 365, 366, 367, 368,
639 372, 373, 382, 383, 384, 388, 400, 404, 408, 415,
640 426, 427, 437, 438, 442, 454, 454, 459, 459, 464,
641 475, 490, 491, 492, 493, 497, 498, 503, 505, 510,
642 511, 516, 518, 523, 524, 528, 529, 533, 534, 535,
643 540, 545, 550, 556, 562, 573, 574, 583, 584, 590,
644 591, 592, 599, 599, 607, 608, 609, 614, 616, 618,
645 620, 622, 624, 626, 631, 633, 643, 644, 649, 650,
646 651, 660, 680, 682, 691, 696, 697, 702, 709, 711
650 #if YYDEBUG || YYERROR_VERBOSE || 1
651 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
652 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
653 static const char *const yytname
[] =
655 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
656 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
657 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
658 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
659 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
660 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
661 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
662 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
663 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
664 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
665 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
666 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
667 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
668 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
669 "prologue_declaration", "$@1", "params", "grammar_declaration",
670 "code_props_type", "union_name", "symbol_declaration", "$@2", "$@3",
671 "precedence_declaration", "precedence_declarator", "tag.opt",
672 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
673 "generic_symlist_item", "tag", "symbol_def", "symbol_defs.1", "grammar",
674 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
675 "named_ref.opt", "variable", "content.opt", "braceless", "id",
676 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
681 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
682 (internal) symbol number NUM (which must be that of a token). */
683 static const yytype_uint16 yytoknum
[] =
685 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
686 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
687 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
688 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
689 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
690 305, 306, 307, 308, 309, 310, 311
694 #define YYPACT_NINF -74
696 #define yypact_value_is_default(Yystate) \
697 (!!((Yystate) == (-74)))
699 #define YYTABLE_NINF -109
701 #define yytable_value_is_error(Yytable_value) \
704 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
706 static const yytype_int16 yypact
[] =
708 -74, 40, 101, -74, -74, -74, -48, -74, -74, -74,
709 -74, -74, -74, 19, -74, 0, 52, -74, 56, 79,
710 -74, 81, -74, 45, 83, 84, -74, -74, -74, 85,
711 86, 87, 31, -74, -74, -74, 15, -74, -74, -74,
712 46, -74, -74, 51, -74, -74, 42, 4, 4, 31,
713 -74, 57, -74, -74, -74, 36, -74, -74, -74, -74,
714 -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
715 -74, -74, 47, -74, 49, 1, -74, -74, 59, 62,
716 -74, 57, 26, -74, 31, -74, -74, 4, 72, 4,
717 31, -74, -74, -74, -74, -74, -74, -74, 60, -74,
718 -74, -74, -74, -74, 63, -74, -74, -74, -74, 26,
719 -74, -74, -74, 31, -74, 111, -74, 113, -74, -74,
720 -74, -74, -74, -74, -74, -74, -74, -13, 27, -74,
721 -74, 31, 137, 65, 59, -74, 59, 27, -74, -74,
725 /* YYDEFACT[S] -- default reduction number in state S. Performed when
726 YYTABLE does not specify something else to do. Zero means the default
728 static const yytype_uint8 yydefact
[] =
730 3, 0, 0, 1, 47, 45, 0, 40, 41, 51,
731 52, 53, 54, 0, 36, 0, 9, 11, 0, 0,
732 7, 0, 15, 0, 0, 0, 37, 19, 20, 0,
733 0, 0, 0, 26, 27, 28, 0, 6, 29, 22,
734 42, 4, 5, 0, 33, 32, 55, 0, 0, 0,
735 101, 0, 38, 97, 96, 98, 10, 12, 13, 14,
736 16, 17, 18, 21, 24, 25, 107, 103, 102, 105,
737 34, 106, 0, 104, 0, 0, 77, 79, 94, 0,
738 43, 0, 0, 56, 0, 70, 75, 48, 71, 46,
739 49, 61, 39, 100, 99, 8, 81, 80, 0, 78,
740 2, 95, 82, 31, 23, 44, 67, 68, 69, 35,
741 63, 66, 65, 50, 57, 59, 76, 72, 73, 62,
742 109, 87, 30, 64, 58, 60, 74, 83, 84, 87,
743 86, 0, 0, 0, 94, 90, 94, 85, 91, 92,
747 /* YYPGOTO[NTERM-NUM]. */
748 static const yytype_int16 yypgoto
[] =
750 -74, -74, -74, -74, -74, -74, 140, -74, -74, -74,
751 -74, -74, -74, -74, -74, -74, 30, -74, -74, 35,
752 -74, -26, 97, -74, 71, -74, -74, -74, 18, -70,
753 -74, -74, -46, 6, -74, -32, -73, -74
756 /* YYDEFGOTO[NTERM-NUM]. */
757 static const yytype_int16 yydefgoto
[] =
759 -1, 1, 2, 41, 79, 104, 74, 43, 81, 44,
760 48, 47, 45, 46, 84, 113, 114, 90, 109, 110,
761 111, 86, 87, 75, 76, 77, 121, 127, 128, 102,
762 55, 95, 52, 69, 78, 112, 71, 100
765 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
766 positive, shift that token. If negative, reduce the rule which
767 number is the opposite. If YYTABLE_NINF, syntax error. */
768 static const yytype_int16 yytable
[] =
770 70, -108, 72, 53, 49, 92, 4, 5, 6, 7,
771 8, 9, 10, 11, 12, 118, 72, 91, 13, 14,
772 4, 5, 6, 7, 8, 9, 10, 11, 12, 66,
773 66, 26, 13, 14, 66, 105, 129, 32, 130, 93,
774 3, 131, 132, 133, 126, 26, 54, 67, 73, 98,
775 68, 32, 115, 88, 88, 56, 85, 40, 119, 50,
776 57, 116, 73, 116, 141, 51, 142, 134, 135, 67,
777 67, 40, 68, 68, 67, 66, 117, 68, 106, 107,
778 108, 115, 94, 58, 59, 60, 61, 62, 63, 64,
779 65, 82, 80, 88, 83, 88, 136, 50, 96, 138,
780 97, 101, 103, 122, 120, 136, 4, 5, 6, 7,
781 8, 9, 10, 11, 12, 125, 66, 140, 13, 14,
782 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
783 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
784 35, 139, 42, 124, 123, 89, 99, 137, 0, 36,
785 0, 37, 38, 0, 0, 0, 39, 40
788 static const yytype_int16 yycheck
[] =
790 32, 0, 1, 3, 52, 51, 5, 6, 7, 8,
791 9, 10, 11, 12, 13, 88, 1, 49, 17, 18,
792 5, 6, 7, 8, 9, 10, 11, 12, 13, 3,
793 3, 30, 17, 18, 3, 81, 49, 36, 51, 3,
794 0, 14, 15, 16, 117, 30, 46, 43, 47, 48,
795 46, 36, 84, 47, 48, 3, 52, 56, 90, 40,
796 4, 87, 47, 89, 134, 46, 136, 40, 41, 43,
797 43, 56, 46, 46, 43, 3, 4, 46, 52, 53,
798 54, 113, 46, 4, 3, 40, 3, 3, 3, 3,
799 3, 40, 46, 87, 52, 89, 128, 40, 51, 131,
800 51, 42, 40, 40, 44, 137, 5, 6, 7, 8,
801 9, 10, 11, 12, 13, 4, 3, 52, 17, 18,
802 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
803 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
804 39, 4, 2, 113, 109, 48, 75, 129, -1, 48,
805 -1, 50, 51, -1, -1, -1, 55, 56
808 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
809 symbol of state STATE-NUM. */
810 static const yytype_uint8 yystos
[] =
812 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
813 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
814 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
815 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
816 56, 60, 63, 64, 66, 69, 70, 68, 67, 52,
817 40, 46, 89, 3, 46, 87, 3, 4, 4, 3,
818 40, 3, 3, 3, 3, 3, 3, 43, 46, 90,
819 92, 93, 1, 47, 63, 80, 81, 82, 91, 61,
820 46, 65, 40, 52, 71, 52, 78, 79, 90, 79,
821 74, 92, 89, 3, 46, 88, 51, 51, 48, 81,
822 94, 42, 86, 40, 62, 89, 52, 53, 54, 75,
823 76, 77, 92, 72, 73, 92, 78, 4, 93, 92,
824 44, 83, 40, 76, 73, 4, 93, 84, 85, 49,
825 51, 14, 15, 16, 40, 41, 92, 85, 92, 4,
829 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
830 static const yytype_uint8 yyr1
[] =
832 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
833 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
834 60, 60, 61, 60, 60, 60, 60, 60, 60, 60,
835 62, 62, 63, 63, 63, 63, 63, 63, 63, 63,
836 64, 64, 65, 65, 63, 67, 66, 68, 66, 66,
837 69, 70, 70, 70, 70, 71, 71, 72, 72, 73,
838 73, 74, 74, 75, 75, 76, 76, 77, 77, 77,
839 78, 78, 78, 78, 78, 79, 79, 80, 80, 81,
840 81, 81, 83, 82, 84, 84, 84, 85, 85, 85,
841 85, 85, 85, 85, 86, 86, 87, 87, 88, 88,
842 88, 89, 90, 90, 91, 92, 92, 93, 94, 94
845 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
846 static const yytype_uint8 yyr2
[] =
848 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
849 2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
850 1, 2, 0, 3, 2, 2, 1, 1, 1, 1,
851 2, 1, 1, 1, 2, 3, 1, 1, 2, 3,
852 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
853 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
854 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
855 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
856 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
857 2, 3, 3, 3, 0, 1, 1, 1, 0, 1,
858 1, 1, 1, 1, 1, 1, 1, 1, 0, 2
862 #define yyerrok (yyerrstatus = 0)
863 #define yyclearin (yychar = YYEMPTY)
867 #define YYACCEPT goto yyacceptlab
868 #define YYABORT goto yyabortlab
869 #define YYERROR goto yyerrorlab
872 #define YYRECOVERING() (!!yyerrstatus)
874 #define YYBACKUP(Token, Value) \
876 if (yychar == YYEMPTY) \
880 YYPOPSTACK (yylen); \
882 YY_LAC_DISCARD ("YYBACKUP"); \
887 yyerror (YY_("syntax error: cannot back up")); \
894 #define YYERRCODE 256
897 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
898 If N is 0, then set CURRENT to the empty location which ends
899 the previous symbol: RHS[0] (always defined). */
901 #ifndef YYLLOC_DEFAULT
902 # define YYLLOC_DEFAULT(Current, Rhs, N) \
906 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
907 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
908 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
909 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
913 (Current).first_line = (Current).last_line = \
914 YYRHSLOC (Rhs, 0).last_line; \
915 (Current).first_column = (Current).last_column = \
916 YYRHSLOC (Rhs, 0).last_column; \
921 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
923 /* YY_LOCATION_PRINT -- Print the location on the stream.
924 This macro was not mandated originally: define only if we know
925 we won't break user code: when these are the locations we know. */
927 #ifndef YY_LOCATION_PRINT
928 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
929 # define YY_LOCATION_PRINT(File, Loc) \
930 fprintf (File, "%d.%d-%d.%d", \
931 (Loc).first_line, (Loc).first_column, \
932 (Loc).last_line, (Loc).last_column)
934 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
939 /* YYLEX -- calling `yylex' with the right arguments. */
942 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
944 # define YYLEX yylex (&yylval, &yylloc)
947 /* Enable debugging if requested. */
951 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
952 # define YYFPRINTF fprintf
955 # define YYDPRINTF(Args) \
961 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
965 YYFPRINTF (stderr, "%s ", Title); \
966 yy_symbol_print (stderr, \
967 Type, Value, Location); \
968 YYFPRINTF (stderr, "\n"); \
973 /*--------------------------------.
974 | Print this symbol on YYOUTPUT. |
975 `--------------------------------*/
978 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
980 FILE *yyo
= yyoutput
;
986 if (yytype
< YYNTOKENS
)
987 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
992 /* Line 731 of yacc.c */
993 #line 196 "src/parse-gram.y"
994 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
995 /* Line 731 of yacc.c */
996 #line 997 "src/parse-gram.c"
1000 /* Line 731 of yacc.c */
1001 #line 209 "src/parse-gram.y"
1002 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
1003 /* Line 731 of yacc.c */
1004 #line 1005 "src/parse-gram.c"
1007 case 24: // "%<flag>"
1008 /* Line 731 of yacc.c */
1009 #line 205 "src/parse-gram.y"
1010 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1011 /* Line 731 of yacc.c */
1012 #line 1013 "src/parse-gram.c"
1016 /* Line 731 of yacc.c */
1017 #line 198 "src/parse-gram.y"
1018 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1019 /* Line 731 of yacc.c */
1020 #line 1021 "src/parse-gram.c"
1023 case 42: // "[identifier]"
1024 /* Line 731 of yacc.c */
1025 #line 203 "src/parse-gram.y"
1026 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1027 /* Line 731 of yacc.c */
1028 #line 1029 "src/parse-gram.c"
1032 /* Line 731 of yacc.c */
1033 #line 190 "src/parse-gram.y"
1034 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
1035 /* Line 731 of yacc.c */
1036 #line 1037 "src/parse-gram.c"
1039 case 44: // "epilogue"
1040 /* Line 731 of yacc.c */
1041 #line 198 "src/parse-gram.y"
1042 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1043 /* Line 731 of yacc.c */
1044 #line 1045 "src/parse-gram.c"
1047 case 46: // "identifier"
1048 /* Line 731 of yacc.c */
1049 #line 202 "src/parse-gram.y"
1050 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1051 /* Line 731 of yacc.c */
1052 #line 1053 "src/parse-gram.c"
1055 case 47: // "identifier:"
1056 /* Line 731 of yacc.c */
1057 #line 204 "src/parse-gram.y"
1058 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
1059 /* Line 731 of yacc.c */
1060 #line 1061 "src/parse-gram.c"
1063 case 50: // "%{...%}"
1064 /* Line 731 of yacc.c */
1065 #line 198 "src/parse-gram.y"
1066 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1067 /* Line 731 of yacc.c */
1068 #line 1069 "src/parse-gram.c"
1072 /* Line 731 of yacc.c */
1073 #line 206 "src/parse-gram.y"
1074 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1075 /* Line 731 of yacc.c */
1076 #line 1077 "src/parse-gram.c"
1079 case 55: // "%param"
1080 /* Line 731 of yacc.c */
1081 #line 252 "src/parse-gram.y"
1083 switch (((*yyvaluep
).param
))
1085 #define CASE(In, Out) \
1086 case param_ ## In: fputs ("%" #Out, stderr); break
1087 CASE(lex
, lex
-param
);
1088 CASE(parse
, parse
-param
);
1091 case param_none
: aver (false); break;
1094 /* Line 731 of yacc.c */
1095 #line 1096 "src/parse-gram.c"
1098 case 64: // code_props_type
1099 /* Line 731 of yacc.c */
1100 #line 424 "src/parse-gram.y"
1101 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1102 /* Line 731 of yacc.c */
1103 #line 1104 "src/parse-gram.c"
1106 case 73: // symbol.prec
1107 /* Line 731 of yacc.c */
1108 #line 212 "src/parse-gram.y"
1109 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1110 /* Line 731 of yacc.c */
1111 #line 1112 "src/parse-gram.c"
1115 /* Line 731 of yacc.c */
1116 #line 206 "src/parse-gram.y"
1117 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1118 /* Line 731 of yacc.c */
1119 #line 1120 "src/parse-gram.c"
1122 case 87: // variable
1123 /* Line 731 of yacc.c */
1124 #line 202 "src/parse-gram.y"
1125 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1126 /* Line 731 of yacc.c */
1127 #line 1128 "src/parse-gram.c"
1130 case 88: // content.opt
1131 /* Line 731 of yacc.c */
1132 #line 198 "src/parse-gram.y"
1133 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1134 /* Line 731 of yacc.c */
1135 #line 1136 "src/parse-gram.c"
1138 case 89: // braceless
1139 /* Line 731 of yacc.c */
1140 #line 198 "src/parse-gram.y"
1141 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1142 /* Line 731 of yacc.c */
1143 #line 1144 "src/parse-gram.c"
1147 /* Line 731 of yacc.c */
1148 #line 212 "src/parse-gram.y"
1149 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1150 /* Line 731 of yacc.c */
1151 #line 1152 "src/parse-gram.c"
1154 case 91: // id_colon
1155 /* Line 731 of yacc.c */
1156 #line 213 "src/parse-gram.y"
1157 { fprintf (yyo
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1158 /* Line 731 of yacc.c */
1159 #line 1160 "src/parse-gram.c"
1163 /* Line 731 of yacc.c */
1164 #line 212 "src/parse-gram.y"
1165 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1166 /* Line 731 of yacc.c */
1167 #line 1168 "src/parse-gram.c"
1170 case 93: // string_as_id
1171 /* Line 731 of yacc.c */
1172 #line 212 "src/parse-gram.y"
1173 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1174 /* Line 731 of yacc.c */
1175 #line 1176 "src/parse-gram.c"
1184 /*--------------------------------.
1185 | Print this symbol on YYOUTPUT. |
1186 `--------------------------------*/
1189 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1191 if (yytype
< YYNTOKENS
)
1192 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1194 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1196 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1197 YYFPRINTF (yyoutput
, ": ");
1198 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1199 YYFPRINTF (yyoutput
, ")");
1202 /*------------------------------------------------------------------.
1203 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1205 `------------------------------------------------------------------*/
1208 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1210 YYFPRINTF (stderr
, "Stack now");
1211 for (; yybottom
<= yytop
; yybottom
++)
1213 int yybot
= *yybottom
;
1214 YYFPRINTF (stderr
, " %d", yybot
);
1216 YYFPRINTF (stderr
, "\n");
1219 # define YY_STACK_PRINT(Bottom, Top) \
1222 yy_stack_print ((Bottom), (Top)); \
1226 /*------------------------------------------------.
1227 | Report that the YYRULE is going to be reduced. |
1228 `------------------------------------------------*/
1231 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1233 unsigned long int yylno
= yyrline
[yyrule
];
1234 int yynrhs
= yyr2
[yyrule
];
1236 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1238 /* The symbols being reduced. */
1239 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1241 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1242 yy_symbol_print (stderr
,
1243 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1244 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1245 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1246 YYFPRINTF (stderr
, "\n");
1250 # define YY_REDUCE_PRINT(Rule) \
1253 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1256 /* Nonzero means print parse trace. It is left uninitialized so that
1257 multiple parsers can coexist. */
1259 #else /* !YYDEBUG */
1260 # define YYDPRINTF(Args)
1261 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1262 # define YY_STACK_PRINT(Bottom, Top)
1263 # define YY_REDUCE_PRINT(Rule)
1264 #endif /* !YYDEBUG */
1267 /* YYINITDEPTH -- initial size of the parser's stacks. */
1269 # define YYINITDEPTH 200
1272 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1273 if the built-in stack extension method is used).
1275 Do not make this value too large; the results are undefined if
1276 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1277 evaluated with infinite-precision integer arithmetic. */
1280 # define YYMAXDEPTH 10000
1283 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1284 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1285 stack, and such that *YYCAPACITY is the maximum number of elements it
1286 can hold without a reallocation, make sure there is enough room to
1287 store YYADD more elements. If not, allocate a new stack using
1288 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1289 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1290 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1291 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1292 required. Return 1 if memory is exhausted. */
1294 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1296 char const *yydebug_prefix
,
1297 char const *yydebug_suffix
,
1299 yytype_int16
**yybottom
,
1300 yytype_int16
*yybottom_no_free
,
1301 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1303 YYSIZE_T yysize_old
=
1304 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1305 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1306 if (*yycapacity
< yysize_new
)
1308 YYSIZE_T yyalloc
= 2 * yysize_new
;
1309 yytype_int16
*yybottom_new
;
1310 /* Use YYMAXDEPTH for maximum stack size given that the stack
1311 should never need to grow larger than the main state stack
1312 needs to grow without LAC. */
1313 if (YYMAXDEPTH
< yysize_new
)
1315 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1319 if (YYMAXDEPTH
< yyalloc
)
1320 yyalloc
= YYMAXDEPTH
;
1322 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1325 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1329 if (*yytop
!= yytop_empty
)
1331 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1332 *yytop
= yybottom_new
+ (yysize_old
- 1);
1334 if (*yybottom
!= yybottom_no_free
)
1335 YYSTACK_FREE (*yybottom
);
1336 *yybottom
= yybottom_new
;
1337 *yycapacity
= yyalloc
;
1342 /* Establish the initial context for the current lookahead if no initial
1343 context is currently established.
1345 We define a context as a snapshot of the parser stacks. We define
1346 the initial context for a lookahead as the context in which the
1347 parser initially examines that lookahead in order to select a
1348 syntactic action. Thus, if the lookahead eventually proves
1349 syntactically unacceptable (possibly in a later context reached via a
1350 series of reductions), the initial context can be used to determine
1351 the exact set of tokens that would be syntactically acceptable in the
1352 lookahead's place. Moreover, it is the context after which any
1353 further semantic actions would be erroneous because they would be
1354 determined by a syntactically unacceptable token.
1356 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1357 performed in an inconsistent state (which, for the purposes of LAC,
1358 includes consistent states that don't know they're consistent because
1359 their default reductions have been disabled). Iff there is a
1360 lookahead token, it should also be invoked before reporting a syntax
1361 error. This latter case is for the sake of the debugging output.
1363 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1364 follows. If no initial context is currently established for the
1365 current lookahead, then check if that lookahead can eventually be
1366 shifted if syntactic actions continue from the current context.
1367 Report a syntax error if it cannot. */
1368 #define YY_LAC_ESTABLISH \
1370 if (!yy_lac_established) \
1372 YYDPRINTF ((stderr, \
1373 "LAC: initial context established for %s\n", \
1374 yytname[yytoken])); \
1375 yy_lac_established = 1; \
1377 int yy_lac_status = \
1378 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1379 if (yy_lac_status == 2) \
1380 goto yyexhaustedlab; \
1381 if (yy_lac_status == 1) \
1387 /* Discard any previous initial lookahead context because of Event,
1388 which may be a lookahead change or an invalidation of the currently
1389 established initial context for the current lookahead.
1391 The most common example of a lookahead change is a shift. An example
1392 of both cases is syntax error recovery. That is, a syntax error
1393 occurs when the lookahead is syntactically erroneous for the
1394 currently established initial context, so error recovery manipulates
1395 the parser stacks to try to find a new initial context in which the
1396 current lookahead is syntactically acceptable. If it fails to find
1397 such a context, it discards the lookahead. */
1399 # define YY_LAC_DISCARD(Event) \
1401 if (yy_lac_established) \
1404 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1406 yy_lac_established = 0; \
1410 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1413 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1414 eventually (after perhaps some reductions) be shifted, return 1 if
1415 not, or return 2 if memory is exhausted. As preconditions and
1416 postconditions: *YYES_CAPACITY is the allocated size of the array to
1417 which *YYES points, and either *YYES = YYESA or *YYES points to an
1418 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1419 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1420 any old *YYES other than YYESA. */
1422 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1423 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1425 yytype_int16
*yyes_prev
= yyssp
;
1426 yytype_int16
*yyesp
= yyes_prev
;
1427 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1428 if (yytoken
== YYUNDEFTOK
)
1430 YYDPRINTF ((stderr
, " Always Err\n"));
1435 int yyrule
= yypact
[*yyesp
];
1436 if (yypact_value_is_default (yyrule
)
1437 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1438 || yycheck
[yyrule
] != yytoken
)
1440 yyrule
= yydefact
[*yyesp
];
1443 YYDPRINTF ((stderr
, " Err\n"));
1449 yyrule
= yytable
[yyrule
];
1450 if (yytable_value_is_error (yyrule
))
1452 YYDPRINTF ((stderr
, " Err\n"));
1457 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1463 YYSIZE_T yylen
= yyr2
[yyrule
];
1464 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1465 if (yyesp
!= yyes_prev
)
1467 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1480 yyesp
= yyes_prev
-= yylen
;
1485 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1486 yystate
= yypgoto
[yylhs
] + *yyesp
;
1487 if (yystate
< 0 || YYLAST
< yystate
1488 || yycheck
[yystate
] != *yyesp
)
1489 yystate
= yydefgoto
[yylhs
];
1491 yystate
= yytable
[yystate
];
1493 if (yyesp
== yyes_prev
)
1500 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1504 yyes
, yyesa
, &yyesp
, yyes_prev
))
1506 YYDPRINTF ((stderr
, "\n"));
1511 YYDPRINTF ((stderr
, " G%d", yystate
));
1520 # if defined __GLIBC__ && defined _STRING_H
1521 # define yystrlen strlen
1523 /* Return the length of YYSTR. */
1525 yystrlen (const char *yystr
)
1528 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1536 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1537 # define yystpcpy stpcpy
1539 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1542 yystpcpy (char *yydest
, const char *yysrc
)
1545 const char *yys
= yysrc
;
1547 while ((*yyd
++ = *yys
++) != '\0')
1556 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1557 quotes and backslashes, so that it's suitable for yyerror. The
1558 heuristic is that double-quoting is unnecessary unless the string
1559 contains an apostrophe, a comma, or backslash (other than
1560 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1561 null, do not copy; instead, return the length of what the result
1564 yytnamerr (char *yyres
, const char *yystr
)
1569 char const *yyp
= yystr
;
1576 goto do_not_strip_quotes
;
1580 goto do_not_strip_quotes
;
1593 do_not_strip_quotes
: ;
1597 return yystrlen (yystr
);
1599 return yystpcpy (yyres
, yystr
) - yyres
;
1603 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1604 about the unexpected token YYTOKEN for the state stack whose top is
1605 YYSSP. In order to see if a particular token T is a
1606 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1608 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1609 not large enough to hold the message. In that case, also set
1610 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1611 required number of bytes is too large to store or if
1612 yy_lac returned 2. */
1614 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1615 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1616 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1618 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1619 YYSIZE_T yysize
= yysize0
;
1621 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1622 /* Internationalized format string. */
1623 const char *yyformat
= YY_NULL
;
1624 /* Arguments of yyformat. */
1625 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1626 /* Number of reported tokens (one for the "unexpected", one per
1630 /* There are many possibilities here to consider:
1631 - If this state is a consistent state with a default action, then
1632 the only way this function was invoked is if the default action
1633 is an error action. In that case, don't check for expected
1634 tokens because there are none.
1635 - The only way there can be no lookahead present (in yychar) is if
1636 this state is a consistent state with a default action. Thus,
1637 detecting the absence of a lookahead is sufficient to determine
1638 that there is no unexpected or expected token to report. In that
1639 case, just report a simple "syntax error".
1640 - Don't assume there isn't a lookahead just because this state is a
1641 consistent state with a default action. There might have been a
1642 previous inconsistent state, consistent state with a non-default
1643 action, or user semantic action that manipulated yychar.
1644 In the first two cases, it might appear that the current syntax
1645 error should have been detected in the previous state when yy_lac
1646 was invoked. However, at that time, there might have been a
1647 different syntax error that discarded a different initial context
1648 during error recovery, leaving behind the current lookahead.
1650 if (yytoken
!= YYEMPTY
)
1652 int yyn
= yypact
[*yyssp
];
1653 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1654 yyarg
[yycount
++] = yytname
[yytoken
];
1655 if (!yypact_value_is_default (yyn
))
1659 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1660 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1663 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1665 if (yy_lac_status
== 2)
1667 if (yy_lac_status
== 1)
1670 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1676 yyarg
[yycount
++] = yytname
[yyx
];
1677 yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1678 if (! (yysize
<= yysize1
1679 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1686 YYFPRINTF (stderr
, "No expected tokens.\n");
1692 # define YYCASE_(N, S) \
1696 YYCASE_(0, YY_("syntax error"));
1697 YYCASE_(1, YY_("syntax error, unexpected %s"));
1698 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1699 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1700 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1701 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1705 yysize1
= yysize
+ yystrlen (yyformat
);
1706 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1710 if (*yymsg_alloc
< yysize
)
1712 *yymsg_alloc
= 2 * yysize
;
1713 if (! (yysize
<= *yymsg_alloc
1714 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1715 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1719 /* Avoid sprintf, as that infringes on the user's name space.
1720 Don't have undefined behavior even if the translation
1721 produced a string with the wrong number of "%s"s. */
1725 while ((*yyp
= *yyformat
) != '\0')
1726 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1728 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1739 #endif /* YYERROR_VERBOSE */
1741 /*-----------------------------------------------.
1742 | Release the memory associated to this symbol. |
1743 `-----------------------------------------------*/
1746 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1749 YYUSE (yylocationp
);
1752 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1771 /* The lookahead symbol. */
1775 #if defined __GNUC__ && (4 < __GNUC__ + (6 <= __GNUC_MINOR__))
1776 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1777 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1778 _Pragma ("GCC diagnostic push") \
1779 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1780 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1781 _Pragma ("GCC diagnostic pop")
1783 /* Default value used for initialization, for pacifying older GCCs
1784 or non-GCC compilers. */
1785 static YYSTYPE yyval_default
;
1786 # define YYLVAL_INITIALIZE() (yylval = yyval_default)
1788 #ifndef YYLVAL_INITIALIZE
1789 # define YYLVAL_INITIALIZE()
1791 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1792 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1793 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1796 /* The semantic value of the lookahead symbol. */
1799 /* Location data for the lookahead symbol. */
1802 /* Number of syntax errors so far. */
1806 /* Number of tokens to shift before error messages enabled. */
1809 /* The stacks and their tools:
1810 `yyss': related to states.
1811 `yyvs': related to semantic values.
1812 `yyls': related to locations.
1814 Refer to the stacks through separate pointers, to allow yyoverflow
1815 to reallocate them elsewhere. */
1817 /* The state stack. */
1818 yytype_int16 yyssa
[YYINITDEPTH
];
1820 yytype_int16
*yyssp
;
1822 /* The semantic value stack. */
1823 YYSTYPE yyvsa
[YYINITDEPTH
];
1827 /* The location stack. */
1828 YYLTYPE yylsa
[YYINITDEPTH
];
1832 /* The locations where the error started and ended. */
1833 YYLTYPE yyerror_range
[3];
1835 YYSIZE_T yystacksize
;
1837 yytype_int16 yyesa
[20];
1839 YYSIZE_T yyes_capacity
;
1841 int yy_lac_established
= 0;
1844 /* Lookahead token as an internal (translated) token number. */
1846 /* The variables used to return semantic value and location from the
1852 /* Buffer for error messages, and its allocated size. */
1854 char *yymsg
= yymsgbuf
;
1855 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1858 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1860 /* The number of symbols on the RHS of the reduced rule.
1861 Keep to zero when no symbol should be popped. */
1867 yystacksize
= YYINITDEPTH
;
1870 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1871 if (YYMAXDEPTH
< yyes_capacity
)
1872 yyes_capacity
= YYMAXDEPTH
;
1874 YYDPRINTF ((stderr
, "Starting parse\n"));
1879 yychar
= YYEMPTY
; /* Cause a token to be read. */
1881 /* Initialize stack pointers.
1882 Waste one element of value and location stack
1883 so that they stay on the same level as the state stack.
1884 The wasted elements are never initialized. */
1889 YYLVAL_INITIALIZE ();
1890 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1891 /* Initialize the default location before parsing starts. */
1892 yylloc
.first_line
= yylloc
.last_line
= 1;
1893 yylloc
.first_column
= yylloc
.last_column
= 1;
1896 /* User initialization code. */
1897 /* Line 1487 of yacc.c */
1898 #line 101 "src/parse-gram.y"
1900 /* Bison's grammar can initial empty locations, hence a default
1901 location is needed. */
1902 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1903 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1905 /* Line 1487 of yacc.c */
1906 #line 1907 "src/parse-gram.c"
1910 /*------------------------------------------------------------.
1911 | yynewstate -- Push a new state, which is found in yystate. |
1912 `------------------------------------------------------------*/
1914 /* In all cases, when you get here, the value and location stacks
1915 have just been pushed. So pushing a state here evens the stacks. */
1921 if (yyss
+ yystacksize
- 1 <= yyssp
)
1923 /* Get the current used size of the three stacks, in elements. */
1924 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1928 /* Give user a chance to reallocate the stack. Use copies of
1929 these so that the &'s don't force the real ones into
1931 YYSTYPE
*yyvs1
= yyvs
;
1932 yytype_int16
*yyss1
= yyss
;
1933 YYLTYPE
*yyls1
= yyls
;
1935 /* Each stack pointer address is followed by the size of the
1936 data in use in that stack, in bytes. This used to be a
1937 conditional around just the two extra args, but that might
1938 be undefined if yyoverflow is a macro. */
1939 yyoverflow (YY_("memory exhausted"),
1940 &yyss1
, yysize
* sizeof (*yyssp
),
1941 &yyvs1
, yysize
* sizeof (*yyvsp
),
1942 &yyls1
, yysize
* sizeof (*yylsp
),
1949 #else /* no yyoverflow */
1950 # ifndef YYSTACK_RELOCATE
1951 goto yyexhaustedlab
;
1953 /* Extend the stack our own way. */
1954 if (YYMAXDEPTH
<= yystacksize
)
1955 goto yyexhaustedlab
;
1957 if (YYMAXDEPTH
< yystacksize
)
1958 yystacksize
= YYMAXDEPTH
;
1961 yytype_int16
*yyss1
= yyss
;
1962 union yyalloc
*yyptr
=
1963 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1965 goto yyexhaustedlab
;
1966 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1967 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1968 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1969 # undef YYSTACK_RELOCATE
1971 YYSTACK_FREE (yyss1
);
1974 #endif /* no yyoverflow */
1976 yyssp
= yyss
+ yysize
- 1;
1977 yyvsp
= yyvs
+ yysize
- 1;
1978 yylsp
= yyls
+ yysize
- 1;
1980 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1981 (unsigned long int) yystacksize
));
1983 if (yyss
+ yystacksize
- 1 <= yyssp
)
1987 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1989 if (yystate
== YYFINAL
)
1999 /* Do appropriate processing given the current state. Read a
2000 lookahead token if we need one and don't already have one. */
2002 /* First try to decide what to do without reference to lookahead token. */
2003 yyn
= yypact
[yystate
];
2004 if (yypact_value_is_default (yyn
))
2007 /* Not known => get a lookahead token if don't already have one. */
2009 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2010 if (yychar
== YYEMPTY
)
2012 YYDPRINTF ((stderr
, "Reading a token: "));
2016 if (yychar
<= YYEOF
)
2018 yychar
= yytoken
= YYEOF
;
2019 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2023 yytoken
= YYTRANSLATE (yychar
);
2024 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2027 /* If the proper action on seeing token YYTOKEN is to reduce or to
2028 detect an error, take that action. */
2030 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2038 if (yytable_value_is_error (yyn
))
2045 /* Count tokens shifted since error; after three, turn off error
2050 /* Shift the lookahead token. */
2051 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2053 /* Discard the shifted token. */
2055 YY_LAC_DISCARD ("shift");
2058 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2060 YY_IGNORE_MAYBE_UNINITIALIZED_END
2065 /*-----------------------------------------------------------.
2066 | yydefault -- do the default action for the current state. |
2067 `-----------------------------------------------------------*/
2069 yyn
= yydefact
[yystate
];
2075 /*-----------------------------.
2076 | yyreduce -- Do a reduction. |
2077 `-----------------------------*/
2079 /* yyn is the number of a rule to reduce with. */
2082 /* If YYLEN is nonzero, implement the default value of the action:
2085 Otherwise, the following line sets YYVAL to garbage.
2086 This behavior is undocumented and Bison
2087 users should not rely upon it. Assigning to YYVAL
2088 unconditionally makes the parser a bit smaller, and it avoids a
2089 GCC warning that YYVAL may be used uninitialized. */
2090 yyval
= yyvsp
[1-yylen
];
2092 /* Default location. */
2093 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2094 YY_REDUCE_PRINT (yyn
);
2096 int yychar_backup
= yychar
;
2100 /* Line 1704 of yacc.c */
2101 #line 288 "src/parse-gram.y"
2103 code_props plain_code
;
2104 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2105 code_props_translate_code (&plain_code
);
2106 gram_scanner_last_string_free ();
2107 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2108 plain_code
.code
, (yylsp
[0]));
2109 code_scanner_last_string_free ();
2111 /* Line 1704 of yacc.c */
2112 #line 2113 "src/parse-gram.c"
2116 /* Line 1704 of yacc.c */
2117 #line 298 "src/parse-gram.y"
2119 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2121 /* Line 1704 of yacc.c */
2122 #line 2123 "src/parse-gram.c"
2126 /* Line 1704 of yacc.c */
2127 #line 302 "src/parse-gram.y"
2129 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2130 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2132 /* Line 1704 of yacc.c */
2133 #line 2134 "src/parse-gram.c"
2137 /* Line 1704 of yacc.c */
2138 #line 306 "src/parse-gram.y"
2139 { defines_flag
= true; }
2140 /* Line 1704 of yacc.c */
2141 #line 2142 "src/parse-gram.c"
2145 /* Line 1704 of yacc.c */
2146 #line 308 "src/parse-gram.y"
2148 defines_flag
= true;
2149 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2151 /* Line 1704 of yacc.c */
2152 #line 2153 "src/parse-gram.c"
2156 /* Line 1704 of yacc.c */
2157 #line 313 "src/parse-gram.y"
2159 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2160 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2162 /* Line 1704 of yacc.c */
2163 #line 2164 "src/parse-gram.c"
2167 /* Line 1704 of yacc.c */
2168 #line 317 "src/parse-gram.y"
2169 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2170 /* Line 1704 of yacc.c */
2171 #line 2172 "src/parse-gram.c"
2175 /* Line 1704 of yacc.c */
2176 #line 318 "src/parse-gram.y"
2177 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2178 /* Line 1704 of yacc.c */
2179 #line 2180 "src/parse-gram.c"
2183 /* Line 1704 of yacc.c */
2184 #line 319 "src/parse-gram.y"
2185 { spec_file_prefix
= (yyvsp
[0].chars
); }
2186 /* Line 1704 of yacc.c */
2187 #line 2188 "src/parse-gram.c"
2191 /* Line 1704 of yacc.c */
2192 #line 321 "src/parse-gram.y"
2194 nondeterministic_parser
= true;
2197 /* Line 1704 of yacc.c */
2198 #line 2199 "src/parse-gram.c"
2202 /* Line 1704 of yacc.c */
2203 #line 326 "src/parse-gram.y"
2206 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2207 code_props_translate_code (&action
);
2208 gram_scanner_last_string_free ();
2209 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2210 code_scanner_last_string_free ();
2212 /* Line 1704 of yacc.c */
2213 #line 2214 "src/parse-gram.c"
2217 /* Line 1704 of yacc.c */
2218 #line 334 "src/parse-gram.y"
2219 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2220 /* Line 1704 of yacc.c */
2221 #line 2222 "src/parse-gram.c"
2225 /* Line 1704 of yacc.c */
2226 #line 335 "src/parse-gram.y"
2227 { spec_name_prefix
= (yyvsp
[0].chars
); }
2228 /* Line 1704 of yacc.c */
2229 #line 2230 "src/parse-gram.c"
2233 /* Line 1704 of yacc.c */
2234 #line 336 "src/parse-gram.y"
2235 { no_lines_flag
= true; }
2236 /* Line 1704 of yacc.c */
2237 #line 2238 "src/parse-gram.c"
2241 /* Line 1704 of yacc.c */
2242 #line 337 "src/parse-gram.y"
2243 { nondeterministic_parser
= true; }
2244 /* Line 1704 of yacc.c */
2245 #line 2246 "src/parse-gram.c"
2249 /* Line 1704 of yacc.c */
2250 #line 338 "src/parse-gram.y"
2251 { spec_outfile
= (yyvsp
[0].chars
); }
2252 /* Line 1704 of yacc.c */
2253 #line 2254 "src/parse-gram.c"
2257 /* Line 1704 of yacc.c */
2258 #line 339 "src/parse-gram.y"
2259 { current_param
= (yyvsp
[0].param
); }
2260 /* Line 1704 of yacc.c */
2261 #line 2262 "src/parse-gram.c"
2265 /* Line 1704 of yacc.c */
2266 #line 339 "src/parse-gram.y"
2267 { current_param
= param_none
; }
2268 /* Line 1704 of yacc.c */
2269 #line 2270 "src/parse-gram.c"
2273 /* Line 1704 of yacc.c */
2274 #line 340 "src/parse-gram.y"
2275 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2276 /* Line 1704 of yacc.c */
2277 #line 2278 "src/parse-gram.c"
2281 /* Line 1704 of yacc.c */
2282 #line 342 "src/parse-gram.y"
2284 char const *skeleton_user
= (yyvsp
[0].chars
);
2285 if (strchr (skeleton_user
, '/'))
2287 size_t dir_length
= strlen (current_file
);
2288 char *skeleton_build
;
2289 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2291 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2294 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2297 memcpy (skeleton_build
, current_file
, dir_length
);
2298 skeleton_build
[dir_length
++] = '/';
2300 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2301 skeleton_user
= uniqstr_new (skeleton_build
);
2302 free (skeleton_build
);
2304 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2306 /* Line 1704 of yacc.c */
2307 #line 2308 "src/parse-gram.c"
2311 /* Line 1704 of yacc.c */
2312 #line 365 "src/parse-gram.y"
2313 { token_table_flag
= true; }
2314 /* Line 1704 of yacc.c */
2315 #line 2316 "src/parse-gram.c"
2319 /* Line 1704 of yacc.c */
2320 #line 366 "src/parse-gram.y"
2321 { report_flag
|= report_states
; }
2322 /* Line 1704 of yacc.c */
2323 #line 2324 "src/parse-gram.c"
2327 /* Line 1704 of yacc.c */
2328 #line 367 "src/parse-gram.y"
2329 { yacc_flag
= true; }
2330 /* Line 1704 of yacc.c */
2331 #line 2332 "src/parse-gram.c"
2335 /* Line 1704 of yacc.c */
2336 #line 372 "src/parse-gram.y"
2337 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2338 /* Line 1704 of yacc.c */
2339 #line 2340 "src/parse-gram.c"
2343 /* Line 1704 of yacc.c */
2344 #line 373 "src/parse-gram.y"
2345 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2346 /* Line 1704 of yacc.c */
2347 #line 2348 "src/parse-gram.c"
2351 /* Line 1704 of yacc.c */
2352 #line 385 "src/parse-gram.y"
2354 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2356 /* Line 1704 of yacc.c */
2357 #line 2358 "src/parse-gram.c"
2361 /* Line 1704 of yacc.c */
2362 #line 389 "src/parse-gram.y"
2365 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2366 code_props_translate_code (&code
);
2369 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2370 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2371 symbol_list_free ((yyvsp
[0].list
));
2374 /* Line 1704 of yacc.c */
2375 #line 2376 "src/parse-gram.c"
2379 /* Line 1704 of yacc.c */
2380 #line 401 "src/parse-gram.y"
2382 default_prec
= true;
2384 /* Line 1704 of yacc.c */
2385 #line 2386 "src/parse-gram.c"
2389 /* Line 1704 of yacc.c */
2390 #line 405 "src/parse-gram.y"
2392 default_prec
= false;
2394 /* Line 1704 of yacc.c */
2395 #line 2396 "src/parse-gram.c"
2399 /* Line 1704 of yacc.c */
2400 #line 409 "src/parse-gram.y"
2402 /* Do not invoke muscle_percent_code_grow here since it invokes
2403 muscle_user_name_list_grow. */
2404 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2405 code_scanner_last_string_free ();
2407 /* Line 1704 of yacc.c */
2408 #line 2409 "src/parse-gram.c"
2412 /* Line 1704 of yacc.c */
2413 #line 416 "src/parse-gram.y"
2415 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2416 code_scanner_last_string_free ();
2418 /* Line 1704 of yacc.c */
2419 #line 2420 "src/parse-gram.c"
2423 /* Line 1704 of yacc.c */
2424 #line 426 "src/parse-gram.y"
2425 { (yyval
.code_type
) = destructor
; }
2426 /* Line 1704 of yacc.c */
2427 #line 2428 "src/parse-gram.c"
2431 /* Line 1704 of yacc.c */
2432 #line 427 "src/parse-gram.y"
2433 { (yyval
.code_type
) = printer
; }
2434 /* Line 1704 of yacc.c */
2435 #line 2436 "src/parse-gram.c"
2439 /* Line 1704 of yacc.c */
2440 #line 437 "src/parse-gram.y"
2442 /* Line 1704 of yacc.c */
2443 #line 2444 "src/parse-gram.c"
2447 /* Line 1704 of yacc.c */
2448 #line 438 "src/parse-gram.y"
2449 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2450 /* Line 1704 of yacc.c */
2451 #line 2452 "src/parse-gram.c"
2455 /* Line 1704 of yacc.c */
2456 #line 443 "src/parse-gram.y"
2459 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2460 code_scanner_last_string_free ();
2462 /* Line 1704 of yacc.c */
2463 #line 2464 "src/parse-gram.c"
2467 /* Line 1704 of yacc.c */
2468 #line 454 "src/parse-gram.y"
2469 { current_class
= nterm_sym
; }
2470 /* Line 1704 of yacc.c */
2471 #line 2472 "src/parse-gram.c"
2475 /* Line 1704 of yacc.c */
2476 #line 455 "src/parse-gram.y"
2478 current_class
= unknown_sym
;
2479 current_type
= NULL
;
2481 /* Line 1704 of yacc.c */
2482 #line 2483 "src/parse-gram.c"
2486 /* Line 1704 of yacc.c */
2487 #line 459 "src/parse-gram.y"
2488 { current_class
= token_sym
; }
2489 /* Line 1704 of yacc.c */
2490 #line 2491 "src/parse-gram.c"
2494 /* Line 1704 of yacc.c */
2495 #line 460 "src/parse-gram.y"
2497 current_class
= unknown_sym
;
2498 current_type
= NULL
;
2500 /* Line 1704 of yacc.c */
2501 #line 2502 "src/parse-gram.c"
2505 /* Line 1704 of yacc.c */
2506 #line 465 "src/parse-gram.y"
2510 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2511 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2512 symbol_list_free ((yyvsp
[0].list
));
2514 /* Line 1704 of yacc.c */
2515 #line 2516 "src/parse-gram.c"
2519 /* Line 1704 of yacc.c */
2520 #line 476 "src/parse-gram.y"
2524 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2526 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2527 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2529 symbol_list_free ((yyvsp
[0].list
));
2530 current_type
= NULL
;
2532 /* Line 1704 of yacc.c */
2533 #line 2534 "src/parse-gram.c"
2537 /* Line 1704 of yacc.c */
2538 #line 490 "src/parse-gram.y"
2539 { (yyval
.assoc
) = left_assoc
; }
2540 /* Line 1704 of yacc.c */
2541 #line 2542 "src/parse-gram.c"
2545 /* Line 1704 of yacc.c */
2546 #line 491 "src/parse-gram.y"
2547 { (yyval
.assoc
) = right_assoc
; }
2548 /* Line 1704 of yacc.c */
2549 #line 2550 "src/parse-gram.c"
2553 /* Line 1704 of yacc.c */
2554 #line 492 "src/parse-gram.y"
2555 { (yyval
.assoc
) = non_assoc
; }
2556 /* Line 1704 of yacc.c */
2557 #line 2558 "src/parse-gram.c"
2561 /* Line 1704 of yacc.c */
2562 #line 493 "src/parse-gram.y"
2563 { (yyval
.assoc
) = precedence_assoc
; }
2564 /* Line 1704 of yacc.c */
2565 #line 2566 "src/parse-gram.c"
2569 /* Line 1704 of yacc.c */
2570 #line 497 "src/parse-gram.y"
2571 { current_type
= NULL
; }
2572 /* Line 1704 of yacc.c */
2573 #line 2574 "src/parse-gram.c"
2577 /* Line 1704 of yacc.c */
2578 #line 498 "src/parse-gram.y"
2579 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2580 /* Line 1704 of yacc.c */
2581 #line 2582 "src/parse-gram.c"
2585 /* Line 1704 of yacc.c */
2586 #line 504 "src/parse-gram.y"
2587 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2588 /* Line 1704 of yacc.c */
2589 #line 2590 "src/parse-gram.c"
2593 /* Line 1704 of yacc.c */
2594 #line 506 "src/parse-gram.y"
2595 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2596 /* Line 1704 of yacc.c */
2597 #line 2598 "src/parse-gram.c"
2601 /* Line 1704 of yacc.c */
2602 #line 510 "src/parse-gram.y"
2603 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2604 /* Line 1704 of yacc.c */
2605 #line 2606 "src/parse-gram.c"
2609 /* Line 1704 of yacc.c */
2610 #line 511 "src/parse-gram.y"
2611 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2612 /* Line 1704 of yacc.c */
2613 #line 2614 "src/parse-gram.c"
2617 /* Line 1704 of yacc.c */
2618 #line 517 "src/parse-gram.y"
2619 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2620 /* Line 1704 of yacc.c */
2621 #line 2622 "src/parse-gram.c"
2625 /* Line 1704 of yacc.c */
2626 #line 519 "src/parse-gram.y"
2627 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2628 /* Line 1704 of yacc.c */
2629 #line 2630 "src/parse-gram.c"
2633 /* Line 1704 of yacc.c */
2634 #line 523 "src/parse-gram.y"
2635 { (yyval
.list
) = (yyvsp
[0].list
); }
2636 /* Line 1704 of yacc.c */
2637 #line 2638 "src/parse-gram.c"
2641 /* Line 1704 of yacc.c */
2642 #line 524 "src/parse-gram.y"
2643 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2644 /* Line 1704 of yacc.c */
2645 #line 2646 "src/parse-gram.c"
2649 /* Line 1704 of yacc.c */
2650 #line 528 "src/parse-gram.y"
2651 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2652 /* Line 1704 of yacc.c */
2653 #line 2654 "src/parse-gram.c"
2657 /* Line 1704 of yacc.c */
2658 #line 529 "src/parse-gram.y"
2659 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2660 /* Line 1704 of yacc.c */
2661 #line 2662 "src/parse-gram.c"
2665 /* Line 1704 of yacc.c */
2666 #line 534 "src/parse-gram.y"
2667 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2668 /* Line 1704 of yacc.c */
2669 #line 2670 "src/parse-gram.c"
2673 /* Line 1704 of yacc.c */
2674 #line 535 "src/parse-gram.y"
2675 { (yyval
.uniqstr
) = uniqstr_new (""); }
2676 /* Line 1704 of yacc.c */
2677 #line 2678 "src/parse-gram.c"
2681 /* Line 1704 of yacc.c */
2682 #line 541 "src/parse-gram.y"
2684 current_type
= (yyvsp
[0].uniqstr
);
2687 /* Line 1704 of yacc.c */
2688 #line 2689 "src/parse-gram.c"
2692 /* Line 1704 of yacc.c */
2693 #line 546 "src/parse-gram.y"
2695 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2696 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2698 /* Line 1704 of yacc.c */
2699 #line 2700 "src/parse-gram.c"
2703 /* Line 1704 of yacc.c */
2704 #line 551 "src/parse-gram.y"
2706 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2707 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2708 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2710 /* Line 1704 of yacc.c */
2711 #line 2712 "src/parse-gram.c"
2715 /* Line 1704 of yacc.c */
2716 #line 557 "src/parse-gram.y"
2718 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2719 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2720 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2722 /* Line 1704 of yacc.c */
2723 #line 2724 "src/parse-gram.c"
2727 /* Line 1704 of yacc.c */
2728 #line 563 "src/parse-gram.y"
2730 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2731 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2732 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2733 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2735 /* Line 1704 of yacc.c */
2736 #line 2737 "src/parse-gram.c"
2740 /* Line 1704 of yacc.c */
2741 #line 593 "src/parse-gram.y"
2745 /* Line 1704 of yacc.c */
2746 #line 2747 "src/parse-gram.c"
2750 /* Line 1704 of yacc.c */
2751 #line 599 "src/parse-gram.y"
2752 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2753 /* Line 1704 of yacc.c */
2754 #line 2755 "src/parse-gram.c"
2758 /* Line 1704 of yacc.c */
2759 #line 600 "src/parse-gram.y"
2761 /* Free the current lhs. */
2762 current_lhs (0, (yylsp
[-3]), 0);
2764 /* Line 1704 of yacc.c */
2765 #line 2766 "src/parse-gram.c"
2769 /* Line 1704 of yacc.c */
2770 #line 607 "src/parse-gram.y"
2771 { grammar_current_rule_end ((yylsp
[0])); }
2772 /* Line 1704 of yacc.c */
2773 #line 2774 "src/parse-gram.c"
2777 /* Line 1704 of yacc.c */
2778 #line 608 "src/parse-gram.y"
2779 { grammar_current_rule_end ((yylsp
[0])); }
2780 /* Line 1704 of yacc.c */
2781 #line 2782 "src/parse-gram.c"
2785 /* Line 1704 of yacc.c */
2786 #line 614 "src/parse-gram.y"
2787 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2788 current_lhs_named_ref
); }
2789 /* Line 1704 of yacc.c */
2790 #line 2791 "src/parse-gram.c"
2794 /* Line 1704 of yacc.c */
2795 #line 617 "src/parse-gram.y"
2796 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2797 /* Line 1704 of yacc.c */
2798 #line 2799 "src/parse-gram.c"
2802 /* Line 1704 of yacc.c */
2803 #line 619 "src/parse-gram.y"
2804 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2805 /* Line 1704 of yacc.c */
2806 #line 2807 "src/parse-gram.c"
2810 /* Line 1704 of yacc.c */
2811 #line 621 "src/parse-gram.y"
2812 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2813 /* Line 1704 of yacc.c */
2814 #line 2815 "src/parse-gram.c"
2818 /* Line 1704 of yacc.c */
2819 #line 623 "src/parse-gram.y"
2820 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2821 /* Line 1704 of yacc.c */
2822 #line 2823 "src/parse-gram.c"
2826 /* Line 1704 of yacc.c */
2827 #line 625 "src/parse-gram.y"
2828 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2829 /* Line 1704 of yacc.c */
2830 #line 2831 "src/parse-gram.c"
2834 /* Line 1704 of yacc.c */
2835 #line 627 "src/parse-gram.y"
2836 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2837 /* Line 1704 of yacc.c */
2838 #line 2839 "src/parse-gram.c"
2842 /* Line 1704 of yacc.c */
2843 #line 631 "src/parse-gram.y"
2844 { (yyval
.named_ref
) = 0; }
2845 /* Line 1704 of yacc.c */
2846 #line 2847 "src/parse-gram.c"
2850 /* Line 1704 of yacc.c */
2851 #line 633 "src/parse-gram.y"
2852 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2853 /* Line 1704 of yacc.c */
2854 #line 2855 "src/parse-gram.c"
2858 /* Line 1704 of yacc.c */
2859 #line 644 "src/parse-gram.y"
2860 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2861 /* Line 1704 of yacc.c */
2862 #line 2863 "src/parse-gram.c"
2866 /* Line 1704 of yacc.c */
2867 #line 649 "src/parse-gram.y"
2868 { (yyval
.chars
) = ""; }
2869 /* Line 1704 of yacc.c */
2870 #line 2871 "src/parse-gram.c"
2874 /* Line 1704 of yacc.c */
2875 #line 650 "src/parse-gram.y"
2876 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2877 /* Line 1704 of yacc.c */
2878 #line 2879 "src/parse-gram.c"
2882 /* Line 1704 of yacc.c */
2883 #line 661 "src/parse-gram.y"
2885 code_props plain_code
;
2886 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2887 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2888 code_props_translate_code (&plain_code
);
2889 gram_scanner_last_string_free ();
2890 (yyval
.chars
) = plain_code
.code
;
2892 /* Line 1704 of yacc.c */
2893 #line 2894 "src/parse-gram.c"
2897 /* Line 1704 of yacc.c */
2898 #line 681 "src/parse-gram.y"
2899 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2900 /* Line 1704 of yacc.c */
2901 #line 2902 "src/parse-gram.c"
2905 /* Line 1704 of yacc.c */
2906 #line 683 "src/parse-gram.y"
2908 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2909 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2910 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2912 /* Line 1704 of yacc.c */
2913 #line 2914 "src/parse-gram.c"
2917 /* Line 1704 of yacc.c */
2918 #line 691 "src/parse-gram.y"
2919 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2920 /* Line 1704 of yacc.c */
2921 #line 2922 "src/parse-gram.c"
2925 /* Line 1704 of yacc.c */
2926 #line 703 "src/parse-gram.y"
2928 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2929 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2931 /* Line 1704 of yacc.c */
2932 #line 2933 "src/parse-gram.c"
2936 /* Line 1704 of yacc.c */
2937 #line 712 "src/parse-gram.y"
2939 code_props plain_code
;
2940 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2941 code_props_translate_code (&plain_code
);
2942 gram_scanner_last_string_free ();
2943 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2944 code_scanner_last_string_free ();
2946 /* Line 1704 of yacc.c */
2947 #line 2948 "src/parse-gram.c"
2951 /* Line 1704 of yacc.c */
2952 #line 2953 "src/parse-gram.c"
2955 if (yychar_backup
!= yychar
)
2956 YY_LAC_DISCARD ("yychar change");
2958 /* User semantic actions sometimes alter yychar, and that requires
2959 that yytoken be updated with the new translation. We take the
2960 approach of translating immediately before every use of yytoken.
2961 One alternative is translating here after every semantic action,
2962 but that translation would be missed if the semantic action invokes
2963 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2964 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2965 incorrect destructor might then be invoked immediately. In the
2966 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2967 to an incorrect destructor call or verbose syntax error message
2968 before the lookahead is translated. */
2969 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2973 YY_STACK_PRINT (yyss
, yyssp
);
2978 /* Now `shift' the result of the reduction. Determine what state
2979 that goes to, based on the state we popped back to and the rule
2980 number reduced by. */
2984 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2985 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2986 yystate
= yytable
[yystate
];
2988 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2993 /*--------------------------------------.
2994 | yyerrlab -- here on detecting error. |
2995 `--------------------------------------*/
2997 /* Make sure we have latest lookahead translation. See comments at
2998 user semantic actions for why this is necessary. */
2999 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3001 /* If not already recovering from an error, report this error. */
3005 #if ! YYERROR_VERBOSE
3006 yyerror (YY_("syntax error"));
3008 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3009 yyesa, &yyes, &yyes_capacity, \
3012 char const *yymsgp
= YY_("syntax error");
3013 int yysyntax_error_status
;
3014 if (yychar
!= YYEMPTY
)
3016 yysyntax_error_status
= YYSYNTAX_ERROR
;
3017 if (yysyntax_error_status
== 0)
3019 else if (yysyntax_error_status
== 1)
3021 if (yymsg
!= yymsgbuf
)
3022 YYSTACK_FREE (yymsg
);
3023 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3027 yymsg_alloc
= sizeof yymsgbuf
;
3028 yysyntax_error_status
= 2;
3032 yysyntax_error_status
= YYSYNTAX_ERROR
;
3037 if (yysyntax_error_status
== 2)
3038 goto yyexhaustedlab
;
3040 # undef YYSYNTAX_ERROR
3044 yyerror_range
[1] = yylloc
;
3046 if (yyerrstatus
== 3)
3048 /* If just tried and failed to reuse lookahead token after an
3049 error, discard it. */
3051 if (yychar
<= YYEOF
)
3053 /* Return failure if at end of input. */
3054 if (yychar
== YYEOF
)
3059 yydestruct ("Error: discarding",
3060 yytoken
, &yylval
, &yylloc
);
3065 /* Else will try to reuse lookahead token after shifting the error
3070 /*---------------------------------------------------.
3071 | yyerrorlab -- error raised explicitly by YYERROR. |
3072 `---------------------------------------------------*/
3075 /* Pacify compilers like GCC when the user code never invokes
3076 YYERROR and the label yyerrorlab therefore never appears in user
3078 if (/*CONSTCOND*/ 0)
3081 yyerror_range
[1] = yylsp
[1-yylen
];
3082 /* Do not reclaim the symbols of the rule which action triggered
3086 YY_STACK_PRINT (yyss
, yyssp
);
3091 /*-------------------------------------------------------------.
3092 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3093 `-------------------------------------------------------------*/
3095 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3099 yyn
= yypact
[yystate
];
3100 if (!yypact_value_is_default (yyn
))
3103 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3111 /* Pop the current state because it cannot handle the error token. */
3115 yyerror_range
[1] = *yylsp
;
3116 yydestruct ("Error: popping",
3117 yystos
[yystate
], yyvsp
, yylsp
);
3120 YY_STACK_PRINT (yyss
, yyssp
);
3123 /* If the stack popping above didn't lose the initial context for the
3124 current lookahead token, the shift below will for sure. */
3125 YY_LAC_DISCARD ("error recovery");
3127 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3129 YY_IGNORE_MAYBE_UNINITIALIZED_END
3131 yyerror_range
[2] = yylloc
;
3132 /* Using YYLLOC is tempting, but would change the location of
3133 the lookahead. YYLOC is available though. */
3134 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3137 /* Shift the error token. */
3138 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3144 /*-------------------------------------.
3145 | yyacceptlab -- YYACCEPT comes here. |
3146 `-------------------------------------*/
3151 /*-----------------------------------.
3152 | yyabortlab -- YYABORT comes here. |
3153 `-----------------------------------*/
3159 /*-------------------------------------------------.
3160 | yyexhaustedlab -- memory exhaustion comes here. |
3161 `-------------------------------------------------*/
3163 yyerror (YY_("memory exhausted"));
3169 if (yychar
!= YYEMPTY
)
3171 /* Make sure we have latest lookahead translation. See comments at
3172 user semantic actions for why this is necessary. */
3173 yytoken
= YYTRANSLATE (yychar
);
3174 yydestruct ("Cleanup: discarding lookahead",
3175 yytoken
, &yylval
, &yylloc
);
3177 /* Do not reclaim the symbols of the rule which action triggered
3178 this YYABORT or YYACCEPT. */
3180 YY_STACK_PRINT (yyss
, yyssp
);
3181 while (yyssp
!= yyss
)
3183 yydestruct ("Cleanup: popping",
3184 yystos
[*yyssp
], yyvsp
, yylsp
);
3189 YYSTACK_FREE (yyss
);
3192 YYSTACK_FREE (yyes
);
3194 if (yymsg
!= yymsgbuf
)
3195 YYSTACK_FREE (yymsg
);
3199 /* Line 1964 of yacc.c */
3200 #line 722 "src/parse-gram.y"
3203 /* Return the location of the left-hand side of a rule whose
3204 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3205 the right-hand side, and return an empty location equal to the end
3206 boundary of RHS[0] if the right-hand side is empty. */
3209 lloc_default (YYLTYPE
const *rhs
, int n
)
3214 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3215 The bug is fixed in 7.4.2m, but play it safe for now. */
3216 loc
.start
= rhs
[n
].end
;
3217 loc
.end
= rhs
[n
].end
;
3219 /* Ignore empty nonterminals the start of the right-hand side.
3220 Do not bother to ignore them at the end of the right-hand side,
3221 since empty nonterminals have the same end as their predecessors. */
3222 for (i
= 1; i
<= n
; i
++)
3223 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3225 loc
.start
= rhs
[i
].start
;
3234 add_param (param_type type
, char *decl
, location loc
)
3236 static char const alphanum
[26 + 26 + 1 + 10] =
3237 "abcdefghijklmnopqrstuvwxyz"
3238 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3242 char const *name_start
= NULL
;
3245 /* Stop on last actual character. */
3246 for (p
= decl
; p
[1]; p
++)
3248 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3249 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3252 /* Strip the surrounding '{' and '}', and any blanks just inside
3255 while (c_isspace ((unsigned char) *p
))
3259 while (c_isspace ((unsigned char) *decl
))
3264 complain (&loc
, complaint
, _("missing identifier in parameter declaration"));
3267 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3268 if (type
& param_lex
)
3269 muscle_pair_list_grow ("lex_param", decl
, name
);
3270 if (type
& param_parse
)
3271 muscle_pair_list_grow ("parse_param", decl
, name
);
3275 gram_scanner_last_string_free ();
3280 version_check (location
const *loc
, char const *version
)
3282 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3284 complain (loc
, complaint
, "require bison %s, but have %s",
3285 version
, PACKAGE_VERSION
);
3291 gram_error (location
const *loc
, char const *msg
)
3293 complain (loc
, complaint
, "%s", msg
);
3297 token_name (int type
)
3299 return yytname
[YYTRANSLATE (type
)];
3310 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3311 return quotearg_style (escape_quoting_style
, buf
);