1 /* A Bison parser, made by GNU Bison 2.4.557-bf3e4. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.4.557-bf3e4"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 1
64 /* Substitute the variable and function names. */
65 #define yyparse gram_parse
66 #define yylex gram_lex
67 #define yyerror gram_error
68 #define yylval gram_lval
69 #define yychar gram_char
70 #define yydebug gram_debug
71 #define yynerrs gram_nerrs
72 #define yylloc gram_lloc
74 /* Copy the first part of user declarations. */
75 /* Line 269 of yacc.c */
76 #line 1 "src/parse-gram.y"
77 /* Bison Grammar Parser -*- C -*-
79 Copyright (C) 2002-2011 Free Software Foundation, Inc.
81 This file is part of Bison, the GNU Compiler Compiler.
83 This program is free software: you can redistribute it and/or modify
84 it under the terms of the GNU General Public License as published by
85 the Free Software Foundation, either version 3 of the License, or
86 (at your option) any later version.
88 This program is distributed in the hope that it will be useful,
89 but WITHOUT ANY WARRANTY; without even the implied warranty of
90 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91 GNU General Public License for more details.
93 You should have received a copy of the GNU General Public License
94 along with this program. If not, see <http://www.gnu.org/licenses/>. */
100 #include "conflicts.h"
104 #include "muscle-tab.h"
105 #include "named-ref.h"
106 #include "quotearg.h"
109 #include "scan-gram.h"
110 #include "scan-code.h"
112 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
113 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
115 #define YY_LOCATION_PRINT(File, Loc) \
116 location_print (File, Loc)
118 static void version_check (location
const *loc
, char const *version
);
120 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
121 FIXME: depends on the undocumented availability of YYLLOC. */
123 #define yyerror(Msg) \
124 gram_error (&yylloc, Msg)
125 static void gram_error (location
const *, char const *);
127 static char const *char_name (char);
129 /* Line 269 of yacc.c */
130 #line 131 "src/parse-gram.c"
132 /* Enabling traces. */
137 /* Enabling verbose error messages. */
138 #ifdef YYERROR_VERBOSE
139 # undef YYERROR_VERBOSE
140 # define YYERROR_VERBOSE 1
142 # define YYERROR_VERBOSE 1
145 /* Enabling the token table. */
146 #ifndef YYTOKEN_TABLE
147 # define YYTOKEN_TABLE 0
150 /* "%code requires" blocks. */
151 /* Line 289 of yacc.c */
152 #line 202 "src/parse-gram.y"
160 param_parse
= 1 << 1,
161 param_both
= param_lex
| param_parse
166 /* Line 289 of yacc.c */
167 #line 168 "src/parse-gram.c"
172 /* Put the tokens into the symbol table, so that GDB and other debuggers
181 PERCENT_DESTRUCTOR
= 263,
182 PERCENT_PRINTER
= 264,
185 PERCENT_NONASSOC
= 267,
186 PERCENT_PRECEDENCE
= 268,
191 PERCENT_DEFAULT_PREC
= 273,
192 PERCENT_DEFINE
= 274,
193 PERCENT_DEFINES
= 275,
194 PERCENT_ERROR_VERBOSE
= 276,
195 PERCENT_EXPECT
= 277,
196 PERCENT_EXPECT_RR
= 278,
198 PERCENT_FILE_PREFIX
= 280,
199 PERCENT_GLR_PARSER
= 281,
200 PERCENT_INITIAL_ACTION
= 282,
201 PERCENT_LANGUAGE
= 283,
202 PERCENT_NAME_PREFIX
= 284,
203 PERCENT_NO_DEFAULT_PREC
= 285,
204 PERCENT_NO_LINES
= 286,
205 PERCENT_NONDETERMINISTIC_PARSER
= 287,
206 PERCENT_OUTPUT
= 288,
207 PERCENT_REQUIRE
= 289,
208 PERCENT_SKELETON
= 290,
210 PERCENT_TOKEN_TABLE
= 292,
211 PERCENT_VERBOSE
= 293,
214 BRACED_PREDICATE
= 296,
221 PERCENT_PERCENT
= 303,
236 #define PERCENT_TOKEN 260
237 #define PERCENT_NTERM 261
238 #define PERCENT_TYPE 262
239 #define PERCENT_DESTRUCTOR 263
240 #define PERCENT_PRINTER 264
241 #define PERCENT_LEFT 265
242 #define PERCENT_RIGHT 266
243 #define PERCENT_NONASSOC 267
244 #define PERCENT_PRECEDENCE 268
245 #define PERCENT_PREC 269
246 #define PERCENT_DPREC 270
247 #define PERCENT_MERGE 271
248 #define PERCENT_CODE 272
249 #define PERCENT_DEFAULT_PREC 273
250 #define PERCENT_DEFINE 274
251 #define PERCENT_DEFINES 275
252 #define PERCENT_ERROR_VERBOSE 276
253 #define PERCENT_EXPECT 277
254 #define PERCENT_EXPECT_RR 278
255 #define PERCENT_FLAG 279
256 #define PERCENT_FILE_PREFIX 280
257 #define PERCENT_GLR_PARSER 281
258 #define PERCENT_INITIAL_ACTION 282
259 #define PERCENT_LANGUAGE 283
260 #define PERCENT_NAME_PREFIX 284
261 #define PERCENT_NO_DEFAULT_PREC 285
262 #define PERCENT_NO_LINES 286
263 #define PERCENT_NONDETERMINISTIC_PARSER 287
264 #define PERCENT_OUTPUT 288
265 #define PERCENT_REQUIRE 289
266 #define PERCENT_SKELETON 290
267 #define PERCENT_START 291
268 #define PERCENT_TOKEN_TABLE 292
269 #define PERCENT_VERBOSE 293
270 #define PERCENT_YACC 294
271 #define BRACED_CODE 295
272 #define BRACED_PREDICATE 296
273 #define BRACKETED_ID 297
279 #define PERCENT_PERCENT 303
282 #define SEMICOLON 306
286 #define PERCENT_PARAM 310
287 #define PERCENT_UNION 311
292 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
293 typedef union YYSTYPE
295 /* Line 294 of yacc.c */
296 #line 88 "src/parse-gram.y"
302 named_ref
*named_ref
;
306 unsigned char character
;
308 /* Line 294 of yacc.c */
309 #line 226 "src/parse-gram.y"
314 /* Line 294 of yacc.c */
315 #line 316 "src/parse-gram.c"
317 # define YYSTYPE_IS_TRIVIAL 1
318 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
319 # define YYSTYPE_IS_DECLARED 1
322 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
323 typedef struct YYLTYPE
330 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
331 # define YYLTYPE_IS_DECLARED 1
332 # define YYLTYPE_IS_TRIVIAL 1
336 /* Copy the second part of user declarations. */
338 /* Line 344 of yacc.c */
339 #line 340 "src/parse-gram.c"
340 /* Unqualified %code blocks. */
341 /* Line 345 of yacc.c */
342 #line 55 "src/parse-gram.y"
344 static int current_prec
= 0;
345 static location current_lhs_location
;
346 static named_ref
*current_lhs_named_ref
;
347 static symbol
*current_lhs
;
348 static symbol_class current_class
= unknown_sym
;
349 static uniqstr current_type
= NULL
;
351 #define YYTYPE_INT16 int_fast16_t
352 #define YYTYPE_INT8 int_fast8_t
353 #define YYTYPE_UINT16 uint_fast16_t
354 #define YYTYPE_UINT8 uint_fast8_t
356 /* Line 345 of yacc.c */
357 #line 215 "src/parse-gram.y"
359 /** Add a lex-param and/or a parse-param.
361 * \param type where to push this formal argument.
362 * \param decl the formal argument. Destroyed.
363 * \param loc the location in the source.
365 static void add_param (param_type type
, char *decl
, location loc
);
366 static param_type current_param
= param_none
;
369 /* Line 345 of yacc.c */
370 #line 371 "src/parse-gram.c"
377 typedef YYTYPE_UINT8 yytype_uint8
;
379 typedef unsigned char yytype_uint8
;
383 typedef YYTYPE_INT8 yytype_int8
;
384 #elif (defined __STDC__ || defined __C99__FUNC__ \
385 || defined __cplusplus || defined _MSC_VER)
386 typedef signed char yytype_int8
;
388 typedef short int yytype_int8
;
392 typedef YYTYPE_UINT16 yytype_uint16
;
394 typedef unsigned short int yytype_uint16
;
398 typedef YYTYPE_INT16 yytype_int16
;
400 typedef short int yytype_int16
;
404 # ifdef __SIZE_TYPE__
405 # define YYSIZE_T __SIZE_TYPE__
406 # elif defined size_t
407 # define YYSIZE_T size_t
408 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
409 || defined __cplusplus || defined _MSC_VER)
410 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
411 # define YYSIZE_T size_t
413 # define YYSIZE_T unsigned int
417 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
420 # if defined YYENABLE_NLS && YYENABLE_NLS
422 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
423 # define YY_(msgid) dgettext ("bison-runtime", msgid)
427 # define YY_(msgid) msgid
431 /* Suppress unused-variable warnings by "using" E. */
432 #if ! defined lint || defined __GNUC__
433 # define YYUSE(e) ((void) (e))
435 # define YYUSE(e) /* empty */
438 /* Identity function, used to suppress warnings about constant conditions. */
442 #if (defined __STDC__ || defined __C99__FUNC__ \
443 || defined __cplusplus || defined _MSC_VER)
458 /* The parser invokes alloca or malloc; define the necessary symbols. */
460 # ifdef YYSTACK_ALLOC
461 /* Pacify GCC's `empty if-body' warning. */
462 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
463 # ifndef YYSTACK_ALLOC_MAXIMUM
464 /* The OS might guarantee only one guard page at the bottom of the stack,
465 and a page size can be as small as 4096 bytes. So we cannot safely
466 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
467 to allow for a few compiler-allocated temporary stack slots. */
468 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
471 # define YYSTACK_ALLOC YYMALLOC
472 # define YYSTACK_FREE YYFREE
473 # ifndef YYSTACK_ALLOC_MAXIMUM
474 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
476 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
477 && ! ((defined YYMALLOC || defined malloc) \
478 && (defined YYFREE || defined free)))
479 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
480 # ifndef EXIT_SUCCESS
481 # define EXIT_SUCCESS 0
485 # define YYMALLOC malloc
486 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
487 || defined __cplusplus || defined _MSC_VER)
488 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
493 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
494 || defined __cplusplus || defined _MSC_VER)
495 void free (void *); /* INFRINGES ON USER NAME SPACE */
499 # define YYCOPY_NEEDED 1
503 #if (! defined yyoverflow \
504 && (! defined __cplusplus \
505 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
506 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
508 /* A type that is properly aligned for any stack member. */
511 yytype_int16 yyss_alloc
;
516 /* The size of the maximum gap between one aligned stack and the next. */
517 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
519 /* The size of an array large to enough to hold all stacks, each with
521 # define YYSTACK_BYTES(N) \
522 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
523 + 2 * YYSTACK_GAP_MAXIMUM)
525 # define YYCOPY_NEEDED 1
527 /* Relocate STACK from its old location to the new one. The
528 local variables YYSIZE and YYSTACKSIZE give the old and new number of
529 elements in the stack, and YYPTR gives the new location of the
530 stack. Advance YYPTR to a properly aligned location for the next
532 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
535 YYSIZE_T yynewbytes; \
536 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
537 Stack = &yyptr->Stack_alloc; \
538 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
539 yyptr += yynewbytes / sizeof (*yyptr); \
545 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
546 /* Copy COUNT objects from FROM to TO. The source and destination do
549 # if defined __GNUC__ && 1 < __GNUC__
550 # define YYCOPY(To, From, Count) \
551 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
553 # define YYCOPY(To, From, Count) \
557 for (yyi = 0; yyi < (Count); yyi++) \
558 (To)[yyi] = (From)[yyi]; \
563 #endif /* !YYCOPY_NEEDED */
565 /* YYFINAL -- State number of the termination state. */
567 /* YYLAST -- Last index in YYTABLE. */
570 /* YYNTOKENS -- Number of terminals. */
572 /* YYNNTS -- Number of nonterminals. */
574 /* YYNRULES -- Number of rules. */
576 /* YYNSTATES -- Number of states. */
577 #define YYNSTATES 149
579 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
580 by yylex, with out-of-bounds checking. */
582 #define YYMAXUTOK 311
584 #define YYTRANSLATE(YYX) \
585 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
587 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
588 as returned by yylex, without out-of-bounds checking. */
589 static const yytype_uint8 yytranslate
[] =
591 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 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, 1, 2, 3, 4,
617 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
618 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
619 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
620 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
621 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
626 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
627 static const yytype_uint16 yyrline
[] =
629 0, 251, 251, 259, 261, 265, 266, 276, 280, 285,
630 286, 291, 296, 297, 298, 299, 300, 305, 314, 315,
631 316, 317, 318, 319, 320, 321, 321, 322, 323, 347,
632 348, 349, 350, 354, 355, 364, 365, 366, 370, 377,
633 384, 388, 392, 399, 414, 415, 419, 431, 431, 436,
634 436, 441, 452, 467, 468, 469, 470, 474, 475, 480,
635 482, 487, 488, 493, 495, 500, 501, 505, 506, 507,
636 508, 513, 518, 523, 529, 535, 546, 547, 556, 557,
637 563, 564, 565, 572, 572, 577, 578, 579, 584, 586,
638 588, 590, 592, 594, 596, 601, 603, 613, 614, 619,
639 620, 621, 630, 650, 652, 661, 666, 667, 672, 679,
644 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
645 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
646 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
647 static const char *const yytname
[] =
649 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
650 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
651 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
652 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
653 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
654 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
655 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
656 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
657 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
658 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
659 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
660 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
661 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
662 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
663 "prologue_declaration", "$@1", "params", "grammar_declaration",
664 "union_name", "symbol_declaration", "$@2", "$@3",
665 "precedence_declaration", "precedence_declarator", "tag.opt",
666 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
667 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
668 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
669 "named_ref.opt", "variable", "content.opt", "braceless", "id",
670 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
675 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
676 (internal) symbol number NUM (which must be that of a token). */
677 static const yytype_uint16 yytoknum
[] =
679 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
680 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
681 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
682 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
683 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
684 305, 306, 307, 308, 309, 310, 311
688 #define YYPACT_NINF -50
690 #define yypact_value_is_default(yystate) \
693 #define YYTABLE_NINF -110
695 #define yytable_value_is_error(yytable_value) \
698 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
700 static const yytype_int16 yypact
[] =
702 -50, 4, 107, -50, -50, -50, -20, 3, 11, -50,
703 -50, -50, -50, 14, -50, 12, 68, -50, 72, 73,
704 -50, 0, -50, 45, 86, 2, -50, -50, -50, 17,
705 95, 96, 32, -50, -50, -50, 16, -50, -50, -50,
706 54, -50, -50, -50, -50, 49, -2, -2, 32, 27,
707 27, -50, 63, -50, -50, -50, 37, -50, -50, -50,
708 -50, 101, -50, -50, -50, 103, -50, 104, -50, -50,
709 -50, -50, -50, -50, -50, -50, 57, -50, 58, 1,
710 -50, -50, 79, 70, -50, 63, -50, 32, -50, -50,
711 -2, 64, -2, 32, -50, -50, -50, -50, 27, -50,
712 -50, 27, -50, -50, -50, -50, -50, -50, -50, -50,
713 -50, 78, -50, -50, -50, -50, -50, 83, -50, 32,
714 -50, 143, -50, 145, -50, -50, -50, -50, -50, -50,
715 -50, -50, -50, 43, 50, -50, -50, 32, 146, 97,
716 79, -50, 79, 50, -50, -50, -50, -50, -50
719 /* YYDEFACT[S] -- default reduction number in state S. Performed when
720 YYTABLE does not specify something else to do. Zero means the default
722 static const yytype_uint8 yydefact
[] =
724 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
725 54, 55, 56, 0, 40, 0, 9, 11, 0, 0,
726 7, 0, 16, 0, 0, 0, 41, 21, 22, 0,
727 0, 0, 0, 29, 30, 31, 0, 6, 32, 25,
728 44, 4, 5, 36, 35, 57, 0, 0, 0, 0,
729 0, 102, 0, 42, 98, 97, 99, 10, 12, 13,
730 14, 0, 17, 18, 19, 0, 23, 0, 27, 28,
731 108, 104, 103, 106, 37, 107, 0, 105, 0, 0,
732 78, 80, 95, 0, 45, 0, 58, 0, 71, 76,
733 50, 72, 48, 51, 63, 68, 69, 70, 38, 65,
734 67, 39, 43, 101, 100, 8, 15, 20, 24, 82,
735 81, 0, 79, 2, 96, 83, 34, 26, 46, 52,
736 59, 61, 77, 73, 74, 64, 66, 110, 88, 33,
737 60, 62, 75, 84, 85, 88, 87, 0, 0, 0,
738 95, 91, 95, 86, 92, 93, 94, 90, 89
741 /* YYPGOTO[NTERM-NUM]. */
742 static const yytype_int16 yypgoto
[] =
744 -50, -50, -50, -50, -50, -50, 149, -50, -50, -50,
745 -50, -50, -50, -50, -50, 33, -50, 106, -42, -4,
746 112, -50, 74, -50, -50, -50, 19, -45, -50, -50,
747 -16, -8, -50, -32, -49, -50
750 /* YYDEFGOTO[NTERM-NUM]. */
751 static const yytype_int16 yydefgoto
[] =
753 -1, 1, 2, 41, 83, 117, 78, 85, 43, 47,
754 46, 44, 45, 87, 119, 120, 93, 98, 99, 89,
755 90, 79, 80, 81, 128, 133, 134, 115, 56, 105,
756 53, 73, 82, 100, 75, 113
759 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
760 positive, shift that token. If negative, reduce the rule which
761 number is the opposite. If YYTABLE_NINF, syntax error. */
762 static const yytype_int16 yytable
[] =
764 74, -109, 76, 60, 3, 64, 4, 5, 6, 7,
765 8, 9, 10, 11, 12, 54, 94, 76, 13, 14,
766 66, 4, 5, 6, 7, 8, 9, 10, 11, 12,
767 70, 26, 48, 13, 14, 70, 102, 32, 91, 91,
768 103, 71, 124, 49, 72, 61, 26, 65, 77, 111,
769 88, 50, 32, 70, 51, 121, 126, 40, 55, 126,
770 52, 125, 67, 77, 137, 138, 139, 70, 123, 118,
771 71, 57, 40, 72, 132, 71, 58, 59, 72, 95,
772 96, 97, 91, 104, 91, 62, 122, 121, 122, 63,
773 140, 141, 135, 71, 136, 147, 72, 148, 68, 69,
774 84, 86, 142, 51, 106, 144, 107, 108, 109, 110,
775 116, 142, 4, 5, 6, 7, 8, 9, 10, 11,
776 12, 114, 127, 129, 13, 14, 15, 16, 17, 18,
777 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
778 29, 30, 31, 32, 33, 34, 35, 131, 70, 146,
779 145, 42, 130, 112, 143, 36, 101, 37, 38, 92,
783 static const yytype_int16 yycheck
[] =
785 32, 0, 1, 3, 0, 3, 5, 6, 7, 8,
786 9, 10, 11, 12, 13, 3, 48, 1, 17, 18,
787 3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
788 3, 30, 52, 17, 18, 3, 52, 36, 46, 47,
789 3, 43, 91, 40, 46, 45, 30, 45, 47, 48,
790 52, 40, 36, 3, 40, 87, 98, 56, 46, 101,
791 46, 93, 45, 47, 14, 15, 16, 3, 4, 85,
792 43, 3, 56, 46, 123, 43, 4, 4, 46, 52,
793 53, 54, 90, 46, 92, 40, 90, 119, 92, 3,
794 40, 41, 49, 43, 51, 140, 46, 142, 3, 3,
795 46, 52, 134, 40, 3, 137, 3, 3, 51, 51,
796 40, 143, 5, 6, 7, 8, 9, 10, 11, 12,
797 13, 42, 44, 40, 17, 18, 19, 20, 21, 22,
798 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
799 33, 34, 35, 36, 37, 38, 39, 4, 3, 52,
800 4, 2, 119, 79, 135, 48, 50, 50, 51, 47,
804 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
805 symbol of state STATE-NUM. */
806 static const yytype_uint8 yystos
[] =
808 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
809 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
810 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
811 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
812 56, 60, 63, 65, 68, 69, 67, 66, 52, 40,
813 40, 40, 46, 87, 3, 46, 85, 3, 4, 4,
814 3, 45, 40, 3, 3, 45, 3, 45, 3, 3,
815 3, 43, 46, 88, 90, 91, 1, 47, 63, 78,
816 79, 80, 89, 61, 46, 64, 52, 70, 52, 76,
817 77, 88, 77, 73, 90, 52, 53, 54, 74, 75,
818 90, 74, 87, 3, 46, 86, 3, 3, 3, 51,
819 51, 48, 79, 92, 42, 84, 40, 62, 87, 71,
820 72, 90, 76, 4, 91, 90, 75, 44, 81, 40,
821 72, 4, 91, 82, 83, 49, 51, 14, 15, 16,
822 40, 41, 90, 83, 90, 4, 52, 84, 84
825 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
826 static const yytype_uint8 yyr1
[] =
828 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
829 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
830 60, 60, 60, 60, 60, 61, 60, 60, 60, 60,
831 60, 60, 60, 62, 62, 63, 63, 63, 63, 63,
832 63, 63, 63, 63, 64, 64, 63, 66, 65, 67,
833 65, 65, 68, 69, 69, 69, 69, 70, 70, 71,
834 71, 72, 72, 73, 73, 74, 74, 75, 75, 75,
835 75, 76, 76, 76, 76, 76, 77, 77, 78, 78,
836 79, 79, 79, 81, 80, 82, 82, 82, 83, 83,
837 83, 83, 83, 83, 83, 84, 84, 85, 85, 86,
838 86, 86, 87, 88, 88, 89, 90, 90, 91, 92,
842 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
843 static const yytype_uint8 yyr2
[] =
845 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
846 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
847 3, 1, 1, 2, 3, 0, 3, 2, 2, 1,
848 1, 1, 1, 2, 1, 1, 1, 2, 3, 3,
849 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
850 3, 3, 3, 1, 1, 1, 1, 0, 1, 1,
851 2, 1, 2, 1, 2, 1, 2, 1, 1, 1,
852 1, 1, 1, 2, 2, 3, 1, 2, 1, 2,
853 1, 2, 2, 0, 4, 1, 3, 2, 0, 3,
854 3, 2, 3, 3, 3, 0, 1, 1, 1, 0,
855 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
860 #define yyerrok (yyerrstatus = 0)
861 #define yyclearin (yychar = YYEMPTY)
865 #define YYACCEPT goto yyacceptlab
866 #define YYABORT goto yyabortlab
867 #define YYERROR goto yyerrorlab
870 /* Like YYERROR except do call yyerror. This remains here temporarily
871 to ease the transition to the new meaning of YYERROR, for GCC.
872 Once GCC version 2 has supplanted version 1, this can go. However,
873 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
874 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
877 #define YYFAIL goto yyerrlab
879 /* This is here to suppress warnings from the GCC cpp's
880 -Wunused-macros. Normally we don't worry about that warning, but
881 some users do, and we want to make it easy for users to remove
882 YYFAIL uses, which will produce warnings from Bison 2.5. */
885 #define YYRECOVERING() (!!yyerrstatus)
887 #define YYBACKUP(Token, Value) \
889 if (yychar == YYEMPTY && yylen == 1) \
894 YY_LAC_DISCARD ("YYBACKUP"); \
899 yyerror (YY_("syntax error: cannot back up")); \
906 #define YYERRCODE 256
909 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
910 If N is 0, then set CURRENT to the empty location which ends
911 the previous symbol: RHS[0] (always defined). */
913 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
914 #ifndef YYLLOC_DEFAULT
915 # define YYLLOC_DEFAULT(Current, Rhs, N) \
919 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
920 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
921 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
922 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
926 (Current).first_line = (Current).last_line = \
927 YYRHSLOC (Rhs, 0).last_line; \
928 (Current).first_column = (Current).last_column = \
929 YYRHSLOC (Rhs, 0).last_column; \
935 /* YY_LOCATION_PRINT -- Print the location on the stream.
936 This macro was not mandated originally: define only if we know
937 we won't break user code: when these are the locations we know. */
939 #ifndef YY_LOCATION_PRINT
940 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
941 # define YY_LOCATION_PRINT(File, Loc) \
942 fprintf (File, "%d.%d-%d.%d", \
943 (Loc).first_line, (Loc).first_column, \
944 (Loc).last_line, (Loc).last_column)
946 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
951 /* YYLEX -- calling `yylex' with the right arguments. */
954 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
956 # define YYLEX yylex (&yylval, &yylloc)
959 /* Enable debugging if requested. */
963 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
964 # define YYFPRINTF fprintf
967 # define YYDPRINTF(Args) \
973 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
977 YYFPRINTF (stderr, "%s ", Title); \
978 yy_symbol_print (stderr, \
979 Type, Value, Location); \
980 YYFPRINTF (stderr, "\n"); \
985 /*--------------------------------.
986 | Print this symbol on YYOUTPUT. |
987 `--------------------------------*/
990 #if (defined __STDC__ || defined __C99__FUNC__ \
991 || defined __cplusplus || defined _MSC_VER)
993 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
996 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
999 YYSTYPE
const * const yyvaluep
;
1000 YYLTYPE
const * const yylocationp
;
1005 YYUSE (yylocationp
);
1007 if (yytype
< YYNTOKENS
)
1008 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1016 /* Line 751 of yacc.c */
1017 #line 175 "src/parse-gram.y"
1018 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
1019 /* Line 751 of yacc.c */
1020 #line 1021 "src/parse-gram.c"
1023 case 4: // "integer"
1025 /* Line 751 of yacc.c */
1026 #line 188 "src/parse-gram.y"
1027 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
1028 /* Line 751 of yacc.c */
1029 #line 1030 "src/parse-gram.c"
1032 case 24: // "%<flag>"
1034 /* Line 751 of yacc.c */
1035 #line 184 "src/parse-gram.y"
1036 { fprintf (stderr
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1037 /* Line 751 of yacc.c */
1038 #line 1039 "src/parse-gram.c"
1043 /* Line 751 of yacc.c */
1044 #line 177 "src/parse-gram.y"
1045 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1046 /* Line 751 of yacc.c */
1047 #line 1048 "src/parse-gram.c"
1050 case 42: // "[identifier]"
1052 /* Line 751 of yacc.c */
1053 #line 182 "src/parse-gram.y"
1054 { fprintf (stderr
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1055 /* Line 751 of yacc.c */
1056 #line 1057 "src/parse-gram.c"
1061 /* Line 751 of yacc.c */
1062 #line 169 "src/parse-gram.y"
1063 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
1064 /* Line 751 of yacc.c */
1065 #line 1066 "src/parse-gram.c"
1068 case 44: // "epilogue"
1070 /* Line 751 of yacc.c */
1071 #line 177 "src/parse-gram.y"
1072 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1073 /* Line 751 of yacc.c */
1074 #line 1075 "src/parse-gram.c"
1077 case 46: // "identifier"
1079 /* Line 751 of yacc.c */
1080 #line 181 "src/parse-gram.y"
1081 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1082 /* Line 751 of yacc.c */
1083 #line 1084 "src/parse-gram.c"
1086 case 47: // "identifier:"
1088 /* Line 751 of yacc.c */
1089 #line 183 "src/parse-gram.y"
1090 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
1091 /* Line 751 of yacc.c */
1092 #line 1093 "src/parse-gram.c"
1095 case 50: // "%{...%}"
1097 /* Line 751 of yacc.c */
1098 #line 177 "src/parse-gram.y"
1099 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1100 /* Line 751 of yacc.c */
1101 #line 1102 "src/parse-gram.c"
1106 /* Line 751 of yacc.c */
1107 #line 185 "src/parse-gram.y"
1108 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1109 /* Line 751 of yacc.c */
1110 #line 1111 "src/parse-gram.c"
1113 case 55: // "%param"
1115 /* Line 751 of yacc.c */
1116 #line 231 "src/parse-gram.y"
1118 switch (((*yyvaluep
).param
))
1120 #define CASE(In, Out) \
1121 case param_ ## In: fputs ("%" #Out, stderr); break
1122 CASE(lex
, lex
-param
);
1123 CASE(parse
, parse
-param
);
1126 case param_none
: aver (false); break;
1129 /* Line 751 of yacc.c */
1130 #line 1131 "src/parse-gram.c"
1133 case 72: // symbol.prec
1135 /* Line 751 of yacc.c */
1136 #line 191 "src/parse-gram.y"
1137 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1138 /* Line 751 of yacc.c */
1139 #line 1140 "src/parse-gram.c"
1142 case 85: // variable
1144 /* Line 751 of yacc.c */
1145 #line 181 "src/parse-gram.y"
1146 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1147 /* Line 751 of yacc.c */
1148 #line 1149 "src/parse-gram.c"
1151 case 86: // content.opt
1153 /* Line 751 of yacc.c */
1154 #line 177 "src/parse-gram.y"
1155 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1156 /* Line 751 of yacc.c */
1157 #line 1158 "src/parse-gram.c"
1160 case 87: // braceless
1162 /* Line 751 of yacc.c */
1163 #line 177 "src/parse-gram.y"
1164 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1165 /* Line 751 of yacc.c */
1166 #line 1167 "src/parse-gram.c"
1171 /* Line 751 of yacc.c */
1172 #line 191 "src/parse-gram.y"
1173 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1174 /* Line 751 of yacc.c */
1175 #line 1176 "src/parse-gram.c"
1178 case 89: // id_colon
1180 /* Line 751 of yacc.c */
1181 #line 192 "src/parse-gram.y"
1182 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1183 /* Line 751 of yacc.c */
1184 #line 1185 "src/parse-gram.c"
1189 /* Line 751 of yacc.c */
1190 #line 191 "src/parse-gram.y"
1191 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1192 /* Line 751 of yacc.c */
1193 #line 1194 "src/parse-gram.c"
1196 case 91: // string_as_id
1198 /* Line 751 of yacc.c */
1199 #line 191 "src/parse-gram.y"
1200 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1201 /* Line 751 of yacc.c */
1202 #line 1203 "src/parse-gram.c"
1211 /*--------------------------------.
1212 | Print this symbol on YYOUTPUT. |
1213 `--------------------------------*/
1215 #if (defined __STDC__ || defined __C99__FUNC__ \
1216 || defined __cplusplus || defined _MSC_VER)
1218 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1221 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1224 YYSTYPE
const * const yyvaluep
;
1225 YYLTYPE
const * const yylocationp
;
1228 if (yytype
< YYNTOKENS
)
1229 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1231 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1233 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1234 YYFPRINTF (yyoutput
, ": ");
1235 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1236 YYFPRINTF (yyoutput
, ")");
1239 /*------------------------------------------------------------------.
1240 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1242 `------------------------------------------------------------------*/
1244 #if (defined __STDC__ || defined __C99__FUNC__ \
1245 || defined __cplusplus || defined _MSC_VER)
1247 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1250 yy_stack_print (yybottom
, yytop
)
1251 yytype_int16
*yybottom
;
1252 yytype_int16
*yytop
;
1255 YYFPRINTF (stderr
, "Stack now");
1256 for (; yybottom
<= yytop
; yybottom
++)
1258 int yybot
= *yybottom
;
1259 YYFPRINTF (stderr
, " %d", yybot
);
1261 YYFPRINTF (stderr
, "\n");
1264 # define YY_STACK_PRINT(Bottom, Top) \
1267 yy_stack_print ((Bottom), (Top)); \
1271 /*------------------------------------------------.
1272 | Report that the YYRULE is going to be reduced. |
1273 `------------------------------------------------*/
1275 #if (defined __STDC__ || defined __C99__FUNC__ \
1276 || defined __cplusplus || defined _MSC_VER)
1278 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1281 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1282 yytype_int16
*yyssp
;
1288 unsigned long int yylno
= yyrline
[yyrule
];
1289 int yynrhs
= yyr2
[yyrule
];
1291 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1293 /* The symbols being reduced. */
1294 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1296 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1297 yy_symbol_print (stderr
,
1298 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1299 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1300 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1301 YYFPRINTF (stderr
, "\n");
1305 # define YY_REDUCE_PRINT(Rule) \
1308 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1311 /* Nonzero means print parse trace. It is left uninitialized so that
1312 multiple parsers can coexist. */
1314 #else /* !YYDEBUG */
1315 # define YYDPRINTF(Args)
1316 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1317 # define YY_STACK_PRINT(Bottom, Top)
1318 # define YY_REDUCE_PRINT(Rule)
1319 #endif /* !YYDEBUG */
1322 /* YYINITDEPTH -- initial size of the parser's stacks. */
1324 # define YYINITDEPTH 200
1327 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1328 if the built-in stack extension method is used).
1330 Do not make this value too large; the results are undefined if
1331 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1332 evaluated with infinite-precision integer arithmetic. */
1335 # define YYMAXDEPTH 10000
1338 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1339 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1340 stack, and such that *YYCAPACITY is the maximum number of elements it
1341 can hold without a reallocation, make sure there is enough room to
1342 store YYADD more elements. If not, allocate a new stack using
1343 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1344 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1345 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1346 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1347 required. Return 1 if memory is exhausted. */
1349 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1351 char const *yydebug_prefix
,
1352 char const *yydebug_suffix
,
1354 yytype_int16
**yybottom
,
1355 yytype_int16
*yybottom_no_free
,
1356 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1358 YYSIZE_T yysize_old
=
1359 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1360 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1361 if (*yycapacity
< yysize_new
)
1363 YYSIZE_T yyalloc
= 2 * yysize_new
;
1364 yytype_int16
*yybottom_new
;
1365 /* Use YYMAXDEPTH for maximum stack size given that the stack
1366 should never need to grow larger than the main state stack
1367 needs to grow without LAC. */
1368 if (YYMAXDEPTH
< yysize_new
)
1370 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1374 if (YYMAXDEPTH
< yyalloc
)
1375 yyalloc
= YYMAXDEPTH
;
1377 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1380 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1384 if (*yytop
!= yytop_empty
)
1386 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1387 *yytop
= yybottom_new
+ (yysize_old
- 1);
1389 if (*yybottom
!= yybottom_no_free
)
1390 YYSTACK_FREE (*yybottom
);
1391 *yybottom
= yybottom_new
;
1392 *yycapacity
= yyalloc
;
1397 /* Establish the initial context for the current lookahead if no initial
1398 context is currently established.
1400 We define a context as a snapshot of the parser stacks. We define
1401 the initial context for a lookahead as the context in which the
1402 parser initially examines that lookahead in order to select a
1403 syntactic action. Thus, if the lookahead eventually proves
1404 syntactically unacceptable (possibly in a later context reached via a
1405 series of reductions), the initial context can be used to determine
1406 the exact set of tokens that would be syntactically acceptable in the
1407 lookahead's place. Moreover, it is the context after which any
1408 further semantic actions would be erroneous because they would be
1409 determined by a syntactically unacceptable token.
1411 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1412 performed in an inconsistent state (which, for the purposes of LAC,
1413 includes consistent states that don't know they're consistent because
1414 their default reductions have been disabled). Iff there is a
1415 lookahead token, it should also be invoked before reporting a syntax
1416 error. This latter case is for the sake of the debugging output.
1418 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1419 follows. If no initial context is currently established for the
1420 current lookahead, then check if that lookahead can eventually be
1421 shifted if syntactic actions continue from the current context.
1422 Report a syntax error if it cannot. */
1423 #define YY_LAC_ESTABLISH \
1425 if (!yy_lac_established) \
1427 YYDPRINTF ((stderr, \
1428 "LAC: initial context established for %s\n", \
1429 yytname[yytoken])); \
1430 yy_lac_established = 1; \
1432 int yy_lac_status = \
1433 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1434 if (yy_lac_status == 2) \
1435 goto yyexhaustedlab; \
1436 if (yy_lac_status == 1) \
1442 /* Discard any previous initial lookahead context because of Event,
1443 which may be a lookahead change or an invalidation of the currently
1444 established initial context for the current lookahead.
1446 The most common example of a lookahead change is a shift. An example
1447 of both cases is syntax error recovery. That is, a syntax error
1448 occurs when the lookahead is syntactically erroneous for the
1449 currently established initial context, so error recovery manipulates
1450 the parser stacks to try to find a new initial context in which the
1451 current lookahead is syntactically acceptable. If it fails to find
1452 such a context, it discards the lookahead. */
1454 # define YY_LAC_DISCARD(Event) \
1456 if (yy_lac_established) \
1459 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1461 yy_lac_established = 0; \
1465 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1468 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1469 eventually (after perhaps some reductions) be shifted, return 1 if
1470 not, or return 2 if memory is exhausted. As preconditions and
1471 postconditions: *YYES_CAPACITY is the allocated size of the array to
1472 which *YYES points, and either *YYES = YYESA or *YYES points to an
1473 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1474 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1475 any old *YYES other than YYESA. */
1477 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1478 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1480 yytype_int16
*yyes_prev
= yyssp
;
1481 yytype_int16
*yyesp
= yyes_prev
;
1482 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1483 if (yytoken
== YYUNDEFTOK
)
1485 YYDPRINTF ((stderr
, " Always Err\n"));
1490 int yyrule
= yypact
[*yyesp
];
1491 if (yypact_value_is_default (yyrule
)
1492 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1493 || yycheck
[yyrule
] != yytoken
)
1495 yyrule
= yydefact
[*yyesp
];
1498 YYDPRINTF ((stderr
, " Err\n"));
1504 yyrule
= yytable
[yyrule
];
1505 if (yytable_value_is_error (yyrule
))
1507 YYDPRINTF ((stderr
, " Err\n"));
1512 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1518 YYSIZE_T yylen
= yyr2
[yyrule
];
1519 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1520 if (yyesp
!= yyes_prev
)
1522 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1535 yyesp
= yyes_prev
-= yylen
;
1540 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1541 yystate
= yypgoto
[yylhs
] + *yyesp
;
1542 if (yystate
< 0 || YYLAST
< yystate
1543 || yycheck
[yystate
] != *yyesp
)
1544 yystate
= yydefgoto
[yylhs
];
1546 yystate
= yytable
[yystate
];
1548 if (yyesp
== yyes_prev
)
1555 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1559 yyes
, yyesa
, &yyesp
, yyes_prev
))
1561 YYDPRINTF ((stderr
, "\n"));
1566 YYDPRINTF ((stderr
, " G%d", yystate
));
1575 # if defined __GLIBC__ && defined _STRING_H
1576 # define yystrlen strlen
1578 /* Return the length of YYSTR. */
1579 #if (defined __STDC__ || defined __C99__FUNC__ \
1580 || defined __cplusplus || defined _MSC_VER)
1582 yystrlen (const char *yystr
)
1590 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1598 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1599 # define yystpcpy stpcpy
1601 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1603 #if (defined __STDC__ || defined __C99__FUNC__ \
1604 || defined __cplusplus || defined _MSC_VER)
1606 yystpcpy (char *yydest
, const char *yysrc
)
1609 yystpcpy (yydest
, yysrc
)
1615 const char *yys
= yysrc
;
1617 while ((*yyd
++ = *yys
++) != '\0')
1626 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1627 quotes and backslashes, so that it's suitable for yyerror. The
1628 heuristic is that double-quoting is unnecessary unless the string
1629 contains an apostrophe, a comma, or backslash (other than
1630 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1631 null, do not copy; instead, return the length of what the result
1634 yytnamerr (char *yyres
, const char *yystr
)
1639 char const *yyp
= yystr
;
1646 goto do_not_strip_quotes
;
1650 goto do_not_strip_quotes
;
1663 do_not_strip_quotes
: ;
1667 return yystrlen (yystr
);
1669 return yystpcpy (yyres
, yystr
) - yyres
;
1673 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1674 about the unexpected token YYTOKEN for the state stack whose top is
1675 YYSSP. In order to see if a particular token T is a
1676 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1678 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1679 not large enough to hold the message. In that case, also set
1680 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1681 required number of bytes is too large to store or if
1682 yy_lac returned 2. */
1684 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1685 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1686 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1688 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1689 YYSIZE_T yysize
= yysize0
;
1691 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1692 /* Internationalized format string. */
1693 const char *yyformat
= 0;
1694 /* Arguments of yyformat. */
1695 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1696 /* Number of reported tokens (one for the "unexpected", one per
1700 /* There are many possibilities here to consider:
1701 - Assume YYFAIL is not used. It's too flawed to consider. See
1702 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1703 for details. YYERROR is fine as it does not invoke this
1705 - If this state is a consistent state with a default action, then
1706 the only way this function was invoked is if the default action
1707 is an error action. In that case, don't check for expected
1708 tokens because there are none.
1709 - The only way there can be no lookahead present (in yychar) is if
1710 this state is a consistent state with a default action. Thus,
1711 detecting the absence of a lookahead is sufficient to determine
1712 that there is no unexpected or expected token to report. In that
1713 case, just report a simple "syntax error".
1714 - Don't assume there isn't a lookahead just because this state is a
1715 consistent state with a default action. There might have been a
1716 previous inconsistent state, consistent state with a non-default
1717 action, or user semantic action that manipulated yychar.
1718 In the first two cases, it might appear that the current syntax
1719 error should have been detected in the previous state when yy_lac
1720 was invoked. However, at that time, there might have been a
1721 different syntax error that discarded a different initial context
1722 during error recovery, leaving behind the current lookahead.
1724 if (yytoken
!= YYEMPTY
)
1726 int yyn
= yypact
[*yyssp
];
1727 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1728 yyarg
[yycount
++] = yytname
[yytoken
];
1729 if (!yypact_value_is_default (yyn
))
1733 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1734 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1737 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1739 if (yy_lac_status
== 2)
1741 if (yy_lac_status
== 1)
1744 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1750 yyarg
[yycount
++] = yytname
[yyx
];
1751 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1752 if (! (yysize
<= yysize1
1753 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1760 YYFPRINTF (stderr
, "No expected tokens.\n");
1766 # define YYCASE_(N, S) \
1770 YYCASE_(0, YY_("syntax error"));
1771 YYCASE_(1, YY_("syntax error, unexpected %s"));
1772 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1773 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1774 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1775 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1779 yysize1
= yysize
+ yystrlen (yyformat
);
1780 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1784 if (*yymsg_alloc
< yysize
)
1786 *yymsg_alloc
= 2 * yysize
;
1787 if (! (yysize
<= *yymsg_alloc
1788 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1789 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1793 /* Avoid sprintf, as that infringes on the user's name space.
1794 Don't have undefined behavior even if the translation
1795 produced a string with the wrong number of "%s"s. */
1799 while ((*yyp
= *yyformat
) != '\0')
1800 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1802 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1813 #endif /* YYERROR_VERBOSE */
1815 /*-----------------------------------------------.
1816 | Release the memory associated to this symbol. |
1817 `-----------------------------------------------*/
1820 #if (defined __STDC__ || defined __C99__FUNC__ \
1821 || defined __cplusplus || defined _MSC_VER)
1823 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1826 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1830 YYLTYPE
*yylocationp
;
1834 YYUSE (yylocationp
);
1838 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1848 /* Prevent warnings from -Wmissing-prototypes. */
1849 #ifdef YYPARSE_PARAM
1850 #if (defined __STDC__ || defined __C99__FUNC__ \
1851 || defined __cplusplus || defined _MSC_VER)
1852 int yyparse (void *YYPARSE_PARAM
);
1856 #else /* ! YYPARSE_PARAM */
1857 #if (defined __STDC__ || defined __C99__FUNC__ \
1858 || defined __cplusplus || defined _MSC_VER)
1863 #endif /* ! YYPARSE_PARAM */
1870 #ifdef YYPARSE_PARAM
1871 #if (defined __STDC__ || defined __C99__FUNC__ \
1872 || defined __cplusplus || defined _MSC_VER)
1874 yyparse (void *YYPARSE_PARAM
)
1877 yyparse (YYPARSE_PARAM
)
1878 void *YYPARSE_PARAM
;
1880 #else /* ! YYPARSE_PARAM */
1881 #if (defined __STDC__ || defined __C99__FUNC__ \
1882 || defined __cplusplus || defined _MSC_VER)
1892 /* The lookahead symbol. */
1895 /* The semantic value of the lookahead symbol. */
1898 /* Location data for the lookahead symbol. */
1901 /* Number of syntax errors so far. */
1905 /* Number of tokens to shift before error messages enabled. */
1908 /* The stacks and their tools:
1909 `yyss': related to states.
1910 `yyvs': related to semantic values.
1911 `yyls': related to locations.
1913 Refer to the stacks thru separate pointers, to allow yyoverflow
1914 to reallocate them elsewhere. */
1916 /* The state stack. */
1917 yytype_int16 yyssa
[YYINITDEPTH
];
1919 yytype_int16
*yyssp
;
1921 /* The semantic value stack. */
1922 YYSTYPE yyvsa
[YYINITDEPTH
];
1926 /* The location stack. */
1927 YYLTYPE yylsa
[YYINITDEPTH
];
1931 /* The locations where the error started and ended. */
1932 YYLTYPE yyerror_range
[3];
1934 YYSIZE_T yystacksize
;
1936 yytype_int16 yyesa
[20];
1938 YYSIZE_T yyes_capacity
;
1940 int yy_lac_established
= 0;
1943 /* Lookahead token as an internal (translated) token number. */
1945 /* The variables used to return semantic value and location from the
1951 /* Buffer for error messages, and its allocated size. */
1953 char *yymsg
= yymsgbuf
;
1954 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1957 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1959 /* The number of symbols on the RHS of the reduced rule.
1960 Keep to zero when no symbol should be popped. */
1967 yystacksize
= YYINITDEPTH
;
1970 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1971 if (YYMAXDEPTH
< yyes_capacity
)
1972 yyes_capacity
= YYMAXDEPTH
;
1974 YYDPRINTF ((stderr
, "Starting parse\n"));
1979 yychar
= YYEMPTY
; /* Cause a token to be read. */
1981 /* Initialize stack pointers.
1982 Waste one element of value and location stack
1983 so that they stay on the same level as the state stack.
1984 The wasted elements are never initialized. */
1989 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1990 /* Initialize the default location before parsing starts. */
1991 yylloc
.first_line
= yylloc
.last_line
= 1;
1992 yylloc
.first_column
= yylloc
.last_column
= 1;
1995 /* User initialization code. */
1996 /* Line 1524 of yacc.c */
1997 #line 80 "src/parse-gram.y"
1999 /* Bison's grammar can initial empty locations, hence a default
2000 location is needed. */
2001 boundary_set (&yylloc
.start
, current_file
, 1, 1);
2002 boundary_set (&yylloc
.end
, current_file
, 1, 1);
2004 /* Line 1524 of yacc.c */
2005 #line 2006 "src/parse-gram.c"
2010 /*------------------------------------------------------------.
2011 | yynewstate -- Push a new state, which is found in yystate. |
2012 `------------------------------------------------------------*/
2014 /* In all cases, when you get here, the value and location stacks
2015 have just been pushed. So pushing a state here evens the stacks. */
2021 if (yyss
+ yystacksize
- 1 <= yyssp
)
2023 /* Get the current used size of the three stacks, in elements. */
2024 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2028 /* Give user a chance to reallocate the stack. Use copies of
2029 these so that the &'s don't force the real ones into
2031 YYSTYPE
*yyvs1
= yyvs
;
2032 yytype_int16
*yyss1
= yyss
;
2033 YYLTYPE
*yyls1
= yyls
;
2035 /* Each stack pointer address is followed by the size of the
2036 data in use in that stack, in bytes. This used to be a
2037 conditional around just the two extra args, but that might
2038 be undefined if yyoverflow is a macro. */
2039 yyoverflow (YY_("memory exhausted"),
2040 &yyss1
, yysize
* sizeof (*yyssp
),
2041 &yyvs1
, yysize
* sizeof (*yyvsp
),
2042 &yyls1
, yysize
* sizeof (*yylsp
),
2049 #else /* no yyoverflow */
2050 # ifndef YYSTACK_RELOCATE
2051 goto yyexhaustedlab
;
2053 /* Extend the stack our own way. */
2054 if (YYMAXDEPTH
<= yystacksize
)
2055 goto yyexhaustedlab
;
2057 if (YYMAXDEPTH
< yystacksize
)
2058 yystacksize
= YYMAXDEPTH
;
2061 yytype_int16
*yyss1
= yyss
;
2062 union yyalloc
*yyptr
=
2063 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2065 goto yyexhaustedlab
;
2066 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2067 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2068 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2069 # undef YYSTACK_RELOCATE
2071 YYSTACK_FREE (yyss1
);
2074 #endif /* no yyoverflow */
2076 yyssp
= yyss
+ yysize
- 1;
2077 yyvsp
= yyvs
+ yysize
- 1;
2078 yylsp
= yyls
+ yysize
- 1;
2080 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2081 (unsigned long int) yystacksize
));
2083 if (yyss
+ yystacksize
- 1 <= yyssp
)
2087 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2089 if (yystate
== YYFINAL
)
2099 /* Do appropriate processing given the current state. Read a
2100 lookahead token if we need one and don't already have one. */
2102 /* First try to decide what to do without reference to lookahead token. */
2103 yyn
= yypact
[yystate
];
2104 if (yypact_value_is_default (yyn
))
2107 /* Not known => get a lookahead token if don't already have one. */
2109 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2110 if (yychar
== YYEMPTY
)
2112 YYDPRINTF ((stderr
, "Reading a token: "));
2116 if (yychar
<= YYEOF
)
2118 yychar
= yytoken
= YYEOF
;
2119 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2123 yytoken
= YYTRANSLATE (yychar
);
2124 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2127 /* If the proper action on seeing token YYTOKEN is to reduce or to
2128 detect an error, take that action. */
2130 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2138 if (yytable_value_is_error (yyn
))
2145 /* Count tokens shifted since error; after three, turn off error
2150 /* Shift the lookahead token. */
2151 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2153 /* Discard the shifted token. */
2155 YY_LAC_DISCARD ("shift");
2163 /*-----------------------------------------------------------.
2164 | yydefault -- do the default action for the current state. |
2165 `-----------------------------------------------------------*/
2167 yyn
= yydefact
[yystate
];
2173 /*-----------------------------.
2174 | yyreduce -- Do a reduction. |
2175 `-----------------------------*/
2177 /* yyn is the number of a rule to reduce with. */
2180 /* If YYLEN is nonzero, implement the default value of the action:
2183 Otherwise, the following line sets YYVAL to garbage.
2184 This behavior is undocumented and Bison
2185 users should not rely upon it. Assigning to YYVAL
2186 unconditionally makes the parser a bit smaller, and it avoids a
2187 GCC warning that YYVAL may be used uninitialized. */
2188 yyval
= yyvsp
[1-yylen
];
2190 /* Default location. */
2191 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2192 YY_REDUCE_PRINT (yyn
);
2194 int yychar_backup
= yychar
;
2198 /* Line 1740 of yacc.c */
2199 #line 267 "src/parse-gram.y"
2201 code_props plain_code
;
2202 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2203 code_props_translate_code (&plain_code
);
2204 gram_scanner_last_string_free ();
2205 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2206 plain_code
.code
, (yylsp
[0]));
2207 code_scanner_last_string_free ();
2209 /* Line 1740 of yacc.c */
2210 #line 2211 "src/parse-gram.c"
2214 /* Line 1740 of yacc.c */
2215 #line 277 "src/parse-gram.y"
2217 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2219 /* Line 1740 of yacc.c */
2220 #line 2221 "src/parse-gram.c"
2224 /* Line 1740 of yacc.c */
2225 #line 281 "src/parse-gram.y"
2227 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2228 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2230 /* Line 1740 of yacc.c */
2231 #line 2232 "src/parse-gram.c"
2235 /* Line 1740 of yacc.c */
2236 #line 285 "src/parse-gram.y"
2237 { defines_flag
= true; }
2238 /* Line 1740 of yacc.c */
2239 #line 2240 "src/parse-gram.c"
2243 /* Line 1740 of yacc.c */
2244 #line 287 "src/parse-gram.y"
2246 defines_flag
= true;
2247 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2249 /* Line 1740 of yacc.c */
2250 #line 2251 "src/parse-gram.c"
2254 /* Line 1740 of yacc.c */
2255 #line 292 "src/parse-gram.y"
2257 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2258 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2260 /* Line 1740 of yacc.c */
2261 #line 2262 "src/parse-gram.c"
2265 /* Line 1740 of yacc.c */
2266 #line 296 "src/parse-gram.y"
2267 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2268 /* Line 1740 of yacc.c */
2269 #line 2270 "src/parse-gram.c"
2273 /* Line 1740 of yacc.c */
2274 #line 297 "src/parse-gram.y"
2275 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2276 /* Line 1740 of yacc.c */
2277 #line 2278 "src/parse-gram.c"
2281 /* Line 1740 of yacc.c */
2282 #line 298 "src/parse-gram.y"
2283 { spec_file_prefix
= (yyvsp
[0].chars
); }
2284 /* Line 1740 of yacc.c */
2285 #line 2286 "src/parse-gram.c"
2289 /* Line 1740 of yacc.c */
2290 #line 299 "src/parse-gram.y"
2291 { spec_file_prefix
= (yyvsp
[0].chars
); }
2292 /* Line 1740 of yacc.c */
2293 #line 2294 "src/parse-gram.c"
2297 /* Line 1740 of yacc.c */
2298 #line 301 "src/parse-gram.y"
2300 nondeterministic_parser
= true;
2303 /* Line 1740 of yacc.c */
2304 #line 2305 "src/parse-gram.c"
2308 /* Line 1740 of yacc.c */
2309 #line 306 "src/parse-gram.y"
2312 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2313 code_props_translate_code (&action
);
2314 gram_scanner_last_string_free ();
2315 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2316 code_scanner_last_string_free ();
2318 /* Line 1740 of yacc.c */
2319 #line 2320 "src/parse-gram.c"
2323 /* Line 1740 of yacc.c */
2324 #line 314 "src/parse-gram.y"
2325 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2326 /* Line 1740 of yacc.c */
2327 #line 2328 "src/parse-gram.c"
2331 /* Line 1740 of yacc.c */
2332 #line 315 "src/parse-gram.y"
2333 { spec_name_prefix
= (yyvsp
[0].chars
); }
2334 /* Line 1740 of yacc.c */
2335 #line 2336 "src/parse-gram.c"
2339 /* Line 1740 of yacc.c */
2340 #line 316 "src/parse-gram.y"
2341 { spec_name_prefix
= (yyvsp
[0].chars
); }
2342 /* Line 1740 of yacc.c */
2343 #line 2344 "src/parse-gram.c"
2347 /* Line 1740 of yacc.c */
2348 #line 317 "src/parse-gram.y"
2349 { no_lines_flag
= true; }
2350 /* Line 1740 of yacc.c */
2351 #line 2352 "src/parse-gram.c"
2355 /* Line 1740 of yacc.c */
2356 #line 318 "src/parse-gram.y"
2357 { nondeterministic_parser
= true; }
2358 /* Line 1740 of yacc.c */
2359 #line 2360 "src/parse-gram.c"
2363 /* Line 1740 of yacc.c */
2364 #line 319 "src/parse-gram.y"
2365 { spec_outfile
= (yyvsp
[0].chars
); }
2366 /* Line 1740 of yacc.c */
2367 #line 2368 "src/parse-gram.c"
2371 /* Line 1740 of yacc.c */
2372 #line 320 "src/parse-gram.y"
2373 { spec_outfile
= (yyvsp
[0].chars
); }
2374 /* Line 1740 of yacc.c */
2375 #line 2376 "src/parse-gram.c"
2379 /* Line 1740 of yacc.c */
2380 #line 321 "src/parse-gram.y"
2381 { current_param
= (yyvsp
[0].param
); }
2382 /* Line 1740 of yacc.c */
2383 #line 2384 "src/parse-gram.c"
2387 /* Line 1740 of yacc.c */
2388 #line 321 "src/parse-gram.y"
2389 { current_param
= param_none
; }
2390 /* Line 1740 of yacc.c */
2391 #line 2392 "src/parse-gram.c"
2395 /* Line 1740 of yacc.c */
2396 #line 322 "src/parse-gram.y"
2397 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2398 /* Line 1740 of yacc.c */
2399 #line 2400 "src/parse-gram.c"
2403 /* Line 1740 of yacc.c */
2404 #line 324 "src/parse-gram.y"
2406 char const *skeleton_user
= (yyvsp
[0].chars
);
2407 if (strchr (skeleton_user
, '/'))
2409 size_t dir_length
= strlen (current_file
);
2410 char *skeleton_build
;
2411 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2413 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2416 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2419 strncpy (skeleton_build
, current_file
, dir_length
);
2420 skeleton_build
[dir_length
++] = '/';
2422 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2423 skeleton_user
= uniqstr_new (skeleton_build
);
2424 free (skeleton_build
);
2426 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2428 /* Line 1740 of yacc.c */
2429 #line 2430 "src/parse-gram.c"
2433 /* Line 1740 of yacc.c */
2434 #line 347 "src/parse-gram.y"
2435 { token_table_flag
= true; }
2436 /* Line 1740 of yacc.c */
2437 #line 2438 "src/parse-gram.c"
2441 /* Line 1740 of yacc.c */
2442 #line 348 "src/parse-gram.y"
2443 { report_flag
|= report_states
; }
2444 /* Line 1740 of yacc.c */
2445 #line 2446 "src/parse-gram.c"
2449 /* Line 1740 of yacc.c */
2450 #line 349 "src/parse-gram.y"
2451 { yacc_flag
= true; }
2452 /* Line 1740 of yacc.c */
2453 #line 2454 "src/parse-gram.c"
2457 /* Line 1740 of yacc.c */
2458 #line 354 "src/parse-gram.y"
2459 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2460 /* Line 1740 of yacc.c */
2461 #line 2462 "src/parse-gram.c"
2465 /* Line 1740 of yacc.c */
2466 #line 355 "src/parse-gram.y"
2467 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2468 /* Line 1740 of yacc.c */
2469 #line 2470 "src/parse-gram.c"
2473 /* Line 1740 of yacc.c */
2474 #line 367 "src/parse-gram.y"
2476 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2478 /* Line 1740 of yacc.c */
2479 #line 2480 "src/parse-gram.c"
2483 /* Line 1740 of yacc.c */
2484 #line 371 "src/parse-gram.y"
2487 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2488 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2489 symbol_list_free ((yyvsp
[0].list
));
2491 /* Line 1740 of yacc.c */
2492 #line 2493 "src/parse-gram.c"
2496 /* Line 1740 of yacc.c */
2497 #line 378 "src/parse-gram.y"
2500 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2501 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2502 symbol_list_free ((yyvsp
[0].list
));
2504 /* Line 1740 of yacc.c */
2505 #line 2506 "src/parse-gram.c"
2509 /* Line 1740 of yacc.c */
2510 #line 385 "src/parse-gram.y"
2512 default_prec
= true;
2514 /* Line 1740 of yacc.c */
2515 #line 2516 "src/parse-gram.c"
2519 /* Line 1740 of yacc.c */
2520 #line 389 "src/parse-gram.y"
2522 default_prec
= false;
2524 /* Line 1740 of yacc.c */
2525 #line 2526 "src/parse-gram.c"
2529 /* Line 1740 of yacc.c */
2530 #line 393 "src/parse-gram.y"
2532 /* Do not invoke muscle_percent_code_grow here since it invokes
2533 muscle_user_name_list_grow. */
2534 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2535 code_scanner_last_string_free ();
2537 /* Line 1740 of yacc.c */
2538 #line 2539 "src/parse-gram.c"
2542 /* Line 1740 of yacc.c */
2543 #line 400 "src/parse-gram.y"
2545 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2546 code_scanner_last_string_free ();
2548 /* Line 1740 of yacc.c */
2549 #line 2550 "src/parse-gram.c"
2553 /* Line 1740 of yacc.c */
2554 #line 414 "src/parse-gram.y"
2556 /* Line 1740 of yacc.c */
2557 #line 2558 "src/parse-gram.c"
2561 /* Line 1740 of yacc.c */
2562 #line 415 "src/parse-gram.y"
2563 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2564 /* Line 1740 of yacc.c */
2565 #line 2566 "src/parse-gram.c"
2569 /* Line 1740 of yacc.c */
2570 #line 420 "src/parse-gram.y"
2573 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2574 code_scanner_last_string_free ();
2576 /* Line 1740 of yacc.c */
2577 #line 2578 "src/parse-gram.c"
2581 /* Line 1740 of yacc.c */
2582 #line 431 "src/parse-gram.y"
2583 { current_class
= nterm_sym
; }
2584 /* Line 1740 of yacc.c */
2585 #line 2586 "src/parse-gram.c"
2589 /* Line 1740 of yacc.c */
2590 #line 432 "src/parse-gram.y"
2592 current_class
= unknown_sym
;
2593 current_type
= NULL
;
2595 /* Line 1740 of yacc.c */
2596 #line 2597 "src/parse-gram.c"
2600 /* Line 1740 of yacc.c */
2601 #line 436 "src/parse-gram.y"
2602 { current_class
= token_sym
; }
2603 /* Line 1740 of yacc.c */
2604 #line 2605 "src/parse-gram.c"
2608 /* Line 1740 of yacc.c */
2609 #line 437 "src/parse-gram.y"
2611 current_class
= unknown_sym
;
2612 current_type
= NULL
;
2614 /* Line 1740 of yacc.c */
2615 #line 2616 "src/parse-gram.c"
2619 /* Line 1740 of yacc.c */
2620 #line 442 "src/parse-gram.y"
2624 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2625 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2626 symbol_list_free ((yyvsp
[0].list
));
2628 /* Line 1740 of yacc.c */
2629 #line 2630 "src/parse-gram.c"
2633 /* Line 1740 of yacc.c */
2634 #line 453 "src/parse-gram.y"
2638 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2640 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2641 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2643 symbol_list_free ((yyvsp
[0].list
));
2644 current_type
= NULL
;
2646 /* Line 1740 of yacc.c */
2647 #line 2648 "src/parse-gram.c"
2651 /* Line 1740 of yacc.c */
2652 #line 467 "src/parse-gram.y"
2653 { (yyval
.assoc
) = left_assoc
; }
2654 /* Line 1740 of yacc.c */
2655 #line 2656 "src/parse-gram.c"
2659 /* Line 1740 of yacc.c */
2660 #line 468 "src/parse-gram.y"
2661 { (yyval
.assoc
) = right_assoc
; }
2662 /* Line 1740 of yacc.c */
2663 #line 2664 "src/parse-gram.c"
2667 /* Line 1740 of yacc.c */
2668 #line 469 "src/parse-gram.y"
2669 { (yyval
.assoc
) = non_assoc
; }
2670 /* Line 1740 of yacc.c */
2671 #line 2672 "src/parse-gram.c"
2675 /* Line 1740 of yacc.c */
2676 #line 470 "src/parse-gram.y"
2677 { (yyval
.assoc
) = precedence_assoc
; }
2678 /* Line 1740 of yacc.c */
2679 #line 2680 "src/parse-gram.c"
2683 /* Line 1740 of yacc.c */
2684 #line 474 "src/parse-gram.y"
2685 { current_type
= NULL
; }
2686 /* Line 1740 of yacc.c */
2687 #line 2688 "src/parse-gram.c"
2691 /* Line 1740 of yacc.c */
2692 #line 475 "src/parse-gram.y"
2693 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2694 /* Line 1740 of yacc.c */
2695 #line 2696 "src/parse-gram.c"
2699 /* Line 1740 of yacc.c */
2700 #line 481 "src/parse-gram.y"
2701 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2702 /* Line 1740 of yacc.c */
2703 #line 2704 "src/parse-gram.c"
2707 /* Line 1740 of yacc.c */
2708 #line 483 "src/parse-gram.y"
2709 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2710 /* Line 1740 of yacc.c */
2711 #line 2712 "src/parse-gram.c"
2715 /* Line 1740 of yacc.c */
2716 #line 487 "src/parse-gram.y"
2717 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2718 /* Line 1740 of yacc.c */
2719 #line 2720 "src/parse-gram.c"
2723 /* Line 1740 of yacc.c */
2724 #line 488 "src/parse-gram.y"
2725 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2726 /* Line 1740 of yacc.c */
2727 #line 2728 "src/parse-gram.c"
2731 /* Line 1740 of yacc.c */
2732 #line 494 "src/parse-gram.y"
2733 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2734 /* Line 1740 of yacc.c */
2735 #line 2736 "src/parse-gram.c"
2739 /* Line 1740 of yacc.c */
2740 #line 496 "src/parse-gram.y"
2741 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2742 /* Line 1740 of yacc.c */
2743 #line 2744 "src/parse-gram.c"
2747 /* Line 1740 of yacc.c */
2748 #line 500 "src/parse-gram.y"
2749 { (yyval
.list
) = (yyvsp
[0].list
); }
2750 /* Line 1740 of yacc.c */
2751 #line 2752 "src/parse-gram.c"
2755 /* Line 1740 of yacc.c */
2756 #line 501 "src/parse-gram.y"
2757 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2758 /* Line 1740 of yacc.c */
2759 #line 2760 "src/parse-gram.c"
2763 /* Line 1740 of yacc.c */
2764 #line 505 "src/parse-gram.y"
2765 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2766 /* Line 1740 of yacc.c */
2767 #line 2768 "src/parse-gram.c"
2771 /* Line 1740 of yacc.c */
2772 #line 506 "src/parse-gram.y"
2773 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2774 /* Line 1740 of yacc.c */
2775 #line 2776 "src/parse-gram.c"
2779 /* Line 1740 of yacc.c */
2780 #line 507 "src/parse-gram.y"
2781 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2782 /* Line 1740 of yacc.c */
2783 #line 2784 "src/parse-gram.c"
2787 /* Line 1740 of yacc.c */
2788 #line 508 "src/parse-gram.y"
2789 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2790 /* Line 1740 of yacc.c */
2791 #line 2792 "src/parse-gram.c"
2795 /* Line 1740 of yacc.c */
2796 #line 514 "src/parse-gram.y"
2798 current_type
= (yyvsp
[0].uniqstr
);
2801 /* Line 1740 of yacc.c */
2802 #line 2803 "src/parse-gram.c"
2806 /* Line 1740 of yacc.c */
2807 #line 519 "src/parse-gram.y"
2809 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2810 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2812 /* Line 1740 of yacc.c */
2813 #line 2814 "src/parse-gram.c"
2817 /* Line 1740 of yacc.c */
2818 #line 524 "src/parse-gram.y"
2820 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2821 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2822 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2824 /* Line 1740 of yacc.c */
2825 #line 2826 "src/parse-gram.c"
2829 /* Line 1740 of yacc.c */
2830 #line 530 "src/parse-gram.y"
2832 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2833 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2834 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2836 /* Line 1740 of yacc.c */
2837 #line 2838 "src/parse-gram.c"
2841 /* Line 1740 of yacc.c */
2842 #line 536 "src/parse-gram.y"
2844 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2845 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2846 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2847 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2849 /* Line 1740 of yacc.c */
2850 #line 2851 "src/parse-gram.c"
2854 /* Line 1740 of yacc.c */
2855 #line 566 "src/parse-gram.y"
2859 /* Line 1740 of yacc.c */
2860 #line 2861 "src/parse-gram.c"
2864 /* Line 1740 of yacc.c */
2865 #line 572 "src/parse-gram.y"
2866 { current_lhs
= (yyvsp
[-1].symbol
); current_lhs_location
= (yylsp
[-1]);
2867 current_lhs_named_ref
= (yyvsp
[0].named_ref
); }
2868 /* Line 1740 of yacc.c */
2869 #line 2870 "src/parse-gram.c"
2873 /* Line 1740 of yacc.c */
2874 #line 577 "src/parse-gram.y"
2875 { grammar_current_rule_end ((yylsp
[0])); }
2876 /* Line 1740 of yacc.c */
2877 #line 2878 "src/parse-gram.c"
2881 /* Line 1740 of yacc.c */
2882 #line 578 "src/parse-gram.y"
2883 { grammar_current_rule_end ((yylsp
[0])); }
2884 /* Line 1740 of yacc.c */
2885 #line 2886 "src/parse-gram.c"
2889 /* Line 1740 of yacc.c */
2890 #line 584 "src/parse-gram.y"
2891 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2892 current_lhs_named_ref
); }
2893 /* Line 1740 of yacc.c */
2894 #line 2895 "src/parse-gram.c"
2898 /* Line 1740 of yacc.c */
2899 #line 587 "src/parse-gram.y"
2900 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2901 /* Line 1740 of yacc.c */
2902 #line 2903 "src/parse-gram.c"
2906 /* Line 1740 of yacc.c */
2907 #line 589 "src/parse-gram.y"
2908 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2909 /* Line 1740 of yacc.c */
2910 #line 2911 "src/parse-gram.c"
2914 /* Line 1740 of yacc.c */
2915 #line 591 "src/parse-gram.y"
2916 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2917 /* Line 1740 of yacc.c */
2918 #line 2919 "src/parse-gram.c"
2922 /* Line 1740 of yacc.c */
2923 #line 593 "src/parse-gram.y"
2924 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2925 /* Line 1740 of yacc.c */
2926 #line 2927 "src/parse-gram.c"
2930 /* Line 1740 of yacc.c */
2931 #line 595 "src/parse-gram.y"
2932 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2933 /* Line 1740 of yacc.c */
2934 #line 2935 "src/parse-gram.c"
2938 /* Line 1740 of yacc.c */
2939 #line 597 "src/parse-gram.y"
2940 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2941 /* Line 1740 of yacc.c */
2942 #line 2943 "src/parse-gram.c"
2946 /* Line 1740 of yacc.c */
2947 #line 601 "src/parse-gram.y"
2948 { (yyval
.named_ref
) = 0; }
2949 /* Line 1740 of yacc.c */
2950 #line 2951 "src/parse-gram.c"
2954 /* Line 1740 of yacc.c */
2955 #line 603 "src/parse-gram.y"
2956 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2957 /* Line 1740 of yacc.c */
2958 #line 2959 "src/parse-gram.c"
2962 /* Line 1740 of yacc.c */
2963 #line 614 "src/parse-gram.y"
2964 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2965 /* Line 1740 of yacc.c */
2966 #line 2967 "src/parse-gram.c"
2970 /* Line 1740 of yacc.c */
2971 #line 619 "src/parse-gram.y"
2972 { (yyval
.chars
) = ""; }
2973 /* Line 1740 of yacc.c */
2974 #line 2975 "src/parse-gram.c"
2978 /* Line 1740 of yacc.c */
2979 #line 620 "src/parse-gram.y"
2980 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2981 /* Line 1740 of yacc.c */
2982 #line 2983 "src/parse-gram.c"
2986 /* Line 1740 of yacc.c */
2987 #line 631 "src/parse-gram.y"
2989 code_props plain_code
;
2990 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2991 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2992 code_props_translate_code (&plain_code
);
2993 gram_scanner_last_string_free ();
2994 (yyval
.chars
) = plain_code
.code
;
2996 /* Line 1740 of yacc.c */
2997 #line 2998 "src/parse-gram.c"
3001 /* Line 1740 of yacc.c */
3002 #line 651 "src/parse-gram.y"
3003 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
3004 /* Line 1740 of yacc.c */
3005 #line 3006 "src/parse-gram.c"
3009 /* Line 1740 of yacc.c */
3010 #line 653 "src/parse-gram.y"
3012 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
3013 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
3014 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
3016 /* Line 1740 of yacc.c */
3017 #line 3018 "src/parse-gram.c"
3021 /* Line 1740 of yacc.c */
3022 #line 661 "src/parse-gram.y"
3023 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
3024 /* Line 1740 of yacc.c */
3025 #line 3026 "src/parse-gram.c"
3029 /* Line 1740 of yacc.c */
3030 #line 673 "src/parse-gram.y"
3032 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
3033 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
3035 /* Line 1740 of yacc.c */
3036 #line 3037 "src/parse-gram.c"
3040 /* Line 1740 of yacc.c */
3041 #line 682 "src/parse-gram.y"
3043 code_props plain_code
;
3044 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
3045 code_props_translate_code (&plain_code
);
3046 gram_scanner_last_string_free ();
3047 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
3048 code_scanner_last_string_free ();
3050 /* Line 1740 of yacc.c */
3051 #line 3052 "src/parse-gram.c"
3055 /* Line 1740 of yacc.c */
3056 #line 3057 "src/parse-gram.c"
3059 if (yychar_backup
!= yychar
)
3060 YY_LAC_DISCARD ("yychar change");
3062 /* User semantic actions sometimes alter yychar, and that requires
3063 that yytoken be updated with the new translation. We take the
3064 approach of translating immediately before every use of yytoken.
3065 One alternative is translating here after every semantic action,
3066 but that translation would be missed if the semantic action invokes
3067 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3068 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3069 incorrect destructor might then be invoked immediately. In the
3070 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3071 to an incorrect destructor call or verbose syntax error message
3072 before the lookahead is translated. */
3073 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3077 YY_STACK_PRINT (yyss
, yyssp
);
3082 /* Now `shift' the result of the reduction. Determine what state
3083 that goes to, based on the state we popped back to and the rule
3084 number reduced by. */
3088 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3089 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3090 yystate
= yytable
[yystate
];
3092 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3097 /*------------------------------------.
3098 | yyerrlab -- here on detecting error |
3099 `------------------------------------*/
3101 /* Make sure we have latest lookahead translation. See comments at
3102 user semantic actions for why this is necessary. */
3103 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3105 /* If not already recovering from an error, report this error. */
3109 #if ! YYERROR_VERBOSE
3110 yyerror (YY_("syntax error"));
3112 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3113 yyesa, &yyes, &yyes_capacity, \
3116 char const *yymsgp
= YY_("syntax error");
3117 int yysyntax_error_status
;
3118 if (yychar
!= YYEMPTY
)
3120 yysyntax_error_status
= YYSYNTAX_ERROR
;
3121 if (yysyntax_error_status
== 0)
3123 else if (yysyntax_error_status
== 1)
3125 if (yymsg
!= yymsgbuf
)
3126 YYSTACK_FREE (yymsg
);
3127 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3131 yymsg_alloc
= sizeof yymsgbuf
;
3132 yysyntax_error_status
= 2;
3136 yysyntax_error_status
= YYSYNTAX_ERROR
;
3141 if (yysyntax_error_status
== 2)
3142 goto yyexhaustedlab
;
3144 # undef YYSYNTAX_ERROR
3148 yyerror_range
[1] = yylloc
;
3150 if (yyerrstatus
== 3)
3152 /* If just tried and failed to reuse lookahead token after an
3153 error, discard it. */
3155 if (yychar
<= YYEOF
)
3157 /* Return failure if at end of input. */
3158 if (yychar
== YYEOF
)
3163 yydestruct ("Error: discarding",
3164 yytoken
, &yylval
, &yylloc
);
3169 /* Else will try to reuse lookahead token after shifting the error
3174 /*---------------------------------------------------.
3175 | yyerrorlab -- error raised explicitly by YYERROR. |
3176 `---------------------------------------------------*/
3179 /* Pacify compilers like GCC when the user code never invokes
3180 YYERROR and the label yyerrorlab therefore never appears in user
3182 if (/*CONSTCOND*/ 0)
3185 yyerror_range
[1] = yylsp
[1-yylen
];
3186 /* Do not reclaim the symbols of the rule which action triggered
3190 YY_STACK_PRINT (yyss
, yyssp
);
3195 /*-------------------------------------------------------------.
3196 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3197 `-------------------------------------------------------------*/
3199 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3203 yyn
= yypact
[yystate
];
3204 if (!yypact_value_is_default (yyn
))
3207 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3215 /* Pop the current state because it cannot handle the error token. */
3219 yyerror_range
[1] = *yylsp
;
3220 yydestruct ("Error: popping",
3221 yystos
[yystate
], yyvsp
, yylsp
);
3224 YY_STACK_PRINT (yyss
, yyssp
);
3227 /* If the stack popping above didn't lose the initial context for the
3228 current lookahead token, the shift below will for sure. */
3229 YY_LAC_DISCARD ("error recovery");
3233 yyerror_range
[2] = yylloc
;
3234 /* Using YYLLOC is tempting, but would change the location of
3235 the lookahead. YYLOC is available though. */
3236 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3239 /* Shift the error token. */
3240 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3246 /*-------------------------------------.
3247 | yyacceptlab -- YYACCEPT comes here. |
3248 `-------------------------------------*/
3253 /*-----------------------------------.
3254 | yyabortlab -- YYABORT comes here. |
3255 `-----------------------------------*/
3261 /*-------------------------------------------------.
3262 | yyexhaustedlab -- memory exhaustion comes here. |
3263 `-------------------------------------------------*/
3265 yyerror (YY_("memory exhausted"));
3271 if (yychar
!= YYEMPTY
)
3273 /* Make sure we have latest lookahead translation. See comments at
3274 user semantic actions for why this is necessary. */
3275 yytoken
= YYTRANSLATE (yychar
);
3276 yydestruct ("Cleanup: discarding lookahead",
3277 yytoken
, &yylval
, &yylloc
);
3279 /* Do not reclaim the symbols of the rule which action triggered
3280 this YYABORT or YYACCEPT. */
3282 YY_STACK_PRINT (yyss
, yyssp
);
3283 while (yyssp
!= yyss
)
3285 yydestruct ("Cleanup: popping",
3286 yystos
[*yyssp
], yyvsp
, yylsp
);
3291 YYSTACK_FREE (yyss
);
3294 YYSTACK_FREE (yyes
);
3296 if (yymsg
!= yymsgbuf
)
3297 YYSTACK_FREE (yymsg
);
3299 /* Make sure YYID is used. */
3300 return YYID (yyresult
);
3303 /* Line 2000 of yacc.c */
3304 #line 692 "src/parse-gram.y"
3308 /* Return the location of the left-hand side of a rule whose
3309 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3310 the right-hand side, and return an empty location equal to the end
3311 boundary of RHS[0] if the right-hand side is empty. */
3314 lloc_default (YYLTYPE
const *rhs
, int n
)
3319 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3320 The bug is fixed in 7.4.2m, but play it safe for now. */
3321 loc
.start
= rhs
[n
].end
;
3322 loc
.end
= rhs
[n
].end
;
3324 /* Ignore empty nonterminals the start of the the right-hand side.
3325 Do not bother to ignore them at the end of the right-hand side,
3326 since empty nonterminals have the same end as their predecessors. */
3327 for (i
= 1; i
<= n
; i
++)
3328 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3330 loc
.start
= rhs
[i
].start
;
3339 add_param (param_type type
, char *decl
, location loc
)
3341 static char const alphanum
[26 + 26 + 1 + 10] =
3342 "abcdefghijklmnopqrstuvwxyz"
3343 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3347 char const *name_start
= NULL
;
3350 /* Stop on last actual character. */
3351 for (p
= decl
; p
[1]; p
++)
3353 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3354 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3357 /* Strip the surrounding '{' and '}', and any blanks just inside
3359 while (*--p
== ' ' || *p
== '\t')
3362 while (*++decl
== ' ' || *decl
== '\t')
3367 complain_at (loc
, _("missing identifier in parameter declaration"));
3374 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3378 name
= xmalloc (name_len
+ 1);
3379 memcpy (name
, name_start
, name_len
);
3380 name
[name_len
] = '\0';
3381 if (type
& param_lex
)
3382 muscle_pair_list_grow ("lex_param", decl
, name
);
3383 if (type
& param_parse
)
3384 muscle_pair_list_grow ("parse_param", decl
, name
);
3388 gram_scanner_last_string_free ();
3393 version_check (location
const *loc
, char const *version
)
3395 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3397 complain_at (*loc
, "require bison %s, but have %s",
3398 version
, PACKAGE_VERSION
);
3404 gram_error (location
const *loc
, char const *msg
)
3406 complain_at (*loc
, "%s", msg
);
3410 token_name (int type
)
3412 return yytname
[YYTRANSLATE (type
)];
3423 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3424 return quotearg_style (escape_quoting_style
, buf
);