1 /* A Bison parser, made by GNU Bison 2.4.542-10bae. */
3 /* Implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.542-10bae"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 1
65 /* Substitute the variable and function names. */
66 #define yyparse gram_parse
67 #define yylex gram_lex
68 #define yyerror gram_error
69 #define yylval gram_lval
70 #define yychar gram_char
71 #define yydebug gram_debug
72 #define yynerrs gram_nerrs
73 #define yylloc gram_lloc
75 /* Copy the first part of user declarations. */
76 /* Line 269 of yacc.c */
77 #line 1 "src/parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
80 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
81 Free Software Foundation, Inc.
83 This file is part of Bison, the GNU Compiler Compiler.
85 This program is free software: you can redistribute it and/or modify
86 it under the terms of the GNU General Public License as published by
87 the Free Software Foundation, either version 3 of the License, or
88 (at your option) any later version.
90 This program is distributed in the hope that it will be useful,
91 but WITHOUT ANY WARRANTY; without even the implied warranty of
92 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93 GNU General Public License for more details.
95 You should have received a copy of the GNU General Public License
96 along with this program. If not, see <http://www.gnu.org/licenses/>. */
101 #include "complain.h"
102 #include "conflicts.h"
106 #include "muscle-tab.h"
107 #include "named-ref.h"
108 #include "quotearg.h"
111 #include "scan-gram.h"
112 #include "scan-code.h"
114 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
115 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
117 #define YY_LOCATION_PRINT(File, Loc) \
118 location_print (File, Loc)
120 static void version_check (location
const *loc
, char const *version
);
122 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
123 FIXME: depends on the undocumented availability of YYLLOC. */
125 #define yyerror(Msg) \
126 gram_error (&yylloc, Msg)
127 static void gram_error (location
const *, char const *);
129 static char const *char_name (char);
131 /* Line 269 of yacc.c */
132 #line 133 "src/parse-gram.c"
134 /* Enabling traces. */
139 /* Enabling verbose error messages. */
140 #ifdef YYERROR_VERBOSE
141 # undef YYERROR_VERBOSE
142 # define YYERROR_VERBOSE 1
144 # define YYERROR_VERBOSE 1
147 /* Enabling the token table. */
148 #ifndef YYTOKEN_TABLE
149 # define YYTOKEN_TABLE 0
152 /* "%code requires" blocks. */
153 /* Line 289 of yacc.c */
154 #line 203 "src/parse-gram.y"
162 param_parse
= 1 << 1,
163 param_both
= param_lex
| param_parse
168 /* Line 289 of yacc.c */
169 #line 170 "src/parse-gram.c"
174 /* Put the tokens into the symbol table, so that GDB and other debuggers
183 PERCENT_DESTRUCTOR
= 263,
184 PERCENT_PRINTER
= 264,
187 PERCENT_NONASSOC
= 267,
188 PERCENT_PRECEDENCE
= 268,
193 PERCENT_DEFAULT_PREC
= 273,
194 PERCENT_DEFINE
= 274,
195 PERCENT_DEFINES
= 275,
196 PERCENT_ERROR_VERBOSE
= 276,
197 PERCENT_EXPECT
= 277,
198 PERCENT_EXPECT_RR
= 278,
200 PERCENT_FILE_PREFIX
= 280,
201 PERCENT_GLR_PARSER
= 281,
202 PERCENT_INITIAL_ACTION
= 282,
203 PERCENT_LANGUAGE
= 283,
204 PERCENT_NAME_PREFIX
= 284,
205 PERCENT_NO_DEFAULT_PREC
= 285,
206 PERCENT_NO_LINES
= 286,
207 PERCENT_NONDETERMINISTIC_PARSER
= 287,
208 PERCENT_OUTPUT
= 288,
209 PERCENT_REQUIRE
= 289,
210 PERCENT_SKELETON
= 290,
212 PERCENT_TOKEN_TABLE
= 292,
213 PERCENT_VERBOSE
= 293,
216 BRACED_PREDICATE
= 296,
223 PERCENT_PERCENT
= 303,
238 #define PERCENT_TOKEN 260
239 #define PERCENT_NTERM 261
240 #define PERCENT_TYPE 262
241 #define PERCENT_DESTRUCTOR 263
242 #define PERCENT_PRINTER 264
243 #define PERCENT_LEFT 265
244 #define PERCENT_RIGHT 266
245 #define PERCENT_NONASSOC 267
246 #define PERCENT_PRECEDENCE 268
247 #define PERCENT_PREC 269
248 #define PERCENT_DPREC 270
249 #define PERCENT_MERGE 271
250 #define PERCENT_CODE 272
251 #define PERCENT_DEFAULT_PREC 273
252 #define PERCENT_DEFINE 274
253 #define PERCENT_DEFINES 275
254 #define PERCENT_ERROR_VERBOSE 276
255 #define PERCENT_EXPECT 277
256 #define PERCENT_EXPECT_RR 278
257 #define PERCENT_FLAG 279
258 #define PERCENT_FILE_PREFIX 280
259 #define PERCENT_GLR_PARSER 281
260 #define PERCENT_INITIAL_ACTION 282
261 #define PERCENT_LANGUAGE 283
262 #define PERCENT_NAME_PREFIX 284
263 #define PERCENT_NO_DEFAULT_PREC 285
264 #define PERCENT_NO_LINES 286
265 #define PERCENT_NONDETERMINISTIC_PARSER 287
266 #define PERCENT_OUTPUT 288
267 #define PERCENT_REQUIRE 289
268 #define PERCENT_SKELETON 290
269 #define PERCENT_START 291
270 #define PERCENT_TOKEN_TABLE 292
271 #define PERCENT_VERBOSE 293
272 #define PERCENT_YACC 294
273 #define BRACED_CODE 295
274 #define BRACED_PREDICATE 296
275 #define BRACKETED_ID 297
281 #define PERCENT_PERCENT 303
284 #define SEMICOLON 306
288 #define PERCENT_PARAM 310
289 #define PERCENT_UNION 311
294 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
295 typedef union YYSTYPE
297 /* Line 294 of yacc.c */
298 #line 89 "src/parse-gram.y"
304 named_ref
*named_ref
;
308 unsigned char character
;
310 /* Line 294 of yacc.c */
311 #line 227 "src/parse-gram.y"
316 /* Line 294 of yacc.c */
317 #line 318 "src/parse-gram.c"
319 # define YYSTYPE_IS_TRIVIAL 1
320 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
321 # define YYSTYPE_IS_DECLARED 1
324 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
325 typedef struct YYLTYPE
332 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
333 # define YYLTYPE_IS_DECLARED 1
334 # define YYLTYPE_IS_TRIVIAL 1
338 /* Copy the second part of user declarations. */
340 /* Line 344 of yacc.c */
341 #line 342 "src/parse-gram.c"
342 /* Unqualified %code blocks. */
343 /* Line 345 of yacc.c */
344 #line 56 "src/parse-gram.y"
346 static int current_prec
= 0;
347 static location current_lhs_location
;
348 static named_ref
*current_lhs_named_ref
;
349 static symbol
*current_lhs
;
350 static symbol_class current_class
= unknown_sym
;
351 static uniqstr current_type
= NULL
;
353 #define YYTYPE_INT16 int_fast16_t
354 #define YYTYPE_INT8 int_fast8_t
355 #define YYTYPE_UINT16 uint_fast16_t
356 #define YYTYPE_UINT8 uint_fast8_t
358 /* Line 345 of yacc.c */
359 #line 216 "src/parse-gram.y"
361 /** Add a lex-param and/or a parse-param.
363 * \param type where to push this formal argument.
364 * \param decl the formal argument. Destroyed.
365 * \param loc the location in the source.
367 static void add_param (param_type type
, char *decl
, location loc
);
368 static param_type current_param
= param_none
;
371 /* Line 345 of yacc.c */
372 #line 373 "src/parse-gram.c"
379 typedef YYTYPE_UINT8 yytype_uint8
;
381 typedef unsigned char yytype_uint8
;
385 typedef YYTYPE_INT8 yytype_int8
;
386 #elif (defined __STDC__ || defined __C99__FUNC__ \
387 || defined __cplusplus || defined _MSC_VER)
388 typedef signed char yytype_int8
;
390 typedef short int yytype_int8
;
394 typedef YYTYPE_UINT16 yytype_uint16
;
396 typedef unsigned short int yytype_uint16
;
400 typedef YYTYPE_INT16 yytype_int16
;
402 typedef short int yytype_int16
;
406 # ifdef __SIZE_TYPE__
407 # define YYSIZE_T __SIZE_TYPE__
408 # elif defined size_t
409 # define YYSIZE_T size_t
410 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
411 || defined __cplusplus || defined _MSC_VER)
412 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
413 # define YYSIZE_T size_t
415 # define YYSIZE_T unsigned int
419 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
422 # if defined YYENABLE_NLS && YYENABLE_NLS
424 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
425 # define YY_(msgid) dgettext ("bison-runtime", msgid)
429 # define YY_(msgid) msgid
433 /* Suppress unused-variable warnings by "using" E. */
434 #if ! defined lint || defined __GNUC__
435 # define YYUSE(e) ((void) (e))
437 # define YYUSE(e) /* empty */
440 /* Identity function, used to suppress warnings about constant conditions. */
444 #if (defined __STDC__ || defined __C99__FUNC__ \
445 || defined __cplusplus || defined _MSC_VER)
460 /* The parser invokes alloca or malloc; define the necessary symbols. */
462 # ifdef YYSTACK_ALLOC
463 /* Pacify GCC's `empty if-body' warning. */
464 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
465 # ifndef YYSTACK_ALLOC_MAXIMUM
466 /* The OS might guarantee only one guard page at the bottom of the stack,
467 and a page size can be as small as 4096 bytes. So we cannot safely
468 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
469 to allow for a few compiler-allocated temporary stack slots. */
470 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
473 # define YYSTACK_ALLOC YYMALLOC
474 # define YYSTACK_FREE YYFREE
475 # ifndef YYSTACK_ALLOC_MAXIMUM
476 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
478 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
479 && ! ((defined YYMALLOC || defined malloc) \
480 && (defined YYFREE || defined free)))
481 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
482 # ifndef EXIT_SUCCESS
483 # define EXIT_SUCCESS 0
487 # define YYMALLOC malloc
488 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
489 || defined __cplusplus || defined _MSC_VER)
490 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
495 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
496 || defined __cplusplus || defined _MSC_VER)
497 void free (void *); /* INFRINGES ON USER NAME SPACE */
501 # define YYCOPY_NEEDED 1
505 #if (! defined yyoverflow \
506 && (! defined __cplusplus \
507 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
508 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
510 /* A type that is properly aligned for any stack member. */
513 yytype_int16 yyss_alloc
;
518 /* The size of the maximum gap between one aligned stack and the next. */
519 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
521 /* The size of an array large to enough to hold all stacks, each with
523 # define YYSTACK_BYTES(N) \
524 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
525 + 2 * YYSTACK_GAP_MAXIMUM)
527 # define YYCOPY_NEEDED 1
529 /* Relocate STACK from its old location to the new one. The
530 local variables YYSIZE and YYSTACKSIZE give the old and new number of
531 elements in the stack, and YYPTR gives the new location of the
532 stack. Advance YYPTR to a properly aligned location for the next
534 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
537 YYSIZE_T yynewbytes; \
538 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
539 Stack = &yyptr->Stack_alloc; \
540 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
541 yyptr += yynewbytes / sizeof (*yyptr); \
547 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
548 /* Copy COUNT objects from FROM to TO. The source and destination do
551 # if defined __GNUC__ && 1 < __GNUC__
552 # define YYCOPY(To, From, Count) \
553 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
555 # define YYCOPY(To, From, Count) \
559 for (yyi = 0; yyi < (Count); yyi++) \
560 (To)[yyi] = (From)[yyi]; \
565 #endif /* !YYCOPY_NEEDED */
567 /* YYFINAL -- State number of the termination state. */
569 /* YYLAST -- Last index in YYTABLE. */
572 /* YYNTOKENS -- Number of terminals. */
574 /* YYNNTS -- Number of nonterminals. */
576 /* YYNRULES -- Number of rules. */
578 /* YYNSTATES -- Number of states. */
579 #define YYNSTATES 149
581 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
582 by yylex, with out-of-bounds checking. */
584 #define YYMAXUTOK 311
586 #define YYTRANSLATE(YYX) \
587 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
589 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
590 as returned by yylex, without out-of-bounds checking. */
591 static const yytype_uint8 yytranslate
[] =
593 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
619 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
620 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
621 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
622 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
623 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
628 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
629 static const yytype_uint16 yyrline
[] =
631 0, 252, 252, 260, 262, 266, 267, 277, 281, 286,
632 287, 292, 297, 298, 299, 300, 301, 306, 315, 316,
633 317, 318, 319, 320, 321, 322, 322, 323, 324, 348,
634 349, 350, 351, 355, 356, 365, 366, 367, 371, 378,
635 385, 389, 393, 400, 415, 416, 420, 432, 432, 437,
636 437, 442, 453, 468, 469, 470, 471, 475, 476, 481,
637 483, 488, 489, 494, 496, 501, 502, 506, 507, 508,
638 509, 514, 519, 524, 530, 536, 547, 548, 557, 558,
639 564, 565, 566, 573, 573, 578, 579, 580, 585, 587,
640 589, 591, 593, 595, 597, 602, 604, 614, 615, 620,
641 621, 622, 631, 651, 653, 662, 667, 668, 673, 680,
646 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
647 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
648 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
649 static const char *const yytname
[] =
651 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
652 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
653 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
654 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
655 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
656 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
657 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
658 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
659 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
660 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
661 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
662 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
663 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
664 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
665 "prologue_declaration", "$@1", "params", "grammar_declaration",
666 "union_name", "symbol_declaration", "$@2", "$@3",
667 "precedence_declaration", "precedence_declarator", "tag.opt",
668 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
669 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
670 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
671 "named_ref.opt", "variable", "content.opt", "braceless", "id",
672 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
677 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
678 (internal) symbol number NUM (which must be that of a token). */
679 static const yytype_uint16 yytoknum
[] =
681 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
682 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
683 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
684 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
685 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
686 305, 306, 307, 308, 309, 310, 311
690 #define YYPACT_NINF -50
692 #define yypact_value_is_default(yystate) \
695 #define YYTABLE_NINF -110
697 #define yytable_value_is_error(yytable_value) \
700 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
702 static const yytype_int16 yypact
[] =
704 -50, 4, 107, -50, -50, -50, -20, 3, 11, -50,
705 -50, -50, -50, 14, -50, 12, 68, -50, 72, 73,
706 -50, 0, -50, 45, 86, 2, -50, -50, -50, 17,
707 95, 96, 32, -50, -50, -50, 16, -50, -50, -50,
708 54, -50, -50, -50, -50, 49, -2, -2, 32, 27,
709 27, -50, 63, -50, -50, -50, 37, -50, -50, -50,
710 -50, 101, -50, -50, -50, 103, -50, 104, -50, -50,
711 -50, -50, -50, -50, -50, -50, 57, -50, 58, 1,
712 -50, -50, 79, 70, -50, 63, -50, 32, -50, -50,
713 -2, 64, -2, 32, -50, -50, -50, -50, 27, -50,
714 -50, 27, -50, -50, -50, -50, -50, -50, -50, -50,
715 -50, 78, -50, -50, -50, -50, -50, 83, -50, 32,
716 -50, 143, -50, 145, -50, -50, -50, -50, -50, -50,
717 -50, -50, -50, 43, 50, -50, -50, 32, 146, 97,
718 79, -50, 79, 50, -50, -50, -50, -50, -50
721 /* YYDEFACT[S] -- default reduction number in state S. Performed when
722 YYTABLE does not specify something else to do. Zero means the default
724 static const yytype_uint8 yydefact
[] =
726 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
727 54, 55, 56, 0, 40, 0, 9, 11, 0, 0,
728 7, 0, 16, 0, 0, 0, 41, 21, 22, 0,
729 0, 0, 0, 29, 30, 31, 0, 6, 32, 25,
730 44, 4, 5, 36, 35, 57, 0, 0, 0, 0,
731 0, 102, 0, 42, 98, 97, 99, 10, 12, 13,
732 14, 0, 17, 18, 19, 0, 23, 0, 27, 28,
733 108, 104, 103, 106, 37, 107, 0, 105, 0, 0,
734 78, 80, 95, 0, 45, 0, 58, 0, 71, 76,
735 50, 72, 48, 51, 63, 68, 69, 70, 38, 65,
736 67, 39, 43, 101, 100, 8, 15, 20, 24, 82,
737 81, 0, 79, 2, 96, 83, 34, 26, 46, 52,
738 59, 61, 77, 73, 74, 64, 66, 110, 88, 33,
739 60, 62, 75, 84, 85, 88, 87, 0, 0, 0,
740 95, 91, 95, 86, 92, 93, 94, 90, 89
743 /* YYPGOTO[NTERM-NUM]. */
744 static const yytype_int16 yypgoto
[] =
746 -50, -50, -50, -50, -50, -50, 149, -50, -50, -50,
747 -50, -50, -50, -50, -50, 33, -50, 106, -42, -4,
748 112, -50, 74, -50, -50, -50, 19, -45, -50, -50,
749 -16, -8, -50, -32, -49, -50
752 /* YYDEFGOTO[NTERM-NUM]. */
753 static const yytype_int16 yydefgoto
[] =
755 -1, 1, 2, 41, 83, 117, 78, 85, 43, 47,
756 46, 44, 45, 87, 119, 120, 93, 98, 99, 89,
757 90, 79, 80, 81, 128, 133, 134, 115, 56, 105,
758 53, 73, 82, 100, 75, 113
761 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
762 positive, shift that token. If negative, reduce the rule which
763 number is the opposite. If YYTABLE_NINF, syntax error. */
764 static const yytype_int16 yytable
[] =
766 74, -109, 76, 60, 3, 64, 4, 5, 6, 7,
767 8, 9, 10, 11, 12, 54, 94, 76, 13, 14,
768 66, 4, 5, 6, 7, 8, 9, 10, 11, 12,
769 70, 26, 48, 13, 14, 70, 102, 32, 91, 91,
770 103, 71, 124, 49, 72, 61, 26, 65, 77, 111,
771 88, 50, 32, 70, 51, 121, 126, 40, 55, 126,
772 52, 125, 67, 77, 137, 138, 139, 70, 123, 118,
773 71, 57, 40, 72, 132, 71, 58, 59, 72, 95,
774 96, 97, 91, 104, 91, 62, 122, 121, 122, 63,
775 140, 141, 135, 71, 136, 147, 72, 148, 68, 69,
776 84, 86, 142, 51, 106, 144, 107, 108, 109, 110,
777 116, 142, 4, 5, 6, 7, 8, 9, 10, 11,
778 12, 114, 127, 129, 13, 14, 15, 16, 17, 18,
779 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
780 29, 30, 31, 32, 33, 34, 35, 131, 70, 146,
781 145, 42, 130, 112, 143, 36, 101, 37, 38, 92,
785 static const yytype_int16 yycheck
[] =
787 32, 0, 1, 3, 0, 3, 5, 6, 7, 8,
788 9, 10, 11, 12, 13, 3, 48, 1, 17, 18,
789 3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
790 3, 30, 52, 17, 18, 3, 52, 36, 46, 47,
791 3, 43, 91, 40, 46, 45, 30, 45, 47, 48,
792 52, 40, 36, 3, 40, 87, 98, 56, 46, 101,
793 46, 93, 45, 47, 14, 15, 16, 3, 4, 85,
794 43, 3, 56, 46, 123, 43, 4, 4, 46, 52,
795 53, 54, 90, 46, 92, 40, 90, 119, 92, 3,
796 40, 41, 49, 43, 51, 140, 46, 142, 3, 3,
797 46, 52, 134, 40, 3, 137, 3, 3, 51, 51,
798 40, 143, 5, 6, 7, 8, 9, 10, 11, 12,
799 13, 42, 44, 40, 17, 18, 19, 20, 21, 22,
800 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
801 33, 34, 35, 36, 37, 38, 39, 4, 3, 52,
802 4, 2, 119, 79, 135, 48, 50, 50, 51, 47,
806 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
807 symbol of state STATE-NUM. */
808 static const yytype_uint8 yystos
[] =
810 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
811 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
812 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
813 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
814 56, 60, 63, 65, 68, 69, 67, 66, 52, 40,
815 40, 40, 46, 87, 3, 46, 85, 3, 4, 4,
816 3, 45, 40, 3, 3, 45, 3, 45, 3, 3,
817 3, 43, 46, 88, 90, 91, 1, 47, 63, 78,
818 79, 80, 89, 61, 46, 64, 52, 70, 52, 76,
819 77, 88, 77, 73, 90, 52, 53, 54, 74, 75,
820 90, 74, 87, 3, 46, 86, 3, 3, 3, 51,
821 51, 48, 79, 92, 42, 84, 40, 62, 87, 71,
822 72, 90, 76, 4, 91, 90, 75, 44, 81, 40,
823 72, 4, 91, 82, 83, 49, 51, 14, 15, 16,
824 40, 41, 90, 83, 90, 4, 52, 84, 84
827 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
828 static const yytype_uint8 yyr1
[] =
830 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
831 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
832 60, 60, 60, 60, 60, 61, 60, 60, 60, 60,
833 60, 60, 60, 62, 62, 63, 63, 63, 63, 63,
834 63, 63, 63, 63, 64, 64, 63, 66, 65, 67,
835 65, 65, 68, 69, 69, 69, 69, 70, 70, 71,
836 71, 72, 72, 73, 73, 74, 74, 75, 75, 75,
837 75, 76, 76, 76, 76, 76, 77, 77, 78, 78,
838 79, 79, 79, 81, 80, 82, 82, 82, 83, 83,
839 83, 83, 83, 83, 83, 84, 84, 85, 85, 86,
840 86, 86, 87, 88, 88, 89, 90, 90, 91, 92,
844 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
845 static const yytype_uint8 yyr2
[] =
847 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
848 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
849 3, 1, 1, 2, 3, 0, 3, 2, 2, 1,
850 1, 1, 1, 2, 1, 1, 1, 2, 3, 3,
851 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
852 3, 3, 3, 1, 1, 1, 1, 0, 1, 1,
853 2, 1, 2, 1, 2, 1, 2, 1, 1, 1,
854 1, 1, 1, 2, 2, 3, 1, 2, 1, 2,
855 1, 2, 2, 0, 4, 1, 3, 2, 0, 3,
856 3, 2, 3, 3, 3, 0, 1, 1, 1, 0,
857 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
862 #define yyerrok (yyerrstatus = 0)
863 #define yyclearin (yychar = YYEMPTY)
867 #define YYACCEPT goto yyacceptlab
868 #define YYABORT goto yyabortlab
869 #define YYERROR goto yyerrorlab
872 /* Like YYERROR except do call yyerror. This remains here temporarily
873 to ease the transition to the new meaning of YYERROR, for GCC.
874 Once GCC version 2 has supplanted version 1, this can go. However,
875 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
876 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
879 #define YYFAIL goto yyerrlab
881 /* This is here to suppress warnings from the GCC cpp's
882 -Wunused-macros. Normally we don't worry about that warning, but
883 some users do, and we want to make it easy for users to remove
884 YYFAIL uses, which will produce warnings from Bison 2.5. */
887 #define YYRECOVERING() (!!yyerrstatus)
889 #define YYBACKUP(Token, Value) \
891 if (yychar == YYEMPTY && yylen == 1) \
896 YY_LAC_DISCARD ("YYBACKUP"); \
901 yyerror (YY_("syntax error: cannot back up")); \
908 #define YYERRCODE 256
911 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
912 If N is 0, then set CURRENT to the empty location which ends
913 the previous symbol: RHS[0] (always defined). */
915 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
916 #ifndef YYLLOC_DEFAULT
917 # define YYLLOC_DEFAULT(Current, Rhs, N) \
921 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
922 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
923 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
924 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
928 (Current).first_line = (Current).last_line = \
929 YYRHSLOC (Rhs, 0).last_line; \
930 (Current).first_column = (Current).last_column = \
931 YYRHSLOC (Rhs, 0).last_column; \
937 /* YY_LOCATION_PRINT -- Print the location on the stream.
938 This macro was not mandated originally: define only if we know
939 we won't break user code: when these are the locations we know. */
941 #ifndef YY_LOCATION_PRINT
942 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
943 # define YY_LOCATION_PRINT(File, Loc) \
944 fprintf (File, "%d.%d-%d.%d", \
945 (Loc).first_line, (Loc).first_column, \
946 (Loc).last_line, (Loc).last_column)
948 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
953 /* YYLEX -- calling `yylex' with the right arguments. */
956 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
958 # define YYLEX yylex (&yylval, &yylloc)
961 /* Enable debugging if requested. */
965 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
966 # define YYFPRINTF fprintf
969 # define YYDPRINTF(Args) \
975 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
979 YYFPRINTF (stderr, "%s ", Title); \
980 yy_symbol_print (stderr, \
981 Type, Value, Location); \
982 YYFPRINTF (stderr, "\n"); \
987 /*--------------------------------.
988 | Print this symbol on YYOUTPUT. |
989 `--------------------------------*/
992 #if (defined __STDC__ || defined __C99__FUNC__ \
993 || defined __cplusplus || defined _MSC_VER)
995 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
998 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1001 YYSTYPE
const * const yyvaluep
;
1002 YYLTYPE
const * const yylocationp
;
1007 YYUSE (yylocationp
);
1009 if (yytype
< YYNTOKENS
)
1010 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1018 /* Line 751 of yacc.c */
1019 #line 176 "src/parse-gram.y"
1020 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
1021 /* Line 751 of yacc.c */
1022 #line 1023 "src/parse-gram.c"
1025 case 4: // "integer"
1027 /* Line 751 of yacc.c */
1028 #line 189 "src/parse-gram.y"
1029 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
1030 /* Line 751 of yacc.c */
1031 #line 1032 "src/parse-gram.c"
1034 case 24: // "%<flag>"
1036 /* Line 751 of yacc.c */
1037 #line 185 "src/parse-gram.y"
1038 { fprintf (stderr
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1039 /* Line 751 of yacc.c */
1040 #line 1041 "src/parse-gram.c"
1045 /* Line 751 of yacc.c */
1046 #line 178 "src/parse-gram.y"
1047 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1048 /* Line 751 of yacc.c */
1049 #line 1050 "src/parse-gram.c"
1052 case 42: // "[identifier]"
1054 /* Line 751 of yacc.c */
1055 #line 183 "src/parse-gram.y"
1056 { fprintf (stderr
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1057 /* Line 751 of yacc.c */
1058 #line 1059 "src/parse-gram.c"
1063 /* Line 751 of yacc.c */
1064 #line 170 "src/parse-gram.y"
1065 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
1066 /* Line 751 of yacc.c */
1067 #line 1068 "src/parse-gram.c"
1070 case 44: // "epilogue"
1072 /* Line 751 of yacc.c */
1073 #line 178 "src/parse-gram.y"
1074 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1075 /* Line 751 of yacc.c */
1076 #line 1077 "src/parse-gram.c"
1079 case 46: // "identifier"
1081 /* Line 751 of yacc.c */
1082 #line 182 "src/parse-gram.y"
1083 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1084 /* Line 751 of yacc.c */
1085 #line 1086 "src/parse-gram.c"
1088 case 47: // "identifier:"
1090 /* Line 751 of yacc.c */
1091 #line 184 "src/parse-gram.y"
1092 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
1093 /* Line 751 of yacc.c */
1094 #line 1095 "src/parse-gram.c"
1097 case 50: // "%{...%}"
1099 /* Line 751 of yacc.c */
1100 #line 178 "src/parse-gram.y"
1101 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1102 /* Line 751 of yacc.c */
1103 #line 1104 "src/parse-gram.c"
1108 /* Line 751 of yacc.c */
1109 #line 186 "src/parse-gram.y"
1110 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1111 /* Line 751 of yacc.c */
1112 #line 1113 "src/parse-gram.c"
1115 case 55: // "%param"
1117 /* Line 751 of yacc.c */
1118 #line 232 "src/parse-gram.y"
1120 switch (((*yyvaluep
).param
))
1122 #define CASE(In, Out) \
1123 case param_ ## In: fputs ("%" #Out, stderr); break
1124 CASE(lex
, lex
-param
);
1125 CASE(parse
, parse
-param
);
1128 case param_none
: aver (false); break;
1131 /* Line 751 of yacc.c */
1132 #line 1133 "src/parse-gram.c"
1135 case 72: // symbol.prec
1137 /* Line 751 of yacc.c */
1138 #line 192 "src/parse-gram.y"
1139 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1140 /* Line 751 of yacc.c */
1141 #line 1142 "src/parse-gram.c"
1144 case 85: // variable
1146 /* Line 751 of yacc.c */
1147 #line 182 "src/parse-gram.y"
1148 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1149 /* Line 751 of yacc.c */
1150 #line 1151 "src/parse-gram.c"
1153 case 86: // content.opt
1155 /* Line 751 of yacc.c */
1156 #line 178 "src/parse-gram.y"
1157 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1158 /* Line 751 of yacc.c */
1159 #line 1160 "src/parse-gram.c"
1162 case 87: // braceless
1164 /* Line 751 of yacc.c */
1165 #line 178 "src/parse-gram.y"
1166 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1167 /* Line 751 of yacc.c */
1168 #line 1169 "src/parse-gram.c"
1173 /* Line 751 of yacc.c */
1174 #line 192 "src/parse-gram.y"
1175 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1176 /* Line 751 of yacc.c */
1177 #line 1178 "src/parse-gram.c"
1180 case 89: // id_colon
1182 /* Line 751 of yacc.c */
1183 #line 193 "src/parse-gram.y"
1184 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1185 /* Line 751 of yacc.c */
1186 #line 1187 "src/parse-gram.c"
1191 /* Line 751 of yacc.c */
1192 #line 192 "src/parse-gram.y"
1193 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1194 /* Line 751 of yacc.c */
1195 #line 1196 "src/parse-gram.c"
1198 case 91: // string_as_id
1200 /* Line 751 of yacc.c */
1201 #line 192 "src/parse-gram.y"
1202 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1203 /* Line 751 of yacc.c */
1204 #line 1205 "src/parse-gram.c"
1213 /*--------------------------------.
1214 | Print this symbol on YYOUTPUT. |
1215 `--------------------------------*/
1217 #if (defined __STDC__ || defined __C99__FUNC__ \
1218 || defined __cplusplus || defined _MSC_VER)
1220 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1223 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1226 YYSTYPE
const * const yyvaluep
;
1227 YYLTYPE
const * const yylocationp
;
1230 if (yytype
< YYNTOKENS
)
1231 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1233 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1235 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1236 YYFPRINTF (yyoutput
, ": ");
1237 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1238 YYFPRINTF (yyoutput
, ")");
1241 /*------------------------------------------------------------------.
1242 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1244 `------------------------------------------------------------------*/
1246 #if (defined __STDC__ || defined __C99__FUNC__ \
1247 || defined __cplusplus || defined _MSC_VER)
1249 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1252 yy_stack_print (yybottom
, yytop
)
1253 yytype_int16
*yybottom
;
1254 yytype_int16
*yytop
;
1257 YYFPRINTF (stderr
, "Stack now");
1258 for (; yybottom
<= yytop
; yybottom
++)
1260 int yybot
= *yybottom
;
1261 YYFPRINTF (stderr
, " %d", yybot
);
1263 YYFPRINTF (stderr
, "\n");
1266 # define YY_STACK_PRINT(Bottom, Top) \
1269 yy_stack_print ((Bottom), (Top)); \
1273 /*------------------------------------------------.
1274 | Report that the YYRULE is going to be reduced. |
1275 `------------------------------------------------*/
1277 #if (defined __STDC__ || defined __C99__FUNC__ \
1278 || defined __cplusplus || defined _MSC_VER)
1280 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1283 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1284 yytype_int16
*yyssp
;
1290 unsigned long int yylno
= yyrline
[yyrule
];
1291 int yynrhs
= yyr2
[yyrule
];
1293 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1295 /* The symbols being reduced. */
1296 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1298 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1299 yy_symbol_print (stderr
,
1300 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1301 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1302 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1303 YYFPRINTF (stderr
, "\n");
1307 # define YY_REDUCE_PRINT(Rule) \
1310 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1313 /* Nonzero means print parse trace. It is left uninitialized so that
1314 multiple parsers can coexist. */
1316 #else /* !YYDEBUG */
1317 # define YYDPRINTF(Args)
1318 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1319 # define YY_STACK_PRINT(Bottom, Top)
1320 # define YY_REDUCE_PRINT(Rule)
1321 #endif /* !YYDEBUG */
1324 /* YYINITDEPTH -- initial size of the parser's stacks. */
1326 # define YYINITDEPTH 200
1329 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1330 if the built-in stack extension method is used).
1332 Do not make this value too large; the results are undefined if
1333 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1334 evaluated with infinite-precision integer arithmetic. */
1337 # define YYMAXDEPTH 10000
1340 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1341 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1342 stack, and such that *YYCAPACITY is the maximum number of elements it
1343 can hold without a reallocation, make sure there is enough room to
1344 store YYADD more elements. If not, allocate a new stack using
1345 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1346 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1347 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1348 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1349 required. Return 1 if memory is exhausted. */
1351 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1353 char const *yydebug_prefix
,
1354 char const *yydebug_suffix
,
1356 yytype_int16
**yybottom
,
1357 yytype_int16
*yybottom_no_free
,
1358 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1360 YYSIZE_T yysize_old
=
1361 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1362 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1363 if (*yycapacity
< yysize_new
)
1365 YYSIZE_T yyalloc
= 2 * yysize_new
;
1366 yytype_int16
*yybottom_new
;
1367 /* Use YYMAXDEPTH for maximum stack size given that the stack
1368 should never need to grow larger than the main state stack
1369 needs to grow without LAC. */
1370 if (YYMAXDEPTH
< yysize_new
)
1372 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1376 if (YYMAXDEPTH
< yyalloc
)
1377 yyalloc
= YYMAXDEPTH
;
1379 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1382 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1386 if (*yytop
!= yytop_empty
)
1388 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1389 *yytop
= yybottom_new
+ (yysize_old
- 1);
1391 if (*yybottom
!= yybottom_no_free
)
1392 YYSTACK_FREE (*yybottom
);
1393 *yybottom
= yybottom_new
;
1394 *yycapacity
= yyalloc
;
1399 /* Establish the initial context for the current lookahead if no initial
1400 context is currently established.
1402 We define a context as a snapshot of the parser stacks. We define
1403 the initial context for a lookahead as the context in which the
1404 parser initially examines that lookahead in order to select a
1405 syntactic action. Thus, if the lookahead eventually proves
1406 syntactically unacceptable (possibly in a later context reached via a
1407 series of reductions), the initial context can be used to determine
1408 the exact set of tokens that would be syntactically acceptable in the
1409 lookahead's place. Moreover, it is the context after which any
1410 further semantic actions would be erroneous because they would be
1411 determined by a syntactically unacceptable token.
1413 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1414 performed in an inconsistent state (which, for the purposes of LAC,
1415 includes consistent states that don't know they're consistent because
1416 their default reductions have been disabled). Iff there is a
1417 lookahead token, it should also be invoked before reporting a syntax
1418 error. This latter case is for the sake of the debugging output.
1420 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1421 follows. If no initial context is currently established for the
1422 current lookahead, then check if that lookahead can eventually be
1423 shifted if syntactic actions continue from the current context.
1424 Report a syntax error if it cannot. */
1425 #define YY_LAC_ESTABLISH \
1427 if (!yy_lac_established) \
1429 YYDPRINTF ((stderr, \
1430 "LAC: initial context established for %s\n", \
1431 yytname[yytoken])); \
1432 yy_lac_established = 1; \
1434 int yy_lac_status = \
1435 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1436 if (yy_lac_status == 2) \
1437 goto yyexhaustedlab; \
1438 if (yy_lac_status == 1) \
1444 /* Discard any previous initial lookahead context because of Event,
1445 which may be a lookahead change or an invalidation of the currently
1446 established initial context for the current lookahead.
1448 The most common example of a lookahead change is a shift. An example
1449 of both cases is syntax error recovery. That is, a syntax error
1450 occurs when the lookahead is syntactically erroneous for the
1451 currently established initial context, so error recovery manipulates
1452 the parser stacks to try to find a new initial context in which the
1453 current lookahead is syntactically acceptable. If it fails to find
1454 such a context, it discards the lookahead. */
1456 # define YY_LAC_DISCARD(Event) \
1458 if (yy_lac_established) \
1461 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1463 yy_lac_established = 0; \
1467 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1470 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1471 eventually (after perhaps some reductions) be shifted, return 1 if
1472 not, or return 2 if memory is exhausted. As preconditions and
1473 postconditions: *YYES_CAPACITY is the allocated size of the array to
1474 which *YYES points, and either *YYES = YYESA or *YYES points to an
1475 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1476 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1477 any old *YYES other than YYESA. */
1479 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1480 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1482 yytype_int16
*yyes_prev
= yyssp
;
1483 yytype_int16
*yyesp
= yyes_prev
;
1484 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1485 if (yytoken
== YYUNDEFTOK
)
1487 YYDPRINTF ((stderr
, " Always Err\n"));
1492 int yyrule
= yypact
[*yyesp
];
1493 if (yypact_value_is_default (yyrule
)
1494 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1495 || yycheck
[yyrule
] != yytoken
)
1497 yyrule
= yydefact
[*yyesp
];
1500 YYDPRINTF ((stderr
, " Err\n"));
1506 yyrule
= yytable
[yyrule
];
1507 if (yytable_value_is_error (yyrule
))
1509 YYDPRINTF ((stderr
, " Err\n"));
1514 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1520 YYSIZE_T yylen
= yyr2
[yyrule
];
1521 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1522 if (yyesp
!= yyes_prev
)
1524 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1537 yyesp
= yyes_prev
-= yylen
;
1542 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1543 yystate
= yypgoto
[yylhs
] + *yyesp
;
1544 if (yystate
< 0 || YYLAST
< yystate
1545 || yycheck
[yystate
] != *yyesp
)
1546 yystate
= yydefgoto
[yylhs
];
1548 yystate
= yytable
[yystate
];
1550 if (yyesp
== yyes_prev
)
1557 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1561 yyes
, yyesa
, &yyesp
, yyes_prev
))
1563 YYDPRINTF ((stderr
, "\n"));
1568 YYDPRINTF ((stderr
, " G%d", *yyesp
));
1577 # if defined __GLIBC__ && defined _STRING_H
1578 # define yystrlen strlen
1580 /* Return the length of YYSTR. */
1581 #if (defined __STDC__ || defined __C99__FUNC__ \
1582 || defined __cplusplus || defined _MSC_VER)
1584 yystrlen (const char *yystr
)
1592 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1600 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1601 # define yystpcpy stpcpy
1603 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1605 #if (defined __STDC__ || defined __C99__FUNC__ \
1606 || defined __cplusplus || defined _MSC_VER)
1608 yystpcpy (char *yydest
, const char *yysrc
)
1611 yystpcpy (yydest
, yysrc
)
1617 const char *yys
= yysrc
;
1619 while ((*yyd
++ = *yys
++) != '\0')
1628 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1629 quotes and backslashes, so that it's suitable for yyerror. The
1630 heuristic is that double-quoting is unnecessary unless the string
1631 contains an apostrophe, a comma, or backslash (other than
1632 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1633 null, do not copy; instead, return the length of what the result
1636 yytnamerr (char *yyres
, const char *yystr
)
1641 char const *yyp
= yystr
;
1648 goto do_not_strip_quotes
;
1652 goto do_not_strip_quotes
;
1665 do_not_strip_quotes
: ;
1669 return yystrlen (yystr
);
1671 return yystpcpy (yyres
, yystr
) - yyres
;
1675 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1676 about the unexpected token YYTOKEN for the state stack whose top is
1677 YYSSP. In order to see if a particular token T is a
1678 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1680 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1681 not large enough to hold the message. In that case, also set
1682 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1683 required number of bytes is too large to store or if
1684 yy_lac returned 2. */
1686 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1687 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1688 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1690 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1691 YYSIZE_T yysize
= yysize0
;
1693 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1694 /* Internationalized format string. */
1695 const char *yyformat
= 0;
1696 /* Arguments of yyformat. */
1697 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1698 /* Number of reported tokens (one for the "unexpected", one per
1702 /* There are many possibilities here to consider:
1703 - Assume YYFAIL is not used. It's too flawed to consider. See
1704 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1705 for details. YYERROR is fine as it does not invoke this
1707 - If this state is a consistent state with a default action, then
1708 the only way this function was invoked is if the default action
1709 is an error action. In that case, don't check for expected
1710 tokens because there are none.
1711 - The only way there can be no lookahead present (in yychar) is if
1712 this state is a consistent state with a default action. Thus,
1713 detecting the absence of a lookahead is sufficient to determine
1714 that there is no unexpected or expected token to report. In that
1715 case, just report a simple "syntax error".
1716 - Don't assume there isn't a lookahead just because this state is a
1717 consistent state with a default action. There might have been a
1718 previous inconsistent state, consistent state with a non-default
1719 action, or user semantic action that manipulated yychar.
1720 In the first two cases, it might appear that the current syntax
1721 error should have been detected in the previous state when yy_lac
1722 was invoked. However, at that time, there might have been a
1723 different syntax error that discarded a different initial context
1724 during error recovery, leaving behind the current lookahead.
1726 if (yytoken
!= YYEMPTY
)
1728 int yyn
= yypact
[*yyssp
];
1729 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1730 yyarg
[yycount
++] = yytname
[yytoken
];
1731 if (!yypact_value_is_default (yyn
))
1735 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1736 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1739 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1741 if (yy_lac_status
== 2)
1743 if (yy_lac_status
== 1)
1746 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1752 yyarg
[yycount
++] = yytname
[yyx
];
1753 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1754 if (! (yysize
<= yysize1
1755 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1762 YYFPRINTF (stderr
, "No expected tokens.\n");
1768 # define YYCASE_(N, S) \
1772 YYCASE_(0, YY_("syntax error"));
1773 YYCASE_(1, YY_("syntax error, unexpected %s"));
1774 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1775 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1776 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1777 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1781 yysize1
= yysize
+ yystrlen (yyformat
);
1782 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1786 if (*yymsg_alloc
< yysize
)
1788 *yymsg_alloc
= 2 * yysize
;
1789 if (! (yysize
<= *yymsg_alloc
1790 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1791 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1795 /* Avoid sprintf, as that infringes on the user's name space.
1796 Don't have undefined behavior even if the translation
1797 produced a string with the wrong number of "%s"s. */
1801 while ((*yyp
= *yyformat
) != '\0')
1802 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1804 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1815 #endif /* YYERROR_VERBOSE */
1817 /*-----------------------------------------------.
1818 | Release the memory associated to this symbol. |
1819 `-----------------------------------------------*/
1822 #if (defined __STDC__ || defined __C99__FUNC__ \
1823 || defined __cplusplus || defined _MSC_VER)
1825 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1828 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1832 YYLTYPE
*yylocationp
;
1836 YYUSE (yylocationp
);
1840 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1850 /* Prevent warnings from -Wmissing-prototypes. */
1851 #ifdef YYPARSE_PARAM
1852 #if (defined __STDC__ || defined __C99__FUNC__ \
1853 || defined __cplusplus || defined _MSC_VER)
1854 int yyparse (void *YYPARSE_PARAM
);
1858 #else /* ! YYPARSE_PARAM */
1859 #if (defined __STDC__ || defined __C99__FUNC__ \
1860 || defined __cplusplus || defined _MSC_VER)
1865 #endif /* ! YYPARSE_PARAM */
1872 #ifdef YYPARSE_PARAM
1873 #if (defined __STDC__ || defined __C99__FUNC__ \
1874 || defined __cplusplus || defined _MSC_VER)
1876 yyparse (void *YYPARSE_PARAM
)
1879 yyparse (YYPARSE_PARAM
)
1880 void *YYPARSE_PARAM
;
1882 #else /* ! YYPARSE_PARAM */
1883 #if (defined __STDC__ || defined __C99__FUNC__ \
1884 || defined __cplusplus || defined _MSC_VER)
1894 /* The lookahead symbol. */
1897 /* The semantic value of the lookahead symbol. */
1900 /* Location data for the lookahead symbol. */
1903 /* Number of syntax errors so far. */
1907 /* Number of tokens to shift before error messages enabled. */
1910 /* The stacks and their tools:
1911 `yyss': related to states.
1912 `yyvs': related to semantic values.
1913 `yyls': related to locations.
1915 Refer to the stacks thru separate pointers, to allow yyoverflow
1916 to reallocate them elsewhere. */
1918 /* The state stack. */
1919 yytype_int16 yyssa
[YYINITDEPTH
];
1921 yytype_int16
*yyssp
;
1923 /* The semantic value stack. */
1924 YYSTYPE yyvsa
[YYINITDEPTH
];
1928 /* The location stack. */
1929 YYLTYPE yylsa
[YYINITDEPTH
];
1933 /* The locations where the error started and ended. */
1934 YYLTYPE yyerror_range
[3];
1936 YYSIZE_T yystacksize
;
1938 yytype_int16 yyesa
[20];
1940 YYSIZE_T yyes_capacity
;
1942 int yy_lac_established
= 0;
1945 /* Lookahead token as an internal (translated) token number. */
1947 /* The variables used to return semantic value and location from the
1953 /* Buffer for error messages, and its allocated size. */
1955 char *yymsg
= yymsgbuf
;
1956 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1959 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1961 /* The number of symbols on the RHS of the reduced rule.
1962 Keep to zero when no symbol should be popped. */
1969 yystacksize
= YYINITDEPTH
;
1972 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1973 if (YYMAXDEPTH
< yyes_capacity
)
1974 yyes_capacity
= YYMAXDEPTH
;
1976 YYDPRINTF ((stderr
, "Starting parse\n"));
1981 yychar
= YYEMPTY
; /* Cause a token to be read. */
1983 /* Initialize stack pointers.
1984 Waste one element of value and location stack
1985 so that they stay on the same level as the state stack.
1986 The wasted elements are never initialized. */
1991 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1992 /* Initialize the default location before parsing starts. */
1993 yylloc
.first_line
= yylloc
.last_line
= 1;
1994 yylloc
.first_column
= yylloc
.last_column
= 1;
1997 /* User initialization code. */
1998 /* Line 1525 of yacc.c */
1999 #line 81 "src/parse-gram.y"
2001 /* Bison's grammar can initial empty locations, hence a default
2002 location is needed. */
2003 boundary_set (&yylloc
.start
, current_file
, 1, 1);
2004 boundary_set (&yylloc
.end
, current_file
, 1, 1);
2006 /* Line 1525 of yacc.c */
2007 #line 2008 "src/parse-gram.c"
2012 /*------------------------------------------------------------.
2013 | yynewstate -- Push a new state, which is found in yystate. |
2014 `------------------------------------------------------------*/
2016 /* In all cases, when you get here, the value and location stacks
2017 have just been pushed. So pushing a state here evens the stacks. */
2023 if (yyss
+ yystacksize
- 1 <= yyssp
)
2025 /* Get the current used size of the three stacks, in elements. */
2026 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2030 /* Give user a chance to reallocate the stack. Use copies of
2031 these so that the &'s don't force the real ones into
2033 YYSTYPE
*yyvs1
= yyvs
;
2034 yytype_int16
*yyss1
= yyss
;
2035 YYLTYPE
*yyls1
= yyls
;
2037 /* Each stack pointer address is followed by the size of the
2038 data in use in that stack, in bytes. This used to be a
2039 conditional around just the two extra args, but that might
2040 be undefined if yyoverflow is a macro. */
2041 yyoverflow (YY_("memory exhausted"),
2042 &yyss1
, yysize
* sizeof (*yyssp
),
2043 &yyvs1
, yysize
* sizeof (*yyvsp
),
2044 &yyls1
, yysize
* sizeof (*yylsp
),
2051 #else /* no yyoverflow */
2052 # ifndef YYSTACK_RELOCATE
2053 goto yyexhaustedlab
;
2055 /* Extend the stack our own way. */
2056 if (YYMAXDEPTH
<= yystacksize
)
2057 goto yyexhaustedlab
;
2059 if (YYMAXDEPTH
< yystacksize
)
2060 yystacksize
= YYMAXDEPTH
;
2063 yytype_int16
*yyss1
= yyss
;
2064 union yyalloc
*yyptr
=
2065 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2067 goto yyexhaustedlab
;
2068 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2069 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2070 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2071 # undef YYSTACK_RELOCATE
2073 YYSTACK_FREE (yyss1
);
2076 #endif /* no yyoverflow */
2078 yyssp
= yyss
+ yysize
- 1;
2079 yyvsp
= yyvs
+ yysize
- 1;
2080 yylsp
= yyls
+ yysize
- 1;
2082 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2083 (unsigned long int) yystacksize
));
2085 if (yyss
+ yystacksize
- 1 <= yyssp
)
2089 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2091 if (yystate
== YYFINAL
)
2101 /* Do appropriate processing given the current state. Read a
2102 lookahead token if we need one and don't already have one. */
2104 /* First try to decide what to do without reference to lookahead token. */
2105 yyn
= yypact
[yystate
];
2106 if (yypact_value_is_default (yyn
))
2109 /* Not known => get a lookahead token if don't already have one. */
2111 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2112 if (yychar
== YYEMPTY
)
2114 YYDPRINTF ((stderr
, "Reading a token: "));
2118 if (yychar
<= YYEOF
)
2120 yychar
= yytoken
= YYEOF
;
2121 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2125 yytoken
= YYTRANSLATE (yychar
);
2126 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2129 /* If the proper action on seeing token YYTOKEN is to reduce or to
2130 detect an error, take that action. */
2132 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2140 if (yytable_value_is_error (yyn
))
2147 /* Count tokens shifted since error; after three, turn off error
2152 /* Shift the lookahead token. */
2153 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2155 /* Discard the shifted token. */
2157 YY_LAC_DISCARD ("shift");
2165 /*-----------------------------------------------------------.
2166 | yydefault -- do the default action for the current state. |
2167 `-----------------------------------------------------------*/
2169 yyn
= yydefact
[yystate
];
2175 /*-----------------------------.
2176 | yyreduce -- Do a reduction. |
2177 `-----------------------------*/
2179 /* yyn is the number of a rule to reduce with. */
2182 /* If YYLEN is nonzero, implement the default value of the action:
2185 Otherwise, the following line sets YYVAL to garbage.
2186 This behavior is undocumented and Bison
2187 users should not rely upon it. Assigning to YYVAL
2188 unconditionally makes the parser a bit smaller, and it avoids a
2189 GCC warning that YYVAL may be used uninitialized. */
2190 yyval
= yyvsp
[1-yylen
];
2192 /* Default location. */
2193 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2194 YY_REDUCE_PRINT (yyn
);
2196 int yychar_backup
= yychar
;
2200 /* Line 1741 of yacc.c */
2201 #line 268 "src/parse-gram.y"
2203 code_props plain_code
;
2204 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2205 code_props_translate_code (&plain_code
);
2206 gram_scanner_last_string_free ();
2207 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2208 plain_code
.code
, (yylsp
[0]));
2209 code_scanner_last_string_free ();
2211 /* Line 1741 of yacc.c */
2212 #line 2213 "src/parse-gram.c"
2216 /* Line 1741 of yacc.c */
2217 #line 278 "src/parse-gram.y"
2219 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2221 /* Line 1741 of yacc.c */
2222 #line 2223 "src/parse-gram.c"
2226 /* Line 1741 of yacc.c */
2227 #line 282 "src/parse-gram.y"
2229 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2230 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2232 /* Line 1741 of yacc.c */
2233 #line 2234 "src/parse-gram.c"
2237 /* Line 1741 of yacc.c */
2238 #line 286 "src/parse-gram.y"
2239 { defines_flag
= true; }
2240 /* Line 1741 of yacc.c */
2241 #line 2242 "src/parse-gram.c"
2245 /* Line 1741 of yacc.c */
2246 #line 288 "src/parse-gram.y"
2248 defines_flag
= true;
2249 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2251 /* Line 1741 of yacc.c */
2252 #line 2253 "src/parse-gram.c"
2256 /* Line 1741 of yacc.c */
2257 #line 293 "src/parse-gram.y"
2259 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2260 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2262 /* Line 1741 of yacc.c */
2263 #line 2264 "src/parse-gram.c"
2267 /* Line 1741 of yacc.c */
2268 #line 297 "src/parse-gram.y"
2269 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2270 /* Line 1741 of yacc.c */
2271 #line 2272 "src/parse-gram.c"
2275 /* Line 1741 of yacc.c */
2276 #line 298 "src/parse-gram.y"
2277 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2278 /* Line 1741 of yacc.c */
2279 #line 2280 "src/parse-gram.c"
2283 /* Line 1741 of yacc.c */
2284 #line 299 "src/parse-gram.y"
2285 { spec_file_prefix
= (yyvsp
[0].chars
); }
2286 /* Line 1741 of yacc.c */
2287 #line 2288 "src/parse-gram.c"
2291 /* Line 1741 of yacc.c */
2292 #line 300 "src/parse-gram.y"
2293 { spec_file_prefix
= (yyvsp
[0].chars
); }
2294 /* Line 1741 of yacc.c */
2295 #line 2296 "src/parse-gram.c"
2299 /* Line 1741 of yacc.c */
2300 #line 302 "src/parse-gram.y"
2302 nondeterministic_parser
= true;
2305 /* Line 1741 of yacc.c */
2306 #line 2307 "src/parse-gram.c"
2310 /* Line 1741 of yacc.c */
2311 #line 307 "src/parse-gram.y"
2314 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2315 code_props_translate_code (&action
);
2316 gram_scanner_last_string_free ();
2317 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2318 code_scanner_last_string_free ();
2320 /* Line 1741 of yacc.c */
2321 #line 2322 "src/parse-gram.c"
2325 /* Line 1741 of yacc.c */
2326 #line 315 "src/parse-gram.y"
2327 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2328 /* Line 1741 of yacc.c */
2329 #line 2330 "src/parse-gram.c"
2333 /* Line 1741 of yacc.c */
2334 #line 316 "src/parse-gram.y"
2335 { spec_name_prefix
= (yyvsp
[0].chars
); }
2336 /* Line 1741 of yacc.c */
2337 #line 2338 "src/parse-gram.c"
2341 /* Line 1741 of yacc.c */
2342 #line 317 "src/parse-gram.y"
2343 { spec_name_prefix
= (yyvsp
[0].chars
); }
2344 /* Line 1741 of yacc.c */
2345 #line 2346 "src/parse-gram.c"
2349 /* Line 1741 of yacc.c */
2350 #line 318 "src/parse-gram.y"
2351 { no_lines_flag
= true; }
2352 /* Line 1741 of yacc.c */
2353 #line 2354 "src/parse-gram.c"
2357 /* Line 1741 of yacc.c */
2358 #line 319 "src/parse-gram.y"
2359 { nondeterministic_parser
= true; }
2360 /* Line 1741 of yacc.c */
2361 #line 2362 "src/parse-gram.c"
2365 /* Line 1741 of yacc.c */
2366 #line 320 "src/parse-gram.y"
2367 { spec_outfile
= (yyvsp
[0].chars
); }
2368 /* Line 1741 of yacc.c */
2369 #line 2370 "src/parse-gram.c"
2373 /* Line 1741 of yacc.c */
2374 #line 321 "src/parse-gram.y"
2375 { spec_outfile
= (yyvsp
[0].chars
); }
2376 /* Line 1741 of yacc.c */
2377 #line 2378 "src/parse-gram.c"
2381 /* Line 1741 of yacc.c */
2382 #line 322 "src/parse-gram.y"
2383 { current_param
= (yyvsp
[0].param
); }
2384 /* Line 1741 of yacc.c */
2385 #line 2386 "src/parse-gram.c"
2389 /* Line 1741 of yacc.c */
2390 #line 322 "src/parse-gram.y"
2391 { current_param
= param_none
; }
2392 /* Line 1741 of yacc.c */
2393 #line 2394 "src/parse-gram.c"
2397 /* Line 1741 of yacc.c */
2398 #line 323 "src/parse-gram.y"
2399 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2400 /* Line 1741 of yacc.c */
2401 #line 2402 "src/parse-gram.c"
2405 /* Line 1741 of yacc.c */
2406 #line 325 "src/parse-gram.y"
2408 char const *skeleton_user
= (yyvsp
[0].chars
);
2409 if (strchr (skeleton_user
, '/'))
2411 size_t dir_length
= strlen (current_file
);
2412 char *skeleton_build
;
2413 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2415 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2418 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2421 strncpy (skeleton_build
, current_file
, dir_length
);
2422 skeleton_build
[dir_length
++] = '/';
2424 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2425 skeleton_user
= uniqstr_new (skeleton_build
);
2426 free (skeleton_build
);
2428 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2430 /* Line 1741 of yacc.c */
2431 #line 2432 "src/parse-gram.c"
2435 /* Line 1741 of yacc.c */
2436 #line 348 "src/parse-gram.y"
2437 { token_table_flag
= true; }
2438 /* Line 1741 of yacc.c */
2439 #line 2440 "src/parse-gram.c"
2443 /* Line 1741 of yacc.c */
2444 #line 349 "src/parse-gram.y"
2445 { report_flag
|= report_states
; }
2446 /* Line 1741 of yacc.c */
2447 #line 2448 "src/parse-gram.c"
2451 /* Line 1741 of yacc.c */
2452 #line 350 "src/parse-gram.y"
2453 { yacc_flag
= true; }
2454 /* Line 1741 of yacc.c */
2455 #line 2456 "src/parse-gram.c"
2459 /* Line 1741 of yacc.c */
2460 #line 355 "src/parse-gram.y"
2461 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2462 /* Line 1741 of yacc.c */
2463 #line 2464 "src/parse-gram.c"
2467 /* Line 1741 of yacc.c */
2468 #line 356 "src/parse-gram.y"
2469 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2470 /* Line 1741 of yacc.c */
2471 #line 2472 "src/parse-gram.c"
2475 /* Line 1741 of yacc.c */
2476 #line 368 "src/parse-gram.y"
2478 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2480 /* Line 1741 of yacc.c */
2481 #line 2482 "src/parse-gram.c"
2485 /* Line 1741 of yacc.c */
2486 #line 372 "src/parse-gram.y"
2489 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2490 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2491 symbol_list_free ((yyvsp
[0].list
));
2493 /* Line 1741 of yacc.c */
2494 #line 2495 "src/parse-gram.c"
2498 /* Line 1741 of yacc.c */
2499 #line 379 "src/parse-gram.y"
2502 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2503 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2504 symbol_list_free ((yyvsp
[0].list
));
2506 /* Line 1741 of yacc.c */
2507 #line 2508 "src/parse-gram.c"
2511 /* Line 1741 of yacc.c */
2512 #line 386 "src/parse-gram.y"
2514 default_prec
= true;
2516 /* Line 1741 of yacc.c */
2517 #line 2518 "src/parse-gram.c"
2521 /* Line 1741 of yacc.c */
2522 #line 390 "src/parse-gram.y"
2524 default_prec
= false;
2526 /* Line 1741 of yacc.c */
2527 #line 2528 "src/parse-gram.c"
2531 /* Line 1741 of yacc.c */
2532 #line 394 "src/parse-gram.y"
2534 /* Do not invoke muscle_percent_code_grow here since it invokes
2535 muscle_user_name_list_grow. */
2536 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2537 code_scanner_last_string_free ();
2539 /* Line 1741 of yacc.c */
2540 #line 2541 "src/parse-gram.c"
2544 /* Line 1741 of yacc.c */
2545 #line 401 "src/parse-gram.y"
2547 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2548 code_scanner_last_string_free ();
2550 /* Line 1741 of yacc.c */
2551 #line 2552 "src/parse-gram.c"
2555 /* Line 1741 of yacc.c */
2556 #line 415 "src/parse-gram.y"
2558 /* Line 1741 of yacc.c */
2559 #line 2560 "src/parse-gram.c"
2563 /* Line 1741 of yacc.c */
2564 #line 416 "src/parse-gram.y"
2565 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2566 /* Line 1741 of yacc.c */
2567 #line 2568 "src/parse-gram.c"
2571 /* Line 1741 of yacc.c */
2572 #line 421 "src/parse-gram.y"
2575 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2576 code_scanner_last_string_free ();
2578 /* Line 1741 of yacc.c */
2579 #line 2580 "src/parse-gram.c"
2583 /* Line 1741 of yacc.c */
2584 #line 432 "src/parse-gram.y"
2585 { current_class
= nterm_sym
; }
2586 /* Line 1741 of yacc.c */
2587 #line 2588 "src/parse-gram.c"
2591 /* Line 1741 of yacc.c */
2592 #line 433 "src/parse-gram.y"
2594 current_class
= unknown_sym
;
2595 current_type
= NULL
;
2597 /* Line 1741 of yacc.c */
2598 #line 2599 "src/parse-gram.c"
2602 /* Line 1741 of yacc.c */
2603 #line 437 "src/parse-gram.y"
2604 { current_class
= token_sym
; }
2605 /* Line 1741 of yacc.c */
2606 #line 2607 "src/parse-gram.c"
2610 /* Line 1741 of yacc.c */
2611 #line 438 "src/parse-gram.y"
2613 current_class
= unknown_sym
;
2614 current_type
= NULL
;
2616 /* Line 1741 of yacc.c */
2617 #line 2618 "src/parse-gram.c"
2621 /* Line 1741 of yacc.c */
2622 #line 443 "src/parse-gram.y"
2626 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2627 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2628 symbol_list_free ((yyvsp
[0].list
));
2630 /* Line 1741 of yacc.c */
2631 #line 2632 "src/parse-gram.c"
2635 /* Line 1741 of yacc.c */
2636 #line 454 "src/parse-gram.y"
2640 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2642 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2643 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2645 symbol_list_free ((yyvsp
[0].list
));
2646 current_type
= NULL
;
2648 /* Line 1741 of yacc.c */
2649 #line 2650 "src/parse-gram.c"
2653 /* Line 1741 of yacc.c */
2654 #line 468 "src/parse-gram.y"
2655 { (yyval
.assoc
) = left_assoc
; }
2656 /* Line 1741 of yacc.c */
2657 #line 2658 "src/parse-gram.c"
2661 /* Line 1741 of yacc.c */
2662 #line 469 "src/parse-gram.y"
2663 { (yyval
.assoc
) = right_assoc
; }
2664 /* Line 1741 of yacc.c */
2665 #line 2666 "src/parse-gram.c"
2669 /* Line 1741 of yacc.c */
2670 #line 470 "src/parse-gram.y"
2671 { (yyval
.assoc
) = non_assoc
; }
2672 /* Line 1741 of yacc.c */
2673 #line 2674 "src/parse-gram.c"
2677 /* Line 1741 of yacc.c */
2678 #line 471 "src/parse-gram.y"
2679 { (yyval
.assoc
) = precedence_assoc
; }
2680 /* Line 1741 of yacc.c */
2681 #line 2682 "src/parse-gram.c"
2685 /* Line 1741 of yacc.c */
2686 #line 475 "src/parse-gram.y"
2687 { current_type
= NULL
; }
2688 /* Line 1741 of yacc.c */
2689 #line 2690 "src/parse-gram.c"
2693 /* Line 1741 of yacc.c */
2694 #line 476 "src/parse-gram.y"
2695 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2696 /* Line 1741 of yacc.c */
2697 #line 2698 "src/parse-gram.c"
2701 /* Line 1741 of yacc.c */
2702 #line 482 "src/parse-gram.y"
2703 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2704 /* Line 1741 of yacc.c */
2705 #line 2706 "src/parse-gram.c"
2709 /* Line 1741 of yacc.c */
2710 #line 484 "src/parse-gram.y"
2711 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2712 /* Line 1741 of yacc.c */
2713 #line 2714 "src/parse-gram.c"
2717 /* Line 1741 of yacc.c */
2718 #line 488 "src/parse-gram.y"
2719 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2720 /* Line 1741 of yacc.c */
2721 #line 2722 "src/parse-gram.c"
2725 /* Line 1741 of yacc.c */
2726 #line 489 "src/parse-gram.y"
2727 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2728 /* Line 1741 of yacc.c */
2729 #line 2730 "src/parse-gram.c"
2733 /* Line 1741 of yacc.c */
2734 #line 495 "src/parse-gram.y"
2735 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2736 /* Line 1741 of yacc.c */
2737 #line 2738 "src/parse-gram.c"
2741 /* Line 1741 of yacc.c */
2742 #line 497 "src/parse-gram.y"
2743 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2744 /* Line 1741 of yacc.c */
2745 #line 2746 "src/parse-gram.c"
2749 /* Line 1741 of yacc.c */
2750 #line 501 "src/parse-gram.y"
2751 { (yyval
.list
) = (yyvsp
[0].list
); }
2752 /* Line 1741 of yacc.c */
2753 #line 2754 "src/parse-gram.c"
2757 /* Line 1741 of yacc.c */
2758 #line 502 "src/parse-gram.y"
2759 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2760 /* Line 1741 of yacc.c */
2761 #line 2762 "src/parse-gram.c"
2765 /* Line 1741 of yacc.c */
2766 #line 506 "src/parse-gram.y"
2767 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2768 /* Line 1741 of yacc.c */
2769 #line 2770 "src/parse-gram.c"
2773 /* Line 1741 of yacc.c */
2774 #line 507 "src/parse-gram.y"
2775 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2776 /* Line 1741 of yacc.c */
2777 #line 2778 "src/parse-gram.c"
2781 /* Line 1741 of yacc.c */
2782 #line 508 "src/parse-gram.y"
2783 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2784 /* Line 1741 of yacc.c */
2785 #line 2786 "src/parse-gram.c"
2789 /* Line 1741 of yacc.c */
2790 #line 509 "src/parse-gram.y"
2791 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2792 /* Line 1741 of yacc.c */
2793 #line 2794 "src/parse-gram.c"
2797 /* Line 1741 of yacc.c */
2798 #line 515 "src/parse-gram.y"
2800 current_type
= (yyvsp
[0].uniqstr
);
2803 /* Line 1741 of yacc.c */
2804 #line 2805 "src/parse-gram.c"
2808 /* Line 1741 of yacc.c */
2809 #line 520 "src/parse-gram.y"
2811 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2812 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2814 /* Line 1741 of yacc.c */
2815 #line 2816 "src/parse-gram.c"
2819 /* Line 1741 of yacc.c */
2820 #line 525 "src/parse-gram.y"
2822 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2823 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2824 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2826 /* Line 1741 of yacc.c */
2827 #line 2828 "src/parse-gram.c"
2831 /* Line 1741 of yacc.c */
2832 #line 531 "src/parse-gram.y"
2834 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2835 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2836 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2838 /* Line 1741 of yacc.c */
2839 #line 2840 "src/parse-gram.c"
2843 /* Line 1741 of yacc.c */
2844 #line 537 "src/parse-gram.y"
2846 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2847 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2848 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2849 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2851 /* Line 1741 of yacc.c */
2852 #line 2853 "src/parse-gram.c"
2856 /* Line 1741 of yacc.c */
2857 #line 567 "src/parse-gram.y"
2861 /* Line 1741 of yacc.c */
2862 #line 2863 "src/parse-gram.c"
2866 /* Line 1741 of yacc.c */
2867 #line 573 "src/parse-gram.y"
2868 { current_lhs
= (yyvsp
[-1].symbol
); current_lhs_location
= (yylsp
[-1]);
2869 current_lhs_named_ref
= (yyvsp
[0].named_ref
); }
2870 /* Line 1741 of yacc.c */
2871 #line 2872 "src/parse-gram.c"
2875 /* Line 1741 of yacc.c */
2876 #line 578 "src/parse-gram.y"
2877 { grammar_current_rule_end ((yylsp
[0])); }
2878 /* Line 1741 of yacc.c */
2879 #line 2880 "src/parse-gram.c"
2883 /* Line 1741 of yacc.c */
2884 #line 579 "src/parse-gram.y"
2885 { grammar_current_rule_end ((yylsp
[0])); }
2886 /* Line 1741 of yacc.c */
2887 #line 2888 "src/parse-gram.c"
2891 /* Line 1741 of yacc.c */
2892 #line 585 "src/parse-gram.y"
2893 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2894 current_lhs_named_ref
); }
2895 /* Line 1741 of yacc.c */
2896 #line 2897 "src/parse-gram.c"
2900 /* Line 1741 of yacc.c */
2901 #line 588 "src/parse-gram.y"
2902 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2903 /* Line 1741 of yacc.c */
2904 #line 2905 "src/parse-gram.c"
2908 /* Line 1741 of yacc.c */
2909 #line 590 "src/parse-gram.y"
2910 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2911 /* Line 1741 of yacc.c */
2912 #line 2913 "src/parse-gram.c"
2916 /* Line 1741 of yacc.c */
2917 #line 592 "src/parse-gram.y"
2918 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2919 /* Line 1741 of yacc.c */
2920 #line 2921 "src/parse-gram.c"
2924 /* Line 1741 of yacc.c */
2925 #line 594 "src/parse-gram.y"
2926 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2927 /* Line 1741 of yacc.c */
2928 #line 2929 "src/parse-gram.c"
2932 /* Line 1741 of yacc.c */
2933 #line 596 "src/parse-gram.y"
2934 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2935 /* Line 1741 of yacc.c */
2936 #line 2937 "src/parse-gram.c"
2940 /* Line 1741 of yacc.c */
2941 #line 598 "src/parse-gram.y"
2942 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2943 /* Line 1741 of yacc.c */
2944 #line 2945 "src/parse-gram.c"
2948 /* Line 1741 of yacc.c */
2949 #line 602 "src/parse-gram.y"
2950 { (yyval
.named_ref
) = 0; }
2951 /* Line 1741 of yacc.c */
2952 #line 2953 "src/parse-gram.c"
2956 /* Line 1741 of yacc.c */
2957 #line 604 "src/parse-gram.y"
2958 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2959 /* Line 1741 of yacc.c */
2960 #line 2961 "src/parse-gram.c"
2964 /* Line 1741 of yacc.c */
2965 #line 615 "src/parse-gram.y"
2966 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2967 /* Line 1741 of yacc.c */
2968 #line 2969 "src/parse-gram.c"
2972 /* Line 1741 of yacc.c */
2973 #line 620 "src/parse-gram.y"
2974 { (yyval
.chars
) = ""; }
2975 /* Line 1741 of yacc.c */
2976 #line 2977 "src/parse-gram.c"
2980 /* Line 1741 of yacc.c */
2981 #line 621 "src/parse-gram.y"
2982 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2983 /* Line 1741 of yacc.c */
2984 #line 2985 "src/parse-gram.c"
2988 /* Line 1741 of yacc.c */
2989 #line 632 "src/parse-gram.y"
2991 code_props plain_code
;
2992 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2993 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2994 code_props_translate_code (&plain_code
);
2995 gram_scanner_last_string_free ();
2996 (yyval
.chars
) = plain_code
.code
;
2998 /* Line 1741 of yacc.c */
2999 #line 3000 "src/parse-gram.c"
3003 /* Line 1741 of yacc.c */
3004 #line 652 "src/parse-gram.y"
3005 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
3006 /* Line 1741 of yacc.c */
3007 #line 3008 "src/parse-gram.c"
3011 /* Line 1741 of yacc.c */
3012 #line 654 "src/parse-gram.y"
3014 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
3015 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
3016 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
3018 /* Line 1741 of yacc.c */
3019 #line 3020 "src/parse-gram.c"
3023 /* Line 1741 of yacc.c */
3024 #line 662 "src/parse-gram.y"
3025 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
3026 /* Line 1741 of yacc.c */
3027 #line 3028 "src/parse-gram.c"
3031 /* Line 1741 of yacc.c */
3032 #line 674 "src/parse-gram.y"
3034 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
3035 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
3037 /* Line 1741 of yacc.c */
3038 #line 3039 "src/parse-gram.c"
3042 /* Line 1741 of yacc.c */
3043 #line 683 "src/parse-gram.y"
3045 code_props plain_code
;
3046 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
3047 code_props_translate_code (&plain_code
);
3048 gram_scanner_last_string_free ();
3049 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
3050 code_scanner_last_string_free ();
3052 /* Line 1741 of yacc.c */
3053 #line 3054 "src/parse-gram.c"
3057 /* Line 1741 of yacc.c */
3058 #line 3059 "src/parse-gram.c"
3061 if (yychar_backup
!= yychar
)
3062 YY_LAC_DISCARD ("yychar change");
3064 /* User semantic actions sometimes alter yychar, and that requires
3065 that yytoken be updated with the new translation. We take the
3066 approach of translating immediately before every use of yytoken.
3067 One alternative is translating here after every semantic action,
3068 but that translation would be missed if the semantic action invokes
3069 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3070 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3071 incorrect destructor might then be invoked immediately. In the
3072 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3073 to an incorrect destructor call or verbose syntax error message
3074 before the lookahead is translated. */
3075 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3079 YY_STACK_PRINT (yyss
, yyssp
);
3084 /* Now `shift' the result of the reduction. Determine what state
3085 that goes to, based on the state we popped back to and the rule
3086 number reduced by. */
3090 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3091 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3092 yystate
= yytable
[yystate
];
3094 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3099 /*------------------------------------.
3100 | yyerrlab -- here on detecting error |
3101 `------------------------------------*/
3103 /* Make sure we have latest lookahead translation. See comments at
3104 user semantic actions for why this is necessary. */
3105 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3107 /* If not already recovering from an error, report this error. */
3111 #if ! YYERROR_VERBOSE
3112 yyerror (YY_("syntax error"));
3114 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3115 yyesa, &yyes, &yyes_capacity, \
3118 char const *yymsgp
= YY_("syntax error");
3119 int yysyntax_error_status
;
3120 if (yychar
!= YYEMPTY
)
3122 yysyntax_error_status
= YYSYNTAX_ERROR
;
3123 if (yysyntax_error_status
== 0)
3125 else if (yysyntax_error_status
== 1)
3127 if (yymsg
!= yymsgbuf
)
3128 YYSTACK_FREE (yymsg
);
3129 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3133 yymsg_alloc
= sizeof yymsgbuf
;
3134 yysyntax_error_status
= 2;
3138 yysyntax_error_status
= YYSYNTAX_ERROR
;
3143 if (yysyntax_error_status
== 2)
3144 goto yyexhaustedlab
;
3146 # undef YYSYNTAX_ERROR
3150 yyerror_range
[1] = yylloc
;
3152 if (yyerrstatus
== 3)
3154 /* If just tried and failed to reuse lookahead token after an
3155 error, discard it. */
3157 if (yychar
<= YYEOF
)
3159 /* Return failure if at end of input. */
3160 if (yychar
== YYEOF
)
3165 yydestruct ("Error: discarding",
3166 yytoken
, &yylval
, &yylloc
);
3171 /* Else will try to reuse lookahead token after shifting the error
3176 /*---------------------------------------------------.
3177 | yyerrorlab -- error raised explicitly by YYERROR. |
3178 `---------------------------------------------------*/
3181 /* Pacify compilers like GCC when the user code never invokes
3182 YYERROR and the label yyerrorlab therefore never appears in user
3184 if (/*CONSTCOND*/ 0)
3187 yyerror_range
[1] = yylsp
[1-yylen
];
3188 /* Do not reclaim the symbols of the rule which action triggered
3192 YY_STACK_PRINT (yyss
, yyssp
);
3197 /*-------------------------------------------------------------.
3198 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3199 `-------------------------------------------------------------*/
3201 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3205 yyn
= yypact
[yystate
];
3206 if (!yypact_value_is_default (yyn
))
3209 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3217 /* Pop the current state because it cannot handle the error token. */
3221 yyerror_range
[1] = *yylsp
;
3222 yydestruct ("Error: popping",
3223 yystos
[yystate
], yyvsp
, yylsp
);
3226 YY_STACK_PRINT (yyss
, yyssp
);
3229 /* If the stack popping above didn't lose the initial context for the
3230 current lookahead token, the shift below will for sure. */
3231 YY_LAC_DISCARD ("error recovery");
3235 yyerror_range
[2] = yylloc
;
3236 /* Using YYLLOC is tempting, but would change the location of
3237 the lookahead. YYLOC is available though. */
3238 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3241 /* Shift the error token. */
3242 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3248 /*-------------------------------------.
3249 | yyacceptlab -- YYACCEPT comes here. |
3250 `-------------------------------------*/
3255 /*-----------------------------------.
3256 | yyabortlab -- YYABORT comes here. |
3257 `-----------------------------------*/
3263 /*-------------------------------------------------.
3264 | yyexhaustedlab -- memory exhaustion comes here. |
3265 `-------------------------------------------------*/
3267 yyerror (YY_("memory exhausted"));
3273 if (yychar
!= YYEMPTY
)
3275 /* Make sure we have latest lookahead translation. See comments at
3276 user semantic actions for why this is necessary. */
3277 yytoken
= YYTRANSLATE (yychar
);
3278 yydestruct ("Cleanup: discarding lookahead",
3279 yytoken
, &yylval
, &yylloc
);
3281 /* Do not reclaim the symbols of the rule which action triggered
3282 this YYABORT or YYACCEPT. */
3284 YY_STACK_PRINT (yyss
, yyssp
);
3285 while (yyssp
!= yyss
)
3287 yydestruct ("Cleanup: popping",
3288 yystos
[*yyssp
], yyvsp
, yylsp
);
3293 YYSTACK_FREE (yyss
);
3296 YYSTACK_FREE (yyes
);
3298 if (yymsg
!= yymsgbuf
)
3299 YYSTACK_FREE (yymsg
);
3301 /* Make sure YYID is used. */
3302 return YYID (yyresult
);
3305 /* Line 2001 of yacc.c */
3306 #line 693 "src/parse-gram.y"
3310 /* Return the location of the left-hand side of a rule whose
3311 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3312 the right-hand side, and return an empty location equal to the end
3313 boundary of RHS[0] if the right-hand side is empty. */
3316 lloc_default (YYLTYPE
const *rhs
, int n
)
3321 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3322 The bug is fixed in 7.4.2m, but play it safe for now. */
3323 loc
.start
= rhs
[n
].end
;
3324 loc
.end
= rhs
[n
].end
;
3326 /* Ignore empty nonterminals the start of the the right-hand side.
3327 Do not bother to ignore them at the end of the right-hand side,
3328 since empty nonterminals have the same end as their predecessors. */
3329 for (i
= 1; i
<= n
; i
++)
3330 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3332 loc
.start
= rhs
[i
].start
;
3341 add_param (param_type type
, char *decl
, location loc
)
3343 static char const alphanum
[26 + 26 + 1 + 10] =
3344 "abcdefghijklmnopqrstuvwxyz"
3345 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3349 char const *name_start
= NULL
;
3352 /* Stop on last actual character. */
3353 for (p
= decl
; p
[1]; p
++)
3355 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3356 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3359 /* Strip the surrounding '{' and '}', and any blanks just inside
3361 while (*--p
== ' ' || *p
== '\t')
3364 while (*++decl
== ' ' || *decl
== '\t')
3369 complain_at (loc
, _("missing identifier in parameter declaration"));
3376 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3380 name
= xmalloc (name_len
+ 1);
3381 memcpy (name
, name_start
, name_len
);
3382 name
[name_len
] = '\0';
3383 if (type
& param_lex
)
3384 muscle_pair_list_grow ("lex_param", decl
, name
);
3385 if (type
& param_parse
)
3386 muscle_pair_list_grow ("parse_param", decl
, name
);
3390 gram_scanner_last_string_free ();
3395 version_check (location
const *loc
, char const *version
)
3397 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3399 complain_at (*loc
, "require bison %s, but have %s",
3400 version
, PACKAGE_VERSION
);
3406 gram_error (location
const *loc
, char const *msg
)
3408 complain_at (*loc
, "%s", msg
);
3412 token_name (int type
)
3414 return yytname
[YYTRANSLATE (type
)];
3425 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3426 return quotearg_style (escape_quoting_style
, buf
);