1 /* A Bison parser, made by GNU Bison 2.7.980-6f0a6-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.7.980-6f0a6-dirty"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Substitute the type names. */
62 #define YYSTYPE GRAM_STYPE
63 #define YYLTYPE GRAM_LTYPE
64 /* Substitute the variable and function names. */
65 #define yyparse gram_parse
66 #define yylex gram_lex
67 #define yyerror gram_error
68 #define yylval gram_lval
69 #define yychar gram_char
70 #define yydebug gram_debug
71 #define yynerrs gram_nerrs
72 #define yylloc gram_lloc
74 /* Copy the first part of user declarations. */
75 /* Line 356 of yacc.c */
76 #line 1 "src/parse-gram.y"
77 /* Bison Grammar Parser -*- C -*-
79 Copyright (C) 2002-2012 Free Software Foundation, Inc.
81 This file is part of Bison, the GNU Compiler Compiler.
83 This program is free software: you can redistribute it and/or modify
84 it under the terms of the GNU General Public License as published by
85 the Free Software Foundation, either version 3 of the License, or
86 (at your option) any later version.
88 This program is distributed in the hope that it will be useful,
89 but WITHOUT ANY WARRANTY; without even the implied warranty of
90 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91 GNU General Public License for more details.
93 You should have received a copy of the GNU General Public License
94 along with this program. If not, see <http://www.gnu.org/licenses/>. */
100 #include "complain.h"
101 #include "conflicts.h"
105 #include "muscle-tab.h"
106 #include "named-ref.h"
107 #include "quotearg.h"
111 #include "scan-gram.h"
112 #include "scan-code.h"
113 #include "xmemdup0.h"
115 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
116 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
118 #define YY_LOCATION_PRINT(File, Loc) \
119 location_print (File, Loc)
121 static void version_check (location
const *loc
, char const *version
);
123 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
124 FIXME: depends on the undocumented availability of YYLLOC. */
126 #define yyerror(Msg) \
127 gram_error (&yylloc, Msg)
128 static void gram_error (location
const *, char const *);
130 static char const *char_name (char);
132 /* Line 356 of yacc.c */
133 #line 134 "src/parse-gram.c"
136 # if defined __cplusplus && 201103L <= __cplusplus
137 # define YY_NULL nullptr
143 /* Enabling verbose error messages. */
144 #ifdef YYERROR_VERBOSE
145 # undef YYERROR_VERBOSE
146 # define YYERROR_VERBOSE 1
148 # define YYERROR_VERBOSE 1
151 /* In a future release of Bison, this section will be replaced
152 by #include "src/parse-gram.h". */
153 #ifndef YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
154 # define YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
159 # define GRAM_DEBUG 1
161 # define GRAM_DEBUG 0
163 # else /* ! defined YYDEBUG */
164 # define GRAM_DEBUG 1
165 # endif /* ! defined YYDEBUG */
166 #endif /* ! defined GRAM_DEBUG */
168 extern int gram_debug
;
170 /* "%code requires" blocks. */
171 /* Line 372 of yacc.c */
172 #line 223 "src/parse-gram.y"
180 param_parse
= 1 << 1,
181 param_both
= param_lex
| param_parse
186 /* Line 372 of yacc.c */
187 #line 188 "src/parse-gram.c"
190 #ifndef GRAM_TOKENTYPE
191 # define GRAM_TOKENTYPE
200 PERCENT_DESTRUCTOR
= 263,
201 PERCENT_PRINTER
= 264,
204 PERCENT_NONASSOC
= 267,
205 PERCENT_PRECEDENCE
= 268,
210 PERCENT_DEFAULT_PREC
= 273,
211 PERCENT_DEFINE
= 274,
212 PERCENT_DEFINES
= 275,
213 PERCENT_ERROR_VERBOSE
= 276,
214 PERCENT_EXPECT
= 277,
215 PERCENT_EXPECT_RR
= 278,
217 PERCENT_FILE_PREFIX
= 280,
218 PERCENT_GLR_PARSER
= 281,
219 PERCENT_INITIAL_ACTION
= 282,
220 PERCENT_LANGUAGE
= 283,
221 PERCENT_NAME_PREFIX
= 284,
222 PERCENT_NO_DEFAULT_PREC
= 285,
223 PERCENT_NO_LINES
= 286,
224 PERCENT_NONDETERMINISTIC_PARSER
= 287,
225 PERCENT_OUTPUT
= 288,
226 PERCENT_REQUIRE
= 289,
227 PERCENT_SKELETON
= 290,
229 PERCENT_TOKEN_TABLE
= 292,
230 PERCENT_VERBOSE
= 293,
233 BRACED_PREDICATE
= 296,
240 PERCENT_PERCENT
= 303,
255 #define PERCENT_TOKEN 260
256 #define PERCENT_NTERM 261
257 #define PERCENT_TYPE 262
258 #define PERCENT_DESTRUCTOR 263
259 #define PERCENT_PRINTER 264
260 #define PERCENT_LEFT 265
261 #define PERCENT_RIGHT 266
262 #define PERCENT_NONASSOC 267
263 #define PERCENT_PRECEDENCE 268
264 #define PERCENT_PREC 269
265 #define PERCENT_DPREC 270
266 #define PERCENT_MERGE 271
267 #define PERCENT_CODE 272
268 #define PERCENT_DEFAULT_PREC 273
269 #define PERCENT_DEFINE 274
270 #define PERCENT_DEFINES 275
271 #define PERCENT_ERROR_VERBOSE 276
272 #define PERCENT_EXPECT 277
273 #define PERCENT_EXPECT_RR 278
274 #define PERCENT_FLAG 279
275 #define PERCENT_FILE_PREFIX 280
276 #define PERCENT_GLR_PARSER 281
277 #define PERCENT_INITIAL_ACTION 282
278 #define PERCENT_LANGUAGE 283
279 #define PERCENT_NAME_PREFIX 284
280 #define PERCENT_NO_DEFAULT_PREC 285
281 #define PERCENT_NO_LINES 286
282 #define PERCENT_NONDETERMINISTIC_PARSER 287
283 #define PERCENT_OUTPUT 288
284 #define PERCENT_REQUIRE 289
285 #define PERCENT_SKELETON 290
286 #define PERCENT_START 291
287 #define PERCENT_TOKEN_TABLE 292
288 #define PERCENT_VERBOSE 293
289 #define PERCENT_YACC 294
290 #define BRACED_CODE 295
291 #define BRACED_PREDICATE 296
292 #define BRACKETED_ID 297
298 #define PERCENT_PERCENT 303
301 #define SEMICOLON 306
305 #define PERCENT_PARAM 310
306 #define PERCENT_UNION 311
309 #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
310 typedef union GRAM_STYPE GRAM_STYPE
;
313 /* Line 372 of yacc.c */
314 #line 109 "src/parse-gram.y"
320 named_ref
*named_ref
;
324 unsigned char character
;
326 /* Line 372 of yacc.c */
327 #line 247 "src/parse-gram.y"
331 /* Line 372 of yacc.c */
332 #line 423 "src/parse-gram.y"
333 code_props_type code_type
;
335 /* Line 372 of yacc.c */
336 #line 337 "src/parse-gram.c"
338 # define GRAM_STYPE_IS_TRIVIAL 1
339 # define GRAM_STYPE_IS_DECLARED 1
343 #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
344 typedef struct GRAM_LTYPE GRAM_LTYPE
;
352 # define GRAM_LTYPE_IS_DECLARED 1
353 # define GRAM_LTYPE_IS_TRIVIAL 1
358 int gram_parse (void);
360 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */
362 /* Copy the second part of user declarations. */
364 /* Line 375 of yacc.c */
365 #line 366 "src/parse-gram.c"
366 /* Unqualified %code blocks. */
367 /* Line 376 of yacc.c */
368 #line 58 "src/parse-gram.y"
370 static int current_prec
= 0;
371 static location current_lhs_location
;
372 static named_ref
*current_lhs_named_ref
;
373 static symbol
*current_lhs_symbol
;
374 static symbol_class current_class
= unknown_sym
;
375 static uniqstr current_type
= NULL
;
377 /** Set the new current left-hand side symbol, possibly common
378 * to several right-hand side parts of rule.
382 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
384 current_lhs_symbol
= sym
;
385 current_lhs_location
= loc
;
386 /* In order to simplify memory management, named references for lhs
387 are always assigned by deep copy into the current symbol_list
388 node. This is because a single named-ref in the grammar may
389 result in several uses when the user factors lhs between several
390 rules using "|". Therefore free the parser's original copy. */
391 free (current_lhs_named_ref
);
392 current_lhs_named_ref
= ref
;
395 #define YYTYPE_INT16 int_fast16_t
396 #define YYTYPE_INT8 int_fast8_t
397 #define YYTYPE_UINT16 uint_fast16_t
398 #define YYTYPE_UINT8 uint_fast8_t
400 /* Line 376 of yacc.c */
401 #line 236 "src/parse-gram.y"
403 /** Add a lex-param and/or a parse-param.
405 * \param type where to push this formal argument.
406 * \param decl the formal argument. Destroyed.
407 * \param loc the location in the source.
409 static void add_param (param_type type
, char *decl
, location loc
);
410 static param_type current_param
= param_none
;
413 /* Line 376 of yacc.c */
414 #line 415 "src/parse-gram.c"
421 typedef YYTYPE_UINT8 yytype_uint8
;
423 typedef unsigned char yytype_uint8
;
427 typedef YYTYPE_INT8 yytype_int8
;
429 typedef signed char yytype_int8
;
433 typedef YYTYPE_UINT16 yytype_uint16
;
435 typedef unsigned short int yytype_uint16
;
439 typedef YYTYPE_INT16 yytype_int16
;
441 typedef short int yytype_int16
;
445 # ifdef __SIZE_TYPE__
446 # define YYSIZE_T __SIZE_TYPE__
447 # elif defined size_t
448 # define YYSIZE_T size_t
449 # elif ! defined YYSIZE_T
450 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
451 # define YYSIZE_T size_t
453 # define YYSIZE_T unsigned int
457 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
460 # if defined YYENABLE_NLS && YYENABLE_NLS
462 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
463 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
467 # define YY_(Msgid) Msgid
471 /* Suppress unused-variable warnings by "using" E. */
473 # define YYUSE(E) ((void) (E))
475 # define YYUSE(E) /* empty */
480 /* The parser invokes alloca or malloc; define the necessary symbols. */
482 # ifdef YYSTACK_ALLOC
483 /* Pacify GCC's `empty if-body' warning. */
484 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
485 # ifndef YYSTACK_ALLOC_MAXIMUM
486 /* The OS might guarantee only one guard page at the bottom of the stack,
487 and a page size can be as small as 4096 bytes. So we cannot safely
488 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
489 to allow for a few compiler-allocated temporary stack slots. */
490 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
493 # define YYSTACK_ALLOC YYMALLOC
494 # define YYSTACK_FREE YYFREE
495 # ifndef YYSTACK_ALLOC_MAXIMUM
496 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
498 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
499 && ! ((defined YYMALLOC || defined malloc) \
500 && (defined YYFREE || defined free)))
501 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
502 # ifndef EXIT_SUCCESS
503 # define EXIT_SUCCESS 0
507 # define YYMALLOC malloc
508 # if ! defined malloc && ! defined EXIT_SUCCESS
509 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
514 # if ! defined free && ! defined EXIT_SUCCESS
515 void free (void *); /* INFRINGES ON USER NAME SPACE */
519 # define YYCOPY_NEEDED 1
523 #if (! defined yyoverflow \
524 && (! defined __cplusplus \
525 || (defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL \
526 && defined GRAM_STYPE_IS_TRIVIAL && GRAM_STYPE_IS_TRIVIAL)))
528 /* A type that is properly aligned for any stack member. */
531 yytype_int16 yyss_alloc
;
536 /* The size of the maximum gap between one aligned stack and the next. */
537 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
539 /* The size of an array large to enough to hold all stacks, each with
541 # define YYSTACK_BYTES(N) \
542 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
543 + 2 * YYSTACK_GAP_MAXIMUM)
545 # define YYCOPY_NEEDED 1
547 /* Relocate STACK from its old location to the new one. The
548 local variables YYSIZE and YYSTACKSIZE give the old and new number of
549 elements in the stack, and YYPTR gives the new location of the
550 stack. Advance YYPTR to a properly aligned location for the next
552 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
555 YYSIZE_T yynewbytes; \
556 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
557 Stack = &yyptr->Stack_alloc; \
558 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
559 yyptr += yynewbytes / sizeof (*yyptr); \
565 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
566 /* Copy COUNT objects from SRC to DST. The source and destination do
569 # if defined __GNUC__ && 1 < __GNUC__
570 # define YYCOPY(Dst, Src, Count) \
571 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
573 # define YYCOPY(Dst, Src, Count) \
577 for (yyi = 0; yyi < (Count); yyi++) \
578 (Dst)[yyi] = (Src)[yyi]; \
583 #endif /* !YYCOPY_NEEDED */
585 /* YYFINAL -- State number of the termination state. */
587 /* YYLAST -- Last index in YYTABLE. */
590 /* YYNTOKENS -- Number of terminals. */
592 /* YYNNTS -- Number of nonterminals. */
594 /* YYNRULES -- Number of rules. */
596 /* YYNSTATES -- Number of states. */
597 #define YYNSTATES 143
599 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
600 by yylex, with out-of-bounds checking. */
602 #define YYMAXUTOK 311
604 #define YYTRANSLATE(YYX) \
605 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
607 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
608 as returned by yylex, without out-of-bounds checking. */
609 static const yytype_uint8 yytranslate
[] =
611 0, 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, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
637 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
638 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
639 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
640 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
641 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
646 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
647 static const yytype_uint16 yyrline
[] =
649 0, 272, 272, 280, 282, 286, 287, 297, 301, 306,
650 307, 312, 317, 318, 319, 320, 325, 334, 335, 336,
651 337, 338, 339, 339, 340, 341, 365, 366, 367, 368,
652 372, 373, 382, 383, 384, 388, 400, 404, 408, 415,
653 426, 427, 437, 438, 442, 454, 454, 459, 459, 464,
654 475, 490, 491, 492, 493, 497, 498, 503, 505, 510,
655 511, 516, 518, 523, 524, 528, 529, 533, 534, 535,
656 540, 545, 550, 556, 562, 573, 574, 583, 584, 590,
657 591, 592, 599, 599, 607, 608, 609, 614, 616, 618,
658 620, 622, 624, 626, 631, 633, 643, 644, 649, 650,
659 651, 660, 680, 682, 691, 696, 697, 702, 709, 711
663 #if GRAM_DEBUG || YYERROR_VERBOSE || 1
664 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
665 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
666 static const char *const yytname
[] =
668 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
669 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
670 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
671 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
672 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
673 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
674 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
675 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
676 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
677 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
678 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
679 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
680 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
681 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
682 "prologue_declaration", "$@1", "params", "grammar_declaration",
683 "code_props_type", "union_name", "symbol_declaration", "$@2", "$@3",
684 "precedence_declaration", "precedence_declarator", "tag.opt",
685 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
686 "generic_symlist_item", "tag", "symbol_def", "symbol_defs.1", "grammar",
687 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
688 "named_ref.opt", "variable", "content.opt", "braceless", "id",
689 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
694 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
695 (internal) symbol number NUM (which must be that of a token). */
696 static const yytype_uint16 yytoknum
[] =
698 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
699 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
700 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
701 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
702 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
703 305, 306, 307, 308, 309, 310, 311
707 #define YYPACT_NINF -74
709 #define yypact_value_is_default(Yystate) \
710 (!!((Yystate) == (-74)))
712 #define YYTABLE_NINF -109
714 #define yytable_value_is_error(Yytable_value) \
717 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
719 static const yytype_int16 yypact
[] =
721 -74, 40, 101, -74, -74, -74, -48, -74, -74, -74,
722 -74, -74, -74, 19, -74, 0, 52, -74, 56, 79,
723 -74, 81, -74, 45, 83, 84, -74, -74, -74, 85,
724 86, 87, 31, -74, -74, -74, 15, -74, -74, -74,
725 46, -74, -74, 51, -74, -74, 42, 4, 4, 31,
726 -74, 57, -74, -74, -74, 36, -74, -74, -74, -74,
727 -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
728 -74, -74, 47, -74, 49, 1, -74, -74, 59, 62,
729 -74, 57, 26, -74, 31, -74, -74, 4, 72, 4,
730 31, -74, -74, -74, -74, -74, -74, -74, 60, -74,
731 -74, -74, -74, -74, 63, -74, -74, -74, -74, 26,
732 -74, -74, -74, 31, -74, 111, -74, 113, -74, -74,
733 -74, -74, -74, -74, -74, -74, -74, -13, 27, -74,
734 -74, 31, 137, 65, 59, -74, 59, 27, -74, -74,
738 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
739 Performed when YYTABLE does not specify something else to do. Zero
740 means the default is an error. */
741 static const yytype_uint8 yydefact
[] =
743 3, 0, 0, 1, 47, 45, 0, 40, 41, 51,
744 52, 53, 54, 0, 36, 0, 9, 11, 0, 0,
745 7, 0, 15, 0, 0, 0, 37, 19, 20, 0,
746 0, 0, 0, 26, 27, 28, 0, 6, 29, 22,
747 42, 4, 5, 0, 33, 32, 55, 0, 0, 0,
748 101, 0, 38, 97, 96, 98, 10, 12, 13, 14,
749 16, 17, 18, 21, 24, 25, 107, 103, 102, 105,
750 34, 106, 0, 104, 0, 0, 77, 79, 94, 0,
751 43, 0, 0, 56, 0, 70, 75, 48, 71, 46,
752 49, 61, 39, 100, 99, 8, 81, 80, 0, 78,
753 2, 95, 82, 31, 23, 44, 67, 68, 69, 35,
754 63, 66, 65, 50, 57, 59, 76, 72, 73, 62,
755 109, 87, 30, 64, 58, 60, 74, 83, 84, 87,
756 86, 0, 0, 0, 94, 90, 94, 85, 91, 92,
760 /* YYPGOTO[NTERM-NUM]. */
761 static const yytype_int16 yypgoto
[] =
763 -74, -74, -74, -74, -74, -74, 140, -74, -74, -74,
764 -74, -74, -74, -74, -74, -74, 30, -74, -74, 35,
765 -74, -26, 97, -74, 71, -74, -74, -74, 18, -70,
766 -74, -74, -46, 6, -74, -32, -73, -74
769 /* YYDEFGOTO[NTERM-NUM]. */
770 static const yytype_int16 yydefgoto
[] =
772 -1, 1, 2, 41, 79, 104, 74, 43, 81, 44,
773 48, 47, 45, 46, 84, 113, 114, 90, 109, 110,
774 111, 86, 87, 75, 76, 77, 121, 127, 128, 102,
775 55, 95, 52, 69, 78, 112, 71, 100
778 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
779 positive, shift that token. If negative, reduce the rule whose
780 number is the opposite. If YYTABLE_NINF, syntax error. */
781 static const yytype_int16 yytable
[] =
783 70, -108, 72, 53, 49, 92, 4, 5, 6, 7,
784 8, 9, 10, 11, 12, 118, 72, 91, 13, 14,
785 4, 5, 6, 7, 8, 9, 10, 11, 12, 66,
786 66, 26, 13, 14, 66, 105, 129, 32, 130, 93,
787 3, 131, 132, 133, 126, 26, 54, 67, 73, 98,
788 68, 32, 115, 88, 88, 56, 85, 40, 119, 50,
789 57, 116, 73, 116, 141, 51, 142, 134, 135, 67,
790 67, 40, 68, 68, 67, 66, 117, 68, 106, 107,
791 108, 115, 94, 58, 59, 60, 61, 62, 63, 64,
792 65, 82, 80, 88, 83, 88, 136, 50, 96, 138,
793 97, 101, 103, 122, 120, 136, 4, 5, 6, 7,
794 8, 9, 10, 11, 12, 125, 66, 140, 13, 14,
795 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
796 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
797 35, 139, 42, 124, 123, 89, 99, 137, 0, 36,
798 0, 37, 38, 0, 0, 0, 39, 40
801 static const yytype_int16 yycheck
[] =
803 32, 0, 1, 3, 52, 51, 5, 6, 7, 8,
804 9, 10, 11, 12, 13, 88, 1, 49, 17, 18,
805 5, 6, 7, 8, 9, 10, 11, 12, 13, 3,
806 3, 30, 17, 18, 3, 81, 49, 36, 51, 3,
807 0, 14, 15, 16, 117, 30, 46, 43, 47, 48,
808 46, 36, 84, 47, 48, 3, 52, 56, 90, 40,
809 4, 87, 47, 89, 134, 46, 136, 40, 41, 43,
810 43, 56, 46, 46, 43, 3, 4, 46, 52, 53,
811 54, 113, 46, 4, 3, 40, 3, 3, 3, 3,
812 3, 40, 46, 87, 52, 89, 128, 40, 51, 131,
813 51, 42, 40, 40, 44, 137, 5, 6, 7, 8,
814 9, 10, 11, 12, 13, 4, 3, 52, 17, 18,
815 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
816 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
817 39, 4, 2, 113, 109, 48, 75, 129, -1, 48,
818 -1, 50, 51, -1, -1, -1, 55, 56
821 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
822 symbol of state STATE-NUM. */
823 static const yytype_uint8 yystos
[] =
825 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
826 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
827 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
828 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
829 56, 60, 63, 64, 66, 69, 70, 68, 67, 52,
830 40, 46, 89, 3, 46, 87, 3, 4, 4, 3,
831 40, 3, 3, 3, 3, 3, 3, 43, 46, 90,
832 92, 93, 1, 47, 63, 80, 81, 82, 91, 61,
833 46, 65, 40, 52, 71, 52, 78, 79, 90, 79,
834 74, 92, 89, 3, 46, 88, 51, 51, 48, 81,
835 94, 42, 86, 40, 62, 89, 52, 53, 54, 75,
836 76, 77, 92, 72, 73, 92, 78, 4, 93, 92,
837 44, 83, 40, 76, 73, 4, 93, 84, 85, 49,
838 51, 14, 15, 16, 40, 41, 92, 85, 92, 4,
842 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
843 static const yytype_uint8 yyr1
[] =
845 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
846 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
847 60, 60, 61, 60, 60, 60, 60, 60, 60, 60,
848 62, 62, 63, 63, 63, 63, 63, 63, 63, 63,
849 64, 64, 65, 65, 63, 67, 66, 68, 66, 66,
850 69, 70, 70, 70, 70, 71, 71, 72, 72, 73,
851 73, 74, 74, 75, 75, 76, 76, 77, 77, 77,
852 78, 78, 78, 78, 78, 79, 79, 80, 80, 81,
853 81, 81, 83, 82, 84, 84, 84, 85, 85, 85,
854 85, 85, 85, 85, 86, 86, 87, 87, 88, 88,
855 88, 89, 90, 90, 91, 92, 92, 93, 94, 94
858 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
859 static const yytype_uint8 yyr2
[] =
861 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
862 2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
863 1, 2, 0, 3, 2, 2, 1, 1, 1, 1,
864 2, 1, 1, 1, 2, 3, 1, 1, 2, 3,
865 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
866 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
867 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
868 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
869 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
870 2, 3, 3, 3, 0, 1, 1, 1, 0, 1,
871 1, 1, 1, 1, 1, 1, 1, 1, 0, 2
875 #define yyerrok (yyerrstatus = 0)
876 #define yyclearin (yychar = YYEMPTY)
880 #define YYACCEPT goto yyacceptlab
881 #define YYABORT goto yyabortlab
882 #define YYERROR goto yyerrorlab
885 #define YYRECOVERING() (!!yyerrstatus)
887 #define YYBACKUP(Token, Value) \
889 if (yychar == YYEMPTY) \
893 YYPOPSTACK (yylen); \
895 YY_LAC_DISCARD ("YYBACKUP"); \
900 yyerror (YY_("syntax error: cannot back up")); \
905 /* Error token number */
907 #define YYERRCODE 256
910 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
911 If N is 0, then set CURRENT to the empty location which ends
912 the previous symbol: RHS[0] (always defined). */
914 #ifndef YYLLOC_DEFAULT
915 # define YYLLOC_DEFAULT(Current, Rhs, N) \
919 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
920 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
921 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
922 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
926 (Current).first_line = (Current).last_line = \
927 YYRHSLOC (Rhs, 0).last_line; \
928 (Current).first_column = (Current).last_column = \
929 YYRHSLOC (Rhs, 0).last_column; \
934 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
937 /* YY_LOCATION_PRINT -- Print the location on the stream.
938 This macro was not mandated originally: define only if we know
939 we won't break user code: when these are the locations we know. */
941 #ifndef YY_LOCATION_PRINT
942 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
944 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
946 __attribute__((__unused__
))
948 yy_location_print_ (FILE *yyo
, YYLTYPE
const * const yylocp
)
951 int end_col
= 0 != yylocp
->last_column
? yylocp
->last_column
- 1 : 0;
952 if (0 <= yylocp
->first_line
)
954 res
+= fprintf (yyo
, "%d", yylocp
->first_line
);
955 if (0 <= yylocp
->first_column
)
956 res
+= fprintf (yyo
, ".%d", yylocp
->first_column
);
958 if (0 <= yylocp
->last_line
)
960 if (yylocp
->first_line
< yylocp
->last_line
)
962 res
+= fprintf (yyo
, "-%d", yylocp
->last_line
);
964 res
+= fprintf (yyo
, ".%d", end_col
);
966 else if (0 <= end_col
&& yylocp
->first_column
< end_col
)
967 res
+= fprintf (yyo
, "-%d", end_col
);
972 # define YY_LOCATION_PRINT(File, Loc) \
973 yy_location_print_ (File, &(Loc))
976 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
981 /* Enable debugging if requested. */
985 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
986 # define YYFPRINTF fprintf
989 # define YYDPRINTF(Args) \
995 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
999 YYFPRINTF (stderr, "%s ", Title); \
1000 yy_symbol_print (stderr, \
1001 Type, Value, Location); \
1002 YYFPRINTF (stderr, "\n"); \
1007 /*--------------------------------.
1008 | Print this symbol on YYOUTPUT. |
1009 `--------------------------------*/
1012 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1014 FILE *yyo
= yyoutput
;
1016 YYUSE (yylocationp
);
1020 if (yytype
< YYNTOKENS
)
1021 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1026 /* Line 705 of yacc.c */
1027 #line 196 "src/parse-gram.y"
1028 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
1029 /* Line 705 of yacc.c */
1030 #line 1031 "src/parse-gram.c"
1033 case 4: // "integer"
1034 /* Line 705 of yacc.c */
1035 #line 209 "src/parse-gram.y"
1036 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
1037 /* Line 705 of yacc.c */
1038 #line 1039 "src/parse-gram.c"
1041 case 24: // "%<flag>"
1042 /* Line 705 of yacc.c */
1043 #line 205 "src/parse-gram.y"
1044 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1045 /* Line 705 of yacc.c */
1046 #line 1047 "src/parse-gram.c"
1050 /* Line 705 of yacc.c */
1051 #line 198 "src/parse-gram.y"
1052 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1053 /* Line 705 of yacc.c */
1054 #line 1055 "src/parse-gram.c"
1057 case 42: // "[identifier]"
1058 /* Line 705 of yacc.c */
1059 #line 203 "src/parse-gram.y"
1060 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1061 /* Line 705 of yacc.c */
1062 #line 1063 "src/parse-gram.c"
1066 /* Line 705 of yacc.c */
1067 #line 190 "src/parse-gram.y"
1068 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
1069 /* Line 705 of yacc.c */
1070 #line 1071 "src/parse-gram.c"
1073 case 44: // "epilogue"
1074 /* Line 705 of yacc.c */
1075 #line 198 "src/parse-gram.y"
1076 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1077 /* Line 705 of yacc.c */
1078 #line 1079 "src/parse-gram.c"
1081 case 46: // "identifier"
1082 /* Line 705 of yacc.c */
1083 #line 202 "src/parse-gram.y"
1084 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1085 /* Line 705 of yacc.c */
1086 #line 1087 "src/parse-gram.c"
1089 case 47: // "identifier:"
1090 /* Line 705 of yacc.c */
1091 #line 204 "src/parse-gram.y"
1092 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
1093 /* Line 705 of yacc.c */
1094 #line 1095 "src/parse-gram.c"
1097 case 50: // "%{...%}"
1098 /* Line 705 of yacc.c */
1099 #line 198 "src/parse-gram.y"
1100 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1101 /* Line 705 of yacc.c */
1102 #line 1103 "src/parse-gram.c"
1106 /* Line 705 of yacc.c */
1107 #line 206 "src/parse-gram.y"
1108 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1109 /* Line 705 of yacc.c */
1110 #line 1111 "src/parse-gram.c"
1113 case 55: // "%param"
1114 /* Line 705 of yacc.c */
1115 #line 252 "src/parse-gram.y"
1117 switch (((*yyvaluep
).param
))
1119 #define CASE(In, Out) \
1120 case param_ ## In: fputs ("%" #Out, stderr); break
1121 CASE(lex
, lex
-param
);
1122 CASE(parse
, parse
-param
);
1125 case param_none
: aver (false); break;
1128 /* Line 705 of yacc.c */
1129 #line 1130 "src/parse-gram.c"
1132 case 64: // code_props_type
1133 /* Line 705 of yacc.c */
1134 #line 424 "src/parse-gram.y"
1135 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1136 /* Line 705 of yacc.c */
1137 #line 1138 "src/parse-gram.c"
1140 case 73: // symbol.prec
1141 /* Line 705 of yacc.c */
1142 #line 212 "src/parse-gram.y"
1143 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1144 /* Line 705 of yacc.c */
1145 #line 1146 "src/parse-gram.c"
1149 /* Line 705 of yacc.c */
1150 #line 206 "src/parse-gram.y"
1151 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1152 /* Line 705 of yacc.c */
1153 #line 1154 "src/parse-gram.c"
1156 case 87: // variable
1157 /* Line 705 of yacc.c */
1158 #line 202 "src/parse-gram.y"
1159 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1160 /* Line 705 of yacc.c */
1161 #line 1162 "src/parse-gram.c"
1164 case 88: // content.opt
1165 /* Line 705 of yacc.c */
1166 #line 198 "src/parse-gram.y"
1167 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1168 /* Line 705 of yacc.c */
1169 #line 1170 "src/parse-gram.c"
1172 case 89: // braceless
1173 /* Line 705 of yacc.c */
1174 #line 198 "src/parse-gram.y"
1175 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1176 /* Line 705 of yacc.c */
1177 #line 1178 "src/parse-gram.c"
1181 /* Line 705 of yacc.c */
1182 #line 212 "src/parse-gram.y"
1183 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1184 /* Line 705 of yacc.c */
1185 #line 1186 "src/parse-gram.c"
1188 case 91: // id_colon
1189 /* Line 705 of yacc.c */
1190 #line 213 "src/parse-gram.y"
1191 { fprintf (yyo
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1192 /* Line 705 of yacc.c */
1193 #line 1194 "src/parse-gram.c"
1197 /* Line 705 of yacc.c */
1198 #line 212 "src/parse-gram.y"
1199 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1200 /* Line 705 of yacc.c */
1201 #line 1202 "src/parse-gram.c"
1204 case 93: // string_as_id
1205 /* Line 705 of yacc.c */
1206 #line 212 "src/parse-gram.y"
1207 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1208 /* Line 705 of yacc.c */
1209 #line 1210 "src/parse-gram.c"
1218 /*--------------------------------.
1219 | Print this symbol on YYOUTPUT. |
1220 `--------------------------------*/
1223 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1225 if (yytype
< YYNTOKENS
)
1226 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1228 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1230 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1231 YYFPRINTF (yyoutput
, ": ");
1232 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1233 YYFPRINTF (yyoutput
, ")");
1236 /*------------------------------------------------------------------.
1237 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1239 `------------------------------------------------------------------*/
1242 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1244 YYFPRINTF (stderr
, "Stack now");
1245 for (; yybottom
<= yytop
; yybottom
++)
1247 int yybot
= *yybottom
;
1248 YYFPRINTF (stderr
, " %d", yybot
);
1250 YYFPRINTF (stderr
, "\n");
1253 # define YY_STACK_PRINT(Bottom, Top) \
1256 yy_stack_print ((Bottom), (Top)); \
1260 /*------------------------------------------------.
1261 | Report that the YYRULE is going to be reduced. |
1262 `------------------------------------------------*/
1265 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1267 unsigned long int yylno
= yyrline
[yyrule
];
1268 int yynrhs
= yyr2
[yyrule
];
1270 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1272 /* The symbols being reduced. */
1273 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1275 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1276 yy_symbol_print (stderr
,
1277 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1278 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1279 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1280 YYFPRINTF (stderr
, "\n");
1284 # define YY_REDUCE_PRINT(Rule) \
1287 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1290 /* Nonzero means print parse trace. It is left uninitialized so that
1291 multiple parsers can coexist. */
1293 #else /* !GRAM_DEBUG */
1294 # define YYDPRINTF(Args)
1295 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1296 # define YY_STACK_PRINT(Bottom, Top)
1297 # define YY_REDUCE_PRINT(Rule)
1298 #endif /* !GRAM_DEBUG */
1301 /* YYINITDEPTH -- initial size of the parser's stacks. */
1303 # define YYINITDEPTH 200
1306 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1307 if the built-in stack extension method is used).
1309 Do not make this value too large; the results are undefined if
1310 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1311 evaluated with infinite-precision integer arithmetic. */
1314 # define YYMAXDEPTH 10000
1317 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1318 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1319 stack, and such that *YYCAPACITY is the maximum number of elements it
1320 can hold without a reallocation, make sure there is enough room to
1321 store YYADD more elements. If not, allocate a new stack using
1322 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1323 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1324 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1325 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1326 required. Return 1 if memory is exhausted. */
1328 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1330 char const *yydebug_prefix
,
1331 char const *yydebug_suffix
,
1333 yytype_int16
**yybottom
,
1334 yytype_int16
*yybottom_no_free
,
1335 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1337 YYSIZE_T yysize_old
=
1338 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1339 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1340 if (*yycapacity
< yysize_new
)
1342 YYSIZE_T yyalloc
= 2 * yysize_new
;
1343 yytype_int16
*yybottom_new
;
1344 /* Use YYMAXDEPTH for maximum stack size given that the stack
1345 should never need to grow larger than the main state stack
1346 needs to grow without LAC. */
1347 if (YYMAXDEPTH
< yysize_new
)
1349 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1353 if (YYMAXDEPTH
< yyalloc
)
1354 yyalloc
= YYMAXDEPTH
;
1356 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1359 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1363 if (*yytop
!= yytop_empty
)
1365 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1366 *yytop
= yybottom_new
+ (yysize_old
- 1);
1368 if (*yybottom
!= yybottom_no_free
)
1369 YYSTACK_FREE (*yybottom
);
1370 *yybottom
= yybottom_new
;
1371 *yycapacity
= yyalloc
;
1376 /* Establish the initial context for the current lookahead if no initial
1377 context is currently established.
1379 We define a context as a snapshot of the parser stacks. We define
1380 the initial context for a lookahead as the context in which the
1381 parser initially examines that lookahead in order to select a
1382 syntactic action. Thus, if the lookahead eventually proves
1383 syntactically unacceptable (possibly in a later context reached via a
1384 series of reductions), the initial context can be used to determine
1385 the exact set of tokens that would be syntactically acceptable in the
1386 lookahead's place. Moreover, it is the context after which any
1387 further semantic actions would be erroneous because they would be
1388 determined by a syntactically unacceptable token.
1390 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1391 performed in an inconsistent state (which, for the purposes of LAC,
1392 includes consistent states that don't know they're consistent because
1393 their default reductions have been disabled). Iff there is a
1394 lookahead token, it should also be invoked before reporting a syntax
1395 error. This latter case is for the sake of the debugging output.
1397 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1398 follows. If no initial context is currently established for the
1399 current lookahead, then check if that lookahead can eventually be
1400 shifted if syntactic actions continue from the current context.
1401 Report a syntax error if it cannot. */
1402 #define YY_LAC_ESTABLISH \
1404 if (!yy_lac_established) \
1406 YYDPRINTF ((stderr, \
1407 "LAC: initial context established for %s\n", \
1408 yytname[yytoken])); \
1409 yy_lac_established = 1; \
1411 int yy_lac_status = \
1412 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1413 if (yy_lac_status == 2) \
1414 goto yyexhaustedlab; \
1415 if (yy_lac_status == 1) \
1421 /* Discard any previous initial lookahead context because of Event,
1422 which may be a lookahead change or an invalidation of the currently
1423 established initial context for the current lookahead.
1425 The most common example of a lookahead change is a shift. An example
1426 of both cases is syntax error recovery. That is, a syntax error
1427 occurs when the lookahead is syntactically erroneous for the
1428 currently established initial context, so error recovery manipulates
1429 the parser stacks to try to find a new initial context in which the
1430 current lookahead is syntactically acceptable. If it fails to find
1431 such a context, it discards the lookahead. */
1433 # define YY_LAC_DISCARD(Event) \
1435 if (yy_lac_established) \
1438 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1440 yy_lac_established = 0; \
1444 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1447 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1448 eventually (after perhaps some reductions) be shifted, return 1 if
1449 not, or return 2 if memory is exhausted. As preconditions and
1450 postconditions: *YYES_CAPACITY is the allocated size of the array to
1451 which *YYES points, and either *YYES = YYESA or *YYES points to an
1452 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1453 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1454 any old *YYES other than YYESA. */
1456 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1457 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1459 yytype_int16
*yyes_prev
= yyssp
;
1460 yytype_int16
*yyesp
= yyes_prev
;
1461 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1462 if (yytoken
== YYUNDEFTOK
)
1464 YYDPRINTF ((stderr
, " Always Err\n"));
1469 int yyrule
= yypact
[*yyesp
];
1470 if (yypact_value_is_default (yyrule
)
1471 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1472 || yycheck
[yyrule
] != yytoken
)
1474 yyrule
= yydefact
[*yyesp
];
1477 YYDPRINTF ((stderr
, " Err\n"));
1483 yyrule
= yytable
[yyrule
];
1484 if (yytable_value_is_error (yyrule
))
1486 YYDPRINTF ((stderr
, " Err\n"));
1491 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1497 YYSIZE_T yylen
= yyr2
[yyrule
];
1498 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1499 if (yyesp
!= yyes_prev
)
1501 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1514 yyesp
= yyes_prev
-= yylen
;
1519 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1520 yystate
= yypgoto
[yylhs
] + *yyesp
;
1521 if (yystate
< 0 || YYLAST
< yystate
1522 || yycheck
[yystate
] != *yyesp
)
1523 yystate
= yydefgoto
[yylhs
];
1525 yystate
= yytable
[yystate
];
1527 if (yyesp
== yyes_prev
)
1534 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1538 yyes
, yyesa
, &yyesp
, yyes_prev
))
1540 YYDPRINTF ((stderr
, "\n"));
1545 YYDPRINTF ((stderr
, " G%d", yystate
));
1554 # if defined __GLIBC__ && defined _STRING_H
1555 # define yystrlen strlen
1557 /* Return the length of YYSTR. */
1559 yystrlen (const char *yystr
)
1562 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1570 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1571 # define yystpcpy stpcpy
1573 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1576 yystpcpy (char *yydest
, const char *yysrc
)
1579 const char *yys
= yysrc
;
1581 while ((*yyd
++ = *yys
++) != '\0')
1590 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1591 quotes and backslashes, so that it's suitable for yyerror. The
1592 heuristic is that double-quoting is unnecessary unless the string
1593 contains an apostrophe, a comma, or backslash (other than
1594 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1595 null, do not copy; instead, return the length of what the result
1598 yytnamerr (char *yyres
, const char *yystr
)
1603 char const *yyp
= yystr
;
1610 goto do_not_strip_quotes
;
1614 goto do_not_strip_quotes
;
1627 do_not_strip_quotes
: ;
1631 return yystrlen (yystr
);
1633 return yystpcpy (yyres
, yystr
) - yyres
;
1637 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1638 about the unexpected token YYTOKEN for the state stack whose top is
1639 YYSSP. In order to see if a particular token T is a
1640 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1642 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1643 not large enough to hold the message. In that case, also set
1644 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1645 required number of bytes is too large to store or if
1646 yy_lac returned 2. */
1648 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1649 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1650 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1652 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1653 YYSIZE_T yysize
= yysize0
;
1654 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1655 /* Internationalized format string. */
1656 const char *yyformat
= YY_NULL
;
1657 /* Arguments of yyformat. */
1658 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1659 /* Number of reported tokens (one for the "unexpected", one per
1663 /* There are many possibilities here to consider:
1664 - If this state is a consistent state with a default action, then
1665 the only way this function was invoked is if the default action
1666 is an error action. In that case, don't check for expected
1667 tokens because there are none.
1668 - The only way there can be no lookahead present (in yychar) is if
1669 this state is a consistent state with a default action. Thus,
1670 detecting the absence of a lookahead is sufficient to determine
1671 that there is no unexpected or expected token to report. In that
1672 case, just report a simple "syntax error".
1673 - Don't assume there isn't a lookahead just because this state is a
1674 consistent state with a default action. There might have been a
1675 previous inconsistent state, consistent state with a non-default
1676 action, or user semantic action that manipulated yychar.
1677 In the first two cases, it might appear that the current syntax
1678 error should have been detected in the previous state when yy_lac
1679 was invoked. However, at that time, there might have been a
1680 different syntax error that discarded a different initial context
1681 during error recovery, leaving behind the current lookahead.
1683 if (yytoken
!= YYEMPTY
)
1685 int yyn
= yypact
[*yyssp
];
1686 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1687 yyarg
[yycount
++] = yytname
[yytoken
];
1688 if (!yypact_value_is_default (yyn
))
1692 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1693 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1696 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1698 if (yy_lac_status
== 2)
1700 if (yy_lac_status
== 1)
1703 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1709 yyarg
[yycount
++] = yytname
[yyx
];
1711 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1712 if (! (yysize
<= yysize1
1713 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1721 YYFPRINTF (stderr
, "No expected tokens.\n");
1727 # define YYCASE_(N, S) \
1731 YYCASE_(0, YY_("syntax error"));
1732 YYCASE_(1, YY_("syntax error, unexpected %s"));
1733 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1734 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1735 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1736 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1741 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1742 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1747 if (*yymsg_alloc
< yysize
)
1749 *yymsg_alloc
= 2 * yysize
;
1750 if (! (yysize
<= *yymsg_alloc
1751 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1752 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1756 /* Avoid sprintf, as that infringes on the user's name space.
1757 Don't have undefined behavior even if the translation
1758 produced a string with the wrong number of "%s"s. */
1762 while ((*yyp
= *yyformat
) != '\0')
1763 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1765 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1776 #endif /* YYERROR_VERBOSE */
1778 /*-----------------------------------------------.
1779 | Release the memory associated to this symbol. |
1780 `-----------------------------------------------*/
1783 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1786 YYUSE (yylocationp
);
1789 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1808 /* The lookahead symbol. */
1812 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1813 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1814 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1815 _Pragma ("GCC diagnostic push") \
1816 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1817 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1818 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1819 _Pragma ("GCC diagnostic pop")
1821 /* Default value used for initialization, for pacifying older GCCs
1822 or non-GCC compilers. */
1823 static YYSTYPE yyval_default
;
1824 # define YY_INITIAL_VALUE(Value) = Value
1826 static YYLTYPE yyloc_default
1827 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
1831 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1832 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1833 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1835 #ifndef YY_INITIAL_VALUE
1836 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1839 /* The semantic value of the lookahead symbol. */
1840 YYSTYPE yylval
YY_INITIAL_VALUE(yyval_default
);
1842 /* Location data for the lookahead symbol. */
1843 YYLTYPE yylloc
= yyloc_default
;
1846 /* Number of syntax errors so far. */
1850 /* Number of tokens to shift before error messages enabled. */
1853 /* The stacks and their tools:
1854 `yyss': related to states.
1855 `yyvs': related to semantic values.
1856 `yyls': related to locations.
1858 Refer to the stacks through separate pointers, to allow yyoverflow
1859 to reallocate them elsewhere. */
1861 /* The state stack. */
1862 yytype_int16 yyssa
[YYINITDEPTH
];
1864 yytype_int16
*yyssp
;
1866 /* The semantic value stack. */
1867 YYSTYPE yyvsa
[YYINITDEPTH
];
1871 /* The location stack. */
1872 YYLTYPE yylsa
[YYINITDEPTH
];
1876 /* The locations where the error started and ended. */
1877 YYLTYPE yyerror_range
[3];
1879 YYSIZE_T yystacksize
;
1881 yytype_int16 yyesa
[20];
1883 YYSIZE_T yyes_capacity
;
1885 int yy_lac_established
= 0;
1888 /* Lookahead token as an internal (translated) token number. */
1890 /* The variables used to return semantic value and location from the
1896 /* Buffer for error messages, and its allocated size. */
1898 char *yymsg
= yymsgbuf
;
1899 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1902 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1904 /* The number of symbols on the RHS of the reduced rule.
1905 Keep to zero when no symbol should be popped. */
1908 yyssp
= yyss
= yyssa
;
1909 yyvsp
= yyvs
= yyvsa
;
1910 yylsp
= yyls
= yylsa
;
1911 yystacksize
= YYINITDEPTH
;
1914 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1915 if (YYMAXDEPTH
< yyes_capacity
)
1916 yyes_capacity
= YYMAXDEPTH
;
1918 YYDPRINTF ((stderr
, "Starting parse\n"));
1923 yychar
= YYEMPTY
; /* Cause a token to be read. */
1925 /* User initialization code. */
1926 /* Line 1450 of yacc.c */
1927 #line 101 "src/parse-gram.y"
1929 /* Bison's grammar can initial empty locations, hence a default
1930 location is needed. */
1931 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1932 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1934 /* Line 1450 of yacc.c */
1935 #line 1936 "src/parse-gram.c"
1939 /*------------------------------------------------------------.
1940 | yynewstate -- Push a new state, which is found in yystate. |
1941 `------------------------------------------------------------*/
1943 /* In all cases, when you get here, the value and location stacks
1944 have just been pushed. So pushing a state here evens the stacks. */
1950 if (yyss
+ yystacksize
- 1 <= yyssp
)
1952 /* Get the current used size of the three stacks, in elements. */
1953 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1957 /* Give user a chance to reallocate the stack. Use copies of
1958 these so that the &'s don't force the real ones into
1960 YYSTYPE
*yyvs1
= yyvs
;
1961 yytype_int16
*yyss1
= yyss
;
1962 YYLTYPE
*yyls1
= yyls
;
1964 /* Each stack pointer address is followed by the size of the
1965 data in use in that stack, in bytes. This used to be a
1966 conditional around just the two extra args, but that might
1967 be undefined if yyoverflow is a macro. */
1968 yyoverflow (YY_("memory exhausted"),
1969 &yyss1
, yysize
* sizeof (*yyssp
),
1970 &yyvs1
, yysize
* sizeof (*yyvsp
),
1971 &yyls1
, yysize
* sizeof (*yylsp
),
1978 #else /* no yyoverflow */
1979 # ifndef YYSTACK_RELOCATE
1980 goto yyexhaustedlab
;
1982 /* Extend the stack our own way. */
1983 if (YYMAXDEPTH
<= yystacksize
)
1984 goto yyexhaustedlab
;
1986 if (YYMAXDEPTH
< yystacksize
)
1987 yystacksize
= YYMAXDEPTH
;
1990 yytype_int16
*yyss1
= yyss
;
1991 union yyalloc
*yyptr
=
1992 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1994 goto yyexhaustedlab
;
1995 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1996 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1997 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1998 # undef YYSTACK_RELOCATE
2000 YYSTACK_FREE (yyss1
);
2003 #endif /* no yyoverflow */
2005 yyssp
= yyss
+ yysize
- 1;
2006 yyvsp
= yyvs
+ yysize
- 1;
2007 yylsp
= yyls
+ yysize
- 1;
2009 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2010 (unsigned long int) yystacksize
));
2012 if (yyss
+ yystacksize
- 1 <= yyssp
)
2016 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2018 if (yystate
== YYFINAL
)
2028 /* Do appropriate processing given the current state. Read a
2029 lookahead token if we need one and don't already have one. */
2031 /* First try to decide what to do without reference to lookahead token. */
2032 yyn
= yypact
[yystate
];
2033 if (yypact_value_is_default (yyn
))
2036 /* Not known => get a lookahead token if don't already have one. */
2038 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2039 if (yychar
== YYEMPTY
)
2041 YYDPRINTF ((stderr
, "Reading a token: "));
2042 yychar
= yylex (&yylval
, &yylloc
);
2045 if (yychar
<= YYEOF
)
2047 yychar
= yytoken
= YYEOF
;
2048 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2052 yytoken
= YYTRANSLATE (yychar
);
2053 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2056 /* If the proper action on seeing token YYTOKEN is to reduce or to
2057 detect an error, take that action. */
2059 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2067 if (yytable_value_is_error (yyn
))
2074 /* Count tokens shifted since error; after three, turn off error
2079 /* Shift the lookahead token. */
2080 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2082 /* Discard the shifted token. */
2084 YY_LAC_DISCARD ("shift");
2087 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2089 YY_IGNORE_MAYBE_UNINITIALIZED_END
2094 /*-----------------------------------------------------------.
2095 | yydefault -- do the default action for the current state. |
2096 `-----------------------------------------------------------*/
2098 yyn
= yydefact
[yystate
];
2104 /*-----------------------------.
2105 | yyreduce -- Do a reduction. |
2106 `-----------------------------*/
2108 /* yyn is the number of a rule to reduce with. */
2111 /* If YYLEN is nonzero, implement the default value of the action:
2114 Otherwise, the following line sets YYVAL to garbage.
2115 This behavior is undocumented and Bison
2116 users should not rely upon it. Assigning to YYVAL
2117 unconditionally makes the parser a bit smaller, and it avoids a
2118 GCC warning that YYVAL may be used uninitialized. */
2119 yyval
= yyvsp
[1-yylen
];
2121 /* Default location. */
2122 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2123 YY_REDUCE_PRINT (yyn
);
2125 int yychar_backup
= yychar
;
2129 /* Line 1667 of yacc.c */
2130 #line 288 "src/parse-gram.y"
2132 code_props plain_code
;
2133 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2134 code_props_translate_code (&plain_code
);
2135 gram_scanner_last_string_free ();
2136 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2137 plain_code
.code
, (yylsp
[0]));
2138 code_scanner_last_string_free ();
2140 /* Line 1667 of yacc.c */
2141 #line 2142 "src/parse-gram.c"
2145 /* Line 1667 of yacc.c */
2146 #line 298 "src/parse-gram.y"
2148 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2150 /* Line 1667 of yacc.c */
2151 #line 2152 "src/parse-gram.c"
2155 /* Line 1667 of yacc.c */
2156 #line 302 "src/parse-gram.y"
2158 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2159 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2161 /* Line 1667 of yacc.c */
2162 #line 2163 "src/parse-gram.c"
2166 /* Line 1667 of yacc.c */
2167 #line 306 "src/parse-gram.y"
2168 { defines_flag
= true; }
2169 /* Line 1667 of yacc.c */
2170 #line 2171 "src/parse-gram.c"
2174 /* Line 1667 of yacc.c */
2175 #line 308 "src/parse-gram.y"
2177 defines_flag
= true;
2178 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2180 /* Line 1667 of yacc.c */
2181 #line 2182 "src/parse-gram.c"
2185 /* Line 1667 of yacc.c */
2186 #line 313 "src/parse-gram.y"
2188 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2189 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2191 /* Line 1667 of yacc.c */
2192 #line 2193 "src/parse-gram.c"
2196 /* Line 1667 of yacc.c */
2197 #line 317 "src/parse-gram.y"
2198 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2199 /* Line 1667 of yacc.c */
2200 #line 2201 "src/parse-gram.c"
2204 /* Line 1667 of yacc.c */
2205 #line 318 "src/parse-gram.y"
2206 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2207 /* Line 1667 of yacc.c */
2208 #line 2209 "src/parse-gram.c"
2212 /* Line 1667 of yacc.c */
2213 #line 319 "src/parse-gram.y"
2214 { spec_file_prefix
= (yyvsp
[0].chars
); }
2215 /* Line 1667 of yacc.c */
2216 #line 2217 "src/parse-gram.c"
2220 /* Line 1667 of yacc.c */
2221 #line 321 "src/parse-gram.y"
2223 nondeterministic_parser
= true;
2226 /* Line 1667 of yacc.c */
2227 #line 2228 "src/parse-gram.c"
2231 /* Line 1667 of yacc.c */
2232 #line 326 "src/parse-gram.y"
2235 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2236 code_props_translate_code (&action
);
2237 gram_scanner_last_string_free ();
2238 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2239 code_scanner_last_string_free ();
2241 /* Line 1667 of yacc.c */
2242 #line 2243 "src/parse-gram.c"
2246 /* Line 1667 of yacc.c */
2247 #line 334 "src/parse-gram.y"
2248 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2249 /* Line 1667 of yacc.c */
2250 #line 2251 "src/parse-gram.c"
2254 /* Line 1667 of yacc.c */
2255 #line 335 "src/parse-gram.y"
2256 { spec_name_prefix
= (yyvsp
[0].chars
); }
2257 /* Line 1667 of yacc.c */
2258 #line 2259 "src/parse-gram.c"
2262 /* Line 1667 of yacc.c */
2263 #line 336 "src/parse-gram.y"
2264 { no_lines_flag
= true; }
2265 /* Line 1667 of yacc.c */
2266 #line 2267 "src/parse-gram.c"
2270 /* Line 1667 of yacc.c */
2271 #line 337 "src/parse-gram.y"
2272 { nondeterministic_parser
= true; }
2273 /* Line 1667 of yacc.c */
2274 #line 2275 "src/parse-gram.c"
2278 /* Line 1667 of yacc.c */
2279 #line 338 "src/parse-gram.y"
2280 { spec_outfile
= (yyvsp
[0].chars
); }
2281 /* Line 1667 of yacc.c */
2282 #line 2283 "src/parse-gram.c"
2286 /* Line 1667 of yacc.c */
2287 #line 339 "src/parse-gram.y"
2288 { current_param
= (yyvsp
[0].param
); }
2289 /* Line 1667 of yacc.c */
2290 #line 2291 "src/parse-gram.c"
2294 /* Line 1667 of yacc.c */
2295 #line 339 "src/parse-gram.y"
2296 { current_param
= param_none
; }
2297 /* Line 1667 of yacc.c */
2298 #line 2299 "src/parse-gram.c"
2302 /* Line 1667 of yacc.c */
2303 #line 340 "src/parse-gram.y"
2304 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2305 /* Line 1667 of yacc.c */
2306 #line 2307 "src/parse-gram.c"
2310 /* Line 1667 of yacc.c */
2311 #line 342 "src/parse-gram.y"
2313 char const *skeleton_user
= (yyvsp
[0].chars
);
2314 if (strchr (skeleton_user
, '/'))
2316 size_t dir_length
= strlen (current_file
);
2317 char *skeleton_build
;
2318 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2320 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2323 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2326 memcpy (skeleton_build
, current_file
, dir_length
);
2327 skeleton_build
[dir_length
++] = '/';
2329 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2330 skeleton_user
= uniqstr_new (skeleton_build
);
2331 free (skeleton_build
);
2333 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2335 /* Line 1667 of yacc.c */
2336 #line 2337 "src/parse-gram.c"
2340 /* Line 1667 of yacc.c */
2341 #line 365 "src/parse-gram.y"
2342 { token_table_flag
= true; }
2343 /* Line 1667 of yacc.c */
2344 #line 2345 "src/parse-gram.c"
2348 /* Line 1667 of yacc.c */
2349 #line 366 "src/parse-gram.y"
2350 { report_flag
|= report_states
; }
2351 /* Line 1667 of yacc.c */
2352 #line 2353 "src/parse-gram.c"
2356 /* Line 1667 of yacc.c */
2357 #line 367 "src/parse-gram.y"
2358 { yacc_flag
= true; }
2359 /* Line 1667 of yacc.c */
2360 #line 2361 "src/parse-gram.c"
2364 /* Line 1667 of yacc.c */
2365 #line 372 "src/parse-gram.y"
2366 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2367 /* Line 1667 of yacc.c */
2368 #line 2369 "src/parse-gram.c"
2372 /* Line 1667 of yacc.c */
2373 #line 373 "src/parse-gram.y"
2374 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2375 /* Line 1667 of yacc.c */
2376 #line 2377 "src/parse-gram.c"
2380 /* Line 1667 of yacc.c */
2381 #line 385 "src/parse-gram.y"
2383 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2385 /* Line 1667 of yacc.c */
2386 #line 2387 "src/parse-gram.c"
2390 /* Line 1667 of yacc.c */
2391 #line 389 "src/parse-gram.y"
2394 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2395 code_props_translate_code (&code
);
2398 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2399 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2400 symbol_list_free ((yyvsp
[0].list
));
2403 /* Line 1667 of yacc.c */
2404 #line 2405 "src/parse-gram.c"
2408 /* Line 1667 of yacc.c */
2409 #line 401 "src/parse-gram.y"
2411 default_prec
= true;
2413 /* Line 1667 of yacc.c */
2414 #line 2415 "src/parse-gram.c"
2418 /* Line 1667 of yacc.c */
2419 #line 405 "src/parse-gram.y"
2421 default_prec
= false;
2423 /* Line 1667 of yacc.c */
2424 #line 2425 "src/parse-gram.c"
2428 /* Line 1667 of yacc.c */
2429 #line 409 "src/parse-gram.y"
2431 /* Do not invoke muscle_percent_code_grow here since it invokes
2432 muscle_user_name_list_grow. */
2433 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2434 code_scanner_last_string_free ();
2436 /* Line 1667 of yacc.c */
2437 #line 2438 "src/parse-gram.c"
2441 /* Line 1667 of yacc.c */
2442 #line 416 "src/parse-gram.y"
2444 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2445 code_scanner_last_string_free ();
2447 /* Line 1667 of yacc.c */
2448 #line 2449 "src/parse-gram.c"
2452 /* Line 1667 of yacc.c */
2453 #line 426 "src/parse-gram.y"
2454 { (yyval
.code_type
) = destructor
; }
2455 /* Line 1667 of yacc.c */
2456 #line 2457 "src/parse-gram.c"
2460 /* Line 1667 of yacc.c */
2461 #line 427 "src/parse-gram.y"
2462 { (yyval
.code_type
) = printer
; }
2463 /* Line 1667 of yacc.c */
2464 #line 2465 "src/parse-gram.c"
2468 /* Line 1667 of yacc.c */
2469 #line 437 "src/parse-gram.y"
2471 /* Line 1667 of yacc.c */
2472 #line 2473 "src/parse-gram.c"
2476 /* Line 1667 of yacc.c */
2477 #line 438 "src/parse-gram.y"
2478 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2479 /* Line 1667 of yacc.c */
2480 #line 2481 "src/parse-gram.c"
2484 /* Line 1667 of yacc.c */
2485 #line 443 "src/parse-gram.y"
2488 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2489 code_scanner_last_string_free ();
2491 /* Line 1667 of yacc.c */
2492 #line 2493 "src/parse-gram.c"
2496 /* Line 1667 of yacc.c */
2497 #line 454 "src/parse-gram.y"
2498 { current_class
= nterm_sym
; }
2499 /* Line 1667 of yacc.c */
2500 #line 2501 "src/parse-gram.c"
2504 /* Line 1667 of yacc.c */
2505 #line 455 "src/parse-gram.y"
2507 current_class
= unknown_sym
;
2508 current_type
= NULL
;
2510 /* Line 1667 of yacc.c */
2511 #line 2512 "src/parse-gram.c"
2515 /* Line 1667 of yacc.c */
2516 #line 459 "src/parse-gram.y"
2517 { current_class
= token_sym
; }
2518 /* Line 1667 of yacc.c */
2519 #line 2520 "src/parse-gram.c"
2523 /* Line 1667 of yacc.c */
2524 #line 460 "src/parse-gram.y"
2526 current_class
= unknown_sym
;
2527 current_type
= NULL
;
2529 /* Line 1667 of yacc.c */
2530 #line 2531 "src/parse-gram.c"
2534 /* Line 1667 of yacc.c */
2535 #line 465 "src/parse-gram.y"
2539 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2540 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2541 symbol_list_free ((yyvsp
[0].list
));
2543 /* Line 1667 of yacc.c */
2544 #line 2545 "src/parse-gram.c"
2548 /* Line 1667 of yacc.c */
2549 #line 476 "src/parse-gram.y"
2553 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2555 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2556 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2558 symbol_list_free ((yyvsp
[0].list
));
2559 current_type
= NULL
;
2561 /* Line 1667 of yacc.c */
2562 #line 2563 "src/parse-gram.c"
2566 /* Line 1667 of yacc.c */
2567 #line 490 "src/parse-gram.y"
2568 { (yyval
.assoc
) = left_assoc
; }
2569 /* Line 1667 of yacc.c */
2570 #line 2571 "src/parse-gram.c"
2574 /* Line 1667 of yacc.c */
2575 #line 491 "src/parse-gram.y"
2576 { (yyval
.assoc
) = right_assoc
; }
2577 /* Line 1667 of yacc.c */
2578 #line 2579 "src/parse-gram.c"
2582 /* Line 1667 of yacc.c */
2583 #line 492 "src/parse-gram.y"
2584 { (yyval
.assoc
) = non_assoc
; }
2585 /* Line 1667 of yacc.c */
2586 #line 2587 "src/parse-gram.c"
2590 /* Line 1667 of yacc.c */
2591 #line 493 "src/parse-gram.y"
2592 { (yyval
.assoc
) = precedence_assoc
; }
2593 /* Line 1667 of yacc.c */
2594 #line 2595 "src/parse-gram.c"
2598 /* Line 1667 of yacc.c */
2599 #line 497 "src/parse-gram.y"
2600 { current_type
= NULL
; }
2601 /* Line 1667 of yacc.c */
2602 #line 2603 "src/parse-gram.c"
2606 /* Line 1667 of yacc.c */
2607 #line 498 "src/parse-gram.y"
2608 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2609 /* Line 1667 of yacc.c */
2610 #line 2611 "src/parse-gram.c"
2614 /* Line 1667 of yacc.c */
2615 #line 504 "src/parse-gram.y"
2616 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2617 /* Line 1667 of yacc.c */
2618 #line 2619 "src/parse-gram.c"
2622 /* Line 1667 of yacc.c */
2623 #line 506 "src/parse-gram.y"
2624 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2625 /* Line 1667 of yacc.c */
2626 #line 2627 "src/parse-gram.c"
2630 /* Line 1667 of yacc.c */
2631 #line 510 "src/parse-gram.y"
2632 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2633 /* Line 1667 of yacc.c */
2634 #line 2635 "src/parse-gram.c"
2638 /* Line 1667 of yacc.c */
2639 #line 511 "src/parse-gram.y"
2640 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2641 /* Line 1667 of yacc.c */
2642 #line 2643 "src/parse-gram.c"
2646 /* Line 1667 of yacc.c */
2647 #line 517 "src/parse-gram.y"
2648 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2649 /* Line 1667 of yacc.c */
2650 #line 2651 "src/parse-gram.c"
2654 /* Line 1667 of yacc.c */
2655 #line 519 "src/parse-gram.y"
2656 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2657 /* Line 1667 of yacc.c */
2658 #line 2659 "src/parse-gram.c"
2662 /* Line 1667 of yacc.c */
2663 #line 523 "src/parse-gram.y"
2664 { (yyval
.list
) = (yyvsp
[0].list
); }
2665 /* Line 1667 of yacc.c */
2666 #line 2667 "src/parse-gram.c"
2670 /* Line 1667 of yacc.c */
2671 #line 524 "src/parse-gram.y"
2672 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2673 /* Line 1667 of yacc.c */
2674 #line 2675 "src/parse-gram.c"
2678 /* Line 1667 of yacc.c */
2679 #line 528 "src/parse-gram.y"
2680 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2681 /* Line 1667 of yacc.c */
2682 #line 2683 "src/parse-gram.c"
2686 /* Line 1667 of yacc.c */
2687 #line 529 "src/parse-gram.y"
2688 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2689 /* Line 1667 of yacc.c */
2690 #line 2691 "src/parse-gram.c"
2694 /* Line 1667 of yacc.c */
2695 #line 534 "src/parse-gram.y"
2696 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2697 /* Line 1667 of yacc.c */
2698 #line 2699 "src/parse-gram.c"
2702 /* Line 1667 of yacc.c */
2703 #line 535 "src/parse-gram.y"
2704 { (yyval
.uniqstr
) = uniqstr_new (""); }
2705 /* Line 1667 of yacc.c */
2706 #line 2707 "src/parse-gram.c"
2710 /* Line 1667 of yacc.c */
2711 #line 541 "src/parse-gram.y"
2713 current_type
= (yyvsp
[0].uniqstr
);
2716 /* Line 1667 of yacc.c */
2717 #line 2718 "src/parse-gram.c"
2721 /* Line 1667 of yacc.c */
2722 #line 546 "src/parse-gram.y"
2724 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2725 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2727 /* Line 1667 of yacc.c */
2728 #line 2729 "src/parse-gram.c"
2732 /* Line 1667 of yacc.c */
2733 #line 551 "src/parse-gram.y"
2735 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2736 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2737 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2739 /* Line 1667 of yacc.c */
2740 #line 2741 "src/parse-gram.c"
2744 /* Line 1667 of yacc.c */
2745 #line 557 "src/parse-gram.y"
2747 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2748 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2749 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2751 /* Line 1667 of yacc.c */
2752 #line 2753 "src/parse-gram.c"
2756 /* Line 1667 of yacc.c */
2757 #line 563 "src/parse-gram.y"
2759 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2760 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2761 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2762 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2764 /* Line 1667 of yacc.c */
2765 #line 2766 "src/parse-gram.c"
2769 /* Line 1667 of yacc.c */
2770 #line 593 "src/parse-gram.y"
2774 /* Line 1667 of yacc.c */
2775 #line 2776 "src/parse-gram.c"
2779 /* Line 1667 of yacc.c */
2780 #line 599 "src/parse-gram.y"
2781 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2782 /* Line 1667 of yacc.c */
2783 #line 2784 "src/parse-gram.c"
2787 /* Line 1667 of yacc.c */
2788 #line 600 "src/parse-gram.y"
2790 /* Free the current lhs. */
2791 current_lhs (0, (yylsp
[-3]), 0);
2793 /* Line 1667 of yacc.c */
2794 #line 2795 "src/parse-gram.c"
2798 /* Line 1667 of yacc.c */
2799 #line 607 "src/parse-gram.y"
2800 { grammar_current_rule_end ((yylsp
[0])); }
2801 /* Line 1667 of yacc.c */
2802 #line 2803 "src/parse-gram.c"
2806 /* Line 1667 of yacc.c */
2807 #line 608 "src/parse-gram.y"
2808 { grammar_current_rule_end ((yylsp
[0])); }
2809 /* Line 1667 of yacc.c */
2810 #line 2811 "src/parse-gram.c"
2814 /* Line 1667 of yacc.c */
2815 #line 614 "src/parse-gram.y"
2816 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2817 current_lhs_named_ref
); }
2818 /* Line 1667 of yacc.c */
2819 #line 2820 "src/parse-gram.c"
2823 /* Line 1667 of yacc.c */
2824 #line 617 "src/parse-gram.y"
2825 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2826 /* Line 1667 of yacc.c */
2827 #line 2828 "src/parse-gram.c"
2831 /* Line 1667 of yacc.c */
2832 #line 619 "src/parse-gram.y"
2833 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2834 /* Line 1667 of yacc.c */
2835 #line 2836 "src/parse-gram.c"
2839 /* Line 1667 of yacc.c */
2840 #line 621 "src/parse-gram.y"
2841 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2842 /* Line 1667 of yacc.c */
2843 #line 2844 "src/parse-gram.c"
2847 /* Line 1667 of yacc.c */
2848 #line 623 "src/parse-gram.y"
2849 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2850 /* Line 1667 of yacc.c */
2851 #line 2852 "src/parse-gram.c"
2855 /* Line 1667 of yacc.c */
2856 #line 625 "src/parse-gram.y"
2857 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2858 /* Line 1667 of yacc.c */
2859 #line 2860 "src/parse-gram.c"
2863 /* Line 1667 of yacc.c */
2864 #line 627 "src/parse-gram.y"
2865 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2866 /* Line 1667 of yacc.c */
2867 #line 2868 "src/parse-gram.c"
2871 /* Line 1667 of yacc.c */
2872 #line 631 "src/parse-gram.y"
2873 { (yyval
.named_ref
) = 0; }
2874 /* Line 1667 of yacc.c */
2875 #line 2876 "src/parse-gram.c"
2879 /* Line 1667 of yacc.c */
2880 #line 633 "src/parse-gram.y"
2881 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2882 /* Line 1667 of yacc.c */
2883 #line 2884 "src/parse-gram.c"
2887 /* Line 1667 of yacc.c */
2888 #line 644 "src/parse-gram.y"
2889 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2890 /* Line 1667 of yacc.c */
2891 #line 2892 "src/parse-gram.c"
2895 /* Line 1667 of yacc.c */
2896 #line 649 "src/parse-gram.y"
2897 { (yyval
.chars
) = ""; }
2898 /* Line 1667 of yacc.c */
2899 #line 2900 "src/parse-gram.c"
2903 /* Line 1667 of yacc.c */
2904 #line 650 "src/parse-gram.y"
2905 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2906 /* Line 1667 of yacc.c */
2907 #line 2908 "src/parse-gram.c"
2911 /* Line 1667 of yacc.c */
2912 #line 661 "src/parse-gram.y"
2914 code_props plain_code
;
2915 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2916 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2917 code_props_translate_code (&plain_code
);
2918 gram_scanner_last_string_free ();
2919 (yyval
.chars
) = plain_code
.code
;
2921 /* Line 1667 of yacc.c */
2922 #line 2923 "src/parse-gram.c"
2926 /* Line 1667 of yacc.c */
2927 #line 681 "src/parse-gram.y"
2928 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2929 /* Line 1667 of yacc.c */
2930 #line 2931 "src/parse-gram.c"
2934 /* Line 1667 of yacc.c */
2935 #line 683 "src/parse-gram.y"
2937 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2938 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2939 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2941 /* Line 1667 of yacc.c */
2942 #line 2943 "src/parse-gram.c"
2946 /* Line 1667 of yacc.c */
2947 #line 691 "src/parse-gram.y"
2948 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2949 /* Line 1667 of yacc.c */
2950 #line 2951 "src/parse-gram.c"
2954 /* Line 1667 of yacc.c */
2955 #line 703 "src/parse-gram.y"
2957 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2958 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2960 /* Line 1667 of yacc.c */
2961 #line 2962 "src/parse-gram.c"
2965 /* Line 1667 of yacc.c */
2966 #line 712 "src/parse-gram.y"
2968 code_props plain_code
;
2969 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2970 code_props_translate_code (&plain_code
);
2971 gram_scanner_last_string_free ();
2972 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2973 code_scanner_last_string_free ();
2975 /* Line 1667 of yacc.c */
2976 #line 2977 "src/parse-gram.c"
2980 /* Line 1667 of yacc.c */
2981 #line 2982 "src/parse-gram.c"
2984 if (yychar_backup
!= yychar
)
2985 YY_LAC_DISCARD ("yychar change");
2987 /* User semantic actions sometimes alter yychar, and that requires
2988 that yytoken be updated with the new translation. We take the
2989 approach of translating immediately before every use of yytoken.
2990 One alternative is translating here after every semantic action,
2991 but that translation would be missed if the semantic action invokes
2992 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2993 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2994 incorrect destructor might then be invoked immediately. In the
2995 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2996 to an incorrect destructor call or verbose syntax error message
2997 before the lookahead is translated. */
2998 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3002 YY_STACK_PRINT (yyss
, yyssp
);
3007 /* Now `shift' the result of the reduction. Determine what state
3008 that goes to, based on the state we popped back to and the rule
3009 number reduced by. */
3013 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3014 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3015 yystate
= yytable
[yystate
];
3017 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3022 /*--------------------------------------.
3023 | yyerrlab -- here on detecting error. |
3024 `--------------------------------------*/
3026 /* Make sure we have latest lookahead translation. See comments at
3027 user semantic actions for why this is necessary. */
3028 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3030 /* If not already recovering from an error, report this error. */
3034 #if ! YYERROR_VERBOSE
3035 yyerror (YY_("syntax error"));
3037 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3038 yyesa, &yyes, &yyes_capacity, \
3041 char const *yymsgp
= YY_("syntax error");
3042 int yysyntax_error_status
;
3043 if (yychar
!= YYEMPTY
)
3045 yysyntax_error_status
= YYSYNTAX_ERROR
;
3046 if (yysyntax_error_status
== 0)
3048 else if (yysyntax_error_status
== 1)
3050 if (yymsg
!= yymsgbuf
)
3051 YYSTACK_FREE (yymsg
);
3052 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3056 yymsg_alloc
= sizeof yymsgbuf
;
3057 yysyntax_error_status
= 2;
3061 yysyntax_error_status
= YYSYNTAX_ERROR
;
3066 if (yysyntax_error_status
== 2)
3067 goto yyexhaustedlab
;
3069 # undef YYSYNTAX_ERROR
3073 yyerror_range
[1] = yylloc
;
3075 if (yyerrstatus
== 3)
3077 /* If just tried and failed to reuse lookahead token after an
3078 error, discard it. */
3080 if (yychar
<= YYEOF
)
3082 /* Return failure if at end of input. */
3083 if (yychar
== YYEOF
)
3088 yydestruct ("Error: discarding",
3089 yytoken
, &yylval
, &yylloc
);
3094 /* Else will try to reuse lookahead token after shifting the error
3099 /*---------------------------------------------------.
3100 | yyerrorlab -- error raised explicitly by YYERROR. |
3101 `---------------------------------------------------*/
3104 /* Pacify compilers like GCC when the user code never invokes
3105 YYERROR and the label yyerrorlab therefore never appears in user
3107 if (/*CONSTCOND*/ 0)
3110 yyerror_range
[1] = yylsp
[1-yylen
];
3111 /* Do not reclaim the symbols of the rule whose action triggered
3115 YY_STACK_PRINT (yyss
, yyssp
);
3120 /*-------------------------------------------------------------.
3121 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3122 `-------------------------------------------------------------*/
3124 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3128 yyn
= yypact
[yystate
];
3129 if (!yypact_value_is_default (yyn
))
3132 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3140 /* Pop the current state because it cannot handle the error token. */
3144 yyerror_range
[1] = *yylsp
;
3145 yydestruct ("Error: popping",
3146 yystos
[yystate
], yyvsp
, yylsp
);
3149 YY_STACK_PRINT (yyss
, yyssp
);
3152 /* If the stack popping above didn't lose the initial context for the
3153 current lookahead token, the shift below will for sure. */
3154 YY_LAC_DISCARD ("error recovery");
3156 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3158 YY_IGNORE_MAYBE_UNINITIALIZED_END
3160 yyerror_range
[2] = yylloc
;
3161 /* Using YYLLOC is tempting, but would change the location of
3162 the lookahead. YYLOC is available though. */
3163 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3166 /* Shift the error token. */
3167 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3173 /*-------------------------------------.
3174 | yyacceptlab -- YYACCEPT comes here. |
3175 `-------------------------------------*/
3180 /*-----------------------------------.
3181 | yyabortlab -- YYABORT comes here. |
3182 `-----------------------------------*/
3188 /*-------------------------------------------------.
3189 | yyexhaustedlab -- memory exhaustion comes here. |
3190 `-------------------------------------------------*/
3192 yyerror (YY_("memory exhausted"));
3198 if (yychar
!= YYEMPTY
)
3200 /* Make sure we have latest lookahead translation. See comments at
3201 user semantic actions for why this is necessary. */
3202 yytoken
= YYTRANSLATE (yychar
);
3203 yydestruct ("Cleanup: discarding lookahead",
3204 yytoken
, &yylval
, &yylloc
);
3206 /* Do not reclaim the symbols of the rule whose action triggered
3207 this YYABORT or YYACCEPT. */
3209 YY_STACK_PRINT (yyss
, yyssp
);
3210 while (yyssp
!= yyss
)
3212 yydestruct ("Cleanup: popping",
3213 yystos
[*yyssp
], yyvsp
, yylsp
);
3218 YYSTACK_FREE (yyss
);
3221 YYSTACK_FREE (yyes
);
3223 if (yymsg
!= yymsgbuf
)
3224 YYSTACK_FREE (yymsg
);
3228 /* Line 1927 of yacc.c */
3229 #line 722 "src/parse-gram.y"
3232 /* Return the location of the left-hand side of a rule whose
3233 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3234 the right-hand side, and return an empty location equal to the end
3235 boundary of RHS[0] if the right-hand side is empty. */
3238 lloc_default (YYLTYPE
const *rhs
, int n
)
3243 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3244 The bug is fixed in 7.4.2m, but play it safe for now. */
3245 loc
.start
= rhs
[n
].end
;
3246 loc
.end
= rhs
[n
].end
;
3248 /* Ignore empty nonterminals the start of the right-hand side.
3249 Do not bother to ignore them at the end of the right-hand side,
3250 since empty nonterminals have the same end as their predecessors. */
3251 for (i
= 1; i
<= n
; i
++)
3252 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3254 loc
.start
= rhs
[i
].start
;
3263 add_param (param_type type
, char *decl
, location loc
)
3265 static char const alphanum
[26 + 26 + 1 + 10] =
3266 "abcdefghijklmnopqrstuvwxyz"
3267 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3271 char const *name_start
= NULL
;
3274 /* Stop on last actual character. */
3275 for (p
= decl
; p
[1]; p
++)
3277 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3278 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3281 /* Strip the surrounding '{' and '}', and any blanks just inside
3284 while (c_isspace ((unsigned char) *p
))
3288 while (c_isspace ((unsigned char) *decl
))
3293 complain (&loc
, complaint
, _("missing identifier in parameter declaration"));
3296 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3297 if (type
& param_lex
)
3298 muscle_pair_list_grow ("lex_param", decl
, name
);
3299 if (type
& param_parse
)
3300 muscle_pair_list_grow ("parse_param", decl
, name
);
3304 gram_scanner_last_string_free ();
3309 version_check (location
const *loc
, char const *version
)
3311 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3313 complain (loc
, complaint
, "require bison %s, but have %s",
3314 version
, PACKAGE_VERSION
);
3320 gram_error (location
const *loc
, char const *msg
)
3322 complain (loc
, complaint
, "%s", msg
);
3326 token_name (int type
)
3328 return yytname
[YYTRANSLATE (type
)];
3339 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3340 return quotearg_style (escape_quoting_style
, buf
);