1 /* A Bison parser, made by GNU Bison 2.6.2.957-b074-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.957-b074-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 353 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 353 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
155 /* Enabling traces. */
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 369 of yacc.c */
172 #line 223 "src/parse-gram.y"
180 param_parse
= 1 << 1,
181 param_both
= param_lex
| param_parse
186 /* Line 369 of yacc.c */
187 #line 188 "src/parse-gram.c"
190 #ifndef GRAM_TOKENTYPE
191 # define GRAM_TOKENTYPE
192 /* Put the tokens into the symbol table, so that GDB and other debuggers
202 PERCENT_DESTRUCTOR
= 263,
203 PERCENT_PRINTER
= 264,
206 PERCENT_NONASSOC
= 267,
207 PERCENT_PRECEDENCE
= 268,
212 PERCENT_DEFAULT_PREC
= 273,
213 PERCENT_DEFINE
= 274,
214 PERCENT_DEFINES
= 275,
215 PERCENT_ERROR_VERBOSE
= 276,
216 PERCENT_EXPECT
= 277,
217 PERCENT_EXPECT_RR
= 278,
219 PERCENT_FILE_PREFIX
= 280,
220 PERCENT_GLR_PARSER
= 281,
221 PERCENT_INITIAL_ACTION
= 282,
222 PERCENT_LANGUAGE
= 283,
223 PERCENT_NAME_PREFIX
= 284,
224 PERCENT_NO_DEFAULT_PREC
= 285,
225 PERCENT_NO_LINES
= 286,
226 PERCENT_NONDETERMINISTIC_PARSER
= 287,
227 PERCENT_OUTPUT
= 288,
228 PERCENT_REQUIRE
= 289,
229 PERCENT_SKELETON
= 290,
231 PERCENT_TOKEN_TABLE
= 292,
232 PERCENT_VERBOSE
= 293,
235 BRACED_PREDICATE
= 296,
242 PERCENT_PERCENT
= 303,
257 #define PERCENT_TOKEN 260
258 #define PERCENT_NTERM 261
259 #define PERCENT_TYPE 262
260 #define PERCENT_DESTRUCTOR 263
261 #define PERCENT_PRINTER 264
262 #define PERCENT_LEFT 265
263 #define PERCENT_RIGHT 266
264 #define PERCENT_NONASSOC 267
265 #define PERCENT_PRECEDENCE 268
266 #define PERCENT_PREC 269
267 #define PERCENT_DPREC 270
268 #define PERCENT_MERGE 271
269 #define PERCENT_CODE 272
270 #define PERCENT_DEFAULT_PREC 273
271 #define PERCENT_DEFINE 274
272 #define PERCENT_DEFINES 275
273 #define PERCENT_ERROR_VERBOSE 276
274 #define PERCENT_EXPECT 277
275 #define PERCENT_EXPECT_RR 278
276 #define PERCENT_FLAG 279
277 #define PERCENT_FILE_PREFIX 280
278 #define PERCENT_GLR_PARSER 281
279 #define PERCENT_INITIAL_ACTION 282
280 #define PERCENT_LANGUAGE 283
281 #define PERCENT_NAME_PREFIX 284
282 #define PERCENT_NO_DEFAULT_PREC 285
283 #define PERCENT_NO_LINES 286
284 #define PERCENT_NONDETERMINISTIC_PARSER 287
285 #define PERCENT_OUTPUT 288
286 #define PERCENT_REQUIRE 289
287 #define PERCENT_SKELETON 290
288 #define PERCENT_START 291
289 #define PERCENT_TOKEN_TABLE 292
290 #define PERCENT_VERBOSE 293
291 #define PERCENT_YACC 294
292 #define BRACED_CODE 295
293 #define BRACED_PREDICATE 296
294 #define BRACKETED_ID 297
300 #define PERCENT_PERCENT 303
303 #define SEMICOLON 306
307 #define PERCENT_PARAM 310
308 #define PERCENT_UNION 311
310 #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
311 typedef union GRAM_STYPE
313 /* Line 369 of yacc.c */
314 #line 109 "src/parse-gram.y"
320 named_ref
*named_ref
;
324 unsigned char character
;
326 /* Line 369 of yacc.c */
327 #line 247 "src/parse-gram.y"
331 /* Line 369 of yacc.c */
332 #line 423 "src/parse-gram.y"
333 code_props_type code_type
;
335 /* Line 369 of yacc.c */
336 #line 337 "src/parse-gram.c"
338 # define GRAM_STYPE_IS_TRIVIAL 1
339 # define GRAM_STYPE_IS_DECLARED 1
342 #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
343 typedef struct GRAM_LTYPE
350 # define GRAM_LTYPE_IS_DECLARED 1
351 # define GRAM_LTYPE_IS_TRIVIAL 1
355 int gram_parse (void);
357 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */
359 /* Copy the second part of user declarations. */
361 /* Line 372 of yacc.c */
362 #line 363 "src/parse-gram.c"
363 /* Unqualified %code blocks. */
364 /* Line 373 of yacc.c */
365 #line 58 "src/parse-gram.y"
367 static int current_prec
= 0;
368 static location current_lhs_location
;
369 static named_ref
*current_lhs_named_ref
;
370 static symbol
*current_lhs_symbol
;
371 static symbol_class current_class
= unknown_sym
;
372 static uniqstr current_type
= NULL
;
374 /** Set the new current left-hand side symbol, possibly common
375 * to several right-hand side parts of rule.
379 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
381 current_lhs_symbol
= sym
;
382 current_lhs_location
= loc
;
383 /* In order to simplify memory management, named references for lhs
384 are always assigned by deep copy into the current symbol_list
385 node. This is because a single named-ref in the grammar may
386 result in several uses when the user factors lhs between several
387 rules using "|". Therefore free the parser's original copy. */
388 free (current_lhs_named_ref
);
389 current_lhs_named_ref
= ref
;
392 #define YYTYPE_INT16 int_fast16_t
393 #define YYTYPE_INT8 int_fast8_t
394 #define YYTYPE_UINT16 uint_fast16_t
395 #define YYTYPE_UINT8 uint_fast8_t
397 /* Line 373 of yacc.c */
398 #line 236 "src/parse-gram.y"
400 /** Add a lex-param and/or a parse-param.
402 * \param type where to push this formal argument.
403 * \param decl the formal argument. Destroyed.
404 * \param loc the location in the source.
406 static void add_param (param_type type
, char *decl
, location loc
);
407 static param_type current_param
= param_none
;
410 /* Line 373 of yacc.c */
411 #line 412 "src/parse-gram.c"
418 typedef YYTYPE_UINT8 yytype_uint8
;
420 typedef unsigned char yytype_uint8
;
424 typedef YYTYPE_INT8 yytype_int8
;
426 typedef signed char yytype_int8
;
430 typedef YYTYPE_UINT16 yytype_uint16
;
432 typedef unsigned short int yytype_uint16
;
436 typedef YYTYPE_INT16 yytype_int16
;
438 typedef short int yytype_int16
;
442 # ifdef __SIZE_TYPE__
443 # define YYSIZE_T __SIZE_TYPE__
444 # elif defined size_t
445 # define YYSIZE_T size_t
446 # elif ! defined YYSIZE_T
447 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
448 # define YYSIZE_T size_t
450 # define YYSIZE_T unsigned int
454 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
457 # if defined YYENABLE_NLS && YYENABLE_NLS
459 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
460 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
464 # define YY_(Msgid) Msgid
468 /* Suppress unused-variable warnings by "using" E. */
470 # define YYUSE(E) ((void) (E))
472 # define YYUSE(E) /* empty */
477 /* The parser invokes alloca or malloc; define the necessary symbols. */
479 # ifdef YYSTACK_ALLOC
480 /* Pacify GCC's `empty if-body' warning. */
481 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
482 # ifndef YYSTACK_ALLOC_MAXIMUM
483 /* The OS might guarantee only one guard page at the bottom of the stack,
484 and a page size can be as small as 4096 bytes. So we cannot safely
485 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
486 to allow for a few compiler-allocated temporary stack slots. */
487 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
490 # define YYSTACK_ALLOC YYMALLOC
491 # define YYSTACK_FREE YYFREE
492 # ifndef YYSTACK_ALLOC_MAXIMUM
493 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
495 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
496 && ! ((defined YYMALLOC || defined malloc) \
497 && (defined YYFREE || defined free)))
498 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
499 # ifndef EXIT_SUCCESS
500 # define EXIT_SUCCESS 0
504 # define YYMALLOC malloc
505 # if ! defined malloc && ! defined EXIT_SUCCESS
506 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
511 # if ! defined free && ! defined EXIT_SUCCESS
512 void free (void *); /* INFRINGES ON USER NAME SPACE */
516 # define YYCOPY_NEEDED 1
520 #if (! defined yyoverflow \
521 && (! defined __cplusplus \
522 || (defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL \
523 && defined GRAM_STYPE_IS_TRIVIAL && GRAM_STYPE_IS_TRIVIAL)))
525 /* A type that is properly aligned for any stack member. */
528 yytype_int16 yyss_alloc
;
533 /* The size of the maximum gap between one aligned stack and the next. */
534 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
536 /* The size of an array large to enough to hold all stacks, each with
538 # define YYSTACK_BYTES(N) \
539 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
540 + 2 * YYSTACK_GAP_MAXIMUM)
542 # define YYCOPY_NEEDED 1
544 /* Relocate STACK from its old location to the new one. The
545 local variables YYSIZE and YYSTACKSIZE give the old and new number of
546 elements in the stack, and YYPTR gives the new location of the
547 stack. Advance YYPTR to a properly aligned location for the next
549 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
552 YYSIZE_T yynewbytes; \
553 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
554 Stack = &yyptr->Stack_alloc; \
555 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
556 yyptr += yynewbytes / sizeof (*yyptr); \
562 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
563 /* Copy COUNT objects from SRC to DST. The source and destination do
566 # if defined __GNUC__ && 1 < __GNUC__
567 # define YYCOPY(Dst, Src, Count) \
568 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
570 # define YYCOPY(Dst, Src, Count) \
574 for (yyi = 0; yyi < (Count); yyi++) \
575 (Dst)[yyi] = (Src)[yyi]; \
580 #endif /* !YYCOPY_NEEDED */
582 /* YYFINAL -- State number of the termination state. */
584 /* YYLAST -- Last index in YYTABLE. */
587 /* YYNTOKENS -- Number of terminals. */
589 /* YYNNTS -- Number of nonterminals. */
591 /* YYNRULES -- Number of rules. */
593 /* YYNSTATES -- Number of states. */
594 #define YYNSTATES 143
596 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
597 by yylex, with out-of-bounds checking. */
599 #define YYMAXUTOK 311
601 #define YYTRANSLATE(YYX) \
602 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
604 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
605 as returned by yylex, without out-of-bounds checking. */
606 static const yytype_uint8 yytranslate
[] =
608 0, 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, 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, 1, 2, 3, 4,
634 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
635 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
636 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
637 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
638 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
643 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
644 static const yytype_uint16 yyrline
[] =
646 0, 272, 272, 280, 282, 286, 287, 297, 301, 306,
647 307, 312, 317, 318, 319, 320, 325, 334, 335, 336,
648 337, 338, 339, 339, 340, 341, 365, 366, 367, 368,
649 372, 373, 382, 383, 384, 388, 400, 404, 408, 415,
650 426, 427, 437, 438, 442, 454, 454, 459, 459, 464,
651 475, 490, 491, 492, 493, 497, 498, 503, 505, 510,
652 511, 516, 518, 523, 524, 528, 529, 533, 534, 535,
653 540, 545, 550, 556, 562, 573, 574, 583, 584, 590,
654 591, 592, 599, 599, 607, 608, 609, 614, 616, 618,
655 620, 622, 624, 626, 631, 633, 643, 644, 649, 650,
656 651, 660, 680, 682, 691, 696, 697, 702, 709, 711
660 #if GRAM_DEBUG || YYERROR_VERBOSE || 1
661 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
662 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
663 static const char *const yytname
[] =
665 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
666 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
667 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
668 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
669 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
670 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
671 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
672 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
673 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
674 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
675 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
676 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
677 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
678 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
679 "prologue_declaration", "$@1", "params", "grammar_declaration",
680 "code_props_type", "union_name", "symbol_declaration", "$@2", "$@3",
681 "precedence_declaration", "precedence_declarator", "tag.opt",
682 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
683 "generic_symlist_item", "tag", "symbol_def", "symbol_defs.1", "grammar",
684 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
685 "named_ref.opt", "variable", "content.opt", "braceless", "id",
686 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
691 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
692 (internal) symbol number NUM (which must be that of a token). */
693 static const yytype_uint16 yytoknum
[] =
695 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
696 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
697 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
698 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
699 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
700 305, 306, 307, 308, 309, 310, 311
704 #define YYPACT_NINF -74
706 #define yypact_value_is_default(Yystate) \
707 (!!((Yystate) == (-74)))
709 #define YYTABLE_NINF -109
711 #define yytable_value_is_error(Yytable_value) \
714 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
716 static const yytype_int16 yypact
[] =
718 -74, 40, 101, -74, -74, -74, -48, -74, -74, -74,
719 -74, -74, -74, 19, -74, 0, 52, -74, 56, 79,
720 -74, 81, -74, 45, 83, 84, -74, -74, -74, 85,
721 86, 87, 31, -74, -74, -74, 15, -74, -74, -74,
722 46, -74, -74, 51, -74, -74, 42, 4, 4, 31,
723 -74, 57, -74, -74, -74, 36, -74, -74, -74, -74,
724 -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
725 -74, -74, 47, -74, 49, 1, -74, -74, 59, 62,
726 -74, 57, 26, -74, 31, -74, -74, 4, 72, 4,
727 31, -74, -74, -74, -74, -74, -74, -74, 60, -74,
728 -74, -74, -74, -74, 63, -74, -74, -74, -74, 26,
729 -74, -74, -74, 31, -74, 111, -74, 113, -74, -74,
730 -74, -74, -74, -74, -74, -74, -74, -13, 27, -74,
731 -74, 31, 137, 65, 59, -74, 59, 27, -74, -74,
735 /* YYDEFACT[S] -- default reduction number in state S. Performed when
736 YYTABLE does not specify something else to do. Zero means the default
738 static const yytype_uint8 yydefact
[] =
740 3, 0, 0, 1, 47, 45, 0, 40, 41, 51,
741 52, 53, 54, 0, 36, 0, 9, 11, 0, 0,
742 7, 0, 15, 0, 0, 0, 37, 19, 20, 0,
743 0, 0, 0, 26, 27, 28, 0, 6, 29, 22,
744 42, 4, 5, 0, 33, 32, 55, 0, 0, 0,
745 101, 0, 38, 97, 96, 98, 10, 12, 13, 14,
746 16, 17, 18, 21, 24, 25, 107, 103, 102, 105,
747 34, 106, 0, 104, 0, 0, 77, 79, 94, 0,
748 43, 0, 0, 56, 0, 70, 75, 48, 71, 46,
749 49, 61, 39, 100, 99, 8, 81, 80, 0, 78,
750 2, 95, 82, 31, 23, 44, 67, 68, 69, 35,
751 63, 66, 65, 50, 57, 59, 76, 72, 73, 62,
752 109, 87, 30, 64, 58, 60, 74, 83, 84, 87,
753 86, 0, 0, 0, 94, 90, 94, 85, 91, 92,
757 /* YYPGOTO[NTERM-NUM]. */
758 static const yytype_int16 yypgoto
[] =
760 -74, -74, -74, -74, -74, -74, 140, -74, -74, -74,
761 -74, -74, -74, -74, -74, -74, 30, -74, -74, 35,
762 -74, -26, 97, -74, 71, -74, -74, -74, 18, -70,
763 -74, -74, -46, 6, -74, -32, -73, -74
766 /* YYDEFGOTO[NTERM-NUM]. */
767 static const yytype_int16 yydefgoto
[] =
769 -1, 1, 2, 41, 79, 104, 74, 43, 81, 44,
770 48, 47, 45, 46, 84, 113, 114, 90, 109, 110,
771 111, 86, 87, 75, 76, 77, 121, 127, 128, 102,
772 55, 95, 52, 69, 78, 112, 71, 100
775 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
776 positive, shift that token. If negative, reduce the rule which
777 number is the opposite. If YYTABLE_NINF, syntax error. */
778 static const yytype_int16 yytable
[] =
780 70, -108, 72, 53, 49, 92, 4, 5, 6, 7,
781 8, 9, 10, 11, 12, 118, 72, 91, 13, 14,
782 4, 5, 6, 7, 8, 9, 10, 11, 12, 66,
783 66, 26, 13, 14, 66, 105, 129, 32, 130, 93,
784 3, 131, 132, 133, 126, 26, 54, 67, 73, 98,
785 68, 32, 115, 88, 88, 56, 85, 40, 119, 50,
786 57, 116, 73, 116, 141, 51, 142, 134, 135, 67,
787 67, 40, 68, 68, 67, 66, 117, 68, 106, 107,
788 108, 115, 94, 58, 59, 60, 61, 62, 63, 64,
789 65, 82, 80, 88, 83, 88, 136, 50, 96, 138,
790 97, 101, 103, 122, 120, 136, 4, 5, 6, 7,
791 8, 9, 10, 11, 12, 125, 66, 140, 13, 14,
792 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
793 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
794 35, 139, 42, 124, 123, 89, 99, 137, 0, 36,
795 0, 37, 38, 0, 0, 0, 39, 40
798 static const yytype_int16 yycheck
[] =
800 32, 0, 1, 3, 52, 51, 5, 6, 7, 8,
801 9, 10, 11, 12, 13, 88, 1, 49, 17, 18,
802 5, 6, 7, 8, 9, 10, 11, 12, 13, 3,
803 3, 30, 17, 18, 3, 81, 49, 36, 51, 3,
804 0, 14, 15, 16, 117, 30, 46, 43, 47, 48,
805 46, 36, 84, 47, 48, 3, 52, 56, 90, 40,
806 4, 87, 47, 89, 134, 46, 136, 40, 41, 43,
807 43, 56, 46, 46, 43, 3, 4, 46, 52, 53,
808 54, 113, 46, 4, 3, 40, 3, 3, 3, 3,
809 3, 40, 46, 87, 52, 89, 128, 40, 51, 131,
810 51, 42, 40, 40, 44, 137, 5, 6, 7, 8,
811 9, 10, 11, 12, 13, 4, 3, 52, 17, 18,
812 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
813 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
814 39, 4, 2, 113, 109, 48, 75, 129, -1, 48,
815 -1, 50, 51, -1, -1, -1, 55, 56
818 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
819 symbol of state STATE-NUM. */
820 static const yytype_uint8 yystos
[] =
822 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
823 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
824 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
825 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
826 56, 60, 63, 64, 66, 69, 70, 68, 67, 52,
827 40, 46, 89, 3, 46, 87, 3, 4, 4, 3,
828 40, 3, 3, 3, 3, 3, 3, 43, 46, 90,
829 92, 93, 1, 47, 63, 80, 81, 82, 91, 61,
830 46, 65, 40, 52, 71, 52, 78, 79, 90, 79,
831 74, 92, 89, 3, 46, 88, 51, 51, 48, 81,
832 94, 42, 86, 40, 62, 89, 52, 53, 54, 75,
833 76, 77, 92, 72, 73, 92, 78, 4, 93, 92,
834 44, 83, 40, 76, 73, 4, 93, 84, 85, 49,
835 51, 14, 15, 16, 40, 41, 92, 85, 92, 4,
839 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
840 static const yytype_uint8 yyr1
[] =
842 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
843 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
844 60, 60, 61, 60, 60, 60, 60, 60, 60, 60,
845 62, 62, 63, 63, 63, 63, 63, 63, 63, 63,
846 64, 64, 65, 65, 63, 67, 66, 68, 66, 66,
847 69, 70, 70, 70, 70, 71, 71, 72, 72, 73,
848 73, 74, 74, 75, 75, 76, 76, 77, 77, 77,
849 78, 78, 78, 78, 78, 79, 79, 80, 80, 81,
850 81, 81, 83, 82, 84, 84, 84, 85, 85, 85,
851 85, 85, 85, 85, 86, 86, 87, 87, 88, 88,
852 88, 89, 90, 90, 91, 92, 92, 93, 94, 94
855 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
856 static const yytype_uint8 yyr2
[] =
858 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
859 2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
860 1, 2, 0, 3, 2, 2, 1, 1, 1, 1,
861 2, 1, 1, 1, 2, 3, 1, 1, 2, 3,
862 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
863 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
864 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
865 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
866 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
867 2, 3, 3, 3, 0, 1, 1, 1, 0, 1,
868 1, 1, 1, 1, 1, 1, 1, 1, 0, 2
872 #define yyerrok (yyerrstatus = 0)
873 #define yyclearin (yychar = YYEMPTY)
877 #define YYACCEPT goto yyacceptlab
878 #define YYABORT goto yyabortlab
879 #define YYERROR goto yyerrorlab
882 #define YYRECOVERING() (!!yyerrstatus)
884 #define YYBACKUP(Token, Value) \
886 if (yychar == YYEMPTY) \
890 YYPOPSTACK (yylen); \
892 YY_LAC_DISCARD ("YYBACKUP"); \
897 yyerror (YY_("syntax error: cannot back up")); \
904 #define YYERRCODE 256
907 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
908 If N is 0, then set CURRENT to the empty location which ends
909 the previous symbol: RHS[0] (always defined). */
911 #ifndef YYLLOC_DEFAULT
912 # define YYLLOC_DEFAULT(Current, Rhs, N) \
916 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
917 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
918 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
919 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
923 (Current).first_line = (Current).last_line = \
924 YYRHSLOC (Rhs, 0).last_line; \
925 (Current).first_column = (Current).last_column = \
926 YYRHSLOC (Rhs, 0).last_column; \
931 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
933 /* YY_LOCATION_PRINT -- Print the location on the stream.
934 This macro was not mandated originally: define only if we know
935 we won't break user code: when these are the locations we know. */
937 #ifndef YY_LOCATION_PRINT
938 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
939 # define YY_LOCATION_PRINT(File, Loc) \
940 fprintf (File, "%d.%d-%d.%d", \
941 (Loc).first_line, (Loc).first_column, \
942 (Loc).last_line, (Loc).last_column)
944 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
949 /* YYLEX -- calling `yylex' with the right arguments. */
951 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
953 # define YYLEX yylex (&yylval, &yylloc)
956 /* Enable debugging if requested. */
960 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
961 # define YYFPRINTF fprintf
964 # define YYDPRINTF(Args) \
970 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
974 YYFPRINTF (stderr, "%s ", Title); \
975 yy_symbol_print (stderr, \
976 Type, Value, Location); \
977 YYFPRINTF (stderr, "\n"); \
982 /*--------------------------------.
983 | Print this symbol on YYOUTPUT. |
984 `--------------------------------*/
987 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
989 FILE *yyo
= yyoutput
;
995 if (yytype
< YYNTOKENS
)
996 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1001 /* Line 727 of yacc.c */
1002 #line 196 "src/parse-gram.y"
1003 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
1004 /* Line 727 of yacc.c */
1005 #line 1006 "src/parse-gram.c"
1008 case 4: // "integer"
1009 /* Line 727 of yacc.c */
1010 #line 209 "src/parse-gram.y"
1011 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
1012 /* Line 727 of yacc.c */
1013 #line 1014 "src/parse-gram.c"
1016 case 24: // "%<flag>"
1017 /* Line 727 of yacc.c */
1018 #line 205 "src/parse-gram.y"
1019 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1020 /* Line 727 of yacc.c */
1021 #line 1022 "src/parse-gram.c"
1025 /* Line 727 of yacc.c */
1026 #line 198 "src/parse-gram.y"
1027 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1028 /* Line 727 of yacc.c */
1029 #line 1030 "src/parse-gram.c"
1032 case 42: // "[identifier]"
1033 /* Line 727 of yacc.c */
1034 #line 203 "src/parse-gram.y"
1035 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1036 /* Line 727 of yacc.c */
1037 #line 1038 "src/parse-gram.c"
1041 /* Line 727 of yacc.c */
1042 #line 190 "src/parse-gram.y"
1043 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
1044 /* Line 727 of yacc.c */
1045 #line 1046 "src/parse-gram.c"
1048 case 44: // "epilogue"
1049 /* Line 727 of yacc.c */
1050 #line 198 "src/parse-gram.y"
1051 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1052 /* Line 727 of yacc.c */
1053 #line 1054 "src/parse-gram.c"
1056 case 46: // "identifier"
1057 /* Line 727 of yacc.c */
1058 #line 202 "src/parse-gram.y"
1059 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1060 /* Line 727 of yacc.c */
1061 #line 1062 "src/parse-gram.c"
1064 case 47: // "identifier:"
1065 /* Line 727 of yacc.c */
1066 #line 204 "src/parse-gram.y"
1067 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
1068 /* Line 727 of yacc.c */
1069 #line 1070 "src/parse-gram.c"
1072 case 50: // "%{...%}"
1073 /* Line 727 of yacc.c */
1074 #line 198 "src/parse-gram.y"
1075 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1076 /* Line 727 of yacc.c */
1077 #line 1078 "src/parse-gram.c"
1081 /* Line 727 of yacc.c */
1082 #line 206 "src/parse-gram.y"
1083 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1084 /* Line 727 of yacc.c */
1085 #line 1086 "src/parse-gram.c"
1088 case 55: // "%param"
1089 /* Line 727 of yacc.c */
1090 #line 252 "src/parse-gram.y"
1092 switch (((*yyvaluep
).param
))
1094 #define CASE(In, Out) \
1095 case param_ ## In: fputs ("%" #Out, stderr); break
1096 CASE(lex
, lex
-param
);
1097 CASE(parse
, parse
-param
);
1100 case param_none
: aver (false); break;
1103 /* Line 727 of yacc.c */
1104 #line 1105 "src/parse-gram.c"
1107 case 64: // code_props_type
1108 /* Line 727 of yacc.c */
1109 #line 424 "src/parse-gram.y"
1110 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1111 /* Line 727 of yacc.c */
1112 #line 1113 "src/parse-gram.c"
1115 case 73: // symbol.prec
1116 /* Line 727 of yacc.c */
1117 #line 212 "src/parse-gram.y"
1118 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1119 /* Line 727 of yacc.c */
1120 #line 1121 "src/parse-gram.c"
1124 /* Line 727 of yacc.c */
1125 #line 206 "src/parse-gram.y"
1126 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1127 /* Line 727 of yacc.c */
1128 #line 1129 "src/parse-gram.c"
1131 case 87: // variable
1132 /* Line 727 of yacc.c */
1133 #line 202 "src/parse-gram.y"
1134 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1135 /* Line 727 of yacc.c */
1136 #line 1137 "src/parse-gram.c"
1139 case 88: // content.opt
1140 /* Line 727 of yacc.c */
1141 #line 198 "src/parse-gram.y"
1142 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1143 /* Line 727 of yacc.c */
1144 #line 1145 "src/parse-gram.c"
1147 case 89: // braceless
1148 /* Line 727 of yacc.c */
1149 #line 198 "src/parse-gram.y"
1150 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1151 /* Line 727 of yacc.c */
1152 #line 1153 "src/parse-gram.c"
1156 /* Line 727 of yacc.c */
1157 #line 212 "src/parse-gram.y"
1158 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1159 /* Line 727 of yacc.c */
1160 #line 1161 "src/parse-gram.c"
1163 case 91: // id_colon
1164 /* Line 727 of yacc.c */
1165 #line 213 "src/parse-gram.y"
1166 { fprintf (yyo
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1167 /* Line 727 of yacc.c */
1168 #line 1169 "src/parse-gram.c"
1172 /* Line 727 of yacc.c */
1173 #line 212 "src/parse-gram.y"
1174 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1175 /* Line 727 of yacc.c */
1176 #line 1177 "src/parse-gram.c"
1179 case 93: // string_as_id
1180 /* Line 727 of yacc.c */
1181 #line 212 "src/parse-gram.y"
1182 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1183 /* Line 727 of yacc.c */
1184 #line 1185 "src/parse-gram.c"
1193 /*--------------------------------.
1194 | Print this symbol on YYOUTPUT. |
1195 `--------------------------------*/
1198 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1200 if (yytype
< YYNTOKENS
)
1201 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1203 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1205 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1206 YYFPRINTF (yyoutput
, ": ");
1207 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1208 YYFPRINTF (yyoutput
, ")");
1211 /*------------------------------------------------------------------.
1212 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1214 `------------------------------------------------------------------*/
1217 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1219 YYFPRINTF (stderr
, "Stack now");
1220 for (; yybottom
<= yytop
; yybottom
++)
1222 int yybot
= *yybottom
;
1223 YYFPRINTF (stderr
, " %d", yybot
);
1225 YYFPRINTF (stderr
, "\n");
1228 # define YY_STACK_PRINT(Bottom, Top) \
1231 yy_stack_print ((Bottom), (Top)); \
1235 /*------------------------------------------------.
1236 | Report that the YYRULE is going to be reduced. |
1237 `------------------------------------------------*/
1240 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1242 unsigned long int yylno
= yyrline
[yyrule
];
1243 int yynrhs
= yyr2
[yyrule
];
1245 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1247 /* The symbols being reduced. */
1248 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1250 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1251 yy_symbol_print (stderr
,
1252 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1253 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1254 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1255 YYFPRINTF (stderr
, "\n");
1259 # define YY_REDUCE_PRINT(Rule) \
1262 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1265 /* Nonzero means print parse trace. It is left uninitialized so that
1266 multiple parsers can coexist. */
1268 #else /* !GRAM_DEBUG */
1269 # define YYDPRINTF(Args)
1270 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1271 # define YY_STACK_PRINT(Bottom, Top)
1272 # define YY_REDUCE_PRINT(Rule)
1273 #endif /* !GRAM_DEBUG */
1276 /* YYINITDEPTH -- initial size of the parser's stacks. */
1278 # define YYINITDEPTH 200
1281 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1282 if the built-in stack extension method is used).
1284 Do not make this value too large; the results are undefined if
1285 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1286 evaluated with infinite-precision integer arithmetic. */
1289 # define YYMAXDEPTH 10000
1292 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1293 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1294 stack, and such that *YYCAPACITY is the maximum number of elements it
1295 can hold without a reallocation, make sure there is enough room to
1296 store YYADD more elements. If not, allocate a new stack using
1297 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1298 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1299 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1300 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1301 required. Return 1 if memory is exhausted. */
1303 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1305 char const *yydebug_prefix
,
1306 char const *yydebug_suffix
,
1308 yytype_int16
**yybottom
,
1309 yytype_int16
*yybottom_no_free
,
1310 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1312 YYSIZE_T yysize_old
=
1313 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1314 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1315 if (*yycapacity
< yysize_new
)
1317 YYSIZE_T yyalloc
= 2 * yysize_new
;
1318 yytype_int16
*yybottom_new
;
1319 /* Use YYMAXDEPTH for maximum stack size given that the stack
1320 should never need to grow larger than the main state stack
1321 needs to grow without LAC. */
1322 if (YYMAXDEPTH
< yysize_new
)
1324 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1328 if (YYMAXDEPTH
< yyalloc
)
1329 yyalloc
= YYMAXDEPTH
;
1331 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1334 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1338 if (*yytop
!= yytop_empty
)
1340 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1341 *yytop
= yybottom_new
+ (yysize_old
- 1);
1343 if (*yybottom
!= yybottom_no_free
)
1344 YYSTACK_FREE (*yybottom
);
1345 *yybottom
= yybottom_new
;
1346 *yycapacity
= yyalloc
;
1351 /* Establish the initial context for the current lookahead if no initial
1352 context is currently established.
1354 We define a context as a snapshot of the parser stacks. We define
1355 the initial context for a lookahead as the context in which the
1356 parser initially examines that lookahead in order to select a
1357 syntactic action. Thus, if the lookahead eventually proves
1358 syntactically unacceptable (possibly in a later context reached via a
1359 series of reductions), the initial context can be used to determine
1360 the exact set of tokens that would be syntactically acceptable in the
1361 lookahead's place. Moreover, it is the context after which any
1362 further semantic actions would be erroneous because they would be
1363 determined by a syntactically unacceptable token.
1365 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1366 performed in an inconsistent state (which, for the purposes of LAC,
1367 includes consistent states that don't know they're consistent because
1368 their default reductions have been disabled). Iff there is a
1369 lookahead token, it should also be invoked before reporting a syntax
1370 error. This latter case is for the sake of the debugging output.
1372 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1373 follows. If no initial context is currently established for the
1374 current lookahead, then check if that lookahead can eventually be
1375 shifted if syntactic actions continue from the current context.
1376 Report a syntax error if it cannot. */
1377 #define YY_LAC_ESTABLISH \
1379 if (!yy_lac_established) \
1381 YYDPRINTF ((stderr, \
1382 "LAC: initial context established for %s\n", \
1383 yytname[yytoken])); \
1384 yy_lac_established = 1; \
1386 int yy_lac_status = \
1387 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1388 if (yy_lac_status == 2) \
1389 goto yyexhaustedlab; \
1390 if (yy_lac_status == 1) \
1396 /* Discard any previous initial lookahead context because of Event,
1397 which may be a lookahead change or an invalidation of the currently
1398 established initial context for the current lookahead.
1400 The most common example of a lookahead change is a shift. An example
1401 of both cases is syntax error recovery. That is, a syntax error
1402 occurs when the lookahead is syntactically erroneous for the
1403 currently established initial context, so error recovery manipulates
1404 the parser stacks to try to find a new initial context in which the
1405 current lookahead is syntactically acceptable. If it fails to find
1406 such a context, it discards the lookahead. */
1408 # define YY_LAC_DISCARD(Event) \
1410 if (yy_lac_established) \
1413 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1415 yy_lac_established = 0; \
1419 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1422 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1423 eventually (after perhaps some reductions) be shifted, return 1 if
1424 not, or return 2 if memory is exhausted. As preconditions and
1425 postconditions: *YYES_CAPACITY is the allocated size of the array to
1426 which *YYES points, and either *YYES = YYESA or *YYES points to an
1427 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1428 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1429 any old *YYES other than YYESA. */
1431 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1432 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1434 yytype_int16
*yyes_prev
= yyssp
;
1435 yytype_int16
*yyesp
= yyes_prev
;
1436 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1437 if (yytoken
== YYUNDEFTOK
)
1439 YYDPRINTF ((stderr
, " Always Err\n"));
1444 int yyrule
= yypact
[*yyesp
];
1445 if (yypact_value_is_default (yyrule
)
1446 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1447 || yycheck
[yyrule
] != yytoken
)
1449 yyrule
= yydefact
[*yyesp
];
1452 YYDPRINTF ((stderr
, " Err\n"));
1458 yyrule
= yytable
[yyrule
];
1459 if (yytable_value_is_error (yyrule
))
1461 YYDPRINTF ((stderr
, " Err\n"));
1466 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1472 YYSIZE_T yylen
= yyr2
[yyrule
];
1473 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1474 if (yyesp
!= yyes_prev
)
1476 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1489 yyesp
= yyes_prev
-= yylen
;
1494 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1495 yystate
= yypgoto
[yylhs
] + *yyesp
;
1496 if (yystate
< 0 || YYLAST
< yystate
1497 || yycheck
[yystate
] != *yyesp
)
1498 yystate
= yydefgoto
[yylhs
];
1500 yystate
= yytable
[yystate
];
1502 if (yyesp
== yyes_prev
)
1509 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1513 yyes
, yyesa
, &yyesp
, yyes_prev
))
1515 YYDPRINTF ((stderr
, "\n"));
1520 YYDPRINTF ((stderr
, " G%d", yystate
));
1529 # if defined __GLIBC__ && defined _STRING_H
1530 # define yystrlen strlen
1532 /* Return the length of YYSTR. */
1534 yystrlen (const char *yystr
)
1537 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1545 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1546 # define yystpcpy stpcpy
1548 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1551 yystpcpy (char *yydest
, const char *yysrc
)
1554 const char *yys
= yysrc
;
1556 while ((*yyd
++ = *yys
++) != '\0')
1565 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1566 quotes and backslashes, so that it's suitable for yyerror. The
1567 heuristic is that double-quoting is unnecessary unless the string
1568 contains an apostrophe, a comma, or backslash (other than
1569 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1570 null, do not copy; instead, return the length of what the result
1573 yytnamerr (char *yyres
, const char *yystr
)
1578 char const *yyp
= yystr
;
1585 goto do_not_strip_quotes
;
1589 goto do_not_strip_quotes
;
1602 do_not_strip_quotes
: ;
1606 return yystrlen (yystr
);
1608 return yystpcpy (yyres
, yystr
) - yyres
;
1612 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1613 about the unexpected token YYTOKEN for the state stack whose top is
1614 YYSSP. In order to see if a particular token T is a
1615 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1617 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1618 not large enough to hold the message. In that case, also set
1619 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1620 required number of bytes is too large to store or if
1621 yy_lac returned 2. */
1623 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1624 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1625 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1627 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1628 YYSIZE_T yysize
= yysize0
;
1630 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1631 /* Internationalized format string. */
1632 const char *yyformat
= YY_NULL
;
1633 /* Arguments of yyformat. */
1634 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1635 /* Number of reported tokens (one for the "unexpected", one per
1639 /* There are many possibilities here to consider:
1640 - If this state is a consistent state with a default action, then
1641 the only way this function was invoked is if the default action
1642 is an error action. In that case, don't check for expected
1643 tokens because there are none.
1644 - The only way there can be no lookahead present (in yychar) is if
1645 this state is a consistent state with a default action. Thus,
1646 detecting the absence of a lookahead is sufficient to determine
1647 that there is no unexpected or expected token to report. In that
1648 case, just report a simple "syntax error".
1649 - Don't assume there isn't a lookahead just because this state is a
1650 consistent state with a default action. There might have been a
1651 previous inconsistent state, consistent state with a non-default
1652 action, or user semantic action that manipulated yychar.
1653 In the first two cases, it might appear that the current syntax
1654 error should have been detected in the previous state when yy_lac
1655 was invoked. However, at that time, there might have been a
1656 different syntax error that discarded a different initial context
1657 during error recovery, leaving behind the current lookahead.
1659 if (yytoken
!= YYEMPTY
)
1661 int yyn
= yypact
[*yyssp
];
1662 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1663 yyarg
[yycount
++] = yytname
[yytoken
];
1664 if (!yypact_value_is_default (yyn
))
1668 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1669 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1672 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1674 if (yy_lac_status
== 2)
1676 if (yy_lac_status
== 1)
1679 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1685 yyarg
[yycount
++] = yytname
[yyx
];
1686 yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1687 if (! (yysize
<= yysize1
1688 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1695 YYFPRINTF (stderr
, "No expected tokens.\n");
1701 # define YYCASE_(N, S) \
1705 YYCASE_(0, YY_("syntax error"));
1706 YYCASE_(1, YY_("syntax error, unexpected %s"));
1707 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1708 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1709 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1710 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1714 yysize1
= yysize
+ yystrlen (yyformat
);
1715 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1719 if (*yymsg_alloc
< yysize
)
1721 *yymsg_alloc
= 2 * yysize
;
1722 if (! (yysize
<= *yymsg_alloc
1723 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1724 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1728 /* Avoid sprintf, as that infringes on the user's name space.
1729 Don't have undefined behavior even if the translation
1730 produced a string with the wrong number of "%s"s. */
1734 while ((*yyp
= *yyformat
) != '\0')
1735 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1737 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1748 #endif /* YYERROR_VERBOSE */
1750 /*-----------------------------------------------.
1751 | Release the memory associated to this symbol. |
1752 `-----------------------------------------------*/
1755 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1758 YYUSE (yylocationp
);
1761 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1780 /* The lookahead symbol. */
1784 #if defined __GNUC__ && (4 < __GNUC__ + (6 <= __GNUC_MINOR__))
1785 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1786 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1787 _Pragma ("GCC diagnostic push") \
1788 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1789 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1790 _Pragma ("GCC diagnostic pop")
1792 /* Default value used for initialization, for pacifying older GCCs
1793 or non-GCC compilers. */
1794 static YYSTYPE yyval_default
;
1795 # define YYLVAL_INITIALIZE() (yylval = yyval_default)
1797 #ifndef YYLVAL_INITIALIZE
1798 # define YYLVAL_INITIALIZE()
1800 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1801 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1802 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1805 /* The semantic value of the lookahead symbol. */
1808 /* Location data for the lookahead symbol. */
1811 /* Number of syntax errors so far. */
1815 /* Number of tokens to shift before error messages enabled. */
1818 /* The stacks and their tools:
1819 `yyss': related to states.
1820 `yyvs': related to semantic values.
1821 `yyls': related to locations.
1823 Refer to the stacks through separate pointers, to allow yyoverflow
1824 to reallocate them elsewhere. */
1826 /* The state stack. */
1827 yytype_int16 yyssa
[YYINITDEPTH
];
1829 yytype_int16
*yyssp
;
1831 /* The semantic value stack. */
1832 YYSTYPE yyvsa
[YYINITDEPTH
];
1836 /* The location stack. */
1837 YYLTYPE yylsa
[YYINITDEPTH
];
1841 /* The locations where the error started and ended. */
1842 YYLTYPE yyerror_range
[3];
1844 YYSIZE_T yystacksize
;
1846 yytype_int16 yyesa
[20];
1848 YYSIZE_T yyes_capacity
;
1850 int yy_lac_established
= 0;
1853 /* Lookahead token as an internal (translated) token number. */
1855 /* The variables used to return semantic value and location from the
1861 /* Buffer for error messages, and its allocated size. */
1863 char *yymsg
= yymsgbuf
;
1864 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1867 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1869 /* The number of symbols on the RHS of the reduced rule.
1870 Keep to zero when no symbol should be popped. */
1876 yystacksize
= YYINITDEPTH
;
1879 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1880 if (YYMAXDEPTH
< yyes_capacity
)
1881 yyes_capacity
= YYMAXDEPTH
;
1883 YYDPRINTF ((stderr
, "Starting parse\n"));
1888 yychar
= YYEMPTY
; /* Cause a token to be read. */
1890 /* Initialize stack pointers.
1891 Waste one element of value and location stack
1892 so that they stay on the same level as the state stack.
1893 The wasted elements are never initialized. */
1898 YYLVAL_INITIALIZE ();
1899 #if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
1900 /* Initialize the default location before parsing starts. */
1901 yylloc
.first_line
= yylloc
.last_line
= 1;
1902 yylloc
.first_column
= yylloc
.last_column
= 1;
1905 /* User initialization code. */
1906 /* Line 1483 of yacc.c */
1907 #line 101 "src/parse-gram.y"
1909 /* Bison's grammar can initial empty locations, hence a default
1910 location is needed. */
1911 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1912 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1914 /* Line 1483 of yacc.c */
1915 #line 1916 "src/parse-gram.c"
1919 /*------------------------------------------------------------.
1920 | yynewstate -- Push a new state, which is found in yystate. |
1921 `------------------------------------------------------------*/
1923 /* In all cases, when you get here, the value and location stacks
1924 have just been pushed. So pushing a state here evens the stacks. */
1930 if (yyss
+ yystacksize
- 1 <= yyssp
)
1932 /* Get the current used size of the three stacks, in elements. */
1933 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1937 /* Give user a chance to reallocate the stack. Use copies of
1938 these so that the &'s don't force the real ones into
1940 YYSTYPE
*yyvs1
= yyvs
;
1941 yytype_int16
*yyss1
= yyss
;
1942 YYLTYPE
*yyls1
= yyls
;
1944 /* Each stack pointer address is followed by the size of the
1945 data in use in that stack, in bytes. This used to be a
1946 conditional around just the two extra args, but that might
1947 be undefined if yyoverflow is a macro. */
1948 yyoverflow (YY_("memory exhausted"),
1949 &yyss1
, yysize
* sizeof (*yyssp
),
1950 &yyvs1
, yysize
* sizeof (*yyvsp
),
1951 &yyls1
, yysize
* sizeof (*yylsp
),
1958 #else /* no yyoverflow */
1959 # ifndef YYSTACK_RELOCATE
1960 goto yyexhaustedlab
;
1962 /* Extend the stack our own way. */
1963 if (YYMAXDEPTH
<= yystacksize
)
1964 goto yyexhaustedlab
;
1966 if (YYMAXDEPTH
< yystacksize
)
1967 yystacksize
= YYMAXDEPTH
;
1970 yytype_int16
*yyss1
= yyss
;
1971 union yyalloc
*yyptr
=
1972 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1974 goto yyexhaustedlab
;
1975 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1976 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1977 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1978 # undef YYSTACK_RELOCATE
1980 YYSTACK_FREE (yyss1
);
1983 #endif /* no yyoverflow */
1985 yyssp
= yyss
+ yysize
- 1;
1986 yyvsp
= yyvs
+ yysize
- 1;
1987 yylsp
= yyls
+ yysize
- 1;
1989 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1990 (unsigned long int) yystacksize
));
1992 if (yyss
+ yystacksize
- 1 <= yyssp
)
1996 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1998 if (yystate
== YYFINAL
)
2008 /* Do appropriate processing given the current state. Read a
2009 lookahead token if we need one and don't already have one. */
2011 /* First try to decide what to do without reference to lookahead token. */
2012 yyn
= yypact
[yystate
];
2013 if (yypact_value_is_default (yyn
))
2016 /* Not known => get a lookahead token if don't already have one. */
2018 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2019 if (yychar
== YYEMPTY
)
2021 YYDPRINTF ((stderr
, "Reading a token: "));
2025 if (yychar
<= YYEOF
)
2027 yychar
= yytoken
= YYEOF
;
2028 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2032 yytoken
= YYTRANSLATE (yychar
);
2033 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2036 /* If the proper action on seeing token YYTOKEN is to reduce or to
2037 detect an error, take that action. */
2039 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2047 if (yytable_value_is_error (yyn
))
2054 /* Count tokens shifted since error; after three, turn off error
2059 /* Shift the lookahead token. */
2060 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2062 /* Discard the shifted token. */
2064 YY_LAC_DISCARD ("shift");
2067 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2069 YY_IGNORE_MAYBE_UNINITIALIZED_END
2074 /*-----------------------------------------------------------.
2075 | yydefault -- do the default action for the current state. |
2076 `-----------------------------------------------------------*/
2078 yyn
= yydefact
[yystate
];
2084 /*-----------------------------.
2085 | yyreduce -- Do a reduction. |
2086 `-----------------------------*/
2088 /* yyn is the number of a rule to reduce with. */
2091 /* If YYLEN is nonzero, implement the default value of the action:
2094 Otherwise, the following line sets YYVAL to garbage.
2095 This behavior is undocumented and Bison
2096 users should not rely upon it. Assigning to YYVAL
2097 unconditionally makes the parser a bit smaller, and it avoids a
2098 GCC warning that YYVAL may be used uninitialized. */
2099 yyval
= yyvsp
[1-yylen
];
2101 /* Default location. */
2102 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2103 YY_REDUCE_PRINT (yyn
);
2105 int yychar_backup
= yychar
;
2109 /* Line 1700 of yacc.c */
2110 #line 288 "src/parse-gram.y"
2112 code_props plain_code
;
2113 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2114 code_props_translate_code (&plain_code
);
2115 gram_scanner_last_string_free ();
2116 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2117 plain_code
.code
, (yylsp
[0]));
2118 code_scanner_last_string_free ();
2120 /* Line 1700 of yacc.c */
2121 #line 2122 "src/parse-gram.c"
2125 /* Line 1700 of yacc.c */
2126 #line 298 "src/parse-gram.y"
2128 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2130 /* Line 1700 of yacc.c */
2131 #line 2132 "src/parse-gram.c"
2135 /* Line 1700 of yacc.c */
2136 #line 302 "src/parse-gram.y"
2138 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2139 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2141 /* Line 1700 of yacc.c */
2142 #line 2143 "src/parse-gram.c"
2146 /* Line 1700 of yacc.c */
2147 #line 306 "src/parse-gram.y"
2148 { defines_flag
= true; }
2149 /* Line 1700 of yacc.c */
2150 #line 2151 "src/parse-gram.c"
2154 /* Line 1700 of yacc.c */
2155 #line 308 "src/parse-gram.y"
2157 defines_flag
= true;
2158 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2160 /* Line 1700 of yacc.c */
2161 #line 2162 "src/parse-gram.c"
2165 /* Line 1700 of yacc.c */
2166 #line 313 "src/parse-gram.y"
2168 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2169 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2171 /* Line 1700 of yacc.c */
2172 #line 2173 "src/parse-gram.c"
2176 /* Line 1700 of yacc.c */
2177 #line 317 "src/parse-gram.y"
2178 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2179 /* Line 1700 of yacc.c */
2180 #line 2181 "src/parse-gram.c"
2184 /* Line 1700 of yacc.c */
2185 #line 318 "src/parse-gram.y"
2186 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2187 /* Line 1700 of yacc.c */
2188 #line 2189 "src/parse-gram.c"
2192 /* Line 1700 of yacc.c */
2193 #line 319 "src/parse-gram.y"
2194 { spec_file_prefix
= (yyvsp
[0].chars
); }
2195 /* Line 1700 of yacc.c */
2196 #line 2197 "src/parse-gram.c"
2200 /* Line 1700 of yacc.c */
2201 #line 321 "src/parse-gram.y"
2203 nondeterministic_parser
= true;
2206 /* Line 1700 of yacc.c */
2207 #line 2208 "src/parse-gram.c"
2211 /* Line 1700 of yacc.c */
2212 #line 326 "src/parse-gram.y"
2215 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2216 code_props_translate_code (&action
);
2217 gram_scanner_last_string_free ();
2218 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2219 code_scanner_last_string_free ();
2221 /* Line 1700 of yacc.c */
2222 #line 2223 "src/parse-gram.c"
2226 /* Line 1700 of yacc.c */
2227 #line 334 "src/parse-gram.y"
2228 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2229 /* Line 1700 of yacc.c */
2230 #line 2231 "src/parse-gram.c"
2234 /* Line 1700 of yacc.c */
2235 #line 335 "src/parse-gram.y"
2236 { spec_name_prefix
= (yyvsp
[0].chars
); }
2237 /* Line 1700 of yacc.c */
2238 #line 2239 "src/parse-gram.c"
2242 /* Line 1700 of yacc.c */
2243 #line 336 "src/parse-gram.y"
2244 { no_lines_flag
= true; }
2245 /* Line 1700 of yacc.c */
2246 #line 2247 "src/parse-gram.c"
2250 /* Line 1700 of yacc.c */
2251 #line 337 "src/parse-gram.y"
2252 { nondeterministic_parser
= true; }
2253 /* Line 1700 of yacc.c */
2254 #line 2255 "src/parse-gram.c"
2258 /* Line 1700 of yacc.c */
2259 #line 338 "src/parse-gram.y"
2260 { spec_outfile
= (yyvsp
[0].chars
); }
2261 /* Line 1700 of yacc.c */
2262 #line 2263 "src/parse-gram.c"
2266 /* Line 1700 of yacc.c */
2267 #line 339 "src/parse-gram.y"
2268 { current_param
= (yyvsp
[0].param
); }
2269 /* Line 1700 of yacc.c */
2270 #line 2271 "src/parse-gram.c"
2274 /* Line 1700 of yacc.c */
2275 #line 339 "src/parse-gram.y"
2276 { current_param
= param_none
; }
2277 /* Line 1700 of yacc.c */
2278 #line 2279 "src/parse-gram.c"
2282 /* Line 1700 of yacc.c */
2283 #line 340 "src/parse-gram.y"
2284 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2285 /* Line 1700 of yacc.c */
2286 #line 2287 "src/parse-gram.c"
2290 /* Line 1700 of yacc.c */
2291 #line 342 "src/parse-gram.y"
2293 char const *skeleton_user
= (yyvsp
[0].chars
);
2294 if (strchr (skeleton_user
, '/'))
2296 size_t dir_length
= strlen (current_file
);
2297 char *skeleton_build
;
2298 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2300 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2303 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2306 memcpy (skeleton_build
, current_file
, dir_length
);
2307 skeleton_build
[dir_length
++] = '/';
2309 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2310 skeleton_user
= uniqstr_new (skeleton_build
);
2311 free (skeleton_build
);
2313 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2315 /* Line 1700 of yacc.c */
2316 #line 2317 "src/parse-gram.c"
2320 /* Line 1700 of yacc.c */
2321 #line 365 "src/parse-gram.y"
2322 { token_table_flag
= true; }
2323 /* Line 1700 of yacc.c */
2324 #line 2325 "src/parse-gram.c"
2328 /* Line 1700 of yacc.c */
2329 #line 366 "src/parse-gram.y"
2330 { report_flag
|= report_states
; }
2331 /* Line 1700 of yacc.c */
2332 #line 2333 "src/parse-gram.c"
2336 /* Line 1700 of yacc.c */
2337 #line 367 "src/parse-gram.y"
2338 { yacc_flag
= true; }
2339 /* Line 1700 of yacc.c */
2340 #line 2341 "src/parse-gram.c"
2344 /* Line 1700 of yacc.c */
2345 #line 372 "src/parse-gram.y"
2346 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2347 /* Line 1700 of yacc.c */
2348 #line 2349 "src/parse-gram.c"
2352 /* Line 1700 of yacc.c */
2353 #line 373 "src/parse-gram.y"
2354 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2355 /* Line 1700 of yacc.c */
2356 #line 2357 "src/parse-gram.c"
2360 /* Line 1700 of yacc.c */
2361 #line 385 "src/parse-gram.y"
2363 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2365 /* Line 1700 of yacc.c */
2366 #line 2367 "src/parse-gram.c"
2370 /* Line 1700 of yacc.c */
2371 #line 389 "src/parse-gram.y"
2374 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2375 code_props_translate_code (&code
);
2378 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2379 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2380 symbol_list_free ((yyvsp
[0].list
));
2383 /* Line 1700 of yacc.c */
2384 #line 2385 "src/parse-gram.c"
2388 /* Line 1700 of yacc.c */
2389 #line 401 "src/parse-gram.y"
2391 default_prec
= true;
2393 /* Line 1700 of yacc.c */
2394 #line 2395 "src/parse-gram.c"
2398 /* Line 1700 of yacc.c */
2399 #line 405 "src/parse-gram.y"
2401 default_prec
= false;
2403 /* Line 1700 of yacc.c */
2404 #line 2405 "src/parse-gram.c"
2408 /* Line 1700 of yacc.c */
2409 #line 409 "src/parse-gram.y"
2411 /* Do not invoke muscle_percent_code_grow here since it invokes
2412 muscle_user_name_list_grow. */
2413 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2414 code_scanner_last_string_free ();
2416 /* Line 1700 of yacc.c */
2417 #line 2418 "src/parse-gram.c"
2421 /* Line 1700 of yacc.c */
2422 #line 416 "src/parse-gram.y"
2424 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2425 code_scanner_last_string_free ();
2427 /* Line 1700 of yacc.c */
2428 #line 2429 "src/parse-gram.c"
2432 /* Line 1700 of yacc.c */
2433 #line 426 "src/parse-gram.y"
2434 { (yyval
.code_type
) = destructor
; }
2435 /* Line 1700 of yacc.c */
2436 #line 2437 "src/parse-gram.c"
2440 /* Line 1700 of yacc.c */
2441 #line 427 "src/parse-gram.y"
2442 { (yyval
.code_type
) = printer
; }
2443 /* Line 1700 of yacc.c */
2444 #line 2445 "src/parse-gram.c"
2448 /* Line 1700 of yacc.c */
2449 #line 437 "src/parse-gram.y"
2451 /* Line 1700 of yacc.c */
2452 #line 2453 "src/parse-gram.c"
2456 /* Line 1700 of yacc.c */
2457 #line 438 "src/parse-gram.y"
2458 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2459 /* Line 1700 of yacc.c */
2460 #line 2461 "src/parse-gram.c"
2464 /* Line 1700 of yacc.c */
2465 #line 443 "src/parse-gram.y"
2468 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2469 code_scanner_last_string_free ();
2471 /* Line 1700 of yacc.c */
2472 #line 2473 "src/parse-gram.c"
2476 /* Line 1700 of yacc.c */
2477 #line 454 "src/parse-gram.y"
2478 { current_class
= nterm_sym
; }
2479 /* Line 1700 of yacc.c */
2480 #line 2481 "src/parse-gram.c"
2484 /* Line 1700 of yacc.c */
2485 #line 455 "src/parse-gram.y"
2487 current_class
= unknown_sym
;
2488 current_type
= NULL
;
2490 /* Line 1700 of yacc.c */
2491 #line 2492 "src/parse-gram.c"
2495 /* Line 1700 of yacc.c */
2496 #line 459 "src/parse-gram.y"
2497 { current_class
= token_sym
; }
2498 /* Line 1700 of yacc.c */
2499 #line 2500 "src/parse-gram.c"
2503 /* Line 1700 of yacc.c */
2504 #line 460 "src/parse-gram.y"
2506 current_class
= unknown_sym
;
2507 current_type
= NULL
;
2509 /* Line 1700 of yacc.c */
2510 #line 2511 "src/parse-gram.c"
2514 /* Line 1700 of yacc.c */
2515 #line 465 "src/parse-gram.y"
2519 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2520 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2521 symbol_list_free ((yyvsp
[0].list
));
2523 /* Line 1700 of yacc.c */
2524 #line 2525 "src/parse-gram.c"
2528 /* Line 1700 of yacc.c */
2529 #line 476 "src/parse-gram.y"
2533 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2535 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2536 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2538 symbol_list_free ((yyvsp
[0].list
));
2539 current_type
= NULL
;
2541 /* Line 1700 of yacc.c */
2542 #line 2543 "src/parse-gram.c"
2546 /* Line 1700 of yacc.c */
2547 #line 490 "src/parse-gram.y"
2548 { (yyval
.assoc
) = left_assoc
; }
2549 /* Line 1700 of yacc.c */
2550 #line 2551 "src/parse-gram.c"
2554 /* Line 1700 of yacc.c */
2555 #line 491 "src/parse-gram.y"
2556 { (yyval
.assoc
) = right_assoc
; }
2557 /* Line 1700 of yacc.c */
2558 #line 2559 "src/parse-gram.c"
2562 /* Line 1700 of yacc.c */
2563 #line 492 "src/parse-gram.y"
2564 { (yyval
.assoc
) = non_assoc
; }
2565 /* Line 1700 of yacc.c */
2566 #line 2567 "src/parse-gram.c"
2570 /* Line 1700 of yacc.c */
2571 #line 493 "src/parse-gram.y"
2572 { (yyval
.assoc
) = precedence_assoc
; }
2573 /* Line 1700 of yacc.c */
2574 #line 2575 "src/parse-gram.c"
2578 /* Line 1700 of yacc.c */
2579 #line 497 "src/parse-gram.y"
2580 { current_type
= NULL
; }
2581 /* Line 1700 of yacc.c */
2582 #line 2583 "src/parse-gram.c"
2586 /* Line 1700 of yacc.c */
2587 #line 498 "src/parse-gram.y"
2588 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2589 /* Line 1700 of yacc.c */
2590 #line 2591 "src/parse-gram.c"
2594 /* Line 1700 of yacc.c */
2595 #line 504 "src/parse-gram.y"
2596 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2597 /* Line 1700 of yacc.c */
2598 #line 2599 "src/parse-gram.c"
2602 /* Line 1700 of yacc.c */
2603 #line 506 "src/parse-gram.y"
2604 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2605 /* Line 1700 of yacc.c */
2606 #line 2607 "src/parse-gram.c"
2610 /* Line 1700 of yacc.c */
2611 #line 510 "src/parse-gram.y"
2612 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2613 /* Line 1700 of yacc.c */
2614 #line 2615 "src/parse-gram.c"
2618 /* Line 1700 of yacc.c */
2619 #line 511 "src/parse-gram.y"
2620 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2621 /* Line 1700 of yacc.c */
2622 #line 2623 "src/parse-gram.c"
2626 /* Line 1700 of yacc.c */
2627 #line 517 "src/parse-gram.y"
2628 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2629 /* Line 1700 of yacc.c */
2630 #line 2631 "src/parse-gram.c"
2634 /* Line 1700 of yacc.c */
2635 #line 519 "src/parse-gram.y"
2636 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2637 /* Line 1700 of yacc.c */
2638 #line 2639 "src/parse-gram.c"
2642 /* Line 1700 of yacc.c */
2643 #line 523 "src/parse-gram.y"
2644 { (yyval
.list
) = (yyvsp
[0].list
); }
2645 /* Line 1700 of yacc.c */
2646 #line 2647 "src/parse-gram.c"
2650 /* Line 1700 of yacc.c */
2651 #line 524 "src/parse-gram.y"
2652 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2653 /* Line 1700 of yacc.c */
2654 #line 2655 "src/parse-gram.c"
2658 /* Line 1700 of yacc.c */
2659 #line 528 "src/parse-gram.y"
2660 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2661 /* Line 1700 of yacc.c */
2662 #line 2663 "src/parse-gram.c"
2666 /* Line 1700 of yacc.c */
2667 #line 529 "src/parse-gram.y"
2668 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2669 /* Line 1700 of yacc.c */
2670 #line 2671 "src/parse-gram.c"
2674 /* Line 1700 of yacc.c */
2675 #line 534 "src/parse-gram.y"
2676 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2677 /* Line 1700 of yacc.c */
2678 #line 2679 "src/parse-gram.c"
2682 /* Line 1700 of yacc.c */
2683 #line 535 "src/parse-gram.y"
2684 { (yyval
.uniqstr
) = uniqstr_new (""); }
2685 /* Line 1700 of yacc.c */
2686 #line 2687 "src/parse-gram.c"
2690 /* Line 1700 of yacc.c */
2691 #line 541 "src/parse-gram.y"
2693 current_type
= (yyvsp
[0].uniqstr
);
2696 /* Line 1700 of yacc.c */
2697 #line 2698 "src/parse-gram.c"
2701 /* Line 1700 of yacc.c */
2702 #line 546 "src/parse-gram.y"
2704 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2705 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2707 /* Line 1700 of yacc.c */
2708 #line 2709 "src/parse-gram.c"
2712 /* Line 1700 of yacc.c */
2713 #line 551 "src/parse-gram.y"
2715 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2716 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2717 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2719 /* Line 1700 of yacc.c */
2720 #line 2721 "src/parse-gram.c"
2724 /* Line 1700 of yacc.c */
2725 #line 557 "src/parse-gram.y"
2727 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2728 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2729 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2731 /* Line 1700 of yacc.c */
2732 #line 2733 "src/parse-gram.c"
2736 /* Line 1700 of yacc.c */
2737 #line 563 "src/parse-gram.y"
2739 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2740 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2741 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2742 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2744 /* Line 1700 of yacc.c */
2745 #line 2746 "src/parse-gram.c"
2749 /* Line 1700 of yacc.c */
2750 #line 593 "src/parse-gram.y"
2754 /* Line 1700 of yacc.c */
2755 #line 2756 "src/parse-gram.c"
2759 /* Line 1700 of yacc.c */
2760 #line 599 "src/parse-gram.y"
2761 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2762 /* Line 1700 of yacc.c */
2763 #line 2764 "src/parse-gram.c"
2767 /* Line 1700 of yacc.c */
2768 #line 600 "src/parse-gram.y"
2770 /* Free the current lhs. */
2771 current_lhs (0, (yylsp
[-3]), 0);
2773 /* Line 1700 of yacc.c */
2774 #line 2775 "src/parse-gram.c"
2778 /* Line 1700 of yacc.c */
2779 #line 607 "src/parse-gram.y"
2780 { grammar_current_rule_end ((yylsp
[0])); }
2781 /* Line 1700 of yacc.c */
2782 #line 2783 "src/parse-gram.c"
2786 /* Line 1700 of yacc.c */
2787 #line 608 "src/parse-gram.y"
2788 { grammar_current_rule_end ((yylsp
[0])); }
2789 /* Line 1700 of yacc.c */
2790 #line 2791 "src/parse-gram.c"
2794 /* Line 1700 of yacc.c */
2795 #line 614 "src/parse-gram.y"
2796 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2797 current_lhs_named_ref
); }
2798 /* Line 1700 of yacc.c */
2799 #line 2800 "src/parse-gram.c"
2803 /* Line 1700 of yacc.c */
2804 #line 617 "src/parse-gram.y"
2805 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2806 /* Line 1700 of yacc.c */
2807 #line 2808 "src/parse-gram.c"
2811 /* Line 1700 of yacc.c */
2812 #line 619 "src/parse-gram.y"
2813 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2814 /* Line 1700 of yacc.c */
2815 #line 2816 "src/parse-gram.c"
2819 /* Line 1700 of yacc.c */
2820 #line 621 "src/parse-gram.y"
2821 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2822 /* Line 1700 of yacc.c */
2823 #line 2824 "src/parse-gram.c"
2827 /* Line 1700 of yacc.c */
2828 #line 623 "src/parse-gram.y"
2829 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2830 /* Line 1700 of yacc.c */
2831 #line 2832 "src/parse-gram.c"
2835 /* Line 1700 of yacc.c */
2836 #line 625 "src/parse-gram.y"
2837 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2838 /* Line 1700 of yacc.c */
2839 #line 2840 "src/parse-gram.c"
2843 /* Line 1700 of yacc.c */
2844 #line 627 "src/parse-gram.y"
2845 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2846 /* Line 1700 of yacc.c */
2847 #line 2848 "src/parse-gram.c"
2851 /* Line 1700 of yacc.c */
2852 #line 631 "src/parse-gram.y"
2853 { (yyval
.named_ref
) = 0; }
2854 /* Line 1700 of yacc.c */
2855 #line 2856 "src/parse-gram.c"
2859 /* Line 1700 of yacc.c */
2860 #line 633 "src/parse-gram.y"
2861 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2862 /* Line 1700 of yacc.c */
2863 #line 2864 "src/parse-gram.c"
2867 /* Line 1700 of yacc.c */
2868 #line 644 "src/parse-gram.y"
2869 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2870 /* Line 1700 of yacc.c */
2871 #line 2872 "src/parse-gram.c"
2875 /* Line 1700 of yacc.c */
2876 #line 649 "src/parse-gram.y"
2877 { (yyval
.chars
) = ""; }
2878 /* Line 1700 of yacc.c */
2879 #line 2880 "src/parse-gram.c"
2883 /* Line 1700 of yacc.c */
2884 #line 650 "src/parse-gram.y"
2885 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2886 /* Line 1700 of yacc.c */
2887 #line 2888 "src/parse-gram.c"
2891 /* Line 1700 of yacc.c */
2892 #line 661 "src/parse-gram.y"
2894 code_props plain_code
;
2895 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2896 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2897 code_props_translate_code (&plain_code
);
2898 gram_scanner_last_string_free ();
2899 (yyval
.chars
) = plain_code
.code
;
2901 /* Line 1700 of yacc.c */
2902 #line 2903 "src/parse-gram.c"
2906 /* Line 1700 of yacc.c */
2907 #line 681 "src/parse-gram.y"
2908 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2909 /* Line 1700 of yacc.c */
2910 #line 2911 "src/parse-gram.c"
2914 /* Line 1700 of yacc.c */
2915 #line 683 "src/parse-gram.y"
2917 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2918 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2919 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2921 /* Line 1700 of yacc.c */
2922 #line 2923 "src/parse-gram.c"
2926 /* Line 1700 of yacc.c */
2927 #line 691 "src/parse-gram.y"
2928 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2929 /* Line 1700 of yacc.c */
2930 #line 2931 "src/parse-gram.c"
2934 /* Line 1700 of yacc.c */
2935 #line 703 "src/parse-gram.y"
2937 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2938 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2940 /* Line 1700 of yacc.c */
2941 #line 2942 "src/parse-gram.c"
2945 /* Line 1700 of yacc.c */
2946 #line 712 "src/parse-gram.y"
2948 code_props plain_code
;
2949 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2950 code_props_translate_code (&plain_code
);
2951 gram_scanner_last_string_free ();
2952 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2953 code_scanner_last_string_free ();
2955 /* Line 1700 of yacc.c */
2956 #line 2957 "src/parse-gram.c"
2960 /* Line 1700 of yacc.c */
2961 #line 2962 "src/parse-gram.c"
2964 if (yychar_backup
!= yychar
)
2965 YY_LAC_DISCARD ("yychar change");
2967 /* User semantic actions sometimes alter yychar, and that requires
2968 that yytoken be updated with the new translation. We take the
2969 approach of translating immediately before every use of yytoken.
2970 One alternative is translating here after every semantic action,
2971 but that translation would be missed if the semantic action invokes
2972 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2973 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2974 incorrect destructor might then be invoked immediately. In the
2975 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2976 to an incorrect destructor call or verbose syntax error message
2977 before the lookahead is translated. */
2978 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2982 YY_STACK_PRINT (yyss
, yyssp
);
2987 /* Now `shift' the result of the reduction. Determine what state
2988 that goes to, based on the state we popped back to and the rule
2989 number reduced by. */
2993 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2994 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2995 yystate
= yytable
[yystate
];
2997 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3002 /*--------------------------------------.
3003 | yyerrlab -- here on detecting error. |
3004 `--------------------------------------*/
3006 /* Make sure we have latest lookahead translation. See comments at
3007 user semantic actions for why this is necessary. */
3008 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3010 /* If not already recovering from an error, report this error. */
3014 #if ! YYERROR_VERBOSE
3015 yyerror (YY_("syntax error"));
3017 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3018 yyesa, &yyes, &yyes_capacity, \
3021 char const *yymsgp
= YY_("syntax error");
3022 int yysyntax_error_status
;
3023 if (yychar
!= YYEMPTY
)
3025 yysyntax_error_status
= YYSYNTAX_ERROR
;
3026 if (yysyntax_error_status
== 0)
3028 else if (yysyntax_error_status
== 1)
3030 if (yymsg
!= yymsgbuf
)
3031 YYSTACK_FREE (yymsg
);
3032 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3036 yymsg_alloc
= sizeof yymsgbuf
;
3037 yysyntax_error_status
= 2;
3041 yysyntax_error_status
= YYSYNTAX_ERROR
;
3046 if (yysyntax_error_status
== 2)
3047 goto yyexhaustedlab
;
3049 # undef YYSYNTAX_ERROR
3053 yyerror_range
[1] = yylloc
;
3055 if (yyerrstatus
== 3)
3057 /* If just tried and failed to reuse lookahead token after an
3058 error, discard it. */
3060 if (yychar
<= YYEOF
)
3062 /* Return failure if at end of input. */
3063 if (yychar
== YYEOF
)
3068 yydestruct ("Error: discarding",
3069 yytoken
, &yylval
, &yylloc
);
3074 /* Else will try to reuse lookahead token after shifting the error
3079 /*---------------------------------------------------.
3080 | yyerrorlab -- error raised explicitly by YYERROR. |
3081 `---------------------------------------------------*/
3084 /* Pacify compilers like GCC when the user code never invokes
3085 YYERROR and the label yyerrorlab therefore never appears in user
3087 if (/*CONSTCOND*/ 0)
3090 yyerror_range
[1] = yylsp
[1-yylen
];
3091 /* Do not reclaim the symbols of the rule which action triggered
3095 YY_STACK_PRINT (yyss
, yyssp
);
3100 /*-------------------------------------------------------------.
3101 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3102 `-------------------------------------------------------------*/
3104 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3108 yyn
= yypact
[yystate
];
3109 if (!yypact_value_is_default (yyn
))
3112 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3120 /* Pop the current state because it cannot handle the error token. */
3124 yyerror_range
[1] = *yylsp
;
3125 yydestruct ("Error: popping",
3126 yystos
[yystate
], yyvsp
, yylsp
);
3129 YY_STACK_PRINT (yyss
, yyssp
);
3132 /* If the stack popping above didn't lose the initial context for the
3133 current lookahead token, the shift below will for sure. */
3134 YY_LAC_DISCARD ("error recovery");
3136 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3138 YY_IGNORE_MAYBE_UNINITIALIZED_END
3140 yyerror_range
[2] = yylloc
;
3141 /* Using YYLLOC is tempting, but would change the location of
3142 the lookahead. YYLOC is available though. */
3143 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3146 /* Shift the error token. */
3147 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3153 /*-------------------------------------.
3154 | yyacceptlab -- YYACCEPT comes here. |
3155 `-------------------------------------*/
3160 /*-----------------------------------.
3161 | yyabortlab -- YYABORT comes here. |
3162 `-----------------------------------*/
3168 /*-------------------------------------------------.
3169 | yyexhaustedlab -- memory exhaustion comes here. |
3170 `-------------------------------------------------*/
3172 yyerror (YY_("memory exhausted"));
3178 if (yychar
!= YYEMPTY
)
3180 /* Make sure we have latest lookahead translation. See comments at
3181 user semantic actions for why this is necessary. */
3182 yytoken
= YYTRANSLATE (yychar
);
3183 yydestruct ("Cleanup: discarding lookahead",
3184 yytoken
, &yylval
, &yylloc
);
3186 /* Do not reclaim the symbols of the rule which action triggered
3187 this YYABORT or YYACCEPT. */
3189 YY_STACK_PRINT (yyss
, yyssp
);
3190 while (yyssp
!= yyss
)
3192 yydestruct ("Cleanup: popping",
3193 yystos
[*yyssp
], yyvsp
, yylsp
);
3198 YYSTACK_FREE (yyss
);
3201 YYSTACK_FREE (yyes
);
3203 if (yymsg
!= yymsgbuf
)
3204 YYSTACK_FREE (yymsg
);
3208 /* Line 1960 of yacc.c */
3209 #line 722 "src/parse-gram.y"
3212 /* Return the location of the left-hand side of a rule whose
3213 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3214 the right-hand side, and return an empty location equal to the end
3215 boundary of RHS[0] if the right-hand side is empty. */
3218 lloc_default (YYLTYPE
const *rhs
, int n
)
3223 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3224 The bug is fixed in 7.4.2m, but play it safe for now. */
3225 loc
.start
= rhs
[n
].end
;
3226 loc
.end
= rhs
[n
].end
;
3228 /* Ignore empty nonterminals the start of the right-hand side.
3229 Do not bother to ignore them at the end of the right-hand side,
3230 since empty nonterminals have the same end as their predecessors. */
3231 for (i
= 1; i
<= n
; i
++)
3232 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3234 loc
.start
= rhs
[i
].start
;
3243 add_param (param_type type
, char *decl
, location loc
)
3245 static char const alphanum
[26 + 26 + 1 + 10] =
3246 "abcdefghijklmnopqrstuvwxyz"
3247 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3251 char const *name_start
= NULL
;
3254 /* Stop on last actual character. */
3255 for (p
= decl
; p
[1]; p
++)
3257 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3258 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3261 /* Strip the surrounding '{' and '}', and any blanks just inside
3264 while (c_isspace ((unsigned char) *p
))
3268 while (c_isspace ((unsigned char) *decl
))
3273 complain (&loc
, complaint
, _("missing identifier in parameter declaration"));
3276 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3277 if (type
& param_lex
)
3278 muscle_pair_list_grow ("lex_param", decl
, name
);
3279 if (type
& param_parse
)
3280 muscle_pair_list_grow ("parse_param", decl
, name
);
3284 gram_scanner_last_string_free ();
3289 version_check (location
const *loc
, char const *version
)
3291 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3293 complain (loc
, complaint
, "require bison %s, but have %s",
3294 version
, PACKAGE_VERSION
);
3300 gram_error (location
const *loc
, char const *msg
)
3302 complain (loc
, complaint
, "%s", msg
);
3306 token_name (int type
)
3308 return yytname
[YYTRANSLATE (type
)];
3319 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3320 return quotearg_style (escape_quoting_style
, buf
);