1 /* A Bison parser, made by GNU Bison 2.6.5.977-6d58-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.5.977-6d58-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 355 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 355 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 371 of yacc.c */
172 #line 223 "src/parse-gram.y"
180 param_parse
= 1 << 1,
181 param_both
= param_lex
| param_parse
186 /* Line 371 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 371 of yacc.c */
314 #line 109 "src/parse-gram.y"
320 named_ref
*named_ref
;
324 unsigned char character
;
326 /* Line 371 of yacc.c */
327 #line 247 "src/parse-gram.y"
331 /* Line 371 of yacc.c */
332 #line 423 "src/parse-gram.y"
333 code_props_type code_type
;
335 /* Line 371 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 374 of yacc.c */
362 #line 363 "src/parse-gram.c"
363 /* Unqualified %code blocks. */
364 /* Line 375 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 375 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 375 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")); \
902 /* Error token number */
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])
934 /* YY_LOCATION_PRINT -- Print the location on the stream.
935 This macro was not mandated originally: define only if we know
936 we won't break user code: when these are the locations we know. */
938 #ifndef YY_LOCATION_PRINT
939 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
940 # define YY_LOCATION_PRINT(File, Loc) \
942 fprintf (File, "%d.%d", (Loc).first_line, (Loc).first_column); \
943 if ((Loc).first_line < (Loc).last_line) \
944 fprintf (File, "-%d.%d", (Loc).last_line, (Loc).last_column - 1); \
945 else if ((Loc).first_column < (Loc).last_column - 1) \
946 fprintf (File, "-%d", (Loc).last_column - 1); \
949 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
954 /* YYLEX -- calling `yylex' with the right arguments. */
956 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
958 # define YYLEX yylex (&yylval, &yylloc)
961 /* Enable debugging if requested. */
965 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
966 # define YYFPRINTF fprintf
969 # define YYDPRINTF(Args) \
975 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
979 YYFPRINTF (stderr, "%s ", Title); \
980 yy_symbol_print (stderr, \
981 Type, Value, Location); \
982 YYFPRINTF (stderr, "\n"); \
987 /*--------------------------------.
988 | Print this symbol on YYOUTPUT. |
989 `--------------------------------*/
992 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
994 FILE *yyo
= yyoutput
;
1000 if (yytype
< YYNTOKENS
)
1001 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1006 /* Line 711 of yacc.c */
1007 #line 196 "src/parse-gram.y"
1008 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
1009 /* Line 711 of yacc.c */
1010 #line 1011 "src/parse-gram.c"
1013 case 4: // "integer"
1014 /* Line 711 of yacc.c */
1015 #line 209 "src/parse-gram.y"
1016 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
1017 /* Line 711 of yacc.c */
1018 #line 1019 "src/parse-gram.c"
1021 case 24: // "%<flag>"
1022 /* Line 711 of yacc.c */
1023 #line 205 "src/parse-gram.y"
1024 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1025 /* Line 711 of yacc.c */
1026 #line 1027 "src/parse-gram.c"
1030 /* Line 711 of yacc.c */
1031 #line 198 "src/parse-gram.y"
1032 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1033 /* Line 711 of yacc.c */
1034 #line 1035 "src/parse-gram.c"
1037 case 42: // "[identifier]"
1038 /* Line 711 of yacc.c */
1039 #line 203 "src/parse-gram.y"
1040 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1041 /* Line 711 of yacc.c */
1042 #line 1043 "src/parse-gram.c"
1046 /* Line 711 of yacc.c */
1047 #line 190 "src/parse-gram.y"
1048 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
1049 /* Line 711 of yacc.c */
1050 #line 1051 "src/parse-gram.c"
1053 case 44: // "epilogue"
1054 /* Line 711 of yacc.c */
1055 #line 198 "src/parse-gram.y"
1056 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1057 /* Line 711 of yacc.c */
1058 #line 1059 "src/parse-gram.c"
1061 case 46: // "identifier"
1062 /* Line 711 of yacc.c */
1063 #line 202 "src/parse-gram.y"
1064 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1065 /* Line 711 of yacc.c */
1066 #line 1067 "src/parse-gram.c"
1069 case 47: // "identifier:"
1070 /* Line 711 of yacc.c */
1071 #line 204 "src/parse-gram.y"
1072 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
1073 /* Line 711 of yacc.c */
1074 #line 1075 "src/parse-gram.c"
1077 case 50: // "%{...%}"
1078 /* Line 711 of yacc.c */
1079 #line 198 "src/parse-gram.y"
1080 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1081 /* Line 711 of yacc.c */
1082 #line 1083 "src/parse-gram.c"
1086 /* Line 711 of yacc.c */
1087 #line 206 "src/parse-gram.y"
1088 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1089 /* Line 711 of yacc.c */
1090 #line 1091 "src/parse-gram.c"
1093 case 55: // "%param"
1094 /* Line 711 of yacc.c */
1095 #line 252 "src/parse-gram.y"
1097 switch (((*yyvaluep
).param
))
1099 #define CASE(In, Out) \
1100 case param_ ## In: fputs ("%" #Out, stderr); break
1101 CASE(lex
, lex
-param
);
1102 CASE(parse
, parse
-param
);
1105 case param_none
: aver (false); break;
1108 /* Line 711 of yacc.c */
1109 #line 1110 "src/parse-gram.c"
1112 case 64: // code_props_type
1113 /* Line 711 of yacc.c */
1114 #line 424 "src/parse-gram.y"
1115 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1116 /* Line 711 of yacc.c */
1117 #line 1118 "src/parse-gram.c"
1120 case 73: // symbol.prec
1121 /* Line 711 of yacc.c */
1122 #line 212 "src/parse-gram.y"
1123 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1124 /* Line 711 of yacc.c */
1125 #line 1126 "src/parse-gram.c"
1129 /* Line 711 of yacc.c */
1130 #line 206 "src/parse-gram.y"
1131 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1132 /* Line 711 of yacc.c */
1133 #line 1134 "src/parse-gram.c"
1136 case 87: // variable
1137 /* Line 711 of yacc.c */
1138 #line 202 "src/parse-gram.y"
1139 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1140 /* Line 711 of yacc.c */
1141 #line 1142 "src/parse-gram.c"
1144 case 88: // content.opt
1145 /* Line 711 of yacc.c */
1146 #line 198 "src/parse-gram.y"
1147 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1148 /* Line 711 of yacc.c */
1149 #line 1150 "src/parse-gram.c"
1152 case 89: // braceless
1153 /* Line 711 of yacc.c */
1154 #line 198 "src/parse-gram.y"
1155 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1156 /* Line 711 of yacc.c */
1157 #line 1158 "src/parse-gram.c"
1161 /* Line 711 of yacc.c */
1162 #line 212 "src/parse-gram.y"
1163 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1164 /* Line 711 of yacc.c */
1165 #line 1166 "src/parse-gram.c"
1168 case 91: // id_colon
1169 /* Line 711 of yacc.c */
1170 #line 213 "src/parse-gram.y"
1171 { fprintf (yyo
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1172 /* Line 711 of yacc.c */
1173 #line 1174 "src/parse-gram.c"
1177 /* Line 711 of yacc.c */
1178 #line 212 "src/parse-gram.y"
1179 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1180 /* Line 711 of yacc.c */
1181 #line 1182 "src/parse-gram.c"
1184 case 93: // string_as_id
1185 /* Line 711 of yacc.c */
1186 #line 212 "src/parse-gram.y"
1187 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1188 /* Line 711 of yacc.c */
1189 #line 1190 "src/parse-gram.c"
1198 /*--------------------------------.
1199 | Print this symbol on YYOUTPUT. |
1200 `--------------------------------*/
1203 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1205 if (yytype
< YYNTOKENS
)
1206 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1208 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1210 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1211 YYFPRINTF (yyoutput
, ": ");
1212 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1213 YYFPRINTF (yyoutput
, ")");
1216 /*------------------------------------------------------------------.
1217 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1219 `------------------------------------------------------------------*/
1222 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1224 YYFPRINTF (stderr
, "Stack now");
1225 for (; yybottom
<= yytop
; yybottom
++)
1227 int yybot
= *yybottom
;
1228 YYFPRINTF (stderr
, " %d", yybot
);
1230 YYFPRINTF (stderr
, "\n");
1233 # define YY_STACK_PRINT(Bottom, Top) \
1236 yy_stack_print ((Bottom), (Top)); \
1240 /*------------------------------------------------.
1241 | Report that the YYRULE is going to be reduced. |
1242 `------------------------------------------------*/
1245 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1247 unsigned long int yylno
= yyrline
[yyrule
];
1248 int yynrhs
= yyr2
[yyrule
];
1250 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1252 /* The symbols being reduced. */
1253 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1255 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1256 yy_symbol_print (stderr
,
1257 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1258 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1259 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1260 YYFPRINTF (stderr
, "\n");
1264 # define YY_REDUCE_PRINT(Rule) \
1267 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1270 /* Nonzero means print parse trace. It is left uninitialized so that
1271 multiple parsers can coexist. */
1273 #else /* !GRAM_DEBUG */
1274 # define YYDPRINTF(Args)
1275 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1276 # define YY_STACK_PRINT(Bottom, Top)
1277 # define YY_REDUCE_PRINT(Rule)
1278 #endif /* !GRAM_DEBUG */
1281 /* YYINITDEPTH -- initial size of the parser's stacks. */
1283 # define YYINITDEPTH 200
1286 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1287 if the built-in stack extension method is used).
1289 Do not make this value too large; the results are undefined if
1290 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1291 evaluated with infinite-precision integer arithmetic. */
1294 # define YYMAXDEPTH 10000
1297 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1298 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1299 stack, and such that *YYCAPACITY is the maximum number of elements it
1300 can hold without a reallocation, make sure there is enough room to
1301 store YYADD more elements. If not, allocate a new stack using
1302 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1303 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1304 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1305 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1306 required. Return 1 if memory is exhausted. */
1308 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1310 char const *yydebug_prefix
,
1311 char const *yydebug_suffix
,
1313 yytype_int16
**yybottom
,
1314 yytype_int16
*yybottom_no_free
,
1315 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1317 YYSIZE_T yysize_old
=
1318 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1319 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1320 if (*yycapacity
< yysize_new
)
1322 YYSIZE_T yyalloc
= 2 * yysize_new
;
1323 yytype_int16
*yybottom_new
;
1324 /* Use YYMAXDEPTH for maximum stack size given that the stack
1325 should never need to grow larger than the main state stack
1326 needs to grow without LAC. */
1327 if (YYMAXDEPTH
< yysize_new
)
1329 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1333 if (YYMAXDEPTH
< yyalloc
)
1334 yyalloc
= YYMAXDEPTH
;
1336 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1339 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1343 if (*yytop
!= yytop_empty
)
1345 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1346 *yytop
= yybottom_new
+ (yysize_old
- 1);
1348 if (*yybottom
!= yybottom_no_free
)
1349 YYSTACK_FREE (*yybottom
);
1350 *yybottom
= yybottom_new
;
1351 *yycapacity
= yyalloc
;
1356 /* Establish the initial context for the current lookahead if no initial
1357 context is currently established.
1359 We define a context as a snapshot of the parser stacks. We define
1360 the initial context for a lookahead as the context in which the
1361 parser initially examines that lookahead in order to select a
1362 syntactic action. Thus, if the lookahead eventually proves
1363 syntactically unacceptable (possibly in a later context reached via a
1364 series of reductions), the initial context can be used to determine
1365 the exact set of tokens that would be syntactically acceptable in the
1366 lookahead's place. Moreover, it is the context after which any
1367 further semantic actions would be erroneous because they would be
1368 determined by a syntactically unacceptable token.
1370 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1371 performed in an inconsistent state (which, for the purposes of LAC,
1372 includes consistent states that don't know they're consistent because
1373 their default reductions have been disabled). Iff there is a
1374 lookahead token, it should also be invoked before reporting a syntax
1375 error. This latter case is for the sake of the debugging output.
1377 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1378 follows. If no initial context is currently established for the
1379 current lookahead, then check if that lookahead can eventually be
1380 shifted if syntactic actions continue from the current context.
1381 Report a syntax error if it cannot. */
1382 #define YY_LAC_ESTABLISH \
1384 if (!yy_lac_established) \
1386 YYDPRINTF ((stderr, \
1387 "LAC: initial context established for %s\n", \
1388 yytname[yytoken])); \
1389 yy_lac_established = 1; \
1391 int yy_lac_status = \
1392 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1393 if (yy_lac_status == 2) \
1394 goto yyexhaustedlab; \
1395 if (yy_lac_status == 1) \
1401 /* Discard any previous initial lookahead context because of Event,
1402 which may be a lookahead change or an invalidation of the currently
1403 established initial context for the current lookahead.
1405 The most common example of a lookahead change is a shift. An example
1406 of both cases is syntax error recovery. That is, a syntax error
1407 occurs when the lookahead is syntactically erroneous for the
1408 currently established initial context, so error recovery manipulates
1409 the parser stacks to try to find a new initial context in which the
1410 current lookahead is syntactically acceptable. If it fails to find
1411 such a context, it discards the lookahead. */
1413 # define YY_LAC_DISCARD(Event) \
1415 if (yy_lac_established) \
1418 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1420 yy_lac_established = 0; \
1424 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1427 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1428 eventually (after perhaps some reductions) be shifted, return 1 if
1429 not, or return 2 if memory is exhausted. As preconditions and
1430 postconditions: *YYES_CAPACITY is the allocated size of the array to
1431 which *YYES points, and either *YYES = YYESA or *YYES points to an
1432 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1433 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1434 any old *YYES other than YYESA. */
1436 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1437 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1439 yytype_int16
*yyes_prev
= yyssp
;
1440 yytype_int16
*yyesp
= yyes_prev
;
1441 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1442 if (yytoken
== YYUNDEFTOK
)
1444 YYDPRINTF ((stderr
, " Always Err\n"));
1449 int yyrule
= yypact
[*yyesp
];
1450 if (yypact_value_is_default (yyrule
)
1451 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1452 || yycheck
[yyrule
] != yytoken
)
1454 yyrule
= yydefact
[*yyesp
];
1457 YYDPRINTF ((stderr
, " Err\n"));
1463 yyrule
= yytable
[yyrule
];
1464 if (yytable_value_is_error (yyrule
))
1466 YYDPRINTF ((stderr
, " Err\n"));
1471 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1477 YYSIZE_T yylen
= yyr2
[yyrule
];
1478 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1479 if (yyesp
!= yyes_prev
)
1481 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1494 yyesp
= yyes_prev
-= yylen
;
1499 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1500 yystate
= yypgoto
[yylhs
] + *yyesp
;
1501 if (yystate
< 0 || YYLAST
< yystate
1502 || yycheck
[yystate
] != *yyesp
)
1503 yystate
= yydefgoto
[yylhs
];
1505 yystate
= yytable
[yystate
];
1507 if (yyesp
== yyes_prev
)
1514 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1518 yyes
, yyesa
, &yyesp
, yyes_prev
))
1520 YYDPRINTF ((stderr
, "\n"));
1525 YYDPRINTF ((stderr
, " G%d", yystate
));
1534 # if defined __GLIBC__ && defined _STRING_H
1535 # define yystrlen strlen
1537 /* Return the length of YYSTR. */
1539 yystrlen (const char *yystr
)
1542 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1550 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1551 # define yystpcpy stpcpy
1553 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1556 yystpcpy (char *yydest
, const char *yysrc
)
1559 const char *yys
= yysrc
;
1561 while ((*yyd
++ = *yys
++) != '\0')
1570 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1571 quotes and backslashes, so that it's suitable for yyerror. The
1572 heuristic is that double-quoting is unnecessary unless the string
1573 contains an apostrophe, a comma, or backslash (other than
1574 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1575 null, do not copy; instead, return the length of what the result
1578 yytnamerr (char *yyres
, const char *yystr
)
1583 char const *yyp
= yystr
;
1590 goto do_not_strip_quotes
;
1594 goto do_not_strip_quotes
;
1607 do_not_strip_quotes
: ;
1611 return yystrlen (yystr
);
1613 return yystpcpy (yyres
, yystr
) - yyres
;
1617 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1618 about the unexpected token YYTOKEN for the state stack whose top is
1619 YYSSP. In order to see if a particular token T is a
1620 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1622 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1623 not large enough to hold the message. In that case, also set
1624 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1625 required number of bytes is too large to store or if
1626 yy_lac returned 2. */
1628 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1629 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1630 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1632 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1633 YYSIZE_T yysize
= yysize0
;
1635 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1636 /* Internationalized format string. */
1637 const char *yyformat
= YY_NULL
;
1638 /* Arguments of yyformat. */
1639 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1640 /* Number of reported tokens (one for the "unexpected", one per
1644 /* There are many possibilities here to consider:
1645 - If this state is a consistent state with a default action, then
1646 the only way this function was invoked is if the default action
1647 is an error action. In that case, don't check for expected
1648 tokens because there are none.
1649 - The only way there can be no lookahead present (in yychar) is if
1650 this state is a consistent state with a default action. Thus,
1651 detecting the absence of a lookahead is sufficient to determine
1652 that there is no unexpected or expected token to report. In that
1653 case, just report a simple "syntax error".
1654 - Don't assume there isn't a lookahead just because this state is a
1655 consistent state with a default action. There might have been a
1656 previous inconsistent state, consistent state with a non-default
1657 action, or user semantic action that manipulated yychar.
1658 In the first two cases, it might appear that the current syntax
1659 error should have been detected in the previous state when yy_lac
1660 was invoked. However, at that time, there might have been a
1661 different syntax error that discarded a different initial context
1662 during error recovery, leaving behind the current lookahead.
1664 if (yytoken
!= YYEMPTY
)
1666 int yyn
= yypact
[*yyssp
];
1667 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1668 yyarg
[yycount
++] = yytname
[yytoken
];
1669 if (!yypact_value_is_default (yyn
))
1673 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1674 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1677 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1679 if (yy_lac_status
== 2)
1681 if (yy_lac_status
== 1)
1684 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1690 yyarg
[yycount
++] = yytname
[yyx
];
1691 yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1692 if (! (yysize
<= yysize1
1693 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1700 YYFPRINTF (stderr
, "No expected tokens.\n");
1706 # define YYCASE_(N, S) \
1710 YYCASE_(0, YY_("syntax error"));
1711 YYCASE_(1, YY_("syntax error, unexpected %s"));
1712 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1713 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1714 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1715 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1719 yysize1
= yysize
+ yystrlen (yyformat
);
1720 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1724 if (*yymsg_alloc
< yysize
)
1726 *yymsg_alloc
= 2 * yysize
;
1727 if (! (yysize
<= *yymsg_alloc
1728 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1729 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1733 /* Avoid sprintf, as that infringes on the user's name space.
1734 Don't have undefined behavior even if the translation
1735 produced a string with the wrong number of "%s"s. */
1739 while ((*yyp
= *yyformat
) != '\0')
1740 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1742 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1753 #endif /* YYERROR_VERBOSE */
1755 /*-----------------------------------------------.
1756 | Release the memory associated to this symbol. |
1757 `-----------------------------------------------*/
1760 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1763 YYUSE (yylocationp
);
1766 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1785 /* The lookahead symbol. */
1789 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1790 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1791 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1792 _Pragma ("GCC diagnostic push") \
1793 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1794 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1795 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1796 _Pragma ("GCC diagnostic pop")
1798 /* Default value used for initialization, for pacifying older GCCs
1799 or non-GCC compilers. */
1800 static YYSTYPE yyval_default
;
1801 # define YY_INITIAL_VALUE(Value) = Value
1803 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1804 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1805 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1807 #ifndef YY_INITIAL_VALUE
1808 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1811 /* The semantic value of the lookahead symbol. */
1812 YYSTYPE yylval
YY_INITIAL_VALUE(yyval_default
);
1814 /* Location data for the lookahead symbol. */
1816 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
1822 /* Number of syntax errors so far. */
1826 /* Number of tokens to shift before error messages enabled. */
1829 /* The stacks and their tools:
1830 `yyss': related to states.
1831 `yyvs': related to semantic values.
1832 `yyls': related to locations.
1834 Refer to the stacks through separate pointers, to allow yyoverflow
1835 to reallocate them elsewhere. */
1837 /* The state stack. */
1838 yytype_int16 yyssa
[YYINITDEPTH
];
1840 yytype_int16
*yyssp
;
1842 /* The semantic value stack. */
1843 YYSTYPE yyvsa
[YYINITDEPTH
];
1847 /* The location stack. */
1848 YYLTYPE yylsa
[YYINITDEPTH
];
1852 /* The locations where the error started and ended. */
1853 YYLTYPE yyerror_range
[3];
1855 YYSIZE_T yystacksize
;
1857 yytype_int16 yyesa
[20];
1859 YYSIZE_T yyes_capacity
;
1861 int yy_lac_established
= 0;
1864 /* Lookahead token as an internal (translated) token number. */
1866 /* The variables used to return semantic value and location from the
1872 /* Buffer for error messages, and its allocated size. */
1874 char *yymsg
= yymsgbuf
;
1875 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1878 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1880 /* The number of symbols on the RHS of the reduced rule.
1881 Keep to zero when no symbol should be popped. */
1884 yyssp
= yyss
= yyssa
;
1885 yyvsp
= yyvs
= yyvsa
;
1886 yylsp
= yyls
= yylsa
;
1887 yystacksize
= YYINITDEPTH
;
1890 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1891 if (YYMAXDEPTH
< yyes_capacity
)
1892 yyes_capacity
= YYMAXDEPTH
;
1894 YYDPRINTF ((stderr
, "Starting parse\n"));
1899 yychar
= YYEMPTY
; /* Cause a token to be read. */
1901 /* User initialization code. */
1902 /* Line 1452 of yacc.c */
1903 #line 101 "src/parse-gram.y"
1905 /* Bison's grammar can initial empty locations, hence a default
1906 location is needed. */
1907 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1908 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1910 /* Line 1452 of yacc.c */
1911 #line 1912 "src/parse-gram.c"
1915 /*------------------------------------------------------------.
1916 | yynewstate -- Push a new state, which is found in yystate. |
1917 `------------------------------------------------------------*/
1919 /* In all cases, when you get here, the value and location stacks
1920 have just been pushed. So pushing a state here evens the stacks. */
1926 if (yyss
+ yystacksize
- 1 <= yyssp
)
1928 /* Get the current used size of the three stacks, in elements. */
1929 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1933 /* Give user a chance to reallocate the stack. Use copies of
1934 these so that the &'s don't force the real ones into
1936 YYSTYPE
*yyvs1
= yyvs
;
1937 yytype_int16
*yyss1
= yyss
;
1938 YYLTYPE
*yyls1
= yyls
;
1940 /* Each stack pointer address is followed by the size of the
1941 data in use in that stack, in bytes. This used to be a
1942 conditional around just the two extra args, but that might
1943 be undefined if yyoverflow is a macro. */
1944 yyoverflow (YY_("memory exhausted"),
1945 &yyss1
, yysize
* sizeof (*yyssp
),
1946 &yyvs1
, yysize
* sizeof (*yyvsp
),
1947 &yyls1
, yysize
* sizeof (*yylsp
),
1954 #else /* no yyoverflow */
1955 # ifndef YYSTACK_RELOCATE
1956 goto yyexhaustedlab
;
1958 /* Extend the stack our own way. */
1959 if (YYMAXDEPTH
<= yystacksize
)
1960 goto yyexhaustedlab
;
1962 if (YYMAXDEPTH
< yystacksize
)
1963 yystacksize
= YYMAXDEPTH
;
1966 yytype_int16
*yyss1
= yyss
;
1967 union yyalloc
*yyptr
=
1968 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1970 goto yyexhaustedlab
;
1971 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1972 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1973 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1974 # undef YYSTACK_RELOCATE
1976 YYSTACK_FREE (yyss1
);
1979 #endif /* no yyoverflow */
1981 yyssp
= yyss
+ yysize
- 1;
1982 yyvsp
= yyvs
+ yysize
- 1;
1983 yylsp
= yyls
+ yysize
- 1;
1985 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1986 (unsigned long int) yystacksize
));
1988 if (yyss
+ yystacksize
- 1 <= yyssp
)
1992 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1994 if (yystate
== YYFINAL
)
2004 /* Do appropriate processing given the current state. Read a
2005 lookahead token if we need one and don't already have one. */
2007 /* First try to decide what to do without reference to lookahead token. */
2008 yyn
= yypact
[yystate
];
2009 if (yypact_value_is_default (yyn
))
2012 /* Not known => get a lookahead token if don't already have one. */
2014 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2015 if (yychar
== YYEMPTY
)
2017 YYDPRINTF ((stderr
, "Reading a token: "));
2021 if (yychar
<= YYEOF
)
2023 yychar
= yytoken
= YYEOF
;
2024 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2028 yytoken
= YYTRANSLATE (yychar
);
2029 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2032 /* If the proper action on seeing token YYTOKEN is to reduce or to
2033 detect an error, take that action. */
2035 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2043 if (yytable_value_is_error (yyn
))
2050 /* Count tokens shifted since error; after three, turn off error
2055 /* Shift the lookahead token. */
2056 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2058 /* Discard the shifted token. */
2060 YY_LAC_DISCARD ("shift");
2063 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2065 YY_IGNORE_MAYBE_UNINITIALIZED_END
2070 /*-----------------------------------------------------------.
2071 | yydefault -- do the default action for the current state. |
2072 `-----------------------------------------------------------*/
2074 yyn
= yydefact
[yystate
];
2080 /*-----------------------------.
2081 | yyreduce -- Do a reduction. |
2082 `-----------------------------*/
2084 /* yyn is the number of a rule to reduce with. */
2087 /* If YYLEN is nonzero, implement the default value of the action:
2090 Otherwise, the following line sets YYVAL to garbage.
2091 This behavior is undocumented and Bison
2092 users should not rely upon it. Assigning to YYVAL
2093 unconditionally makes the parser a bit smaller, and it avoids a
2094 GCC warning that YYVAL may be used uninitialized. */
2095 yyval
= yyvsp
[1-yylen
];
2097 /* Default location. */
2098 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2099 YY_REDUCE_PRINT (yyn
);
2101 int yychar_backup
= yychar
;
2105 /* Line 1670 of yacc.c */
2106 #line 288 "src/parse-gram.y"
2108 code_props plain_code
;
2109 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2110 code_props_translate_code (&plain_code
);
2111 gram_scanner_last_string_free ();
2112 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2113 plain_code
.code
, (yylsp
[0]));
2114 code_scanner_last_string_free ();
2116 /* Line 1670 of yacc.c */
2117 #line 2118 "src/parse-gram.c"
2121 /* Line 1670 of yacc.c */
2122 #line 298 "src/parse-gram.y"
2124 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2126 /* Line 1670 of yacc.c */
2127 #line 2128 "src/parse-gram.c"
2131 /* Line 1670 of yacc.c */
2132 #line 302 "src/parse-gram.y"
2134 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2135 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2137 /* Line 1670 of yacc.c */
2138 #line 2139 "src/parse-gram.c"
2142 /* Line 1670 of yacc.c */
2143 #line 306 "src/parse-gram.y"
2144 { defines_flag
= true; }
2145 /* Line 1670 of yacc.c */
2146 #line 2147 "src/parse-gram.c"
2150 /* Line 1670 of yacc.c */
2151 #line 308 "src/parse-gram.y"
2153 defines_flag
= true;
2154 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2156 /* Line 1670 of yacc.c */
2157 #line 2158 "src/parse-gram.c"
2161 /* Line 1670 of yacc.c */
2162 #line 313 "src/parse-gram.y"
2164 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2165 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2167 /* Line 1670 of yacc.c */
2168 #line 2169 "src/parse-gram.c"
2172 /* Line 1670 of yacc.c */
2173 #line 317 "src/parse-gram.y"
2174 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2175 /* Line 1670 of yacc.c */
2176 #line 2177 "src/parse-gram.c"
2180 /* Line 1670 of yacc.c */
2181 #line 318 "src/parse-gram.y"
2182 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2183 /* Line 1670 of yacc.c */
2184 #line 2185 "src/parse-gram.c"
2188 /* Line 1670 of yacc.c */
2189 #line 319 "src/parse-gram.y"
2190 { spec_file_prefix
= (yyvsp
[0].chars
); }
2191 /* Line 1670 of yacc.c */
2192 #line 2193 "src/parse-gram.c"
2196 /* Line 1670 of yacc.c */
2197 #line 321 "src/parse-gram.y"
2199 nondeterministic_parser
= true;
2202 /* Line 1670 of yacc.c */
2203 #line 2204 "src/parse-gram.c"
2207 /* Line 1670 of yacc.c */
2208 #line 326 "src/parse-gram.y"
2211 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2212 code_props_translate_code (&action
);
2213 gram_scanner_last_string_free ();
2214 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2215 code_scanner_last_string_free ();
2217 /* Line 1670 of yacc.c */
2218 #line 2219 "src/parse-gram.c"
2222 /* Line 1670 of yacc.c */
2223 #line 334 "src/parse-gram.y"
2224 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2225 /* Line 1670 of yacc.c */
2226 #line 2227 "src/parse-gram.c"
2230 /* Line 1670 of yacc.c */
2231 #line 335 "src/parse-gram.y"
2232 { spec_name_prefix
= (yyvsp
[0].chars
); }
2233 /* Line 1670 of yacc.c */
2234 #line 2235 "src/parse-gram.c"
2238 /* Line 1670 of yacc.c */
2239 #line 336 "src/parse-gram.y"
2240 { no_lines_flag
= true; }
2241 /* Line 1670 of yacc.c */
2242 #line 2243 "src/parse-gram.c"
2246 /* Line 1670 of yacc.c */
2247 #line 337 "src/parse-gram.y"
2248 { nondeterministic_parser
= true; }
2249 /* Line 1670 of yacc.c */
2250 #line 2251 "src/parse-gram.c"
2254 /* Line 1670 of yacc.c */
2255 #line 338 "src/parse-gram.y"
2256 { spec_outfile
= (yyvsp
[0].chars
); }
2257 /* Line 1670 of yacc.c */
2258 #line 2259 "src/parse-gram.c"
2262 /* Line 1670 of yacc.c */
2263 #line 339 "src/parse-gram.y"
2264 { current_param
= (yyvsp
[0].param
); }
2265 /* Line 1670 of yacc.c */
2266 #line 2267 "src/parse-gram.c"
2270 /* Line 1670 of yacc.c */
2271 #line 339 "src/parse-gram.y"
2272 { current_param
= param_none
; }
2273 /* Line 1670 of yacc.c */
2274 #line 2275 "src/parse-gram.c"
2278 /* Line 1670 of yacc.c */
2279 #line 340 "src/parse-gram.y"
2280 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2281 /* Line 1670 of yacc.c */
2282 #line 2283 "src/parse-gram.c"
2286 /* Line 1670 of yacc.c */
2287 #line 342 "src/parse-gram.y"
2289 char const *skeleton_user
= (yyvsp
[0].chars
);
2290 if (strchr (skeleton_user
, '/'))
2292 size_t dir_length
= strlen (current_file
);
2293 char *skeleton_build
;
2294 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2296 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2299 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2302 memcpy (skeleton_build
, current_file
, dir_length
);
2303 skeleton_build
[dir_length
++] = '/';
2305 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2306 skeleton_user
= uniqstr_new (skeleton_build
);
2307 free (skeleton_build
);
2309 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2311 /* Line 1670 of yacc.c */
2312 #line 2313 "src/parse-gram.c"
2316 /* Line 1670 of yacc.c */
2317 #line 365 "src/parse-gram.y"
2318 { token_table_flag
= true; }
2319 /* Line 1670 of yacc.c */
2320 #line 2321 "src/parse-gram.c"
2324 /* Line 1670 of yacc.c */
2325 #line 366 "src/parse-gram.y"
2326 { report_flag
|= report_states
; }
2327 /* Line 1670 of yacc.c */
2328 #line 2329 "src/parse-gram.c"
2332 /* Line 1670 of yacc.c */
2333 #line 367 "src/parse-gram.y"
2334 { yacc_flag
= true; }
2335 /* Line 1670 of yacc.c */
2336 #line 2337 "src/parse-gram.c"
2340 /* Line 1670 of yacc.c */
2341 #line 372 "src/parse-gram.y"
2342 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2343 /* Line 1670 of yacc.c */
2344 #line 2345 "src/parse-gram.c"
2348 /* Line 1670 of yacc.c */
2349 #line 373 "src/parse-gram.y"
2350 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2351 /* Line 1670 of yacc.c */
2352 #line 2353 "src/parse-gram.c"
2356 /* Line 1670 of yacc.c */
2357 #line 385 "src/parse-gram.y"
2359 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2361 /* Line 1670 of yacc.c */
2362 #line 2363 "src/parse-gram.c"
2366 /* Line 1670 of yacc.c */
2367 #line 389 "src/parse-gram.y"
2370 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2371 code_props_translate_code (&code
);
2374 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2375 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2376 symbol_list_free ((yyvsp
[0].list
));
2379 /* Line 1670 of yacc.c */
2380 #line 2381 "src/parse-gram.c"
2384 /* Line 1670 of yacc.c */
2385 #line 401 "src/parse-gram.y"
2387 default_prec
= true;
2389 /* Line 1670 of yacc.c */
2390 #line 2391 "src/parse-gram.c"
2394 /* Line 1670 of yacc.c */
2395 #line 405 "src/parse-gram.y"
2397 default_prec
= false;
2399 /* Line 1670 of yacc.c */
2400 #line 2401 "src/parse-gram.c"
2404 /* Line 1670 of yacc.c */
2405 #line 409 "src/parse-gram.y"
2407 /* Do not invoke muscle_percent_code_grow here since it invokes
2408 muscle_user_name_list_grow. */
2409 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2410 code_scanner_last_string_free ();
2412 /* Line 1670 of yacc.c */
2413 #line 2414 "src/parse-gram.c"
2417 /* Line 1670 of yacc.c */
2418 #line 416 "src/parse-gram.y"
2420 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2421 code_scanner_last_string_free ();
2423 /* Line 1670 of yacc.c */
2424 #line 2425 "src/parse-gram.c"
2428 /* Line 1670 of yacc.c */
2429 #line 426 "src/parse-gram.y"
2430 { (yyval
.code_type
) = destructor
; }
2431 /* Line 1670 of yacc.c */
2432 #line 2433 "src/parse-gram.c"
2436 /* Line 1670 of yacc.c */
2437 #line 427 "src/parse-gram.y"
2438 { (yyval
.code_type
) = printer
; }
2439 /* Line 1670 of yacc.c */
2440 #line 2441 "src/parse-gram.c"
2444 /* Line 1670 of yacc.c */
2445 #line 437 "src/parse-gram.y"
2447 /* Line 1670 of yacc.c */
2448 #line 2449 "src/parse-gram.c"
2452 /* Line 1670 of yacc.c */
2453 #line 438 "src/parse-gram.y"
2454 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2455 /* Line 1670 of yacc.c */
2456 #line 2457 "src/parse-gram.c"
2460 /* Line 1670 of yacc.c */
2461 #line 443 "src/parse-gram.y"
2464 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2465 code_scanner_last_string_free ();
2467 /* Line 1670 of yacc.c */
2468 #line 2469 "src/parse-gram.c"
2472 /* Line 1670 of yacc.c */
2473 #line 454 "src/parse-gram.y"
2474 { current_class
= nterm_sym
; }
2475 /* Line 1670 of yacc.c */
2476 #line 2477 "src/parse-gram.c"
2480 /* Line 1670 of yacc.c */
2481 #line 455 "src/parse-gram.y"
2483 current_class
= unknown_sym
;
2484 current_type
= NULL
;
2486 /* Line 1670 of yacc.c */
2487 #line 2488 "src/parse-gram.c"
2491 /* Line 1670 of yacc.c */
2492 #line 459 "src/parse-gram.y"
2493 { current_class
= token_sym
; }
2494 /* Line 1670 of yacc.c */
2495 #line 2496 "src/parse-gram.c"
2499 /* Line 1670 of yacc.c */
2500 #line 460 "src/parse-gram.y"
2502 current_class
= unknown_sym
;
2503 current_type
= NULL
;
2505 /* Line 1670 of yacc.c */
2506 #line 2507 "src/parse-gram.c"
2510 /* Line 1670 of yacc.c */
2511 #line 465 "src/parse-gram.y"
2515 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2516 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2517 symbol_list_free ((yyvsp
[0].list
));
2519 /* Line 1670 of yacc.c */
2520 #line 2521 "src/parse-gram.c"
2524 /* Line 1670 of yacc.c */
2525 #line 476 "src/parse-gram.y"
2529 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2531 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2532 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2534 symbol_list_free ((yyvsp
[0].list
));
2535 current_type
= NULL
;
2537 /* Line 1670 of yacc.c */
2538 #line 2539 "src/parse-gram.c"
2542 /* Line 1670 of yacc.c */
2543 #line 490 "src/parse-gram.y"
2544 { (yyval
.assoc
) = left_assoc
; }
2545 /* Line 1670 of yacc.c */
2546 #line 2547 "src/parse-gram.c"
2550 /* Line 1670 of yacc.c */
2551 #line 491 "src/parse-gram.y"
2552 { (yyval
.assoc
) = right_assoc
; }
2553 /* Line 1670 of yacc.c */
2554 #line 2555 "src/parse-gram.c"
2558 /* Line 1670 of yacc.c */
2559 #line 492 "src/parse-gram.y"
2560 { (yyval
.assoc
) = non_assoc
; }
2561 /* Line 1670 of yacc.c */
2562 #line 2563 "src/parse-gram.c"
2566 /* Line 1670 of yacc.c */
2567 #line 493 "src/parse-gram.y"
2568 { (yyval
.assoc
) = precedence_assoc
; }
2569 /* Line 1670 of yacc.c */
2570 #line 2571 "src/parse-gram.c"
2574 /* Line 1670 of yacc.c */
2575 #line 497 "src/parse-gram.y"
2576 { current_type
= NULL
; }
2577 /* Line 1670 of yacc.c */
2578 #line 2579 "src/parse-gram.c"
2582 /* Line 1670 of yacc.c */
2583 #line 498 "src/parse-gram.y"
2584 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2585 /* Line 1670 of yacc.c */
2586 #line 2587 "src/parse-gram.c"
2590 /* Line 1670 of yacc.c */
2591 #line 504 "src/parse-gram.y"
2592 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2593 /* Line 1670 of yacc.c */
2594 #line 2595 "src/parse-gram.c"
2598 /* Line 1670 of yacc.c */
2599 #line 506 "src/parse-gram.y"
2600 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2601 /* Line 1670 of yacc.c */
2602 #line 2603 "src/parse-gram.c"
2606 /* Line 1670 of yacc.c */
2607 #line 510 "src/parse-gram.y"
2608 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2609 /* Line 1670 of yacc.c */
2610 #line 2611 "src/parse-gram.c"
2614 /* Line 1670 of yacc.c */
2615 #line 511 "src/parse-gram.y"
2616 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2617 /* Line 1670 of yacc.c */
2618 #line 2619 "src/parse-gram.c"
2622 /* Line 1670 of yacc.c */
2623 #line 517 "src/parse-gram.y"
2624 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2625 /* Line 1670 of yacc.c */
2626 #line 2627 "src/parse-gram.c"
2630 /* Line 1670 of yacc.c */
2631 #line 519 "src/parse-gram.y"
2632 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2633 /* Line 1670 of yacc.c */
2634 #line 2635 "src/parse-gram.c"
2638 /* Line 1670 of yacc.c */
2639 #line 523 "src/parse-gram.y"
2640 { (yyval
.list
) = (yyvsp
[0].list
); }
2641 /* Line 1670 of yacc.c */
2642 #line 2643 "src/parse-gram.c"
2646 /* Line 1670 of yacc.c */
2647 #line 524 "src/parse-gram.y"
2648 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2649 /* Line 1670 of yacc.c */
2650 #line 2651 "src/parse-gram.c"
2654 /* Line 1670 of yacc.c */
2655 #line 528 "src/parse-gram.y"
2656 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2657 /* Line 1670 of yacc.c */
2658 #line 2659 "src/parse-gram.c"
2662 /* Line 1670 of yacc.c */
2663 #line 529 "src/parse-gram.y"
2664 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2665 /* Line 1670 of yacc.c */
2666 #line 2667 "src/parse-gram.c"
2670 /* Line 1670 of yacc.c */
2671 #line 534 "src/parse-gram.y"
2672 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2673 /* Line 1670 of yacc.c */
2674 #line 2675 "src/parse-gram.c"
2678 /* Line 1670 of yacc.c */
2679 #line 535 "src/parse-gram.y"
2680 { (yyval
.uniqstr
) = uniqstr_new (""); }
2681 /* Line 1670 of yacc.c */
2682 #line 2683 "src/parse-gram.c"
2686 /* Line 1670 of yacc.c */
2687 #line 541 "src/parse-gram.y"
2689 current_type
= (yyvsp
[0].uniqstr
);
2692 /* Line 1670 of yacc.c */
2693 #line 2694 "src/parse-gram.c"
2697 /* Line 1670 of yacc.c */
2698 #line 546 "src/parse-gram.y"
2700 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2701 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2703 /* Line 1670 of yacc.c */
2704 #line 2705 "src/parse-gram.c"
2708 /* Line 1670 of yacc.c */
2709 #line 551 "src/parse-gram.y"
2711 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2712 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2713 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2715 /* Line 1670 of yacc.c */
2716 #line 2717 "src/parse-gram.c"
2720 /* Line 1670 of yacc.c */
2721 #line 557 "src/parse-gram.y"
2723 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2724 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2725 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2727 /* Line 1670 of yacc.c */
2728 #line 2729 "src/parse-gram.c"
2732 /* Line 1670 of yacc.c */
2733 #line 563 "src/parse-gram.y"
2735 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2736 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2737 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2738 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2740 /* Line 1670 of yacc.c */
2741 #line 2742 "src/parse-gram.c"
2745 /* Line 1670 of yacc.c */
2746 #line 593 "src/parse-gram.y"
2750 /* Line 1670 of yacc.c */
2751 #line 2752 "src/parse-gram.c"
2755 /* Line 1670 of yacc.c */
2756 #line 599 "src/parse-gram.y"
2757 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2758 /* Line 1670 of yacc.c */
2759 #line 2760 "src/parse-gram.c"
2763 /* Line 1670 of yacc.c */
2764 #line 600 "src/parse-gram.y"
2766 /* Free the current lhs. */
2767 current_lhs (0, (yylsp
[-3]), 0);
2769 /* Line 1670 of yacc.c */
2770 #line 2771 "src/parse-gram.c"
2774 /* Line 1670 of yacc.c */
2775 #line 607 "src/parse-gram.y"
2776 { grammar_current_rule_end ((yylsp
[0])); }
2777 /* Line 1670 of yacc.c */
2778 #line 2779 "src/parse-gram.c"
2782 /* Line 1670 of yacc.c */
2783 #line 608 "src/parse-gram.y"
2784 { grammar_current_rule_end ((yylsp
[0])); }
2785 /* Line 1670 of yacc.c */
2786 #line 2787 "src/parse-gram.c"
2790 /* Line 1670 of yacc.c */
2791 #line 614 "src/parse-gram.y"
2792 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2793 current_lhs_named_ref
); }
2794 /* Line 1670 of yacc.c */
2795 #line 2796 "src/parse-gram.c"
2799 /* Line 1670 of yacc.c */
2800 #line 617 "src/parse-gram.y"
2801 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2802 /* Line 1670 of yacc.c */
2803 #line 2804 "src/parse-gram.c"
2807 /* Line 1670 of yacc.c */
2808 #line 619 "src/parse-gram.y"
2809 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2810 /* Line 1670 of yacc.c */
2811 #line 2812 "src/parse-gram.c"
2815 /* Line 1670 of yacc.c */
2816 #line 621 "src/parse-gram.y"
2817 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2818 /* Line 1670 of yacc.c */
2819 #line 2820 "src/parse-gram.c"
2823 /* Line 1670 of yacc.c */
2824 #line 623 "src/parse-gram.y"
2825 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2826 /* Line 1670 of yacc.c */
2827 #line 2828 "src/parse-gram.c"
2831 /* Line 1670 of yacc.c */
2832 #line 625 "src/parse-gram.y"
2833 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2834 /* Line 1670 of yacc.c */
2835 #line 2836 "src/parse-gram.c"
2839 /* Line 1670 of yacc.c */
2840 #line 627 "src/parse-gram.y"
2841 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2842 /* Line 1670 of yacc.c */
2843 #line 2844 "src/parse-gram.c"
2847 /* Line 1670 of yacc.c */
2848 #line 631 "src/parse-gram.y"
2849 { (yyval
.named_ref
) = 0; }
2850 /* Line 1670 of yacc.c */
2851 #line 2852 "src/parse-gram.c"
2855 /* Line 1670 of yacc.c */
2856 #line 633 "src/parse-gram.y"
2857 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2858 /* Line 1670 of yacc.c */
2859 #line 2860 "src/parse-gram.c"
2863 /* Line 1670 of yacc.c */
2864 #line 644 "src/parse-gram.y"
2865 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2866 /* Line 1670 of yacc.c */
2867 #line 2868 "src/parse-gram.c"
2871 /* Line 1670 of yacc.c */
2872 #line 649 "src/parse-gram.y"
2873 { (yyval
.chars
) = ""; }
2874 /* Line 1670 of yacc.c */
2875 #line 2876 "src/parse-gram.c"
2879 /* Line 1670 of yacc.c */
2880 #line 650 "src/parse-gram.y"
2881 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2882 /* Line 1670 of yacc.c */
2883 #line 2884 "src/parse-gram.c"
2887 /* Line 1670 of yacc.c */
2888 #line 661 "src/parse-gram.y"
2890 code_props plain_code
;
2891 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2892 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2893 code_props_translate_code (&plain_code
);
2894 gram_scanner_last_string_free ();
2895 (yyval
.chars
) = plain_code
.code
;
2897 /* Line 1670 of yacc.c */
2898 #line 2899 "src/parse-gram.c"
2902 /* Line 1670 of yacc.c */
2903 #line 681 "src/parse-gram.y"
2904 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2905 /* Line 1670 of yacc.c */
2906 #line 2907 "src/parse-gram.c"
2910 /* Line 1670 of yacc.c */
2911 #line 683 "src/parse-gram.y"
2913 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2914 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2915 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2917 /* Line 1670 of yacc.c */
2918 #line 2919 "src/parse-gram.c"
2922 /* Line 1670 of yacc.c */
2923 #line 691 "src/parse-gram.y"
2924 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2925 /* Line 1670 of yacc.c */
2926 #line 2927 "src/parse-gram.c"
2930 /* Line 1670 of yacc.c */
2931 #line 703 "src/parse-gram.y"
2933 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2934 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2936 /* Line 1670 of yacc.c */
2937 #line 2938 "src/parse-gram.c"
2941 /* Line 1670 of yacc.c */
2942 #line 712 "src/parse-gram.y"
2944 code_props plain_code
;
2945 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2946 code_props_translate_code (&plain_code
);
2947 gram_scanner_last_string_free ();
2948 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2949 code_scanner_last_string_free ();
2951 /* Line 1670 of yacc.c */
2952 #line 2953 "src/parse-gram.c"
2956 /* Line 1670 of yacc.c */
2957 #line 2958 "src/parse-gram.c"
2960 if (yychar_backup
!= yychar
)
2961 YY_LAC_DISCARD ("yychar change");
2963 /* User semantic actions sometimes alter yychar, and that requires
2964 that yytoken be updated with the new translation. We take the
2965 approach of translating immediately before every use of yytoken.
2966 One alternative is translating here after every semantic action,
2967 but that translation would be missed if the semantic action invokes
2968 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2969 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2970 incorrect destructor might then be invoked immediately. In the
2971 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2972 to an incorrect destructor call or verbose syntax error message
2973 before the lookahead is translated. */
2974 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2978 YY_STACK_PRINT (yyss
, yyssp
);
2983 /* Now `shift' the result of the reduction. Determine what state
2984 that goes to, based on the state we popped back to and the rule
2985 number reduced by. */
2989 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2990 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2991 yystate
= yytable
[yystate
];
2993 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2998 /*--------------------------------------.
2999 | yyerrlab -- here on detecting error. |
3000 `--------------------------------------*/
3002 /* Make sure we have latest lookahead translation. See comments at
3003 user semantic actions for why this is necessary. */
3004 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3006 /* If not already recovering from an error, report this error. */
3010 #if ! YYERROR_VERBOSE
3011 yyerror (YY_("syntax error"));
3013 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3014 yyesa, &yyes, &yyes_capacity, \
3017 char const *yymsgp
= YY_("syntax error");
3018 int yysyntax_error_status
;
3019 if (yychar
!= YYEMPTY
)
3021 yysyntax_error_status
= YYSYNTAX_ERROR
;
3022 if (yysyntax_error_status
== 0)
3024 else if (yysyntax_error_status
== 1)
3026 if (yymsg
!= yymsgbuf
)
3027 YYSTACK_FREE (yymsg
);
3028 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3032 yymsg_alloc
= sizeof yymsgbuf
;
3033 yysyntax_error_status
= 2;
3037 yysyntax_error_status
= YYSYNTAX_ERROR
;
3042 if (yysyntax_error_status
== 2)
3043 goto yyexhaustedlab
;
3045 # undef YYSYNTAX_ERROR
3049 yyerror_range
[1] = yylloc
;
3051 if (yyerrstatus
== 3)
3053 /* If just tried and failed to reuse lookahead token after an
3054 error, discard it. */
3056 if (yychar
<= YYEOF
)
3058 /* Return failure if at end of input. */
3059 if (yychar
== YYEOF
)
3064 yydestruct ("Error: discarding",
3065 yytoken
, &yylval
, &yylloc
);
3070 /* Else will try to reuse lookahead token after shifting the error
3075 /*---------------------------------------------------.
3076 | yyerrorlab -- error raised explicitly by YYERROR. |
3077 `---------------------------------------------------*/
3080 /* Pacify compilers like GCC when the user code never invokes
3081 YYERROR and the label yyerrorlab therefore never appears in user
3083 if (/*CONSTCOND*/ 0)
3086 yyerror_range
[1] = yylsp
[1-yylen
];
3087 /* Do not reclaim the symbols of the rule which action triggered
3091 YY_STACK_PRINT (yyss
, yyssp
);
3096 /*-------------------------------------------------------------.
3097 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3098 `-------------------------------------------------------------*/
3100 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3104 yyn
= yypact
[yystate
];
3105 if (!yypact_value_is_default (yyn
))
3108 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3116 /* Pop the current state because it cannot handle the error token. */
3120 yyerror_range
[1] = *yylsp
;
3121 yydestruct ("Error: popping",
3122 yystos
[yystate
], yyvsp
, yylsp
);
3125 YY_STACK_PRINT (yyss
, yyssp
);
3128 /* If the stack popping above didn't lose the initial context for the
3129 current lookahead token, the shift below will for sure. */
3130 YY_LAC_DISCARD ("error recovery");
3132 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3134 YY_IGNORE_MAYBE_UNINITIALIZED_END
3136 yyerror_range
[2] = yylloc
;
3137 /* Using YYLLOC is tempting, but would change the location of
3138 the lookahead. YYLOC is available though. */
3139 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3142 /* Shift the error token. */
3143 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3149 /*-------------------------------------.
3150 | yyacceptlab -- YYACCEPT comes here. |
3151 `-------------------------------------*/
3156 /*-----------------------------------.
3157 | yyabortlab -- YYABORT comes here. |
3158 `-----------------------------------*/
3164 /*-------------------------------------------------.
3165 | yyexhaustedlab -- memory exhaustion comes here. |
3166 `-------------------------------------------------*/
3168 yyerror (YY_("memory exhausted"));
3174 if (yychar
!= YYEMPTY
)
3176 /* Make sure we have latest lookahead translation. See comments at
3177 user semantic actions for why this is necessary. */
3178 yytoken
= YYTRANSLATE (yychar
);
3179 yydestruct ("Cleanup: discarding lookahead",
3180 yytoken
, &yylval
, &yylloc
);
3182 /* Do not reclaim the symbols of the rule which action triggered
3183 this YYABORT or YYACCEPT. */
3185 YY_STACK_PRINT (yyss
, yyssp
);
3186 while (yyssp
!= yyss
)
3188 yydestruct ("Cleanup: popping",
3189 yystos
[*yyssp
], yyvsp
, yylsp
);
3194 YYSTACK_FREE (yyss
);
3197 YYSTACK_FREE (yyes
);
3199 if (yymsg
!= yymsgbuf
)
3200 YYSTACK_FREE (yymsg
);
3204 /* Line 1930 of yacc.c */
3205 #line 722 "src/parse-gram.y"
3208 /* Return the location of the left-hand side of a rule whose
3209 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3210 the right-hand side, and return an empty location equal to the end
3211 boundary of RHS[0] if the right-hand side is empty. */
3214 lloc_default (YYLTYPE
const *rhs
, int n
)
3219 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3220 The bug is fixed in 7.4.2m, but play it safe for now. */
3221 loc
.start
= rhs
[n
].end
;
3222 loc
.end
= rhs
[n
].end
;
3224 /* Ignore empty nonterminals the start of the right-hand side.
3225 Do not bother to ignore them at the end of the right-hand side,
3226 since empty nonterminals have the same end as their predecessors. */
3227 for (i
= 1; i
<= n
; i
++)
3228 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3230 loc
.start
= rhs
[i
].start
;
3239 add_param (param_type type
, char *decl
, location loc
)
3241 static char const alphanum
[26 + 26 + 1 + 10] =
3242 "abcdefghijklmnopqrstuvwxyz"
3243 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3247 char const *name_start
= NULL
;
3250 /* Stop on last actual character. */
3251 for (p
= decl
; p
[1]; p
++)
3253 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3254 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3257 /* Strip the surrounding '{' and '}', and any blanks just inside
3260 while (c_isspace ((unsigned char) *p
))
3264 while (c_isspace ((unsigned char) *decl
))
3269 complain (&loc
, complaint
, _("missing identifier in parameter declaration"));
3272 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3273 if (type
& param_lex
)
3274 muscle_pair_list_grow ("lex_param", decl
, name
);
3275 if (type
& param_parse
)
3276 muscle_pair_list_grow ("parse_param", decl
, name
);
3280 gram_scanner_last_string_free ();
3285 version_check (location
const *loc
, char const *version
)
3287 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3289 complain (loc
, complaint
, "require bison %s, but have %s",
3290 version
, PACKAGE_VERSION
);
3296 gram_error (location
const *loc
, char const *msg
)
3298 complain (loc
, complaint
, "%s", msg
);
3302 token_name (int type
)
3304 return yytname
[YYTRANSLATE (type
)];
3315 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3316 return quotearg_style (escape_quoting_style
, buf
);