1 /* A Bison parser, made by GNU Bison 2.4.266-78f6. */
3 /* Implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2007, 2008, 2009 Free Software Foundation, Inc.
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.266-78f6"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 1
65 /* Substitute the variable and function names. */
66 #define yyparse gram_parse
67 #define yylex gram_lex
68 #define yyerror gram_error
69 #define yylval gram_lval
70 #define yychar gram_char
71 #define yydebug gram_debug
72 #define yynerrs gram_nerrs
73 #define yylloc gram_lloc
75 /* Copy the first part of user declarations. */
76 /* Line 191 of yacc.c */
77 #line 1 "parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
80 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
83 This file is part of Bison, the GNU Compiler Compiler.
85 This program is free software: you can redistribute it and/or modify
86 it under the terms of the GNU General Public License as published by
87 the Free Software Foundation, either version 3 of the License, or
88 (at your option) any later version.
90 This program is distributed in the hope that it will be useful,
91 but WITHOUT ANY WARRANTY; without even the implied warranty of
92 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93 GNU General Public License for more details.
95 You should have received a copy of the GNU General Public License
96 along with this program. If not, see <http://www.gnu.org/licenses/>. */
101 #include "complain.h"
102 #include "conflicts.h"
106 #include "muscle_tab.h"
107 #include "quotearg.h"
110 #include "scan-gram.h"
111 #include "scan-code.h"
113 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
114 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
116 #define YY_LOCATION_PRINT(File, Loc) \
117 location_print (File, Loc)
119 static void version_check (location
const *loc
, char const *version
);
121 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
122 FIXME: depends on the undocumented availability of YYLLOC. */
124 #define yyerror(Msg) \
125 gram_error (&yylloc, Msg)
126 static void gram_error (location
const *, char const *);
128 static char const *char_name (char);
130 /** Add a lex-param or a parse-param.
132 * \param type \a lex_param or \a parse_param
133 * \param decl the formal argument
134 * \param loc the location in the source.
136 static void add_param (char const *type
, char *decl
, location loc
);
139 static symbol_class current_class
= unknown_sym
;
140 static uniqstr current_type
= NULL
;
141 static symbol
*current_lhs
;
142 static location current_lhs_location
;
143 static int current_prec
= 0;
145 #define YYTYPE_INT16 int_fast16_t
146 #define YYTYPE_INT8 int_fast8_t
147 #define YYTYPE_UINT16 uint_fast16_t
148 #define YYTYPE_UINT8 uint_fast8_t
150 /* Line 191 of yacc.c */
151 #line 152 "../../src/parse-gram.c"
153 /* Enabling traces. */
158 /* Enabling verbose error messages. */
159 #ifdef YYERROR_VERBOSE
160 # undef YYERROR_VERBOSE
161 # define YYERROR_VERBOSE 1
163 # define YYERROR_VERBOSE 1
166 /* Enabling the token table. */
167 #ifndef YYTOKEN_TABLE
168 # define YYTOKEN_TABLE 0
175 /* Put the tokens into the symbol table, so that GDB and other debuggers
184 PERCENT_DESTRUCTOR
= 263,
185 PERCENT_PRINTER
= 264,
188 PERCENT_NONASSOC
= 267,
189 PERCENT_PRECEDENCE
= 268,
195 PERCENT_DEFAULT_PREC
= 274,
196 PERCENT_DEFINE
= 275,
197 PERCENT_DEFINES
= 276,
198 PERCENT_ERROR_VERBOSE
= 277,
199 PERCENT_EXPECT
= 278,
200 PERCENT_EXPECT_RR
= 279,
201 PERCENT_FILE_PREFIX
= 280,
202 PERCENT_GLR_PARSER
= 281,
203 PERCENT_INITIAL_ACTION
= 282,
204 PERCENT_LANGUAGE
= 283,
205 PERCENT_LEX_PARAM
= 284,
206 PERCENT_LOCATIONS
= 285,
207 PERCENT_NAME_PREFIX
= 286,
208 PERCENT_NO_DEFAULT_PREC
= 287,
209 PERCENT_NO_LINES
= 288,
210 PERCENT_NONDETERMINISTIC_PARSER
= 289,
211 PERCENT_OUTPUT
= 290,
212 PERCENT_PARSE_PARAM
= 291,
213 PERCENT_PURE_PARSER
= 292,
214 PERCENT_REQUIRE
= 293,
215 PERCENT_SKELETON
= 294,
217 PERCENT_TOKEN_TABLE
= 296,
218 PERCENT_VERBOSE
= 297,
226 PERCENT_PERCENT
= 305,
240 #define PERCENT_TOKEN 260
241 #define PERCENT_NTERM 261
242 #define PERCENT_TYPE 262
243 #define PERCENT_DESTRUCTOR 263
244 #define PERCENT_PRINTER 264
245 #define PERCENT_LEFT 265
246 #define PERCENT_RIGHT 266
247 #define PERCENT_NONASSOC 267
248 #define PERCENT_PRECEDENCE 268
249 #define PERCENT_PREC 269
250 #define PERCENT_DPREC 270
251 #define PERCENT_MERGE 271
252 #define PERCENT_CODE 272
253 #define PERCENT_DEBUG 273
254 #define PERCENT_DEFAULT_PREC 274
255 #define PERCENT_DEFINE 275
256 #define PERCENT_DEFINES 276
257 #define PERCENT_ERROR_VERBOSE 277
258 #define PERCENT_EXPECT 278
259 #define PERCENT_EXPECT_RR 279
260 #define PERCENT_FILE_PREFIX 280
261 #define PERCENT_GLR_PARSER 281
262 #define PERCENT_INITIAL_ACTION 282
263 #define PERCENT_LANGUAGE 283
264 #define PERCENT_LEX_PARAM 284
265 #define PERCENT_LOCATIONS 285
266 #define PERCENT_NAME_PREFIX 286
267 #define PERCENT_NO_DEFAULT_PREC 287
268 #define PERCENT_NO_LINES 288
269 #define PERCENT_NONDETERMINISTIC_PARSER 289
270 #define PERCENT_OUTPUT 290
271 #define PERCENT_PARSE_PARAM 291
272 #define PERCENT_PURE_PARSER 292
273 #define PERCENT_REQUIRE 293
274 #define PERCENT_SKELETON 294
275 #define PERCENT_START 295
276 #define PERCENT_TOKEN_TABLE 296
277 #define PERCENT_VERBOSE 297
278 #define PERCENT_YACC 298
279 #define BRACED_CODE 299
285 #define PERCENT_PERCENT 305
288 #define SEMICOLON 308
292 #define PERCENT_UNION 312
297 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
298 typedef union YYSTYPE
300 /* Line 216 of yacc.c */
301 #line 92 "parse-gram.y"
310 unsigned char character
;
313 /* Line 216 of yacc.c */
314 #line 315 "../../src/parse-gram.c"
316 # define YYSTYPE_IS_TRIVIAL 1
317 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
318 # define YYSTYPE_IS_DECLARED 1
321 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
322 typedef struct YYLTYPE
329 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
330 # define YYLTYPE_IS_DECLARED 1
331 # define YYLTYPE_IS_TRIVIAL 1
335 /* Copy the second part of user declarations. */
337 /* Line 266 of yacc.c */
338 #line 339 "../../src/parse-gram.c"
345 typedef YYTYPE_UINT8 yytype_uint8
;
347 typedef unsigned char yytype_uint8
;
351 typedef YYTYPE_INT8 yytype_int8
;
352 #elif (defined __STDC__ || defined __C99__FUNC__ \
353 || defined __cplusplus || defined _MSC_VER)
354 typedef signed char yytype_int8
;
356 typedef short int yytype_int8
;
360 typedef YYTYPE_UINT16 yytype_uint16
;
362 typedef unsigned short int yytype_uint16
;
366 typedef YYTYPE_INT16 yytype_int16
;
368 typedef short int yytype_int16
;
372 # ifdef __SIZE_TYPE__
373 # define YYSIZE_T __SIZE_TYPE__
374 # elif defined size_t
375 # define YYSIZE_T size_t
376 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
377 || defined __cplusplus || defined _MSC_VER)
378 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
379 # define YYSIZE_T size_t
381 # define YYSIZE_T unsigned int
385 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
390 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
391 # define YY_(msgid) dgettext ("bison-runtime", msgid)
395 # define YY_(msgid) msgid
399 /* Suppress unused-variable warnings by "using" E. */
400 #if ! defined lint || defined __GNUC__
401 # define YYUSE(e) ((void) (e))
403 # define YYUSE(e) /* empty */
406 /* Identity function, used to suppress warnings about constant conditions. */
410 #if (defined __STDC__ || defined __C99__FUNC__ \
411 || defined __cplusplus || defined _MSC_VER)
424 #if ! defined yyoverflow || YYERROR_VERBOSE
426 /* The parser invokes alloca or malloc; define the necessary symbols. */
428 # ifdef YYSTACK_USE_ALLOCA
429 # if YYSTACK_USE_ALLOCA
431 # define YYSTACK_ALLOC __builtin_alloca
432 # elif defined __BUILTIN_VA_ARG_INCR
433 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
435 # define YYSTACK_ALLOC __alloca
436 # elif defined _MSC_VER
437 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
438 # define alloca _alloca
440 # define YYSTACK_ALLOC alloca
441 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
442 || defined __cplusplus || defined _MSC_VER)
443 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
452 # ifdef YYSTACK_ALLOC
453 /* Pacify GCC's `empty if-body' warning. */
454 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
455 # ifndef YYSTACK_ALLOC_MAXIMUM
456 /* The OS might guarantee only one guard page at the bottom of the stack,
457 and a page size can be as small as 4096 bytes. So we cannot safely
458 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
459 to allow for a few compiler-allocated temporary stack slots. */
460 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
463 # define YYSTACK_ALLOC YYMALLOC
464 # define YYSTACK_FREE YYFREE
465 # ifndef YYSTACK_ALLOC_MAXIMUM
466 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
468 # if (defined __cplusplus && ! defined _STDLIB_H \
469 && ! ((defined YYMALLOC || defined malloc) \
470 && (defined YYFREE || defined free)))
471 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
477 # define YYMALLOC malloc
478 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
479 || defined __cplusplus || defined _MSC_VER)
480 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
485 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
486 || defined __cplusplus || defined _MSC_VER)
487 void free (void *); /* INFRINGES ON USER NAME SPACE */
491 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
494 #if (! defined yyoverflow \
495 && (! defined __cplusplus \
496 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
497 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
499 /* A type that is properly aligned for any stack member. */
502 yytype_int16 yyss_alloc
;
507 /* The size of the maximum gap between one aligned stack and the next. */
508 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
510 /* The size of an array large to enough to hold all stacks, each with
512 # define YYSTACK_BYTES(N) \
513 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
514 + 2 * YYSTACK_GAP_MAXIMUM)
516 /* Copy COUNT objects from FROM to TO. The source and destination do
519 # if defined __GNUC__ && 1 < __GNUC__
520 # define YYCOPY(To, From, Count) \
521 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
523 # define YYCOPY(To, From, Count) \
527 for (yyi = 0; yyi < (Count); yyi++) \
528 (To)[yyi] = (From)[yyi]; \
534 /* Relocate STACK from its old location to the new one. The
535 local variables YYSIZE and YYSTACKSIZE give the old and new number of
536 elements in the stack, and YYPTR gives the new location of the
537 stack. Advance YYPTR to a properly aligned location for the next
539 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
542 YYSIZE_T yynewbytes; \
543 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
544 Stack = &yyptr->Stack_alloc; \
545 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
546 yyptr += yynewbytes / sizeof (*yyptr); \
552 /* YYFINAL -- State number of the termination state. */
554 /* YYLAST -- Last index in YYTABLE. */
557 /* YYNTOKENS -- Number of terminals. */
559 /* YYNNTS -- Number of nonterminals. */
561 /* YYNRULES -- Number of rules. */
563 /* YYNSTATES -- Number of states. */
564 #define YYNSTATES 144
566 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
567 by yylex, with out-of-bounds checking. */
569 #define YYMAXUTOK 312
571 #define YYTRANSLATE(YYX) \
572 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
574 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
575 as returned by yylex, without out-of-bounds checking. */
576 static const yytype_uint8 yytranslate
[] =
578 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
604 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
605 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
606 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
607 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
608 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
613 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
614 static const yytype_uint16 yyrline
[] =
616 0, 203, 203, 211, 213, 217, 218, 228, 232, 236,
617 237, 242, 246, 247, 248, 249, 250, 255, 264, 265,
618 266, 267, 268, 269, 270, 271, 272, 273, 274, 287,
619 288, 312, 313, 314, 315, 319, 320, 321, 325, 332,
620 339, 343, 347, 354, 369, 370, 374, 386, 386, 391,
621 391, 396, 407, 422, 423, 424, 425, 429, 430, 435,
622 437, 442, 443, 448, 450, 455, 456, 460, 461, 462,
623 463, 468, 473, 478, 484, 490, 501, 502, 511, 512,
624 518, 519, 520, 527, 527, 531, 532, 533, 538, 539,
625 541, 543, 545, 547, 557, 558, 564, 567, 576, 596,
626 598, 607, 612, 613, 618, 625, 627
630 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
631 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
632 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
633 static const char *const yytname
[] =
635 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
636 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
637 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
638 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
639 "\"%debug\"", "\"%default-prec\"", "\"%define\"", "\"%defines\"",
640 "\"%error-verbose\"", "\"%expect\"", "\"%expect-rr\"",
641 "\"%file-prefix\"", "\"%glr-parser\"", "\"%initial-action\"",
642 "\"%language\"", "\"%lex-param\"", "\"%locations\"", "\"%name-prefix\"",
643 "\"%no-default-prec\"", "\"%no-lines\"", "\"%nondeterministic-parser\"",
644 "\"%output\"", "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"",
645 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
646 "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"", "\"=\"",
647 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
648 "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
649 "input", "prologue_declarations", "prologue_declaration",
650 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
651 "precedence_declaration", "precedence_declarator", "tag.opt",
652 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
653 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
654 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
655 "variable", "content.opt", "braceless", "id", "id_colon", "symbol",
656 "string_as_id", "epilogue.opt", 0
661 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
662 (internal) symbol number NUM (which must be that of a token). */
663 static const yytype_uint16 yytoknum
[] =
665 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
666 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
667 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
668 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
669 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
670 305, 306, 307, 308, 309, 310, 311, 312
674 #define YYPACT_NINF -81
676 #define YYTABLE_NINF -106
678 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
680 static const yytype_int16 yypact
[] =
682 -81, 23, 111, -81, -81, -81, -28, -12, -8, -81,
683 -81, -81, -81, -13, -81, -81, 14, 43, -81, 48,
684 49, 2, -81, 10, 53, 34, -81, 13, -81, -81,
685 -81, 26, 36, -81, 54, 78, 0, -81, -81, -81,
686 58, -81, -81, 41, -81, -81, -81, -81, 28, -24,
687 -24, 0, 31, 31, -81, 44, -81, -81, -81, 81,
688 -81, -81, -81, -81, 88, -81, -81, -81, -81, 89,
689 -81, 91, -81, -81, -81, -81, -81, -81, -81, -81,
690 -81, 42, -81, 47, 1, -81, -81, -81, -81, 44,
691 -81, 0, -81, -81, -24, 40, -24, 0, -81, -81,
692 -81, -81, 31, -81, -81, 31, -81, -81, -81, -81,
693 -81, -81, -81, -81, 50, -81, -81, -81, -81, 0,
694 -81, 93, -81, 98, -81, -81, -81, -81, -14, 155,
695 -81, -81, -81, -81, -81, 0, 99, 51, -81, -81,
699 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
700 does not specify something else to do. Zero means the default is an
702 static const yytype_uint8 yydefact
[] =
704 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
705 54, 55, 56, 0, 7, 40, 0, 9, 11, 0,
706 0, 0, 16, 0, 0, 0, 20, 0, 41, 23,
707 24, 0, 0, 28, 0, 0, 0, 31, 32, 33,
708 0, 6, 34, 44, 4, 5, 36, 35, 57, 0,
709 0, 0, 0, 0, 98, 0, 42, 95, 94, 96,
710 10, 12, 13, 14, 0, 17, 18, 19, 21, 0,
711 25, 0, 27, 29, 30, 104, 100, 99, 102, 37,
712 103, 0, 101, 0, 0, 78, 80, 83, 45, 0,
713 58, 0, 71, 76, 50, 72, 48, 51, 63, 68,
714 69, 70, 38, 65, 67, 39, 43, 97, 8, 15,
715 22, 26, 82, 81, 0, 79, 2, 88, 46, 52,
716 59, 61, 77, 73, 74, 64, 66, 106, 84, 85,
717 60, 62, 75, 88, 87, 0, 0, 0, 90, 89,
721 /* YYPGOTO[NTERM-NUM]. */
722 static const yytype_int8 yypgoto
[] =
724 -81, -81, -81, -81, 100, -81, -81, -81, -81, -81,
725 -81, -81, -81, -11, -81, 56, -80, -54, 60, -81,
726 22, -81, -81, -81, -21, -81, -81, -51, -22, -81,
730 /* YYDEFGOTO[NTERM-NUM]. */
731 static const yytype_int16 yydefgoto
[] =
733 -1, 1, 2, 44, 83, 89, 46, 50, 49, 47,
734 48, 91, 119, 120, 97, 102, 103, 93, 94, 84,
735 85, 86, 117, 128, 129, 59, 108, 56, 78, 87,
739 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
740 positive, shift that token. If negative, reduce the rule which
741 number is the opposite. If zero, do what YYDEFACT says.
742 If YYTABLE_NINF, syntax error. */
743 static const yytype_int16 yytable
[] =
745 79, -105, 81, 75, 106, 63, 4, 5, 6, 7,
746 8, 9, 10, 11, 12, 98, 68, 57, 13, 124,
747 15, 76, 126, 3, 77, 126, 51, 95, 95, 70,
748 92, 54, 52, 28, 75, 55, 53, 133, 118, 134,
749 122, 36, 122, 75, 123, 76, 60, 132, 77, 64,
750 82, 114, 61, 62, 65, 121, 66, 73, 43, 81,
751 69, 125, 58, 4, 5, 6, 7, 8, 9, 10,
752 11, 12, 95, 71, 95, 13, 76, 15, 67, 77,
753 72, 74, 90, 121, 107, 99, 100, 101, 54, 88,
754 28, 109, 110, 139, 111, 112, 127, 131, 36, 141,
755 113, 75, 45, 142, 139, 143, 115, 82, 130, 105,
756 96, 0, 140, 0, 0, 43, 4, 5, 6, 7,
757 8, 9, 10, 11, 12, 0, 0, 0, 13, 14,
758 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
759 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
760 35, 36, 37, 38, 39, 0, 0, 0, 75, 0,
761 0, 40, 0, 41, 42, 0, 0, 0, 43, 135,
762 136, 137, 0, 0, 0, 0, 0, 0, 0, 0,
763 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
764 0, 0, 0, 0, 0, 0, 0, 0, 0, 138,
768 static const yytype_int16 yycheck
[] =
770 36, 0, 1, 3, 55, 3, 5, 6, 7, 8,
771 9, 10, 11, 12, 13, 51, 3, 3, 17, 95,
772 19, 45, 102, 0, 48, 105, 54, 49, 50, 3,
773 54, 44, 44, 32, 3, 48, 44, 51, 89, 53,
774 94, 40, 96, 3, 4, 45, 3, 123, 48, 47,
775 49, 50, 4, 4, 44, 91, 3, 3, 57, 1,
776 47, 97, 48, 5, 6, 7, 8, 9, 10, 11,
777 12, 13, 94, 47, 96, 17, 45, 19, 44, 48,
778 44, 3, 54, 119, 3, 54, 55, 56, 44, 48,
779 32, 3, 3, 129, 3, 53, 46, 4, 40, 135,
780 53, 3, 2, 4, 140, 54, 84, 49, 119, 53,
781 50, -1, 133, -1, -1, 57, 5, 6, 7, 8,
782 9, 10, 11, 12, 13, -1, -1, -1, 17, 18,
783 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
784 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
785 39, 40, 41, 42, 43, -1, -1, -1, 3, -1,
786 -1, 50, -1, 52, 53, -1, -1, -1, 57, 14,
787 15, 16, -1, -1, -1, -1, -1, -1, -1, -1,
788 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
789 -1, -1, -1, -1, -1, -1, -1, -1, -1, 44,
793 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
794 symbol of state STATE-NUM. */
795 static const yytype_uint8 yystos
[] =
797 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
798 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
799 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
800 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
801 50, 52, 53, 57, 61, 62, 64, 67, 68, 66,
802 65, 54, 44, 44, 44, 48, 85, 3, 48, 83,
803 3, 4, 4, 3, 47, 44, 3, 44, 3, 47,
804 3, 47, 44, 3, 3, 3, 45, 48, 86, 88,
805 89, 1, 49, 62, 77, 78, 79, 87, 48, 63,
806 54, 69, 54, 75, 76, 86, 76, 72, 88, 54,
807 55, 56, 73, 74, 88, 73, 85, 3, 84, 3,
808 3, 3, 53, 53, 50, 78, 90, 80, 85, 70,
809 71, 88, 75, 4, 89, 88, 74, 46, 81, 82,
810 71, 4, 89, 51, 53, 14, 15, 16, 44, 88,
814 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
815 static const yytype_uint8 yyr1
[] =
817 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
818 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
819 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
820 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
821 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
822 64, 64, 67, 68, 68, 68, 68, 69, 69, 70,
823 70, 71, 71, 72, 72, 73, 73, 74, 74, 74,
824 74, 75, 75, 75, 75, 75, 76, 76, 77, 77,
825 78, 78, 78, 80, 79, 81, 81, 81, 82, 82,
826 82, 82, 82, 82, 83, 83, 84, 84, 85, 86,
827 86, 87, 88, 88, 89, 90, 90
830 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
831 static const yytype_uint8 yyr2
[] =
833 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
834 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
835 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
836 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
837 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
838 3, 3, 3, 1, 1, 1, 1, 0, 1, 1,
839 2, 1, 2, 1, 2, 1, 2, 1, 1, 1,
840 1, 1, 1, 2, 2, 3, 1, 2, 1, 2,
841 1, 2, 2, 0, 3, 1, 3, 2, 0, 2,
842 2, 3, 3, 3, 1, 1, 0, 1, 1, 1,
847 #define yyerrok (yyerrstatus = 0)
848 #define yyclearin (yychar = YYEMPTY)
852 #define YYACCEPT goto yyacceptlab
853 #define YYABORT goto yyabortlab
854 #define YYERROR goto yyerrorlab
857 /* Like YYERROR except do call yyerror. This remains here temporarily
858 to ease the transition to the new meaning of YYERROR, for GCC.
859 Once GCC version 2 has supplanted version 1, this can go. */
861 #define YYFAIL goto yyerrlab
863 #define YYRECOVERING() (!!yyerrstatus)
865 #define YYBACKUP(Token, Value) \
867 if (yychar == YYEMPTY && yylen == 1) \
871 yytoken = YYTRANSLATE (yychar); \
877 yyerror (YY_("syntax error: cannot back up")); \
884 #define YYERRCODE 256
887 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
888 If N is 0, then set CURRENT to the empty location which ends
889 the previous symbol: RHS[0] (always defined). */
891 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
892 #ifndef YYLLOC_DEFAULT
893 # define YYLLOC_DEFAULT(Current, Rhs, N) \
897 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
898 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
899 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
900 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
904 (Current).first_line = (Current).last_line = \
905 YYRHSLOC (Rhs, 0).last_line; \
906 (Current).first_column = (Current).last_column = \
907 YYRHSLOC (Rhs, 0).last_column; \
913 /* YY_LOCATION_PRINT -- Print the location on the stream.
914 This macro was not mandated originally: define only if we know
915 we won't break user code: when these are the locations we know. */
917 #ifndef YY_LOCATION_PRINT
918 # if YYLTYPE_IS_TRIVIAL
919 # define YY_LOCATION_PRINT(File, Loc) \
920 fprintf (File, "%d.%d-%d.%d", \
921 (Loc).first_line, (Loc).first_column, \
922 (Loc).last_line, (Loc).last_column)
924 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
929 /* YYLEX -- calling `yylex' with the right arguments. */
932 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
934 # define YYLEX yylex (&yylval, &yylloc)
937 /* Enable debugging if requested. */
941 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
942 # define YYFPRINTF fprintf
945 # define YYDPRINTF(Args) \
951 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
955 YYFPRINTF (stderr, "%s ", Title); \
956 yy_symbol_print (stderr, \
957 Type, Value, Location); \
958 YYFPRINTF (stderr, "\n"); \
963 /*--------------------------------.
964 | Print this symbol on YYOUTPUT. |
965 `--------------------------------*/
968 #if (defined __STDC__ || defined __C99__FUNC__ \
969 || defined __cplusplus || defined _MSC_VER)
971 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
974 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
977 YYSTYPE
const * const yyvaluep
;
978 YYLTYPE
const * const yylocationp
;
985 if (yytype
< YYNTOKENS
)
986 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
994 /* Line 647 of yacc.c */
995 #line 181 "parse-gram.y"
996 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
997 /* Line 647 of yacc.c */
998 #line 999 "../../src/parse-gram.c"
1001 case 4: // "integer"
1003 /* Line 647 of yacc.c */
1004 #line 192 "parse-gram.y"
1005 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
1006 /* Line 647 of yacc.c */
1007 #line 1008 "../../src/parse-gram.c"
1012 /* Line 647 of yacc.c */
1013 #line 183 "parse-gram.y"
1014 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1015 /* Line 647 of yacc.c */
1016 #line 1017 "../../src/parse-gram.c"
1021 /* Line 647 of yacc.c */
1022 #line 175 "parse-gram.y"
1023 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
1024 /* Line 647 of yacc.c */
1025 #line 1026 "../../src/parse-gram.c"
1028 case 46: // "epilogue"
1030 /* Line 647 of yacc.c */
1031 #line 183 "parse-gram.y"
1032 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1033 /* Line 647 of yacc.c */
1034 #line 1035 "../../src/parse-gram.c"
1037 case 48: // "identifier"
1039 /* Line 647 of yacc.c */
1040 #line 188 "parse-gram.y"
1041 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1042 /* Line 647 of yacc.c */
1043 #line 1044 "../../src/parse-gram.c"
1046 case 49: // "identifier:"
1048 /* Line 647 of yacc.c */
1049 #line 189 "parse-gram.y"
1050 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
1051 /* Line 647 of yacc.c */
1052 #line 1053 "../../src/parse-gram.c"
1055 case 52: // "%{...%}"
1057 /* Line 647 of yacc.c */
1058 #line 183 "parse-gram.y"
1059 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1060 /* Line 647 of yacc.c */
1061 #line 1062 "../../src/parse-gram.c"
1066 /* Line 647 of yacc.c */
1067 #line 187 "parse-gram.y"
1068 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1069 /* Line 647 of yacc.c */
1070 #line 1071 "../../src/parse-gram.c"
1073 case 83: // variable
1075 /* Line 647 of yacc.c */
1076 #line 188 "parse-gram.y"
1077 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1078 /* Line 647 of yacc.c */
1079 #line 1080 "../../src/parse-gram.c"
1082 case 84: // content.opt
1084 /* Line 647 of yacc.c */
1085 #line 183 "parse-gram.y"
1086 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1087 /* Line 647 of yacc.c */
1088 #line 1089 "../../src/parse-gram.c"
1091 case 85: // braceless
1093 /* Line 647 of yacc.c */
1094 #line 183 "parse-gram.y"
1095 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1096 /* Line 647 of yacc.c */
1097 #line 1098 "../../src/parse-gram.c"
1102 /* Line 647 of yacc.c */
1103 #line 195 "parse-gram.y"
1104 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1105 /* Line 647 of yacc.c */
1106 #line 1107 "../../src/parse-gram.c"
1109 case 87: // id_colon
1111 /* Line 647 of yacc.c */
1112 #line 196 "parse-gram.y"
1113 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1114 /* Line 647 of yacc.c */
1115 #line 1116 "../../src/parse-gram.c"
1120 /* Line 647 of yacc.c */
1121 #line 195 "parse-gram.y"
1122 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1123 /* Line 647 of yacc.c */
1124 #line 1125 "../../src/parse-gram.c"
1127 case 89: // string_as_id
1129 /* Line 647 of yacc.c */
1130 #line 195 "parse-gram.y"
1131 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1132 /* Line 647 of yacc.c */
1133 #line 1134 "../../src/parse-gram.c"
1142 /*--------------------------------.
1143 | Print this symbol on YYOUTPUT. |
1144 `--------------------------------*/
1146 #if (defined __STDC__ || defined __C99__FUNC__ \
1147 || defined __cplusplus || defined _MSC_VER)
1149 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1152 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1155 YYSTYPE
const * const yyvaluep
;
1156 YYLTYPE
const * const yylocationp
;
1159 if (yytype
< YYNTOKENS
)
1160 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1162 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1164 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1165 YYFPRINTF (yyoutput
, ": ");
1166 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1167 YYFPRINTF (yyoutput
, ")");
1170 /*------------------------------------------------------------------.
1171 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1173 `------------------------------------------------------------------*/
1175 #if (defined __STDC__ || defined __C99__FUNC__ \
1176 || defined __cplusplus || defined _MSC_VER)
1178 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1181 yy_stack_print (yybottom
, yytop
)
1182 yytype_int16
*yybottom
;
1183 yytype_int16
*yytop
;
1186 YYFPRINTF (stderr
, "Stack now");
1187 for (; yybottom
<= yytop
; yybottom
++)
1189 int yybot
= *yybottom
;
1190 YYFPRINTF (stderr
, " %d", yybot
);
1192 YYFPRINTF (stderr
, "\n");
1195 # define YY_STACK_PRINT(Bottom, Top) \
1198 yy_stack_print ((Bottom), (Top)); \
1202 /*------------------------------------------------.
1203 | Report that the YYRULE is going to be reduced. |
1204 `------------------------------------------------*/
1206 #if (defined __STDC__ || defined __C99__FUNC__ \
1207 || defined __cplusplus || defined _MSC_VER)
1209 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1212 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1213 yytype_int16
*yyssp
;
1219 unsigned long int yylno
= yyrline
[yyrule
];
1220 int yynrhs
= yyr2
[yyrule
];
1222 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1224 /* The symbols being reduced. */
1225 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1227 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1228 yy_symbol_print (stderr
,
1229 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1230 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1231 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1232 YYFPRINTF (stderr
, "\n");
1236 # define YY_REDUCE_PRINT(Rule) \
1239 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1242 /* Nonzero means print parse trace. It is left uninitialized so that
1243 multiple parsers can coexist. */
1245 #else /* !YYDEBUG */
1246 # define YYDPRINTF(Args)
1247 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1248 # define YY_STACK_PRINT(Bottom, Top)
1249 # define YY_REDUCE_PRINT(Rule)
1250 #endif /* !YYDEBUG */
1253 /* YYINITDEPTH -- initial size of the parser's stacks. */
1255 # define YYINITDEPTH 200
1258 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1259 if the built-in stack extension method is used).
1261 Do not make this value too large; the results are undefined if
1262 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1263 evaluated with infinite-precision integer arithmetic. */
1266 # define YYMAXDEPTH 10000
1274 # if defined __GLIBC__ && defined _STRING_H
1275 # define yystrlen strlen
1277 /* Return the length of YYSTR. */
1278 #if (defined __STDC__ || defined __C99__FUNC__ \
1279 || defined __cplusplus || defined _MSC_VER)
1281 yystrlen (const char *yystr
)
1289 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1297 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1298 # define yystpcpy stpcpy
1300 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1302 #if (defined __STDC__ || defined __C99__FUNC__ \
1303 || defined __cplusplus || defined _MSC_VER)
1305 yystpcpy (char *yydest
, const char *yysrc
)
1308 yystpcpy (yydest
, yysrc
)
1314 const char *yys
= yysrc
;
1316 while ((*yyd
++ = *yys
++) != '\0')
1325 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1326 quotes and backslashes, so that it's suitable for yyerror. The
1327 heuristic is that double-quoting is unnecessary unless the string
1328 contains an apostrophe, a comma, or backslash (other than
1329 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1330 null, do not copy; instead, return the length of what the result
1333 yytnamerr (char *yyres
, const char *yystr
)
1338 char const *yyp
= yystr
;
1345 goto do_not_strip_quotes
;
1349 goto do_not_strip_quotes
;
1362 do_not_strip_quotes
: ;
1366 return yystrlen (yystr
);
1368 return yystpcpy (yyres
, yystr
) - yyres
;
1372 /* Copy into YYRESULT an error message about the unexpected token
1373 YYTOKEN while in state YYSTATE. Return the number of bytes copied,
1374 including the terminating null byte. If YYRESULT is null, do not
1375 copy anything; just return the number of bytes that would be
1376 copied. As a special case, return 0 if an ordinary "syntax error"
1377 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1378 size calculation. */
1380 yysyntax_error (char *yyresult
, int yystate
, int yytoken
)
1382 int yyn
= yypact
[yystate
];
1384 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1388 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1389 YYSIZE_T yysize
= yysize0
;
1391 int yysize_overflow
= 0;
1392 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1393 /* Internationalized format string. */
1394 const char *yyformat
= 0;
1395 /* Arguments of yyformat. */
1396 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1398 /* Start YYX at -YYN if negative to avoid negative indexes in
1400 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1402 /* Stay within bounds of both yycheck and yytname. */
1403 int yychecklim
= YYLAST
- yyn
+ 1;
1404 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1405 /* Number of reported tokens (one for the "unexpected", one per
1410 yyarg
[yycount
++] = yytname
[yytoken
];
1412 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1413 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1415 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1421 yyarg
[yycount
++] = yytname
[yyx
];
1422 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1423 yysize_overflow
|= (yysize1
< yysize
);
1429 #define YYCASE_(N, S) \
1433 YYCASE_(1, YY_("syntax error, unexpected %s"));
1434 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1435 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1436 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1437 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1441 yysize1
= yysize
+ yystrlen (yyformat
);
1442 yysize_overflow
|= (yysize1
< yysize
);
1445 if (yysize_overflow
)
1446 return YYSIZE_MAXIMUM
;
1450 /* Avoid sprintf, as that infringes on the user's name space.
1451 Don't have undefined behavior even if the translation
1452 produced a string with the wrong number of "%s"s. */
1453 char *yyp
= yyresult
;
1455 while ((*yyp
= *yyformat
) != '\0')
1456 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1458 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1470 #endif /* YYERROR_VERBOSE */
1473 /*-----------------------------------------------.
1474 | Release the memory associated to this symbol. |
1475 `-----------------------------------------------*/
1478 #if (defined __STDC__ || defined __C99__FUNC__ \
1479 || defined __cplusplus || defined _MSC_VER)
1481 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1484 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1488 YYLTYPE
*yylocationp
;
1492 YYUSE (yylocationp
);
1496 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1505 /* Prevent warnings from -Wmissing-prototypes. */
1506 #ifdef YYPARSE_PARAM
1507 #if (defined __STDC__ || defined __C99__FUNC__ \
1508 || defined __cplusplus || defined _MSC_VER)
1509 int yyparse (void *YYPARSE_PARAM
);
1513 #else /* ! YYPARSE_PARAM */
1514 #if (defined __STDC__ || defined __C99__FUNC__ \
1515 || defined __cplusplus || defined _MSC_VER)
1520 #endif /* ! YYPARSE_PARAM */
1526 /*-------------------------.
1527 | yyparse or yypush_parse. |
1528 `-------------------------*/
1530 #ifdef YYPARSE_PARAM
1531 #if (defined __STDC__ || defined __C99__FUNC__ \
1532 || defined __cplusplus || defined _MSC_VER)
1534 yyparse (void *YYPARSE_PARAM
)
1537 yyparse (YYPARSE_PARAM
)
1538 void *YYPARSE_PARAM
;
1540 #else /* ! YYPARSE_PARAM */
1541 #if (defined __STDC__ || defined __C99__FUNC__ \
1542 || defined __cplusplus || defined _MSC_VER)
1552 /* The lookahead symbol. */
1555 /* The semantic value of the lookahead symbol. */
1558 /* Location data for the lookahead symbol. */
1561 /* Number of syntax errors so far. */
1565 /* Number of tokens to shift before error messages enabled. */
1568 /* The stacks and their tools:
1569 `yyss': related to states.
1570 `yyvs': related to semantic values.
1571 `yyls': related to locations.
1573 Refer to the stacks thru separate pointers, to allow yyoverflow
1574 to reallocate them elsewhere. */
1576 /* The state stack. */
1577 yytype_int16 yyssa
[YYINITDEPTH
];
1579 yytype_int16
*yyssp
;
1581 /* The semantic value stack. */
1582 YYSTYPE yyvsa
[YYINITDEPTH
];
1586 /* The location stack. */
1587 YYLTYPE yylsa
[YYINITDEPTH
];
1591 /* The locations where the error started and ended. */
1592 YYLTYPE yyerror_range
[2];
1594 YYSIZE_T yystacksize
;
1598 /* Lookahead token as an internal (translated) token number. */
1600 /* The variables used to return semantic value and location from the
1606 /* Buffer for error messages, and its allocated size. */
1608 char *yymsg
= yymsgbuf
;
1609 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1612 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1614 /* The number of symbols on the RHS of the reduced rule.
1615 Keep to zero when no symbol should be popped. */
1622 yystacksize
= YYINITDEPTH
;
1624 YYDPRINTF ((stderr
, "Starting parse\n"));
1629 yychar
= YYEMPTY
; /* Cause a token to be read. */
1631 /* Initialize stack pointers.
1632 Waste one element of value and location stack
1633 so that they stay on the same level as the state stack.
1634 The wasted elements are never initialized. */
1639 #if YYLTYPE_IS_TRIVIAL
1640 /* Initialize the default location before parsing starts. */
1641 yylloc
.first_line
= yylloc
.last_line
= 1;
1642 yylloc
.first_column
= yylloc
.last_column
= 1;
1645 /* User initialization code. */
1646 /* Line 1167 of yacc.c */
1647 #line 84 "parse-gram.y"
1649 /* Bison's grammar can initial empty locations, hence a default
1650 location is needed. */
1651 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1652 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1654 /* Line 1167 of yacc.c */
1655 #line 1656 "../../src/parse-gram.c"
1660 /*------------------------------------------------------------.
1661 | yynewstate -- Push a new state, which is found in yystate. |
1662 `------------------------------------------------------------*/
1664 /* In all cases, when you get here, the value and location stacks
1665 have just been pushed. So pushing a state here evens the stacks. */
1671 if (yyss
+ yystacksize
- 1 <= yyssp
)
1673 /* Get the current used size of the three stacks, in elements. */
1674 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1678 /* Give user a chance to reallocate the stack. Use copies of
1679 these so that the &'s don't force the real ones into
1681 YYSTYPE
*yyvs1
= yyvs
;
1682 yytype_int16
*yyss1
= yyss
;
1683 YYLTYPE
*yyls1
= yyls
;
1685 /* Each stack pointer address is followed by the size of the
1686 data in use in that stack, in bytes. This used to be a
1687 conditional around just the two extra args, but that might
1688 be undefined if yyoverflow is a macro. */
1689 yyoverflow (YY_("memory exhausted"),
1690 &yyss1
, yysize
* sizeof (*yyssp
),
1691 &yyvs1
, yysize
* sizeof (*yyvsp
),
1692 &yyls1
, yysize
* sizeof (*yylsp
),
1699 #else /* no yyoverflow */
1700 # ifndef YYSTACK_RELOCATE
1701 goto yyexhaustedlab
;
1703 /* Extend the stack our own way. */
1704 if (YYMAXDEPTH
<= yystacksize
)
1705 goto yyexhaustedlab
;
1707 if (YYMAXDEPTH
< yystacksize
)
1708 yystacksize
= YYMAXDEPTH
;
1711 yytype_int16
*yyss1
= yyss
;
1712 union yyalloc
*yyptr
=
1713 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1715 goto yyexhaustedlab
;
1716 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1717 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1718 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1719 # undef YYSTACK_RELOCATE
1721 YYSTACK_FREE (yyss1
);
1724 #endif /* no yyoverflow */
1726 yyssp
= yyss
+ yysize
- 1;
1727 yyvsp
= yyvs
+ yysize
- 1;
1728 yylsp
= yyls
+ yysize
- 1;
1730 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1731 (unsigned long int) yystacksize
));
1733 if (yyss
+ yystacksize
- 1 <= yyssp
)
1737 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1739 if (yystate
== YYFINAL
)
1749 /* Do appropriate processing given the current state. Read a
1750 lookahead token if we need one and don't already have one. */
1752 /* First try to decide what to do without reference to lookahead token. */
1753 yyn
= yypact
[yystate
];
1754 if (yyn
== YYPACT_NINF
)
1757 /* Not known => get a lookahead token if don't already have one. */
1759 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1760 if (yychar
== YYEMPTY
)
1762 YYDPRINTF ((stderr
, "Reading a token: "));
1766 if (yychar
<= YYEOF
)
1768 yychar
= yytoken
= YYEOF
;
1769 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1773 yytoken
= YYTRANSLATE (yychar
);
1774 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1777 /* If the proper action on seeing token YYTOKEN is to reduce or to
1778 detect an error, take that action. */
1780 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1785 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1791 /* Count tokens shifted since error; after three, turn off error
1796 /* Shift the lookahead token. */
1797 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1799 /* Discard the shifted token. */
1808 /*-----------------------------------------------------------.
1809 | yydefault -- do the default action for the current state. |
1810 `-----------------------------------------------------------*/
1812 yyn
= yydefact
[yystate
];
1818 /*-----------------------------.
1819 | yyreduce -- Do a reduction. |
1820 `-----------------------------*/
1822 /* yyn is the number of a rule to reduce with. */
1825 /* If YYLEN is nonzero, implement the default value of the action:
1828 Otherwise, the following line sets YYVAL to garbage.
1829 This behavior is undocumented and Bison
1830 users should not rely upon it. Assigning to YYVAL
1831 unconditionally makes the parser a bit smaller, and it avoids a
1832 GCC warning that YYVAL may be used uninitialized. */
1833 yyval
= yyvsp
[1-yylen
];
1835 /* Default location. */
1836 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1837 YY_REDUCE_PRINT (yyn
);
1841 /* Line 1380 of yacc.c */
1842 #line 219 "parse-gram.y"
1844 code_props plain_code
;
1845 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
1846 code_props_translate_code (&plain_code
);
1847 gram_scanner_last_string_free ();
1848 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1849 plain_code
.code
, (yylsp
[0]));
1850 code_scanner_last_string_free ();
1852 /* Line 1380 of yacc.c */
1853 #line 1854 "../../src/parse-gram.c"
1857 /* Line 1380 of yacc.c */
1858 #line 229 "parse-gram.y"
1860 muscle_percent_define_insert ("debug", (yyloc
), "");
1862 /* Line 1380 of yacc.c */
1863 #line 1864 "../../src/parse-gram.c"
1867 /* Line 1380 of yacc.c */
1868 #line 233 "parse-gram.y"
1870 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
));
1872 /* Line 1380 of yacc.c */
1873 #line 1874 "../../src/parse-gram.c"
1877 /* Line 1380 of yacc.c */
1878 #line 236 "parse-gram.y"
1879 { defines_flag
= true; }
1880 /* Line 1380 of yacc.c */
1881 #line 1882 "../../src/parse-gram.c"
1885 /* Line 1380 of yacc.c */
1886 #line 238 "parse-gram.y"
1888 defines_flag
= true;
1889 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
1891 /* Line 1380 of yacc.c */
1892 #line 1893 "../../src/parse-gram.c"
1896 /* Line 1380 of yacc.c */
1897 #line 243 "parse-gram.y"
1899 muscle_percent_define_insert ("error_verbose", (yyloc
), "");
1901 /* Line 1380 of yacc.c */
1902 #line 1903 "../../src/parse-gram.c"
1906 /* Line 1380 of yacc.c */
1907 #line 246 "parse-gram.y"
1908 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
1909 /* Line 1380 of yacc.c */
1910 #line 1911 "../../src/parse-gram.c"
1914 /* Line 1380 of yacc.c */
1915 #line 247 "parse-gram.y"
1916 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
1917 /* Line 1380 of yacc.c */
1918 #line 1919 "../../src/parse-gram.c"
1922 /* Line 1380 of yacc.c */
1923 #line 248 "parse-gram.y"
1924 { spec_file_prefix
= (yyvsp
[0].chars
); }
1925 /* Line 1380 of yacc.c */
1926 #line 1927 "../../src/parse-gram.c"
1930 /* Line 1380 of yacc.c */
1931 #line 249 "parse-gram.y"
1932 { spec_file_prefix
= (yyvsp
[0].chars
); }
1933 /* Line 1380 of yacc.c */
1934 #line 1935 "../../src/parse-gram.c"
1938 /* Line 1380 of yacc.c */
1939 #line 251 "parse-gram.y"
1941 nondeterministic_parser
= true;
1944 /* Line 1380 of yacc.c */
1945 #line 1946 "../../src/parse-gram.c"
1949 /* Line 1380 of yacc.c */
1950 #line 256 "parse-gram.y"
1953 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
1954 code_props_translate_code (&action
);
1955 gram_scanner_last_string_free ();
1956 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
1957 code_scanner_last_string_free ();
1959 /* Line 1380 of yacc.c */
1960 #line 1961 "../../src/parse-gram.c"
1964 /* Line 1380 of yacc.c */
1965 #line 264 "parse-gram.y"
1966 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
1967 /* Line 1380 of yacc.c */
1968 #line 1969 "../../src/parse-gram.c"
1972 /* Line 1380 of yacc.c */
1973 #line 265 "parse-gram.y"
1974 { add_param ("lex_param", (yyvsp
[0].code
), (yylsp
[0])); }
1975 /* Line 1380 of yacc.c */
1976 #line 1977 "../../src/parse-gram.c"
1980 /* Line 1380 of yacc.c */
1981 #line 266 "parse-gram.y"
1982 { locations_flag
= true; }
1983 /* Line 1380 of yacc.c */
1984 #line 1985 "../../src/parse-gram.c"
1988 /* Line 1380 of yacc.c */
1989 #line 267 "parse-gram.y"
1990 { spec_name_prefix
= (yyvsp
[0].chars
); }
1991 /* Line 1380 of yacc.c */
1992 #line 1993 "../../src/parse-gram.c"
1996 /* Line 1380 of yacc.c */
1997 #line 268 "parse-gram.y"
1998 { spec_name_prefix
= (yyvsp
[0].chars
); }
1999 /* Line 1380 of yacc.c */
2000 #line 2001 "../../src/parse-gram.c"
2004 /* Line 1380 of yacc.c */
2005 #line 269 "parse-gram.y"
2006 { no_lines_flag
= true; }
2007 /* Line 1380 of yacc.c */
2008 #line 2009 "../../src/parse-gram.c"
2012 /* Line 1380 of yacc.c */
2013 #line 270 "parse-gram.y"
2014 { nondeterministic_parser
= true; }
2015 /* Line 1380 of yacc.c */
2016 #line 2017 "../../src/parse-gram.c"
2020 /* Line 1380 of yacc.c */
2021 #line 271 "parse-gram.y"
2022 { spec_outfile
= (yyvsp
[0].chars
); }
2023 /* Line 1380 of yacc.c */
2024 #line 2025 "../../src/parse-gram.c"
2028 /* Line 1380 of yacc.c */
2029 #line 272 "parse-gram.y"
2030 { spec_outfile
= (yyvsp
[0].chars
); }
2031 /* Line 1380 of yacc.c */
2032 #line 2033 "../../src/parse-gram.c"
2036 /* Line 1380 of yacc.c */
2037 #line 273 "parse-gram.y"
2038 { add_param ("parse_param", (yyvsp
[0].code
), (yylsp
[0])); }
2039 /* Line 1380 of yacc.c */
2040 #line 2041 "../../src/parse-gram.c"
2044 /* Line 1380 of yacc.c */
2045 #line 275 "parse-gram.y"
2047 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2048 `%define api.pure' in a backward-compatible manner here. First, don't
2049 complain if %pure-parser is specified multiple times. */
2050 if (!muscle_find_const ("percent_define(api.pure)"))
2051 muscle_percent_define_insert ("api.pure", (yylsp
[0]), "");
2052 /* In all cases, use api.pure now so that the backend doesn't complain if
2053 the skeleton ignores api.pure, but do warn now if there's a previous
2054 conflicting definition from an actual %define. */
2055 if (!muscle_percent_define_flag_if ("api.pure"))
2056 muscle_percent_define_insert ("api.pure", (yylsp
[0]), "");
2058 /* Line 1380 of yacc.c */
2059 #line 2060 "../../src/parse-gram.c"
2063 /* Line 1380 of yacc.c */
2064 #line 287 "parse-gram.y"
2065 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2066 /* Line 1380 of yacc.c */
2067 #line 2068 "../../src/parse-gram.c"
2071 /* Line 1380 of yacc.c */
2072 #line 289 "parse-gram.y"
2074 char const *skeleton_user
= (yyvsp
[0].chars
);
2075 if (strchr (skeleton_user
, '/'))
2077 size_t dir_length
= strlen (current_file
);
2078 char *skeleton_build
;
2079 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2081 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2084 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2087 strncpy (skeleton_build
, current_file
, dir_length
);
2088 skeleton_build
[dir_length
++] = '/';
2090 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2091 skeleton_user
= uniqstr_new (skeleton_build
);
2092 free (skeleton_build
);
2094 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2096 /* Line 1380 of yacc.c */
2097 #line 2098 "../../src/parse-gram.c"
2101 /* Line 1380 of yacc.c */
2102 #line 312 "parse-gram.y"
2103 { token_table_flag
= true; }
2104 /* Line 1380 of yacc.c */
2105 #line 2106 "../../src/parse-gram.c"
2109 /* Line 1380 of yacc.c */
2110 #line 313 "parse-gram.y"
2111 { report_flag
|= report_states
; }
2112 /* Line 1380 of yacc.c */
2113 #line 2114 "../../src/parse-gram.c"
2117 /* Line 1380 of yacc.c */
2118 #line 314 "parse-gram.y"
2119 { yacc_flag
= true; }
2120 /* Line 1380 of yacc.c */
2121 #line 2122 "../../src/parse-gram.c"
2125 /* Line 1380 of yacc.c */
2126 #line 322 "parse-gram.y"
2128 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2130 /* Line 1380 of yacc.c */
2131 #line 2132 "../../src/parse-gram.c"
2135 /* Line 1380 of yacc.c */
2136 #line 326 "parse-gram.y"
2139 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2140 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2141 symbol_list_free ((yyvsp
[0].list
));
2143 /* Line 1380 of yacc.c */
2144 #line 2145 "../../src/parse-gram.c"
2148 /* Line 1380 of yacc.c */
2149 #line 333 "parse-gram.y"
2152 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2153 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2154 symbol_list_free ((yyvsp
[0].list
));
2156 /* Line 1380 of yacc.c */
2157 #line 2158 "../../src/parse-gram.c"
2161 /* Line 1380 of yacc.c */
2162 #line 340 "parse-gram.y"
2164 default_prec
= true;
2166 /* Line 1380 of yacc.c */
2167 #line 2168 "../../src/parse-gram.c"
2171 /* Line 1380 of yacc.c */
2172 #line 344 "parse-gram.y"
2174 default_prec
= false;
2176 /* Line 1380 of yacc.c */
2177 #line 2178 "../../src/parse-gram.c"
2181 /* Line 1380 of yacc.c */
2182 #line 348 "parse-gram.y"
2184 /* Do not invoke muscle_percent_code_grow here since it invokes
2185 muscle_user_name_list_grow. */
2186 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2187 code_scanner_last_string_free ();
2189 /* Line 1380 of yacc.c */
2190 #line 2191 "../../src/parse-gram.c"
2194 /* Line 1380 of yacc.c */
2195 #line 355 "parse-gram.y"
2197 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2198 code_scanner_last_string_free ();
2200 /* Line 1380 of yacc.c */
2201 #line 2202 "../../src/parse-gram.c"
2205 /* Line 1380 of yacc.c */
2206 #line 369 "parse-gram.y"
2208 /* Line 1380 of yacc.c */
2209 #line 2210 "../../src/parse-gram.c"
2213 /* Line 1380 of yacc.c */
2214 #line 370 "parse-gram.y"
2215 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2216 /* Line 1380 of yacc.c */
2217 #line 2218 "../../src/parse-gram.c"
2221 /* Line 1380 of yacc.c */
2222 #line 375 "parse-gram.y"
2225 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2226 code_scanner_last_string_free ();
2228 /* Line 1380 of yacc.c */
2229 #line 2230 "../../src/parse-gram.c"
2233 /* Line 1380 of yacc.c */
2234 #line 386 "parse-gram.y"
2235 { current_class
= nterm_sym
; }
2236 /* Line 1380 of yacc.c */
2237 #line 2238 "../../src/parse-gram.c"
2241 /* Line 1380 of yacc.c */
2242 #line 387 "parse-gram.y"
2244 current_class
= unknown_sym
;
2245 current_type
= NULL
;
2247 /* Line 1380 of yacc.c */
2248 #line 2249 "../../src/parse-gram.c"
2252 /* Line 1380 of yacc.c */
2253 #line 391 "parse-gram.y"
2254 { current_class
= token_sym
; }
2255 /* Line 1380 of yacc.c */
2256 #line 2257 "../../src/parse-gram.c"
2260 /* Line 1380 of yacc.c */
2261 #line 392 "parse-gram.y"
2263 current_class
= unknown_sym
;
2264 current_type
= NULL
;
2266 /* Line 1380 of yacc.c */
2267 #line 2268 "../../src/parse-gram.c"
2271 /* Line 1380 of yacc.c */
2272 #line 397 "parse-gram.y"
2276 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2277 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2278 symbol_list_free ((yyvsp
[0].list
));
2280 /* Line 1380 of yacc.c */
2281 #line 2282 "../../src/parse-gram.c"
2285 /* Line 1380 of yacc.c */
2286 #line 408 "parse-gram.y"
2290 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2292 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2293 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2295 symbol_list_free ((yyvsp
[0].list
));
2296 current_type
= NULL
;
2298 /* Line 1380 of yacc.c */
2299 #line 2300 "../../src/parse-gram.c"
2303 /* Line 1380 of yacc.c */
2304 #line 422 "parse-gram.y"
2305 { (yyval
.assoc
) = left_assoc
; }
2306 /* Line 1380 of yacc.c */
2307 #line 2308 "../../src/parse-gram.c"
2311 /* Line 1380 of yacc.c */
2312 #line 423 "parse-gram.y"
2313 { (yyval
.assoc
) = right_assoc
; }
2314 /* Line 1380 of yacc.c */
2315 #line 2316 "../../src/parse-gram.c"
2319 /* Line 1380 of yacc.c */
2320 #line 424 "parse-gram.y"
2321 { (yyval
.assoc
) = non_assoc
; }
2322 /* Line 1380 of yacc.c */
2323 #line 2324 "../../src/parse-gram.c"
2327 /* Line 1380 of yacc.c */
2328 #line 425 "parse-gram.y"
2329 { (yyval
.assoc
) = precedence_assoc
; }
2330 /* Line 1380 of yacc.c */
2331 #line 2332 "../../src/parse-gram.c"
2335 /* Line 1380 of yacc.c */
2336 #line 429 "parse-gram.y"
2337 { current_type
= NULL
; }
2338 /* Line 1380 of yacc.c */
2339 #line 2340 "../../src/parse-gram.c"
2343 /* Line 1380 of yacc.c */
2344 #line 430 "parse-gram.y"
2345 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2346 /* Line 1380 of yacc.c */
2347 #line 2348 "../../src/parse-gram.c"
2351 /* Line 1380 of yacc.c */
2352 #line 436 "parse-gram.y"
2353 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2354 /* Line 1380 of yacc.c */
2355 #line 2356 "../../src/parse-gram.c"
2359 /* Line 1380 of yacc.c */
2360 #line 438 "parse-gram.y"
2361 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2362 /* Line 1380 of yacc.c */
2363 #line 2364 "../../src/parse-gram.c"
2367 /* Line 1380 of yacc.c */
2368 #line 442 "parse-gram.y"
2369 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2370 /* Line 1380 of yacc.c */
2371 #line 2372 "../../src/parse-gram.c"
2375 /* Line 1380 of yacc.c */
2376 #line 443 "parse-gram.y"
2377 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2378 /* Line 1380 of yacc.c */
2379 #line 2380 "../../src/parse-gram.c"
2383 /* Line 1380 of yacc.c */
2384 #line 449 "parse-gram.y"
2385 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2386 /* Line 1380 of yacc.c */
2387 #line 2388 "../../src/parse-gram.c"
2391 /* Line 1380 of yacc.c */
2392 #line 451 "parse-gram.y"
2393 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2394 /* Line 1380 of yacc.c */
2395 #line 2396 "../../src/parse-gram.c"
2399 /* Line 1380 of yacc.c */
2400 #line 455 "parse-gram.y"
2401 { (yyval
.list
) = (yyvsp
[0].list
); }
2402 /* Line 1380 of yacc.c */
2403 #line 2404 "../../src/parse-gram.c"
2407 /* Line 1380 of yacc.c */
2408 #line 456 "parse-gram.y"
2409 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2410 /* Line 1380 of yacc.c */
2411 #line 2412 "../../src/parse-gram.c"
2415 /* Line 1380 of yacc.c */
2416 #line 460 "parse-gram.y"
2417 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2418 /* Line 1380 of yacc.c */
2419 #line 2420 "../../src/parse-gram.c"
2423 /* Line 1380 of yacc.c */
2424 #line 461 "parse-gram.y"
2425 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2426 /* Line 1380 of yacc.c */
2427 #line 2428 "../../src/parse-gram.c"
2431 /* Line 1380 of yacc.c */
2432 #line 462 "parse-gram.y"
2433 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2434 /* Line 1380 of yacc.c */
2435 #line 2436 "../../src/parse-gram.c"
2439 /* Line 1380 of yacc.c */
2440 #line 463 "parse-gram.y"
2441 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2442 /* Line 1380 of yacc.c */
2443 #line 2444 "../../src/parse-gram.c"
2447 /* Line 1380 of yacc.c */
2448 #line 469 "parse-gram.y"
2450 current_type
= (yyvsp
[0].uniqstr
);
2453 /* Line 1380 of yacc.c */
2454 #line 2455 "../../src/parse-gram.c"
2458 /* Line 1380 of yacc.c */
2459 #line 474 "parse-gram.y"
2461 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2462 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2464 /* Line 1380 of yacc.c */
2465 #line 2466 "../../src/parse-gram.c"
2469 /* Line 1380 of yacc.c */
2470 #line 479 "parse-gram.y"
2472 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2473 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2474 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2476 /* Line 1380 of yacc.c */
2477 #line 2478 "../../src/parse-gram.c"
2481 /* Line 1380 of yacc.c */
2482 #line 485 "parse-gram.y"
2484 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2485 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2486 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2488 /* Line 1380 of yacc.c */
2489 #line 2490 "../../src/parse-gram.c"
2493 /* Line 1380 of yacc.c */
2494 #line 491 "parse-gram.y"
2496 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2497 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2498 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2499 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2501 /* Line 1380 of yacc.c */
2502 #line 2503 "../../src/parse-gram.c"
2506 /* Line 1380 of yacc.c */
2507 #line 521 "parse-gram.y"
2511 /* Line 1380 of yacc.c */
2512 #line 2513 "../../src/parse-gram.c"
2516 /* Line 1380 of yacc.c */
2517 #line 527 "parse-gram.y"
2518 { current_lhs
= (yyvsp
[0].symbol
); current_lhs_location
= (yylsp
[0]); }
2519 /* Line 1380 of yacc.c */
2520 #line 2521 "../../src/parse-gram.c"
2524 /* Line 1380 of yacc.c */
2525 #line 531 "parse-gram.y"
2526 { grammar_current_rule_end ((yylsp
[0])); }
2527 /* Line 1380 of yacc.c */
2528 #line 2529 "../../src/parse-gram.c"
2532 /* Line 1380 of yacc.c */
2533 #line 532 "parse-gram.y"
2534 { grammar_current_rule_end ((yylsp
[0])); }
2535 /* Line 1380 of yacc.c */
2536 #line 2537 "../../src/parse-gram.c"
2540 /* Line 1380 of yacc.c */
2541 #line 538 "parse-gram.y"
2542 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2543 /* Line 1380 of yacc.c */
2544 #line 2545 "../../src/parse-gram.c"
2548 /* Line 1380 of yacc.c */
2549 #line 540 "parse-gram.y"
2550 { grammar_current_rule_symbol_append ((yyvsp
[0].symbol
), (yylsp
[0])); }
2551 /* Line 1380 of yacc.c */
2552 #line 2553 "../../src/parse-gram.c"
2556 /* Line 1380 of yacc.c */
2557 #line 542 "parse-gram.y"
2558 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0])); }
2559 /* Line 1380 of yacc.c */
2560 #line 2561 "../../src/parse-gram.c"
2564 /* Line 1380 of yacc.c */
2565 #line 544 "parse-gram.y"
2566 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2567 /* Line 1380 of yacc.c */
2568 #line 2569 "../../src/parse-gram.c"
2572 /* Line 1380 of yacc.c */
2573 #line 546 "parse-gram.y"
2574 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2575 /* Line 1380 of yacc.c */
2576 #line 2577 "../../src/parse-gram.c"
2580 /* Line 1380 of yacc.c */
2581 #line 548 "parse-gram.y"
2582 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2583 /* Line 1380 of yacc.c */
2584 #line 2585 "../../src/parse-gram.c"
2588 /* Line 1380 of yacc.c */
2589 #line 558 "parse-gram.y"
2590 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2591 /* Line 1380 of yacc.c */
2592 #line 2593 "../../src/parse-gram.c"
2596 /* Line 1380 of yacc.c */
2597 #line 564 "parse-gram.y"
2601 /* Line 1380 of yacc.c */
2602 #line 2603 "../../src/parse-gram.c"
2606 /* Line 1380 of yacc.c */
2607 #line 577 "parse-gram.y"
2609 code_props plain_code
;
2610 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2611 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2612 code_props_translate_code (&plain_code
);
2613 gram_scanner_last_string_free ();
2614 (yyval
.chars
) = plain_code
.code
;
2616 /* Line 1380 of yacc.c */
2617 #line 2618 "../../src/parse-gram.c"
2621 /* Line 1380 of yacc.c */
2622 #line 597 "parse-gram.y"
2623 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2624 /* Line 1380 of yacc.c */
2625 #line 2626 "../../src/parse-gram.c"
2629 /* Line 1380 of yacc.c */
2630 #line 599 "parse-gram.y"
2632 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2633 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2634 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2636 /* Line 1380 of yacc.c */
2637 #line 2638 "../../src/parse-gram.c"
2641 /* Line 1380 of yacc.c */
2642 #line 607 "parse-gram.y"
2643 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2644 /* Line 1380 of yacc.c */
2645 #line 2646 "../../src/parse-gram.c"
2649 /* Line 1380 of yacc.c */
2650 #line 619 "parse-gram.y"
2652 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2653 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2655 /* Line 1380 of yacc.c */
2656 #line 2657 "../../src/parse-gram.c"
2660 /* Line 1380 of yacc.c */
2661 #line 628 "parse-gram.y"
2663 code_props plain_code
;
2664 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2665 code_props_translate_code (&plain_code
);
2666 gram_scanner_last_string_free ();
2667 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2668 code_scanner_last_string_free ();
2670 /* Line 1380 of yacc.c */
2671 #line 2672 "../../src/parse-gram.c"
2675 /* Line 1380 of yacc.c */
2676 #line 2677 "../../src/parse-gram.c"
2679 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2683 YY_STACK_PRINT (yyss
, yyssp
);
2688 /* Now `shift' the result of the reduction. Determine what state
2689 that goes to, based on the state we popped back to and the rule
2690 number reduced by. */
2694 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2695 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2696 yystate
= yytable
[yystate
];
2698 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2703 /*------------------------------------.
2704 | yyerrlab -- here on detecting error |
2705 `------------------------------------*/
2707 /* If not already recovering from an error, report this error. */
2711 #if ! YYERROR_VERBOSE
2712 yyerror (YY_("syntax error"));
2715 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yytoken
);
2716 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2718 YYSIZE_T yyalloc
= 2 * yysize
;
2719 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2720 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2721 if (yymsg
!= yymsgbuf
)
2722 YYSTACK_FREE (yymsg
);
2723 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2725 yymsg_alloc
= yyalloc
;
2729 yymsg_alloc
= sizeof yymsgbuf
;
2733 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2735 (void) yysyntax_error (yymsg
, yystate
, yytoken
);
2740 yyerror (YY_("syntax error"));
2742 goto yyexhaustedlab
;
2748 yyerror_range
[0] = yylloc
;
2750 if (yyerrstatus
== 3)
2752 /* If just tried and failed to reuse lookahead token after an
2753 error, discard it. */
2755 if (yychar
<= YYEOF
)
2757 /* Return failure if at end of input. */
2758 if (yychar
== YYEOF
)
2763 yydestruct ("Error: discarding",
2764 yytoken
, &yylval
, &yylloc
);
2769 /* Else will try to reuse lookahead token after shifting the error
2774 /*---------------------------------------------------.
2775 | yyerrorlab -- error raised explicitly by YYERROR. |
2776 `---------------------------------------------------*/
2779 /* Pacify compilers like GCC when the user code never invokes
2780 YYERROR and the label yyerrorlab therefore never appears in user
2782 if (/*CONSTCOND*/ 0)
2785 yyerror_range
[0] = yylsp
[1-yylen
];
2786 /* Do not reclaim the symbols of the rule which action triggered
2790 YY_STACK_PRINT (yyss
, yyssp
);
2795 /*-------------------------------------------------------------.
2796 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2797 `-------------------------------------------------------------*/
2799 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2803 yyn
= yypact
[yystate
];
2804 if (yyn
!= YYPACT_NINF
)
2807 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2815 /* Pop the current state because it cannot handle the error token. */
2819 yyerror_range
[0] = *yylsp
;
2820 yydestruct ("Error: popping",
2821 yystos
[yystate
], yyvsp
, yylsp
);
2824 YY_STACK_PRINT (yyss
, yyssp
);
2829 yyerror_range
[1] = yylloc
;
2830 /* Using YYLLOC is tempting, but would change the location of
2831 the lookahead. YYLOC is available though. */
2832 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2835 /* Shift the error token. */
2836 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2842 /*-------------------------------------.
2843 | yyacceptlab -- YYACCEPT comes here. |
2844 `-------------------------------------*/
2849 /*-----------------------------------.
2850 | yyabortlab -- YYABORT comes here. |
2851 `-----------------------------------*/
2856 #if !defined(yyoverflow) || YYERROR_VERBOSE
2857 /*-------------------------------------------------.
2858 | yyexhaustedlab -- memory exhaustion comes here. |
2859 `-------------------------------------------------*/
2861 yyerror (YY_("memory exhausted"));
2867 if (yychar
!= YYEMPTY
)
2868 yydestruct ("Cleanup: discarding lookahead",
2869 yytoken
, &yylval
, &yylloc
);
2870 /* Do not reclaim the symbols of the rule which action triggered
2871 this YYABORT or YYACCEPT. */
2873 YY_STACK_PRINT (yyss
, yyssp
);
2874 while (yyssp
!= yyss
)
2876 yydestruct ("Cleanup: popping",
2877 yystos
[*yyssp
], yyvsp
, yylsp
);
2882 YYSTACK_FREE (yyss
);
2885 if (yymsg
!= yymsgbuf
)
2886 YYSTACK_FREE (yymsg
);
2888 /* Make sure YYID is used. */
2889 return YYID (yyresult
);
2892 /* Line 1599 of yacc.c */
2893 #line 638 "parse-gram.y"
2897 /* Return the location of the left-hand side of a rule whose
2898 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2899 the right-hand side, and return an empty location equal to the end
2900 boundary of RHS[0] if the right-hand side is empty. */
2903 lloc_default (YYLTYPE
const *rhs
, int n
)
2908 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2909 The bug is fixed in 7.4.2m, but play it safe for now. */
2910 loc
.start
= rhs
[n
].end
;
2911 loc
.end
= rhs
[n
].end
;
2913 /* Ignore empty nonterminals the start of the the right-hand side.
2914 Do not bother to ignore them at the end of the right-hand side,
2915 since empty nonterminals have the same end as their predecessors. */
2916 for (i
= 1; i
<= n
; i
++)
2917 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2919 loc
.start
= rhs
[i
].start
;
2927 /* Add a lex-param or a parse-param (depending on TYPE) with
2928 declaration DECL and location LOC. */
2931 add_param (char const *type
, char *decl
, location loc
)
2933 static char const alphanum
[26 + 26 + 1 + 10] =
2934 "abcdefghijklmnopqrstuvwxyz"
2935 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2938 char const *name_start
= NULL
;
2941 /* Stop on last actual character. */
2942 for (p
= decl
; p
[1]; p
++)
2944 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2945 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2948 /* Strip the surrounding '{' and '}', and any blanks just inside
2950 while (*--p
== ' ' || *p
== '\t')
2953 while (*++decl
== ' ' || *decl
== '\t')
2957 complain_at (loc
, _("missing identifier in parameter declaration"));
2964 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2968 name
= xmalloc (name_len
+ 1);
2969 memcpy (name
, name_start
, name_len
);
2970 name
[name_len
] = '\0';
2971 muscle_pair_list_grow (type
, decl
, name
);
2975 gram_scanner_last_string_free ();
2980 version_check (location
const *loc
, char const *version
)
2982 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2984 complain_at (*loc
, "require bison %s, but have %s",
2985 version
, PACKAGE_VERSION
);
2991 gram_error (location
const *loc
, char const *msg
)
2993 complain_at (*loc
, "%s", msg
);
2997 token_name (int type
)
2999 return yytname
[YYTRANSLATE (type
)];
3010 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3011 return quotearg_style (escape_quoting_style
, buf
);