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