1 /* A Bison parser, made by GNU Bison 2.5.1.931-4323e-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.5.1.931-4323e-dirty"
50 #define YYSKELETON_NAME "yacc.c"
62 /* Substitute the variable and function names. */
63 #define yyparse gram_parse
64 #define yylex gram_lex
65 #define yyerror gram_error
66 #define yylval gram_lval
67 #define yychar gram_char
68 #define yydebug gram_debug
69 #define yynerrs gram_nerrs
70 #define yylloc gram_lloc
72 /* Copy the first part of user declarations. */
73 /* Line 337 of yacc.c */
74 #line 1 "src/parse-gram.y"
75 /* Bison Grammar Parser -*- C -*-
77 Copyright (C) 2002-2012 Free Software Foundation, Inc.
79 This file is part of Bison, the GNU Compiler Compiler.
81 This program is free software: you can redistribute it and/or modify
82 it under the terms of the GNU General Public License as published by
83 the Free Software Foundation, either version 3 of the License, or
84 (at your option) any later version.
86 This program is distributed in the hope that it will be useful,
87 but WITHOUT ANY WARRANTY; without even the implied warranty of
88 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
89 GNU General Public License for more details.
91 You should have received a copy of the GNU General Public License
92 along with this program. If not, see <http://www.gnu.org/licenses/>. */
98 #include "conflicts.h"
102 #include "muscle-tab.h"
103 #include "named-ref.h"
104 #include "quotearg.h"
108 #include "scan-gram.h"
109 #include "scan-code.h"
110 #include "xmemdup0.h"
112 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
113 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
115 #define YY_LOCATION_PRINT(File, Loc) \
116 location_print (File, Loc)
118 static void version_check (location
const *loc
, char const *version
);
120 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
121 FIXME: depends on the undocumented availability of YYLLOC. */
123 #define yyerror(Msg) \
124 gram_error (&yylloc, Msg)
125 static void gram_error (location
const *, char const *);
127 static char const *char_name (char);
129 /* Line 337 of yacc.c */
130 #line 131 "src/parse-gram.c"
133 # if defined __cplusplus && 201103L <= __cplusplus
134 # define YY_NULL nullptr
140 /* Enabling verbose error messages. */
141 #ifdef YYERROR_VERBOSE
142 # undef YYERROR_VERBOSE
143 # define YYERROR_VERBOSE 1
145 # define YYERROR_VERBOSE 1
148 /* In a future release of Bison, this section will be replaced
149 by #include "src/parse-gram.h". */
150 #ifndef GRAM_SRC_PARSE_GRAM_H
151 # define GRAM_SRC_PARSE_GRAM_H
152 /* Enabling traces. */
157 extern int gram_debug
;
159 /* "%code requires" blocks. */
160 /* Line 351 of yacc.c */
161 #line 222 "src/parse-gram.y"
169 param_parse
= 1 << 1,
170 param_both
= param_lex
| param_parse
175 /* Line 351 of yacc.c */
176 #line 177 "src/parse-gram.c"
181 /* Put the tokens into the symbol table, so that GDB and other debuggers
191 PERCENT_DESTRUCTOR
= 263,
192 PERCENT_PRINTER
= 264,
195 PERCENT_NONASSOC
= 267,
196 PERCENT_PRECEDENCE
= 268,
201 PERCENT_DEFAULT_PREC
= 273,
202 PERCENT_DEFINE
= 274,
203 PERCENT_DEFINES
= 275,
204 PERCENT_ERROR_VERBOSE
= 276,
205 PERCENT_EXPECT
= 277,
206 PERCENT_EXPECT_RR
= 278,
208 PERCENT_FILE_PREFIX
= 280,
209 PERCENT_GLR_PARSER
= 281,
210 PERCENT_INITIAL_ACTION
= 282,
211 PERCENT_LANGUAGE
= 283,
212 PERCENT_NAME_PREFIX
= 284,
213 PERCENT_NO_DEFAULT_PREC
= 285,
214 PERCENT_NO_LINES
= 286,
215 PERCENT_NONDETERMINISTIC_PARSER
= 287,
216 PERCENT_OUTPUT
= 288,
217 PERCENT_REQUIRE
= 289,
218 PERCENT_SKELETON
= 290,
220 PERCENT_TOKEN_TABLE
= 292,
221 PERCENT_VERBOSE
= 293,
224 BRACED_PREDICATE
= 296,
231 PERCENT_PERCENT
= 303,
246 #define PERCENT_TOKEN 260
247 #define PERCENT_NTERM 261
248 #define PERCENT_TYPE 262
249 #define PERCENT_DESTRUCTOR 263
250 #define PERCENT_PRINTER 264
251 #define PERCENT_LEFT 265
252 #define PERCENT_RIGHT 266
253 #define PERCENT_NONASSOC 267
254 #define PERCENT_PRECEDENCE 268
255 #define PERCENT_PREC 269
256 #define PERCENT_DPREC 270
257 #define PERCENT_MERGE 271
258 #define PERCENT_CODE 272
259 #define PERCENT_DEFAULT_PREC 273
260 #define PERCENT_DEFINE 274
261 #define PERCENT_DEFINES 275
262 #define PERCENT_ERROR_VERBOSE 276
263 #define PERCENT_EXPECT 277
264 #define PERCENT_EXPECT_RR 278
265 #define PERCENT_FLAG 279
266 #define PERCENT_FILE_PREFIX 280
267 #define PERCENT_GLR_PARSER 281
268 #define PERCENT_INITIAL_ACTION 282
269 #define PERCENT_LANGUAGE 283
270 #define PERCENT_NAME_PREFIX 284
271 #define PERCENT_NO_DEFAULT_PREC 285
272 #define PERCENT_NO_LINES 286
273 #define PERCENT_NONDETERMINISTIC_PARSER 287
274 #define PERCENT_OUTPUT 288
275 #define PERCENT_REQUIRE 289
276 #define PERCENT_SKELETON 290
277 #define PERCENT_START 291
278 #define PERCENT_TOKEN_TABLE 292
279 #define PERCENT_VERBOSE 293
280 #define PERCENT_YACC 294
281 #define BRACED_CODE 295
282 #define BRACED_PREDICATE 296
283 #define BRACKETED_ID 297
289 #define PERCENT_PERCENT 303
292 #define SEMICOLON 306
296 #define PERCENT_PARAM 310
297 #define PERCENT_UNION 311
299 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
300 typedef union YYSTYPE
302 /* Line 351 of yacc.c */
303 #line 108 "src/parse-gram.y"
309 named_ref
*named_ref
;
313 unsigned char character
;
315 /* Line 351 of yacc.c */
316 #line 246 "src/parse-gram.y"
320 /* Line 351 of yacc.c */
321 #line 425 "src/parse-gram.y"
322 code_props_type code_type
;
324 /* Line 351 of yacc.c */
325 #line 326 "src/parse-gram.c"
327 # define YYSTYPE_IS_TRIVIAL 1
328 # define YYSTYPE_IS_DECLARED 1
331 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
332 typedef struct YYLTYPE
339 # define YYLTYPE_IS_DECLARED 1
340 # define YYLTYPE_IS_TRIVIAL 1
345 #if (defined __STDC__ || defined __C99__FUNC__ \
346 || defined __cplusplus || defined _MSC_VER)
347 int gram_parse (void *YYPARSE_PARAM
);
351 #else /* ! YYPARSE_PARAM */
352 #if (defined __STDC__ || defined __C99__FUNC__ \
353 || defined __cplusplus || defined _MSC_VER)
354 int gram_parse (void);
358 #endif /* ! YYPARSE_PARAM */
360 #endif /* !GRAM_SRC_PARSE_GRAM_H */
362 /* Copy the second part of user declarations. */
364 /* Line 354 of yacc.c */
365 #line 366 "src/parse-gram.c"
366 /* Unqualified %code blocks. */
367 /* Line 355 of yacc.c */
368 #line 57 "src/parse-gram.y"
370 static int current_prec
= 0;
371 static location current_lhs_location
;
372 static named_ref
*current_lhs_named_ref
;
373 static symbol
*current_lhs_symbol
;
374 static symbol_class current_class
= unknown_sym
;
375 static uniqstr current_type
= NULL
;
377 /** Set the new current left-hand side symbol, possibly common
378 * to several right-hand side parts of rule.
382 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
384 current_lhs_symbol
= sym
;
385 current_lhs_location
= loc
;
386 /* In order to simplify memory management, named references for lhs
387 are always assigned by deep copy into the current symbol_list
388 node. This is because a single named-ref in the grammar may
389 result in several uses when the user factors lhs between several
390 rules using "|". Therefore free the parser's original copy. */
391 free (current_lhs_named_ref
);
392 current_lhs_named_ref
= ref
;
395 #define YYTYPE_INT16 int_fast16_t
396 #define YYTYPE_INT8 int_fast8_t
397 #define YYTYPE_UINT16 uint_fast16_t
398 #define YYTYPE_UINT8 uint_fast8_t
400 /* Line 355 of yacc.c */
401 #line 235 "src/parse-gram.y"
403 /** Add a lex-param and/or a parse-param.
405 * \param type where to push this formal argument.
406 * \param decl the formal argument. Destroyed.
407 * \param loc the location in the source.
409 static void add_param (param_type type
, char *decl
, location loc
);
410 static param_type current_param
= param_none
;
413 /* Line 355 of yacc.c */
414 #line 415 "src/parse-gram.c"
421 typedef YYTYPE_UINT8 yytype_uint8
;
423 typedef unsigned char yytype_uint8
;
427 typedef YYTYPE_INT8 yytype_int8
;
428 #elif (defined __STDC__ || defined __C99__FUNC__ \
429 || defined __cplusplus || defined _MSC_VER)
430 typedef signed char yytype_int8
;
432 typedef short int yytype_int8
;
436 typedef YYTYPE_UINT16 yytype_uint16
;
438 typedef unsigned short int yytype_uint16
;
442 typedef YYTYPE_INT16 yytype_int16
;
444 typedef short int yytype_int16
;
448 # ifdef __SIZE_TYPE__
449 # define YYSIZE_T __SIZE_TYPE__
450 # elif defined size_t
451 # define YYSIZE_T size_t
452 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
453 || defined __cplusplus || defined _MSC_VER)
454 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
455 # define YYSIZE_T size_t
457 # define YYSIZE_T unsigned int
461 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
464 # if defined YYENABLE_NLS && YYENABLE_NLS
466 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
467 # define YY_(msgid) dgettext ("bison-runtime", msgid)
471 # define YY_(msgid) msgid
475 /* Suppress unused-variable warnings by "using" E. */
476 #if ! defined lint || defined __GNUC__
477 # define YYUSE(e) ((void) (e))
479 # define YYUSE(e) /* empty */
482 /* Identity function, used to suppress warnings about constant conditions. */
486 #if (defined __STDC__ || defined __C99__FUNC__ \
487 || defined __cplusplus || defined _MSC_VER)
502 /* The parser invokes alloca or malloc; define the necessary symbols. */
504 # ifdef YYSTACK_ALLOC
505 /* Pacify GCC's `empty if-body' warning. */
506 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
507 # ifndef YYSTACK_ALLOC_MAXIMUM
508 /* The OS might guarantee only one guard page at the bottom of the stack,
509 and a page size can be as small as 4096 bytes. So we cannot safely
510 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
511 to allow for a few compiler-allocated temporary stack slots. */
512 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
515 # define YYSTACK_ALLOC YYMALLOC
516 # define YYSTACK_FREE YYFREE
517 # ifndef YYSTACK_ALLOC_MAXIMUM
518 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
520 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
521 && ! ((defined YYMALLOC || defined malloc) \
522 && (defined YYFREE || defined free)))
523 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
524 # ifndef EXIT_SUCCESS
525 # define EXIT_SUCCESS 0
529 # define YYMALLOC malloc
530 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
531 || defined __cplusplus || defined _MSC_VER)
532 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
537 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
538 || defined __cplusplus || defined _MSC_VER)
539 void free (void *); /* INFRINGES ON USER NAME SPACE */
543 # define YYCOPY_NEEDED 1
547 #if (! defined yyoverflow \
548 && (! defined __cplusplus \
549 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
550 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
552 /* A type that is properly aligned for any stack member. */
555 yytype_int16 yyss_alloc
;
560 /* The size of the maximum gap between one aligned stack and the next. */
561 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
563 /* The size of an array large to enough to hold all stacks, each with
565 # define YYSTACK_BYTES(N) \
566 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
567 + 2 * YYSTACK_GAP_MAXIMUM)
569 # define YYCOPY_NEEDED 1
571 /* Relocate STACK from its old location to the new one. The
572 local variables YYSIZE and YYSTACKSIZE give the old and new number of
573 elements in the stack, and YYPTR gives the new location of the
574 stack. Advance YYPTR to a properly aligned location for the next
576 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
579 YYSIZE_T yynewbytes; \
580 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
581 Stack = &yyptr->Stack_alloc; \
582 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
583 yyptr += yynewbytes / sizeof (*yyptr); \
589 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
590 /* Copy COUNT objects from SRC to DST. The source and destination do
593 # if defined __GNUC__ && 1 < __GNUC__
594 # define YYCOPY(Dst, Src, Count) \
595 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
597 # define YYCOPY(Dst, Src, Count) \
601 for (yyi = 0; yyi < (Count); yyi++) \
602 (Dst)[yyi] = (Src)[yyi]; \
607 #endif /* !YYCOPY_NEEDED */
609 /* YYFINAL -- State number of the termination state. */
611 /* YYLAST -- Last index in YYTABLE. */
614 /* YYNTOKENS -- Number of terminals. */
616 /* YYNNTS -- Number of nonterminals. */
618 /* YYNRULES -- Number of rules. */
620 /* YYNSTATES -- Number of states. */
621 #define YYNSTATES 149
623 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
624 by yylex, with out-of-bounds checking. */
626 #define YYMAXUTOK 311
628 #define YYTRANSLATE(YYX) \
629 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
631 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
632 as returned by yylex, without out-of-bounds checking. */
633 static const yytype_uint8 yytranslate
[] =
635 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
661 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
662 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
663 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
664 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
665 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
670 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
671 static const yytype_uint16 yyrline
[] =
673 0, 271, 271, 279, 281, 285, 286, 296, 300, 305,
674 306, 311, 316, 317, 318, 319, 320, 325, 334, 335,
675 336, 337, 338, 339, 340, 341, 341, 342, 343, 367,
676 368, 369, 370, 374, 375, 384, 385, 386, 390, 402,
677 406, 410, 417, 428, 429, 439, 440, 444, 456, 456,
678 461, 461, 466, 477, 492, 493, 494, 495, 499, 500,
679 505, 507, 512, 513, 518, 520, 525, 526, 530, 531,
680 535, 536, 537, 542, 547, 552, 558, 564, 575, 576,
681 585, 586, 592, 593, 594, 601, 601, 609, 610, 611,
682 616, 618, 620, 622, 624, 626, 628, 633, 635, 645,
683 646, 651, 652, 653, 662, 682, 684, 693, 698, 699,
688 #if YYDEBUG || YYERROR_VERBOSE || 1
689 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
690 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
691 static const char *const yytname
[] =
693 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
694 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
695 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
696 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
697 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
698 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
699 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
700 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
701 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
702 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
703 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
704 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
705 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
706 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
707 "prologue_declaration", "$@1", "params", "grammar_declaration",
708 "code_props_type", "union_name", "symbol_declaration", "$@2", "$@3",
709 "precedence_declaration", "precedence_declarator", "tag.opt",
710 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
711 "generic_symlist_item", "tag", "symbol_def", "symbol_defs.1", "grammar",
712 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
713 "named_ref.opt", "variable", "content.opt", "braceless", "id",
714 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
719 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
720 (internal) symbol number NUM (which must be that of a token). */
721 static const yytype_uint16 yytoknum
[] =
723 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
724 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
725 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
726 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
727 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
728 305, 306, 307, 308, 309, 310, 311
732 #define YYPACT_NINF -88
734 #define yypact_value_is_default(yystate) \
737 #define YYTABLE_NINF -112
739 #define yytable_value_is_error(yytable_value) \
742 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
744 static const yytype_int16 yypact
[] =
746 -88, 42, 107, -88, -88, -88, 8, -88, -88, -88,
747 -88, -88, -88, 19, -88, 12, 60, -88, 66, 72,
748 -88, 2, -88, 39, 83, 35, -88, -88, -88, 36,
749 87, 88, 32, -88, -88, -88, 15, -88, -88, -88,
750 46, -88, -88, 55, -88, -88, 45, -2, -2, 32,
751 -88, 58, -88, -88, -88, 31, -88, -88, -88, -88,
752 97, -88, -88, -88, 98, -88, 100, -88, -88, -88,
753 -88, -88, -88, -88, -88, 56, -88, 57, 1, -88,
754 -88, 62, 69, -88, 58, 0, -88, 32, -88, -88,
755 -2, 85, -2, 32, -88, -88, -88, -88, -88, -88,
756 -88, -88, -88, -88, 77, -88, -88, -88, -88, -88,
757 70, -88, -88, -88, -88, 0, -88, -88, -88, 32,
758 -88, 102, -88, 119, -88, -88, -88, -88, -88, -88,
759 -88, -88, -88, 33, 53, -88, -88, 32, 143, 71,
760 62, -88, 62, 53, -88, -88, -88, -88, -88
763 /* YYDEFACT[S] -- default reduction number in state S. Performed when
764 YYTABLE does not specify something else to do. Zero means the default
766 static const yytype_uint8 yydefact
[] =
768 3, 0, 0, 1, 50, 48, 0, 43, 44, 54,
769 55, 56, 57, 0, 39, 0, 9, 11, 0, 0,
770 7, 0, 16, 0, 0, 0, 40, 21, 22, 0,
771 0, 0, 0, 29, 30, 31, 0, 6, 32, 25,
772 45, 4, 5, 0, 36, 35, 58, 0, 0, 0,
773 104, 0, 41, 100, 99, 101, 10, 12, 13, 14,
774 0, 17, 18, 19, 0, 23, 0, 27, 28, 110,
775 106, 105, 108, 37, 109, 0, 107, 0, 0, 80,
776 82, 97, 0, 46, 0, 0, 59, 0, 73, 78,
777 51, 74, 49, 52, 64, 42, 103, 102, 8, 15,
778 20, 24, 84, 83, 0, 81, 2, 98, 85, 34,
779 26, 47, 70, 71, 72, 38, 66, 69, 68, 53,
780 60, 62, 79, 75, 76, 65, 112, 90, 33, 67,
781 61, 63, 77, 86, 87, 90, 89, 0, 0, 0,
782 97, 93, 97, 88, 94, 95, 96, 92, 91
785 /* YYPGOTO[NTERM-NUM]. */
786 static const yytype_int16 yypgoto
[] =
788 -88, -88, -88, -88, -88, -88, 146, -88, -88, -88,
789 -88, -88, -88, -88, -88, -88, 30, -88, -88, 37,
790 -88, -26, 103, -88, 75, -88, -88, -88, 21, -57,
791 -88, -88, -11, -18, -88, -32, -87, -88
794 /* YYDEFGOTO[NTERM-NUM]. */
795 static const yytype_int16 yydefgoto
[] =
797 -1, 1, 2, 41, 82, 110, 77, 43, 84, 44,
798 48, 47, 45, 46, 87, 119, 120, 93, 115, 116,
799 117, 89, 90, 78, 79, 80, 127, 133, 134, 108,
800 55, 98, 52, 72, 81, 118, 74, 106
803 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
804 positive, shift that token. If negative, reduce the rule which
805 number is the opposite. If YYTABLE_NINF, syntax error. */
806 static const yytype_int16 yytable
[] =
808 73, -111, 75, 69, 124, 59, 4, 5, 6, 7,
809 8, 9, 10, 11, 12, 53, 75, 94, 13, 14,
810 4, 5, 6, 7, 8, 9, 10, 11, 12, 91,
811 91, 26, 13, 14, 96, 69, 132, 32, 63, 65,
812 95, 70, 3, 70, 71, 26, 71, 60, 76, 104,
813 88, 32, 112, 113, 114, 121, 69, 40, 54, 50,
814 49, 125, 76, 56, 122, 51, 122, 137, 138, 139,
815 57, 40, 91, 111, 91, 70, 58, 97, 71, 61,
816 64, 66, 135, 147, 136, 148, 62, 121, 69, 123,
817 67, 68, 83, 140, 141, 85, 70, 86, 50, 71,
818 99, 100, 142, 101, 107, 144, 131, 102, 103, 109,
819 128, 142, 4, 5, 6, 7, 8, 9, 10, 11,
820 12, 126, 69, 146, 13, 14, 15, 16, 17, 18,
821 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
822 29, 30, 31, 32, 33, 34, 35, 145, 42, 130,
823 0, 92, 129, 105, 0, 36, 143, 37, 38, 0,
827 static const yytype_int16 yycheck
[] =
829 32, 0, 1, 3, 91, 3, 5, 6, 7, 8,
830 9, 10, 11, 12, 13, 3, 1, 49, 17, 18,
831 5, 6, 7, 8, 9, 10, 11, 12, 13, 47,
832 48, 30, 17, 18, 3, 3, 123, 36, 3, 3,
833 51, 43, 0, 43, 46, 30, 46, 45, 47, 48,
834 52, 36, 52, 53, 54, 87, 3, 56, 46, 40,
835 52, 93, 47, 3, 90, 46, 92, 14, 15, 16,
836 4, 56, 90, 84, 92, 43, 4, 46, 46, 40,
837 45, 45, 49, 140, 51, 142, 3, 119, 3, 4,
838 3, 3, 46, 40, 41, 40, 43, 52, 40, 46,
839 3, 3, 134, 3, 42, 137, 4, 51, 51, 40,
840 40, 143, 5, 6, 7, 8, 9, 10, 11, 12,
841 13, 44, 3, 52, 17, 18, 19, 20, 21, 22,
842 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
843 33, 34, 35, 36, 37, 38, 39, 4, 2, 119,
844 -1, 48, 115, 78, -1, 48, 135, 50, 51, -1,
848 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
849 symbol of state STATE-NUM. */
850 static const yytype_uint8 yystos
[] =
852 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
853 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
854 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
855 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
856 56, 60, 63, 64, 66, 69, 70, 68, 67, 52,
857 40, 46, 89, 3, 46, 87, 3, 4, 4, 3,
858 45, 40, 3, 3, 45, 3, 45, 3, 3, 3,
859 43, 46, 90, 92, 93, 1, 47, 63, 80, 81,
860 82, 91, 61, 46, 65, 40, 52, 71, 52, 78,
861 79, 90, 79, 74, 92, 89, 3, 46, 88, 3,
862 3, 3, 51, 51, 48, 81, 94, 42, 86, 40,
863 62, 89, 52, 53, 54, 75, 76, 77, 92, 72,
864 73, 92, 78, 4, 93, 92, 44, 83, 40, 76,
865 73, 4, 93, 84, 85, 49, 51, 14, 15, 16,
866 40, 41, 92, 85, 92, 4, 52, 86, 86
869 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
870 static const yytype_uint8 yyr1
[] =
872 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
873 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
874 60, 60, 60, 60, 60, 61, 60, 60, 60, 60,
875 60, 60, 60, 62, 62, 63, 63, 63, 63, 63,
876 63, 63, 63, 64, 64, 65, 65, 63, 67, 66,
877 68, 66, 66, 69, 70, 70, 70, 70, 71, 71,
878 72, 72, 73, 73, 74, 74, 75, 75, 76, 76,
879 77, 77, 77, 78, 78, 78, 78, 78, 79, 79,
880 80, 80, 81, 81, 81, 83, 82, 84, 84, 84,
881 85, 85, 85, 85, 85, 85, 85, 86, 86, 87,
882 87, 88, 88, 88, 89, 90, 90, 91, 92, 92,
886 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
887 static const yytype_uint8 yyr2
[] =
889 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
890 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
891 3, 1, 1, 2, 3, 0, 3, 2, 2, 1,
892 1, 1, 1, 2, 1, 1, 1, 2, 3, 1,
893 1, 2, 3, 1, 1, 0, 1, 3, 0, 3,
894 0, 3, 3, 3, 1, 1, 1, 1, 0, 1,
895 1, 2, 1, 2, 1, 2, 1, 2, 1, 1,
896 1, 1, 1, 1, 1, 2, 2, 3, 1, 2,
897 1, 2, 1, 2, 2, 0, 4, 1, 3, 2,
898 0, 3, 3, 2, 3, 3, 3, 0, 1, 1,
899 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
904 #define yyerrok (yyerrstatus = 0)
905 #define yyclearin (yychar = YYEMPTY)
909 #define YYACCEPT goto yyacceptlab
910 #define YYABORT goto yyabortlab
911 #define YYERROR goto yyerrorlab
914 #define YYRECOVERING() (!!yyerrstatus)
916 #define YYBACKUP(Token, Value) \
918 if (yychar == YYEMPTY) \
922 YYPOPSTACK (yylen); \
924 YY_LAC_DISCARD ("YYBACKUP"); \
929 yyerror (YY_("syntax error: cannot back up")); \
936 #define YYERRCODE 256
939 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
940 If N is 0, then set CURRENT to the empty location which ends
941 the previous symbol: RHS[0] (always defined). */
943 #ifndef YYLLOC_DEFAULT
944 # define YYLLOC_DEFAULT(Current, Rhs, N) \
948 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
949 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
950 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
951 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
955 (Current).first_line = (Current).last_line = \
956 YYRHSLOC (Rhs, 0).last_line; \
957 (Current).first_column = (Current).last_column = \
958 YYRHSLOC (Rhs, 0).last_column; \
963 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
965 /* YY_LOCATION_PRINT -- Print the location on the stream.
966 This macro was not mandated originally: define only if we know
967 we won't break user code: when these are the locations we know. */
969 #ifndef YY_LOCATION_PRINT
970 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
971 # define YY_LOCATION_PRINT(File, Loc) \
972 fprintf (File, "%d.%d-%d.%d", \
973 (Loc).first_line, (Loc).first_column, \
974 (Loc).last_line, (Loc).last_column)
976 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
981 /* YYLEX -- calling `yylex' with the right arguments. */
984 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
986 # define YYLEX yylex (&yylval, &yylloc)
989 /* Enable debugging if requested. */
993 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
994 # define YYFPRINTF fprintf
997 # define YYDPRINTF(Args) \
1003 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1007 YYFPRINTF (stderr, "%s ", Title); \
1008 yy_symbol_print (stderr, \
1009 Type, Value, Location); \
1010 YYFPRINTF (stderr, "\n"); \
1015 /*--------------------------------.
1016 | Print this symbol on YYOUTPUT. |
1017 `--------------------------------*/
1020 #if (defined __STDC__ || defined __C99__FUNC__ \
1021 || defined __cplusplus || defined _MSC_VER)
1023 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1026 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1029 YYSTYPE
const * const yyvaluep
;
1030 YYLTYPE
const * const yylocationp
;
1033 FILE *yyo
= yyoutput
;
1035 YYUSE (yylocationp
);
1039 if (yytype
< YYNTOKENS
)
1040 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1045 /* Line 725 of yacc.c */
1046 #line 195 "src/parse-gram.y"
1047 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
1048 /* Line 725 of yacc.c */
1049 #line 1050 "src/parse-gram.c"
1052 case 4: // "integer"
1053 /* Line 725 of yacc.c */
1054 #line 208 "src/parse-gram.y"
1055 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
1056 /* Line 725 of yacc.c */
1057 #line 1058 "src/parse-gram.c"
1060 case 24: // "%<flag>"
1061 /* Line 725 of yacc.c */
1062 #line 204 "src/parse-gram.y"
1063 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1064 /* Line 725 of yacc.c */
1065 #line 1066 "src/parse-gram.c"
1069 /* Line 725 of yacc.c */
1070 #line 197 "src/parse-gram.y"
1071 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1072 /* Line 725 of yacc.c */
1073 #line 1074 "src/parse-gram.c"
1076 case 42: // "[identifier]"
1077 /* Line 725 of yacc.c */
1078 #line 202 "src/parse-gram.y"
1079 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1080 /* Line 725 of yacc.c */
1081 #line 1082 "src/parse-gram.c"
1085 /* Line 725 of yacc.c */
1086 #line 189 "src/parse-gram.y"
1087 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
1088 /* Line 725 of yacc.c */
1089 #line 1090 "src/parse-gram.c"
1092 case 44: // "epilogue"
1093 /* Line 725 of yacc.c */
1094 #line 197 "src/parse-gram.y"
1095 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1096 /* Line 725 of yacc.c */
1097 #line 1098 "src/parse-gram.c"
1100 case 46: // "identifier"
1101 /* Line 725 of yacc.c */
1102 #line 201 "src/parse-gram.y"
1103 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1104 /* Line 725 of yacc.c */
1105 #line 1106 "src/parse-gram.c"
1108 case 47: // "identifier:"
1109 /* Line 725 of yacc.c */
1110 #line 203 "src/parse-gram.y"
1111 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
1112 /* Line 725 of yacc.c */
1113 #line 1114 "src/parse-gram.c"
1116 case 50: // "%{...%}"
1117 /* Line 725 of yacc.c */
1118 #line 197 "src/parse-gram.y"
1119 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1120 /* Line 725 of yacc.c */
1121 #line 1122 "src/parse-gram.c"
1125 /* Line 725 of yacc.c */
1126 #line 205 "src/parse-gram.y"
1127 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1128 /* Line 725 of yacc.c */
1129 #line 1130 "src/parse-gram.c"
1132 case 55: // "%param"
1133 /* Line 725 of yacc.c */
1134 #line 251 "src/parse-gram.y"
1136 switch (((*yyvaluep
).param
))
1138 #define CASE(In, Out) \
1139 case param_ ## In: fputs ("%" #Out, stderr); break
1140 CASE(lex
, lex
-param
);
1141 CASE(parse
, parse
-param
);
1144 case param_none
: aver (false); break;
1147 /* Line 725 of yacc.c */
1148 #line 1149 "src/parse-gram.c"
1151 case 64: // code_props_type
1152 /* Line 725 of yacc.c */
1153 #line 426 "src/parse-gram.y"
1154 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1155 /* Line 725 of yacc.c */
1156 #line 1157 "src/parse-gram.c"
1159 case 73: // symbol.prec
1160 /* Line 725 of yacc.c */
1161 #line 211 "src/parse-gram.y"
1162 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1163 /* Line 725 of yacc.c */
1164 #line 1165 "src/parse-gram.c"
1168 /* Line 725 of yacc.c */
1169 #line 205 "src/parse-gram.y"
1170 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1171 /* Line 725 of yacc.c */
1172 #line 1173 "src/parse-gram.c"
1175 case 87: // variable
1176 /* Line 725 of yacc.c */
1177 #line 201 "src/parse-gram.y"
1178 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1179 /* Line 725 of yacc.c */
1180 #line 1181 "src/parse-gram.c"
1183 case 88: // content.opt
1184 /* Line 725 of yacc.c */
1185 #line 197 "src/parse-gram.y"
1186 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1187 /* Line 725 of yacc.c */
1188 #line 1189 "src/parse-gram.c"
1191 case 89: // braceless
1192 /* Line 725 of yacc.c */
1193 #line 197 "src/parse-gram.y"
1194 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1195 /* Line 725 of yacc.c */
1196 #line 1197 "src/parse-gram.c"
1200 /* Line 725 of yacc.c */
1201 #line 211 "src/parse-gram.y"
1202 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1203 /* Line 725 of yacc.c */
1204 #line 1205 "src/parse-gram.c"
1207 case 91: // id_colon
1208 /* Line 725 of yacc.c */
1209 #line 212 "src/parse-gram.y"
1210 { fprintf (yyo
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1211 /* Line 725 of yacc.c */
1212 #line 1213 "src/parse-gram.c"
1216 /* Line 725 of yacc.c */
1217 #line 211 "src/parse-gram.y"
1218 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1219 /* Line 725 of yacc.c */
1220 #line 1221 "src/parse-gram.c"
1223 case 93: // string_as_id
1224 /* Line 725 of yacc.c */
1225 #line 211 "src/parse-gram.y"
1226 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1227 /* Line 725 of yacc.c */
1228 #line 1229 "src/parse-gram.c"
1237 /*--------------------------------.
1238 | Print this symbol on YYOUTPUT. |
1239 `--------------------------------*/
1241 #if (defined __STDC__ || defined __C99__FUNC__ \
1242 || defined __cplusplus || defined _MSC_VER)
1244 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1247 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1250 YYSTYPE
const * const yyvaluep
;
1251 YYLTYPE
const * const yylocationp
;
1254 if (yytype
< YYNTOKENS
)
1255 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1257 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1259 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1260 YYFPRINTF (yyoutput
, ": ");
1261 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1262 YYFPRINTF (yyoutput
, ")");
1265 /*------------------------------------------------------------------.
1266 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1268 `------------------------------------------------------------------*/
1270 #if (defined __STDC__ || defined __C99__FUNC__ \
1271 || defined __cplusplus || defined _MSC_VER)
1273 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1276 yy_stack_print (yybottom
, yytop
)
1277 yytype_int16
*yybottom
;
1278 yytype_int16
*yytop
;
1281 YYFPRINTF (stderr
, "Stack now");
1282 for (; yybottom
<= yytop
; yybottom
++)
1284 int yybot
= *yybottom
;
1285 YYFPRINTF (stderr
, " %d", yybot
);
1287 YYFPRINTF (stderr
, "\n");
1290 # define YY_STACK_PRINT(Bottom, Top) \
1293 yy_stack_print ((Bottom), (Top)); \
1297 /*------------------------------------------------.
1298 | Report that the YYRULE is going to be reduced. |
1299 `------------------------------------------------*/
1301 #if (defined __STDC__ || defined __C99__FUNC__ \
1302 || defined __cplusplus || defined _MSC_VER)
1304 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1307 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1308 yytype_int16
*yyssp
;
1314 unsigned long int yylno
= yyrline
[yyrule
];
1315 int yynrhs
= yyr2
[yyrule
];
1317 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1319 /* The symbols being reduced. */
1320 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1322 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1323 yy_symbol_print (stderr
,
1324 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1325 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1326 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1327 YYFPRINTF (stderr
, "\n");
1331 # define YY_REDUCE_PRINT(Rule) \
1334 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1337 /* Nonzero means print parse trace. It is left uninitialized so that
1338 multiple parsers can coexist. */
1340 #else /* !YYDEBUG */
1341 # define YYDPRINTF(Args)
1342 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1343 # define YY_STACK_PRINT(Bottom, Top)
1344 # define YY_REDUCE_PRINT(Rule)
1345 #endif /* !YYDEBUG */
1348 /* YYINITDEPTH -- initial size of the parser's stacks. */
1350 # define YYINITDEPTH 200
1353 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1354 if the built-in stack extension method is used).
1356 Do not make this value too large; the results are undefined if
1357 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1358 evaluated with infinite-precision integer arithmetic. */
1361 # define YYMAXDEPTH 10000
1364 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1365 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1366 stack, and such that *YYCAPACITY is the maximum number of elements it
1367 can hold without a reallocation, make sure there is enough room to
1368 store YYADD more elements. If not, allocate a new stack using
1369 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1370 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1371 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1372 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1373 required. Return 1 if memory is exhausted. */
1375 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1377 char const *yydebug_prefix
,
1378 char const *yydebug_suffix
,
1380 yytype_int16
**yybottom
,
1381 yytype_int16
*yybottom_no_free
,
1382 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1384 YYSIZE_T yysize_old
=
1385 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1386 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1387 if (*yycapacity
< yysize_new
)
1389 YYSIZE_T yyalloc
= 2 * yysize_new
;
1390 yytype_int16
*yybottom_new
;
1391 /* Use YYMAXDEPTH for maximum stack size given that the stack
1392 should never need to grow larger than the main state stack
1393 needs to grow without LAC. */
1394 if (YYMAXDEPTH
< yysize_new
)
1396 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1400 if (YYMAXDEPTH
< yyalloc
)
1401 yyalloc
= YYMAXDEPTH
;
1403 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1406 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1410 if (*yytop
!= yytop_empty
)
1412 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1413 *yytop
= yybottom_new
+ (yysize_old
- 1);
1415 if (*yybottom
!= yybottom_no_free
)
1416 YYSTACK_FREE (*yybottom
);
1417 *yybottom
= yybottom_new
;
1418 *yycapacity
= yyalloc
;
1423 /* Establish the initial context for the current lookahead if no initial
1424 context is currently established.
1426 We define a context as a snapshot of the parser stacks. We define
1427 the initial context for a lookahead as the context in which the
1428 parser initially examines that lookahead in order to select a
1429 syntactic action. Thus, if the lookahead eventually proves
1430 syntactically unacceptable (possibly in a later context reached via a
1431 series of reductions), the initial context can be used to determine
1432 the exact set of tokens that would be syntactically acceptable in the
1433 lookahead's place. Moreover, it is the context after which any
1434 further semantic actions would be erroneous because they would be
1435 determined by a syntactically unacceptable token.
1437 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1438 performed in an inconsistent state (which, for the purposes of LAC,
1439 includes consistent states that don't know they're consistent because
1440 their default reductions have been disabled). Iff there is a
1441 lookahead token, it should also be invoked before reporting a syntax
1442 error. This latter case is for the sake of the debugging output.
1444 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1445 follows. If no initial context is currently established for the
1446 current lookahead, then check if that lookahead can eventually be
1447 shifted if syntactic actions continue from the current context.
1448 Report a syntax error if it cannot. */
1449 #define YY_LAC_ESTABLISH \
1451 if (!yy_lac_established) \
1453 YYDPRINTF ((stderr, \
1454 "LAC: initial context established for %s\n", \
1455 yytname[yytoken])); \
1456 yy_lac_established = 1; \
1458 int yy_lac_status = \
1459 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1460 if (yy_lac_status == 2) \
1461 goto yyexhaustedlab; \
1462 if (yy_lac_status == 1) \
1468 /* Discard any previous initial lookahead context because of Event,
1469 which may be a lookahead change or an invalidation of the currently
1470 established initial context for the current lookahead.
1472 The most common example of a lookahead change is a shift. An example
1473 of both cases is syntax error recovery. That is, a syntax error
1474 occurs when the lookahead is syntactically erroneous for the
1475 currently established initial context, so error recovery manipulates
1476 the parser stacks to try to find a new initial context in which the
1477 current lookahead is syntactically acceptable. If it fails to find
1478 such a context, it discards the lookahead. */
1480 # define YY_LAC_DISCARD(Event) \
1482 if (yy_lac_established) \
1485 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1487 yy_lac_established = 0; \
1491 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1494 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1495 eventually (after perhaps some reductions) be shifted, return 1 if
1496 not, or return 2 if memory is exhausted. As preconditions and
1497 postconditions: *YYES_CAPACITY is the allocated size of the array to
1498 which *YYES points, and either *YYES = YYESA or *YYES points to an
1499 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1500 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1501 any old *YYES other than YYESA. */
1503 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1504 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1506 yytype_int16
*yyes_prev
= yyssp
;
1507 yytype_int16
*yyesp
= yyes_prev
;
1508 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1509 if (yytoken
== YYUNDEFTOK
)
1511 YYDPRINTF ((stderr
, " Always Err\n"));
1516 int yyrule
= yypact
[*yyesp
];
1517 if (yypact_value_is_default (yyrule
)
1518 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1519 || yycheck
[yyrule
] != yytoken
)
1521 yyrule
= yydefact
[*yyesp
];
1524 YYDPRINTF ((stderr
, " Err\n"));
1530 yyrule
= yytable
[yyrule
];
1531 if (yytable_value_is_error (yyrule
))
1533 YYDPRINTF ((stderr
, " Err\n"));
1538 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1544 YYSIZE_T yylen
= yyr2
[yyrule
];
1545 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1546 if (yyesp
!= yyes_prev
)
1548 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1561 yyesp
= yyes_prev
-= yylen
;
1566 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1567 yystate
= yypgoto
[yylhs
] + *yyesp
;
1568 if (yystate
< 0 || YYLAST
< yystate
1569 || yycheck
[yystate
] != *yyesp
)
1570 yystate
= yydefgoto
[yylhs
];
1572 yystate
= yytable
[yystate
];
1574 if (yyesp
== yyes_prev
)
1581 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1585 yyes
, yyesa
, &yyesp
, yyes_prev
))
1587 YYDPRINTF ((stderr
, "\n"));
1592 YYDPRINTF ((stderr
, " G%d", yystate
));
1601 # if defined __GLIBC__ && defined _STRING_H
1602 # define yystrlen strlen
1604 /* Return the length of YYSTR. */
1605 #if (defined __STDC__ || defined __C99__FUNC__ \
1606 || defined __cplusplus || defined _MSC_VER)
1608 yystrlen (const char *yystr
)
1616 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1624 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1625 # define yystpcpy stpcpy
1627 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1629 #if (defined __STDC__ || defined __C99__FUNC__ \
1630 || defined __cplusplus || defined _MSC_VER)
1632 yystpcpy (char *yydest
, const char *yysrc
)
1635 yystpcpy (yydest
, yysrc
)
1641 const char *yys
= yysrc
;
1643 while ((*yyd
++ = *yys
++) != '\0')
1652 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1653 quotes and backslashes, so that it's suitable for yyerror. The
1654 heuristic is that double-quoting is unnecessary unless the string
1655 contains an apostrophe, a comma, or backslash (other than
1656 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1657 null, do not copy; instead, return the length of what the result
1660 yytnamerr (char *yyres
, const char *yystr
)
1665 char const *yyp
= yystr
;
1672 goto do_not_strip_quotes
;
1676 goto do_not_strip_quotes
;
1689 do_not_strip_quotes
: ;
1693 return yystrlen (yystr
);
1695 return yystpcpy (yyres
, yystr
) - yyres
;
1699 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1700 about the unexpected token YYTOKEN for the state stack whose top is
1701 YYSSP. In order to see if a particular token T is a
1702 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1704 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1705 not large enough to hold the message. In that case, also set
1706 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1707 required number of bytes is too large to store or if
1708 yy_lac returned 2. */
1710 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1711 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1712 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1714 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1715 YYSIZE_T yysize
= yysize0
;
1717 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1718 /* Internationalized format string. */
1719 const char *yyformat
= YY_NULL
;
1720 /* Arguments of yyformat. */
1721 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1722 /* Number of reported tokens (one for the "unexpected", one per
1726 /* There are many possibilities here to consider:
1727 - If this state is a consistent state with a default action, then
1728 the only way this function was invoked is if the default action
1729 is an error action. In that case, don't check for expected
1730 tokens because there are none.
1731 - The only way there can be no lookahead present (in yychar) is if
1732 this state is a consistent state with a default action. Thus,
1733 detecting the absence of a lookahead is sufficient to determine
1734 that there is no unexpected or expected token to report. In that
1735 case, just report a simple "syntax error".
1736 - Don't assume there isn't a lookahead just because this state is a
1737 consistent state with a default action. There might have been a
1738 previous inconsistent state, consistent state with a non-default
1739 action, or user semantic action that manipulated yychar.
1740 In the first two cases, it might appear that the current syntax
1741 error should have been detected in the previous state when yy_lac
1742 was invoked. However, at that time, there might have been a
1743 different syntax error that discarded a different initial context
1744 during error recovery, leaving behind the current lookahead.
1746 if (yytoken
!= YYEMPTY
)
1748 int yyn
= yypact
[*yyssp
];
1749 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1750 yyarg
[yycount
++] = yytname
[yytoken
];
1751 if (!yypact_value_is_default (yyn
))
1755 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1756 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1759 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1761 if (yy_lac_status
== 2)
1763 if (yy_lac_status
== 1)
1766 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1772 yyarg
[yycount
++] = yytname
[yyx
];
1773 yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1774 if (! (yysize
<= yysize1
1775 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1782 YYFPRINTF (stderr
, "No expected tokens.\n");
1788 # define YYCASE_(N, S) \
1792 YYCASE_(0, YY_("syntax error"));
1793 YYCASE_(1, YY_("syntax error, unexpected %s"));
1794 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1795 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1796 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1797 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1801 yysize1
= yysize
+ yystrlen (yyformat
);
1802 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1806 if (*yymsg_alloc
< yysize
)
1808 *yymsg_alloc
= 2 * yysize
;
1809 if (! (yysize
<= *yymsg_alloc
1810 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1811 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1815 /* Avoid sprintf, as that infringes on the user's name space.
1816 Don't have undefined behavior even if the translation
1817 produced a string with the wrong number of "%s"s. */
1821 while ((*yyp
= *yyformat
) != '\0')
1822 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1824 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1835 #endif /* YYERROR_VERBOSE */
1837 /*-----------------------------------------------.
1838 | Release the memory associated to this symbol. |
1839 `-----------------------------------------------*/
1842 #if (defined __STDC__ || defined __C99__FUNC__ \
1843 || defined __cplusplus || defined _MSC_VER)
1845 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1848 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1852 YYLTYPE
*yylocationp
;
1856 YYUSE (yylocationp
);
1859 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1875 #ifdef YYPARSE_PARAM
1876 #if (defined __STDC__ || defined __C99__FUNC__ \
1877 || defined __cplusplus || defined _MSC_VER)
1879 yyparse (void *YYPARSE_PARAM
)
1882 yyparse (YYPARSE_PARAM
)
1883 void *YYPARSE_PARAM
;
1885 #else /* ! YYPARSE_PARAM */
1886 #if (defined __STDC__ || defined __C99__FUNC__ \
1887 || defined __cplusplus || defined _MSC_VER)
1897 /* The lookahead symbol. */
1900 /* The semantic value of the lookahead symbol. */
1903 /* Location data for the lookahead symbol. */
1906 /* Number of syntax errors so far. */
1910 /* Number of tokens to shift before error messages enabled. */
1913 /* The stacks and their tools:
1914 `yyss': related to states.
1915 `yyvs': related to semantic values.
1916 `yyls': related to locations.
1918 Refer to the stacks through separate pointers, to allow yyoverflow
1919 to reallocate them elsewhere. */
1921 /* The state stack. */
1922 yytype_int16 yyssa
[YYINITDEPTH
];
1924 yytype_int16
*yyssp
;
1926 /* The semantic value stack. */
1927 YYSTYPE yyvsa
[YYINITDEPTH
];
1931 /* The location stack. */
1932 YYLTYPE yylsa
[YYINITDEPTH
];
1936 /* The locations where the error started and ended. */
1937 YYLTYPE yyerror_range
[3];
1939 YYSIZE_T yystacksize
;
1941 yytype_int16 yyesa
[20];
1943 YYSIZE_T yyes_capacity
;
1945 int yy_lac_established
= 0;
1948 /* Lookahead token as an internal (translated) token number. */
1950 /* The variables used to return semantic value and location from the
1956 /* Buffer for error messages, and its allocated size. */
1958 char *yymsg
= yymsgbuf
;
1959 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1962 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1964 /* The number of symbols on the RHS of the reduced rule.
1965 Keep to zero when no symbol should be popped. */
1972 yystacksize
= YYINITDEPTH
;
1975 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1976 if (YYMAXDEPTH
< yyes_capacity
)
1977 yyes_capacity
= YYMAXDEPTH
;
1979 YYDPRINTF ((stderr
, "Starting parse\n"));
1984 yychar
= YYEMPTY
; /* Cause a token to be read. */
1986 /* Initialize stack pointers.
1987 Waste one element of value and location stack
1988 so that they stay on the same level as the state stack.
1989 The wasted elements are never initialized. */
1994 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1995 /* Initialize the default location before parsing starts. */
1996 yylloc
.first_line
= yylloc
.last_line
= 1;
1997 yylloc
.first_column
= yylloc
.last_column
= 1;
2000 /* User initialization code. */
2001 /* Line 1486 of yacc.c */
2002 #line 100 "src/parse-gram.y"
2004 /* Bison's grammar can initial empty locations, hence a default
2005 location is needed. */
2006 boundary_set (&yylloc
.start
, current_file
, 1, 1);
2007 boundary_set (&yylloc
.end
, current_file
, 1, 1);
2009 /* Line 1486 of yacc.c */
2010 #line 2011 "src/parse-gram.c"
2014 /*------------------------------------------------------------.
2015 | yynewstate -- Push a new state, which is found in yystate. |
2016 `------------------------------------------------------------*/
2018 /* In all cases, when you get here, the value and location stacks
2019 have just been pushed. So pushing a state here evens the stacks. */
2025 if (yyss
+ yystacksize
- 1 <= yyssp
)
2027 /* Get the current used size of the three stacks, in elements. */
2028 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2032 /* Give user a chance to reallocate the stack. Use copies of
2033 these so that the &'s don't force the real ones into
2035 YYSTYPE
*yyvs1
= yyvs
;
2036 yytype_int16
*yyss1
= yyss
;
2037 YYLTYPE
*yyls1
= yyls
;
2039 /* Each stack pointer address is followed by the size of the
2040 data in use in that stack, in bytes. This used to be a
2041 conditional around just the two extra args, but that might
2042 be undefined if yyoverflow is a macro. */
2043 yyoverflow (YY_("memory exhausted"),
2044 &yyss1
, yysize
* sizeof (*yyssp
),
2045 &yyvs1
, yysize
* sizeof (*yyvsp
),
2046 &yyls1
, yysize
* sizeof (*yylsp
),
2053 #else /* no yyoverflow */
2054 # ifndef YYSTACK_RELOCATE
2055 goto yyexhaustedlab
;
2057 /* Extend the stack our own way. */
2058 if (YYMAXDEPTH
<= yystacksize
)
2059 goto yyexhaustedlab
;
2061 if (YYMAXDEPTH
< yystacksize
)
2062 yystacksize
= YYMAXDEPTH
;
2065 yytype_int16
*yyss1
= yyss
;
2066 union yyalloc
*yyptr
=
2067 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2069 goto yyexhaustedlab
;
2070 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2071 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2072 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2073 # undef YYSTACK_RELOCATE
2075 YYSTACK_FREE (yyss1
);
2078 #endif /* no yyoverflow */
2080 yyssp
= yyss
+ yysize
- 1;
2081 yyvsp
= yyvs
+ yysize
- 1;
2082 yylsp
= yyls
+ yysize
- 1;
2084 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2085 (unsigned long int) yystacksize
));
2087 if (yyss
+ yystacksize
- 1 <= yyssp
)
2091 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2093 if (yystate
== YYFINAL
)
2103 /* Do appropriate processing given the current state. Read a
2104 lookahead token if we need one and don't already have one. */
2106 /* First try to decide what to do without reference to lookahead token. */
2107 yyn
= yypact
[yystate
];
2108 if (yypact_value_is_default (yyn
))
2111 /* Not known => get a lookahead token if don't already have one. */
2113 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2114 if (yychar
== YYEMPTY
)
2116 YYDPRINTF ((stderr
, "Reading a token: "));
2120 if (yychar
<= YYEOF
)
2122 yychar
= yytoken
= YYEOF
;
2123 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2127 yytoken
= YYTRANSLATE (yychar
);
2128 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2131 /* If the proper action on seeing token YYTOKEN is to reduce or to
2132 detect an error, take that action. */
2134 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2142 if (yytable_value_is_error (yyn
))
2149 /* Count tokens shifted since error; after three, turn off error
2154 /* Shift the lookahead token. */
2155 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2157 /* Discard the shifted token. */
2159 YY_LAC_DISCARD ("shift");
2167 /*-----------------------------------------------------------.
2168 | yydefault -- do the default action for the current state. |
2169 `-----------------------------------------------------------*/
2171 yyn
= yydefact
[yystate
];
2177 /*-----------------------------.
2178 | yyreduce -- Do a reduction. |
2179 `-----------------------------*/
2181 /* yyn is the number of a rule to reduce with. */
2184 /* If YYLEN is nonzero, implement the default value of the action:
2187 Otherwise, the following line sets YYVAL to garbage.
2188 This behavior is undocumented and Bison
2189 users should not rely upon it. Assigning to YYVAL
2190 unconditionally makes the parser a bit smaller, and it avoids a
2191 GCC warning that YYVAL may be used uninitialized. */
2192 yyval
= yyvsp
[1-yylen
];
2194 /* Default location. */
2195 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2196 YY_REDUCE_PRINT (yyn
);
2198 int yychar_backup
= yychar
;
2202 /* Line 1701 of yacc.c */
2203 #line 287 "src/parse-gram.y"
2205 code_props plain_code
;
2206 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2207 code_props_translate_code (&plain_code
);
2208 gram_scanner_last_string_free ();
2209 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2210 plain_code
.code
, (yylsp
[0]));
2211 code_scanner_last_string_free ();
2213 /* Line 1701 of yacc.c */
2214 #line 2215 "src/parse-gram.c"
2218 /* Line 1701 of yacc.c */
2219 #line 297 "src/parse-gram.y"
2221 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2223 /* Line 1701 of yacc.c */
2224 #line 2225 "src/parse-gram.c"
2228 /* Line 1701 of yacc.c */
2229 #line 301 "src/parse-gram.y"
2231 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2232 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2234 /* Line 1701 of yacc.c */
2235 #line 2236 "src/parse-gram.c"
2239 /* Line 1701 of yacc.c */
2240 #line 305 "src/parse-gram.y"
2241 { defines_flag
= true; }
2242 /* Line 1701 of yacc.c */
2243 #line 2244 "src/parse-gram.c"
2247 /* Line 1701 of yacc.c */
2248 #line 307 "src/parse-gram.y"
2250 defines_flag
= true;
2251 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2253 /* Line 1701 of yacc.c */
2254 #line 2255 "src/parse-gram.c"
2258 /* Line 1701 of yacc.c */
2259 #line 312 "src/parse-gram.y"
2261 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2262 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2264 /* Line 1701 of yacc.c */
2265 #line 2266 "src/parse-gram.c"
2269 /* Line 1701 of yacc.c */
2270 #line 316 "src/parse-gram.y"
2271 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2272 /* Line 1701 of yacc.c */
2273 #line 2274 "src/parse-gram.c"
2277 /* Line 1701 of yacc.c */
2278 #line 317 "src/parse-gram.y"
2279 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2280 /* Line 1701 of yacc.c */
2281 #line 2282 "src/parse-gram.c"
2285 /* Line 1701 of yacc.c */
2286 #line 318 "src/parse-gram.y"
2287 { spec_file_prefix
= (yyvsp
[0].chars
); }
2288 /* Line 1701 of yacc.c */
2289 #line 2290 "src/parse-gram.c"
2293 /* Line 1701 of yacc.c */
2294 #line 319 "src/parse-gram.y"
2295 { spec_file_prefix
= (yyvsp
[0].chars
); }
2296 /* Line 1701 of yacc.c */
2297 #line 2298 "src/parse-gram.c"
2301 /* Line 1701 of yacc.c */
2302 #line 321 "src/parse-gram.y"
2304 nondeterministic_parser
= true;
2307 /* Line 1701 of yacc.c */
2308 #line 2309 "src/parse-gram.c"
2312 /* Line 1701 of yacc.c */
2313 #line 326 "src/parse-gram.y"
2316 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2317 code_props_translate_code (&action
);
2318 gram_scanner_last_string_free ();
2319 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2320 code_scanner_last_string_free ();
2322 /* Line 1701 of yacc.c */
2323 #line 2324 "src/parse-gram.c"
2327 /* Line 1701 of yacc.c */
2328 #line 334 "src/parse-gram.y"
2329 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2330 /* Line 1701 of yacc.c */
2331 #line 2332 "src/parse-gram.c"
2335 /* Line 1701 of yacc.c */
2336 #line 335 "src/parse-gram.y"
2337 { spec_name_prefix
= (yyvsp
[0].chars
); }
2338 /* Line 1701 of yacc.c */
2339 #line 2340 "src/parse-gram.c"
2343 /* Line 1701 of yacc.c */
2344 #line 336 "src/parse-gram.y"
2345 { spec_name_prefix
= (yyvsp
[0].chars
); }
2346 /* Line 1701 of yacc.c */
2347 #line 2348 "src/parse-gram.c"
2351 /* Line 1701 of yacc.c */
2352 #line 337 "src/parse-gram.y"
2353 { no_lines_flag
= true; }
2354 /* Line 1701 of yacc.c */
2355 #line 2356 "src/parse-gram.c"
2359 /* Line 1701 of yacc.c */
2360 #line 338 "src/parse-gram.y"
2361 { nondeterministic_parser
= true; }
2362 /* Line 1701 of yacc.c */
2363 #line 2364 "src/parse-gram.c"
2367 /* Line 1701 of yacc.c */
2368 #line 339 "src/parse-gram.y"
2369 { spec_outfile
= (yyvsp
[0].chars
); }
2370 /* Line 1701 of yacc.c */
2371 #line 2372 "src/parse-gram.c"
2375 /* Line 1701 of yacc.c */
2376 #line 340 "src/parse-gram.y"
2377 { spec_outfile
= (yyvsp
[0].chars
); }
2378 /* Line 1701 of yacc.c */
2379 #line 2380 "src/parse-gram.c"
2383 /* Line 1701 of yacc.c */
2384 #line 341 "src/parse-gram.y"
2385 { current_param
= (yyvsp
[0].param
); }
2386 /* Line 1701 of yacc.c */
2387 #line 2388 "src/parse-gram.c"
2391 /* Line 1701 of yacc.c */
2392 #line 341 "src/parse-gram.y"
2393 { current_param
= param_none
; }
2394 /* Line 1701 of yacc.c */
2395 #line 2396 "src/parse-gram.c"
2399 /* Line 1701 of yacc.c */
2400 #line 342 "src/parse-gram.y"
2401 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2402 /* Line 1701 of yacc.c */
2403 #line 2404 "src/parse-gram.c"
2407 /* Line 1701 of yacc.c */
2408 #line 344 "src/parse-gram.y"
2410 char const *skeleton_user
= (yyvsp
[0].chars
);
2411 if (strchr (skeleton_user
, '/'))
2413 size_t dir_length
= strlen (current_file
);
2414 char *skeleton_build
;
2415 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2417 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2420 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2423 memcpy (skeleton_build
, current_file
, dir_length
);
2424 skeleton_build
[dir_length
++] = '/';
2426 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2427 skeleton_user
= uniqstr_new (skeleton_build
);
2428 free (skeleton_build
);
2430 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2432 /* Line 1701 of yacc.c */
2433 #line 2434 "src/parse-gram.c"
2437 /* Line 1701 of yacc.c */
2438 #line 367 "src/parse-gram.y"
2439 { token_table_flag
= true; }
2440 /* Line 1701 of yacc.c */
2441 #line 2442 "src/parse-gram.c"
2445 /* Line 1701 of yacc.c */
2446 #line 368 "src/parse-gram.y"
2447 { report_flag
|= report_states
; }
2448 /* Line 1701 of yacc.c */
2449 #line 2450 "src/parse-gram.c"
2453 /* Line 1701 of yacc.c */
2454 #line 369 "src/parse-gram.y"
2455 { yacc_flag
= true; }
2456 /* Line 1701 of yacc.c */
2457 #line 2458 "src/parse-gram.c"
2461 /* Line 1701 of yacc.c */
2462 #line 374 "src/parse-gram.y"
2463 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2464 /* Line 1701 of yacc.c */
2465 #line 2466 "src/parse-gram.c"
2469 /* Line 1701 of yacc.c */
2470 #line 375 "src/parse-gram.y"
2471 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2472 /* Line 1701 of yacc.c */
2473 #line 2474 "src/parse-gram.c"
2477 /* Line 1701 of yacc.c */
2478 #line 387 "src/parse-gram.y"
2480 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2482 /* Line 1701 of yacc.c */
2483 #line 2484 "src/parse-gram.c"
2487 /* Line 1701 of yacc.c */
2488 #line 391 "src/parse-gram.y"
2491 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2492 code_props_translate_code (&code
);
2495 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2496 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2497 symbol_list_free ((yyvsp
[0].list
));
2500 /* Line 1701 of yacc.c */
2501 #line 2502 "src/parse-gram.c"
2505 /* Line 1701 of yacc.c */
2506 #line 403 "src/parse-gram.y"
2508 default_prec
= true;
2510 /* Line 1701 of yacc.c */
2511 #line 2512 "src/parse-gram.c"
2515 /* Line 1701 of yacc.c */
2516 #line 407 "src/parse-gram.y"
2518 default_prec
= false;
2520 /* Line 1701 of yacc.c */
2521 #line 2522 "src/parse-gram.c"
2525 /* Line 1701 of yacc.c */
2526 #line 411 "src/parse-gram.y"
2528 /* Do not invoke muscle_percent_code_grow here since it invokes
2529 muscle_user_name_list_grow. */
2530 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2531 code_scanner_last_string_free ();
2533 /* Line 1701 of yacc.c */
2534 #line 2535 "src/parse-gram.c"
2538 /* Line 1701 of yacc.c */
2539 #line 418 "src/parse-gram.y"
2541 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2542 code_scanner_last_string_free ();
2544 /* Line 1701 of yacc.c */
2545 #line 2546 "src/parse-gram.c"
2549 /* Line 1701 of yacc.c */
2550 #line 428 "src/parse-gram.y"
2551 { (yyval
.code_type
) = destructor
; }
2552 /* Line 1701 of yacc.c */
2553 #line 2554 "src/parse-gram.c"
2557 /* Line 1701 of yacc.c */
2558 #line 429 "src/parse-gram.y"
2559 { (yyval
.code_type
) = printer
; }
2560 /* Line 1701 of yacc.c */
2561 #line 2562 "src/parse-gram.c"
2565 /* Line 1701 of yacc.c */
2566 #line 439 "src/parse-gram.y"
2568 /* Line 1701 of yacc.c */
2569 #line 2570 "src/parse-gram.c"
2573 /* Line 1701 of yacc.c */
2574 #line 440 "src/parse-gram.y"
2575 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2576 /* Line 1701 of yacc.c */
2577 #line 2578 "src/parse-gram.c"
2581 /* Line 1701 of yacc.c */
2582 #line 445 "src/parse-gram.y"
2585 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2586 code_scanner_last_string_free ();
2588 /* Line 1701 of yacc.c */
2589 #line 2590 "src/parse-gram.c"
2593 /* Line 1701 of yacc.c */
2594 #line 456 "src/parse-gram.y"
2595 { current_class
= nterm_sym
; }
2596 /* Line 1701 of yacc.c */
2597 #line 2598 "src/parse-gram.c"
2601 /* Line 1701 of yacc.c */
2602 #line 457 "src/parse-gram.y"
2604 current_class
= unknown_sym
;
2605 current_type
= NULL
;
2607 /* Line 1701 of yacc.c */
2608 #line 2609 "src/parse-gram.c"
2612 /* Line 1701 of yacc.c */
2613 #line 461 "src/parse-gram.y"
2614 { current_class
= token_sym
; }
2615 /* Line 1701 of yacc.c */
2616 #line 2617 "src/parse-gram.c"
2620 /* Line 1701 of yacc.c */
2621 #line 462 "src/parse-gram.y"
2623 current_class
= unknown_sym
;
2624 current_type
= NULL
;
2626 /* Line 1701 of yacc.c */
2627 #line 2628 "src/parse-gram.c"
2631 /* Line 1701 of yacc.c */
2632 #line 467 "src/parse-gram.y"
2636 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2637 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2638 symbol_list_free ((yyvsp
[0].list
));
2640 /* Line 1701 of yacc.c */
2641 #line 2642 "src/parse-gram.c"
2645 /* Line 1701 of yacc.c */
2646 #line 478 "src/parse-gram.y"
2650 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2652 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2653 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2655 symbol_list_free ((yyvsp
[0].list
));
2656 current_type
= NULL
;
2658 /* Line 1701 of yacc.c */
2659 #line 2660 "src/parse-gram.c"
2663 /* Line 1701 of yacc.c */
2664 #line 492 "src/parse-gram.y"
2665 { (yyval
.assoc
) = left_assoc
; }
2666 /* Line 1701 of yacc.c */
2667 #line 2668 "src/parse-gram.c"
2671 /* Line 1701 of yacc.c */
2672 #line 493 "src/parse-gram.y"
2673 { (yyval
.assoc
) = right_assoc
; }
2674 /* Line 1701 of yacc.c */
2675 #line 2676 "src/parse-gram.c"
2679 /* Line 1701 of yacc.c */
2680 #line 494 "src/parse-gram.y"
2681 { (yyval
.assoc
) = non_assoc
; }
2682 /* Line 1701 of yacc.c */
2683 #line 2684 "src/parse-gram.c"
2687 /* Line 1701 of yacc.c */
2688 #line 495 "src/parse-gram.y"
2689 { (yyval
.assoc
) = precedence_assoc
; }
2690 /* Line 1701 of yacc.c */
2691 #line 2692 "src/parse-gram.c"
2695 /* Line 1701 of yacc.c */
2696 #line 499 "src/parse-gram.y"
2697 { current_type
= NULL
; }
2698 /* Line 1701 of yacc.c */
2699 #line 2700 "src/parse-gram.c"
2703 /* Line 1701 of yacc.c */
2704 #line 500 "src/parse-gram.y"
2705 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2706 /* Line 1701 of yacc.c */
2707 #line 2708 "src/parse-gram.c"
2711 /* Line 1701 of yacc.c */
2712 #line 506 "src/parse-gram.y"
2713 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2714 /* Line 1701 of yacc.c */
2715 #line 2716 "src/parse-gram.c"
2719 /* Line 1701 of yacc.c */
2720 #line 508 "src/parse-gram.y"
2721 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2722 /* Line 1701 of yacc.c */
2723 #line 2724 "src/parse-gram.c"
2727 /* Line 1701 of yacc.c */
2728 #line 512 "src/parse-gram.y"
2729 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2730 /* Line 1701 of yacc.c */
2731 #line 2732 "src/parse-gram.c"
2735 /* Line 1701 of yacc.c */
2736 #line 513 "src/parse-gram.y"
2737 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2738 /* Line 1701 of yacc.c */
2739 #line 2740 "src/parse-gram.c"
2743 /* Line 1701 of yacc.c */
2744 #line 519 "src/parse-gram.y"
2745 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2746 /* Line 1701 of yacc.c */
2747 #line 2748 "src/parse-gram.c"
2751 /* Line 1701 of yacc.c */
2752 #line 521 "src/parse-gram.y"
2753 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2754 /* Line 1701 of yacc.c */
2755 #line 2756 "src/parse-gram.c"
2759 /* Line 1701 of yacc.c */
2760 #line 525 "src/parse-gram.y"
2761 { (yyval
.list
) = (yyvsp
[0].list
); }
2762 /* Line 1701 of yacc.c */
2763 #line 2764 "src/parse-gram.c"
2767 /* Line 1701 of yacc.c */
2768 #line 526 "src/parse-gram.y"
2769 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2770 /* Line 1701 of yacc.c */
2771 #line 2772 "src/parse-gram.c"
2775 /* Line 1701 of yacc.c */
2776 #line 530 "src/parse-gram.y"
2777 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2778 /* Line 1701 of yacc.c */
2779 #line 2780 "src/parse-gram.c"
2783 /* Line 1701 of yacc.c */
2784 #line 531 "src/parse-gram.y"
2785 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2786 /* Line 1701 of yacc.c */
2787 #line 2788 "src/parse-gram.c"
2791 /* Line 1701 of yacc.c */
2792 #line 536 "src/parse-gram.y"
2793 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2794 /* Line 1701 of yacc.c */
2795 #line 2796 "src/parse-gram.c"
2799 /* Line 1701 of yacc.c */
2800 #line 537 "src/parse-gram.y"
2801 { (yyval
.uniqstr
) = uniqstr_new (""); }
2802 /* Line 1701 of yacc.c */
2803 #line 2804 "src/parse-gram.c"
2807 /* Line 1701 of yacc.c */
2808 #line 543 "src/parse-gram.y"
2810 current_type
= (yyvsp
[0].uniqstr
);
2813 /* Line 1701 of yacc.c */
2814 #line 2815 "src/parse-gram.c"
2818 /* Line 1701 of yacc.c */
2819 #line 548 "src/parse-gram.y"
2821 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2822 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2824 /* Line 1701 of yacc.c */
2825 #line 2826 "src/parse-gram.c"
2829 /* Line 1701 of yacc.c */
2830 #line 553 "src/parse-gram.y"
2832 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2833 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2834 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2836 /* Line 1701 of yacc.c */
2837 #line 2838 "src/parse-gram.c"
2841 /* Line 1701 of yacc.c */
2842 #line 559 "src/parse-gram.y"
2844 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2845 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2846 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2848 /* Line 1701 of yacc.c */
2849 #line 2850 "src/parse-gram.c"
2853 /* Line 1701 of yacc.c */
2854 #line 565 "src/parse-gram.y"
2856 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2857 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2858 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2859 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2861 /* Line 1701 of yacc.c */
2862 #line 2863 "src/parse-gram.c"
2866 /* Line 1701 of yacc.c */
2867 #line 595 "src/parse-gram.y"
2871 /* Line 1701 of yacc.c */
2872 #line 2873 "src/parse-gram.c"
2876 /* Line 1701 of yacc.c */
2877 #line 601 "src/parse-gram.y"
2878 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2879 /* Line 1701 of yacc.c */
2880 #line 2881 "src/parse-gram.c"
2884 /* Line 1701 of yacc.c */
2885 #line 602 "src/parse-gram.y"
2887 /* Free the current lhs. */
2888 current_lhs (0, (yylsp
[-3]), 0);
2890 /* Line 1701 of yacc.c */
2891 #line 2892 "src/parse-gram.c"
2895 /* Line 1701 of yacc.c */
2896 #line 609 "src/parse-gram.y"
2897 { grammar_current_rule_end ((yylsp
[0])); }
2898 /* Line 1701 of yacc.c */
2899 #line 2900 "src/parse-gram.c"
2903 /* Line 1701 of yacc.c */
2904 #line 610 "src/parse-gram.y"
2905 { grammar_current_rule_end ((yylsp
[0])); }
2906 /* Line 1701 of yacc.c */
2907 #line 2908 "src/parse-gram.c"
2911 /* Line 1701 of yacc.c */
2912 #line 616 "src/parse-gram.y"
2913 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2914 current_lhs_named_ref
); }
2915 /* Line 1701 of yacc.c */
2916 #line 2917 "src/parse-gram.c"
2920 /* Line 1701 of yacc.c */
2921 #line 619 "src/parse-gram.y"
2922 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2923 /* Line 1701 of yacc.c */
2924 #line 2925 "src/parse-gram.c"
2928 /* Line 1701 of yacc.c */
2929 #line 621 "src/parse-gram.y"
2930 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2931 /* Line 1701 of yacc.c */
2932 #line 2933 "src/parse-gram.c"
2936 /* Line 1701 of yacc.c */
2937 #line 623 "src/parse-gram.y"
2938 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2939 /* Line 1701 of yacc.c */
2940 #line 2941 "src/parse-gram.c"
2944 /* Line 1701 of yacc.c */
2945 #line 625 "src/parse-gram.y"
2946 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2947 /* Line 1701 of yacc.c */
2948 #line 2949 "src/parse-gram.c"
2952 /* Line 1701 of yacc.c */
2953 #line 627 "src/parse-gram.y"
2954 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2955 /* Line 1701 of yacc.c */
2956 #line 2957 "src/parse-gram.c"
2960 /* Line 1701 of yacc.c */
2961 #line 629 "src/parse-gram.y"
2962 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2963 /* Line 1701 of yacc.c */
2964 #line 2965 "src/parse-gram.c"
2968 /* Line 1701 of yacc.c */
2969 #line 633 "src/parse-gram.y"
2970 { (yyval
.named_ref
) = 0; }
2971 /* Line 1701 of yacc.c */
2972 #line 2973 "src/parse-gram.c"
2976 /* Line 1701 of yacc.c */
2977 #line 635 "src/parse-gram.y"
2978 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2979 /* Line 1701 of yacc.c */
2980 #line 2981 "src/parse-gram.c"
2984 /* Line 1701 of yacc.c */
2985 #line 646 "src/parse-gram.y"
2986 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2987 /* Line 1701 of yacc.c */
2988 #line 2989 "src/parse-gram.c"
2992 /* Line 1701 of yacc.c */
2993 #line 651 "src/parse-gram.y"
2994 { (yyval
.chars
) = ""; }
2995 /* Line 1701 of yacc.c */
2996 #line 2997 "src/parse-gram.c"
3000 /* Line 1701 of yacc.c */
3001 #line 652 "src/parse-gram.y"
3002 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
3003 /* Line 1701 of yacc.c */
3004 #line 3005 "src/parse-gram.c"
3008 /* Line 1701 of yacc.c */
3009 #line 663 "src/parse-gram.y"
3011 code_props plain_code
;
3012 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
3013 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
3014 code_props_translate_code (&plain_code
);
3015 gram_scanner_last_string_free ();
3016 (yyval
.chars
) = plain_code
.code
;
3018 /* Line 1701 of yacc.c */
3019 #line 3020 "src/parse-gram.c"
3023 /* Line 1701 of yacc.c */
3024 #line 683 "src/parse-gram.y"
3025 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
3026 /* Line 1701 of yacc.c */
3027 #line 3028 "src/parse-gram.c"
3031 /* Line 1701 of yacc.c */
3032 #line 685 "src/parse-gram.y"
3034 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
3035 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
3036 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
3038 /* Line 1701 of yacc.c */
3039 #line 3040 "src/parse-gram.c"
3043 /* Line 1701 of yacc.c */
3044 #line 693 "src/parse-gram.y"
3045 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
3046 /* Line 1701 of yacc.c */
3047 #line 3048 "src/parse-gram.c"
3051 /* Line 1701 of yacc.c */
3052 #line 705 "src/parse-gram.y"
3054 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
3055 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
3057 /* Line 1701 of yacc.c */
3058 #line 3059 "src/parse-gram.c"
3062 /* Line 1701 of yacc.c */
3063 #line 714 "src/parse-gram.y"
3065 code_props plain_code
;
3066 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
3067 code_props_translate_code (&plain_code
);
3068 gram_scanner_last_string_free ();
3069 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
3070 code_scanner_last_string_free ();
3072 /* Line 1701 of yacc.c */
3073 #line 3074 "src/parse-gram.c"
3077 /* Line 1701 of yacc.c */
3078 #line 3079 "src/parse-gram.c"
3081 if (yychar_backup
!= yychar
)
3082 YY_LAC_DISCARD ("yychar change");
3084 /* User semantic actions sometimes alter yychar, and that requires
3085 that yytoken be updated with the new translation. We take the
3086 approach of translating immediately before every use of yytoken.
3087 One alternative is translating here after every semantic action,
3088 but that translation would be missed if the semantic action invokes
3089 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3090 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3091 incorrect destructor might then be invoked immediately. In the
3092 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3093 to an incorrect destructor call or verbose syntax error message
3094 before the lookahead is translated. */
3095 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3099 YY_STACK_PRINT (yyss
, yyssp
);
3104 /* Now `shift' the result of the reduction. Determine what state
3105 that goes to, based on the state we popped back to and the rule
3106 number reduced by. */
3110 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3111 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3112 yystate
= yytable
[yystate
];
3114 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3119 /*--------------------------------------.
3120 | yyerrlab -- here on detecting error. |
3121 `--------------------------------------*/
3123 /* Make sure we have latest lookahead translation. See comments at
3124 user semantic actions for why this is necessary. */
3125 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3127 /* If not already recovering from an error, report this error. */
3131 #if ! YYERROR_VERBOSE
3132 yyerror (YY_("syntax error"));
3134 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3135 yyesa, &yyes, &yyes_capacity, \
3138 char const *yymsgp
= YY_("syntax error");
3139 int yysyntax_error_status
;
3140 if (yychar
!= YYEMPTY
)
3142 yysyntax_error_status
= YYSYNTAX_ERROR
;
3143 if (yysyntax_error_status
== 0)
3145 else if (yysyntax_error_status
== 1)
3147 if (yymsg
!= yymsgbuf
)
3148 YYSTACK_FREE (yymsg
);
3149 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3153 yymsg_alloc
= sizeof yymsgbuf
;
3154 yysyntax_error_status
= 2;
3158 yysyntax_error_status
= YYSYNTAX_ERROR
;
3163 if (yysyntax_error_status
== 2)
3164 goto yyexhaustedlab
;
3166 # undef YYSYNTAX_ERROR
3170 yyerror_range
[1] = yylloc
;
3172 if (yyerrstatus
== 3)
3174 /* If just tried and failed to reuse lookahead token after an
3175 error, discard it. */
3177 if (yychar
<= YYEOF
)
3179 /* Return failure if at end of input. */
3180 if (yychar
== YYEOF
)
3185 yydestruct ("Error: discarding",
3186 yytoken
, &yylval
, &yylloc
);
3191 /* Else will try to reuse lookahead token after shifting the error
3196 /*---------------------------------------------------.
3197 | yyerrorlab -- error raised explicitly by YYERROR. |
3198 `---------------------------------------------------*/
3201 /* Pacify compilers like GCC when the user code never invokes
3202 YYERROR and the label yyerrorlab therefore never appears in user
3204 if (/*CONSTCOND*/ 0)
3207 yyerror_range
[1] = yylsp
[1-yylen
];
3208 /* Do not reclaim the symbols of the rule which action triggered
3212 YY_STACK_PRINT (yyss
, yyssp
);
3217 /*-------------------------------------------------------------.
3218 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3219 `-------------------------------------------------------------*/
3221 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3225 yyn
= yypact
[yystate
];
3226 if (!yypact_value_is_default (yyn
))
3229 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3237 /* Pop the current state because it cannot handle the error token. */
3241 yyerror_range
[1] = *yylsp
;
3242 yydestruct ("Error: popping",
3243 yystos
[yystate
], yyvsp
, yylsp
);
3246 YY_STACK_PRINT (yyss
, yyssp
);
3249 /* If the stack popping above didn't lose the initial context for the
3250 current lookahead token, the shift below will for sure. */
3251 YY_LAC_DISCARD ("error recovery");
3255 yyerror_range
[2] = yylloc
;
3256 /* Using YYLLOC is tempting, but would change the location of
3257 the lookahead. YYLOC is available though. */
3258 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3261 /* Shift the error token. */
3262 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3268 /*-------------------------------------.
3269 | yyacceptlab -- YYACCEPT comes here. |
3270 `-------------------------------------*/
3275 /*-----------------------------------.
3276 | yyabortlab -- YYABORT comes here. |
3277 `-----------------------------------*/
3283 /*-------------------------------------------------.
3284 | yyexhaustedlab -- memory exhaustion comes here. |
3285 `-------------------------------------------------*/
3287 yyerror (YY_("memory exhausted"));
3293 if (yychar
!= YYEMPTY
)
3295 /* Make sure we have latest lookahead translation. See comments at
3296 user semantic actions for why this is necessary. */
3297 yytoken
= YYTRANSLATE (yychar
);
3298 yydestruct ("Cleanup: discarding lookahead",
3299 yytoken
, &yylval
, &yylloc
);
3301 /* Do not reclaim the symbols of the rule which action triggered
3302 this YYABORT or YYACCEPT. */
3304 YY_STACK_PRINT (yyss
, yyssp
);
3305 while (yyssp
!= yyss
)
3307 yydestruct ("Cleanup: popping",
3308 yystos
[*yyssp
], yyvsp
, yylsp
);
3313 YYSTACK_FREE (yyss
);
3316 YYSTACK_FREE (yyes
);
3318 if (yymsg
!= yymsgbuf
)
3319 YYSTACK_FREE (yymsg
);
3321 /* Make sure YYID is used. */
3322 return YYID (yyresult
);
3325 /* Line 1961 of yacc.c */
3326 #line 724 "src/parse-gram.y"
3330 /* Return the location of the left-hand side of a rule whose
3331 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3332 the right-hand side, and return an empty location equal to the end
3333 boundary of RHS[0] if the right-hand side is empty. */
3336 lloc_default (YYLTYPE
const *rhs
, int n
)
3341 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3342 The bug is fixed in 7.4.2m, but play it safe for now. */
3343 loc
.start
= rhs
[n
].end
;
3344 loc
.end
= rhs
[n
].end
;
3346 /* Ignore empty nonterminals the start of the right-hand side.
3347 Do not bother to ignore them at the end of the right-hand side,
3348 since empty nonterminals have the same end as their predecessors. */
3349 for (i
= 1; i
<= n
; i
++)
3350 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3352 loc
.start
= rhs
[i
].start
;
3361 add_param (param_type type
, char *decl
, location loc
)
3363 static char const alphanum
[26 + 26 + 1 + 10] =
3364 "abcdefghijklmnopqrstuvwxyz"
3365 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3369 char const *name_start
= NULL
;
3372 /* Stop on last actual character. */
3373 for (p
= decl
; p
[1]; p
++)
3375 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3376 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3379 /* Strip the surrounding '{' and '}', and any blanks just inside
3381 while (*--p
== ' ' || *p
== '\t')
3384 while (*++decl
== ' ' || *decl
== '\t')
3389 complain_at (loc
, complaint
,
3390 _("missing identifier in parameter declaration"));
3393 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3394 if (type
& param_lex
)
3395 muscle_pair_list_grow ("lex_param", decl
, name
);
3396 if (type
& param_parse
)
3397 muscle_pair_list_grow ("parse_param", decl
, name
);
3401 gram_scanner_last_string_free ();
3406 version_check (location
const *loc
, char const *version
)
3408 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3410 complain_at (*loc
, complaint
, "require bison %s, but have %s",
3411 version
, PACKAGE_VERSION
);
3417 gram_error (location
const *loc
, char const *msg
)
3419 complain_at (*loc
, complaint
, "%s", msg
);
3423 token_name (int type
)
3425 return yytname
[YYTRANSLATE (type
)];
3436 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3437 return quotearg_style (escape_quoting_style
, buf
);