1 /* A Bison parser, made by GNU Bison 2.7.1164-a174b-dirty. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 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.7.1164-a174b-dirty"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Substitute the type names. */
62 #define YYSTYPE GRAM_STYPE
63 #define YYLTYPE GRAM_LTYPE
64 /* Substitute the variable and function names. */
65 #define yyparse gram_parse
66 #define yylex gram_lex
67 #define yyerror gram_error
68 #define yydebug gram_debug
69 #define yynerrs gram_nerrs
72 /* Copy the first part of user declarations. */
74 #line 75 "src/parse-gram.c" /* yacc.c:356 */
77 # if defined __cplusplus && 201103L <= __cplusplus
78 # define YY_NULL nullptr
84 /* Enabling verbose error messages. */
85 #ifdef YYERROR_VERBOSE
86 # undef YYERROR_VERBOSE
87 # define YYERROR_VERBOSE 1
89 # define YYERROR_VERBOSE 1
92 /* In a future release of Bison, this section will be replaced
93 by #include "src/parse-gram.h". */
94 #ifndef YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
95 # define YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
100 # define GRAM_DEBUG 1
102 # define GRAM_DEBUG 0
104 # else /* ! defined YYDEBUG */
105 # define GRAM_DEBUG 1
106 # endif /* ! defined YYDEBUG */
107 #endif /* ! defined GRAM_DEBUG */
109 extern int gram_debug
;
111 /* "%code requires" blocks. */
112 #line 21 "src/parse-gram.y" /* yacc.c:372 */
116 #line 209 "src/parse-gram.y" /* yacc.c:372 */
122 param_parse
= 1 << 1,
123 param_both
= param_lex
| param_parse
125 #line 640 "src/parse-gram.y" /* yacc.c:372 */
126 #include "muscle-tab.h"
128 #line 129 "src/parse-gram.c" /* yacc.c:372 */
131 #ifndef GRAM_TOKENTYPE
132 # define GRAM_TOKENTYPE
140 PERCENT_DESTRUCTOR
= 262,
141 PERCENT_PRINTER
= 263,
144 PERCENT_NONASSOC
= 266,
145 PERCENT_PRECEDENCE
= 267,
150 PERCENT_DEFAULT_PREC
= 272,
151 PERCENT_DEFINE
= 273,
152 PERCENT_DEFINES
= 274,
153 PERCENT_ERROR_VERBOSE
= 275,
154 PERCENT_EXPECT
= 276,
155 PERCENT_EXPECT_RR
= 277,
157 PERCENT_FILE_PREFIX
= 279,
158 PERCENT_GLR_PARSER
= 280,
159 PERCENT_INITIAL_ACTION
= 281,
160 PERCENT_LANGUAGE
= 282,
161 PERCENT_NAME_PREFIX
= 283,
162 PERCENT_NO_DEFAULT_PREC
= 284,
163 PERCENT_NO_LINES
= 285,
164 PERCENT_NONDETERMINISTIC_PARSER
= 286,
165 PERCENT_OUTPUT
= 287,
166 PERCENT_REQUIRE
= 288,
167 PERCENT_SKELETON
= 289,
169 PERCENT_TOKEN_TABLE
= 291,
170 PERCENT_VERBOSE
= 292,
173 BRACED_PREDICATE
= 295,
180 PERCENT_PERCENT
= 302,
195 #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
196 typedef union GRAM_STYPE GRAM_STYPE
;
199 #line 161 "src/parse-gram.y" /* yacc.c:372 */
200 unsigned char character
;
201 #line 168 "src/parse-gram.y" /* yacc.c:372 */
205 #line 179 "src/parse-gram.y" /* yacc.c:372 */
207 #line 187 "src/parse-gram.y" /* yacc.c:372 */
209 #line 191 "src/parse-gram.y" /* yacc.c:372 */
211 #line 196 "src/parse-gram.y" /* yacc.c:372 */
213 #line 199 "src/parse-gram.y" /* yacc.c:372 */
215 #line 202 "src/parse-gram.y" /* yacc.c:372 */
216 named_ref
*named_ref
;
217 #line 229 "src/parse-gram.y" /* yacc.c:372 */
219 #line 404 "src/parse-gram.y" /* yacc.c:372 */
220 code_props_type code_type
;
221 #line 642 "src/parse-gram.y" /* yacc.c:372 */
229 #line 230 "src/parse-gram.c" /* yacc.c:372 */
231 # define GRAM_STYPE_IS_TRIVIAL 1
232 # define GRAM_STYPE_IS_DECLARED 1
236 #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
237 typedef struct GRAM_LTYPE GRAM_LTYPE
;
245 # define GRAM_LTYPE_IS_DECLARED 1
246 # define GRAM_LTYPE_IS_TRIVIAL 1
251 int gram_parse (void);
253 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */
255 /* Copy the second part of user declarations. */
257 #line 258 "src/parse-gram.c" /* yacc.c:375 */
258 /* Unqualified %code blocks. */
259 #line 27 "src/parse-gram.y" /* yacc.c:376 */
265 #include "complain.h"
266 #include "conflicts.h"
270 #include "named-ref.h"
271 #include "quotearg.h"
273 #include "scan-gram.h"
274 #include "scan-code.h"
275 #include "xmemdup0.h"
277 static int current_prec
= 0;
278 static location current_lhs_location
;
279 static named_ref
*current_lhs_named_ref
;
280 static symbol
*current_lhs_symbol
;
281 static symbol_class current_class
= unknown_sym
;
282 static uniqstr current_type
= NULL
;
284 /** Set the new current left-hand side symbol, possibly common
285 * to several right-hand side parts of rule.
287 static void current_lhs (symbol
*sym
, location loc
, named_ref
*ref
);
289 #define YYLLOC_DEFAULT(Current, Rhs, N) \
290 (Current) = lloc_default (Rhs, N)
291 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
293 #define YY_LOCATION_PRINT(File, Loc) \
294 location_print (Loc, File)
296 static void version_check (location
const *loc
, char const *version
);
298 static void gram_error (location
const *, char const *);
300 /* A string that describes a char (e.g., 'a' -> "'a'"). */
301 static char const *char_name (char);
303 #define YYTYPE_INT16 int_fast16_t
304 #define YYTYPE_INT8 int_fast8_t
305 #define YYTYPE_UINT16 uint_fast16_t
306 #define YYTYPE_UINT8 uint_fast8_t
307 #line 219 "src/parse-gram.y" /* yacc.c:376 */
309 /** Add a lex-param and/or a parse-param.
311 * \param type where to push this formal argument.
312 * \param decl the formal argument. Destroyed.
313 * \param loc the location in the source.
315 static void add_param (param_type type
, char *decl
, location loc
);
316 static param_type current_param
= param_none
;
318 #line 319 "src/parse-gram.c" /* yacc.c:376 */
325 typedef YYTYPE_UINT8 yytype_uint8
;
327 typedef unsigned char yytype_uint8
;
331 typedef YYTYPE_INT8 yytype_int8
;
333 typedef signed char yytype_int8
;
337 typedef YYTYPE_UINT16 yytype_uint16
;
339 typedef unsigned short int yytype_uint16
;
343 typedef YYTYPE_INT16 yytype_int16
;
345 typedef short int yytype_int16
;
349 # ifdef __SIZE_TYPE__
350 # define YYSIZE_T __SIZE_TYPE__
351 # elif defined size_t
352 # define YYSIZE_T size_t
353 # elif ! defined YYSIZE_T
354 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
355 # define YYSIZE_T size_t
357 # define YYSIZE_T unsigned int
361 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
364 # if defined YYENABLE_NLS && YYENABLE_NLS
366 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
367 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
371 # define YY_(Msgid) Msgid
375 #ifndef __attribute__
376 /* This feature is available in gcc versions 2.5 and later. */
377 # if (! defined __GNUC__ || __GNUC__ < 2 \
378 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
379 # define __attribute__(Spec) /* empty */
383 /* Suppress unused-variable warnings by "using" E. */
384 #if ! defined lint || defined __GNUC__
385 # define YYUSE(E) ((void) (E))
387 # define YYUSE(E) /* empty */
393 /* The parser invokes alloca or malloc; define the necessary symbols. */
395 # ifdef YYSTACK_ALLOC
396 /* Pacify GCC's 'empty if-body' warning. */
397 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
398 # ifndef YYSTACK_ALLOC_MAXIMUM
399 /* The OS might guarantee only one guard page at the bottom of the stack,
400 and a page size can be as small as 4096 bytes. So we cannot safely
401 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
402 to allow for a few compiler-allocated temporary stack slots. */
403 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
406 # define YYSTACK_ALLOC YYMALLOC
407 # define YYSTACK_FREE YYFREE
408 # ifndef YYSTACK_ALLOC_MAXIMUM
409 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
411 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
412 && ! ((defined YYMALLOC || defined malloc) \
413 && (defined YYFREE || defined free)))
414 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
415 # ifndef EXIT_SUCCESS
416 # define EXIT_SUCCESS 0
420 # define YYMALLOC malloc
421 # if ! defined malloc && ! defined EXIT_SUCCESS
422 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
427 # if ! defined free && ! defined EXIT_SUCCESS
428 void free (void *); /* INFRINGES ON USER NAME SPACE */
432 # define YYCOPY_NEEDED 1
436 #if (! defined yyoverflow \
437 && (! defined __cplusplus \
438 || (defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL \
439 && defined GRAM_STYPE_IS_TRIVIAL && GRAM_STYPE_IS_TRIVIAL)))
441 /* A type that is properly aligned for any stack member. */
444 yytype_int16 yyss_alloc
;
449 /* The size of the maximum gap between one aligned stack and the next. */
450 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
452 /* The size of an array large to enough to hold all stacks, each with
454 # define YYSTACK_BYTES(N) \
455 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
456 + 2 * YYSTACK_GAP_MAXIMUM)
458 # define YYCOPY_NEEDED 1
460 /* Relocate STACK from its old location to the new one. The
461 local variables YYSIZE and YYSTACKSIZE give the old and new number of
462 elements in the stack, and YYPTR gives the new location of the
463 stack. Advance YYPTR to a properly aligned location for the next
465 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
468 YYSIZE_T yynewbytes; \
469 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
470 Stack = &yyptr->Stack_alloc; \
471 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
472 yyptr += yynewbytes / sizeof (*yyptr); \
478 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
479 /* Copy COUNT objects from SRC to DST. The source and destination do
482 # if defined __GNUC__ && 1 < __GNUC__
483 # define YYCOPY(Dst, Src, Count) \
484 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
486 # define YYCOPY(Dst, Src, Count) \
490 for (yyi = 0; yyi < (Count); yyi++) \
491 (Dst)[yyi] = (Src)[yyi]; \
496 #endif /* !YYCOPY_NEEDED */
498 /* YYFINAL -- State number of the termination state. */
500 /* YYLAST -- Last index in YYTABLE. */
503 /* YYNTOKENS -- Number of terminals. */
505 /* YYNNTS -- Number of nonterminals. */
507 /* YYNRULES -- Number of rules. */
509 /* YYNSTATES -- Number of states. */
510 #define YYNSTATES 145
512 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
513 by yylex, with out-of-bounds checking. */
515 #define YYMAXUTOK 312
517 #define YYTRANSLATE(YYX) \
518 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
520 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
521 as returned by yylex, without out-of-bounds checking. */
522 static const yytype_uint8 yytranslate
[] =
524 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
550 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
551 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
552 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
553 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
554 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
559 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
560 static const yytype_uint16 yyrline
[] =
562 0, 252, 252, 261, 262, 266, 267, 277, 281, 286,
563 287, 292, 298, 299, 300, 301, 306, 315, 316, 317,
564 318, 319, 320, 320, 321, 322, 346, 347, 348, 349,
565 353, 354, 363, 364, 365, 369, 381, 385, 389, 396,
566 407, 408, 418, 419, 423, 435, 435, 440, 440, 445,
567 456, 471, 472, 473, 474, 478, 479, 484, 486, 491,
568 496, 506, 508, 513, 514, 518, 519, 523, 524, 525,
569 530, 535, 540, 546, 552, 563, 564, 573, 574, 580,
570 581, 582, 589, 589, 597, 598, 599, 604, 607, 609,
571 611, 613, 615, 617, 619, 624, 625, 635, 636, 661,
572 662, 663, 664, 673, 693, 695, 704, 709, 710, 715,
577 #if GRAM_DEBUG || YYERROR_VERBOSE || 1
578 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
579 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
580 static const char *const yytname
[] =
582 "\"end of file\"", "error", "$undefined", "\"string\"", "\"%token\"",
583 "\"%nterm\"", "\"%type\"", "\"%destructor\"", "\"%printer\"",
584 "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%precedence\"",
585 "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
586 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
587 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
588 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
589 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
590 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
591 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
592 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
593 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
594 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
595 "\"integer\"", "\"%param\"", "\"%union\"", "\"%empty\"", "$accept",
596 "input", "prologue_declarations", "prologue_declaration", "$@1",
597 "params", "grammar_declaration", "code_props_type", "union_name",
598 "symbol_declaration", "$@2", "$@3", "precedence_declaration",
599 "precedence_declarator", "tag.opt", "symbols.prec", "symbol.prec",
600 "symbols.1", "generic_symlist", "generic_symlist_item", "tag",
601 "symbol_def", "symbol_defs.1", "grammar", "rules_or_grammar_declaration",
602 "rules", "$@4", "rhses.1", "rhs", "named_ref.opt", "variable", "value",
603 "braceless", "id", "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
608 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
609 (internal) symbol number NUM (which must be that of a token). */
610 static const yytype_uint16 yytoknum
[] =
612 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
613 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
614 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
615 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
616 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
617 305, 306, 307, 308, 309, 310, 311, 312
621 #define YYPACT_NINF -115
623 #define yypact_value_is_default(Yystate) \
624 (!!((Yystate) == (-115)))
626 #define YYTABLE_NINF -111
628 #define yytable_value_is_error(Yytable_value) \
631 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
633 static const yytype_int8 yypact
[] =
635 -115, 16, 109, -115, -115, -115, -28, -115, -115, -115,
636 -115, -115, -115, -14, -115, 25, 23, -115, -27, -20,
637 -115, 39, -115, 7, 48, 71, -115, -115, -115, 72,
638 73, 74, -2, -115, -115, -115, 56, -115, -115, -115,
639 33, -115, -115, 40, -115, -115, 37, 54, 54, -2,
640 -115, 50, -115, -115, -115, 2, -115, -115, -115, -115,
641 -115, -115, -115, -115, -115, -115, -115, -115, -115, -115,
642 -115, -115, 51, -115, 53, 3, -115, -115, 49, 65,
643 -115, 50, 42, -115, -2, -115, -115, 54, -1, 54,
644 -2, -115, -115, -115, -115, -115, -115, -115, -115, 63,
645 -115, -115, -115, -115, -115, 69, -115, -115, -115, -115,
646 42, -115, -115, -115, -2, -115, 38, -115, 106, -115,
647 -115, -115, -115, -115, -115, -115, -115, -115, -15, 41,
648 -115, -115, -2, 57, 59, 49, -115, -115, 49, 41,
649 -115, -115, -115, -115, -115
652 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
653 Performed when YYTABLE does not specify something else to do. Zero
654 means the default is an error. */
655 static const yytype_uint8 yydefact
[] =
657 3, 0, 0, 1, 47, 45, 0, 40, 41, 51,
658 52, 53, 54, 0, 36, 0, 9, 11, 0, 0,
659 7, 0, 15, 0, 0, 0, 37, 19, 20, 0,
660 0, 0, 0, 26, 27, 28, 0, 6, 29, 22,
661 42, 4, 5, 0, 33, 32, 55, 0, 0, 0,
662 103, 0, 38, 98, 97, 99, 10, 12, 13, 14,
663 16, 17, 18, 21, 24, 25, 109, 105, 104, 107,
664 34, 108, 0, 106, 0, 0, 77, 79, 95, 0,
665 43, 0, 0, 56, 0, 70, 75, 48, 71, 46,
666 49, 61, 39, 101, 100, 8, 102, 81, 80, 0,
667 78, 2, 96, 82, 31, 23, 44, 67, 68, 69,
668 35, 63, 66, 65, 50, 57, 59, 76, 72, 73,
669 62, 111, 87, 30, 64, 58, 60, 74, 83, 84,
670 87, 86, 0, 0, 0, 95, 90, 91, 95, 85,
674 /* YYPGOTO[NTERM-NUM]. */
675 static const yytype_int8 yypgoto
[] =
677 -115, -115, -115, -115, -115, -115, 120, -115, -115, -115,
678 -115, -115, -115, -115, -115, -115, 9, -115, -115, 14,
679 -115, -50, 100, -115, 75, -115, -115, -115, 19, -114,
680 -115, -115, -33, -18, -115, -32, -82, -115
683 /* YYDEFGOTO[NTERM-NUM]. */
684 static const yytype_int16 yydefgoto
[] =
686 -1, 1, 2, 41, 79, 105, 74, 43, 81, 44,
687 48, 47, 45, 46, 84, 114, 115, 90, 110, 111,
688 112, 86, 87, 75, 76, 77, 122, 128, 129, 103,
689 55, 95, 52, 69, 78, 113, 71, 101
692 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
693 positive, shift that token. If negative, reduce the rule whose
694 number is the opposite. If YYTABLE_NINF, syntax error. */
695 static const yytype_int16 yytable
[] =
697 70, 66, 66, -110, 72, 93, 119, 4, 5, 6,
698 7, 8, 9, 10, 11, 12, 3, 91, 92, 13,
699 14, 143, 96, 49, 144, 50, 56, 57, 53, 88,
700 88, 51, 26, 130, 58, 131, 127, 117, 32, 117,
701 67, 50, 59, 68, 66, 66, 60, 94, 106, 73,
702 99, 61, 116, 118, 132, 133, 134, 72, 120, 40,
703 4, 5, 6, 7, 8, 9, 10, 11, 12, 88,
704 54, 88, 13, 14, 62, 63, 64, 65, 80, 82,
705 135, 136, 116, 67, 67, 26, 68, 68, 83, 50,
706 102, 32, 126, 107, 108, 109, 67, 138, 137, 68,
707 140, 97, 73, 98, 104, 85, 121, 138, 123, 66,
708 142, 141, 40, 4, 5, 6, 7, 8, 9, 10,
709 11, 12, 42, 125, 124, 13, 14, 15, 16, 17,
710 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
711 28, 29, 30, 31, 32, 33, 34, 35, 89, 139,
712 100, 0, 0, 0, 0, 0, 36, 0, 37, 38,
716 static const yytype_int16 yycheck
[] =
718 32, 3, 3, 0, 1, 3, 88, 4, 5, 6,
719 7, 8, 9, 10, 11, 12, 0, 49, 51, 16,
720 17, 135, 55, 51, 138, 39, 3, 54, 3, 47,
721 48, 45, 29, 48, 54, 50, 118, 87, 35, 89,
722 42, 39, 3, 45, 3, 3, 39, 45, 81, 46,
723 47, 3, 84, 54, 13, 14, 15, 1, 90, 56,
724 4, 5, 6, 7, 8, 9, 10, 11, 12, 87,
725 45, 89, 16, 17, 3, 3, 3, 3, 45, 39,
726 39, 40, 114, 42, 42, 29, 45, 45, 51, 39,
727 41, 35, 54, 51, 52, 53, 42, 129, 57, 45,
728 132, 50, 46, 50, 39, 51, 43, 139, 39, 3,
729 51, 54, 56, 4, 5, 6, 7, 8, 9, 10,
730 11, 12, 2, 114, 110, 16, 17, 18, 19, 20,
731 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
732 31, 32, 33, 34, 35, 36, 37, 38, 48, 130,
733 75, -1, -1, -1, -1, -1, 47, -1, 49, 50,
734 -1, -1, -1, -1, 55, 56
737 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
738 symbol of state STATE-NUM. */
739 static const yytype_uint8 yystos
[] =
741 0, 59, 60, 0, 4, 5, 6, 7, 8, 9,
742 10, 11, 12, 16, 17, 18, 19, 20, 21, 22,
743 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
744 33, 34, 35, 36, 37, 38, 47, 49, 50, 55,
745 56, 61, 64, 65, 67, 70, 71, 69, 68, 51,
746 39, 45, 90, 3, 45, 88, 3, 54, 54, 3,
747 39, 3, 3, 3, 3, 3, 3, 42, 45, 91,
748 93, 94, 1, 46, 64, 81, 82, 83, 92, 62,
749 45, 66, 39, 51, 72, 51, 79, 80, 91, 80,
750 75, 93, 90, 3, 45, 89, 90, 50, 50, 47,
751 82, 95, 41, 87, 39, 63, 90, 51, 52, 53,
752 76, 77, 78, 93, 73, 74, 93, 79, 54, 94,
753 93, 43, 84, 39, 77, 74, 54, 94, 85, 86,
754 48, 50, 13, 14, 15, 39, 40, 57, 93, 86,
758 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
759 static const yytype_uint8 yyr1
[] =
761 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
762 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
763 61, 61, 62, 61, 61, 61, 61, 61, 61, 61,
764 63, 63, 64, 64, 64, 64, 64, 64, 64, 64,
765 65, 65, 66, 66, 64, 68, 67, 69, 67, 67,
766 70, 71, 71, 71, 71, 72, 72, 73, 73, 74,
767 74, 75, 75, 76, 76, 77, 77, 78, 78, 78,
768 79, 79, 79, 79, 79, 80, 80, 81, 81, 82,
769 82, 82, 84, 83, 85, 85, 85, 86, 86, 86,
770 86, 86, 86, 86, 86, 87, 87, 88, 88, 89,
771 89, 89, 89, 90, 91, 91, 92, 93, 93, 94,
775 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
776 static const yytype_uint8 yyr2
[] =
778 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
779 2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
780 1, 2, 0, 3, 2, 2, 1, 1, 1, 1,
781 2, 1, 1, 1, 2, 3, 1, 1, 2, 3,
782 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
783 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
784 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
785 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
786 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
787 2, 2, 3, 3, 3, 0, 1, 1, 1, 0,
788 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
793 #define yyerrok (yyerrstatus = 0)
794 #define yyclearin (yychar = YYEMPTY)
798 #define YYACCEPT goto yyacceptlab
799 #define YYABORT goto yyabortlab
800 #define YYERROR goto yyerrorlab
803 #define YYRECOVERING() (!!yyerrstatus)
805 #define YYBACKUP(Token, Value) \
807 if (yychar == YYEMPTY) \
811 YYPOPSTACK (yylen); \
813 YY_LAC_DISCARD ("YYBACKUP"); \
818 yyerror (&yylloc, YY_("syntax error: cannot back up")); \
823 /* Error token number */
825 #define YYERRCODE 256
828 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
829 If N is 0, then set CURRENT to the empty location which ends
830 the previous symbol: RHS[0] (always defined). */
832 #ifndef YYLLOC_DEFAULT
833 # define YYLLOC_DEFAULT(Current, Rhs, N) \
837 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
838 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
839 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
840 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
844 (Current).first_line = (Current).last_line = \
845 YYRHSLOC (Rhs, 0).last_line; \
846 (Current).first_column = (Current).last_column = \
847 YYRHSLOC (Rhs, 0).last_column; \
852 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
855 /* Enable debugging if requested. */
859 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
860 # define YYFPRINTF fprintf
863 # define YYDPRINTF(Args) \
870 /* YY_LOCATION_PRINT -- Print the location on the stream.
871 This macro was not mandated originally: define only if we know
872 we won't break user code: when these are the locations we know. */
874 #ifndef YY_LOCATION_PRINT
875 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
877 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
879 __attribute__((__unused__
))
881 yy_location_print_ (FILE *yyo
, YYLTYPE
const * const yylocp
)
884 int end_col
= 0 != yylocp
->last_column
? yylocp
->last_column
- 1 : 0;
885 if (0 <= yylocp
->first_line
)
887 res
+= YYFPRINTF (yyo
, "%d", yylocp
->first_line
);
888 if (0 <= yylocp
->first_column
)
889 res
+= YYFPRINTF (yyo
, ".%d", yylocp
->first_column
);
891 if (0 <= yylocp
->last_line
)
893 if (yylocp
->first_line
< yylocp
->last_line
)
895 res
+= YYFPRINTF (yyo
, "-%d", yylocp
->last_line
);
897 res
+= YYFPRINTF (yyo
, ".%d", end_col
);
899 else if (0 <= end_col
&& yylocp
->first_column
< end_col
)
900 res
+= YYFPRINTF (yyo
, "-%d", end_col
);
905 # define YY_LOCATION_PRINT(File, Loc) \
906 yy_location_print_ (File, &(Loc))
909 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
914 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
918 YYFPRINTF (stderr, "%s ", Title); \
919 yy_symbol_print (stderr, \
920 Type, Value, Location); \
921 YYFPRINTF (stderr, "\n"); \
926 /*--------------------------------.
927 | Print this symbol on YYOUTPUT. |
928 `--------------------------------*/
931 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
933 FILE *yyo
= yyoutput
;
939 if (yytype
< YYNTOKENS
)
940 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
944 case 3: /* "string" */
945 #line 174 "src/parse-gram.y" /* yacc.c:701 */
946 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
947 #line 948 "src/parse-gram.c" /* yacc.c:701 */
950 case 23: /* "%<flag>" */
951 #line 184 "src/parse-gram.y" /* yacc.c:701 */
952 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
953 #line 954 "src/parse-gram.c" /* yacc.c:701 */
956 case 39: /* "{...}" */
957 #line 176 "src/parse-gram.y" /* yacc.c:701 */
958 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
959 #line 960 "src/parse-gram.c" /* yacc.c:701 */
962 case 41: /* "[identifier]" */
963 #line 182 "src/parse-gram.y" /* yacc.c:701 */
964 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
965 #line 966 "src/parse-gram.c" /* yacc.c:701 */
968 case 42: /* "char" */
969 #line 163 "src/parse-gram.y" /* yacc.c:701 */
970 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
971 #line 972 "src/parse-gram.c" /* yacc.c:701 */
974 case 43: /* "epilogue" */
975 #line 176 "src/parse-gram.y" /* yacc.c:701 */
976 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
977 #line 978 "src/parse-gram.c" /* yacc.c:701 */
980 case 45: /* "identifier" */
981 #line 181 "src/parse-gram.y" /* yacc.c:701 */
982 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
983 #line 984 "src/parse-gram.c" /* yacc.c:701 */
986 case 46: /* "identifier:" */
987 #line 183 "src/parse-gram.y" /* yacc.c:701 */
988 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
989 #line 990 "src/parse-gram.c" /* yacc.c:701 */
992 case 49: /* "%{...%}" */
993 #line 176 "src/parse-gram.y" /* yacc.c:701 */
994 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
995 #line 996 "src/parse-gram.c" /* yacc.c:701 */
998 case 51: /* "<tag>" */
999 #line 185 "src/parse-gram.y" /* yacc.c:701 */
1000 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1001 #line 1002 "src/parse-gram.c" /* yacc.c:701 */
1004 case 54: /* "integer" */
1005 #line 189 "src/parse-gram.y" /* yacc.c:701 */
1006 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
1007 #line 1008 "src/parse-gram.c" /* yacc.c:701 */
1010 case 55: /* "%param" */
1011 #line 232 "src/parse-gram.y" /* yacc.c:701 */
1013 switch (((*yyvaluep
).param
))
1015 #define CASE(In, Out) \
1016 case param_ ## In: fputs ("%" #Out, yyo); break
1017 CASE (lex
, lex
-param
);
1018 CASE (parse
, parse
-param
);
1021 case param_none
: aver (false); break;
1024 #line 1025 "src/parse-gram.c" /* yacc.c:701 */
1027 case 65: /* code_props_type */
1028 #line 405 "src/parse-gram.y" /* yacc.c:701 */
1029 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1030 #line 1031 "src/parse-gram.c" /* yacc.c:701 */
1033 case 74: /* symbol.prec */
1034 #line 193 "src/parse-gram.y" /* yacc.c:701 */
1035 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1036 #line 1037 "src/parse-gram.c" /* yacc.c:701 */
1040 #line 185 "src/parse-gram.y" /* yacc.c:701 */
1041 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1042 #line 1043 "src/parse-gram.c" /* yacc.c:701 */
1045 case 88: /* variable */
1046 #line 181 "src/parse-gram.y" /* yacc.c:701 */
1047 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1048 #line 1049 "src/parse-gram.c" /* yacc.c:701 */
1051 case 89: /* value */
1052 #line 651 "src/parse-gram.y" /* yacc.c:701 */
1054 switch (((*yyvaluep
).value
).kind
)
1056 case muscle_code
: fprintf (yyo
, "{%s}", ((*yyvaluep
).value
).chars
); break;
1057 case muscle_keyword
: fprintf (yyo
, "%s", ((*yyvaluep
).value
).chars
); break;
1058 case muscle_string
: fprintf (yyo
, "\"%s\"", ((*yyvaluep
).value
).chars
); break;
1061 #line 1062 "src/parse-gram.c" /* yacc.c:701 */
1064 case 90: /* braceless */
1065 #line 176 "src/parse-gram.y" /* yacc.c:701 */
1066 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1067 #line 1068 "src/parse-gram.c" /* yacc.c:701 */
1071 #line 193 "src/parse-gram.y" /* yacc.c:701 */
1072 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1073 #line 1074 "src/parse-gram.c" /* yacc.c:701 */
1076 case 92: /* id_colon */
1077 #line 194 "src/parse-gram.y" /* yacc.c:701 */
1078 { fprintf (yyo
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1079 #line 1080 "src/parse-gram.c" /* yacc.c:701 */
1082 case 93: /* symbol */
1083 #line 193 "src/parse-gram.y" /* yacc.c:701 */
1084 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1085 #line 1086 "src/parse-gram.c" /* yacc.c:701 */
1088 case 94: /* string_as_id */
1089 #line 193 "src/parse-gram.y" /* yacc.c:701 */
1090 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1091 #line 1092 "src/parse-gram.c" /* yacc.c:701 */
1101 /*--------------------------------.
1102 | Print this symbol on YYOUTPUT. |
1103 `--------------------------------*/
1106 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1108 YYFPRINTF (yyoutput
, "%s %s (",
1109 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
1111 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1112 YYFPRINTF (yyoutput
, ": ");
1113 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1114 YYFPRINTF (yyoutput
, ")");
1117 /*------------------------------------------------------------------.
1118 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1120 `------------------------------------------------------------------*/
1123 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1125 YYFPRINTF (stderr
, "Stack now");
1126 for (; yybottom
<= yytop
; yybottom
++)
1128 int yybot
= *yybottom
;
1129 YYFPRINTF (stderr
, " %d", yybot
);
1131 YYFPRINTF (stderr
, "\n");
1134 # define YY_STACK_PRINT(Bottom, Top) \
1137 yy_stack_print ((Bottom), (Top)); \
1141 /*------------------------------------------------.
1142 | Report that the YYRULE is going to be reduced. |
1143 `------------------------------------------------*/
1146 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1148 unsigned long int yylno
= yyrline
[yyrule
];
1149 int yynrhs
= yyr2
[yyrule
];
1151 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1153 /* The symbols being reduced. */
1154 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1156 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1157 yy_symbol_print (stderr
,
1158 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1159 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1160 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1161 YYFPRINTF (stderr
, "\n");
1165 # define YY_REDUCE_PRINT(Rule) \
1168 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1171 /* Nonzero means print parse trace. It is left uninitialized so that
1172 multiple parsers can coexist. */
1174 #else /* !GRAM_DEBUG */
1175 # define YYDPRINTF(Args)
1176 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1177 # define YY_STACK_PRINT(Bottom, Top)
1178 # define YY_REDUCE_PRINT(Rule)
1179 #endif /* !GRAM_DEBUG */
1182 /* YYINITDEPTH -- initial size of the parser's stacks. */
1184 # define YYINITDEPTH 200
1187 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1188 if the built-in stack extension method is used).
1190 Do not make this value too large; the results are undefined if
1191 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1192 evaluated with infinite-precision integer arithmetic. */
1195 # define YYMAXDEPTH 10000
1198 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1199 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1200 stack, and such that *YYCAPACITY is the maximum number of elements it
1201 can hold without a reallocation, make sure there is enough room to
1202 store YYADD more elements. If not, allocate a new stack using
1203 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1204 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1205 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1206 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1207 required. Return 1 if memory is exhausted. */
1209 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1211 char const *yydebug_prefix
,
1212 char const *yydebug_suffix
,
1214 yytype_int16
**yybottom
,
1215 yytype_int16
*yybottom_no_free
,
1216 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1218 YYSIZE_T yysize_old
=
1219 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1220 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1221 if (*yycapacity
< yysize_new
)
1223 YYSIZE_T yyalloc
= 2 * yysize_new
;
1224 yytype_int16
*yybottom_new
;
1225 /* Use YYMAXDEPTH for maximum stack size given that the stack
1226 should never need to grow larger than the main state stack
1227 needs to grow without LAC. */
1228 if (YYMAXDEPTH
< yysize_new
)
1230 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1234 if (YYMAXDEPTH
< yyalloc
)
1235 yyalloc
= YYMAXDEPTH
;
1237 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1240 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1244 if (*yytop
!= yytop_empty
)
1246 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1247 *yytop
= yybottom_new
+ (yysize_old
- 1);
1249 if (*yybottom
!= yybottom_no_free
)
1250 YYSTACK_FREE (*yybottom
);
1251 *yybottom
= yybottom_new
;
1252 *yycapacity
= yyalloc
;
1257 /* Establish the initial context for the current lookahead if no initial
1258 context is currently established.
1260 We define a context as a snapshot of the parser stacks. We define
1261 the initial context for a lookahead as the context in which the
1262 parser initially examines that lookahead in order to select a
1263 syntactic action. Thus, if the lookahead eventually proves
1264 syntactically unacceptable (possibly in a later context reached via a
1265 series of reductions), the initial context can be used to determine
1266 the exact set of tokens that would be syntactically acceptable in the
1267 lookahead's place. Moreover, it is the context after which any
1268 further semantic actions would be erroneous because they would be
1269 determined by a syntactically unacceptable token.
1271 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1272 performed in an inconsistent state (which, for the purposes of LAC,
1273 includes consistent states that don't know they're consistent because
1274 their default reductions have been disabled). Iff there is a
1275 lookahead token, it should also be invoked before reporting a syntax
1276 error. This latter case is for the sake of the debugging output.
1278 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1279 follows. If no initial context is currently established for the
1280 current lookahead, then check if that lookahead can eventually be
1281 shifted if syntactic actions continue from the current context.
1282 Report a syntax error if it cannot. */
1283 #define YY_LAC_ESTABLISH \
1285 if (!yy_lac_established) \
1287 YYDPRINTF ((stderr, \
1288 "LAC: initial context established for %s\n", \
1289 yytname[yytoken])); \
1290 yy_lac_established = 1; \
1292 int yy_lac_status = \
1293 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1294 if (yy_lac_status == 2) \
1295 goto yyexhaustedlab; \
1296 if (yy_lac_status == 1) \
1302 /* Discard any previous initial lookahead context because of Event,
1303 which may be a lookahead change or an invalidation of the currently
1304 established initial context for the current lookahead.
1306 The most common example of a lookahead change is a shift. An example
1307 of both cases is syntax error recovery. That is, a syntax error
1308 occurs when the lookahead is syntactically erroneous for the
1309 currently established initial context, so error recovery manipulates
1310 the parser stacks to try to find a new initial context in which the
1311 current lookahead is syntactically acceptable. If it fails to find
1312 such a context, it discards the lookahead. */
1314 # define YY_LAC_DISCARD(Event) \
1316 if (yy_lac_established) \
1319 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1321 yy_lac_established = 0; \
1325 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1328 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1329 eventually (after perhaps some reductions) be shifted, return 1 if
1330 not, or return 2 if memory is exhausted. As preconditions and
1331 postconditions: *YYES_CAPACITY is the allocated size of the array to
1332 which *YYES points, and either *YYES = YYESA or *YYES points to an
1333 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1334 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1335 any old *YYES other than YYESA. */
1337 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1338 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1340 yytype_int16
*yyes_prev
= yyssp
;
1341 yytype_int16
*yyesp
= yyes_prev
;
1342 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1343 if (yytoken
== YYUNDEFTOK
)
1345 YYDPRINTF ((stderr
, " Always Err\n"));
1350 int yyrule
= yypact
[*yyesp
];
1351 if (yypact_value_is_default (yyrule
)
1352 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1353 || yycheck
[yyrule
] != yytoken
)
1355 yyrule
= yydefact
[*yyesp
];
1358 YYDPRINTF ((stderr
, " Err\n"));
1364 yyrule
= yytable
[yyrule
];
1365 if (yytable_value_is_error (yyrule
))
1367 YYDPRINTF ((stderr
, " Err\n"));
1372 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1378 YYSIZE_T yylen
= yyr2
[yyrule
];
1379 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1380 if (yyesp
!= yyes_prev
)
1382 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1395 yyesp
= yyes_prev
-= yylen
;
1400 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1401 yystate
= yypgoto
[yylhs
] + *yyesp
;
1402 if (yystate
< 0 || YYLAST
< yystate
1403 || yycheck
[yystate
] != *yyesp
)
1404 yystate
= yydefgoto
[yylhs
];
1406 yystate
= yytable
[yystate
];
1408 if (yyesp
== yyes_prev
)
1415 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1419 yyes
, yyesa
, &yyesp
, yyes_prev
))
1421 YYDPRINTF ((stderr
, "\n"));
1426 YYDPRINTF ((stderr
, " G%d", yystate
));
1435 # if defined __GLIBC__ && defined _STRING_H
1436 # define yystrlen strlen
1438 /* Return the length of YYSTR. */
1440 yystrlen (const char *yystr
)
1443 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1451 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1452 # define yystpcpy stpcpy
1454 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1457 yystpcpy (char *yydest
, const char *yysrc
)
1460 const char *yys
= yysrc
;
1462 while ((*yyd
++ = *yys
++) != '\0')
1471 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1472 quotes and backslashes, so that it's suitable for yyerror. The
1473 heuristic is that double-quoting is unnecessary unless the string
1474 contains an apostrophe, a comma, or backslash (other than
1475 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1476 null, do not copy; instead, return the length of what the result
1479 yytnamerr (char *yyres
, const char *yystr
)
1484 char const *yyp
= yystr
;
1491 goto do_not_strip_quotes
;
1495 goto do_not_strip_quotes
;
1508 do_not_strip_quotes
: ;
1512 return yystrlen (yystr
);
1514 return yystpcpy (yyres
, yystr
) - yyres
;
1518 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1519 about the unexpected token YYTOKEN for the state stack whose top is
1520 YYSSP. In order to see if a particular token T is a
1521 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1523 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1524 not large enough to hold the message. In that case, also set
1525 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1526 required number of bytes is too large to store or if
1527 yy_lac returned 2. */
1529 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1530 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1531 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1533 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1534 YYSIZE_T yysize
= yysize0
;
1535 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1536 /* Internationalized format string. */
1537 const char *yyformat
= YY_NULL
;
1538 /* Arguments of yyformat. */
1539 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1540 /* Number of reported tokens (one for the "unexpected", one per
1544 /* There are many possibilities here to consider:
1545 - If this state is a consistent state with a default action, then
1546 the only way this function was invoked is if the default action
1547 is an error action. In that case, don't check for expected
1548 tokens because there are none.
1549 - The only way there can be no lookahead present (in yychar) is if
1550 this state is a consistent state with a default action. Thus,
1551 detecting the absence of a lookahead is sufficient to determine
1552 that there is no unexpected or expected token to report. In that
1553 case, just report a simple "syntax error".
1554 - Don't assume there isn't a lookahead just because this state is a
1555 consistent state with a default action. There might have been a
1556 previous inconsistent state, consistent state with a non-default
1557 action, or user semantic action that manipulated yychar.
1558 In the first two cases, it might appear that the current syntax
1559 error should have been detected in the previous state when yy_lac
1560 was invoked. However, at that time, there might have been a
1561 different syntax error that discarded a different initial context
1562 during error recovery, leaving behind the current lookahead.
1564 if (yytoken
!= YYEMPTY
)
1566 int yyn
= yypact
[*yyssp
];
1567 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1568 yyarg
[yycount
++] = yytname
[yytoken
];
1569 if (!yypact_value_is_default (yyn
))
1573 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1574 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1577 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1579 if (yy_lac_status
== 2)
1581 if (yy_lac_status
== 1)
1584 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1590 yyarg
[yycount
++] = yytname
[yyx
];
1592 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1593 if (! (yysize
<= yysize1
1594 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1602 YYFPRINTF (stderr
, "No expected tokens.\n");
1608 # define YYCASE_(N, S) \
1612 YYCASE_(0, YY_("syntax error"));
1613 YYCASE_(1, YY_("syntax error, unexpected %s"));
1614 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1615 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1616 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1617 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1622 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1623 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1628 if (*yymsg_alloc
< yysize
)
1630 *yymsg_alloc
= 2 * yysize
;
1631 if (! (yysize
<= *yymsg_alloc
1632 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1633 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1637 /* Avoid sprintf, as that infringes on the user's name space.
1638 Don't have undefined behavior even if the translation
1639 produced a string with the wrong number of "%s"s. */
1643 while ((*yyp
= *yyformat
) != '\0')
1644 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1646 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1657 #endif /* YYERROR_VERBOSE */
1659 /*-----------------------------------------------.
1660 | Release the memory associated to this symbol. |
1661 `-----------------------------------------------*/
1664 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1667 YYUSE (yylocationp
);
1670 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1685 /* The lookahead symbol. */
1689 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1690 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1691 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1692 _Pragma ("GCC diagnostic push") \
1693 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1694 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1695 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1696 _Pragma ("GCC diagnostic pop")
1698 /* Default value used for initialization, for pacifying older GCCs
1699 or non-GCC compilers. */
1700 static YYSTYPE yyval_default
;
1701 # define YY_INITIAL_VALUE(Value) = Value
1703 static YYLTYPE yyloc_default
1704 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
1708 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1709 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1710 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1712 #ifndef YY_INITIAL_VALUE
1713 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1716 /* The semantic value of the lookahead symbol. */
1717 YYSTYPE yylval
YY_INITIAL_VALUE(yyval_default
);
1719 /* Location data for the lookahead symbol. */
1720 YYLTYPE yylloc
= yyloc_default
;
1723 /* Number of syntax errors so far. */
1727 /* Number of tokens to shift before error messages enabled. */
1730 /* The stacks and their tools:
1731 'yyss': related to states.
1732 'yyvs': related to semantic values.
1733 'yyls': related to locations.
1735 Refer to the stacks through separate pointers, to allow yyoverflow
1736 to reallocate them elsewhere. */
1738 /* The state stack. */
1739 yytype_int16 yyssa
[YYINITDEPTH
];
1741 yytype_int16
*yyssp
;
1743 /* The semantic value stack. */
1744 YYSTYPE yyvsa
[YYINITDEPTH
];
1748 /* The location stack. */
1749 YYLTYPE yylsa
[YYINITDEPTH
];
1753 /* The locations where the error started and ended. */
1754 YYLTYPE yyerror_range
[3];
1756 YYSIZE_T yystacksize
;
1758 yytype_int16 yyesa
[20];
1760 YYSIZE_T yyes_capacity
;
1762 int yy_lac_established
= 0;
1765 /* Lookahead token as an internal (translated) token number. */
1767 /* The variables used to return semantic value and location from the
1773 /* Buffer for error messages, and its allocated size. */
1775 char *yymsg
= yymsgbuf
;
1776 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1779 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1781 /* The number of symbols on the RHS of the reduced rule.
1782 Keep to zero when no symbol should be popped. */
1785 yyssp
= yyss
= yyssa
;
1786 yyvsp
= yyvs
= yyvsa
;
1787 yylsp
= yyls
= yylsa
;
1788 yystacksize
= YYINITDEPTH
;
1791 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1792 if (YYMAXDEPTH
< yyes_capacity
)
1793 yyes_capacity
= YYMAXDEPTH
;
1795 YYDPRINTF ((stderr
, "Starting parse\n"));
1800 yychar
= YYEMPTY
; /* Cause a token to be read. */
1802 /* User initialization code. */
1803 #line 87 "src/parse-gram.y" /* yacc.c:1446 */
1805 /* Bison's grammar can initial empty locations, hence a default
1806 location is needed. */
1807 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1808 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1811 #line 1812 "src/parse-gram.c" /* yacc.c:1446 */
1815 /*------------------------------------------------------------.
1816 | yynewstate -- Push a new state, which is found in yystate. |
1817 `------------------------------------------------------------*/
1819 /* In all cases, when you get here, the value and location stacks
1820 have just been pushed. So pushing a state here evens the stacks. */
1826 if (yyss
+ yystacksize
- 1 <= yyssp
)
1828 /* Get the current used size of the three stacks, in elements. */
1829 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1833 /* Give user a chance to reallocate the stack. Use copies of
1834 these so that the &'s don't force the real ones into
1836 YYSTYPE
*yyvs1
= yyvs
;
1837 yytype_int16
*yyss1
= yyss
;
1838 YYLTYPE
*yyls1
= yyls
;
1840 /* Each stack pointer address is followed by the size of the
1841 data in use in that stack, in bytes. This used to be a
1842 conditional around just the two extra args, but that might
1843 be undefined if yyoverflow is a macro. */
1844 yyoverflow (YY_("memory exhausted"),
1845 &yyss1
, yysize
* sizeof (*yyssp
),
1846 &yyvs1
, yysize
* sizeof (*yyvsp
),
1847 &yyls1
, yysize
* sizeof (*yylsp
),
1854 #else /* no yyoverflow */
1855 # ifndef YYSTACK_RELOCATE
1856 goto yyexhaustedlab
;
1858 /* Extend the stack our own way. */
1859 if (YYMAXDEPTH
<= yystacksize
)
1860 goto yyexhaustedlab
;
1862 if (YYMAXDEPTH
< yystacksize
)
1863 yystacksize
= YYMAXDEPTH
;
1866 yytype_int16
*yyss1
= yyss
;
1867 union yyalloc
*yyptr
=
1868 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1870 goto yyexhaustedlab
;
1871 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1872 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1873 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1874 # undef YYSTACK_RELOCATE
1876 YYSTACK_FREE (yyss1
);
1879 #endif /* no yyoverflow */
1881 yyssp
= yyss
+ yysize
- 1;
1882 yyvsp
= yyvs
+ yysize
- 1;
1883 yylsp
= yyls
+ yysize
- 1;
1885 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1886 (unsigned long int) yystacksize
));
1888 if (yyss
+ yystacksize
- 1 <= yyssp
)
1892 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1894 if (yystate
== YYFINAL
)
1904 /* Do appropriate processing given the current state. Read a
1905 lookahead token if we need one and don't already have one. */
1907 /* First try to decide what to do without reference to lookahead token. */
1908 yyn
= yypact
[yystate
];
1909 if (yypact_value_is_default (yyn
))
1912 /* Not known => get a lookahead token if don't already have one. */
1914 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1915 if (yychar
== YYEMPTY
)
1917 YYDPRINTF ((stderr
, "Reading a token: "));
1918 yychar
= yylex (&yylval
, &yylloc
);
1921 if (yychar
<= YYEOF
)
1923 yychar
= yytoken
= YYEOF
;
1924 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1928 yytoken
= YYTRANSLATE (yychar
);
1929 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1932 /* If the proper action on seeing token YYTOKEN is to reduce or to
1933 detect an error, take that action. */
1935 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1943 if (yytable_value_is_error (yyn
))
1950 /* Count tokens shifted since error; after three, turn off error
1955 /* Shift the lookahead token. */
1956 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1958 /* Discard the shifted token. */
1960 YY_LAC_DISCARD ("shift");
1963 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1965 YY_IGNORE_MAYBE_UNINITIALIZED_END
1970 /*-----------------------------------------------------------.
1971 | yydefault -- do the default action for the current state. |
1972 `-----------------------------------------------------------*/
1974 yyn
= yydefact
[yystate
];
1980 /*-----------------------------.
1981 | yyreduce -- Do a reduction. |
1982 `-----------------------------*/
1984 /* yyn is the number of a rule to reduce with. */
1987 /* If YYLEN is nonzero, implement the default value of the action:
1990 Otherwise, the following line sets YYVAL to garbage.
1991 This behavior is undocumented and Bison
1992 users should not rely upon it. Assigning to YYVAL
1993 unconditionally makes the parser a bit smaller, and it avoids a
1994 GCC warning that YYVAL may be used uninitialized. */
1995 yyval
= yyvsp
[1-yylen
];
1997 /* Default location. */
1998 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1999 YY_REDUCE_PRINT (yyn
);
2001 int yychar_backup
= yychar
;
2005 #line 268 "src/parse-gram.y" /* yacc.c:1663 */
2007 code_props plain_code
;
2008 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2009 code_props_translate_code (&plain_code
);
2010 gram_scanner_last_string_free ();
2011 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2012 plain_code
.code
, (yylsp
[0]));
2013 code_scanner_last_string_free ();
2015 #line 2016 "src/parse-gram.c" /* yacc.c:1663 */
2019 #line 278 "src/parse-gram.y" /* yacc.c:1663 */
2021 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2023 #line 2024 "src/parse-gram.c" /* yacc.c:1663 */
2027 #line 282 "src/parse-gram.y" /* yacc.c:1663 */
2029 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].value
).kind
, (yyvsp
[0].value
).chars
,
2030 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2032 #line 2033 "src/parse-gram.c" /* yacc.c:1663 */
2036 #line 286 "src/parse-gram.y" /* yacc.c:1663 */
2037 { defines_flag
= true; }
2038 #line 2039 "src/parse-gram.c" /* yacc.c:1663 */
2042 #line 288 "src/parse-gram.y" /* yacc.c:1663 */
2044 defines_flag
= true;
2045 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2047 #line 2048 "src/parse-gram.c" /* yacc.c:1663 */
2051 #line 293 "src/parse-gram.y" /* yacc.c:1663 */
2053 muscle_percent_define_insert ("parse.error", (yylsp
[0]), muscle_keyword
,
2055 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2057 #line 2058 "src/parse-gram.c" /* yacc.c:1663 */
2061 #line 298 "src/parse-gram.y" /* yacc.c:1663 */
2062 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2063 #line 2064 "src/parse-gram.c" /* yacc.c:1663 */
2067 #line 299 "src/parse-gram.y" /* yacc.c:1663 */
2068 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2069 #line 2070 "src/parse-gram.c" /* yacc.c:1663 */
2073 #line 300 "src/parse-gram.y" /* yacc.c:1663 */
2074 { spec_file_prefix
= (yyvsp
[0].chars
); }
2075 #line 2076 "src/parse-gram.c" /* yacc.c:1663 */
2079 #line 302 "src/parse-gram.y" /* yacc.c:1663 */
2081 nondeterministic_parser
= true;
2084 #line 2085 "src/parse-gram.c" /* yacc.c:1663 */
2088 #line 307 "src/parse-gram.y" /* yacc.c:1663 */
2091 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2092 code_props_translate_code (&action
);
2093 gram_scanner_last_string_free ();
2094 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2095 code_scanner_last_string_free ();
2097 #line 2098 "src/parse-gram.c" /* yacc.c:1663 */
2101 #line 315 "src/parse-gram.y" /* yacc.c:1663 */
2102 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2103 #line 2104 "src/parse-gram.c" /* yacc.c:1663 */
2107 #line 316 "src/parse-gram.y" /* yacc.c:1663 */
2108 { spec_name_prefix
= (yyvsp
[0].chars
); }
2109 #line 2110 "src/parse-gram.c" /* yacc.c:1663 */
2113 #line 317 "src/parse-gram.y" /* yacc.c:1663 */
2114 { no_lines_flag
= true; }
2115 #line 2116 "src/parse-gram.c" /* yacc.c:1663 */
2119 #line 318 "src/parse-gram.y" /* yacc.c:1663 */
2120 { nondeterministic_parser
= true; }
2121 #line 2122 "src/parse-gram.c" /* yacc.c:1663 */
2125 #line 319 "src/parse-gram.y" /* yacc.c:1663 */
2126 { spec_outfile
= (yyvsp
[0].chars
); }
2127 #line 2128 "src/parse-gram.c" /* yacc.c:1663 */
2131 #line 320 "src/parse-gram.y" /* yacc.c:1663 */
2132 { current_param
= (yyvsp
[0].param
); }
2133 #line 2134 "src/parse-gram.c" /* yacc.c:1663 */
2137 #line 320 "src/parse-gram.y" /* yacc.c:1663 */
2138 { current_param
= param_none
; }
2139 #line 2140 "src/parse-gram.c" /* yacc.c:1663 */
2143 #line 321 "src/parse-gram.y" /* yacc.c:1663 */
2144 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2145 #line 2146 "src/parse-gram.c" /* yacc.c:1663 */
2149 #line 323 "src/parse-gram.y" /* yacc.c:1663 */
2151 char const *skeleton_user
= (yyvsp
[0].chars
);
2152 if (strchr (skeleton_user
, '/'))
2154 size_t dir_length
= strlen (current_file
);
2155 char *skeleton_build
;
2156 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2158 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2161 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2164 memcpy (skeleton_build
, current_file
, dir_length
);
2165 skeleton_build
[dir_length
++] = '/';
2167 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2168 skeleton_user
= uniqstr_new (skeleton_build
);
2169 free (skeleton_build
);
2171 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2173 #line 2174 "src/parse-gram.c" /* yacc.c:1663 */
2177 #line 346 "src/parse-gram.y" /* yacc.c:1663 */
2178 { token_table_flag
= true; }
2179 #line 2180 "src/parse-gram.c" /* yacc.c:1663 */
2183 #line 347 "src/parse-gram.y" /* yacc.c:1663 */
2184 { report_flag
|= report_states
; }
2185 #line 2186 "src/parse-gram.c" /* yacc.c:1663 */
2189 #line 348 "src/parse-gram.y" /* yacc.c:1663 */
2190 { yacc_flag
= true; }
2191 #line 2192 "src/parse-gram.c" /* yacc.c:1663 */
2195 #line 353 "src/parse-gram.y" /* yacc.c:1663 */
2196 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2197 #line 2198 "src/parse-gram.c" /* yacc.c:1663 */
2201 #line 354 "src/parse-gram.y" /* yacc.c:1663 */
2202 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2203 #line 2204 "src/parse-gram.c" /* yacc.c:1663 */
2207 #line 366 "src/parse-gram.y" /* yacc.c:1663 */
2209 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2211 #line 2212 "src/parse-gram.c" /* yacc.c:1663 */
2215 #line 370 "src/parse-gram.y" /* yacc.c:1663 */
2218 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2219 code_props_translate_code (&code
);
2222 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2223 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2224 symbol_list_free ((yyvsp
[0].list
));
2227 #line 2228 "src/parse-gram.c" /* yacc.c:1663 */
2231 #line 382 "src/parse-gram.y" /* yacc.c:1663 */
2233 default_prec
= true;
2235 #line 2236 "src/parse-gram.c" /* yacc.c:1663 */
2239 #line 386 "src/parse-gram.y" /* yacc.c:1663 */
2241 default_prec
= false;
2243 #line 2244 "src/parse-gram.c" /* yacc.c:1663 */
2247 #line 390 "src/parse-gram.y" /* yacc.c:1663 */
2249 /* Do not invoke muscle_percent_code_grow here since it invokes
2250 muscle_user_name_list_grow. */
2251 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2252 code_scanner_last_string_free ();
2254 #line 2255 "src/parse-gram.c" /* yacc.c:1663 */
2258 #line 397 "src/parse-gram.y" /* yacc.c:1663 */
2260 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2261 code_scanner_last_string_free ();
2263 #line 2264 "src/parse-gram.c" /* yacc.c:1663 */
2267 #line 407 "src/parse-gram.y" /* yacc.c:1663 */
2268 { (yyval
.code_type
) = destructor
; }
2269 #line 2270 "src/parse-gram.c" /* yacc.c:1663 */
2273 #line 408 "src/parse-gram.y" /* yacc.c:1663 */
2274 { (yyval
.code_type
) = printer
; }
2275 #line 2276 "src/parse-gram.c" /* yacc.c:1663 */
2279 #line 418 "src/parse-gram.y" /* yacc.c:1663 */
2281 #line 2282 "src/parse-gram.c" /* yacc.c:1663 */
2285 #line 419 "src/parse-gram.y" /* yacc.c:1663 */
2286 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2287 #line 2288 "src/parse-gram.c" /* yacc.c:1663 */
2291 #line 424 "src/parse-gram.y" /* yacc.c:1663 */
2294 muscle_code_grow ("union_members", (yyvsp
[0].chars
), (yylsp
[0]));
2295 code_scanner_last_string_free ();
2297 #line 2298 "src/parse-gram.c" /* yacc.c:1663 */
2301 #line 435 "src/parse-gram.y" /* yacc.c:1663 */
2302 { current_class
= nterm_sym
; }
2303 #line 2304 "src/parse-gram.c" /* yacc.c:1663 */
2307 #line 436 "src/parse-gram.y" /* yacc.c:1663 */
2309 current_class
= unknown_sym
;
2310 current_type
= NULL
;
2312 #line 2313 "src/parse-gram.c" /* yacc.c:1663 */
2316 #line 440 "src/parse-gram.y" /* yacc.c:1663 */
2317 { current_class
= token_sym
; }
2318 #line 2319 "src/parse-gram.c" /* yacc.c:1663 */
2322 #line 441 "src/parse-gram.y" /* yacc.c:1663 */
2324 current_class
= unknown_sym
;
2325 current_type
= NULL
;
2327 #line 2328 "src/parse-gram.c" /* yacc.c:1663 */
2331 #line 446 "src/parse-gram.y" /* yacc.c:1663 */
2335 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2336 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2337 symbol_list_free ((yyvsp
[0].list
));
2339 #line 2340 "src/parse-gram.c" /* yacc.c:1663 */
2343 #line 457 "src/parse-gram.y" /* yacc.c:1663 */
2347 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2349 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2350 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2352 symbol_list_free ((yyvsp
[0].list
));
2353 current_type
= NULL
;
2355 #line 2356 "src/parse-gram.c" /* yacc.c:1663 */
2359 #line 471 "src/parse-gram.y" /* yacc.c:1663 */
2360 { (yyval
.assoc
) = left_assoc
; }
2361 #line 2362 "src/parse-gram.c" /* yacc.c:1663 */
2365 #line 472 "src/parse-gram.y" /* yacc.c:1663 */
2366 { (yyval
.assoc
) = right_assoc
; }
2367 #line 2368 "src/parse-gram.c" /* yacc.c:1663 */
2371 #line 473 "src/parse-gram.y" /* yacc.c:1663 */
2372 { (yyval
.assoc
) = non_assoc
; }
2373 #line 2374 "src/parse-gram.c" /* yacc.c:1663 */
2377 #line 474 "src/parse-gram.y" /* yacc.c:1663 */
2378 { (yyval
.assoc
) = precedence_assoc
; }
2379 #line 2380 "src/parse-gram.c" /* yacc.c:1663 */
2383 #line 478 "src/parse-gram.y" /* yacc.c:1663 */
2384 { current_type
= NULL
; }
2385 #line 2386 "src/parse-gram.c" /* yacc.c:1663 */
2389 #line 479 "src/parse-gram.y" /* yacc.c:1663 */
2390 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2391 #line 2392 "src/parse-gram.c" /* yacc.c:1663 */
2395 #line 485 "src/parse-gram.y" /* yacc.c:1663 */
2396 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2397 #line 2398 "src/parse-gram.c" /* yacc.c:1663 */
2401 #line 487 "src/parse-gram.y" /* yacc.c:1663 */
2402 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2403 #line 2404 "src/parse-gram.c" /* yacc.c:1663 */
2407 #line 492 "src/parse-gram.y" /* yacc.c:1663 */
2409 (yyval
.symbol
) = (yyvsp
[0].symbol
);
2410 symbol_class_set ((yyvsp
[0].symbol
), token_sym
, (yylsp
[0]), false);
2412 #line 2413 "src/parse-gram.c" /* yacc.c:1663 */
2416 #line 497 "src/parse-gram.y" /* yacc.c:1663 */
2418 (yyval
.symbol
) = (yyvsp
[-1].symbol
);
2419 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2420 symbol_class_set ((yyvsp
[-1].symbol
), token_sym
, (yylsp
[-1]), false);
2422 #line 2423 "src/parse-gram.c" /* yacc.c:1663 */
2426 #line 507 "src/parse-gram.y" /* yacc.c:1663 */
2427 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2428 #line 2429 "src/parse-gram.c" /* yacc.c:1663 */
2432 #line 509 "src/parse-gram.y" /* yacc.c:1663 */
2433 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2434 #line 2435 "src/parse-gram.c" /* yacc.c:1663 */
2438 #line 513 "src/parse-gram.y" /* yacc.c:1663 */
2439 { (yyval
.list
) = (yyvsp
[0].list
); }
2440 #line 2441 "src/parse-gram.c" /* yacc.c:1663 */
2444 #line 514 "src/parse-gram.y" /* yacc.c:1663 */
2445 { (yyval
.list
) = symbol_list_append ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2446 #line 2447 "src/parse-gram.c" /* yacc.c:1663 */
2450 #line 518 "src/parse-gram.y" /* yacc.c:1663 */
2451 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2452 #line 2453 "src/parse-gram.c" /* yacc.c:1663 */
2456 #line 519 "src/parse-gram.y" /* yacc.c:1663 */
2457 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2458 #line 2459 "src/parse-gram.c" /* yacc.c:1663 */
2462 #line 524 "src/parse-gram.y" /* yacc.c:1663 */
2463 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2464 #line 2465 "src/parse-gram.c" /* yacc.c:1663 */
2468 #line 525 "src/parse-gram.y" /* yacc.c:1663 */
2469 { (yyval
.uniqstr
) = uniqstr_new (""); }
2470 #line 2471 "src/parse-gram.c" /* yacc.c:1663 */
2474 #line 531 "src/parse-gram.y" /* yacc.c:1663 */
2476 current_type
= (yyvsp
[0].uniqstr
);
2479 #line 2480 "src/parse-gram.c" /* yacc.c:1663 */
2483 #line 536 "src/parse-gram.y" /* yacc.c:1663 */
2485 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2486 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2488 #line 2489 "src/parse-gram.c" /* yacc.c:1663 */
2492 #line 541 "src/parse-gram.y" /* yacc.c:1663 */
2494 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2495 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2496 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2498 #line 2499 "src/parse-gram.c" /* yacc.c:1663 */
2502 #line 547 "src/parse-gram.y" /* yacc.c:1663 */
2504 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2505 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2506 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2508 #line 2509 "src/parse-gram.c" /* yacc.c:1663 */
2512 #line 553 "src/parse-gram.y" /* yacc.c:1663 */
2514 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2515 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2516 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2517 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2519 #line 2520 "src/parse-gram.c" /* yacc.c:1663 */
2523 #line 583 "src/parse-gram.y" /* yacc.c:1663 */
2527 #line 2528 "src/parse-gram.c" /* yacc.c:1663 */
2531 #line 589 "src/parse-gram.y" /* yacc.c:1663 */
2532 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2533 #line 2534 "src/parse-gram.c" /* yacc.c:1663 */
2537 #line 590 "src/parse-gram.y" /* yacc.c:1663 */
2539 /* Free the current lhs. */
2540 current_lhs (0, (yylsp
[-3]), 0);
2542 #line 2543 "src/parse-gram.c" /* yacc.c:1663 */
2546 #line 597 "src/parse-gram.y" /* yacc.c:1663 */
2547 { grammar_current_rule_end ((yylsp
[0])); }
2548 #line 2549 "src/parse-gram.c" /* yacc.c:1663 */
2552 #line 598 "src/parse-gram.y" /* yacc.c:1663 */
2553 { grammar_current_rule_end ((yylsp
[0])); }
2554 #line 2555 "src/parse-gram.c" /* yacc.c:1663 */
2558 #line 605 "src/parse-gram.y" /* yacc.c:1663 */
2559 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2560 current_lhs_named_ref
); }
2561 #line 2562 "src/parse-gram.c" /* yacc.c:1663 */
2565 #line 608 "src/parse-gram.y" /* yacc.c:1663 */
2566 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2567 #line 2568 "src/parse-gram.c" /* yacc.c:1663 */
2571 #line 610 "src/parse-gram.y" /* yacc.c:1663 */
2572 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2573 #line 2574 "src/parse-gram.c" /* yacc.c:1663 */
2577 #line 612 "src/parse-gram.y" /* yacc.c:1663 */
2578 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2579 #line 2580 "src/parse-gram.c" /* yacc.c:1663 */
2583 #line 614 "src/parse-gram.y" /* yacc.c:1663 */
2584 { grammar_current_rule_empty_set ((yylsp
[0])); }
2585 #line 2586 "src/parse-gram.c" /* yacc.c:1663 */
2589 #line 616 "src/parse-gram.y" /* yacc.c:1663 */
2590 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2591 #line 2592 "src/parse-gram.c" /* yacc.c:1663 */
2595 #line 618 "src/parse-gram.y" /* yacc.c:1663 */
2596 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2597 #line 2598 "src/parse-gram.c" /* yacc.c:1663 */
2601 #line 620 "src/parse-gram.y" /* yacc.c:1663 */
2602 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2603 #line 2604 "src/parse-gram.c" /* yacc.c:1663 */
2607 #line 624 "src/parse-gram.y" /* yacc.c:1663 */
2608 { (yyval
.named_ref
) = 0; }
2609 #line 2610 "src/parse-gram.c" /* yacc.c:1663 */
2613 #line 625 "src/parse-gram.y" /* yacc.c:1663 */
2614 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2615 #line 2616 "src/parse-gram.c" /* yacc.c:1663 */
2619 #line 636 "src/parse-gram.y" /* yacc.c:1663 */
2620 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2621 #line 2622 "src/parse-gram.c" /* yacc.c:1663 */
2625 #line 661 "src/parse-gram.y" /* yacc.c:1663 */
2626 { (yyval
.value
).kind
= muscle_keyword
; (yyval
.value
).chars
= ""; }
2627 #line 2628 "src/parse-gram.c" /* yacc.c:1663 */
2631 #line 662 "src/parse-gram.y" /* yacc.c:1663 */
2632 { (yyval
.value
).kind
= muscle_keyword
; (yyval
.value
).chars
= (yyvsp
[0].uniqstr
); }
2633 #line 2634 "src/parse-gram.c" /* yacc.c:1663 */
2637 #line 663 "src/parse-gram.y" /* yacc.c:1663 */
2638 { (yyval
.value
).kind
= muscle_string
; (yyval
.value
).chars
= (yyvsp
[0].chars
); }
2639 #line 2640 "src/parse-gram.c" /* yacc.c:1663 */
2643 #line 664 "src/parse-gram.y" /* yacc.c:1663 */
2644 { (yyval
.value
).kind
= muscle_code
; (yyval
.value
).chars
= (yyvsp
[0].chars
); }
2645 #line 2646 "src/parse-gram.c" /* yacc.c:1663 */
2649 #line 674 "src/parse-gram.y" /* yacc.c:1663 */
2651 code_props plain_code
;
2652 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\0';
2653 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2654 code_props_translate_code (&plain_code
);
2655 gram_scanner_last_string_free ();
2656 (yyval
.chars
) = plain_code
.code
;
2658 #line 2659 "src/parse-gram.c" /* yacc.c:1663 */
2662 #line 694 "src/parse-gram.y" /* yacc.c:1663 */
2663 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2664 #line 2665 "src/parse-gram.c" /* yacc.c:1663 */
2668 #line 696 "src/parse-gram.y" /* yacc.c:1663 */
2670 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2671 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2672 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2674 #line 2675 "src/parse-gram.c" /* yacc.c:1663 */
2678 #line 704 "src/parse-gram.y" /* yacc.c:1663 */
2679 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2680 #line 2681 "src/parse-gram.c" /* yacc.c:1663 */
2684 #line 716 "src/parse-gram.y" /* yacc.c:1663 */
2686 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2687 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2689 #line 2690 "src/parse-gram.c" /* yacc.c:1663 */
2693 #line 725 "src/parse-gram.y" /* yacc.c:1663 */
2695 code_props plain_code
;
2696 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2697 code_props_translate_code (&plain_code
);
2698 gram_scanner_last_string_free ();
2699 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2700 code_scanner_last_string_free ();
2702 #line 2703 "src/parse-gram.c" /* yacc.c:1663 */
2706 #line 2707 "src/parse-gram.c" /* yacc.c:1663 */
2709 if (yychar_backup
!= yychar
)
2710 YY_LAC_DISCARD ("yychar change");
2712 /* User semantic actions sometimes alter yychar, and that requires
2713 that yytoken be updated with the new translation. We take the
2714 approach of translating immediately before every use of yytoken.
2715 One alternative is translating here after every semantic action,
2716 but that translation would be missed if the semantic action invokes
2717 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2718 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2719 incorrect destructor might then be invoked immediately. In the
2720 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2721 to an incorrect destructor call or verbose syntax error message
2722 before the lookahead is translated. */
2723 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2727 YY_STACK_PRINT (yyss
, yyssp
);
2732 /* Now 'shift' the result of the reduction. Determine what state
2733 that goes to, based on the state we popped back to and the rule
2734 number reduced by. */
2738 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2739 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2740 yystate
= yytable
[yystate
];
2742 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2747 /*--------------------------------------.
2748 | yyerrlab -- here on detecting error. |
2749 `--------------------------------------*/
2751 /* Make sure we have latest lookahead translation. See comments at
2752 user semantic actions for why this is necessary. */
2753 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2755 /* If not already recovering from an error, report this error. */
2759 #if ! YYERROR_VERBOSE
2760 yyerror (&yylloc
, YY_("syntax error"));
2762 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2763 yyesa, &yyes, &yyes_capacity, \
2766 char const *yymsgp
= YY_("syntax error");
2767 int yysyntax_error_status
;
2768 if (yychar
!= YYEMPTY
)
2770 yysyntax_error_status
= YYSYNTAX_ERROR
;
2771 if (yysyntax_error_status
== 0)
2773 else if (yysyntax_error_status
== 1)
2775 if (yymsg
!= yymsgbuf
)
2776 YYSTACK_FREE (yymsg
);
2777 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2781 yymsg_alloc
= sizeof yymsgbuf
;
2782 yysyntax_error_status
= 2;
2786 yysyntax_error_status
= YYSYNTAX_ERROR
;
2790 yyerror (&yylloc
, yymsgp
);
2791 if (yysyntax_error_status
== 2)
2792 goto yyexhaustedlab
;
2794 # undef YYSYNTAX_ERROR
2798 yyerror_range
[1] = yylloc
;
2800 if (yyerrstatus
== 3)
2802 /* If just tried and failed to reuse lookahead token after an
2803 error, discard it. */
2805 if (yychar
<= YYEOF
)
2807 /* Return failure if at end of input. */
2808 if (yychar
== YYEOF
)
2813 yydestruct ("Error: discarding",
2814 yytoken
, &yylval
, &yylloc
);
2819 /* Else will try to reuse lookahead token after shifting the error
2824 /*---------------------------------------------------.
2825 | yyerrorlab -- error raised explicitly by YYERROR. |
2826 `---------------------------------------------------*/
2829 /* Pacify compilers like GCC when the user code never invokes
2830 YYERROR and the label yyerrorlab therefore never appears in user
2832 if (/*CONSTCOND*/ 0)
2835 yyerror_range
[1] = yylsp
[1-yylen
];
2836 /* Do not reclaim the symbols of the rule whose action triggered
2840 YY_STACK_PRINT (yyss
, yyssp
);
2845 /*-------------------------------------------------------------.
2846 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2847 `-------------------------------------------------------------*/
2849 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2853 yyn
= yypact
[yystate
];
2854 if (!yypact_value_is_default (yyn
))
2857 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2865 /* Pop the current state because it cannot handle the error token. */
2869 yyerror_range
[1] = *yylsp
;
2870 yydestruct ("Error: popping",
2871 yystos
[yystate
], yyvsp
, yylsp
);
2874 YY_STACK_PRINT (yyss
, yyssp
);
2877 /* If the stack popping above didn't lose the initial context for the
2878 current lookahead token, the shift below will for sure. */
2879 YY_LAC_DISCARD ("error recovery");
2881 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2883 YY_IGNORE_MAYBE_UNINITIALIZED_END
2885 yyerror_range
[2] = yylloc
;
2886 /* Using YYLLOC is tempting, but would change the location of
2887 the lookahead. YYLOC is available though. */
2888 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2891 /* Shift the error token. */
2892 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2898 /*-------------------------------------.
2899 | yyacceptlab -- YYACCEPT comes here. |
2900 `-------------------------------------*/
2905 /*-----------------------------------.
2906 | yyabortlab -- YYABORT comes here. |
2907 `-----------------------------------*/
2913 /*-------------------------------------------------.
2914 | yyexhaustedlab -- memory exhaustion comes here. |
2915 `-------------------------------------------------*/
2917 yyerror (&yylloc
, YY_("memory exhausted"));
2923 if (yychar
!= YYEMPTY
)
2925 /* Make sure we have latest lookahead translation. See comments at
2926 user semantic actions for why this is necessary. */
2927 yytoken
= YYTRANSLATE (yychar
);
2928 yydestruct ("Cleanup: discarding lookahead",
2929 yytoken
, &yylval
, &yylloc
);
2931 /* Do not reclaim the symbols of the rule whose action triggered
2932 this YYABORT or YYACCEPT. */
2934 YY_STACK_PRINT (yyss
, yyssp
);
2935 while (yyssp
!= yyss
)
2937 yydestruct ("Cleanup: popping",
2938 yystos
[*yyssp
], yyvsp
, yylsp
);
2943 YYSTACK_FREE (yyss
);
2946 YYSTACK_FREE (yyes
);
2948 if (yymsg
!= yymsgbuf
)
2949 YYSTACK_FREE (yymsg
);
2953 #line 735 "src/parse-gram.y" /* yacc.c:1923 */
2956 /* Return the location of the left-hand side of a rule whose
2957 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2958 the right-hand side, and return an empty location equal to the end
2959 boundary of RHS[0] if the right-hand side is empty. */
2962 lloc_default (YYLTYPE
const *rhs
, int n
)
2967 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2968 The bug is fixed in 7.4.2m, but play it safe for now. */
2969 loc
.start
= rhs
[n
].end
;
2970 loc
.end
= rhs
[n
].end
;
2972 /* Ignore empty nonterminals the start of the right-hand side.
2973 Do not bother to ignore them at the end of the right-hand side,
2974 since empty nonterminals have the same end as their predecessors. */
2975 for (i
= 1; i
<= n
; i
++)
2976 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2978 loc
.start
= rhs
[i
].start
;
2987 add_param (param_type type
, char *decl
, location loc
)
2989 static char const alphanum
[26 + 26 + 1 + 10] =
2990 "abcdefghijklmnopqrstuvwxyz"
2991 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2995 char const *name_start
= NULL
;
2998 /* Stop on last actual character. */
2999 for (p
= decl
; p
[1]; p
++)
3001 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3002 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3005 /* Strip the surrounding '{' and '}', and any blanks just inside
3008 while (c_isspace ((unsigned char) *p
))
3012 while (c_isspace ((unsigned char) *decl
))
3017 complain (&loc
, complaint
, _("missing identifier in parameter declaration"));
3020 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3021 if (type
& param_lex
)
3022 muscle_pair_list_grow ("lex_param", decl
, name
);
3023 if (type
& param_parse
)
3024 muscle_pair_list_grow ("parse_param", decl
, name
);
3028 gram_scanner_last_string_free ();
3033 version_check (location
const *loc
, char const *version
)
3035 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3037 complain (loc
, complaint
, "require bison %s, but have %s",
3038 version
, PACKAGE_VERSION
);
3044 gram_error (location
const *loc
, char const *msg
)
3046 complain (loc
, complaint
, "%s", msg
);
3050 token_name (int type
)
3052 return yytname
[YYTRANSLATE (type
)];
3063 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3064 return quotearg_style (escape_quoting_style
, buf
);
3070 current_lhs (symbol
*sym
, location loc
, named_ref
*ref
)
3072 current_lhs_symbol
= sym
;
3073 current_lhs_location
= loc
;
3074 /* In order to simplify memory management, named references for lhs
3075 are always assigned by deep copy into the current symbol_list
3076 node. This is because a single named-ref in the grammar may
3077 result in several uses when the user factors lhs between several
3078 rules using "|". Therefore free the parser's original copy. */
3079 free (current_lhs_named_ref
);
3080 current_lhs_named_ref
= ref
;