1 /* A Bison parser, made by GNU Bison 2.7.987-a2db-dirty. */
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.7.987-a2db-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 yylval gram_lval
69 #define yychar gram_char
70 #define yydebug gram_debug
71 #define yynerrs gram_nerrs
72 #define yylloc gram_lloc
74 /* Copy the first part of user declarations. */
75 #line 1 "src/parse-gram.y" /* yacc.c:356 */
76 /* Bison Grammar Parser -*- C -*-
78 Copyright (C) 2002-2012 Free Software Foundation, Inc.
80 This file is part of Bison, the GNU Compiler Compiler.
82 This program is free software: you can redistribute it and/or modify
83 it under the terms of the GNU General Public License as published by
84 the Free Software Foundation, either version 3 of the License, or
85 (at your option) any later version.
87 This program is distributed in the hope that it will be useful,
88 but WITHOUT ANY WARRANTY; without even the implied warranty of
89 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
90 GNU General Public License for more details.
92 You should have received a copy of the GNU General Public License
93 along with this program. If not, see <http://www.gnu.org/licenses/>. */
100 #include "conflicts.h"
104 #include "muscle-tab.h"
105 #include "named-ref.h"
106 #include "quotearg.h"
110 #include "scan-gram.h"
111 #include "scan-code.h"
112 #include "xmemdup0.h"
114 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
115 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
117 #define YY_LOCATION_PRINT(File, Loc) \
118 location_print (File, Loc)
120 static void version_check (location
const *loc
, char const *version
);
122 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
123 FIXME: depends on the undocumented availability of YYLLOC. */
125 #define yyerror(Msg) \
126 gram_error (&yylloc, Msg)
127 static void gram_error (location
const *, char const *);
129 static char const *char_name (char);
131 #line 132 "src/parse-gram.c" /* yacc.c:356 */
134 # if defined __cplusplus && 201103L <= __cplusplus
135 # define YY_NULL nullptr
141 /* Enabling verbose error messages. */
142 #ifdef YYERROR_VERBOSE
143 # undef YYERROR_VERBOSE
144 # define YYERROR_VERBOSE 1
146 # define YYERROR_VERBOSE 1
149 /* In a future release of Bison, this section will be replaced
150 by #include "src/parse-gram.h". */
151 #ifndef YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
152 # define YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
157 # define GRAM_DEBUG 1
159 # define GRAM_DEBUG 0
161 # else /* ! defined YYDEBUG */
162 # define GRAM_DEBUG 1
163 # endif /* ! defined YYDEBUG */
164 #endif /* ! defined GRAM_DEBUG */
166 extern int gram_debug
;
168 /* "%code requires" blocks. */
169 #line 223 "src/parse-gram.y" /* yacc.c:372 */
177 param_parse
= 1 << 1,
178 param_both
= param_lex
| param_parse
183 #line 184 "src/parse-gram.c" /* yacc.c:372 */
186 #ifndef GRAM_TOKENTYPE
187 # define GRAM_TOKENTYPE
196 PERCENT_DESTRUCTOR
= 263,
197 PERCENT_PRINTER
= 264,
200 PERCENT_NONASSOC
= 267,
201 PERCENT_PRECEDENCE
= 268,
206 PERCENT_DEFAULT_PREC
= 273,
207 PERCENT_DEFINE
= 274,
208 PERCENT_DEFINES
= 275,
209 PERCENT_ERROR_VERBOSE
= 276,
210 PERCENT_EXPECT
= 277,
211 PERCENT_EXPECT_RR
= 278,
213 PERCENT_FILE_PREFIX
= 280,
214 PERCENT_GLR_PARSER
= 281,
215 PERCENT_INITIAL_ACTION
= 282,
216 PERCENT_LANGUAGE
= 283,
217 PERCENT_NAME_PREFIX
= 284,
218 PERCENT_NO_DEFAULT_PREC
= 285,
219 PERCENT_NO_LINES
= 286,
220 PERCENT_NONDETERMINISTIC_PARSER
= 287,
221 PERCENT_OUTPUT
= 288,
222 PERCENT_REQUIRE
= 289,
223 PERCENT_SKELETON
= 290,
225 PERCENT_TOKEN_TABLE
= 292,
226 PERCENT_VERBOSE
= 293,
229 BRACED_PREDICATE
= 296,
236 PERCENT_PERCENT
= 303,
251 #define PERCENT_TOKEN 260
252 #define PERCENT_NTERM 261
253 #define PERCENT_TYPE 262
254 #define PERCENT_DESTRUCTOR 263
255 #define PERCENT_PRINTER 264
256 #define PERCENT_LEFT 265
257 #define PERCENT_RIGHT 266
258 #define PERCENT_NONASSOC 267
259 #define PERCENT_PRECEDENCE 268
260 #define PERCENT_PREC 269
261 #define PERCENT_DPREC 270
262 #define PERCENT_MERGE 271
263 #define PERCENT_CODE 272
264 #define PERCENT_DEFAULT_PREC 273
265 #define PERCENT_DEFINE 274
266 #define PERCENT_DEFINES 275
267 #define PERCENT_ERROR_VERBOSE 276
268 #define PERCENT_EXPECT 277
269 #define PERCENT_EXPECT_RR 278
270 #define PERCENT_FLAG 279
271 #define PERCENT_FILE_PREFIX 280
272 #define PERCENT_GLR_PARSER 281
273 #define PERCENT_INITIAL_ACTION 282
274 #define PERCENT_LANGUAGE 283
275 #define PERCENT_NAME_PREFIX 284
276 #define PERCENT_NO_DEFAULT_PREC 285
277 #define PERCENT_NO_LINES 286
278 #define PERCENT_NONDETERMINISTIC_PARSER 287
279 #define PERCENT_OUTPUT 288
280 #define PERCENT_REQUIRE 289
281 #define PERCENT_SKELETON 290
282 #define PERCENT_START 291
283 #define PERCENT_TOKEN_TABLE 292
284 #define PERCENT_VERBOSE 293
285 #define PERCENT_YACC 294
286 #define BRACED_CODE 295
287 #define BRACED_PREDICATE 296
288 #define BRACKETED_ID 297
294 #define PERCENT_PERCENT 303
297 #define SEMICOLON 306
301 #define PERCENT_PARAM 310
302 #define PERCENT_UNION 311
305 #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
306 typedef union GRAM_STYPE GRAM_STYPE
;
309 #line 109 "src/parse-gram.y" /* yacc.c:372 */
315 named_ref
*named_ref
;
319 unsigned char character
;
321 #line 247 "src/parse-gram.y" /* yacc.c:372 */
325 #line 423 "src/parse-gram.y" /* yacc.c:372 */
326 code_props_type code_type
;
328 #line 329 "src/parse-gram.c" /* yacc.c:372 */
330 # define GRAM_STYPE_IS_TRIVIAL 1
331 # define GRAM_STYPE_IS_DECLARED 1
335 #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
336 typedef struct GRAM_LTYPE GRAM_LTYPE
;
344 # define GRAM_LTYPE_IS_DECLARED 1
345 # define GRAM_LTYPE_IS_TRIVIAL 1
350 int gram_parse (void);
352 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */
354 /* Copy the second part of user declarations. */
356 #line 357 "src/parse-gram.c" /* yacc.c:375 */
357 /* Unqualified %code blocks. */
358 #line 58 "src/parse-gram.y" /* yacc.c:376 */
360 static int current_prec
= 0;
361 static location current_lhs_location
;
362 static named_ref
*current_lhs_named_ref
;
363 static symbol
*current_lhs_symbol
;
364 static symbol_class current_class
= unknown_sym
;
365 static uniqstr current_type
= NULL
;
367 /** Set the new current left-hand side symbol, possibly common
368 * to several right-hand side parts of rule.
372 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
374 current_lhs_symbol
= sym
;
375 current_lhs_location
= loc
;
376 /* In order to simplify memory management, named references for lhs
377 are always assigned by deep copy into the current symbol_list
378 node. This is because a single named-ref in the grammar may
379 result in several uses when the user factors lhs between several
380 rules using "|". Therefore free the parser's original copy. */
381 free (current_lhs_named_ref
);
382 current_lhs_named_ref
= ref
;
385 #define YYTYPE_INT16 int_fast16_t
386 #define YYTYPE_INT8 int_fast8_t
387 #define YYTYPE_UINT16 uint_fast16_t
388 #define YYTYPE_UINT8 uint_fast8_t
390 #line 236 "src/parse-gram.y" /* yacc.c:376 */
392 /** Add a lex-param and/or a parse-param.
394 * \param type where to push this formal argument.
395 * \param decl the formal argument. Destroyed.
396 * \param loc the location in the source.
398 static void add_param (param_type type
, char *decl
, location loc
);
399 static param_type current_param
= param_none
;
402 #line 403 "src/parse-gram.c" /* yacc.c:376 */
409 typedef YYTYPE_UINT8 yytype_uint8
;
411 typedef unsigned char yytype_uint8
;
415 typedef YYTYPE_INT8 yytype_int8
;
417 typedef signed char yytype_int8
;
421 typedef YYTYPE_UINT16 yytype_uint16
;
423 typedef unsigned short int yytype_uint16
;
427 typedef YYTYPE_INT16 yytype_int16
;
429 typedef short int yytype_int16
;
433 # ifdef __SIZE_TYPE__
434 # define YYSIZE_T __SIZE_TYPE__
435 # elif defined size_t
436 # define YYSIZE_T size_t
437 # elif ! defined YYSIZE_T
438 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
439 # define YYSIZE_T size_t
441 # define YYSIZE_T unsigned int
445 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
448 # if defined YYENABLE_NLS && YYENABLE_NLS
450 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
451 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
455 # define YY_(Msgid) Msgid
459 /* Suppress unused-variable warnings by "using" E. */
461 # define YYUSE(E) ((void) (E))
463 # define YYUSE(E) /* empty */
468 /* The parser invokes alloca or malloc; define the necessary symbols. */
470 # ifdef YYSTACK_ALLOC
471 /* Pacify GCC's `empty if-body' warning. */
472 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
473 # ifndef YYSTACK_ALLOC_MAXIMUM
474 /* The OS might guarantee only one guard page at the bottom of the stack,
475 and a page size can be as small as 4096 bytes. So we cannot safely
476 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
477 to allow for a few compiler-allocated temporary stack slots. */
478 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
481 # define YYSTACK_ALLOC YYMALLOC
482 # define YYSTACK_FREE YYFREE
483 # ifndef YYSTACK_ALLOC_MAXIMUM
484 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
486 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
487 && ! ((defined YYMALLOC || defined malloc) \
488 && (defined YYFREE || defined free)))
489 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
490 # ifndef EXIT_SUCCESS
491 # define EXIT_SUCCESS 0
495 # define YYMALLOC malloc
496 # if ! defined malloc && ! defined EXIT_SUCCESS
497 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
502 # if ! defined free && ! defined EXIT_SUCCESS
503 void free (void *); /* INFRINGES ON USER NAME SPACE */
507 # define YYCOPY_NEEDED 1
511 #if (! defined yyoverflow \
512 && (! defined __cplusplus \
513 || (defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL \
514 && defined GRAM_STYPE_IS_TRIVIAL && GRAM_STYPE_IS_TRIVIAL)))
516 /* A type that is properly aligned for any stack member. */
519 yytype_int16 yyss_alloc
;
524 /* The size of the maximum gap between one aligned stack and the next. */
525 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
527 /* The size of an array large to enough to hold all stacks, each with
529 # define YYSTACK_BYTES(N) \
530 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
531 + 2 * YYSTACK_GAP_MAXIMUM)
533 # define YYCOPY_NEEDED 1
535 /* Relocate STACK from its old location to the new one. The
536 local variables YYSIZE and YYSTACKSIZE give the old and new number of
537 elements in the stack, and YYPTR gives the new location of the
538 stack. Advance YYPTR to a properly aligned location for the next
540 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
543 YYSIZE_T yynewbytes; \
544 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
545 Stack = &yyptr->Stack_alloc; \
546 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
547 yyptr += yynewbytes / sizeof (*yyptr); \
553 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
554 /* Copy COUNT objects from SRC to DST. The source and destination do
557 # if defined __GNUC__ && 1 < __GNUC__
558 # define YYCOPY(Dst, Src, Count) \
559 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
561 # define YYCOPY(Dst, Src, Count) \
565 for (yyi = 0; yyi < (Count); yyi++) \
566 (Dst)[yyi] = (Src)[yyi]; \
571 #endif /* !YYCOPY_NEEDED */
573 /* YYFINAL -- State number of the termination state. */
575 /* YYLAST -- Last index in YYTABLE. */
578 /* YYNTOKENS -- Number of terminals. */
580 /* YYNNTS -- Number of nonterminals. */
582 /* YYNRULES -- Number of rules. */
584 /* YYNSTATES -- Number of states. */
585 #define YYNSTATES 143
587 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
588 by yylex, with out-of-bounds checking. */
590 #define YYMAXUTOK 311
592 #define YYTRANSLATE(YYX) \
593 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
595 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
596 as returned by yylex, without out-of-bounds checking. */
597 static const yytype_uint8 yytranslate
[] =
599 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
625 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
626 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
627 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
628 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
629 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
634 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
635 static const yytype_uint16 yyrline
[] =
637 0, 272, 272, 280, 282, 286, 287, 297, 301, 306,
638 307, 312, 317, 318, 319, 320, 325, 334, 335, 336,
639 337, 338, 339, 339, 340, 341, 365, 366, 367, 368,
640 372, 373, 382, 383, 384, 388, 400, 404, 408, 415,
641 426, 427, 437, 438, 442, 454, 454, 459, 459, 464,
642 475, 490, 491, 492, 493, 497, 498, 503, 505, 510,
643 511, 516, 518, 523, 524, 528, 529, 533, 534, 535,
644 540, 545, 550, 556, 562, 573, 574, 583, 584, 590,
645 591, 592, 599, 599, 607, 608, 609, 614, 616, 618,
646 620, 622, 624, 626, 631, 633, 643, 644, 649, 650,
647 651, 660, 680, 682, 691, 696, 697, 702, 709, 711
651 #if GRAM_DEBUG || YYERROR_VERBOSE || 1
652 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
653 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
654 static const char *const yytname
[] =
656 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
657 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
658 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
659 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
660 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
661 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
662 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
663 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
664 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
665 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
666 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
667 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
668 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
669 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
670 "prologue_declaration", "$@1", "params", "grammar_declaration",
671 "code_props_type", "union_name", "symbol_declaration", "$@2", "$@3",
672 "precedence_declaration", "precedence_declarator", "tag.opt",
673 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
674 "generic_symlist_item", "tag", "symbol_def", "symbol_defs.1", "grammar",
675 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
676 "named_ref.opt", "variable", "content.opt", "braceless", "id",
677 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
682 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
683 (internal) symbol number NUM (which must be that of a token). */
684 static const yytype_uint16 yytoknum
[] =
686 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
687 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
688 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
689 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
690 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
691 305, 306, 307, 308, 309, 310, 311
695 #define YYPACT_NINF -74
697 #define yypact_value_is_default(Yystate) \
698 (!!((Yystate) == (-74)))
700 #define YYTABLE_NINF -109
702 #define yytable_value_is_error(Yytable_value) \
705 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
707 static const yytype_int16 yypact
[] =
709 -74, 40, 101, -74, -74, -74, -48, -74, -74, -74,
710 -74, -74, -74, 19, -74, 0, 52, -74, 56, 79,
711 -74, 81, -74, 45, 83, 84, -74, -74, -74, 85,
712 86, 87, 31, -74, -74, -74, 15, -74, -74, -74,
713 46, -74, -74, 51, -74, -74, 42, 4, 4, 31,
714 -74, 57, -74, -74, -74, 36, -74, -74, -74, -74,
715 -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
716 -74, -74, 47, -74, 49, 1, -74, -74, 59, 62,
717 -74, 57, 26, -74, 31, -74, -74, 4, 72, 4,
718 31, -74, -74, -74, -74, -74, -74, -74, 60, -74,
719 -74, -74, -74, -74, 63, -74, -74, -74, -74, 26,
720 -74, -74, -74, 31, -74, 111, -74, 113, -74, -74,
721 -74, -74, -74, -74, -74, -74, -74, -13, 27, -74,
722 -74, 31, 137, 65, 59, -74, 59, 27, -74, -74,
726 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
727 Performed when YYTABLE does not specify something else to do. Zero
728 means the default is an error. */
729 static const yytype_uint8 yydefact
[] =
731 3, 0, 0, 1, 47, 45, 0, 40, 41, 51,
732 52, 53, 54, 0, 36, 0, 9, 11, 0, 0,
733 7, 0, 15, 0, 0, 0, 37, 19, 20, 0,
734 0, 0, 0, 26, 27, 28, 0, 6, 29, 22,
735 42, 4, 5, 0, 33, 32, 55, 0, 0, 0,
736 101, 0, 38, 97, 96, 98, 10, 12, 13, 14,
737 16, 17, 18, 21, 24, 25, 107, 103, 102, 105,
738 34, 106, 0, 104, 0, 0, 77, 79, 94, 0,
739 43, 0, 0, 56, 0, 70, 75, 48, 71, 46,
740 49, 61, 39, 100, 99, 8, 81, 80, 0, 78,
741 2, 95, 82, 31, 23, 44, 67, 68, 69, 35,
742 63, 66, 65, 50, 57, 59, 76, 72, 73, 62,
743 109, 87, 30, 64, 58, 60, 74, 83, 84, 87,
744 86, 0, 0, 0, 94, 90, 94, 85, 91, 92,
748 /* YYPGOTO[NTERM-NUM]. */
749 static const yytype_int16 yypgoto
[] =
751 -74, -74, -74, -74, -74, -74, 140, -74, -74, -74,
752 -74, -74, -74, -74, -74, -74, 30, -74, -74, 35,
753 -74, -26, 97, -74, 71, -74, -74, -74, 18, -70,
754 -74, -74, -46, 6, -74, -32, -73, -74
757 /* YYDEFGOTO[NTERM-NUM]. */
758 static const yytype_int16 yydefgoto
[] =
760 -1, 1, 2, 41, 79, 104, 74, 43, 81, 44,
761 48, 47, 45, 46, 84, 113, 114, 90, 109, 110,
762 111, 86, 87, 75, 76, 77, 121, 127, 128, 102,
763 55, 95, 52, 69, 78, 112, 71, 100
766 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
767 positive, shift that token. If negative, reduce the rule whose
768 number is the opposite. If YYTABLE_NINF, syntax error. */
769 static const yytype_int16 yytable
[] =
771 70, -108, 72, 53, 49, 92, 4, 5, 6, 7,
772 8, 9, 10, 11, 12, 118, 72, 91, 13, 14,
773 4, 5, 6, 7, 8, 9, 10, 11, 12, 66,
774 66, 26, 13, 14, 66, 105, 129, 32, 130, 93,
775 3, 131, 132, 133, 126, 26, 54, 67, 73, 98,
776 68, 32, 115, 88, 88, 56, 85, 40, 119, 50,
777 57, 116, 73, 116, 141, 51, 142, 134, 135, 67,
778 67, 40, 68, 68, 67, 66, 117, 68, 106, 107,
779 108, 115, 94, 58, 59, 60, 61, 62, 63, 64,
780 65, 82, 80, 88, 83, 88, 136, 50, 96, 138,
781 97, 101, 103, 122, 120, 136, 4, 5, 6, 7,
782 8, 9, 10, 11, 12, 125, 66, 140, 13, 14,
783 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
784 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
785 35, 139, 42, 124, 123, 89, 99, 137, 0, 36,
786 0, 37, 38, 0, 0, 0, 39, 40
789 static const yytype_int16 yycheck
[] =
791 32, 0, 1, 3, 52, 51, 5, 6, 7, 8,
792 9, 10, 11, 12, 13, 88, 1, 49, 17, 18,
793 5, 6, 7, 8, 9, 10, 11, 12, 13, 3,
794 3, 30, 17, 18, 3, 81, 49, 36, 51, 3,
795 0, 14, 15, 16, 117, 30, 46, 43, 47, 48,
796 46, 36, 84, 47, 48, 3, 52, 56, 90, 40,
797 4, 87, 47, 89, 134, 46, 136, 40, 41, 43,
798 43, 56, 46, 46, 43, 3, 4, 46, 52, 53,
799 54, 113, 46, 4, 3, 40, 3, 3, 3, 3,
800 3, 40, 46, 87, 52, 89, 128, 40, 51, 131,
801 51, 42, 40, 40, 44, 137, 5, 6, 7, 8,
802 9, 10, 11, 12, 13, 4, 3, 52, 17, 18,
803 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
804 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
805 39, 4, 2, 113, 109, 48, 75, 129, -1, 48,
806 -1, 50, 51, -1, -1, -1, 55, 56
809 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
810 symbol of state STATE-NUM. */
811 static const yytype_uint8 yystos
[] =
813 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
814 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
815 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
816 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
817 56, 60, 63, 64, 66, 69, 70, 68, 67, 52,
818 40, 46, 89, 3, 46, 87, 3, 4, 4, 3,
819 40, 3, 3, 3, 3, 3, 3, 43, 46, 90,
820 92, 93, 1, 47, 63, 80, 81, 82, 91, 61,
821 46, 65, 40, 52, 71, 52, 78, 79, 90, 79,
822 74, 92, 89, 3, 46, 88, 51, 51, 48, 81,
823 94, 42, 86, 40, 62, 89, 52, 53, 54, 75,
824 76, 77, 92, 72, 73, 92, 78, 4, 93, 92,
825 44, 83, 40, 76, 73, 4, 93, 84, 85, 49,
826 51, 14, 15, 16, 40, 41, 92, 85, 92, 4,
830 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
831 static const yytype_uint8 yyr1
[] =
833 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
834 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
835 60, 60, 61, 60, 60, 60, 60, 60, 60, 60,
836 62, 62, 63, 63, 63, 63, 63, 63, 63, 63,
837 64, 64, 65, 65, 63, 67, 66, 68, 66, 66,
838 69, 70, 70, 70, 70, 71, 71, 72, 72, 73,
839 73, 74, 74, 75, 75, 76, 76, 77, 77, 77,
840 78, 78, 78, 78, 78, 79, 79, 80, 80, 81,
841 81, 81, 83, 82, 84, 84, 84, 85, 85, 85,
842 85, 85, 85, 85, 86, 86, 87, 87, 88, 88,
843 88, 89, 90, 90, 91, 92, 92, 93, 94, 94
846 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
847 static const yytype_uint8 yyr2
[] =
849 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
850 2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
851 1, 2, 0, 3, 2, 2, 1, 1, 1, 1,
852 2, 1, 1, 1, 2, 3, 1, 1, 2, 3,
853 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
854 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
855 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
856 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
857 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
858 2, 3, 3, 3, 0, 1, 1, 1, 0, 1,
859 1, 1, 1, 1, 1, 1, 1, 1, 0, 2
863 #define yyerrok (yyerrstatus = 0)
864 #define yyclearin (yychar = YYEMPTY)
868 #define YYACCEPT goto yyacceptlab
869 #define YYABORT goto yyabortlab
870 #define YYERROR goto yyerrorlab
873 #define YYRECOVERING() (!!yyerrstatus)
875 #define YYBACKUP(Token, Value) \
877 if (yychar == YYEMPTY) \
881 YYPOPSTACK (yylen); \
883 YY_LAC_DISCARD ("YYBACKUP"); \
888 yyerror (YY_("syntax error: cannot back up")); \
893 /* Error token number */
895 #define YYERRCODE 256
898 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
899 If N is 0, then set CURRENT to the empty location which ends
900 the previous symbol: RHS[0] (always defined). */
902 #ifndef YYLLOC_DEFAULT
903 # define YYLLOC_DEFAULT(Current, Rhs, N) \
907 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
908 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
909 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
910 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
914 (Current).first_line = (Current).last_line = \
915 YYRHSLOC (Rhs, 0).last_line; \
916 (Current).first_column = (Current).last_column = \
917 YYRHSLOC (Rhs, 0).last_column; \
922 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
925 /* YY_LOCATION_PRINT -- Print the location on the stream.
926 This macro was not mandated originally: define only if we know
927 we won't break user code: when these are the locations we know. */
929 #ifndef YY_LOCATION_PRINT
930 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
932 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
934 __attribute__((__unused__
))
936 yy_location_print_ (FILE *yyo
, YYLTYPE
const * const yylocp
)
939 int end_col
= 0 != yylocp
->last_column
? yylocp
->last_column
- 1 : 0;
940 if (0 <= yylocp
->first_line
)
942 res
+= fprintf (yyo
, "%d", yylocp
->first_line
);
943 if (0 <= yylocp
->first_column
)
944 res
+= fprintf (yyo
, ".%d", yylocp
->first_column
);
946 if (0 <= yylocp
->last_line
)
948 if (yylocp
->first_line
< yylocp
->last_line
)
950 res
+= fprintf (yyo
, "-%d", yylocp
->last_line
);
952 res
+= fprintf (yyo
, ".%d", end_col
);
954 else if (0 <= end_col
&& yylocp
->first_column
< end_col
)
955 res
+= fprintf (yyo
, "-%d", end_col
);
960 # define YY_LOCATION_PRINT(File, Loc) \
961 yy_location_print_ (File, &(Loc))
964 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
969 /* Enable debugging if requested. */
973 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
974 # define YYFPRINTF fprintf
977 # define YYDPRINTF(Args) \
983 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
987 YYFPRINTF (stderr, "%s ", Title); \
988 yy_symbol_print (stderr, \
989 Type, Value, Location); \
990 YYFPRINTF (stderr, "\n"); \
995 /*--------------------------------.
996 | Print this symbol on YYOUTPUT. |
997 `--------------------------------*/
1000 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1002 FILE *yyo
= yyoutput
;
1004 YYUSE (yylocationp
);
1008 if (yytype
< YYNTOKENS
)
1009 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1013 case 3: /* "string" */
1014 #line 196 "src/parse-gram.y" /* yacc.c:705 */
1015 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), yyo
); }
1016 #line 1017 "src/parse-gram.c" /* yacc.c:705 */
1019 case 4: /* "integer" */
1020 #line 209 "src/parse-gram.y" /* yacc.c:705 */
1021 { fprintf (yyo
, "%d", ((*yyvaluep
).integer
)); }
1022 #line 1023 "src/parse-gram.c" /* yacc.c:705 */
1025 case 24: /* "%<flag>" */
1026 #line 205 "src/parse-gram.y" /* yacc.c:705 */
1027 { fprintf (yyo
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1028 #line 1029 "src/parse-gram.c" /* yacc.c:705 */
1031 case 40: /* "{...}" */
1032 #line 198 "src/parse-gram.y" /* yacc.c:705 */
1033 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1034 #line 1035 "src/parse-gram.c" /* yacc.c:705 */
1037 case 42: /* "[identifier]" */
1038 #line 203 "src/parse-gram.y" /* yacc.c:705 */
1039 { fprintf (yyo
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1040 #line 1041 "src/parse-gram.c" /* yacc.c:705 */
1043 case 43: /* "char" */
1044 #line 190 "src/parse-gram.y" /* yacc.c:705 */
1045 { fputs (char_name (((*yyvaluep
).character
)), yyo
); }
1046 #line 1047 "src/parse-gram.c" /* yacc.c:705 */
1049 case 44: /* "epilogue" */
1050 #line 198 "src/parse-gram.y" /* yacc.c:705 */
1051 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1052 #line 1053 "src/parse-gram.c" /* yacc.c:705 */
1055 case 46: /* "identifier" */
1056 #line 202 "src/parse-gram.y" /* yacc.c:705 */
1057 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1058 #line 1059 "src/parse-gram.c" /* yacc.c:705 */
1061 case 47: /* "identifier:" */
1062 #line 204 "src/parse-gram.y" /* yacc.c:705 */
1063 { fprintf (yyo
, "%s:", ((*yyvaluep
).uniqstr
)); }
1064 #line 1065 "src/parse-gram.c" /* yacc.c:705 */
1067 case 50: /* "%{...%}" */
1068 #line 198 "src/parse-gram.y" /* yacc.c:705 */
1069 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1070 #line 1071 "src/parse-gram.c" /* yacc.c:705 */
1073 case 52: /* "<tag>" */
1074 #line 206 "src/parse-gram.y" /* yacc.c:705 */
1075 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1076 #line 1077 "src/parse-gram.c" /* yacc.c:705 */
1079 case 55: /* "%param" */
1080 #line 252 "src/parse-gram.y" /* yacc.c:705 */
1082 switch (((*yyvaluep
).param
))
1084 #define CASE(In, Out) \
1085 case param_ ## In: fputs ("%" #Out, stderr); break
1086 CASE(lex
, lex
-param
);
1087 CASE(parse
, parse
-param
);
1090 case param_none
: aver (false); break;
1093 #line 1094 "src/parse-gram.c" /* yacc.c:705 */
1096 case 64: /* code_props_type */
1097 #line 424 "src/parse-gram.y" /* yacc.c:705 */
1098 { fprintf (yyo
, "%s", code_props_type_string (((*yyvaluep
).code_type
))); }
1099 #line 1100 "src/parse-gram.c" /* yacc.c:705 */
1102 case 73: /* symbol.prec */
1103 #line 212 "src/parse-gram.y" /* yacc.c:705 */
1104 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1105 #line 1106 "src/parse-gram.c" /* yacc.c:705 */
1109 #line 206 "src/parse-gram.y" /* yacc.c:705 */
1110 { fprintf (yyo
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1111 #line 1112 "src/parse-gram.c" /* yacc.c:705 */
1114 case 87: /* variable */
1115 #line 202 "src/parse-gram.y" /* yacc.c:705 */
1116 { fputs (((*yyvaluep
).uniqstr
), yyo
); }
1117 #line 1118 "src/parse-gram.c" /* yacc.c:705 */
1120 case 88: /* content.opt */
1121 #line 198 "src/parse-gram.y" /* yacc.c:705 */
1122 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1123 #line 1124 "src/parse-gram.c" /* yacc.c:705 */
1126 case 89: /* braceless */
1127 #line 198 "src/parse-gram.y" /* yacc.c:705 */
1128 { fprintf (yyo
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1129 #line 1130 "src/parse-gram.c" /* yacc.c:705 */
1133 #line 212 "src/parse-gram.y" /* yacc.c:705 */
1134 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1135 #line 1136 "src/parse-gram.c" /* yacc.c:705 */
1138 case 91: /* id_colon */
1139 #line 213 "src/parse-gram.y" /* yacc.c:705 */
1140 { fprintf (yyo
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1141 #line 1142 "src/parse-gram.c" /* yacc.c:705 */
1144 case 92: /* symbol */
1145 #line 212 "src/parse-gram.y" /* yacc.c:705 */
1146 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1147 #line 1148 "src/parse-gram.c" /* yacc.c:705 */
1150 case 93: /* string_as_id */
1151 #line 212 "src/parse-gram.y" /* yacc.c:705 */
1152 { fprintf (yyo
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1153 #line 1154 "src/parse-gram.c" /* yacc.c:705 */
1162 /*--------------------------------.
1163 | Print this symbol on YYOUTPUT. |
1164 `--------------------------------*/
1167 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1169 if (yytype
< YYNTOKENS
)
1170 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1172 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1174 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1175 YYFPRINTF (yyoutput
, ": ");
1176 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1177 YYFPRINTF (yyoutput
, ")");
1180 /*------------------------------------------------------------------.
1181 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1183 `------------------------------------------------------------------*/
1186 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1188 YYFPRINTF (stderr
, "Stack now");
1189 for (; yybottom
<= yytop
; yybottom
++)
1191 int yybot
= *yybottom
;
1192 YYFPRINTF (stderr
, " %d", yybot
);
1194 YYFPRINTF (stderr
, "\n");
1197 # define YY_STACK_PRINT(Bottom, Top) \
1200 yy_stack_print ((Bottom), (Top)); \
1204 /*------------------------------------------------.
1205 | Report that the YYRULE is going to be reduced. |
1206 `------------------------------------------------*/
1209 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1211 unsigned long int yylno
= yyrline
[yyrule
];
1212 int yynrhs
= yyr2
[yyrule
];
1214 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1216 /* The symbols being reduced. */
1217 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1219 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1220 yy_symbol_print (stderr
,
1221 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1222 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1223 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1224 YYFPRINTF (stderr
, "\n");
1228 # define YY_REDUCE_PRINT(Rule) \
1231 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1234 /* Nonzero means print parse trace. It is left uninitialized so that
1235 multiple parsers can coexist. */
1237 #else /* !GRAM_DEBUG */
1238 # define YYDPRINTF(Args)
1239 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1240 # define YY_STACK_PRINT(Bottom, Top)
1241 # define YY_REDUCE_PRINT(Rule)
1242 #endif /* !GRAM_DEBUG */
1245 /* YYINITDEPTH -- initial size of the parser's stacks. */
1247 # define YYINITDEPTH 200
1250 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1251 if the built-in stack extension method is used).
1253 Do not make this value too large; the results are undefined if
1254 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1255 evaluated with infinite-precision integer arithmetic. */
1258 # define YYMAXDEPTH 10000
1261 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1262 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1263 stack, and such that *YYCAPACITY is the maximum number of elements it
1264 can hold without a reallocation, make sure there is enough room to
1265 store YYADD more elements. If not, allocate a new stack using
1266 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1267 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1268 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1269 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1270 required. Return 1 if memory is exhausted. */
1272 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1274 char const *yydebug_prefix
,
1275 char const *yydebug_suffix
,
1277 yytype_int16
**yybottom
,
1278 yytype_int16
*yybottom_no_free
,
1279 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1281 YYSIZE_T yysize_old
=
1282 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1283 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1284 if (*yycapacity
< yysize_new
)
1286 YYSIZE_T yyalloc
= 2 * yysize_new
;
1287 yytype_int16
*yybottom_new
;
1288 /* Use YYMAXDEPTH for maximum stack size given that the stack
1289 should never need to grow larger than the main state stack
1290 needs to grow without LAC. */
1291 if (YYMAXDEPTH
< yysize_new
)
1293 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1297 if (YYMAXDEPTH
< yyalloc
)
1298 yyalloc
= YYMAXDEPTH
;
1300 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1303 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1307 if (*yytop
!= yytop_empty
)
1309 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1310 *yytop
= yybottom_new
+ (yysize_old
- 1);
1312 if (*yybottom
!= yybottom_no_free
)
1313 YYSTACK_FREE (*yybottom
);
1314 *yybottom
= yybottom_new
;
1315 *yycapacity
= yyalloc
;
1320 /* Establish the initial context for the current lookahead if no initial
1321 context is currently established.
1323 We define a context as a snapshot of the parser stacks. We define
1324 the initial context for a lookahead as the context in which the
1325 parser initially examines that lookahead in order to select a
1326 syntactic action. Thus, if the lookahead eventually proves
1327 syntactically unacceptable (possibly in a later context reached via a
1328 series of reductions), the initial context can be used to determine
1329 the exact set of tokens that would be syntactically acceptable in the
1330 lookahead's place. Moreover, it is the context after which any
1331 further semantic actions would be erroneous because they would be
1332 determined by a syntactically unacceptable token.
1334 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1335 performed in an inconsistent state (which, for the purposes of LAC,
1336 includes consistent states that don't know they're consistent because
1337 their default reductions have been disabled). Iff there is a
1338 lookahead token, it should also be invoked before reporting a syntax
1339 error. This latter case is for the sake of the debugging output.
1341 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1342 follows. If no initial context is currently established for the
1343 current lookahead, then check if that lookahead can eventually be
1344 shifted if syntactic actions continue from the current context.
1345 Report a syntax error if it cannot. */
1346 #define YY_LAC_ESTABLISH \
1348 if (!yy_lac_established) \
1350 YYDPRINTF ((stderr, \
1351 "LAC: initial context established for %s\n", \
1352 yytname[yytoken])); \
1353 yy_lac_established = 1; \
1355 int yy_lac_status = \
1356 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1357 if (yy_lac_status == 2) \
1358 goto yyexhaustedlab; \
1359 if (yy_lac_status == 1) \
1365 /* Discard any previous initial lookahead context because of Event,
1366 which may be a lookahead change or an invalidation of the currently
1367 established initial context for the current lookahead.
1369 The most common example of a lookahead change is a shift. An example
1370 of both cases is syntax error recovery. That is, a syntax error
1371 occurs when the lookahead is syntactically erroneous for the
1372 currently established initial context, so error recovery manipulates
1373 the parser stacks to try to find a new initial context in which the
1374 current lookahead is syntactically acceptable. If it fails to find
1375 such a context, it discards the lookahead. */
1377 # define YY_LAC_DISCARD(Event) \
1379 if (yy_lac_established) \
1382 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1384 yy_lac_established = 0; \
1388 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1391 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1392 eventually (after perhaps some reductions) be shifted, return 1 if
1393 not, or return 2 if memory is exhausted. As preconditions and
1394 postconditions: *YYES_CAPACITY is the allocated size of the array to
1395 which *YYES points, and either *YYES = YYESA or *YYES points to an
1396 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1397 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1398 any old *YYES other than YYESA. */
1400 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1401 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1403 yytype_int16
*yyes_prev
= yyssp
;
1404 yytype_int16
*yyesp
= yyes_prev
;
1405 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1406 if (yytoken
== YYUNDEFTOK
)
1408 YYDPRINTF ((stderr
, " Always Err\n"));
1413 int yyrule
= yypact
[*yyesp
];
1414 if (yypact_value_is_default (yyrule
)
1415 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1416 || yycheck
[yyrule
] != yytoken
)
1418 yyrule
= yydefact
[*yyesp
];
1421 YYDPRINTF ((stderr
, " Err\n"));
1427 yyrule
= yytable
[yyrule
];
1428 if (yytable_value_is_error (yyrule
))
1430 YYDPRINTF ((stderr
, " Err\n"));
1435 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1441 YYSIZE_T yylen
= yyr2
[yyrule
];
1442 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1443 if (yyesp
!= yyes_prev
)
1445 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1458 yyesp
= yyes_prev
-= yylen
;
1463 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1464 yystate
= yypgoto
[yylhs
] + *yyesp
;
1465 if (yystate
< 0 || YYLAST
< yystate
1466 || yycheck
[yystate
] != *yyesp
)
1467 yystate
= yydefgoto
[yylhs
];
1469 yystate
= yytable
[yystate
];
1471 if (yyesp
== yyes_prev
)
1478 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1482 yyes
, yyesa
, &yyesp
, yyes_prev
))
1484 YYDPRINTF ((stderr
, "\n"));
1489 YYDPRINTF ((stderr
, " G%d", yystate
));
1498 # if defined __GLIBC__ && defined _STRING_H
1499 # define yystrlen strlen
1501 /* Return the length of YYSTR. */
1503 yystrlen (const char *yystr
)
1506 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1514 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1515 # define yystpcpy stpcpy
1517 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1520 yystpcpy (char *yydest
, const char *yysrc
)
1523 const char *yys
= yysrc
;
1525 while ((*yyd
++ = *yys
++) != '\0')
1534 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1535 quotes and backslashes, so that it's suitable for yyerror. The
1536 heuristic is that double-quoting is unnecessary unless the string
1537 contains an apostrophe, a comma, or backslash (other than
1538 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1539 null, do not copy; instead, return the length of what the result
1542 yytnamerr (char *yyres
, const char *yystr
)
1547 char const *yyp
= yystr
;
1554 goto do_not_strip_quotes
;
1558 goto do_not_strip_quotes
;
1571 do_not_strip_quotes
: ;
1575 return yystrlen (yystr
);
1577 return yystpcpy (yyres
, yystr
) - yyres
;
1581 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1582 about the unexpected token YYTOKEN for the state stack whose top is
1583 YYSSP. In order to see if a particular token T is a
1584 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1586 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1587 not large enough to hold the message. In that case, also set
1588 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1589 required number of bytes is too large to store or if
1590 yy_lac returned 2. */
1592 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1593 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1594 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1596 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1597 YYSIZE_T yysize
= yysize0
;
1598 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1599 /* Internationalized format string. */
1600 const char *yyformat
= YY_NULL
;
1601 /* Arguments of yyformat. */
1602 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1603 /* Number of reported tokens (one for the "unexpected", one per
1607 /* There are many possibilities here to consider:
1608 - If this state is a consistent state with a default action, then
1609 the only way this function was invoked is if the default action
1610 is an error action. In that case, don't check for expected
1611 tokens because there are none.
1612 - The only way there can be no lookahead present (in yychar) is if
1613 this state is a consistent state with a default action. Thus,
1614 detecting the absence of a lookahead is sufficient to determine
1615 that there is no unexpected or expected token to report. In that
1616 case, just report a simple "syntax error".
1617 - Don't assume there isn't a lookahead just because this state is a
1618 consistent state with a default action. There might have been a
1619 previous inconsistent state, consistent state with a non-default
1620 action, or user semantic action that manipulated yychar.
1621 In the first two cases, it might appear that the current syntax
1622 error should have been detected in the previous state when yy_lac
1623 was invoked. However, at that time, there might have been a
1624 different syntax error that discarded a different initial context
1625 during error recovery, leaving behind the current lookahead.
1627 if (yytoken
!= YYEMPTY
)
1629 int yyn
= yypact
[*yyssp
];
1630 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1631 yyarg
[yycount
++] = yytname
[yytoken
];
1632 if (!yypact_value_is_default (yyn
))
1636 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1637 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1640 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1642 if (yy_lac_status
== 2)
1644 if (yy_lac_status
== 1)
1647 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1653 yyarg
[yycount
++] = yytname
[yyx
];
1655 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1656 if (! (yysize
<= yysize1
1657 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1665 YYFPRINTF (stderr
, "No expected tokens.\n");
1671 # define YYCASE_(N, S) \
1675 YYCASE_(0, YY_("syntax error"));
1676 YYCASE_(1, YY_("syntax error, unexpected %s"));
1677 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1678 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1679 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1680 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1685 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1686 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1691 if (*yymsg_alloc
< yysize
)
1693 *yymsg_alloc
= 2 * yysize
;
1694 if (! (yysize
<= *yymsg_alloc
1695 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1696 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1700 /* Avoid sprintf, as that infringes on the user's name space.
1701 Don't have undefined behavior even if the translation
1702 produced a string with the wrong number of "%s"s. */
1706 while ((*yyp
= *yyformat
) != '\0')
1707 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1709 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1720 #endif /* YYERROR_VERBOSE */
1722 /*-----------------------------------------------.
1723 | Release the memory associated to this symbol. |
1724 `-----------------------------------------------*/
1727 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1730 YYUSE (yylocationp
);
1733 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1752 /* The lookahead symbol. */
1756 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1757 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1758 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1759 _Pragma ("GCC diagnostic push") \
1760 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1761 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1762 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1763 _Pragma ("GCC diagnostic pop")
1765 /* Default value used for initialization, for pacifying older GCCs
1766 or non-GCC compilers. */
1767 static YYSTYPE yyval_default
;
1768 # define YY_INITIAL_VALUE(Value) = Value
1770 static YYLTYPE yyloc_default
1771 # if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
1775 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1776 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1777 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1779 #ifndef YY_INITIAL_VALUE
1780 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1783 /* The semantic value of the lookahead symbol. */
1784 YYSTYPE yylval
YY_INITIAL_VALUE(yyval_default
);
1786 /* Location data for the lookahead symbol. */
1787 YYLTYPE yylloc
= yyloc_default
;
1790 /* Number of syntax errors so far. */
1794 /* Number of tokens to shift before error messages enabled. */
1797 /* The stacks and their tools:
1798 `yyss': related to states.
1799 `yyvs': related to semantic values.
1800 `yyls': related to locations.
1802 Refer to the stacks through separate pointers, to allow yyoverflow
1803 to reallocate them elsewhere. */
1805 /* The state stack. */
1806 yytype_int16 yyssa
[YYINITDEPTH
];
1808 yytype_int16
*yyssp
;
1810 /* The semantic value stack. */
1811 YYSTYPE yyvsa
[YYINITDEPTH
];
1815 /* The location stack. */
1816 YYLTYPE yylsa
[YYINITDEPTH
];
1820 /* The locations where the error started and ended. */
1821 YYLTYPE yyerror_range
[3];
1823 YYSIZE_T yystacksize
;
1825 yytype_int16 yyesa
[20];
1827 YYSIZE_T yyes_capacity
;
1829 int yy_lac_established
= 0;
1832 /* Lookahead token as an internal (translated) token number. */
1834 /* The variables used to return semantic value and location from the
1840 /* Buffer for error messages, and its allocated size. */
1842 char *yymsg
= yymsgbuf
;
1843 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1846 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1848 /* The number of symbols on the RHS of the reduced rule.
1849 Keep to zero when no symbol should be popped. */
1852 yyssp
= yyss
= yyssa
;
1853 yyvsp
= yyvs
= yyvsa
;
1854 yylsp
= yyls
= yylsa
;
1855 yystacksize
= YYINITDEPTH
;
1858 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1859 if (YYMAXDEPTH
< yyes_capacity
)
1860 yyes_capacity
= YYMAXDEPTH
;
1862 YYDPRINTF ((stderr
, "Starting parse\n"));
1867 yychar
= YYEMPTY
; /* Cause a token to be read. */
1869 /* User initialization code. */
1870 #line 101 "src/parse-gram.y" /* yacc.c:1450 */
1872 /* Bison's grammar can initial empty locations, hence a default
1873 location is needed. */
1874 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1875 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1877 #line 1878 "src/parse-gram.c" /* yacc.c:1450 */
1881 /*------------------------------------------------------------.
1882 | yynewstate -- Push a new state, which is found in yystate. |
1883 `------------------------------------------------------------*/
1885 /* In all cases, when you get here, the value and location stacks
1886 have just been pushed. So pushing a state here evens the stacks. */
1892 if (yyss
+ yystacksize
- 1 <= yyssp
)
1894 /* Get the current used size of the three stacks, in elements. */
1895 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1899 /* Give user a chance to reallocate the stack. Use copies of
1900 these so that the &'s don't force the real ones into
1902 YYSTYPE
*yyvs1
= yyvs
;
1903 yytype_int16
*yyss1
= yyss
;
1904 YYLTYPE
*yyls1
= yyls
;
1906 /* Each stack pointer address is followed by the size of the
1907 data in use in that stack, in bytes. This used to be a
1908 conditional around just the two extra args, but that might
1909 be undefined if yyoverflow is a macro. */
1910 yyoverflow (YY_("memory exhausted"),
1911 &yyss1
, yysize
* sizeof (*yyssp
),
1912 &yyvs1
, yysize
* sizeof (*yyvsp
),
1913 &yyls1
, yysize
* sizeof (*yylsp
),
1920 #else /* no yyoverflow */
1921 # ifndef YYSTACK_RELOCATE
1922 goto yyexhaustedlab
;
1924 /* Extend the stack our own way. */
1925 if (YYMAXDEPTH
<= yystacksize
)
1926 goto yyexhaustedlab
;
1928 if (YYMAXDEPTH
< yystacksize
)
1929 yystacksize
= YYMAXDEPTH
;
1932 yytype_int16
*yyss1
= yyss
;
1933 union yyalloc
*yyptr
=
1934 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1936 goto yyexhaustedlab
;
1937 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1938 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1939 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1940 # undef YYSTACK_RELOCATE
1942 YYSTACK_FREE (yyss1
);
1945 #endif /* no yyoverflow */
1947 yyssp
= yyss
+ yysize
- 1;
1948 yyvsp
= yyvs
+ yysize
- 1;
1949 yylsp
= yyls
+ yysize
- 1;
1951 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1952 (unsigned long int) yystacksize
));
1954 if (yyss
+ yystacksize
- 1 <= yyssp
)
1958 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1960 if (yystate
== YYFINAL
)
1970 /* Do appropriate processing given the current state. Read a
1971 lookahead token if we need one and don't already have one. */
1973 /* First try to decide what to do without reference to lookahead token. */
1974 yyn
= yypact
[yystate
];
1975 if (yypact_value_is_default (yyn
))
1978 /* Not known => get a lookahead token if don't already have one. */
1980 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1981 if (yychar
== YYEMPTY
)
1983 YYDPRINTF ((stderr
, "Reading a token: "));
1984 yychar
= yylex (&yylval
, &yylloc
);
1987 if (yychar
<= YYEOF
)
1989 yychar
= yytoken
= YYEOF
;
1990 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1994 yytoken
= YYTRANSLATE (yychar
);
1995 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1998 /* If the proper action on seeing token YYTOKEN is to reduce or to
1999 detect an error, take that action. */
2001 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2009 if (yytable_value_is_error (yyn
))
2016 /* Count tokens shifted since error; after three, turn off error
2021 /* Shift the lookahead token. */
2022 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2024 /* Discard the shifted token. */
2026 YY_LAC_DISCARD ("shift");
2029 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2031 YY_IGNORE_MAYBE_UNINITIALIZED_END
2036 /*-----------------------------------------------------------.
2037 | yydefault -- do the default action for the current state. |
2038 `-----------------------------------------------------------*/
2040 yyn
= yydefact
[yystate
];
2046 /*-----------------------------.
2047 | yyreduce -- Do a reduction. |
2048 `-----------------------------*/
2050 /* yyn is the number of a rule to reduce with. */
2053 /* If YYLEN is nonzero, implement the default value of the action:
2056 Otherwise, the following line sets YYVAL to garbage.
2057 This behavior is undocumented and Bison
2058 users should not rely upon it. Assigning to YYVAL
2059 unconditionally makes the parser a bit smaller, and it avoids a
2060 GCC warning that YYVAL may be used uninitialized. */
2061 yyval
= yyvsp
[1-yylen
];
2063 /* Default location. */
2064 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2065 YY_REDUCE_PRINT (yyn
);
2067 int yychar_backup
= yychar
;
2071 #line 288 "src/parse-gram.y" /* yacc.c:1667 */
2073 code_props plain_code
;
2074 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2075 code_props_translate_code (&plain_code
);
2076 gram_scanner_last_string_free ();
2077 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2078 plain_code
.code
, (yylsp
[0]));
2079 code_scanner_last_string_free ();
2081 #line 2082 "src/parse-gram.c" /* yacc.c:1667 */
2085 #line 298 "src/parse-gram.y" /* yacc.c:1667 */
2087 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
2089 #line 2090 "src/parse-gram.c" /* yacc.c:1667 */
2093 #line 302 "src/parse-gram.y" /* yacc.c:1667 */
2095 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
2096 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2098 #line 2099 "src/parse-gram.c" /* yacc.c:1667 */
2102 #line 306 "src/parse-gram.y" /* yacc.c:1667 */
2103 { defines_flag
= true; }
2104 #line 2105 "src/parse-gram.c" /* yacc.c:1667 */
2108 #line 308 "src/parse-gram.y" /* yacc.c:1667 */
2110 defines_flag
= true;
2111 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
2113 #line 2114 "src/parse-gram.c" /* yacc.c:1667 */
2117 #line 313 "src/parse-gram.y" /* yacc.c:1667 */
2119 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2120 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2122 #line 2123 "src/parse-gram.c" /* yacc.c:1667 */
2126 #line 317 "src/parse-gram.y" /* yacc.c:1667 */
2127 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2128 #line 2129 "src/parse-gram.c" /* yacc.c:1667 */
2132 #line 318 "src/parse-gram.y" /* yacc.c:1667 */
2133 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2134 #line 2135 "src/parse-gram.c" /* yacc.c:1667 */
2138 #line 319 "src/parse-gram.y" /* yacc.c:1667 */
2139 { spec_file_prefix
= (yyvsp
[0].chars
); }
2140 #line 2141 "src/parse-gram.c" /* yacc.c:1667 */
2144 #line 321 "src/parse-gram.y" /* yacc.c:1667 */
2146 nondeterministic_parser
= true;
2149 #line 2150 "src/parse-gram.c" /* yacc.c:1667 */
2153 #line 326 "src/parse-gram.y" /* yacc.c:1667 */
2156 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2157 code_props_translate_code (&action
);
2158 gram_scanner_last_string_free ();
2159 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2160 code_scanner_last_string_free ();
2162 #line 2163 "src/parse-gram.c" /* yacc.c:1667 */
2166 #line 334 "src/parse-gram.y" /* yacc.c:1667 */
2167 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2168 #line 2169 "src/parse-gram.c" /* yacc.c:1667 */
2172 #line 335 "src/parse-gram.y" /* yacc.c:1667 */
2173 { spec_name_prefix
= (yyvsp
[0].chars
); }
2174 #line 2175 "src/parse-gram.c" /* yacc.c:1667 */
2178 #line 336 "src/parse-gram.y" /* yacc.c:1667 */
2179 { no_lines_flag
= true; }
2180 #line 2181 "src/parse-gram.c" /* yacc.c:1667 */
2184 #line 337 "src/parse-gram.y" /* yacc.c:1667 */
2185 { nondeterministic_parser
= true; }
2186 #line 2187 "src/parse-gram.c" /* yacc.c:1667 */
2190 #line 338 "src/parse-gram.y" /* yacc.c:1667 */
2191 { spec_outfile
= (yyvsp
[0].chars
); }
2192 #line 2193 "src/parse-gram.c" /* yacc.c:1667 */
2196 #line 339 "src/parse-gram.y" /* yacc.c:1667 */
2197 { current_param
= (yyvsp
[0].param
); }
2198 #line 2199 "src/parse-gram.c" /* yacc.c:1667 */
2202 #line 339 "src/parse-gram.y" /* yacc.c:1667 */
2203 { current_param
= param_none
; }
2204 #line 2205 "src/parse-gram.c" /* yacc.c:1667 */
2208 #line 340 "src/parse-gram.y" /* yacc.c:1667 */
2209 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2210 #line 2211 "src/parse-gram.c" /* yacc.c:1667 */
2214 #line 342 "src/parse-gram.y" /* yacc.c:1667 */
2216 char const *skeleton_user
= (yyvsp
[0].chars
);
2217 if (strchr (skeleton_user
, '/'))
2219 size_t dir_length
= strlen (current_file
);
2220 char *skeleton_build
;
2221 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2223 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2226 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2229 memcpy (skeleton_build
, current_file
, dir_length
);
2230 skeleton_build
[dir_length
++] = '/';
2232 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2233 skeleton_user
= uniqstr_new (skeleton_build
);
2234 free (skeleton_build
);
2236 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2238 #line 2239 "src/parse-gram.c" /* yacc.c:1667 */
2242 #line 365 "src/parse-gram.y" /* yacc.c:1667 */
2243 { token_table_flag
= true; }
2244 #line 2245 "src/parse-gram.c" /* yacc.c:1667 */
2248 #line 366 "src/parse-gram.y" /* yacc.c:1667 */
2249 { report_flag
|= report_states
; }
2250 #line 2251 "src/parse-gram.c" /* yacc.c:1667 */
2254 #line 367 "src/parse-gram.y" /* yacc.c:1667 */
2255 { yacc_flag
= true; }
2256 #line 2257 "src/parse-gram.c" /* yacc.c:1667 */
2260 #line 372 "src/parse-gram.y" /* yacc.c:1667 */
2261 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2262 #line 2263 "src/parse-gram.c" /* yacc.c:1667 */
2266 #line 373 "src/parse-gram.y" /* yacc.c:1667 */
2267 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2268 #line 2269 "src/parse-gram.c" /* yacc.c:1667 */
2272 #line 385 "src/parse-gram.y" /* yacc.c:1667 */
2274 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2276 #line 2277 "src/parse-gram.c" /* yacc.c:1667 */
2280 #line 389 "src/parse-gram.y" /* yacc.c:1667 */
2283 code_props_symbol_action_init (&code
, (yyvsp
[-1].code
), (yylsp
[-1]));
2284 code_props_translate_code (&code
);
2287 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2288 symbol_list_code_props_set (list
, (yyvsp
[-2].code_type
), &code
);
2289 symbol_list_free ((yyvsp
[0].list
));
2292 #line 2293 "src/parse-gram.c" /* yacc.c:1667 */
2296 #line 401 "src/parse-gram.y" /* yacc.c:1667 */
2298 default_prec
= true;
2300 #line 2301 "src/parse-gram.c" /* yacc.c:1667 */
2304 #line 405 "src/parse-gram.y" /* yacc.c:1667 */
2306 default_prec
= false;
2308 #line 2309 "src/parse-gram.c" /* yacc.c:1667 */
2312 #line 409 "src/parse-gram.y" /* yacc.c:1667 */
2314 /* Do not invoke muscle_percent_code_grow here since it invokes
2315 muscle_user_name_list_grow. */
2316 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2317 code_scanner_last_string_free ();
2319 #line 2320 "src/parse-gram.c" /* yacc.c:1667 */
2323 #line 416 "src/parse-gram.y" /* yacc.c:1667 */
2325 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2326 code_scanner_last_string_free ();
2328 #line 2329 "src/parse-gram.c" /* yacc.c:1667 */
2332 #line 426 "src/parse-gram.y" /* yacc.c:1667 */
2333 { (yyval
.code_type
) = destructor
; }
2334 #line 2335 "src/parse-gram.c" /* yacc.c:1667 */
2338 #line 427 "src/parse-gram.y" /* yacc.c:1667 */
2339 { (yyval
.code_type
) = printer
; }
2340 #line 2341 "src/parse-gram.c" /* yacc.c:1667 */
2344 #line 437 "src/parse-gram.y" /* yacc.c:1667 */
2346 #line 2347 "src/parse-gram.c" /* yacc.c:1667 */
2350 #line 438 "src/parse-gram.y" /* yacc.c:1667 */
2351 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2352 #line 2353 "src/parse-gram.c" /* yacc.c:1667 */
2356 #line 443 "src/parse-gram.y" /* yacc.c:1667 */
2359 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2360 code_scanner_last_string_free ();
2362 #line 2363 "src/parse-gram.c" /* yacc.c:1667 */
2366 #line 454 "src/parse-gram.y" /* yacc.c:1667 */
2367 { current_class
= nterm_sym
; }
2368 #line 2369 "src/parse-gram.c" /* yacc.c:1667 */
2372 #line 455 "src/parse-gram.y" /* yacc.c:1667 */
2374 current_class
= unknown_sym
;
2375 current_type
= NULL
;
2377 #line 2378 "src/parse-gram.c" /* yacc.c:1667 */
2381 #line 459 "src/parse-gram.y" /* yacc.c:1667 */
2382 { current_class
= token_sym
; }
2383 #line 2384 "src/parse-gram.c" /* yacc.c:1667 */
2387 #line 460 "src/parse-gram.y" /* yacc.c:1667 */
2389 current_class
= unknown_sym
;
2390 current_type
= NULL
;
2392 #line 2393 "src/parse-gram.c" /* yacc.c:1667 */
2396 #line 465 "src/parse-gram.y" /* yacc.c:1667 */
2400 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2401 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2402 symbol_list_free ((yyvsp
[0].list
));
2404 #line 2405 "src/parse-gram.c" /* yacc.c:1667 */
2408 #line 476 "src/parse-gram.y" /* yacc.c:1667 */
2412 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2414 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2415 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2417 symbol_list_free ((yyvsp
[0].list
));
2418 current_type
= NULL
;
2420 #line 2421 "src/parse-gram.c" /* yacc.c:1667 */
2424 #line 490 "src/parse-gram.y" /* yacc.c:1667 */
2425 { (yyval
.assoc
) = left_assoc
; }
2426 #line 2427 "src/parse-gram.c" /* yacc.c:1667 */
2430 #line 491 "src/parse-gram.y" /* yacc.c:1667 */
2431 { (yyval
.assoc
) = right_assoc
; }
2432 #line 2433 "src/parse-gram.c" /* yacc.c:1667 */
2436 #line 492 "src/parse-gram.y" /* yacc.c:1667 */
2437 { (yyval
.assoc
) = non_assoc
; }
2438 #line 2439 "src/parse-gram.c" /* yacc.c:1667 */
2442 #line 493 "src/parse-gram.y" /* yacc.c:1667 */
2443 { (yyval
.assoc
) = precedence_assoc
; }
2444 #line 2445 "src/parse-gram.c" /* yacc.c:1667 */
2448 #line 497 "src/parse-gram.y" /* yacc.c:1667 */
2449 { current_type
= NULL
; }
2450 #line 2451 "src/parse-gram.c" /* yacc.c:1667 */
2454 #line 498 "src/parse-gram.y" /* yacc.c:1667 */
2455 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2456 #line 2457 "src/parse-gram.c" /* yacc.c:1667 */
2460 #line 504 "src/parse-gram.y" /* yacc.c:1667 */
2461 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2462 #line 2463 "src/parse-gram.c" /* yacc.c:1667 */
2466 #line 506 "src/parse-gram.y" /* yacc.c:1667 */
2467 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2468 #line 2469 "src/parse-gram.c" /* yacc.c:1667 */
2472 #line 510 "src/parse-gram.y" /* yacc.c:1667 */
2473 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2474 #line 2475 "src/parse-gram.c" /* yacc.c:1667 */
2478 #line 511 "src/parse-gram.y" /* yacc.c:1667 */
2479 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2480 #line 2481 "src/parse-gram.c" /* yacc.c:1667 */
2484 #line 517 "src/parse-gram.y" /* yacc.c:1667 */
2485 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2486 #line 2487 "src/parse-gram.c" /* yacc.c:1667 */
2490 #line 519 "src/parse-gram.y" /* yacc.c:1667 */
2491 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2492 #line 2493 "src/parse-gram.c" /* yacc.c:1667 */
2496 #line 523 "src/parse-gram.y" /* yacc.c:1667 */
2497 { (yyval
.list
) = (yyvsp
[0].list
); }
2498 #line 2499 "src/parse-gram.c" /* yacc.c:1667 */
2502 #line 524 "src/parse-gram.y" /* yacc.c:1667 */
2503 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2504 #line 2505 "src/parse-gram.c" /* yacc.c:1667 */
2508 #line 528 "src/parse-gram.y" /* yacc.c:1667 */
2509 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2510 #line 2511 "src/parse-gram.c" /* yacc.c:1667 */
2514 #line 529 "src/parse-gram.y" /* yacc.c:1667 */
2515 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2516 #line 2517 "src/parse-gram.c" /* yacc.c:1667 */
2520 #line 534 "src/parse-gram.y" /* yacc.c:1667 */
2521 { (yyval
.uniqstr
) = uniqstr_new ("*"); }
2522 #line 2523 "src/parse-gram.c" /* yacc.c:1667 */
2526 #line 535 "src/parse-gram.y" /* yacc.c:1667 */
2527 { (yyval
.uniqstr
) = uniqstr_new (""); }
2528 #line 2529 "src/parse-gram.c" /* yacc.c:1667 */
2532 #line 541 "src/parse-gram.y" /* yacc.c:1667 */
2534 current_type
= (yyvsp
[0].uniqstr
);
2537 #line 2538 "src/parse-gram.c" /* yacc.c:1667 */
2541 #line 546 "src/parse-gram.y" /* yacc.c:1667 */
2543 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2544 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2546 #line 2547 "src/parse-gram.c" /* yacc.c:1667 */
2550 #line 551 "src/parse-gram.y" /* yacc.c:1667 */
2552 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2553 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2554 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2556 #line 2557 "src/parse-gram.c" /* yacc.c:1667 */
2560 #line 557 "src/parse-gram.y" /* yacc.c:1667 */
2562 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2563 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2564 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2566 #line 2567 "src/parse-gram.c" /* yacc.c:1667 */
2570 #line 563 "src/parse-gram.y" /* yacc.c:1667 */
2572 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2573 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2574 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2575 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2577 #line 2578 "src/parse-gram.c" /* yacc.c:1667 */
2581 #line 593 "src/parse-gram.y" /* yacc.c:1667 */
2585 #line 2586 "src/parse-gram.c" /* yacc.c:1667 */
2589 #line 599 "src/parse-gram.y" /* yacc.c:1667 */
2590 { current_lhs ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2591 #line 2592 "src/parse-gram.c" /* yacc.c:1667 */
2595 #line 600 "src/parse-gram.y" /* yacc.c:1667 */
2597 /* Free the current lhs. */
2598 current_lhs (0, (yylsp
[-3]), 0);
2600 #line 2601 "src/parse-gram.c" /* yacc.c:1667 */
2604 #line 607 "src/parse-gram.y" /* yacc.c:1667 */
2605 { grammar_current_rule_end ((yylsp
[0])); }
2606 #line 2607 "src/parse-gram.c" /* yacc.c:1667 */
2610 #line 608 "src/parse-gram.y" /* yacc.c:1667 */
2611 { grammar_current_rule_end ((yylsp
[0])); }
2612 #line 2613 "src/parse-gram.c" /* yacc.c:1667 */
2616 #line 614 "src/parse-gram.y" /* yacc.c:1667 */
2617 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2618 current_lhs_named_ref
); }
2619 #line 2620 "src/parse-gram.c" /* yacc.c:1667 */
2623 #line 617 "src/parse-gram.y" /* yacc.c:1667 */
2624 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2625 #line 2626 "src/parse-gram.c" /* yacc.c:1667 */
2629 #line 619 "src/parse-gram.y" /* yacc.c:1667 */
2630 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2631 #line 2632 "src/parse-gram.c" /* yacc.c:1667 */
2635 #line 621 "src/parse-gram.y" /* yacc.c:1667 */
2636 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2637 #line 2638 "src/parse-gram.c" /* yacc.c:1667 */
2641 #line 623 "src/parse-gram.y" /* yacc.c:1667 */
2642 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2643 #line 2644 "src/parse-gram.c" /* yacc.c:1667 */
2647 #line 625 "src/parse-gram.y" /* yacc.c:1667 */
2648 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2649 #line 2650 "src/parse-gram.c" /* yacc.c:1667 */
2653 #line 627 "src/parse-gram.y" /* yacc.c:1667 */
2654 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2655 #line 2656 "src/parse-gram.c" /* yacc.c:1667 */
2659 #line 631 "src/parse-gram.y" /* yacc.c:1667 */
2660 { (yyval
.named_ref
) = 0; }
2661 #line 2662 "src/parse-gram.c" /* yacc.c:1667 */
2665 #line 633 "src/parse-gram.y" /* yacc.c:1667 */
2666 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2667 #line 2668 "src/parse-gram.c" /* yacc.c:1667 */
2671 #line 644 "src/parse-gram.y" /* yacc.c:1667 */
2672 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2673 #line 2674 "src/parse-gram.c" /* yacc.c:1667 */
2677 #line 649 "src/parse-gram.y" /* yacc.c:1667 */
2678 { (yyval
.chars
) = ""; }
2679 #line 2680 "src/parse-gram.c" /* yacc.c:1667 */
2683 #line 650 "src/parse-gram.y" /* yacc.c:1667 */
2684 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2685 #line 2686 "src/parse-gram.c" /* yacc.c:1667 */
2689 #line 661 "src/parse-gram.y" /* yacc.c:1667 */
2691 code_props plain_code
;
2692 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2693 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2694 code_props_translate_code (&plain_code
);
2695 gram_scanner_last_string_free ();
2696 (yyval
.chars
) = plain_code
.code
;
2698 #line 2699 "src/parse-gram.c" /* yacc.c:1667 */
2702 #line 681 "src/parse-gram.y" /* yacc.c:1667 */
2703 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2704 #line 2705 "src/parse-gram.c" /* yacc.c:1667 */
2708 #line 683 "src/parse-gram.y" /* yacc.c:1667 */
2710 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2711 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2712 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2714 #line 2715 "src/parse-gram.c" /* yacc.c:1667 */
2718 #line 691 "src/parse-gram.y" /* yacc.c:1667 */
2719 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2720 #line 2721 "src/parse-gram.c" /* yacc.c:1667 */
2724 #line 703 "src/parse-gram.y" /* yacc.c:1667 */
2726 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2727 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2729 #line 2730 "src/parse-gram.c" /* yacc.c:1667 */
2733 #line 712 "src/parse-gram.y" /* yacc.c:1667 */
2735 code_props plain_code
;
2736 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2737 code_props_translate_code (&plain_code
);
2738 gram_scanner_last_string_free ();
2739 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2740 code_scanner_last_string_free ();
2742 #line 2743 "src/parse-gram.c" /* yacc.c:1667 */
2746 #line 2747 "src/parse-gram.c" /* yacc.c:1667 */
2749 if (yychar_backup
!= yychar
)
2750 YY_LAC_DISCARD ("yychar change");
2752 /* User semantic actions sometimes alter yychar, and that requires
2753 that yytoken be updated with the new translation. We take the
2754 approach of translating immediately before every use of yytoken.
2755 One alternative is translating here after every semantic action,
2756 but that translation would be missed if the semantic action invokes
2757 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2758 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2759 incorrect destructor might then be invoked immediately. In the
2760 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2761 to an incorrect destructor call or verbose syntax error message
2762 before the lookahead is translated. */
2763 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2767 YY_STACK_PRINT (yyss
, yyssp
);
2772 /* Now `shift' the result of the reduction. Determine what state
2773 that goes to, based on the state we popped back to and the rule
2774 number reduced by. */
2778 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2779 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2780 yystate
= yytable
[yystate
];
2782 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2787 /*--------------------------------------.
2788 | yyerrlab -- here on detecting error. |
2789 `--------------------------------------*/
2791 /* Make sure we have latest lookahead translation. See comments at
2792 user semantic actions for why this is necessary. */
2793 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2795 /* If not already recovering from an error, report this error. */
2799 #if ! YYERROR_VERBOSE
2800 yyerror (YY_("syntax error"));
2802 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2803 yyesa, &yyes, &yyes_capacity, \
2806 char const *yymsgp
= YY_("syntax error");
2807 int yysyntax_error_status
;
2808 if (yychar
!= YYEMPTY
)
2810 yysyntax_error_status
= YYSYNTAX_ERROR
;
2811 if (yysyntax_error_status
== 0)
2813 else if (yysyntax_error_status
== 1)
2815 if (yymsg
!= yymsgbuf
)
2816 YYSTACK_FREE (yymsg
);
2817 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2821 yymsg_alloc
= sizeof yymsgbuf
;
2822 yysyntax_error_status
= 2;
2826 yysyntax_error_status
= YYSYNTAX_ERROR
;
2831 if (yysyntax_error_status
== 2)
2832 goto yyexhaustedlab
;
2834 # undef YYSYNTAX_ERROR
2838 yyerror_range
[1] = yylloc
;
2840 if (yyerrstatus
== 3)
2842 /* If just tried and failed to reuse lookahead token after an
2843 error, discard it. */
2845 if (yychar
<= YYEOF
)
2847 /* Return failure if at end of input. */
2848 if (yychar
== YYEOF
)
2853 yydestruct ("Error: discarding",
2854 yytoken
, &yylval
, &yylloc
);
2859 /* Else will try to reuse lookahead token after shifting the error
2864 /*---------------------------------------------------.
2865 | yyerrorlab -- error raised explicitly by YYERROR. |
2866 `---------------------------------------------------*/
2869 /* Pacify compilers like GCC when the user code never invokes
2870 YYERROR and the label yyerrorlab therefore never appears in user
2872 if (/*CONSTCOND*/ 0)
2875 yyerror_range
[1] = yylsp
[1-yylen
];
2876 /* Do not reclaim the symbols of the rule whose action triggered
2880 YY_STACK_PRINT (yyss
, yyssp
);
2885 /*-------------------------------------------------------------.
2886 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2887 `-------------------------------------------------------------*/
2889 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2893 yyn
= yypact
[yystate
];
2894 if (!yypact_value_is_default (yyn
))
2897 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2905 /* Pop the current state because it cannot handle the error token. */
2909 yyerror_range
[1] = *yylsp
;
2910 yydestruct ("Error: popping",
2911 yystos
[yystate
], yyvsp
, yylsp
);
2914 YY_STACK_PRINT (yyss
, yyssp
);
2917 /* If the stack popping above didn't lose the initial context for the
2918 current lookahead token, the shift below will for sure. */
2919 YY_LAC_DISCARD ("error recovery");
2921 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2923 YY_IGNORE_MAYBE_UNINITIALIZED_END
2925 yyerror_range
[2] = yylloc
;
2926 /* Using YYLLOC is tempting, but would change the location of
2927 the lookahead. YYLOC is available though. */
2928 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2931 /* Shift the error token. */
2932 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2938 /*-------------------------------------.
2939 | yyacceptlab -- YYACCEPT comes here. |
2940 `-------------------------------------*/
2945 /*-----------------------------------.
2946 | yyabortlab -- YYABORT comes here. |
2947 `-----------------------------------*/
2953 /*-------------------------------------------------.
2954 | yyexhaustedlab -- memory exhaustion comes here. |
2955 `-------------------------------------------------*/
2957 yyerror (YY_("memory exhausted"));
2963 if (yychar
!= YYEMPTY
)
2965 /* Make sure we have latest lookahead translation. See comments at
2966 user semantic actions for why this is necessary. */
2967 yytoken
= YYTRANSLATE (yychar
);
2968 yydestruct ("Cleanup: discarding lookahead",
2969 yytoken
, &yylval
, &yylloc
);
2971 /* Do not reclaim the symbols of the rule whose action triggered
2972 this YYABORT or YYACCEPT. */
2974 YY_STACK_PRINT (yyss
, yyssp
);
2975 while (yyssp
!= yyss
)
2977 yydestruct ("Cleanup: popping",
2978 yystos
[*yyssp
], yyvsp
, yylsp
);
2983 YYSTACK_FREE (yyss
);
2986 YYSTACK_FREE (yyes
);
2988 if (yymsg
!= yymsgbuf
)
2989 YYSTACK_FREE (yymsg
);
2993 #line 722 "src/parse-gram.y" /* yacc.c:1927 */
2996 /* Return the location of the left-hand side of a rule whose
2997 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2998 the right-hand side, and return an empty location equal to the end
2999 boundary of RHS[0] if the right-hand side is empty. */
3002 lloc_default (YYLTYPE
const *rhs
, int n
)
3007 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3008 The bug is fixed in 7.4.2m, but play it safe for now. */
3009 loc
.start
= rhs
[n
].end
;
3010 loc
.end
= rhs
[n
].end
;
3012 /* Ignore empty nonterminals the start of the right-hand side.
3013 Do not bother to ignore them at the end of the right-hand side,
3014 since empty nonterminals have the same end as their predecessors. */
3015 for (i
= 1; i
<= n
; i
++)
3016 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3018 loc
.start
= rhs
[i
].start
;
3027 add_param (param_type type
, char *decl
, location loc
)
3029 static char const alphanum
[26 + 26 + 1 + 10] =
3030 "abcdefghijklmnopqrstuvwxyz"
3031 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3035 char const *name_start
= NULL
;
3038 /* Stop on last actual character. */
3039 for (p
= decl
; p
[1]; p
++)
3041 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3042 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3045 /* Strip the surrounding '{' and '}', and any blanks just inside
3048 while (c_isspace ((unsigned char) *p
))
3052 while (c_isspace ((unsigned char) *decl
))
3057 complain (&loc
, complaint
, _("missing identifier in parameter declaration"));
3060 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3061 if (type
& param_lex
)
3062 muscle_pair_list_grow ("lex_param", decl
, name
);
3063 if (type
& param_parse
)
3064 muscle_pair_list_grow ("parse_param", decl
, name
);
3068 gram_scanner_last_string_free ();
3073 version_check (location
const *loc
, char const *version
)
3075 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3077 complain (loc
, complaint
, "require bison %s, but have %s",
3078 version
, PACKAGE_VERSION
);
3084 gram_error (location
const *loc
, char const *msg
)
3086 complain (loc
, complaint
, "%s", msg
);
3090 token_name (int type
)
3092 return yytname
[YYTRANSLATE (type
)];
3103 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3104 return quotearg_style (escape_quoting_style
, buf
);