1 /* A Bison parser, made by GNU Bison 2.4.687-d4fc-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.4.687-d4fc-dirty"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 1
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 269 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 "conflicts.h"
104 #include "muscle-tab.h"
105 #include "named-ref.h"
106 #include "quotearg.h"
109 #include "scan-gram.h"
110 #include "scan-code.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 269 of yacc.c */
130 #line 131 "src/parse-gram.c"
132 /* Enabling traces. */
137 /* Enabling verbose error messages. */
138 #ifdef YYERROR_VERBOSE
139 # undef YYERROR_VERBOSE
140 # define YYERROR_VERBOSE 1
142 # define YYERROR_VERBOSE 1
145 /* Enabling the token table. */
146 #ifndef YYTOKEN_TABLE
147 # define YYTOKEN_TABLE 0
150 /* "%code requires" blocks. */
151 /* Line 289 of yacc.c */
152 #line 220 "src/parse-gram.y"
160 param_parse
= 1 << 1,
161 param_both
= param_lex
| param_parse
166 /* Line 289 of yacc.c */
167 #line 168 "src/parse-gram.c"
172 /* Put the tokens into the symbol table, so that GDB and other debuggers
181 PERCENT_DESTRUCTOR
= 263,
182 PERCENT_PRINTER
= 264,
185 PERCENT_NONASSOC
= 267,
186 PERCENT_PRECEDENCE
= 268,
191 PERCENT_DEFAULT_PREC
= 273,
192 PERCENT_DEFINE
= 274,
193 PERCENT_DEFINES
= 275,
194 PERCENT_ERROR_VERBOSE
= 276,
195 PERCENT_EXPECT
= 277,
196 PERCENT_EXPECT_RR
= 278,
198 PERCENT_FILE_PREFIX
= 280,
199 PERCENT_GLR_PARSER
= 281,
200 PERCENT_INITIAL_ACTION
= 282,
201 PERCENT_LANGUAGE
= 283,
202 PERCENT_NAME_PREFIX
= 284,
203 PERCENT_NO_DEFAULT_PREC
= 285,
204 PERCENT_NO_LINES
= 286,
205 PERCENT_NONDETERMINISTIC_PARSER
= 287,
206 PERCENT_OUTPUT
= 288,
207 PERCENT_REQUIRE
= 289,
208 PERCENT_SKELETON
= 290,
210 PERCENT_TOKEN_TABLE
= 292,
211 PERCENT_VERBOSE
= 293,
214 BRACED_PREDICATE
= 296,
221 PERCENT_PERCENT
= 303,
236 #define PERCENT_TOKEN 260
237 #define PERCENT_NTERM 261
238 #define PERCENT_TYPE 262
239 #define PERCENT_DESTRUCTOR 263
240 #define PERCENT_PRINTER 264
241 #define PERCENT_LEFT 265
242 #define PERCENT_RIGHT 266
243 #define PERCENT_NONASSOC 267
244 #define PERCENT_PRECEDENCE 268
245 #define PERCENT_PREC 269
246 #define PERCENT_DPREC 270
247 #define PERCENT_MERGE 271
248 #define PERCENT_CODE 272
249 #define PERCENT_DEFAULT_PREC 273
250 #define PERCENT_DEFINE 274
251 #define PERCENT_DEFINES 275
252 #define PERCENT_ERROR_VERBOSE 276
253 #define PERCENT_EXPECT 277
254 #define PERCENT_EXPECT_RR 278
255 #define PERCENT_FLAG 279
256 #define PERCENT_FILE_PREFIX 280
257 #define PERCENT_GLR_PARSER 281
258 #define PERCENT_INITIAL_ACTION 282
259 #define PERCENT_LANGUAGE 283
260 #define PERCENT_NAME_PREFIX 284
261 #define PERCENT_NO_DEFAULT_PREC 285
262 #define PERCENT_NO_LINES 286
263 #define PERCENT_NONDETERMINISTIC_PARSER 287
264 #define PERCENT_OUTPUT 288
265 #define PERCENT_REQUIRE 289
266 #define PERCENT_SKELETON 290
267 #define PERCENT_START 291
268 #define PERCENT_TOKEN_TABLE 292
269 #define PERCENT_VERBOSE 293
270 #define PERCENT_YACC 294
271 #define BRACED_CODE 295
272 #define BRACED_PREDICATE 296
273 #define BRACKETED_ID 297
279 #define PERCENT_PERCENT 303
282 #define SEMICOLON 306
286 #define PERCENT_PARAM 310
287 #define PERCENT_UNION 311
292 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
293 typedef union YYSTYPE
295 /* Line 294 of yacc.c */
296 #line 106 "src/parse-gram.y"
302 named_ref
*named_ref
;
306 unsigned char character
;
308 /* Line 294 of yacc.c */
309 #line 244 "src/parse-gram.y"
314 /* Line 294 of yacc.c */
315 #line 316 "src/parse-gram.c"
317 # define YYSTYPE_IS_TRIVIAL 1
318 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
319 # define YYSTYPE_IS_DECLARED 1
322 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
323 typedef struct YYLTYPE
330 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
331 # define YYLTYPE_IS_DECLARED 1
332 # define YYLTYPE_IS_TRIVIAL 1
336 /* Copy the second part of user declarations. */
338 /* Line 344 of yacc.c */
339 #line 340 "src/parse-gram.c"
340 /* Unqualified %code blocks. */
341 /* Line 345 of yacc.c */
342 #line 55 "src/parse-gram.y"
344 static int current_prec
= 0;
345 static location current_lhs_location
;
346 static named_ref
*current_lhs_named_ref
;
347 static symbol
*current_lhs_symbol
;
348 static symbol_class current_class
= unknown_sym
;
349 static uniqstr current_type
= NULL
;
351 /** Set the new current left-hand side symbol, possibly common
352 * to several right-hand side parts of rule.
356 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
358 current_lhs_symbol
= sym
;
359 current_lhs_location
= loc
;
360 /* In order to simplify memory management, named references for lhs
361 are always assigned by deep copy into the current symbol_list
362 node. This is because a single named-ref in the grammar may
363 result in several uses when the user factors lhs between several
364 rules using "|". Therefore free the parser's original copy. */
365 free (current_lhs_named_ref
);
366 current_lhs_named_ref
= ref
;
369 #define YYTYPE_INT16 int_fast16_t
370 #define YYTYPE_INT8 int_fast8_t
371 #define YYTYPE_UINT16 uint_fast16_t
372 #define YYTYPE_UINT8 uint_fast8_t
374 /* Line 345 of yacc.c */
375 #line 233 "src/parse-gram.y"
377 /** Add a lex-param and/or a parse-param.
379 * \param type where to push this formal argument.
380 * \param decl the formal argument. Destroyed.
381 * \param loc the location in the source.
383 static void add_param (param_type type
, char *decl
, location loc
);
384 static param_type current_param
= param_none
;
387 /* Line 345 of yacc.c */
388 #line 389 "src/parse-gram.c"
395 typedef YYTYPE_UINT8 yytype_uint8
;
397 typedef unsigned char yytype_uint8
;
401 typedef YYTYPE_INT8 yytype_int8
;
402 #elif (defined __STDC__ || defined __C99__FUNC__ \
403 || defined __cplusplus || defined _MSC_VER)
404 typedef signed char yytype_int8
;
406 typedef short int yytype_int8
;
410 typedef YYTYPE_UINT16 yytype_uint16
;
412 typedef unsigned short int yytype_uint16
;
416 typedef YYTYPE_INT16 yytype_int16
;
418 typedef short int yytype_int16
;
422 # ifdef __SIZE_TYPE__
423 # define YYSIZE_T __SIZE_TYPE__
424 # elif defined size_t
425 # define YYSIZE_T size_t
426 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
427 || defined __cplusplus || defined _MSC_VER)
428 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
429 # define YYSIZE_T size_t
431 # define YYSIZE_T unsigned int
435 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
438 # if defined YYENABLE_NLS && YYENABLE_NLS
440 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
441 # define YY_(msgid) dgettext ("bison-runtime", msgid)
445 # define YY_(msgid) msgid
449 /* Suppress unused-variable warnings by "using" E. */
450 #if ! defined lint || defined __GNUC__
451 # define YYUSE(e) ((void) (e))
453 # define YYUSE(e) /* empty */
456 /* Identity function, used to suppress warnings about constant conditions. */
460 #if (defined __STDC__ || defined __C99__FUNC__ \
461 || defined __cplusplus || defined _MSC_VER)
476 /* The parser invokes alloca or malloc; define the necessary symbols. */
478 # ifdef YYSTACK_ALLOC
479 /* Pacify GCC's `empty if-body' warning. */
480 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
481 # ifndef YYSTACK_ALLOC_MAXIMUM
482 /* The OS might guarantee only one guard page at the bottom of the stack,
483 and a page size can be as small as 4096 bytes. So we cannot safely
484 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
485 to allow for a few compiler-allocated temporary stack slots. */
486 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
489 # define YYSTACK_ALLOC YYMALLOC
490 # define YYSTACK_FREE YYFREE
491 # ifndef YYSTACK_ALLOC_MAXIMUM
492 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
494 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
495 && ! ((defined YYMALLOC || defined malloc) \
496 && (defined YYFREE || defined free)))
497 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
498 # ifndef EXIT_SUCCESS
499 # define EXIT_SUCCESS 0
503 # define YYMALLOC malloc
504 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
505 || defined __cplusplus || defined _MSC_VER)
506 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
511 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
512 || defined __cplusplus || defined _MSC_VER)
513 void free (void *); /* INFRINGES ON USER NAME SPACE */
517 # define YYCOPY_NEEDED 1
521 #if (! defined yyoverflow \
522 && (! defined __cplusplus \
523 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
524 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
526 /* A type that is properly aligned for any stack member. */
529 yytype_int16 yyss_alloc
;
534 /* The size of the maximum gap between one aligned stack and the next. */
535 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
537 /* The size of an array large to enough to hold all stacks, each with
539 # define YYSTACK_BYTES(N) \
540 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
541 + 2 * YYSTACK_GAP_MAXIMUM)
543 # define YYCOPY_NEEDED 1
545 /* Relocate STACK from its old location to the new one. The
546 local variables YYSIZE and YYSTACKSIZE give the old and new number of
547 elements in the stack, and YYPTR gives the new location of the
548 stack. Advance YYPTR to a properly aligned location for the next
550 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
553 YYSIZE_T yynewbytes; \
554 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
555 Stack = &yyptr->Stack_alloc; \
556 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
557 yyptr += yynewbytes / sizeof (*yyptr); \
563 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
564 /* Copy COUNT objects from SRC to DST. The source and destination do
567 # if defined __GNUC__ && 1 < __GNUC__
568 # define YYCOPY(Dst, Src, Count) \
569 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
571 # define YYCOPY(Dst, Src, Count) \
575 for (yyi = 0; yyi < (Count); yyi++) \
576 (Dst)[yyi] = (Src)[yyi]; \
581 #endif /* !YYCOPY_NEEDED */
583 /* YYFINAL -- State number of the termination state. */
585 /* YYLAST -- Last index in YYTABLE. */
588 /* YYNTOKENS -- Number of terminals. */
590 /* YYNNTS -- Number of nonterminals. */
592 /* YYNRULES -- Number of rules. */
594 /* YYNSTATES -- Number of states. */
595 #define YYNSTATES 149
597 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
598 by yylex, with out-of-bounds checking. */
600 #define YYMAXUTOK 311
602 #define YYTRANSLATE(YYX) \
603 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
605 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
606 as returned by yylex, without out-of-bounds checking. */
607 static const yytype_uint8 yytranslate
[] =
609 0, 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, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
635 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
636 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
637 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
638 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
639 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
644 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
645 static const yytype_uint16 yyrline
[] =
647 0, 269, 269, 277, 279, 283, 284, 294, 298, 303,
648 304, 309, 314, 315, 316, 317, 318, 323, 332, 333,
649 334, 335, 336, 337, 338, 339, 339, 340, 341, 365,
650 366, 367, 368, 372, 373, 382, 383, 384, 388, 395,
651 402, 406, 410, 417, 432, 433, 437, 449, 449, 454,
652 454, 459, 470, 485, 486, 487, 488, 492, 493, 498,
653 500, 505, 506, 511, 513, 518, 519, 523, 524, 525,
654 526, 531, 536, 541, 547, 553, 564, 565, 574, 575,
655 581, 582, 583, 590, 590, 598, 599, 600, 605, 607,
656 609, 611, 613, 615, 617, 622, 624, 634, 635, 640,
657 641, 642, 651, 671, 673, 682, 687, 688, 693, 700,
662 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
663 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
664 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
665 static const char *const yytname
[] =
667 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
668 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
669 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
670 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
671 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
672 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
673 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
674 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
675 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
676 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
677 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
678 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
679 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
680 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
681 "prologue_declaration", "$@1", "params", "grammar_declaration",
682 "union_name", "symbol_declaration", "$@2", "$@3",
683 "precedence_declaration", "precedence_declarator", "tag.opt",
684 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
685 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
686 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
687 "named_ref.opt", "variable", "content.opt", "braceless", "id",
688 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
693 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
694 (internal) symbol number NUM (which must be that of a token). */
695 static const yytype_uint16 yytoknum
[] =
697 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
698 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
699 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
700 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
701 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
702 305, 306, 307, 308, 309, 310, 311
706 #define YYPACT_NINF -50
708 #define yypact_value_is_default(yystate) \
711 #define YYTABLE_NINF -110
713 #define yytable_value_is_error(yytable_value) \
716 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
718 static const yytype_int16 yypact
[] =
720 -50, 4, 107, -50, -50, -50, -20, 3, 11, -50,
721 -50, -50, -50, 14, -50, 12, 68, -50, 72, 73,
722 -50, 0, -50, 45, 86, 2, -50, -50, -50, 17,
723 95, 96, 32, -50, -50, -50, 16, -50, -50, -50,
724 54, -50, -50, -50, -50, 49, -2, -2, 32, 27,
725 27, -50, 63, -50, -50, -50, 37, -50, -50, -50,
726 -50, 101, -50, -50, -50, 103, -50, 104, -50, -50,
727 -50, -50, -50, -50, -50, -50, 57, -50, 58, 1,
728 -50, -50, 79, 70, -50, 63, -50, 32, -50, -50,
729 -2, 64, -2, 32, -50, -50, -50, -50, 27, -50,
730 -50, 27, -50, -50, -50, -50, -50, -50, -50, -50,
731 -50, 78, -50, -50, -50, -50, -50, 83, -50, 32,
732 -50, 143, -50, 145, -50, -50, -50, -50, -50, -50,
733 -50, -50, -50, 43, 50, -50, -50, 32, 146, 97,
734 79, -50, 79, 50, -50, -50, -50, -50, -50
737 /* YYDEFACT[S] -- default reduction number in state S. Performed when
738 YYTABLE does not specify something else to do. Zero means the default
740 static const yytype_uint8 yydefact
[] =
742 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
743 54, 55, 56, 0, 40, 0, 9, 11, 0, 0,
744 7, 0, 16, 0, 0, 0, 41, 21, 22, 0,
745 0, 0, 0, 29, 30, 31, 0, 6, 32, 25,
746 44, 4, 5, 36, 35, 57, 0, 0, 0, 0,
747 0, 102, 0, 42, 98, 97, 99, 10, 12, 13,
748 14, 0, 17, 18, 19, 0, 23, 0, 27, 28,
749 108, 104, 103, 106, 37, 107, 0, 105, 0, 0,
750 78, 80, 95, 0, 45, 0, 58, 0, 71, 76,
751 50, 72, 48, 51, 63, 68, 69, 70, 38, 65,
752 67, 39, 43, 101, 100, 8, 15, 20, 24, 82,
753 81, 0, 79, 2, 96, 83, 34, 26, 46, 52,
754 59, 61, 77, 73, 74, 64, 66, 110, 88, 33,
755 60, 62, 75, 84, 85, 88, 87, 0, 0, 0,
756 95, 91, 95, 86, 92, 93, 94, 90, 89
759 /* YYPGOTO[NTERM-NUM]. */
760 static const yytype_int16 yypgoto
[] =
762 -50, -50, -50, -50, -50, -50, 149, -50, -50, -50,
763 -50, -50, -50, -50, -50, 33, -50, 106, -42, -4,
764 112, -50, 74, -50, -50, -50, 19, -45, -50, -50,
765 -16, -8, -50, -32, -49, -50
768 /* YYDEFGOTO[NTERM-NUM]. */
769 static const yytype_int16 yydefgoto
[] =
771 -1, 1, 2, 41, 83, 117, 78, 85, 43, 47,
772 46, 44, 45, 87, 119, 120, 93, 98, 99, 89,
773 90, 79, 80, 81, 128, 133, 134, 115, 56, 105,
774 53, 73, 82, 100, 75, 113
777 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
778 positive, shift that token. If negative, reduce the rule which
779 number is the opposite. If YYTABLE_NINF, syntax error. */
780 static const yytype_int16 yytable
[] =
782 74, -109, 76, 60, 3, 64, 4, 5, 6, 7,
783 8, 9, 10, 11, 12, 54, 94, 76, 13, 14,
784 66, 4, 5, 6, 7, 8, 9, 10, 11, 12,
785 70, 26, 48, 13, 14, 70, 102, 32, 91, 91,
786 103, 71, 124, 49, 72, 61, 26, 65, 77, 111,
787 88, 50, 32, 70, 51, 121, 126, 40, 55, 126,
788 52, 125, 67, 77, 137, 138, 139, 70, 123, 118,
789 71, 57, 40, 72, 132, 71, 58, 59, 72, 95,
790 96, 97, 91, 104, 91, 62, 122, 121, 122, 63,
791 140, 141, 135, 71, 136, 147, 72, 148, 68, 69,
792 84, 86, 142, 51, 106, 144, 107, 108, 109, 110,
793 116, 142, 4, 5, 6, 7, 8, 9, 10, 11,
794 12, 114, 127, 129, 13, 14, 15, 16, 17, 18,
795 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
796 29, 30, 31, 32, 33, 34, 35, 131, 70, 146,
797 145, 42, 130, 112, 143, 36, 101, 37, 38, 92,
801 static const yytype_int16 yycheck
[] =
803 32, 0, 1, 3, 0, 3, 5, 6, 7, 8,
804 9, 10, 11, 12, 13, 3, 48, 1, 17, 18,
805 3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
806 3, 30, 52, 17, 18, 3, 52, 36, 46, 47,
807 3, 43, 91, 40, 46, 45, 30, 45, 47, 48,
808 52, 40, 36, 3, 40, 87, 98, 56, 46, 101,
809 46, 93, 45, 47, 14, 15, 16, 3, 4, 85,
810 43, 3, 56, 46, 123, 43, 4, 4, 46, 52,
811 53, 54, 90, 46, 92, 40, 90, 119, 92, 3,
812 40, 41, 49, 43, 51, 140, 46, 142, 3, 3,
813 46, 52, 134, 40, 3, 137, 3, 3, 51, 51,
814 40, 143, 5, 6, 7, 8, 9, 10, 11, 12,
815 13, 42, 44, 40, 17, 18, 19, 20, 21, 22,
816 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
817 33, 34, 35, 36, 37, 38, 39, 4, 3, 52,
818 4, 2, 119, 79, 135, 48, 50, 50, 51, 47,
822 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
823 symbol of state STATE-NUM. */
824 static const yytype_uint8 yystos
[] =
826 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
827 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
828 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
829 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
830 56, 60, 63, 65, 68, 69, 67, 66, 52, 40,
831 40, 40, 46, 87, 3, 46, 85, 3, 4, 4,
832 3, 45, 40, 3, 3, 45, 3, 45, 3, 3,
833 3, 43, 46, 88, 90, 91, 1, 47, 63, 78,
834 79, 80, 89, 61, 46, 64, 52, 70, 52, 76,
835 77, 88, 77, 73, 90, 52, 53, 54, 74, 75,
836 90, 74, 87, 3, 46, 86, 3, 3, 3, 51,
837 51, 48, 79, 92, 42, 84, 40, 62, 87, 71,
838 72, 90, 76, 4, 91, 90, 75, 44, 81, 40,
839 72, 4, 91, 82, 83, 49, 51, 14, 15, 16,
840 40, 41, 90, 83, 90, 4, 52, 84, 84
843 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
844 static const yytype_uint8 yyr1
[] =
846 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
847 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
848 60, 60, 60, 60, 60, 61, 60, 60, 60, 60,
849 60, 60, 60, 62, 62, 63, 63, 63, 63, 63,
850 63, 63, 63, 63, 64, 64, 63, 66, 65, 67,
851 65, 65, 68, 69, 69, 69, 69, 70, 70, 71,
852 71, 72, 72, 73, 73, 74, 74, 75, 75, 75,
853 75, 76, 76, 76, 76, 76, 77, 77, 78, 78,
854 79, 79, 79, 81, 80, 82, 82, 82, 83, 83,
855 83, 83, 83, 83, 83, 84, 84, 85, 85, 86,
856 86, 86, 87, 88, 88, 89, 90, 90, 91, 92,
860 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
861 static const yytype_uint8 yyr2
[] =
863 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
864 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
865 3, 1, 1, 2, 3, 0, 3, 2, 2, 1,
866 1, 1, 1, 2, 1, 1, 1, 2, 3, 3,
867 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
868 3, 3, 3, 1, 1, 1, 1, 0, 1, 1,
869 2, 1, 2, 1, 2, 1, 2, 1, 1, 1,
870 1, 1, 1, 2, 2, 3, 1, 2, 1, 2,
871 1, 2, 2, 0, 4, 1, 3, 2, 0, 3,
872 3, 2, 3, 3, 3, 0, 1, 1, 1, 0,
873 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
878 #define yyerrok (yyerrstatus = 0)
879 #define yyclearin (yychar = YYEMPTY)
883 #define YYACCEPT goto yyacceptlab
884 #define YYABORT goto yyabortlab
885 #define YYERROR goto yyerrorlab
888 /* Like YYERROR except do call yyerror. This remains here temporarily
889 to ease the transition to the new meaning of YYERROR, for GCC.
890 Once GCC version 2 has supplanted version 1, this can go. However,
891 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
892 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
895 #define YYFAIL goto yyerrlab
897 /* This is here to suppress warnings from the GCC cpp's
898 -Wunused-macros. Normally we don't worry about that warning, but
899 some users do, and we want to make it easy for users to remove
900 YYFAIL uses, which will produce warnings from Bison 2.5. */
903 #define YYRECOVERING() (!!yyerrstatus)
905 #define YYBACKUP(Token, Value) \
907 if (yychar == YYEMPTY) \
911 YYPOPSTACK (yylen); \
913 YY_LAC_DISCARD ("YYBACKUP"); \
918 yyerror (YY_("syntax error: cannot back up")); \
925 #define YYERRCODE 256
928 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
929 If N is 0, then set CURRENT to the empty location which ends
930 the previous symbol: RHS[0] (always defined). */
932 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
933 #ifndef YYLLOC_DEFAULT
934 # define YYLLOC_DEFAULT(Current, Rhs, N) \
938 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
939 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
940 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
941 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
945 (Current).first_line = (Current).last_line = \
946 YYRHSLOC (Rhs, 0).last_line; \
947 (Current).first_column = (Current).last_column = \
948 YYRHSLOC (Rhs, 0).last_column; \
954 /* YY_LOCATION_PRINT -- Print the location on the stream.
955 This macro was not mandated originally: define only if we know
956 we won't break user code: when these are the locations we know. */
958 #ifndef YY_LOCATION_PRINT
959 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
960 # define YY_LOCATION_PRINT(File, Loc) \
961 fprintf (File, "%d.%d-%d.%d", \
962 (Loc).first_line, (Loc).first_column, \
963 (Loc).last_line, (Loc).last_column)
965 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
970 /* YYLEX -- calling `yylex' with the right arguments. */
973 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
975 # define YYLEX yylex (&yylval, &yylloc)
978 /* Enable debugging if requested. */
982 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
983 # define YYFPRINTF fprintf
986 # define YYDPRINTF(Args) \
992 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
996 YYFPRINTF (stderr, "%s ", Title); \
997 yy_symbol_print (stderr, \
998 Type, Value, Location); \
999 YYFPRINTF (stderr, "\n"); \
1004 /*--------------------------------.
1005 | Print this symbol on YYOUTPUT. |
1006 `--------------------------------*/
1009 #if (defined __STDC__ || defined __C99__FUNC__ \
1010 || defined __cplusplus || defined _MSC_VER)
1012 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1015 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1018 YYSTYPE
const * const yyvaluep
;
1019 YYLTYPE
const * const yylocationp
;
1023 YYUSE (yylocationp
);
1028 if (yytype
< YYNTOKENS
)
1029 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1035 /* Line 753 of yacc.c */
1036 #line 193 "src/parse-gram.y"
1037 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
1038 /* Line 753 of yacc.c */
1039 #line 1040 "src/parse-gram.c"
1042 case 4: // "integer"
1044 /* Line 753 of yacc.c */
1045 #line 206 "src/parse-gram.y"
1046 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
1047 /* Line 753 of yacc.c */
1048 #line 1049 "src/parse-gram.c"
1051 case 24: // "%<flag>"
1053 /* Line 753 of yacc.c */
1054 #line 202 "src/parse-gram.y"
1055 { fprintf (stderr
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1056 /* Line 753 of yacc.c */
1057 #line 1058 "src/parse-gram.c"
1062 /* Line 753 of yacc.c */
1063 #line 195 "src/parse-gram.y"
1064 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1065 /* Line 753 of yacc.c */
1066 #line 1067 "src/parse-gram.c"
1069 case 42: // "[identifier]"
1071 /* Line 753 of yacc.c */
1072 #line 200 "src/parse-gram.y"
1073 { fprintf (stderr
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1074 /* Line 753 of yacc.c */
1075 #line 1076 "src/parse-gram.c"
1080 /* Line 753 of yacc.c */
1081 #line 187 "src/parse-gram.y"
1082 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
1083 /* Line 753 of yacc.c */
1084 #line 1085 "src/parse-gram.c"
1087 case 44: // "epilogue"
1089 /* Line 753 of yacc.c */
1090 #line 195 "src/parse-gram.y"
1091 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1092 /* Line 753 of yacc.c */
1093 #line 1094 "src/parse-gram.c"
1096 case 46: // "identifier"
1098 /* Line 753 of yacc.c */
1099 #line 199 "src/parse-gram.y"
1100 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1101 /* Line 753 of yacc.c */
1102 #line 1103 "src/parse-gram.c"
1105 case 47: // "identifier:"
1107 /* Line 753 of yacc.c */
1108 #line 201 "src/parse-gram.y"
1109 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
1110 /* Line 753 of yacc.c */
1111 #line 1112 "src/parse-gram.c"
1114 case 50: // "%{...%}"
1116 /* Line 753 of yacc.c */
1117 #line 195 "src/parse-gram.y"
1118 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1119 /* Line 753 of yacc.c */
1120 #line 1121 "src/parse-gram.c"
1125 /* Line 753 of yacc.c */
1126 #line 203 "src/parse-gram.y"
1127 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1128 /* Line 753 of yacc.c */
1129 #line 1130 "src/parse-gram.c"
1132 case 55: // "%param"
1134 /* Line 753 of yacc.c */
1135 #line 249 "src/parse-gram.y"
1137 switch (((*yyvaluep
).param
))
1139 #define CASE(In, Out) \
1140 case param_ ## In: fputs ("%" #Out, stderr); break
1141 CASE(lex
, lex
-param
);
1142 CASE(parse
, parse
-param
);
1145 case param_none
: aver (false); break;
1148 /* Line 753 of yacc.c */
1149 #line 1150 "src/parse-gram.c"
1152 case 72: // symbol.prec
1154 /* Line 753 of yacc.c */
1155 #line 209 "src/parse-gram.y"
1156 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1157 /* Line 753 of yacc.c */
1158 #line 1159 "src/parse-gram.c"
1161 case 85: // variable
1163 /* Line 753 of yacc.c */
1164 #line 199 "src/parse-gram.y"
1165 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1166 /* Line 753 of yacc.c */
1167 #line 1168 "src/parse-gram.c"
1170 case 86: // content.opt
1172 /* Line 753 of yacc.c */
1173 #line 195 "src/parse-gram.y"
1174 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1175 /* Line 753 of yacc.c */
1176 #line 1177 "src/parse-gram.c"
1179 case 87: // braceless
1181 /* Line 753 of yacc.c */
1182 #line 195 "src/parse-gram.y"
1183 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1184 /* Line 753 of yacc.c */
1185 #line 1186 "src/parse-gram.c"
1190 /* Line 753 of yacc.c */
1191 #line 209 "src/parse-gram.y"
1192 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1193 /* Line 753 of yacc.c */
1194 #line 1195 "src/parse-gram.c"
1197 case 89: // id_colon
1199 /* Line 753 of yacc.c */
1200 #line 210 "src/parse-gram.y"
1201 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1202 /* Line 753 of yacc.c */
1203 #line 1204 "src/parse-gram.c"
1208 /* Line 753 of yacc.c */
1209 #line 209 "src/parse-gram.y"
1210 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1211 /* Line 753 of yacc.c */
1212 #line 1213 "src/parse-gram.c"
1215 case 91: // string_as_id
1217 /* Line 753 of yacc.c */
1218 #line 209 "src/parse-gram.y"
1219 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1220 /* Line 753 of yacc.c */
1221 #line 1222 "src/parse-gram.c"
1230 /*--------------------------------.
1231 | Print this symbol on YYOUTPUT. |
1232 `--------------------------------*/
1234 #if (defined __STDC__ || defined __C99__FUNC__ \
1235 || defined __cplusplus || defined _MSC_VER)
1237 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1240 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1243 YYSTYPE
const * const yyvaluep
;
1244 YYLTYPE
const * const yylocationp
;
1247 if (yytype
< YYNTOKENS
)
1248 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1250 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1252 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1253 YYFPRINTF (yyoutput
, ": ");
1254 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1255 YYFPRINTF (yyoutput
, ")");
1258 /*------------------------------------------------------------------.
1259 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1261 `------------------------------------------------------------------*/
1263 #if (defined __STDC__ || defined __C99__FUNC__ \
1264 || defined __cplusplus || defined _MSC_VER)
1266 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1269 yy_stack_print (yybottom
, yytop
)
1270 yytype_int16
*yybottom
;
1271 yytype_int16
*yytop
;
1274 YYFPRINTF (stderr
, "Stack now");
1275 for (; yybottom
<= yytop
; yybottom
++)
1277 int yybot
= *yybottom
;
1278 YYFPRINTF (stderr
, " %d", yybot
);
1280 YYFPRINTF (stderr
, "\n");
1283 # define YY_STACK_PRINT(Bottom, Top) \
1286 yy_stack_print ((Bottom), (Top)); \
1290 /*------------------------------------------------.
1291 | Report that the YYRULE is going to be reduced. |
1292 `------------------------------------------------*/
1294 #if (defined __STDC__ || defined __C99__FUNC__ \
1295 || defined __cplusplus || defined _MSC_VER)
1297 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1300 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1301 yytype_int16
*yyssp
;
1307 unsigned long int yylno
= yyrline
[yyrule
];
1308 int yynrhs
= yyr2
[yyrule
];
1310 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1312 /* The symbols being reduced. */
1313 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1315 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1316 yy_symbol_print (stderr
,
1317 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1318 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1319 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1320 YYFPRINTF (stderr
, "\n");
1324 # define YY_REDUCE_PRINT(Rule) \
1327 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1330 /* Nonzero means print parse trace. It is left uninitialized so that
1331 multiple parsers can coexist. */
1333 #else /* !YYDEBUG */
1334 # define YYDPRINTF(Args)
1335 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1336 # define YY_STACK_PRINT(Bottom, Top)
1337 # define YY_REDUCE_PRINT(Rule)
1338 #endif /* !YYDEBUG */
1341 /* YYINITDEPTH -- initial size of the parser's stacks. */
1343 # define YYINITDEPTH 200
1346 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1347 if the built-in stack extension method is used).
1349 Do not make this value too large; the results are undefined if
1350 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1351 evaluated with infinite-precision integer arithmetic. */
1354 # define YYMAXDEPTH 10000
1357 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1358 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1359 stack, and such that *YYCAPACITY is the maximum number of elements it
1360 can hold without a reallocation, make sure there is enough room to
1361 store YYADD more elements. If not, allocate a new stack using
1362 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1363 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1364 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1365 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1366 required. Return 1 if memory is exhausted. */
1368 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1370 char const *yydebug_prefix
,
1371 char const *yydebug_suffix
,
1373 yytype_int16
**yybottom
,
1374 yytype_int16
*yybottom_no_free
,
1375 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1377 YYSIZE_T yysize_old
=
1378 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1379 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1380 if (*yycapacity
< yysize_new
)
1382 YYSIZE_T yyalloc
= 2 * yysize_new
;
1383 yytype_int16
*yybottom_new
;
1384 /* Use YYMAXDEPTH for maximum stack size given that the stack
1385 should never need to grow larger than the main state stack
1386 needs to grow without LAC. */
1387 if (YYMAXDEPTH
< yysize_new
)
1389 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1393 if (YYMAXDEPTH
< yyalloc
)
1394 yyalloc
= YYMAXDEPTH
;
1396 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1399 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1403 if (*yytop
!= yytop_empty
)
1405 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1406 *yytop
= yybottom_new
+ (yysize_old
- 1);
1408 if (*yybottom
!= yybottom_no_free
)
1409 YYSTACK_FREE (*yybottom
);
1410 *yybottom
= yybottom_new
;
1411 *yycapacity
= yyalloc
;
1416 /* Establish the initial context for the current lookahead if no initial
1417 context is currently established.
1419 We define a context as a snapshot of the parser stacks. We define
1420 the initial context for a lookahead as the context in which the
1421 parser initially examines that lookahead in order to select a
1422 syntactic action. Thus, if the lookahead eventually proves
1423 syntactically unacceptable (possibly in a later context reached via a
1424 series of reductions), the initial context can be used to determine
1425 the exact set of tokens that would be syntactically acceptable in the
1426 lookahead's place. Moreover, it is the context after which any
1427 further semantic actions would be erroneous because they would be
1428 determined by a syntactically unacceptable token.
1430 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1431 performed in an inconsistent state (which, for the purposes of LAC,
1432 includes consistent states that don't know they're consistent because
1433 their default reductions have been disabled). Iff there is a
1434 lookahead token, it should also be invoked before reporting a syntax
1435 error. This latter case is for the sake of the debugging output.
1437 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1438 follows. If no initial context is currently established for the
1439 current lookahead, then check if that lookahead can eventually be
1440 shifted if syntactic actions continue from the current context.
1441 Report a syntax error if it cannot. */
1442 #define YY_LAC_ESTABLISH \
1444 if (!yy_lac_established) \
1446 YYDPRINTF ((stderr, \
1447 "LAC: initial context established for %s\n", \
1448 yytname[yytoken])); \
1449 yy_lac_established = 1; \
1451 int yy_lac_status = \
1452 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1453 if (yy_lac_status == 2) \
1454 goto yyexhaustedlab; \
1455 if (yy_lac_status == 1) \
1461 /* Discard any previous initial lookahead context because of Event,
1462 which may be a lookahead change or an invalidation of the currently
1463 established initial context for the current lookahead.
1465 The most common example of a lookahead change is a shift. An example
1466 of both cases is syntax error recovery. That is, a syntax error
1467 occurs when the lookahead is syntactically erroneous for the
1468 currently established initial context, so error recovery manipulates
1469 the parser stacks to try to find a new initial context in which the
1470 current lookahead is syntactically acceptable. If it fails to find
1471 such a context, it discards the lookahead. */
1473 # define YY_LAC_DISCARD(Event) \
1475 if (yy_lac_established) \
1478 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1480 yy_lac_established = 0; \
1484 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1487 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1488 eventually (after perhaps some reductions) be shifted, return 1 if
1489 not, or return 2 if memory is exhausted. As preconditions and
1490 postconditions: *YYES_CAPACITY is the allocated size of the array to
1491 which *YYES points, and either *YYES = YYESA or *YYES points to an
1492 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1493 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1494 any old *YYES other than YYESA. */
1496 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1497 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1499 yytype_int16
*yyes_prev
= yyssp
;
1500 yytype_int16
*yyesp
= yyes_prev
;
1501 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1502 if (yytoken
== YYUNDEFTOK
)
1504 YYDPRINTF ((stderr
, " Always Err\n"));
1509 int yyrule
= yypact
[*yyesp
];
1510 if (yypact_value_is_default (yyrule
)
1511 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1512 || yycheck
[yyrule
] != yytoken
)
1514 yyrule
= yydefact
[*yyesp
];
1517 YYDPRINTF ((stderr
, " Err\n"));
1523 yyrule
= yytable
[yyrule
];
1524 if (yytable_value_is_error (yyrule
))
1526 YYDPRINTF ((stderr
, " Err\n"));
1531 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1537 YYSIZE_T yylen
= yyr2
[yyrule
];
1538 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1539 if (yyesp
!= yyes_prev
)
1541 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1554 yyesp
= yyes_prev
-= yylen
;
1559 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1560 yystate
= yypgoto
[yylhs
] + *yyesp
;
1561 if (yystate
< 0 || YYLAST
< yystate
1562 || yycheck
[yystate
] != *yyesp
)
1563 yystate
= yydefgoto
[yylhs
];
1565 yystate
= yytable
[yystate
];
1567 if (yyesp
== yyes_prev
)
1574 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1578 yyes
, yyesa
, &yyesp
, yyes_prev
))
1580 YYDPRINTF ((stderr
, "\n"));
1585 YYDPRINTF ((stderr
, " G%d", yystate
));
1594 # if defined __GLIBC__ && defined _STRING_H
1595 # define yystrlen strlen
1597 /* Return the length of YYSTR. */
1598 #if (defined __STDC__ || defined __C99__FUNC__ \
1599 || defined __cplusplus || defined _MSC_VER)
1601 yystrlen (const char *yystr
)
1609 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1617 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1618 # define yystpcpy stpcpy
1620 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1622 #if (defined __STDC__ || defined __C99__FUNC__ \
1623 || defined __cplusplus || defined _MSC_VER)
1625 yystpcpy (char *yydest
, const char *yysrc
)
1628 yystpcpy (yydest
, yysrc
)
1634 const char *yys
= yysrc
;
1636 while ((*yyd
++ = *yys
++) != '\0')
1645 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1646 quotes and backslashes, so that it's suitable for yyerror. The
1647 heuristic is that double-quoting is unnecessary unless the string
1648 contains an apostrophe, a comma, or backslash (other than
1649 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1650 null, do not copy; instead, return the length of what the result
1653 yytnamerr (char *yyres
, const char *yystr
)
1658 char const *yyp
= yystr
;
1665 goto do_not_strip_quotes
;
1669 goto do_not_strip_quotes
;
1682 do_not_strip_quotes
: ;
1686 return yystrlen (yystr
);
1688 return yystpcpy (yyres
, yystr
) - yyres
;
1692 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1693 about the unexpected token YYTOKEN for the state stack whose top is
1694 YYSSP. In order to see if a particular token T is a
1695 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1697 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1698 not large enough to hold the message. In that case, also set
1699 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1700 required number of bytes is too large to store or if
1701 yy_lac returned 2. */
1703 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1704 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1705 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1707 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1708 YYSIZE_T yysize
= yysize0
;
1710 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1711 /* Internationalized format string. */
1712 const char *yyformat
= 0;
1713 /* Arguments of yyformat. */
1714 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1715 /* Number of reported tokens (one for the "unexpected", one per
1719 /* There are many possibilities here to consider:
1720 - Assume YYFAIL is not used. It's too flawed to consider. See
1721 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1722 for details. YYERROR is fine as it does not invoke this
1724 - If this state is a consistent state with a default action, then
1725 the only way this function was invoked is if the default action
1726 is an error action. In that case, don't check for expected
1727 tokens because there are none.
1728 - The only way there can be no lookahead present (in yychar) is if
1729 this state is a consistent state with a default action. Thus,
1730 detecting the absence of a lookahead is sufficient to determine
1731 that there is no unexpected or expected token to report. In that
1732 case, just report a simple "syntax error".
1733 - Don't assume there isn't a lookahead just because this state is a
1734 consistent state with a default action. There might have been a
1735 previous inconsistent state, consistent state with a non-default
1736 action, or user semantic action that manipulated yychar.
1737 In the first two cases, it might appear that the current syntax
1738 error should have been detected in the previous state when yy_lac
1739 was invoked. However, at that time, there might have been a
1740 different syntax error that discarded a different initial context
1741 during error recovery, leaving behind the current lookahead.
1743 if (yytoken
!= YYEMPTY
)
1745 int yyn
= yypact
[*yyssp
];
1746 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1747 yyarg
[yycount
++] = yytname
[yytoken
];
1748 if (!yypact_value_is_default (yyn
))
1752 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1753 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1756 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1758 if (yy_lac_status
== 2)
1760 if (yy_lac_status
== 1)
1763 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1769 yyarg
[yycount
++] = yytname
[yyx
];
1770 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1771 if (! (yysize
<= yysize1
1772 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1779 YYFPRINTF (stderr
, "No expected tokens.\n");
1785 # define YYCASE_(N, S) \
1789 YYCASE_(0, YY_("syntax error"));
1790 YYCASE_(1, YY_("syntax error, unexpected %s"));
1791 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1792 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1793 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1794 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1798 yysize1
= yysize
+ yystrlen (yyformat
);
1799 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1803 if (*yymsg_alloc
< yysize
)
1805 *yymsg_alloc
= 2 * yysize
;
1806 if (! (yysize
<= *yymsg_alloc
1807 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1808 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1812 /* Avoid sprintf, as that infringes on the user's name space.
1813 Don't have undefined behavior even if the translation
1814 produced a string with the wrong number of "%s"s. */
1818 while ((*yyp
= *yyformat
) != '\0')
1819 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1821 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1832 #endif /* YYERROR_VERBOSE */
1834 /*-----------------------------------------------.
1835 | Release the memory associated to this symbol. |
1836 `-----------------------------------------------*/
1839 #if (defined __STDC__ || defined __C99__FUNC__ \
1840 || defined __cplusplus || defined _MSC_VER)
1842 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1845 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1849 YYLTYPE
*yylocationp
;
1853 YYUSE (yylocationp
);
1857 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1867 /* Prevent warnings from -Wmissing-prototypes. */
1868 #ifdef YYPARSE_PARAM
1869 #if (defined __STDC__ || defined __C99__FUNC__ \
1870 || defined __cplusplus || defined _MSC_VER)
1871 int yyparse (void *YYPARSE_PARAM
);
1875 #else /* ! YYPARSE_PARAM */
1876 #if (defined __STDC__ || defined __C99__FUNC__ \
1877 || defined __cplusplus || defined _MSC_VER)
1882 #endif /* ! YYPARSE_PARAM */
1889 #ifdef YYPARSE_PARAM
1890 #if (defined __STDC__ || defined __C99__FUNC__ \
1891 || defined __cplusplus || defined _MSC_VER)
1893 yyparse (void *YYPARSE_PARAM
)
1896 yyparse (YYPARSE_PARAM
)
1897 void *YYPARSE_PARAM
;
1899 #else /* ! YYPARSE_PARAM */
1900 #if (defined __STDC__ || defined __C99__FUNC__ \
1901 || defined __cplusplus || defined _MSC_VER)
1911 /* The lookahead symbol. */
1914 /* The semantic value of the lookahead symbol. */
1917 /* Location data for the lookahead symbol. */
1920 /* Number of syntax errors so far. */
1924 /* Number of tokens to shift before error messages enabled. */
1927 /* The stacks and their tools:
1928 `yyss': related to states.
1929 `yyvs': related to semantic values.
1930 `yyls': related to locations.
1932 Refer to the stacks thru separate pointers, to allow yyoverflow
1933 to reallocate them elsewhere. */
1935 /* The state stack. */
1936 yytype_int16 yyssa
[YYINITDEPTH
];
1938 yytype_int16
*yyssp
;
1940 /* The semantic value stack. */
1941 YYSTYPE yyvsa
[YYINITDEPTH
];
1945 /* The location stack. */
1946 YYLTYPE yylsa
[YYINITDEPTH
];
1950 /* The locations where the error started and ended. */
1951 YYLTYPE yyerror_range
[3];
1953 YYSIZE_T yystacksize
;
1955 yytype_int16 yyesa
[20];
1957 YYSIZE_T yyes_capacity
;
1959 int yy_lac_established
= 0;
1962 /* Lookahead token as an internal (translated) token number. */
1964 /* The variables used to return semantic value and location from the
1970 /* Buffer for error messages, and its allocated size. */
1972 char *yymsg
= yymsgbuf
;
1973 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1976 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1978 /* The number of symbols on the RHS of the reduced rule.
1979 Keep to zero when no symbol should be popped. */
1986 yystacksize
= YYINITDEPTH
;
1989 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1990 if (YYMAXDEPTH
< yyes_capacity
)
1991 yyes_capacity
= YYMAXDEPTH
;
1993 YYDPRINTF ((stderr
, "Starting parse\n"));
1998 yychar
= YYEMPTY
; /* Cause a token to be read. */
2000 /* Initialize stack pointers.
2001 Waste one element of value and location stack
2002 so that they stay on the same level as the state stack.
2003 The wasted elements are never initialized. */
2008 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2009 /* Initialize the default location before parsing starts. */
2010 yylloc
.first_line
= yylloc
.last_line
= 1;
2011 yylloc
.first_column
= yylloc
.last_column
= 1;
2014 /* User initialization code. */
2015 /* Line 1526 of yacc.c */
2016 #line 98 "src/parse-gram.y"
2018 /* Bison's grammar can initial empty locations, hence a default
2019 location is needed. */
2020 boundary_set (&yylloc
.start
, current_file
, 1, 1);
2021 boundary_set (&yylloc
.end
, current_file
, 1, 1);
2023 /* Line 1526 of yacc.c */
2024 #line 2025 "src/parse-gram.c"
2029 /*------------------------------------------------------------.
2030 | yynewstate -- Push a new state, which is found in yystate. |
2031 `------------------------------------------------------------*/
2033 /* In all cases, when you get here, the value and location stacks
2034 have just been pushed. So pushing a state here evens the stacks. */
2040 if (yyss
+ yystacksize
- 1 <= yyssp
)
2042 /* Get the current used size of the three stacks, in elements. */
2043 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2047 /* Give user a chance to reallocate the stack. Use copies of
2048 these so that the &'s don't force the real ones into
2050 YYSTYPE
*yyvs1
= yyvs
;
2051 yytype_int16
*yyss1
= yyss
;
2052 YYLTYPE
*yyls1
= yyls
;
2054 /* Each stack pointer address is followed by the size of the
2055 data in use in that stack, in bytes. This used to be a
2056 conditional around just the two extra args, but that might
2057 be undefined if yyoverflow is a macro. */
2058 yyoverflow (YY_("memory exhausted"),
2059 &yyss1
, yysize
* sizeof (*yyssp
),
2060 &yyvs1
, yysize
* sizeof (*yyvsp
),
2061 &yyls1
, yysize
* sizeof (*yylsp
),
2068 #else /* no yyoverflow */
2069 # ifndef YYSTACK_RELOCATE
2070 goto yyexhaustedlab
;
2072 /* Extend the stack our own way. */
2073 if (YYMAXDEPTH
<= yystacksize
)
2074 goto yyexhaustedlab
;
2076 if (YYMAXDEPTH
< yystacksize
)
2077 yystacksize
= YYMAXDEPTH
;
2080 yytype_int16
*yyss1
= yyss
;
2081 union yyalloc
*yyptr
=
2082 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2084 goto yyexhaustedlab
;
2085 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2086 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2087 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2088 # undef YYSTACK_RELOCATE
2090 YYSTACK_FREE (yyss1
);
2093 #endif /* no yyoverflow */
2095 yyssp
= yyss
+ yysize
- 1;
2096 yyvsp
= yyvs
+ yysize
- 1;
2097 yylsp
= yyls
+ yysize
- 1;
2099 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2100 (unsigned long int) yystacksize
));
2102 if (yyss
+ yystacksize
- 1 <= yyssp
)
2106 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2108 if (yystate
== YYFINAL
)
2118 /* Do appropriate processing given the current state. Read a
2119 lookahead token if we need one and don't already have one. */
2121 /* First try to decide what to do without reference to lookahead token. */
2122 yyn
= yypact
[yystate
];
2123 if (yypact_value_is_default (yyn
))
2126 /* Not known => get a lookahead token if don't already have one. */
2128 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2129 if (yychar
== YYEMPTY
)
2131 YYDPRINTF ((stderr
, "Reading a token: "));
2135 if (yychar
<= YYEOF
)
2137 yychar
= yytoken
= YYEOF
;
2138 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2142 yytoken
= YYTRANSLATE (yychar
);
2143 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2146 /* If the proper action on seeing token YYTOKEN is to reduce or to
2147 detect an error, take that action. */
2149 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2157 if (yytable_value_is_error (yyn
))
2164 /* Count tokens shifted since error; after three, turn off error
2169 /* Shift the lookahead token. */
2170 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2172 /* Discard the shifted token. */
2174 YY_LAC_DISCARD ("shift");
2182 /*-----------------------------------------------------------.
2183 | yydefault -- do the default action for the current state. |
2184 `-----------------------------------------------------------*/
2186 yyn
= yydefact
[yystate
];
2192 /*-----------------------------.
2193 | yyreduce -- Do a reduction. |
2194 `-----------------------------*/
2196 /* yyn is the number of a rule to reduce with. */
2199 /* If YYLEN is nonzero, implement the default value of the action:
2202 Otherwise, the following line sets YYVAL to garbage.
2203 This behavior is undocumented and Bison
2204 users should not rely upon it. Assigning to YYVAL
2205 unconditionally makes the parser a bit smaller, and it avoids a
2206 GCC warning that YYVAL may be used uninitialized. */
2207 yyval
= yyvsp
[1-yylen
];
2209 /* Default location. */
2210 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2211 YY_REDUCE_PRINT (yyn
);
2213 int yychar_backup
= yychar
;
2217 /* Line 1742 of yacc.c */
2218 #line 285 "src/parse-gram.y"
2220 code_props plain_code
;
2221 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2222 code_props_translate_code (&plain_code
);
2223 gram_scanner_last_string_free ();
2224 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2225 plain_code
.code
, (yylsp
[0]));
2226 code_scanner_last_string_free ();
2228 /* Line 1742 of yacc.c */
2229 #line 2230 "src/parse-gram.c"
2233 /* Line 1742 of yacc.c */
2234 #line 295 "src/parse-gram.y"
2236 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2238 /* Line 1742 of yacc.c */
2239 #line 2240 "src/parse-gram.c"
2243 /* Line 1742 of yacc.c */
2244 #line 299 "src/parse-gram.y"
2246 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2247 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2249 /* Line 1742 of yacc.c */
2250 #line 2251 "src/parse-gram.c"
2254 /* Line 1742 of yacc.c */
2255 #line 303 "src/parse-gram.y"
2256 { defines_flag
= true; }
2257 /* Line 1742 of yacc.c */
2258 #line 2259 "src/parse-gram.c"
2262 /* Line 1742 of yacc.c */
2263 #line 305 "src/parse-gram.y"
2265 defines_flag
= true;
2266 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2268 /* Line 1742 of yacc.c */
2269 #line 2270 "src/parse-gram.c"
2273 /* Line 1742 of yacc.c */
2274 #line 310 "src/parse-gram.y"
2276 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2277 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2279 /* Line 1742 of yacc.c */
2280 #line 2281 "src/parse-gram.c"
2284 /* Line 1742 of yacc.c */
2285 #line 314 "src/parse-gram.y"
2286 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2287 /* Line 1742 of yacc.c */
2288 #line 2289 "src/parse-gram.c"
2292 /* Line 1742 of yacc.c */
2293 #line 315 "src/parse-gram.y"
2294 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2295 /* Line 1742 of yacc.c */
2296 #line 2297 "src/parse-gram.c"
2300 /* Line 1742 of yacc.c */
2301 #line 316 "src/parse-gram.y"
2302 { spec_file_prefix
= (yyvsp
[0].chars
); }
2303 /* Line 1742 of yacc.c */
2304 #line 2305 "src/parse-gram.c"
2308 /* Line 1742 of yacc.c */
2309 #line 317 "src/parse-gram.y"
2310 { spec_file_prefix
= (yyvsp
[0].chars
); }
2311 /* Line 1742 of yacc.c */
2312 #line 2313 "src/parse-gram.c"
2316 /* Line 1742 of yacc.c */
2317 #line 319 "src/parse-gram.y"
2319 nondeterministic_parser
= true;
2322 /* Line 1742 of yacc.c */
2323 #line 2324 "src/parse-gram.c"
2327 /* Line 1742 of yacc.c */
2328 #line 324 "src/parse-gram.y"
2331 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2332 code_props_translate_code (&action
);
2333 gram_scanner_last_string_free ();
2334 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2335 code_scanner_last_string_free ();
2337 /* Line 1742 of yacc.c */
2338 #line 2339 "src/parse-gram.c"
2342 /* Line 1742 of yacc.c */
2343 #line 332 "src/parse-gram.y"
2344 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2345 /* Line 1742 of yacc.c */
2346 #line 2347 "src/parse-gram.c"
2350 /* Line 1742 of yacc.c */
2351 #line 333 "src/parse-gram.y"
2352 { spec_name_prefix
= (yyvsp
[0].chars
); }
2353 /* Line 1742 of yacc.c */
2354 #line 2355 "src/parse-gram.c"
2358 /* Line 1742 of yacc.c */
2359 #line 334 "src/parse-gram.y"
2360 { spec_name_prefix
= (yyvsp
[0].chars
); }
2361 /* Line 1742 of yacc.c */
2362 #line 2363 "src/parse-gram.c"
2366 /* Line 1742 of yacc.c */
2367 #line 335 "src/parse-gram.y"
2368 { no_lines_flag
= true; }
2369 /* Line 1742 of yacc.c */
2370 #line 2371 "src/parse-gram.c"
2374 /* Line 1742 of yacc.c */
2375 #line 336 "src/parse-gram.y"
2376 { nondeterministic_parser
= true; }
2377 /* Line 1742 of yacc.c */
2378 #line 2379 "src/parse-gram.c"
2382 /* Line 1742 of yacc.c */
2383 #line 337 "src/parse-gram.y"
2384 { spec_outfile
= (yyvsp
[0].chars
); }
2385 /* Line 1742 of yacc.c */
2386 #line 2387 "src/parse-gram.c"
2390 /* Line 1742 of yacc.c */
2391 #line 338 "src/parse-gram.y"
2392 { spec_outfile
= (yyvsp
[0].chars
); }
2393 /* Line 1742 of yacc.c */
2394 #line 2395 "src/parse-gram.c"
2398 /* Line 1742 of yacc.c */
2399 #line 339 "src/parse-gram.y"
2400 { current_param
= (yyvsp
[0].param
); }
2401 /* Line 1742 of yacc.c */
2402 #line 2403 "src/parse-gram.c"
2406 /* Line 1742 of yacc.c */
2407 #line 339 "src/parse-gram.y"
2408 { current_param
= param_none
; }
2409 /* Line 1742 of yacc.c */
2410 #line 2411 "src/parse-gram.c"
2414 /* Line 1742 of yacc.c */
2415 #line 340 "src/parse-gram.y"
2416 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2417 /* Line 1742 of yacc.c */
2418 #line 2419 "src/parse-gram.c"
2422 /* Line 1742 of yacc.c */
2423 #line 342 "src/parse-gram.y"
2425 char const *skeleton_user
= (yyvsp
[0].chars
);
2426 if (mbschr (skeleton_user
, '/'))
2428 size_t dir_length
= strlen (current_file
);
2429 char *skeleton_build
;
2430 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2432 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2435 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2438 strncpy (skeleton_build
, current_file
, dir_length
);
2439 skeleton_build
[dir_length
++] = '/';
2441 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2442 skeleton_user
= uniqstr_new (skeleton_build
);
2443 free (skeleton_build
);
2445 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2447 /* Line 1742 of yacc.c */
2448 #line 2449 "src/parse-gram.c"
2452 /* Line 1742 of yacc.c */
2453 #line 365 "src/parse-gram.y"
2454 { token_table_flag
= true; }
2455 /* Line 1742 of yacc.c */
2456 #line 2457 "src/parse-gram.c"
2460 /* Line 1742 of yacc.c */
2461 #line 366 "src/parse-gram.y"
2462 { report_flag
|= report_states
; }
2463 /* Line 1742 of yacc.c */
2464 #line 2465 "src/parse-gram.c"
2468 /* Line 1742 of yacc.c */
2469 #line 367 "src/parse-gram.y"
2470 { yacc_flag
= true; }
2471 /* Line 1742 of yacc.c */
2472 #line 2473 "src/parse-gram.c"
2476 /* Line 1742 of yacc.c */
2477 #line 372 "src/parse-gram.y"
2478 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2479 /* Line 1742 of yacc.c */
2480 #line 2481 "src/parse-gram.c"
2484 /* Line 1742 of yacc.c */
2485 #line 373 "src/parse-gram.y"
2486 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2487 /* Line 1742 of yacc.c */
2488 #line 2489 "src/parse-gram.c"
2492 /* Line 1742 of yacc.c */
2493 #line 385 "src/parse-gram.y"
2495 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2497 /* Line 1742 of yacc.c */
2498 #line 2499 "src/parse-gram.c"
2502 /* Line 1742 of yacc.c */
2503 #line 389 "src/parse-gram.y"
2506 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2507 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2508 symbol_list_free ((yyvsp
[0].list
));
2510 /* Line 1742 of yacc.c */
2511 #line 2512 "src/parse-gram.c"
2515 /* Line 1742 of yacc.c */
2516 #line 396 "src/parse-gram.y"
2519 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2520 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2521 symbol_list_free ((yyvsp
[0].list
));
2523 /* Line 1742 of yacc.c */
2524 #line 2525 "src/parse-gram.c"
2528 /* Line 1742 of yacc.c */
2529 #line 403 "src/parse-gram.y"
2531 default_prec
= true;
2533 /* Line 1742 of yacc.c */
2534 #line 2535 "src/parse-gram.c"
2538 /* Line 1742 of yacc.c */
2539 #line 407 "src/parse-gram.y"
2541 default_prec
= false;
2543 /* Line 1742 of yacc.c */
2544 #line 2545 "src/parse-gram.c"
2548 /* Line 1742 of yacc.c */
2549 #line 411 "src/parse-gram.y"
2551 /* Do not invoke muscle_percent_code_grow here since it invokes
2552 muscle_user_name_list_grow. */
2553 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2554 code_scanner_last_string_free ();
2556 /* Line 1742 of yacc.c */
2557 #line 2558 "src/parse-gram.c"
2561 /* Line 1742 of yacc.c */
2562 #line 418 "src/parse-gram.y"
2564 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2565 code_scanner_last_string_free ();
2567 /* Line 1742 of yacc.c */
2568 #line 2569 "src/parse-gram.c"
2572 /* Line 1742 of yacc.c */
2573 #line 432 "src/parse-gram.y"
2575 /* Line 1742 of yacc.c */
2576 #line 2577 "src/parse-gram.c"
2580 /* Line 1742 of yacc.c */
2581 #line 433 "src/parse-gram.y"
2582 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2583 /* Line 1742 of yacc.c */
2584 #line 2585 "src/parse-gram.c"
2588 /* Line 1742 of yacc.c */
2589 #line 438 "src/parse-gram.y"
2592 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2593 code_scanner_last_string_free ();
2595 /* Line 1742 of yacc.c */
2596 #line 2597 "src/parse-gram.c"
2600 /* Line 1742 of yacc.c */
2601 #line 449 "src/parse-gram.y"
2602 { current_class
= nterm_sym
; }
2603 /* Line 1742 of yacc.c */
2604 #line 2605 "src/parse-gram.c"
2608 /* Line 1742 of yacc.c */
2609 #line 450 "src/parse-gram.y"
2611 current_class
= unknown_sym
;
2612 current_type
= NULL
;
2614 /* Line 1742 of yacc.c */
2615 #line 2616 "src/parse-gram.c"
2619 /* Line 1742 of yacc.c */
2620 #line 454 "src/parse-gram.y"
2621 { current_class
= token_sym
; }
2622 /* Line 1742 of yacc.c */
2623 #line 2624 "src/parse-gram.c"
2627 /* Line 1742 of yacc.c */
2628 #line 455 "src/parse-gram.y"
2630 current_class
= unknown_sym
;
2631 current_type
= NULL
;
2633 /* Line 1742 of yacc.c */
2634 #line 2635 "src/parse-gram.c"
2638 /* Line 1742 of yacc.c */
2639 #line 460 "src/parse-gram.y"
2643 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2644 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2645 symbol_list_free ((yyvsp
[0].list
));
2647 /* Line 1742 of yacc.c */
2648 #line 2649 "src/parse-gram.c"
2652 /* Line 1742 of yacc.c */
2653 #line 471 "src/parse-gram.y"
2657 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2659 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2660 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2662 symbol_list_free ((yyvsp
[0].list
));
2663 current_type
= NULL
;
2665 /* Line 1742 of yacc.c */
2666 #line 2667 "src/parse-gram.c"
2670 /* Line 1742 of yacc.c */
2671 #line 485 "src/parse-gram.y"
2672 { (yyval
.assoc
) = left_assoc
; }
2673 /* Line 1742 of yacc.c */
2674 #line 2675 "src/parse-gram.c"
2678 /* Line 1742 of yacc.c */
2679 #line 486 "src/parse-gram.y"
2680 { (yyval
.assoc
) = right_assoc
; }
2681 /* Line 1742 of yacc.c */
2682 #line 2683 "src/parse-gram.c"
2686 /* Line 1742 of yacc.c */
2687 #line 487 "src/parse-gram.y"
2688 { (yyval
.assoc
) = non_assoc
; }
2689 /* Line 1742 of yacc.c */
2690 #line 2691 "src/parse-gram.c"
2694 /* Line 1742 of yacc.c */
2695 #line 488 "src/parse-gram.y"
2696 { (yyval
.assoc
) = precedence_assoc
; }
2697 /* Line 1742 of yacc.c */
2698 #line 2699 "src/parse-gram.c"
2702 /* Line 1742 of yacc.c */
2703 #line 492 "src/parse-gram.y"
2704 { current_type
= NULL
; }
2705 /* Line 1742 of yacc.c */
2706 #line 2707 "src/parse-gram.c"
2710 /* Line 1742 of yacc.c */
2711 #line 493 "src/parse-gram.y"
2712 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2713 /* Line 1742 of yacc.c */
2714 #line 2715 "src/parse-gram.c"
2718 /* Line 1742 of yacc.c */
2719 #line 499 "src/parse-gram.y"
2720 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2721 /* Line 1742 of yacc.c */
2722 #line 2723 "src/parse-gram.c"
2726 /* Line 1742 of yacc.c */
2727 #line 501 "src/parse-gram.y"
2728 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2729 /* Line 1742 of yacc.c */
2730 #line 2731 "src/parse-gram.c"
2734 /* Line 1742 of yacc.c */
2735 #line 505 "src/parse-gram.y"
2736 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2737 /* Line 1742 of yacc.c */
2738 #line 2739 "src/parse-gram.c"
2742 /* Line 1742 of yacc.c */
2743 #line 506 "src/parse-gram.y"
2744 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2745 /* Line 1742 of yacc.c */
2746 #line 2747 "src/parse-gram.c"
2750 /* Line 1742 of yacc.c */
2751 #line 512 "src/parse-gram.y"
2752 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2753 /* Line 1742 of yacc.c */
2754 #line 2755 "src/parse-gram.c"
2758 /* Line 1742 of yacc.c */
2759 #line 514 "src/parse-gram.y"
2760 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2761 /* Line 1742 of yacc.c */
2762 #line 2763 "src/parse-gram.c"
2766 /* Line 1742 of yacc.c */
2767 #line 518 "src/parse-gram.y"
2768 { (yyval
.list
) = (yyvsp
[0].list
); }
2769 /* Line 1742 of yacc.c */
2770 #line 2771 "src/parse-gram.c"
2774 /* Line 1742 of yacc.c */
2775 #line 519 "src/parse-gram.y"
2776 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2777 /* Line 1742 of yacc.c */
2778 #line 2779 "src/parse-gram.c"
2782 /* Line 1742 of yacc.c */
2783 #line 523 "src/parse-gram.y"
2784 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2785 /* Line 1742 of yacc.c */
2786 #line 2787 "src/parse-gram.c"
2790 /* Line 1742 of yacc.c */
2791 #line 524 "src/parse-gram.y"
2792 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2793 /* Line 1742 of yacc.c */
2794 #line 2795 "src/parse-gram.c"
2798 /* Line 1742 of yacc.c */
2799 #line 525 "src/parse-gram.y"
2800 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2801 /* Line 1742 of yacc.c */
2802 #line 2803 "src/parse-gram.c"
2806 /* Line 1742 of yacc.c */
2807 #line 526 "src/parse-gram.y"
2808 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2809 /* Line 1742 of yacc.c */
2810 #line 2811 "src/parse-gram.c"
2814 /* Line 1742 of yacc.c */
2815 #line 532 "src/parse-gram.y"
2817 current_type
= (yyvsp
[0].uniqstr
);
2820 /* Line 1742 of yacc.c */
2821 #line 2822 "src/parse-gram.c"
2825 /* Line 1742 of yacc.c */
2826 #line 537 "src/parse-gram.y"
2828 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2829 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2831 /* Line 1742 of yacc.c */
2832 #line 2833 "src/parse-gram.c"
2836 /* Line 1742 of yacc.c */
2837 #line 542 "src/parse-gram.y"
2839 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2840 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2841 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2843 /* Line 1742 of yacc.c */
2844 #line 2845 "src/parse-gram.c"
2848 /* Line 1742 of yacc.c */
2849 #line 548 "src/parse-gram.y"
2851 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2852 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2853 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2855 /* Line 1742 of yacc.c */
2856 #line 2857 "src/parse-gram.c"
2860 /* Line 1742 of yacc.c */
2861 #line 554 "src/parse-gram.y"
2863 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2864 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2865 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2866 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2868 /* Line 1742 of yacc.c */
2869 #line 2870 "src/parse-gram.c"
2873 /* Line 1742 of yacc.c */
2874 #line 584 "src/parse-gram.y"
2878 /* Line 1742 of yacc.c */
2879 #line 2880 "src/parse-gram.c"
2883 /* Line 1742 of yacc.c */
2884 #line 590 "src/parse-gram.y"
2885 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2886 /* Line 1742 of yacc.c */
2887 #line 2888 "src/parse-gram.c"
2891 /* Line 1742 of yacc.c */
2892 #line 591 "src/parse-gram.y"
2894 /* Free the current lhs. */
2895 current_lhs (0, (yylsp
[-3]), 0);
2897 /* Line 1742 of yacc.c */
2898 #line 2899 "src/parse-gram.c"
2902 /* Line 1742 of yacc.c */
2903 #line 598 "src/parse-gram.y"
2904 { grammar_current_rule_end ((yylsp
[0])); }
2905 /* Line 1742 of yacc.c */
2906 #line 2907 "src/parse-gram.c"
2910 /* Line 1742 of yacc.c */
2911 #line 599 "src/parse-gram.y"
2912 { grammar_current_rule_end ((yylsp
[0])); }
2913 /* Line 1742 of yacc.c */
2914 #line 2915 "src/parse-gram.c"
2918 /* Line 1742 of yacc.c */
2919 #line 605 "src/parse-gram.y"
2920 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2921 current_lhs_named_ref
); }
2922 /* Line 1742 of yacc.c */
2923 #line 2924 "src/parse-gram.c"
2927 /* Line 1742 of yacc.c */
2928 #line 608 "src/parse-gram.y"
2929 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2930 /* Line 1742 of yacc.c */
2931 #line 2932 "src/parse-gram.c"
2935 /* Line 1742 of yacc.c */
2936 #line 610 "src/parse-gram.y"
2937 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2938 /* Line 1742 of yacc.c */
2939 #line 2940 "src/parse-gram.c"
2943 /* Line 1742 of yacc.c */
2944 #line 612 "src/parse-gram.y"
2945 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2946 /* Line 1742 of yacc.c */
2947 #line 2948 "src/parse-gram.c"
2951 /* Line 1742 of yacc.c */
2952 #line 614 "src/parse-gram.y"
2953 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2954 /* Line 1742 of yacc.c */
2955 #line 2956 "src/parse-gram.c"
2959 /* Line 1742 of yacc.c */
2960 #line 616 "src/parse-gram.y"
2961 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2962 /* Line 1742 of yacc.c */
2963 #line 2964 "src/parse-gram.c"
2967 /* Line 1742 of yacc.c */
2968 #line 618 "src/parse-gram.y"
2969 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2970 /* Line 1742 of yacc.c */
2971 #line 2972 "src/parse-gram.c"
2975 /* Line 1742 of yacc.c */
2976 #line 622 "src/parse-gram.y"
2977 { (yyval
.named_ref
) = 0; }
2978 /* Line 1742 of yacc.c */
2979 #line 2980 "src/parse-gram.c"
2983 /* Line 1742 of yacc.c */
2984 #line 624 "src/parse-gram.y"
2985 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2986 /* Line 1742 of yacc.c */
2987 #line 2988 "src/parse-gram.c"
2991 /* Line 1742 of yacc.c */
2992 #line 635 "src/parse-gram.y"
2993 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2994 /* Line 1742 of yacc.c */
2995 #line 2996 "src/parse-gram.c"
2999 /* Line 1742 of yacc.c */
3000 #line 640 "src/parse-gram.y"
3001 { (yyval
.chars
) = ""; }
3002 /* Line 1742 of yacc.c */
3003 #line 3004 "src/parse-gram.c"
3007 /* Line 1742 of yacc.c */
3008 #line 641 "src/parse-gram.y"
3009 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
3010 /* Line 1742 of yacc.c */
3011 #line 3012 "src/parse-gram.c"
3015 /* Line 1742 of yacc.c */
3016 #line 652 "src/parse-gram.y"
3018 code_props plain_code
;
3019 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
3020 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
3021 code_props_translate_code (&plain_code
);
3022 gram_scanner_last_string_free ();
3023 (yyval
.chars
) = plain_code
.code
;
3025 /* Line 1742 of yacc.c */
3026 #line 3027 "src/parse-gram.c"
3030 /* Line 1742 of yacc.c */
3031 #line 672 "src/parse-gram.y"
3032 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
3033 /* Line 1742 of yacc.c */
3034 #line 3035 "src/parse-gram.c"
3038 /* Line 1742 of yacc.c */
3039 #line 674 "src/parse-gram.y"
3041 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
3042 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
3043 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
3045 /* Line 1742 of yacc.c */
3046 #line 3047 "src/parse-gram.c"
3050 /* Line 1742 of yacc.c */
3051 #line 682 "src/parse-gram.y"
3052 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
3053 /* Line 1742 of yacc.c */
3054 #line 3055 "src/parse-gram.c"
3058 /* Line 1742 of yacc.c */
3059 #line 694 "src/parse-gram.y"
3061 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
3062 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
3064 /* Line 1742 of yacc.c */
3065 #line 3066 "src/parse-gram.c"
3069 /* Line 1742 of yacc.c */
3070 #line 703 "src/parse-gram.y"
3072 code_props plain_code
;
3073 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
3074 code_props_translate_code (&plain_code
);
3075 gram_scanner_last_string_free ();
3076 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
3077 code_scanner_last_string_free ();
3079 /* Line 1742 of yacc.c */
3080 #line 3081 "src/parse-gram.c"
3084 /* Line 1742 of yacc.c */
3085 #line 3086 "src/parse-gram.c"
3088 if (yychar_backup
!= yychar
)
3089 YY_LAC_DISCARD ("yychar change");
3091 /* User semantic actions sometimes alter yychar, and that requires
3092 that yytoken be updated with the new translation. We take the
3093 approach of translating immediately before every use of yytoken.
3094 One alternative is translating here after every semantic action,
3095 but that translation would be missed if the semantic action invokes
3096 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3097 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3098 incorrect destructor might then be invoked immediately. In the
3099 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3100 to an incorrect destructor call or verbose syntax error message
3101 before the lookahead is translated. */
3102 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3106 YY_STACK_PRINT (yyss
, yyssp
);
3111 /* Now `shift' the result of the reduction. Determine what state
3112 that goes to, based on the state we popped back to and the rule
3113 number reduced by. */
3117 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3118 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3119 yystate
= yytable
[yystate
];
3121 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3126 /*------------------------------------.
3127 | yyerrlab -- here on detecting error |
3128 `------------------------------------*/
3130 /* Make sure we have latest lookahead translation. See comments at
3131 user semantic actions for why this is necessary. */
3132 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3134 /* If not already recovering from an error, report this error. */
3138 #if ! YYERROR_VERBOSE
3139 yyerror (YY_("syntax error"));
3141 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3142 yyesa, &yyes, &yyes_capacity, \
3145 char const *yymsgp
= YY_("syntax error");
3146 int yysyntax_error_status
;
3147 if (yychar
!= YYEMPTY
)
3149 yysyntax_error_status
= YYSYNTAX_ERROR
;
3150 if (yysyntax_error_status
== 0)
3152 else if (yysyntax_error_status
== 1)
3154 if (yymsg
!= yymsgbuf
)
3155 YYSTACK_FREE (yymsg
);
3156 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3160 yymsg_alloc
= sizeof yymsgbuf
;
3161 yysyntax_error_status
= 2;
3165 yysyntax_error_status
= YYSYNTAX_ERROR
;
3170 if (yysyntax_error_status
== 2)
3171 goto yyexhaustedlab
;
3173 # undef YYSYNTAX_ERROR
3177 yyerror_range
[1] = yylloc
;
3179 if (yyerrstatus
== 3)
3181 /* If just tried and failed to reuse lookahead token after an
3182 error, discard it. */
3184 if (yychar
<= YYEOF
)
3186 /* Return failure if at end of input. */
3187 if (yychar
== YYEOF
)
3192 yydestruct ("Error: discarding",
3193 yytoken
, &yylval
, &yylloc
);
3198 /* Else will try to reuse lookahead token after shifting the error
3203 /*---------------------------------------------------.
3204 | yyerrorlab -- error raised explicitly by YYERROR. |
3205 `---------------------------------------------------*/
3208 /* Pacify compilers like GCC when the user code never invokes
3209 YYERROR and the label yyerrorlab therefore never appears in user
3211 if (/*CONSTCOND*/ 0)
3214 yyerror_range
[1] = yylsp
[1-yylen
];
3215 /* Do not reclaim the symbols of the rule which action triggered
3219 YY_STACK_PRINT (yyss
, yyssp
);
3224 /*-------------------------------------------------------------.
3225 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3226 `-------------------------------------------------------------*/
3228 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3232 yyn
= yypact
[yystate
];
3233 if (!yypact_value_is_default (yyn
))
3236 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3244 /* Pop the current state because it cannot handle the error token. */
3248 yyerror_range
[1] = *yylsp
;
3249 yydestruct ("Error: popping",
3250 yystos
[yystate
], yyvsp
, yylsp
);
3253 YY_STACK_PRINT (yyss
, yyssp
);
3256 /* If the stack popping above didn't lose the initial context for the
3257 current lookahead token, the shift below will for sure. */
3258 YY_LAC_DISCARD ("error recovery");
3262 yyerror_range
[2] = yylloc
;
3263 /* Using YYLLOC is tempting, but would change the location of
3264 the lookahead. YYLOC is available though. */
3265 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3268 /* Shift the error token. */
3269 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3275 /*-------------------------------------.
3276 | yyacceptlab -- YYACCEPT comes here. |
3277 `-------------------------------------*/
3282 /*-----------------------------------.
3283 | yyabortlab -- YYABORT comes here. |
3284 `-----------------------------------*/
3290 /*-------------------------------------------------.
3291 | yyexhaustedlab -- memory exhaustion comes here. |
3292 `-------------------------------------------------*/
3294 yyerror (YY_("memory exhausted"));
3300 if (yychar
!= YYEMPTY
)
3302 /* Make sure we have latest lookahead translation. See comments at
3303 user semantic actions for why this is necessary. */
3304 yytoken
= YYTRANSLATE (yychar
);
3305 yydestruct ("Cleanup: discarding lookahead",
3306 yytoken
, &yylval
, &yylloc
);
3308 /* Do not reclaim the symbols of the rule which action triggered
3309 this YYABORT or YYACCEPT. */
3311 YY_STACK_PRINT (yyss
, yyssp
);
3312 while (yyssp
!= yyss
)
3314 yydestruct ("Cleanup: popping",
3315 yystos
[*yyssp
], yyvsp
, yylsp
);
3320 YYSTACK_FREE (yyss
);
3323 YYSTACK_FREE (yyes
);
3325 if (yymsg
!= yymsgbuf
)
3326 YYSTACK_FREE (yymsg
);
3328 /* Make sure YYID is used. */
3329 return YYID (yyresult
);
3332 /* Line 2002 of yacc.c */
3333 #line 713 "src/parse-gram.y"
3337 /* Return the location of the left-hand side of a rule whose
3338 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3339 the right-hand side, and return an empty location equal to the end
3340 boundary of RHS[0] if the right-hand side is empty. */
3343 lloc_default (YYLTYPE
const *rhs
, int n
)
3348 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3349 The bug is fixed in 7.4.2m, but play it safe for now. */
3350 loc
.start
= rhs
[n
].end
;
3351 loc
.end
= rhs
[n
].end
;
3353 /* Ignore empty nonterminals the start of the right-hand side.
3354 Do not bother to ignore them at the end of the right-hand side,
3355 since empty nonterminals have the same end as their predecessors. */
3356 for (i
= 1; i
<= n
; i
++)
3357 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3359 loc
.start
= rhs
[i
].start
;
3368 add_param (param_type type
, char *decl
, location loc
)
3370 static char const alphanum
[26 + 26 + 1 + 10] =
3371 "abcdefghijklmnopqrstuvwxyz"
3372 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3376 char const *name_start
= NULL
;
3379 /* Stop on last actual character. */
3380 for (p
= decl
; p
[1]; p
++)
3382 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3383 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3386 /* Strip the surrounding '{' and '}', and any blanks just inside
3388 while (*--p
== ' ' || *p
== '\t')
3391 while (*++decl
== ' ' || *decl
== '\t')
3396 complain_at (loc
, _("missing identifier in parameter declaration"));
3403 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3407 name
= xmalloc (name_len
+ 1);
3408 memcpy (name
, name_start
, name_len
);
3409 name
[name_len
] = '\0';
3410 if (type
& param_lex
)
3411 muscle_pair_list_grow ("lex_param", decl
, name
);
3412 if (type
& param_parse
)
3413 muscle_pair_list_grow ("parse_param", decl
, name
);
3417 gram_scanner_last_string_free ();
3422 version_check (location
const *loc
, char const *version
)
3424 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3426 complain_at (*loc
, "require bison %s, but have %s",
3427 version
, PACKAGE_VERSION
);
3433 gram_error (location
const *loc
, char const *msg
)
3435 complain_at (*loc
, "%s", msg
);
3439 token_name (int type
)
3441 return yytname
[YYTRANSLATE (type
)];
3452 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3453 return quotearg_style (escape_quoting_style
, buf
);