1 /* A Bison parser, made by GNU Bison 2.5.1.779-71bff. */
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.779-71bff"
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 324 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"
111 #include "xmemdup0.h"
113 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
114 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
116 #define YY_LOCATION_PRINT(File, Loc) \
117 location_print (File, Loc)
119 static void version_check (location
const *loc
, char const *version
);
121 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
122 FIXME: depends on the undocumented availability of YYLLOC. */
124 #define yyerror(Msg) \
125 gram_error (&yylloc, Msg)
126 static void gram_error (location
const *, char const *);
128 static char const *char_name (char);
130 /* Line 324 of yacc.c */
131 #line 132 "src/parse-gram.c"
134 # if defined __cplusplus && 201103L <= __cplusplus
135 # define YY_NULL nullptr
141 /* Enabling verbose error messages. */
142 #ifdef YYERROR_VERBOSE
143 # undef YYERROR_VERBOSE
144 # define YYERROR_VERBOSE 1
146 # define YYERROR_VERBOSE 1
149 /* Enabling the token table. */
150 #ifndef YYTOKEN_TABLE
151 # define YYTOKEN_TABLE 0
154 #include "src/parse-gram.h"
156 /* Copy the second part of user declarations. */
158 /* Line 345 of yacc.c */
159 #line 160 "src/parse-gram.c"
160 /* Unqualified %code blocks. */
161 /* Line 346 of yacc.c */
162 #line 56 "src/parse-gram.y"
164 static int current_prec
= 0;
165 static location current_lhs_location
;
166 static named_ref
*current_lhs_named_ref
;
167 static symbol
*current_lhs_symbol
;
168 static symbol_class current_class
= unknown_sym
;
169 static uniqstr current_type
= NULL
;
171 /** Set the new current left-hand side symbol, possibly common
172 * to several right-hand side parts of rule.
176 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
178 current_lhs_symbol
= sym
;
179 current_lhs_location
= loc
;
180 /* In order to simplify memory management, named references for lhs
181 are always assigned by deep copy into the current symbol_list
182 node. This is because a single named-ref in the grammar may
183 result in several uses when the user factors lhs between several
184 rules using "|". Therefore free the parser's original copy. */
185 free (current_lhs_named_ref
);
186 current_lhs_named_ref
= ref
;
189 #define YYTYPE_INT16 int_fast16_t
190 #define YYTYPE_INT8 int_fast8_t
191 #define YYTYPE_UINT16 uint_fast16_t
192 #define YYTYPE_UINT8 uint_fast8_t
194 /* Line 346 of yacc.c */
195 #line 234 "src/parse-gram.y"
197 /** Add a lex-param and/or a parse-param.
199 * \param type where to push this formal argument.
200 * \param decl the formal argument. Destroyed.
201 * \param loc the location in the source.
203 static void add_param (param_type type
, char *decl
, location loc
);
204 static param_type current_param
= param_none
;
207 /* Line 346 of yacc.c */
208 #line 209 "src/parse-gram.c"
215 typedef YYTYPE_UINT8 yytype_uint8
;
217 typedef unsigned char yytype_uint8
;
221 typedef YYTYPE_INT8 yytype_int8
;
222 #elif (defined __STDC__ || defined __C99__FUNC__ \
223 || defined __cplusplus || defined _MSC_VER)
224 typedef signed char yytype_int8
;
226 typedef short int yytype_int8
;
230 typedef YYTYPE_UINT16 yytype_uint16
;
232 typedef unsigned short int yytype_uint16
;
236 typedef YYTYPE_INT16 yytype_int16
;
238 typedef short int yytype_int16
;
242 # ifdef __SIZE_TYPE__
243 # define YYSIZE_T __SIZE_TYPE__
244 # elif defined size_t
245 # define YYSIZE_T size_t
246 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
247 || defined __cplusplus || defined _MSC_VER)
248 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
249 # define YYSIZE_T size_t
251 # define YYSIZE_T unsigned int
255 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
258 # if defined YYENABLE_NLS && YYENABLE_NLS
260 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
261 # define YY_(msgid) dgettext ("bison-runtime", msgid)
265 # define YY_(msgid) msgid
269 /* Suppress unused-variable warnings by "using" E. */
270 #if ! defined lint || defined __GNUC__
271 # define YYUSE(e) ((void) (e))
273 # define YYUSE(e) /* empty */
276 /* Identity function, used to suppress warnings about constant conditions. */
280 #if (defined __STDC__ || defined __C99__FUNC__ \
281 || defined __cplusplus || defined _MSC_VER)
296 /* The parser invokes alloca or malloc; define the necessary symbols. */
298 # ifdef YYSTACK_ALLOC
299 /* Pacify GCC's `empty if-body' warning. */
300 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
301 # ifndef YYSTACK_ALLOC_MAXIMUM
302 /* The OS might guarantee only one guard page at the bottom of the stack,
303 and a page size can be as small as 4096 bytes. So we cannot safely
304 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
305 to allow for a few compiler-allocated temporary stack slots. */
306 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
309 # define YYSTACK_ALLOC YYMALLOC
310 # define YYSTACK_FREE YYFREE
311 # ifndef YYSTACK_ALLOC_MAXIMUM
312 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
314 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
315 && ! ((defined YYMALLOC || defined malloc) \
316 && (defined YYFREE || defined free)))
317 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
318 # ifndef EXIT_SUCCESS
319 # define EXIT_SUCCESS 0
323 # define YYMALLOC malloc
324 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
325 || defined __cplusplus || defined _MSC_VER)
326 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
331 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
332 || defined __cplusplus || defined _MSC_VER)
333 void free (void *); /* INFRINGES ON USER NAME SPACE */
337 # define YYCOPY_NEEDED 1
341 #if (! defined yyoverflow \
342 && (! defined __cplusplus \
343 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
344 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
346 /* A type that is properly aligned for any stack member. */
349 yytype_int16 yyss_alloc
;
354 /* The size of the maximum gap between one aligned stack and the next. */
355 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
357 /* The size of an array large to enough to hold all stacks, each with
359 # define YYSTACK_BYTES(N) \
360 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
361 + 2 * YYSTACK_GAP_MAXIMUM)
363 # define YYCOPY_NEEDED 1
365 /* Relocate STACK from its old location to the new one. The
366 local variables YYSIZE and YYSTACKSIZE give the old and new number of
367 elements in the stack, and YYPTR gives the new location of the
368 stack. Advance YYPTR to a properly aligned location for the next
370 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
373 YYSIZE_T yynewbytes; \
374 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
375 Stack = &yyptr->Stack_alloc; \
376 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
377 yyptr += yynewbytes / sizeof (*yyptr); \
383 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
384 /* Copy COUNT objects from SRC to DST. The source and destination do
387 # if defined __GNUC__ && 1 < __GNUC__
388 # define YYCOPY(Dst, Src, Count) \
389 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
391 # define YYCOPY(Dst, Src, Count) \
395 for (yyi = 0; yyi < (Count); yyi++) \
396 (Dst)[yyi] = (Src)[yyi]; \
401 #endif /* !YYCOPY_NEEDED */
403 /* YYFINAL -- State number of the termination state. */
405 /* YYLAST -- Last index in YYTABLE. */
408 /* YYNTOKENS -- Number of terminals. */
410 /* YYNNTS -- Number of nonterminals. */
412 /* YYNRULES -- Number of rules. */
414 /* YYNSTATES -- Number of states. */
415 #define YYNSTATES 149
417 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
418 by yylex, with out-of-bounds checking. */
420 #define YYMAXUTOK 311
422 #define YYTRANSLATE(YYX) \
423 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
425 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
426 as returned by yylex, without out-of-bounds checking. */
427 static const yytype_uint8 yytranslate
[] =
429 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
455 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
456 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
457 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
458 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
459 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
464 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
465 static const yytype_uint16 yyrline
[] =
467 0, 270, 270, 278, 280, 284, 285, 295, 299, 304,
468 305, 310, 315, 316, 317, 318, 319, 324, 333, 334,
469 335, 336, 337, 338, 339, 340, 340, 341, 342, 366,
470 367, 368, 369, 373, 374, 383, 384, 385, 389, 396,
471 403, 407, 411, 418, 433, 434, 438, 450, 450, 455,
472 455, 460, 471, 486, 487, 488, 489, 493, 494, 499,
473 501, 506, 507, 512, 514, 519, 520, 524, 525, 526,
474 527, 532, 537, 542, 548, 554, 565, 566, 575, 576,
475 582, 583, 584, 591, 591, 599, 600, 601, 606, 608,
476 610, 612, 614, 616, 618, 623, 625, 635, 636, 641,
477 642, 643, 652, 672, 674, 683, 688, 689, 694, 701,
482 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
483 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
484 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
485 static const char *const yytname
[] =
487 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
488 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
489 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
490 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
491 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
492 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
493 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
494 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
495 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
496 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
497 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
498 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
499 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
500 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
501 "prologue_declaration", "$@1", "params", "grammar_declaration",
502 "union_name", "symbol_declaration", "$@2", "$@3",
503 "precedence_declaration", "precedence_declarator", "tag.opt",
504 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
505 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
506 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
507 "named_ref.opt", "variable", "content.opt", "braceless", "id",
508 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
513 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
514 (internal) symbol number NUM (which must be that of a token). */
515 static const yytype_uint16 yytoknum
[] =
517 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
518 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
519 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
520 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
521 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
522 305, 306, 307, 308, 309, 310, 311
526 #define YYPACT_NINF -50
528 #define yypact_value_is_default(yystate) \
531 #define YYTABLE_NINF -110
533 #define yytable_value_is_error(yytable_value) \
536 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
538 static const yytype_int16 yypact
[] =
540 -50, 4, 107, -50, -50, -50, -20, 3, 11, -50,
541 -50, -50, -50, 14, -50, 12, 68, -50, 72, 73,
542 -50, 0, -50, 45, 86, 2, -50, -50, -50, 17,
543 95, 96, 32, -50, -50, -50, 16, -50, -50, -50,
544 54, -50, -50, -50, -50, 49, -2, -2, 32, 27,
545 27, -50, 63, -50, -50, -50, 37, -50, -50, -50,
546 -50, 101, -50, -50, -50, 103, -50, 104, -50, -50,
547 -50, -50, -50, -50, -50, -50, 57, -50, 58, 1,
548 -50, -50, 79, 70, -50, 63, -50, 32, -50, -50,
549 -2, 64, -2, 32, -50, -50, -50, -50, 27, -50,
550 -50, 27, -50, -50, -50, -50, -50, -50, -50, -50,
551 -50, 78, -50, -50, -50, -50, -50, 83, -50, 32,
552 -50, 143, -50, 145, -50, -50, -50, -50, -50, -50,
553 -50, -50, -50, 43, 50, -50, -50, 32, 146, 97,
554 79, -50, 79, 50, -50, -50, -50, -50, -50
557 /* YYDEFACT[S] -- default reduction number in state S. Performed when
558 YYTABLE does not specify something else to do. Zero means the default
560 static const yytype_uint8 yydefact
[] =
562 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
563 54, 55, 56, 0, 40, 0, 9, 11, 0, 0,
564 7, 0, 16, 0, 0, 0, 41, 21, 22, 0,
565 0, 0, 0, 29, 30, 31, 0, 6, 32, 25,
566 44, 4, 5, 36, 35, 57, 0, 0, 0, 0,
567 0, 102, 0, 42, 98, 97, 99, 10, 12, 13,
568 14, 0, 17, 18, 19, 0, 23, 0, 27, 28,
569 108, 104, 103, 106, 37, 107, 0, 105, 0, 0,
570 78, 80, 95, 0, 45, 0, 58, 0, 71, 76,
571 50, 72, 48, 51, 63, 68, 69, 70, 38, 65,
572 67, 39, 43, 101, 100, 8, 15, 20, 24, 82,
573 81, 0, 79, 2, 96, 83, 34, 26, 46, 52,
574 59, 61, 77, 73, 74, 64, 66, 110, 88, 33,
575 60, 62, 75, 84, 85, 88, 87, 0, 0, 0,
576 95, 91, 95, 86, 92, 93, 94, 90, 89
579 /* YYPGOTO[NTERM-NUM]. */
580 static const yytype_int16 yypgoto
[] =
582 -50, -50, -50, -50, -50, -50, 149, -50, -50, -50,
583 -50, -50, -50, -50, -50, 33, -50, 106, -42, -4,
584 112, -50, 74, -50, -50, -50, 19, -45, -50, -50,
585 -16, -8, -50, -32, -49, -50
588 /* YYDEFGOTO[NTERM-NUM]. */
589 static const yytype_int16 yydefgoto
[] =
591 -1, 1, 2, 41, 83, 117, 78, 85, 43, 47,
592 46, 44, 45, 87, 119, 120, 93, 98, 99, 89,
593 90, 79, 80, 81, 128, 133, 134, 115, 56, 105,
594 53, 73, 82, 100, 75, 113
597 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
598 positive, shift that token. If negative, reduce the rule which
599 number is the opposite. If YYTABLE_NINF, syntax error. */
600 static const yytype_int16 yytable
[] =
602 74, -109, 76, 60, 3, 64, 4, 5, 6, 7,
603 8, 9, 10, 11, 12, 54, 94, 76, 13, 14,
604 66, 4, 5, 6, 7, 8, 9, 10, 11, 12,
605 70, 26, 48, 13, 14, 70, 102, 32, 91, 91,
606 103, 71, 124, 49, 72, 61, 26, 65, 77, 111,
607 88, 50, 32, 70, 51, 121, 126, 40, 55, 126,
608 52, 125, 67, 77, 137, 138, 139, 70, 123, 118,
609 71, 57, 40, 72, 132, 71, 58, 59, 72, 95,
610 96, 97, 91, 104, 91, 62, 122, 121, 122, 63,
611 140, 141, 135, 71, 136, 147, 72, 148, 68, 69,
612 84, 86, 142, 51, 106, 144, 107, 108, 109, 110,
613 116, 142, 4, 5, 6, 7, 8, 9, 10, 11,
614 12, 114, 127, 129, 13, 14, 15, 16, 17, 18,
615 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
616 29, 30, 31, 32, 33, 34, 35, 131, 70, 146,
617 145, 42, 130, 112, 143, 36, 101, 37, 38, 92,
621 static const yytype_int16 yycheck
[] =
623 32, 0, 1, 3, 0, 3, 5, 6, 7, 8,
624 9, 10, 11, 12, 13, 3, 48, 1, 17, 18,
625 3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
626 3, 30, 52, 17, 18, 3, 52, 36, 46, 47,
627 3, 43, 91, 40, 46, 45, 30, 45, 47, 48,
628 52, 40, 36, 3, 40, 87, 98, 56, 46, 101,
629 46, 93, 45, 47, 14, 15, 16, 3, 4, 85,
630 43, 3, 56, 46, 123, 43, 4, 4, 46, 52,
631 53, 54, 90, 46, 92, 40, 90, 119, 92, 3,
632 40, 41, 49, 43, 51, 140, 46, 142, 3, 3,
633 46, 52, 134, 40, 3, 137, 3, 3, 51, 51,
634 40, 143, 5, 6, 7, 8, 9, 10, 11, 12,
635 13, 42, 44, 40, 17, 18, 19, 20, 21, 22,
636 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
637 33, 34, 35, 36, 37, 38, 39, 4, 3, 52,
638 4, 2, 119, 79, 135, 48, 50, 50, 51, 47,
642 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
643 symbol of state STATE-NUM. */
644 static const yytype_uint8 yystos
[] =
646 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
647 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
648 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
649 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
650 56, 60, 63, 65, 68, 69, 67, 66, 52, 40,
651 40, 40, 46, 87, 3, 46, 85, 3, 4, 4,
652 3, 45, 40, 3, 3, 45, 3, 45, 3, 3,
653 3, 43, 46, 88, 90, 91, 1, 47, 63, 78,
654 79, 80, 89, 61, 46, 64, 52, 70, 52, 76,
655 77, 88, 77, 73, 90, 52, 53, 54, 74, 75,
656 90, 74, 87, 3, 46, 86, 3, 3, 3, 51,
657 51, 48, 79, 92, 42, 84, 40, 62, 87, 71,
658 72, 90, 76, 4, 91, 90, 75, 44, 81, 40,
659 72, 4, 91, 82, 83, 49, 51, 14, 15, 16,
660 40, 41, 90, 83, 90, 4, 52, 84, 84
663 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
664 static const yytype_uint8 yyr1
[] =
666 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
667 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
668 60, 60, 60, 60, 60, 61, 60, 60, 60, 60,
669 60, 60, 60, 62, 62, 63, 63, 63, 63, 63,
670 63, 63, 63, 63, 64, 64, 63, 66, 65, 67,
671 65, 65, 68, 69, 69, 69, 69, 70, 70, 71,
672 71, 72, 72, 73, 73, 74, 74, 75, 75, 75,
673 75, 76, 76, 76, 76, 76, 77, 77, 78, 78,
674 79, 79, 79, 81, 80, 82, 82, 82, 83, 83,
675 83, 83, 83, 83, 83, 84, 84, 85, 85, 86,
676 86, 86, 87, 88, 88, 89, 90, 90, 91, 92,
680 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
681 static const yytype_uint8 yyr2
[] =
683 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
684 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
685 3, 1, 1, 2, 3, 0, 3, 2, 2, 1,
686 1, 1, 1, 2, 1, 1, 1, 2, 3, 3,
687 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
688 3, 3, 3, 1, 1, 1, 1, 0, 1, 1,
689 2, 1, 2, 1, 2, 1, 2, 1, 1, 1,
690 1, 1, 1, 2, 2, 3, 1, 2, 1, 2,
691 1, 2, 2, 0, 4, 1, 3, 2, 0, 3,
692 3, 2, 3, 3, 3, 0, 1, 1, 1, 0,
693 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
698 #define yyerrok (yyerrstatus = 0)
699 #define yyclearin (yychar = YYEMPTY)
703 #define YYACCEPT goto yyacceptlab
704 #define YYABORT goto yyabortlab
705 #define YYERROR goto yyerrorlab
708 /* Like YYERROR except do call yyerror. This remains here temporarily
709 to ease the transition to the new meaning of YYERROR, for GCC.
710 Once GCC version 2 has supplanted version 1, this can go. However,
711 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
712 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
715 #define YYFAIL goto yyerrlab
717 /* This is here to suppress warnings from the GCC cpp's
718 -Wunused-macros. Normally we don't worry about that warning, but
719 some users do, and we want to make it easy for users to remove
720 YYFAIL uses, which will produce warnings from Bison 2.5. */
723 #define YYRECOVERING() (!!yyerrstatus)
725 #define YYBACKUP(Token, Value) \
727 if (yychar == YYEMPTY) \
731 YYPOPSTACK (yylen); \
733 YY_LAC_DISCARD ("YYBACKUP"); \
738 yyerror (YY_("syntax error: cannot back up")); \
745 #define YYERRCODE 256
748 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
749 If N is 0, then set CURRENT to the empty location which ends
750 the previous symbol: RHS[0] (always defined). */
752 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
753 #ifndef YYLLOC_DEFAULT
754 # define YYLLOC_DEFAULT(Current, Rhs, N) \
758 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
759 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
760 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
761 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
765 (Current).first_line = (Current).last_line = \
766 YYRHSLOC (Rhs, 0).last_line; \
767 (Current).first_column = (Current).last_column = \
768 YYRHSLOC (Rhs, 0).last_column; \
774 /* YY_LOCATION_PRINT -- Print the location on the stream.
775 This macro was not mandated originally: define only if we know
776 we won't break user code: when these are the locations we know. */
778 #ifndef YY_LOCATION_PRINT
779 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
780 # define YY_LOCATION_PRINT(File, Loc) \
781 fprintf (File, "%d.%d-%d.%d", \
782 (Loc).first_line, (Loc).first_column, \
783 (Loc).last_line, (Loc).last_column)
785 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
790 /* YYLEX -- calling `yylex' with the right arguments. */
793 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
795 # define YYLEX yylex (&yylval, &yylloc)
798 /* Enable debugging if requested. */
802 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
803 # define YYFPRINTF fprintf
806 # define YYDPRINTF(Args) \
812 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
816 YYFPRINTF (stderr, "%s ", Title); \
817 yy_symbol_print (stderr, \
818 Type, Value, Location); \
819 YYFPRINTF (stderr, "\n"); \
824 /*--------------------------------.
825 | Print this symbol on YYOUTPUT. |
826 `--------------------------------*/
829 #if (defined __STDC__ || defined __C99__FUNC__ \
830 || defined __cplusplus || defined _MSC_VER)
832 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
835 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
838 YYSTYPE
const * const yyvaluep
;
839 YYLTYPE
const * const yylocationp
;
842 FILE *yyo
= yyoutput
;
848 if (yytype
< YYNTOKENS
)
849 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
855 /* Line 754 of yacc.c */
856 #line 194 "src/parse-gram.y"
857 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
858 /* Line 754 of yacc.c */
859 #line 860 "src/parse-gram.c"
864 /* Line 754 of yacc.c */
865 #line 207 "src/parse-gram.y"
866 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
867 /* Line 754 of yacc.c */
868 #line 869 "src/parse-gram.c"
871 case 24: // "%<flag>"
873 /* Line 754 of yacc.c */
874 #line 203 "src/parse-gram.y"
875 { fprintf (stderr
, "%%%s", ((*yyvaluep
).uniqstr
)); }
876 /* Line 754 of yacc.c */
877 #line 878 "src/parse-gram.c"
882 /* Line 754 of yacc.c */
883 #line 196 "src/parse-gram.y"
884 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
885 /* Line 754 of yacc.c */
886 #line 887 "src/parse-gram.c"
889 case 42: // "[identifier]"
891 /* Line 754 of yacc.c */
892 #line 201 "src/parse-gram.y"
893 { fprintf (stderr
, "[%s]", ((*yyvaluep
).uniqstr
)); }
894 /* Line 754 of yacc.c */
895 #line 896 "src/parse-gram.c"
900 /* Line 754 of yacc.c */
901 #line 188 "src/parse-gram.y"
902 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
903 /* Line 754 of yacc.c */
904 #line 905 "src/parse-gram.c"
907 case 44: // "epilogue"
909 /* Line 754 of yacc.c */
910 #line 196 "src/parse-gram.y"
911 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
912 /* Line 754 of yacc.c */
913 #line 914 "src/parse-gram.c"
916 case 46: // "identifier"
918 /* Line 754 of yacc.c */
919 #line 200 "src/parse-gram.y"
920 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
921 /* Line 754 of yacc.c */
922 #line 923 "src/parse-gram.c"
925 case 47: // "identifier:"
927 /* Line 754 of yacc.c */
928 #line 202 "src/parse-gram.y"
929 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
930 /* Line 754 of yacc.c */
931 #line 932 "src/parse-gram.c"
934 case 50: // "%{...%}"
936 /* Line 754 of yacc.c */
937 #line 196 "src/parse-gram.y"
938 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
939 /* Line 754 of yacc.c */
940 #line 941 "src/parse-gram.c"
945 /* Line 754 of yacc.c */
946 #line 204 "src/parse-gram.y"
947 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
948 /* Line 754 of yacc.c */
949 #line 950 "src/parse-gram.c"
954 /* Line 754 of yacc.c */
955 #line 250 "src/parse-gram.y"
957 switch (((*yyvaluep
).param
))
959 #define CASE(In, Out) \
960 case param_ ## In: fputs ("%" #Out, stderr); break
961 CASE(lex
, lex
-param
);
962 CASE(parse
, parse
-param
);
965 case param_none
: aver (false); break;
968 /* Line 754 of yacc.c */
969 #line 970 "src/parse-gram.c"
972 case 72: // symbol.prec
974 /* Line 754 of yacc.c */
975 #line 210 "src/parse-gram.y"
976 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
977 /* Line 754 of yacc.c */
978 #line 979 "src/parse-gram.c"
983 /* Line 754 of yacc.c */
984 #line 200 "src/parse-gram.y"
985 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
986 /* Line 754 of yacc.c */
987 #line 988 "src/parse-gram.c"
990 case 86: // content.opt
992 /* Line 754 of yacc.c */
993 #line 196 "src/parse-gram.y"
994 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
995 /* Line 754 of yacc.c */
996 #line 997 "src/parse-gram.c"
999 case 87: // braceless
1001 /* Line 754 of yacc.c */
1002 #line 196 "src/parse-gram.y"
1003 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1004 /* Line 754 of yacc.c */
1005 #line 1006 "src/parse-gram.c"
1010 /* Line 754 of yacc.c */
1011 #line 210 "src/parse-gram.y"
1012 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1013 /* Line 754 of yacc.c */
1014 #line 1015 "src/parse-gram.c"
1017 case 89: // id_colon
1019 /* Line 754 of yacc.c */
1020 #line 211 "src/parse-gram.y"
1021 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1022 /* Line 754 of yacc.c */
1023 #line 1024 "src/parse-gram.c"
1028 /* Line 754 of yacc.c */
1029 #line 210 "src/parse-gram.y"
1030 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1031 /* Line 754 of yacc.c */
1032 #line 1033 "src/parse-gram.c"
1035 case 91: // string_as_id
1037 /* Line 754 of yacc.c */
1038 #line 210 "src/parse-gram.y"
1039 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1040 /* Line 754 of yacc.c */
1041 #line 1042 "src/parse-gram.c"
1050 /*--------------------------------.
1051 | Print this symbol on YYOUTPUT. |
1052 `--------------------------------*/
1054 #if (defined __STDC__ || defined __C99__FUNC__ \
1055 || defined __cplusplus || defined _MSC_VER)
1057 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1060 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1063 YYSTYPE
const * const yyvaluep
;
1064 YYLTYPE
const * const yylocationp
;
1067 if (yytype
< YYNTOKENS
)
1068 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1070 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1072 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1073 YYFPRINTF (yyoutput
, ": ");
1074 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1075 YYFPRINTF (yyoutput
, ")");
1078 /*------------------------------------------------------------------.
1079 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1081 `------------------------------------------------------------------*/
1083 #if (defined __STDC__ || defined __C99__FUNC__ \
1084 || defined __cplusplus || defined _MSC_VER)
1086 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1089 yy_stack_print (yybottom
, yytop
)
1090 yytype_int16
*yybottom
;
1091 yytype_int16
*yytop
;
1094 YYFPRINTF (stderr
, "Stack now");
1095 for (; yybottom
<= yytop
; yybottom
++)
1097 int yybot
= *yybottom
;
1098 YYFPRINTF (stderr
, " %d", yybot
);
1100 YYFPRINTF (stderr
, "\n");
1103 # define YY_STACK_PRINT(Bottom, Top) \
1106 yy_stack_print ((Bottom), (Top)); \
1110 /*------------------------------------------------.
1111 | Report that the YYRULE is going to be reduced. |
1112 `------------------------------------------------*/
1114 #if (defined __STDC__ || defined __C99__FUNC__ \
1115 || defined __cplusplus || defined _MSC_VER)
1117 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1120 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1121 yytype_int16
*yyssp
;
1127 unsigned long int yylno
= yyrline
[yyrule
];
1128 int yynrhs
= yyr2
[yyrule
];
1130 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1132 /* The symbols being reduced. */
1133 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1135 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1136 yy_symbol_print (stderr
,
1137 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1138 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1139 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1140 YYFPRINTF (stderr
, "\n");
1144 # define YY_REDUCE_PRINT(Rule) \
1147 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1150 /* Nonzero means print parse trace. It is left uninitialized so that
1151 multiple parsers can coexist. */
1153 #else /* !YYDEBUG */
1154 # define YYDPRINTF(Args)
1155 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1156 # define YY_STACK_PRINT(Bottom, Top)
1157 # define YY_REDUCE_PRINT(Rule)
1158 #endif /* !YYDEBUG */
1161 /* YYINITDEPTH -- initial size of the parser's stacks. */
1163 # define YYINITDEPTH 200
1166 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1167 if the built-in stack extension method is used).
1169 Do not make this value too large; the results are undefined if
1170 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1171 evaluated with infinite-precision integer arithmetic. */
1174 # define YYMAXDEPTH 10000
1177 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1178 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1179 stack, and such that *YYCAPACITY is the maximum number of elements it
1180 can hold without a reallocation, make sure there is enough room to
1181 store YYADD more elements. If not, allocate a new stack using
1182 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1183 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1184 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1185 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1186 required. Return 1 if memory is exhausted. */
1188 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1190 char const *yydebug_prefix
,
1191 char const *yydebug_suffix
,
1193 yytype_int16
**yybottom
,
1194 yytype_int16
*yybottom_no_free
,
1195 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1197 YYSIZE_T yysize_old
=
1198 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1199 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1200 if (*yycapacity
< yysize_new
)
1202 YYSIZE_T yyalloc
= 2 * yysize_new
;
1203 yytype_int16
*yybottom_new
;
1204 /* Use YYMAXDEPTH for maximum stack size given that the stack
1205 should never need to grow larger than the main state stack
1206 needs to grow without LAC. */
1207 if (YYMAXDEPTH
< yysize_new
)
1209 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1213 if (YYMAXDEPTH
< yyalloc
)
1214 yyalloc
= YYMAXDEPTH
;
1216 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1219 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1223 if (*yytop
!= yytop_empty
)
1225 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1226 *yytop
= yybottom_new
+ (yysize_old
- 1);
1228 if (*yybottom
!= yybottom_no_free
)
1229 YYSTACK_FREE (*yybottom
);
1230 *yybottom
= yybottom_new
;
1231 *yycapacity
= yyalloc
;
1236 /* Establish the initial context for the current lookahead if no initial
1237 context is currently established.
1239 We define a context as a snapshot of the parser stacks. We define
1240 the initial context for a lookahead as the context in which the
1241 parser initially examines that lookahead in order to select a
1242 syntactic action. Thus, if the lookahead eventually proves
1243 syntactically unacceptable (possibly in a later context reached via a
1244 series of reductions), the initial context can be used to determine
1245 the exact set of tokens that would be syntactically acceptable in the
1246 lookahead's place. Moreover, it is the context after which any
1247 further semantic actions would be erroneous because they would be
1248 determined by a syntactically unacceptable token.
1250 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1251 performed in an inconsistent state (which, for the purposes of LAC,
1252 includes consistent states that don't know they're consistent because
1253 their default reductions have been disabled). Iff there is a
1254 lookahead token, it should also be invoked before reporting a syntax
1255 error. This latter case is for the sake of the debugging output.
1257 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1258 follows. If no initial context is currently established for the
1259 current lookahead, then check if that lookahead can eventually be
1260 shifted if syntactic actions continue from the current context.
1261 Report a syntax error if it cannot. */
1262 #define YY_LAC_ESTABLISH \
1264 if (!yy_lac_established) \
1266 YYDPRINTF ((stderr, \
1267 "LAC: initial context established for %s\n", \
1268 yytname[yytoken])); \
1269 yy_lac_established = 1; \
1271 int yy_lac_status = \
1272 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1273 if (yy_lac_status == 2) \
1274 goto yyexhaustedlab; \
1275 if (yy_lac_status == 1) \
1281 /* Discard any previous initial lookahead context because of Event,
1282 which may be a lookahead change or an invalidation of the currently
1283 established initial context for the current lookahead.
1285 The most common example of a lookahead change is a shift. An example
1286 of both cases is syntax error recovery. That is, a syntax error
1287 occurs when the lookahead is syntactically erroneous for the
1288 currently established initial context, so error recovery manipulates
1289 the parser stacks to try to find a new initial context in which the
1290 current lookahead is syntactically acceptable. If it fails to find
1291 such a context, it discards the lookahead. */
1293 # define YY_LAC_DISCARD(Event) \
1295 if (yy_lac_established) \
1298 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1300 yy_lac_established = 0; \
1304 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1307 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1308 eventually (after perhaps some reductions) be shifted, return 1 if
1309 not, or return 2 if memory is exhausted. As preconditions and
1310 postconditions: *YYES_CAPACITY is the allocated size of the array to
1311 which *YYES points, and either *YYES = YYESA or *YYES points to an
1312 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1313 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1314 any old *YYES other than YYESA. */
1316 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1317 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1319 yytype_int16
*yyes_prev
= yyssp
;
1320 yytype_int16
*yyesp
= yyes_prev
;
1321 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1322 if (yytoken
== YYUNDEFTOK
)
1324 YYDPRINTF ((stderr
, " Always Err\n"));
1329 int yyrule
= yypact
[*yyesp
];
1330 if (yypact_value_is_default (yyrule
)
1331 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1332 || yycheck
[yyrule
] != yytoken
)
1334 yyrule
= yydefact
[*yyesp
];
1337 YYDPRINTF ((stderr
, " Err\n"));
1343 yyrule
= yytable
[yyrule
];
1344 if (yytable_value_is_error (yyrule
))
1346 YYDPRINTF ((stderr
, " Err\n"));
1351 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1357 YYSIZE_T yylen
= yyr2
[yyrule
];
1358 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1359 if (yyesp
!= yyes_prev
)
1361 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1374 yyesp
= yyes_prev
-= yylen
;
1379 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1380 yystate
= yypgoto
[yylhs
] + *yyesp
;
1381 if (yystate
< 0 || YYLAST
< yystate
1382 || yycheck
[yystate
] != *yyesp
)
1383 yystate
= yydefgoto
[yylhs
];
1385 yystate
= yytable
[yystate
];
1387 if (yyesp
== yyes_prev
)
1394 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1398 yyes
, yyesa
, &yyesp
, yyes_prev
))
1400 YYDPRINTF ((stderr
, "\n"));
1405 YYDPRINTF ((stderr
, " G%d", yystate
));
1414 # if defined __GLIBC__ && defined _STRING_H
1415 # define yystrlen strlen
1417 /* Return the length of YYSTR. */
1418 #if (defined __STDC__ || defined __C99__FUNC__ \
1419 || defined __cplusplus || defined _MSC_VER)
1421 yystrlen (const char *yystr
)
1429 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1437 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1438 # define yystpcpy stpcpy
1440 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1442 #if (defined __STDC__ || defined __C99__FUNC__ \
1443 || defined __cplusplus || defined _MSC_VER)
1445 yystpcpy (char *yydest
, const char *yysrc
)
1448 yystpcpy (yydest
, yysrc
)
1454 const char *yys
= yysrc
;
1456 while ((*yyd
++ = *yys
++) != '\0')
1465 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1466 quotes and backslashes, so that it's suitable for yyerror. The
1467 heuristic is that double-quoting is unnecessary unless the string
1468 contains an apostrophe, a comma, or backslash (other than
1469 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1470 null, do not copy; instead, return the length of what the result
1473 yytnamerr (char *yyres
, const char *yystr
)
1478 char const *yyp
= yystr
;
1485 goto do_not_strip_quotes
;
1489 goto do_not_strip_quotes
;
1502 do_not_strip_quotes
: ;
1506 return yystrlen (yystr
);
1508 return yystpcpy (yyres
, yystr
) - yyres
;
1512 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1513 about the unexpected token YYTOKEN for the state stack whose top is
1514 YYSSP. In order to see if a particular token T is a
1515 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1517 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1518 not large enough to hold the message. In that case, also set
1519 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1520 required number of bytes is too large to store or if
1521 yy_lac returned 2. */
1523 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1524 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1525 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1527 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1528 YYSIZE_T yysize
= yysize0
;
1530 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1531 /* Internationalized format string. */
1532 const char *yyformat
= YY_NULL
;
1533 /* Arguments of yyformat. */
1534 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1535 /* Number of reported tokens (one for the "unexpected", one per
1539 /* There are many possibilities here to consider:
1540 - Assume YYFAIL is not used. It's too flawed to consider. See
1541 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1542 for details. YYERROR is fine as it does not invoke this
1544 - If this state is a consistent state with a default action, then
1545 the only way this function was invoked is if the default action
1546 is an error action. In that case, don't check for expected
1547 tokens because there are none.
1548 - The only way there can be no lookahead present (in yychar) is if
1549 this state is a consistent state with a default action. Thus,
1550 detecting the absence of a lookahead is sufficient to determine
1551 that there is no unexpected or expected token to report. In that
1552 case, just report a simple "syntax error".
1553 - Don't assume there isn't a lookahead just because this state is a
1554 consistent state with a default action. There might have been a
1555 previous inconsistent state, consistent state with a non-default
1556 action, or user semantic action that manipulated yychar.
1557 In the first two cases, it might appear that the current syntax
1558 error should have been detected in the previous state when yy_lac
1559 was invoked. However, at that time, there might have been a
1560 different syntax error that discarded a different initial context
1561 during error recovery, leaving behind the current lookahead.
1563 if (yytoken
!= YYEMPTY
)
1565 int yyn
= yypact
[*yyssp
];
1566 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1567 yyarg
[yycount
++] = yytname
[yytoken
];
1568 if (!yypact_value_is_default (yyn
))
1572 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1573 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1576 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1578 if (yy_lac_status
== 2)
1580 if (yy_lac_status
== 1)
1583 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1589 yyarg
[yycount
++] = yytname
[yyx
];
1590 yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1591 if (! (yysize
<= yysize1
1592 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1599 YYFPRINTF (stderr
, "No expected tokens.\n");
1605 # define YYCASE_(N, S) \
1609 YYCASE_(0, YY_("syntax error"));
1610 YYCASE_(1, YY_("syntax error, unexpected %s"));
1611 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1612 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1613 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1614 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1618 yysize1
= yysize
+ yystrlen (yyformat
);
1619 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1623 if (*yymsg_alloc
< yysize
)
1625 *yymsg_alloc
= 2 * yysize
;
1626 if (! (yysize
<= *yymsg_alloc
1627 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1628 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1632 /* Avoid sprintf, as that infringes on the user's name space.
1633 Don't have undefined behavior even if the translation
1634 produced a string with the wrong number of "%s"s. */
1638 while ((*yyp
= *yyformat
) != '\0')
1639 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1641 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1652 #endif /* YYERROR_VERBOSE */
1654 /*-----------------------------------------------.
1655 | Release the memory associated to this symbol. |
1656 `-----------------------------------------------*/
1659 #if (defined __STDC__ || defined __C99__FUNC__ \
1660 || defined __cplusplus || defined _MSC_VER)
1662 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1665 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1669 YYLTYPE
*yylocationp
;
1673 YYUSE (yylocationp
);
1676 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1692 #ifdef YYPARSE_PARAM
1693 #if (defined __STDC__ || defined __C99__FUNC__ \
1694 || defined __cplusplus || defined _MSC_VER)
1696 yyparse (void *YYPARSE_PARAM
)
1699 yyparse (YYPARSE_PARAM
)
1700 void *YYPARSE_PARAM
;
1702 #else /* ! YYPARSE_PARAM */
1703 #if (defined __STDC__ || defined __C99__FUNC__ \
1704 || defined __cplusplus || defined _MSC_VER)
1714 /* The lookahead symbol. */
1717 /* The semantic value of the lookahead symbol. */
1720 /* Location data for the lookahead symbol. */
1723 /* Number of syntax errors so far. */
1727 /* Number of tokens to shift before error messages enabled. */
1730 /* The stacks and their tools:
1731 `yyss': related to states.
1732 `yyvs': related to semantic values.
1733 `yyls': related to locations.
1735 Refer to the stacks through separate pointers, to allow yyoverflow
1736 to reallocate them elsewhere. */
1738 /* The state stack. */
1739 yytype_int16 yyssa
[YYINITDEPTH
];
1741 yytype_int16
*yyssp
;
1743 /* The semantic value stack. */
1744 YYSTYPE yyvsa
[YYINITDEPTH
];
1748 /* The location stack. */
1749 YYLTYPE yylsa
[YYINITDEPTH
];
1753 /* The locations where the error started and ended. */
1754 YYLTYPE yyerror_range
[3];
1756 YYSIZE_T yystacksize
;
1758 yytype_int16 yyesa
[20];
1760 YYSIZE_T yyes_capacity
;
1762 int yy_lac_established
= 0;
1765 /* Lookahead token as an internal (translated) token number. */
1767 /* The variables used to return semantic value and location from the
1773 /* Buffer for error messages, and its allocated size. */
1775 char *yymsg
= yymsgbuf
;
1776 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1779 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1781 /* The number of symbols on the RHS of the reduced rule.
1782 Keep to zero when no symbol should be popped. */
1789 yystacksize
= YYINITDEPTH
;
1792 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1793 if (YYMAXDEPTH
< yyes_capacity
)
1794 yyes_capacity
= YYMAXDEPTH
;
1796 YYDPRINTF ((stderr
, "Starting parse\n"));
1801 yychar
= YYEMPTY
; /* Cause a token to be read. */
1803 /* Initialize stack pointers.
1804 Waste one element of value and location stack
1805 so that they stay on the same level as the state stack.
1806 The wasted elements are never initialized. */
1811 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1812 /* Initialize the default location before parsing starts. */
1813 yylloc
.first_line
= yylloc
.last_line
= 1;
1814 yylloc
.first_column
= yylloc
.last_column
= 1;
1817 /* User initialization code. */
1818 /* Line 1519 of yacc.c */
1819 #line 99 "src/parse-gram.y"
1821 /* Bison's grammar can initial empty locations, hence a default
1822 location is needed. */
1823 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1824 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1826 /* Line 1519 of yacc.c */
1827 #line 1828 "src/parse-gram.c"
1832 /*------------------------------------------------------------.
1833 | yynewstate -- Push a new state, which is found in yystate. |
1834 `------------------------------------------------------------*/
1836 /* In all cases, when you get here, the value and location stacks
1837 have just been pushed. So pushing a state here evens the stacks. */
1843 if (yyss
+ yystacksize
- 1 <= yyssp
)
1845 /* Get the current used size of the three stacks, in elements. */
1846 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1850 /* Give user a chance to reallocate the stack. Use copies of
1851 these so that the &'s don't force the real ones into
1853 YYSTYPE
*yyvs1
= yyvs
;
1854 yytype_int16
*yyss1
= yyss
;
1855 YYLTYPE
*yyls1
= yyls
;
1857 /* Each stack pointer address is followed by the size of the
1858 data in use in that stack, in bytes. This used to be a
1859 conditional around just the two extra args, but that might
1860 be undefined if yyoverflow is a macro. */
1861 yyoverflow (YY_("memory exhausted"),
1862 &yyss1
, yysize
* sizeof (*yyssp
),
1863 &yyvs1
, yysize
* sizeof (*yyvsp
),
1864 &yyls1
, yysize
* sizeof (*yylsp
),
1871 #else /* no yyoverflow */
1872 # ifndef YYSTACK_RELOCATE
1873 goto yyexhaustedlab
;
1875 /* Extend the stack our own way. */
1876 if (YYMAXDEPTH
<= yystacksize
)
1877 goto yyexhaustedlab
;
1879 if (YYMAXDEPTH
< yystacksize
)
1880 yystacksize
= YYMAXDEPTH
;
1883 yytype_int16
*yyss1
= yyss
;
1884 union yyalloc
*yyptr
=
1885 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1887 goto yyexhaustedlab
;
1888 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1889 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1890 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1891 # undef YYSTACK_RELOCATE
1893 YYSTACK_FREE (yyss1
);
1896 #endif /* no yyoverflow */
1898 yyssp
= yyss
+ yysize
- 1;
1899 yyvsp
= yyvs
+ yysize
- 1;
1900 yylsp
= yyls
+ yysize
- 1;
1902 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1903 (unsigned long int) yystacksize
));
1905 if (yyss
+ yystacksize
- 1 <= yyssp
)
1909 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1911 if (yystate
== YYFINAL
)
1921 /* Do appropriate processing given the current state. Read a
1922 lookahead token if we need one and don't already have one. */
1924 /* First try to decide what to do without reference to lookahead token. */
1925 yyn
= yypact
[yystate
];
1926 if (yypact_value_is_default (yyn
))
1929 /* Not known => get a lookahead token if don't already have one. */
1931 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1932 if (yychar
== YYEMPTY
)
1934 YYDPRINTF ((stderr
, "Reading a token: "));
1938 if (yychar
<= YYEOF
)
1940 yychar
= yytoken
= YYEOF
;
1941 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1945 yytoken
= YYTRANSLATE (yychar
);
1946 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1949 /* If the proper action on seeing token YYTOKEN is to reduce or to
1950 detect an error, take that action. */
1952 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1960 if (yytable_value_is_error (yyn
))
1967 /* Count tokens shifted since error; after three, turn off error
1972 /* Shift the lookahead token. */
1973 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1975 /* Discard the shifted token. */
1977 YY_LAC_DISCARD ("shift");
1985 /*-----------------------------------------------------------.
1986 | yydefault -- do the default action for the current state. |
1987 `-----------------------------------------------------------*/
1989 yyn
= yydefact
[yystate
];
1995 /*-----------------------------.
1996 | yyreduce -- Do a reduction. |
1997 `-----------------------------*/
1999 /* yyn is the number of a rule to reduce with. */
2002 /* If YYLEN is nonzero, implement the default value of the action:
2005 Otherwise, the following line sets YYVAL to garbage.
2006 This behavior is undocumented and Bison
2007 users should not rely upon it. Assigning to YYVAL
2008 unconditionally makes the parser a bit smaller, and it avoids a
2009 GCC warning that YYVAL may be used uninitialized. */
2010 yyval
= yyvsp
[1-yylen
];
2012 /* Default location. */
2013 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2014 YY_REDUCE_PRINT (yyn
);
2016 int yychar_backup
= yychar
;
2020 /* Line 1735 of yacc.c */
2021 #line 286 "src/parse-gram.y"
2023 code_props plain_code
;
2024 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2025 code_props_translate_code (&plain_code
);
2026 gram_scanner_last_string_free ();
2027 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2028 plain_code
.code
, (yylsp
[0]));
2029 code_scanner_last_string_free ();
2031 /* Line 1735 of yacc.c */
2032 #line 2033 "src/parse-gram.c"
2036 /* Line 1735 of yacc.c */
2037 #line 296 "src/parse-gram.y"
2039 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2041 /* Line 1735 of yacc.c */
2042 #line 2043 "src/parse-gram.c"
2046 /* Line 1735 of yacc.c */
2047 #line 300 "src/parse-gram.y"
2049 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2050 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2052 /* Line 1735 of yacc.c */
2053 #line 2054 "src/parse-gram.c"
2057 /* Line 1735 of yacc.c */
2058 #line 304 "src/parse-gram.y"
2059 { defines_flag
= true; }
2060 /* Line 1735 of yacc.c */
2061 #line 2062 "src/parse-gram.c"
2065 /* Line 1735 of yacc.c */
2066 #line 306 "src/parse-gram.y"
2068 defines_flag
= true;
2069 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2071 /* Line 1735 of yacc.c */
2072 #line 2073 "src/parse-gram.c"
2076 /* Line 1735 of yacc.c */
2077 #line 311 "src/parse-gram.y"
2079 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2080 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2082 /* Line 1735 of yacc.c */
2083 #line 2084 "src/parse-gram.c"
2087 /* Line 1735 of yacc.c */
2088 #line 315 "src/parse-gram.y"
2089 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2090 /* Line 1735 of yacc.c */
2091 #line 2092 "src/parse-gram.c"
2095 /* Line 1735 of yacc.c */
2096 #line 316 "src/parse-gram.y"
2097 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2098 /* Line 1735 of yacc.c */
2099 #line 2100 "src/parse-gram.c"
2103 /* Line 1735 of yacc.c */
2104 #line 317 "src/parse-gram.y"
2105 { spec_file_prefix
= (yyvsp
[0].chars
); }
2106 /* Line 1735 of yacc.c */
2107 #line 2108 "src/parse-gram.c"
2111 /* Line 1735 of yacc.c */
2112 #line 318 "src/parse-gram.y"
2113 { spec_file_prefix
= (yyvsp
[0].chars
); }
2114 /* Line 1735 of yacc.c */
2115 #line 2116 "src/parse-gram.c"
2119 /* Line 1735 of yacc.c */
2120 #line 320 "src/parse-gram.y"
2122 nondeterministic_parser
= true;
2125 /* Line 1735 of yacc.c */
2126 #line 2127 "src/parse-gram.c"
2130 /* Line 1735 of yacc.c */
2131 #line 325 "src/parse-gram.y"
2134 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2135 code_props_translate_code (&action
);
2136 gram_scanner_last_string_free ();
2137 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2138 code_scanner_last_string_free ();
2140 /* Line 1735 of yacc.c */
2141 #line 2142 "src/parse-gram.c"
2145 /* Line 1735 of yacc.c */
2146 #line 333 "src/parse-gram.y"
2147 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2148 /* Line 1735 of yacc.c */
2149 #line 2150 "src/parse-gram.c"
2153 /* Line 1735 of yacc.c */
2154 #line 334 "src/parse-gram.y"
2155 { spec_name_prefix
= (yyvsp
[0].chars
); }
2156 /* Line 1735 of yacc.c */
2157 #line 2158 "src/parse-gram.c"
2161 /* Line 1735 of yacc.c */
2162 #line 335 "src/parse-gram.y"
2163 { spec_name_prefix
= (yyvsp
[0].chars
); }
2164 /* Line 1735 of yacc.c */
2165 #line 2166 "src/parse-gram.c"
2169 /* Line 1735 of yacc.c */
2170 #line 336 "src/parse-gram.y"
2171 { no_lines_flag
= true; }
2172 /* Line 1735 of yacc.c */
2173 #line 2174 "src/parse-gram.c"
2177 /* Line 1735 of yacc.c */
2178 #line 337 "src/parse-gram.y"
2179 { nondeterministic_parser
= true; }
2180 /* Line 1735 of yacc.c */
2181 #line 2182 "src/parse-gram.c"
2185 /* Line 1735 of yacc.c */
2186 #line 338 "src/parse-gram.y"
2187 { spec_outfile
= (yyvsp
[0].chars
); }
2188 /* Line 1735 of yacc.c */
2189 #line 2190 "src/parse-gram.c"
2193 /* Line 1735 of yacc.c */
2194 #line 339 "src/parse-gram.y"
2195 { spec_outfile
= (yyvsp
[0].chars
); }
2196 /* Line 1735 of yacc.c */
2197 #line 2198 "src/parse-gram.c"
2201 /* Line 1735 of yacc.c */
2202 #line 340 "src/parse-gram.y"
2203 { current_param
= (yyvsp
[0].param
); }
2204 /* Line 1735 of yacc.c */
2205 #line 2206 "src/parse-gram.c"
2209 /* Line 1735 of yacc.c */
2210 #line 340 "src/parse-gram.y"
2211 { current_param
= param_none
; }
2212 /* Line 1735 of yacc.c */
2213 #line 2214 "src/parse-gram.c"
2217 /* Line 1735 of yacc.c */
2218 #line 341 "src/parse-gram.y"
2219 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2220 /* Line 1735 of yacc.c */
2221 #line 2222 "src/parse-gram.c"
2225 /* Line 1735 of yacc.c */
2226 #line 343 "src/parse-gram.y"
2228 char const *skeleton_user
= (yyvsp
[0].chars
);
2229 if (strchr (skeleton_user
, '/'))
2231 size_t dir_length
= strlen (current_file
);
2232 char *skeleton_build
;
2233 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2235 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2238 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2241 memcpy (skeleton_build
, current_file
, dir_length
);
2242 skeleton_build
[dir_length
++] = '/';
2244 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2245 skeleton_user
= uniqstr_new (skeleton_build
);
2246 free (skeleton_build
);
2248 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2250 /* Line 1735 of yacc.c */
2251 #line 2252 "src/parse-gram.c"
2255 /* Line 1735 of yacc.c */
2256 #line 366 "src/parse-gram.y"
2257 { token_table_flag
= true; }
2258 /* Line 1735 of yacc.c */
2259 #line 2260 "src/parse-gram.c"
2263 /* Line 1735 of yacc.c */
2264 #line 367 "src/parse-gram.y"
2265 { report_flag
|= report_states
; }
2266 /* Line 1735 of yacc.c */
2267 #line 2268 "src/parse-gram.c"
2271 /* Line 1735 of yacc.c */
2272 #line 368 "src/parse-gram.y"
2273 { yacc_flag
= true; }
2274 /* Line 1735 of yacc.c */
2275 #line 2276 "src/parse-gram.c"
2279 /* Line 1735 of yacc.c */
2280 #line 373 "src/parse-gram.y"
2281 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2282 /* Line 1735 of yacc.c */
2283 #line 2284 "src/parse-gram.c"
2287 /* Line 1735 of yacc.c */
2288 #line 374 "src/parse-gram.y"
2289 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2290 /* Line 1735 of yacc.c */
2291 #line 2292 "src/parse-gram.c"
2295 /* Line 1735 of yacc.c */
2296 #line 386 "src/parse-gram.y"
2298 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2300 /* Line 1735 of yacc.c */
2301 #line 2302 "src/parse-gram.c"
2305 /* Line 1735 of yacc.c */
2306 #line 390 "src/parse-gram.y"
2309 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2310 symbol_list_code_props_set (list
, destructor
, (yylsp
[-1]), (yyvsp
[-1].code
));
2311 symbol_list_free ((yyvsp
[0].list
));
2313 /* Line 1735 of yacc.c */
2314 #line 2315 "src/parse-gram.c"
2318 /* Line 1735 of yacc.c */
2319 #line 397 "src/parse-gram.y"
2322 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2323 symbol_list_code_props_set (list
, printer
, (yylsp
[-1]), (yyvsp
[-1].code
));
2324 symbol_list_free ((yyvsp
[0].list
));
2326 /* Line 1735 of yacc.c */
2327 #line 2328 "src/parse-gram.c"
2331 /* Line 1735 of yacc.c */
2332 #line 404 "src/parse-gram.y"
2334 default_prec
= true;
2336 /* Line 1735 of yacc.c */
2337 #line 2338 "src/parse-gram.c"
2341 /* Line 1735 of yacc.c */
2342 #line 408 "src/parse-gram.y"
2344 default_prec
= false;
2346 /* Line 1735 of yacc.c */
2347 #line 2348 "src/parse-gram.c"
2351 /* Line 1735 of yacc.c */
2352 #line 412 "src/parse-gram.y"
2354 /* Do not invoke muscle_percent_code_grow here since it invokes
2355 muscle_user_name_list_grow. */
2356 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2357 code_scanner_last_string_free ();
2359 /* Line 1735 of yacc.c */
2360 #line 2361 "src/parse-gram.c"
2364 /* Line 1735 of yacc.c */
2365 #line 419 "src/parse-gram.y"
2367 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2368 code_scanner_last_string_free ();
2370 /* Line 1735 of yacc.c */
2371 #line 2372 "src/parse-gram.c"
2375 /* Line 1735 of yacc.c */
2376 #line 433 "src/parse-gram.y"
2378 /* Line 1735 of yacc.c */
2379 #line 2380 "src/parse-gram.c"
2383 /* Line 1735 of yacc.c */
2384 #line 434 "src/parse-gram.y"
2385 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2386 /* Line 1735 of yacc.c */
2387 #line 2388 "src/parse-gram.c"
2391 /* Line 1735 of yacc.c */
2392 #line 439 "src/parse-gram.y"
2395 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2396 code_scanner_last_string_free ();
2398 /* Line 1735 of yacc.c */
2399 #line 2400 "src/parse-gram.c"
2403 /* Line 1735 of yacc.c */
2404 #line 450 "src/parse-gram.y"
2405 { current_class
= nterm_sym
; }
2406 /* Line 1735 of yacc.c */
2407 #line 2408 "src/parse-gram.c"
2411 /* Line 1735 of yacc.c */
2412 #line 451 "src/parse-gram.y"
2414 current_class
= unknown_sym
;
2415 current_type
= NULL
;
2417 /* Line 1735 of yacc.c */
2418 #line 2419 "src/parse-gram.c"
2422 /* Line 1735 of yacc.c */
2423 #line 455 "src/parse-gram.y"
2424 { current_class
= token_sym
; }
2425 /* Line 1735 of yacc.c */
2426 #line 2427 "src/parse-gram.c"
2430 /* Line 1735 of yacc.c */
2431 #line 456 "src/parse-gram.y"
2433 current_class
= unknown_sym
;
2434 current_type
= NULL
;
2436 /* Line 1735 of yacc.c */
2437 #line 2438 "src/parse-gram.c"
2441 /* Line 1735 of yacc.c */
2442 #line 461 "src/parse-gram.y"
2446 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2447 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2448 symbol_list_free ((yyvsp
[0].list
));
2450 /* Line 1735 of yacc.c */
2451 #line 2452 "src/parse-gram.c"
2455 /* Line 1735 of yacc.c */
2456 #line 472 "src/parse-gram.y"
2460 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2462 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2463 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2465 symbol_list_free ((yyvsp
[0].list
));
2466 current_type
= NULL
;
2468 /* Line 1735 of yacc.c */
2469 #line 2470 "src/parse-gram.c"
2473 /* Line 1735 of yacc.c */
2474 #line 486 "src/parse-gram.y"
2475 { (yyval
.assoc
) = left_assoc
; }
2476 /* Line 1735 of yacc.c */
2477 #line 2478 "src/parse-gram.c"
2481 /* Line 1735 of yacc.c */
2482 #line 487 "src/parse-gram.y"
2483 { (yyval
.assoc
) = right_assoc
; }
2484 /* Line 1735 of yacc.c */
2485 #line 2486 "src/parse-gram.c"
2489 /* Line 1735 of yacc.c */
2490 #line 488 "src/parse-gram.y"
2491 { (yyval
.assoc
) = non_assoc
; }
2492 /* Line 1735 of yacc.c */
2493 #line 2494 "src/parse-gram.c"
2497 /* Line 1735 of yacc.c */
2498 #line 489 "src/parse-gram.y"
2499 { (yyval
.assoc
) = precedence_assoc
; }
2500 /* Line 1735 of yacc.c */
2501 #line 2502 "src/parse-gram.c"
2505 /* Line 1735 of yacc.c */
2506 #line 493 "src/parse-gram.y"
2507 { current_type
= NULL
; }
2508 /* Line 1735 of yacc.c */
2509 #line 2510 "src/parse-gram.c"
2513 /* Line 1735 of yacc.c */
2514 #line 494 "src/parse-gram.y"
2515 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2516 /* Line 1735 of yacc.c */
2517 #line 2518 "src/parse-gram.c"
2521 /* Line 1735 of yacc.c */
2522 #line 500 "src/parse-gram.y"
2523 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2524 /* Line 1735 of yacc.c */
2525 #line 2526 "src/parse-gram.c"
2529 /* Line 1735 of yacc.c */
2530 #line 502 "src/parse-gram.y"
2531 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2532 /* Line 1735 of yacc.c */
2533 #line 2534 "src/parse-gram.c"
2537 /* Line 1735 of yacc.c */
2538 #line 506 "src/parse-gram.y"
2539 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2540 /* Line 1735 of yacc.c */
2541 #line 2542 "src/parse-gram.c"
2545 /* Line 1735 of yacc.c */
2546 #line 507 "src/parse-gram.y"
2547 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2548 /* Line 1735 of yacc.c */
2549 #line 2550 "src/parse-gram.c"
2553 /* Line 1735 of yacc.c */
2554 #line 513 "src/parse-gram.y"
2555 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2556 /* Line 1735 of yacc.c */
2557 #line 2558 "src/parse-gram.c"
2561 /* Line 1735 of yacc.c */
2562 #line 515 "src/parse-gram.y"
2563 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2564 /* Line 1735 of yacc.c */
2565 #line 2566 "src/parse-gram.c"
2569 /* Line 1735 of yacc.c */
2570 #line 519 "src/parse-gram.y"
2571 { (yyval
.list
) = (yyvsp
[0].list
); }
2572 /* Line 1735 of yacc.c */
2573 #line 2574 "src/parse-gram.c"
2577 /* Line 1735 of yacc.c */
2578 #line 520 "src/parse-gram.y"
2579 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2580 /* Line 1735 of yacc.c */
2581 #line 2582 "src/parse-gram.c"
2585 /* Line 1735 of yacc.c */
2586 #line 524 "src/parse-gram.y"
2587 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2588 /* Line 1735 of yacc.c */
2589 #line 2590 "src/parse-gram.c"
2593 /* Line 1735 of yacc.c */
2594 #line 525 "src/parse-gram.y"
2595 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2596 /* Line 1735 of yacc.c */
2597 #line 2598 "src/parse-gram.c"
2601 /* Line 1735 of yacc.c */
2602 #line 526 "src/parse-gram.y"
2603 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2604 /* Line 1735 of yacc.c */
2605 #line 2606 "src/parse-gram.c"
2609 /* Line 1735 of yacc.c */
2610 #line 527 "src/parse-gram.y"
2611 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2612 /* Line 1735 of yacc.c */
2613 #line 2614 "src/parse-gram.c"
2617 /* Line 1735 of yacc.c */
2618 #line 533 "src/parse-gram.y"
2620 current_type
= (yyvsp
[0].uniqstr
);
2623 /* Line 1735 of yacc.c */
2624 #line 2625 "src/parse-gram.c"
2628 /* Line 1735 of yacc.c */
2629 #line 538 "src/parse-gram.y"
2631 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2632 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2634 /* Line 1735 of yacc.c */
2635 #line 2636 "src/parse-gram.c"
2639 /* Line 1735 of yacc.c */
2640 #line 543 "src/parse-gram.y"
2642 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2643 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2644 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2646 /* Line 1735 of yacc.c */
2647 #line 2648 "src/parse-gram.c"
2651 /* Line 1735 of yacc.c */
2652 #line 549 "src/parse-gram.y"
2654 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2655 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2656 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2658 /* Line 1735 of yacc.c */
2659 #line 2660 "src/parse-gram.c"
2663 /* Line 1735 of yacc.c */
2664 #line 555 "src/parse-gram.y"
2666 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2667 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2668 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2669 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2671 /* Line 1735 of yacc.c */
2672 #line 2673 "src/parse-gram.c"
2676 /* Line 1735 of yacc.c */
2677 #line 585 "src/parse-gram.y"
2681 /* Line 1735 of yacc.c */
2682 #line 2683 "src/parse-gram.c"
2686 /* Line 1735 of yacc.c */
2687 #line 591 "src/parse-gram.y"
2688 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2689 /* Line 1735 of yacc.c */
2690 #line 2691 "src/parse-gram.c"
2694 /* Line 1735 of yacc.c */
2695 #line 592 "src/parse-gram.y"
2697 /* Free the current lhs. */
2698 current_lhs (0, (yylsp
[-3]), 0);
2700 /* Line 1735 of yacc.c */
2701 #line 2702 "src/parse-gram.c"
2705 /* Line 1735 of yacc.c */
2706 #line 599 "src/parse-gram.y"
2707 { grammar_current_rule_end ((yylsp
[0])); }
2708 /* Line 1735 of yacc.c */
2709 #line 2710 "src/parse-gram.c"
2713 /* Line 1735 of yacc.c */
2714 #line 600 "src/parse-gram.y"
2715 { grammar_current_rule_end ((yylsp
[0])); }
2716 /* Line 1735 of yacc.c */
2717 #line 2718 "src/parse-gram.c"
2721 /* Line 1735 of yacc.c */
2722 #line 606 "src/parse-gram.y"
2723 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2724 current_lhs_named_ref
); }
2725 /* Line 1735 of yacc.c */
2726 #line 2727 "src/parse-gram.c"
2730 /* Line 1735 of yacc.c */
2731 #line 609 "src/parse-gram.y"
2732 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2733 /* Line 1735 of yacc.c */
2734 #line 2735 "src/parse-gram.c"
2738 /* Line 1735 of yacc.c */
2739 #line 611 "src/parse-gram.y"
2740 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2741 /* Line 1735 of yacc.c */
2742 #line 2743 "src/parse-gram.c"
2746 /* Line 1735 of yacc.c */
2747 #line 613 "src/parse-gram.y"
2748 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2749 /* Line 1735 of yacc.c */
2750 #line 2751 "src/parse-gram.c"
2754 /* Line 1735 of yacc.c */
2755 #line 615 "src/parse-gram.y"
2756 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2757 /* Line 1735 of yacc.c */
2758 #line 2759 "src/parse-gram.c"
2762 /* Line 1735 of yacc.c */
2763 #line 617 "src/parse-gram.y"
2764 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2765 /* Line 1735 of yacc.c */
2766 #line 2767 "src/parse-gram.c"
2770 /* Line 1735 of yacc.c */
2771 #line 619 "src/parse-gram.y"
2772 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2773 /* Line 1735 of yacc.c */
2774 #line 2775 "src/parse-gram.c"
2778 /* Line 1735 of yacc.c */
2779 #line 623 "src/parse-gram.y"
2780 { (yyval
.named_ref
) = 0; }
2781 /* Line 1735 of yacc.c */
2782 #line 2783 "src/parse-gram.c"
2786 /* Line 1735 of yacc.c */
2787 #line 625 "src/parse-gram.y"
2788 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2789 /* Line 1735 of yacc.c */
2790 #line 2791 "src/parse-gram.c"
2794 /* Line 1735 of yacc.c */
2795 #line 636 "src/parse-gram.y"
2796 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2797 /* Line 1735 of yacc.c */
2798 #line 2799 "src/parse-gram.c"
2802 /* Line 1735 of yacc.c */
2803 #line 641 "src/parse-gram.y"
2804 { (yyval
.chars
) = ""; }
2805 /* Line 1735 of yacc.c */
2806 #line 2807 "src/parse-gram.c"
2810 /* Line 1735 of yacc.c */
2811 #line 642 "src/parse-gram.y"
2812 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2813 /* Line 1735 of yacc.c */
2814 #line 2815 "src/parse-gram.c"
2818 /* Line 1735 of yacc.c */
2819 #line 653 "src/parse-gram.y"
2821 code_props plain_code
;
2822 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2823 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2824 code_props_translate_code (&plain_code
);
2825 gram_scanner_last_string_free ();
2826 (yyval
.chars
) = plain_code
.code
;
2828 /* Line 1735 of yacc.c */
2829 #line 2830 "src/parse-gram.c"
2833 /* Line 1735 of yacc.c */
2834 #line 673 "src/parse-gram.y"
2835 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2836 /* Line 1735 of yacc.c */
2837 #line 2838 "src/parse-gram.c"
2841 /* Line 1735 of yacc.c */
2842 #line 675 "src/parse-gram.y"
2844 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2845 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2846 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2848 /* Line 1735 of yacc.c */
2849 #line 2850 "src/parse-gram.c"
2853 /* Line 1735 of yacc.c */
2854 #line 683 "src/parse-gram.y"
2855 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2856 /* Line 1735 of yacc.c */
2857 #line 2858 "src/parse-gram.c"
2861 /* Line 1735 of yacc.c */
2862 #line 695 "src/parse-gram.y"
2864 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2865 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2867 /* Line 1735 of yacc.c */
2868 #line 2869 "src/parse-gram.c"
2872 /* Line 1735 of yacc.c */
2873 #line 704 "src/parse-gram.y"
2875 code_props plain_code
;
2876 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2877 code_props_translate_code (&plain_code
);
2878 gram_scanner_last_string_free ();
2879 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2880 code_scanner_last_string_free ();
2882 /* Line 1735 of yacc.c */
2883 #line 2884 "src/parse-gram.c"
2887 /* Line 1735 of yacc.c */
2888 #line 2889 "src/parse-gram.c"
2891 if (yychar_backup
!= yychar
)
2892 YY_LAC_DISCARD ("yychar change");
2894 /* User semantic actions sometimes alter yychar, and that requires
2895 that yytoken be updated with the new translation. We take the
2896 approach of translating immediately before every use of yytoken.
2897 One alternative is translating here after every semantic action,
2898 but that translation would be missed if the semantic action invokes
2899 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2900 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2901 incorrect destructor might then be invoked immediately. In the
2902 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2903 to an incorrect destructor call or verbose syntax error message
2904 before the lookahead is translated. */
2905 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2909 YY_STACK_PRINT (yyss
, yyssp
);
2914 /* Now `shift' the result of the reduction. Determine what state
2915 that goes to, based on the state we popped back to and the rule
2916 number reduced by. */
2920 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2921 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2922 yystate
= yytable
[yystate
];
2924 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2929 /*------------------------------------.
2930 | yyerrlab -- here on detecting error |
2931 `------------------------------------*/
2933 /* Make sure we have latest lookahead translation. See comments at
2934 user semantic actions for why this is necessary. */
2935 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2937 /* If not already recovering from an error, report this error. */
2941 #if ! YYERROR_VERBOSE
2942 yyerror (YY_("syntax error"));
2944 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2945 yyesa, &yyes, &yyes_capacity, \
2948 char const *yymsgp
= YY_("syntax error");
2949 int yysyntax_error_status
;
2950 if (yychar
!= YYEMPTY
)
2952 yysyntax_error_status
= YYSYNTAX_ERROR
;
2953 if (yysyntax_error_status
== 0)
2955 else if (yysyntax_error_status
== 1)
2957 if (yymsg
!= yymsgbuf
)
2958 YYSTACK_FREE (yymsg
);
2959 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2963 yymsg_alloc
= sizeof yymsgbuf
;
2964 yysyntax_error_status
= 2;
2968 yysyntax_error_status
= YYSYNTAX_ERROR
;
2973 if (yysyntax_error_status
== 2)
2974 goto yyexhaustedlab
;
2976 # undef YYSYNTAX_ERROR
2980 yyerror_range
[1] = yylloc
;
2982 if (yyerrstatus
== 3)
2984 /* If just tried and failed to reuse lookahead token after an
2985 error, discard it. */
2987 if (yychar
<= YYEOF
)
2989 /* Return failure if at end of input. */
2990 if (yychar
== YYEOF
)
2995 yydestruct ("Error: discarding",
2996 yytoken
, &yylval
, &yylloc
);
3001 /* Else will try to reuse lookahead token after shifting the error
3006 /*---------------------------------------------------.
3007 | yyerrorlab -- error raised explicitly by YYERROR. |
3008 `---------------------------------------------------*/
3011 /* Pacify compilers like GCC when the user code never invokes
3012 YYERROR and the label yyerrorlab therefore never appears in user
3014 if (/*CONSTCOND*/ 0)
3017 yyerror_range
[1] = yylsp
[1-yylen
];
3018 /* Do not reclaim the symbols of the rule which action triggered
3022 YY_STACK_PRINT (yyss
, yyssp
);
3027 /*-------------------------------------------------------------.
3028 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3029 `-------------------------------------------------------------*/
3031 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3035 yyn
= yypact
[yystate
];
3036 if (!yypact_value_is_default (yyn
))
3039 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3047 /* Pop the current state because it cannot handle the error token. */
3051 yyerror_range
[1] = *yylsp
;
3052 yydestruct ("Error: popping",
3053 yystos
[yystate
], yyvsp
, yylsp
);
3056 YY_STACK_PRINT (yyss
, yyssp
);
3059 /* If the stack popping above didn't lose the initial context for the
3060 current lookahead token, the shift below will for sure. */
3061 YY_LAC_DISCARD ("error recovery");
3065 yyerror_range
[2] = yylloc
;
3066 /* Using YYLLOC is tempting, but would change the location of
3067 the lookahead. YYLOC is available though. */
3068 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3071 /* Shift the error token. */
3072 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3078 /*-------------------------------------.
3079 | yyacceptlab -- YYACCEPT comes here. |
3080 `-------------------------------------*/
3085 /*-----------------------------------.
3086 | yyabortlab -- YYABORT comes here. |
3087 `-----------------------------------*/
3093 /*-------------------------------------------------.
3094 | yyexhaustedlab -- memory exhaustion comes here. |
3095 `-------------------------------------------------*/
3097 yyerror (YY_("memory exhausted"));
3103 if (yychar
!= YYEMPTY
)
3105 /* Make sure we have latest lookahead translation. See comments at
3106 user semantic actions for why this is necessary. */
3107 yytoken
= YYTRANSLATE (yychar
);
3108 yydestruct ("Cleanup: discarding lookahead",
3109 yytoken
, &yylval
, &yylloc
);
3111 /* Do not reclaim the symbols of the rule which action triggered
3112 this YYABORT or YYACCEPT. */
3114 YY_STACK_PRINT (yyss
, yyssp
);
3115 while (yyssp
!= yyss
)
3117 yydestruct ("Cleanup: popping",
3118 yystos
[*yyssp
], yyvsp
, yylsp
);
3123 YYSTACK_FREE (yyss
);
3126 YYSTACK_FREE (yyes
);
3128 if (yymsg
!= yymsgbuf
)
3129 YYSTACK_FREE (yymsg
);
3131 /* Make sure YYID is used. */
3132 return YYID (yyresult
);
3135 /* Line 1995 of yacc.c */
3136 #line 714 "src/parse-gram.y"
3140 /* Return the location of the left-hand side of a rule whose
3141 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3142 the right-hand side, and return an empty location equal to the end
3143 boundary of RHS[0] if the right-hand side is empty. */
3146 lloc_default (YYLTYPE
const *rhs
, int n
)
3151 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3152 The bug is fixed in 7.4.2m, but play it safe for now. */
3153 loc
.start
= rhs
[n
].end
;
3154 loc
.end
= rhs
[n
].end
;
3156 /* Ignore empty nonterminals the start of the right-hand side.
3157 Do not bother to ignore them at the end of the right-hand side,
3158 since empty nonterminals have the same end as their predecessors. */
3159 for (i
= 1; i
<= n
; i
++)
3160 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3162 loc
.start
= rhs
[i
].start
;
3171 add_param (param_type type
, char *decl
, location loc
)
3173 static char const alphanum
[26 + 26 + 1 + 10] =
3174 "abcdefghijklmnopqrstuvwxyz"
3175 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3179 char const *name_start
= NULL
;
3182 /* Stop on last actual character. */
3183 for (p
= decl
; p
[1]; p
++)
3185 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3186 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3189 /* Strip the surrounding '{' and '}', and any blanks just inside
3191 while (*--p
== ' ' || *p
== '\t')
3194 while (*++decl
== ' ' || *decl
== '\t')
3199 complain_at (loc
, _("missing identifier in parameter declaration"));
3202 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3203 if (type
& param_lex
)
3204 muscle_pair_list_grow ("lex_param", decl
, name
);
3205 if (type
& param_parse
)
3206 muscle_pair_list_grow ("parse_param", decl
, name
);
3210 gram_scanner_last_string_free ();
3215 version_check (location
const *loc
, char const *version
)
3217 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3219 complain_at (*loc
, "require bison %s, but have %s",
3220 version
, PACKAGE_VERSION
);
3226 gram_error (location
const *loc
, char const *msg
)
3228 complain_at (*loc
, "%s", msg
);
3232 token_name (int type
)
3234 return yytname
[YYTRANSLATE (type
)];
3245 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3246 return quotearg_style (escape_quoting_style
, buf
);