1 /* A Bison parser, made by GNU Bison 2.4.323-f8e7-dirty. */
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.323-f8e7-dirty"
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,
194 PERCENT_DEFAULT_PREC
= 273,
195 PERCENT_DEFINE
= 274,
196 PERCENT_DEFINES
= 275,
197 PERCENT_EXPECT
= 276,
198 PERCENT_EXPECT_RR
= 277,
200 PERCENT_FILE_PREFIX
= 279,
201 PERCENT_GLR_PARSER
= 280,
202 PERCENT_INITIAL_ACTION
= 281,
203 PERCENT_LANGUAGE
= 282,
204 PERCENT_LEX_PARAM
= 283,
205 PERCENT_NAME_PREFIX
= 284,
206 PERCENT_NO_DEFAULT_PREC
= 285,
207 PERCENT_NO_LINES
= 286,
208 PERCENT_NONDETERMINISTIC_PARSER
= 287,
209 PERCENT_OUTPUT
= 288,
210 PERCENT_PARSE_PARAM
= 289,
211 PERCENT_REQUIRE
= 290,
212 PERCENT_SKELETON
= 291,
214 PERCENT_TOKEN_TABLE
= 293,
215 PERCENT_VERBOSE
= 294,
223 PERCENT_PERCENT
= 302,
237 #define PERCENT_TOKEN 260
238 #define PERCENT_NTERM 261
239 #define PERCENT_TYPE 262
240 #define PERCENT_DESTRUCTOR 263
241 #define PERCENT_PRINTER 264
242 #define PERCENT_LEFT 265
243 #define PERCENT_RIGHT 266
244 #define PERCENT_NONASSOC 267
245 #define PERCENT_PRECEDENCE 268
246 #define PERCENT_PREC 269
247 #define PERCENT_DPREC 270
248 #define PERCENT_MERGE 271
249 #define PERCENT_CODE 272
250 #define PERCENT_DEFAULT_PREC 273
251 #define PERCENT_DEFINE 274
252 #define PERCENT_DEFINES 275
253 #define PERCENT_EXPECT 276
254 #define PERCENT_EXPECT_RR 277
255 #define PERCENT_FLAG 278
256 #define PERCENT_FILE_PREFIX 279
257 #define PERCENT_GLR_PARSER 280
258 #define PERCENT_INITIAL_ACTION 281
259 #define PERCENT_LANGUAGE 282
260 #define PERCENT_LEX_PARAM 283
261 #define PERCENT_NAME_PREFIX 284
262 #define PERCENT_NO_DEFAULT_PREC 285
263 #define PERCENT_NO_LINES 286
264 #define PERCENT_NONDETERMINISTIC_PARSER 287
265 #define PERCENT_OUTPUT 288
266 #define PERCENT_PARSE_PARAM 289
267 #define PERCENT_REQUIRE 290
268 #define PERCENT_SKELETON 291
269 #define PERCENT_START 292
270 #define PERCENT_TOKEN_TABLE 293
271 #define PERCENT_VERBOSE 294
272 #define PERCENT_YACC 295
273 #define BRACED_CODE 296
279 #define PERCENT_PERCENT 302
282 #define SEMICOLON 305
286 #define PERCENT_UNION 309
291 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
292 typedef union YYSTYPE
294 /* Line 224 of yacc.c */
295 #line 92 "parse-gram.y"
304 unsigned char character
;
307 /* Line 224 of yacc.c */
308 #line 309 "src/parse-gram.c"
310 # define YYSTYPE_IS_TRIVIAL 1
311 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
312 # define YYSTYPE_IS_DECLARED 1
315 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
316 typedef struct YYLTYPE
323 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
324 # define YYLTYPE_IS_DECLARED 1
325 # define YYLTYPE_IS_TRIVIAL 1
329 /* Copy the second part of user declarations. */
331 /* Line 266 of yacc.c */
332 #line 333 "src/parse-gram.c"
339 typedef YYTYPE_UINT8 yytype_uint8
;
341 typedef unsigned char yytype_uint8
;
345 typedef YYTYPE_INT8 yytype_int8
;
346 #elif (defined __STDC__ || defined __C99__FUNC__ \
347 || defined __cplusplus || defined _MSC_VER)
348 typedef signed char yytype_int8
;
350 typedef short int yytype_int8
;
354 typedef YYTYPE_UINT16 yytype_uint16
;
356 typedef unsigned short int yytype_uint16
;
360 typedef YYTYPE_INT16 yytype_int16
;
362 typedef short int yytype_int16
;
366 # ifdef __SIZE_TYPE__
367 # define YYSIZE_T __SIZE_TYPE__
368 # elif defined size_t
369 # define YYSIZE_T size_t
370 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
371 || defined __cplusplus || defined _MSC_VER)
372 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
373 # define YYSIZE_T size_t
375 # define YYSIZE_T unsigned int
379 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
384 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
385 # define YY_(msgid) dgettext ("bison-runtime", msgid)
389 # define YY_(msgid) msgid
393 /* Suppress unused-variable warnings by "using" E. */
394 #if ! defined lint || defined __GNUC__
395 # define YYUSE(e) ((void) (e))
397 # define YYUSE(e) /* empty */
400 /* Identity function, used to suppress warnings about constant conditions. */
404 #if (defined __STDC__ || defined __C99__FUNC__ \
405 || defined __cplusplus || defined _MSC_VER)
418 #if ! defined yyoverflow || YYERROR_VERBOSE
420 /* The parser invokes alloca or malloc; define the necessary symbols. */
422 # ifdef YYSTACK_USE_ALLOCA
423 # if YYSTACK_USE_ALLOCA
425 # define YYSTACK_ALLOC __builtin_alloca
426 # elif defined __BUILTIN_VA_ARG_INCR
427 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
429 # define YYSTACK_ALLOC __alloca
430 # elif defined _MSC_VER
431 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
432 # define alloca _alloca
434 # define YYSTACK_ALLOC alloca
435 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
436 || defined __cplusplus || defined _MSC_VER)
437 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
446 # ifdef YYSTACK_ALLOC
447 /* Pacify GCC's `empty if-body' warning. */
448 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
449 # ifndef YYSTACK_ALLOC_MAXIMUM
450 /* The OS might guarantee only one guard page at the bottom of the stack,
451 and a page size can be as small as 4096 bytes. So we cannot safely
452 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
453 to allow for a few compiler-allocated temporary stack slots. */
454 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
457 # define YYSTACK_ALLOC YYMALLOC
458 # define YYSTACK_FREE YYFREE
459 # ifndef YYSTACK_ALLOC_MAXIMUM
460 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
462 # if (defined __cplusplus && ! defined _STDLIB_H \
463 && ! ((defined YYMALLOC || defined malloc) \
464 && (defined YYFREE || defined free)))
465 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
471 # define YYMALLOC malloc
472 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
473 || defined __cplusplus || defined _MSC_VER)
474 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
479 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
480 || defined __cplusplus || defined _MSC_VER)
481 void free (void *); /* INFRINGES ON USER NAME SPACE */
485 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
488 #if (! defined yyoverflow \
489 && (! defined __cplusplus \
490 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
491 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
493 /* A type that is properly aligned for any stack member. */
496 yytype_int16 yyss_alloc
;
501 /* The size of the maximum gap between one aligned stack and the next. */
502 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
504 /* The size of an array large to enough to hold all stacks, each with
506 # define YYSTACK_BYTES(N) \
507 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
508 + 2 * YYSTACK_GAP_MAXIMUM)
510 /* Copy COUNT objects from FROM to TO. The source and destination do
513 # if defined __GNUC__ && 1 < __GNUC__
514 # define YYCOPY(To, From, Count) \
515 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
517 # define YYCOPY(To, From, Count) \
521 for (yyi = 0; yyi < (Count); yyi++) \
522 (To)[yyi] = (From)[yyi]; \
528 /* Relocate STACK from its old location to the new one. The
529 local variables YYSIZE and YYSTACKSIZE give the old and new number of
530 elements in the stack, and YYPTR gives the new location of the
531 stack. Advance YYPTR to a properly aligned location for the next
533 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
536 YYSIZE_T yynewbytes; \
537 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
538 Stack = &yyptr->Stack_alloc; \
539 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
540 yyptr += yynewbytes / sizeof (*yyptr); \
546 /* YYFINAL -- State number of the termination state. */
548 /* YYLAST -- Last index in YYTABLE. */
551 /* YYNTOKENS -- Number of terminals. */
553 /* YYNNTS -- Number of nonterminals. */
555 /* YYNRULES -- Number of rules. */
557 /* YYNSTATES -- Number of states. */
558 #define YYNSTATES 141
560 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
561 by yylex, with out-of-bounds checking. */
563 #define YYMAXUTOK 309
565 #define YYTRANSLATE(YYX) \
566 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
568 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
569 as returned by yylex, without out-of-bounds checking. */
570 static const yytype_uint8 yytranslate
[] =
572 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 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, 1, 2, 3, 4,
598 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
599 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
600 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
601 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
602 45, 46, 47, 48, 49, 50, 51, 52, 53, 54
606 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
607 static const yytype_uint16 yyrline
[] =
609 0, 201, 201, 209, 211, 215, 216, 226, 230, 235,
610 236, 241, 242, 243, 244, 245, 250, 259, 260, 261,
611 262, 263, 264, 265, 266, 267, 268, 269, 293, 294,
612 295, 296, 300, 301, 302, 306, 313, 320, 324, 328,
613 335, 350, 351, 355, 367, 367, 372, 372, 377, 388,
614 403, 404, 405, 406, 410, 411, 416, 418, 423, 424,
615 429, 431, 436, 437, 441, 442, 443, 444, 449, 454,
616 459, 465, 471, 482, 483, 492, 493, 499, 500, 501,
617 508, 508, 512, 513, 514, 519, 520, 522, 524, 526,
618 528, 540, 541, 546, 547, 556, 576, 578, 587, 592,
623 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
624 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
625 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
626 static const char *const yytname
[] =
628 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
629 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
630 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
631 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
632 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%expect\"",
633 "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"", "\"%glr-parser\"",
634 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
635 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
636 "\"%nondeterministic-parser\"", "\"%output\"", "\"%parse-param\"",
637 "\"%require\"", "\"%skeleton\"", "\"%start\"", "\"%token-table\"",
638 "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"",
639 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
640 "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"", "\"%union\"",
641 "$accept", "input", "prologue_declarations", "prologue_declaration",
642 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
643 "precedence_declaration", "precedence_declarator", "tag.opt",
644 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
645 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
646 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
647 "variable", "content.opt", "braceless", "id", "id_colon", "symbol",
648 "string_as_id", "epilogue.opt", 0
653 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
654 (internal) symbol number NUM (which must be that of a token). */
655 static const yytype_uint16 yytoknum
[] =
657 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
658 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
659 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
660 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
661 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
662 305, 306, 307, 308, 309
666 #define YYPACT_NINF -93
668 #define YYTABLE_NINF -103
670 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
672 static const yytype_int16 yypact
[] =
674 -93, 9, 100, -93, -93, -93, -50, 21, 32, -93,
675 -93, -93, -93, -39, -93, 1, 56, 73, 74, -93,
676 10, -93, 38, 79, 43, 27, -93, -93, -93, 37,
677 44, 83, 84, 22, -93, -93, -93, 26, -93, -93,
678 45, -93, -93, -93, -93, 40, -37, -37, 22, 0,
679 0, -93, 47, -93, -93, -93, 86, -93, -93, -93,
680 -93, 89, -93, -93, -93, -93, 92, -93, 94, -93,
681 -93, -93, -93, -93, -93, -93, -93, -93, 48, -93,
682 50, 11, -93, -93, -93, -93, 47, -93, 22, -93,
683 -93, -37, 66, -37, 22, -93, -93, -93, -93, 0,
684 -93, -93, 0, -93, -93, -93, -93, -93, -93, -93,
685 -93, 58, -93, -93, -93, -93, 22, -93, 98, -93,
686 111, -93, -93, -93, -93, 18, 141, -93, -93, -93,
687 -93, -93, 22, 99, 64, -93, -93, 141, -93, -93,
691 /* YYDEFACT[S] -- default reduction number in state S. Performed when
692 YYTABLE does not specify something else to do. Zero means the default
694 static const yytype_uint8 yydefact
[] =
696 3, 0, 0, 1, 46, 44, 0, 0, 0, 50,
697 51, 52, 53, 0, 37, 0, 9, 0, 0, 7,
698 0, 15, 0, 0, 0, 0, 38, 21, 22, 0,
699 0, 0, 0, 0, 28, 29, 30, 0, 6, 31,
700 41, 4, 5, 33, 32, 54, 0, 0, 0, 0,
701 0, 95, 0, 39, 92, 91, 93, 10, 11, 12,
702 13, 0, 16, 17, 18, 19, 0, 23, 0, 25,
703 26, 27, 101, 97, 96, 99, 34, 100, 0, 98,
704 0, 0, 75, 77, 80, 42, 0, 55, 0, 68,
705 73, 47, 69, 45, 48, 60, 65, 66, 67, 35,
706 62, 64, 36, 40, 94, 8, 14, 20, 24, 79,
707 78, 0, 76, 2, 85, 43, 49, 56, 58, 74,
708 70, 71, 61, 63, 103, 81, 82, 57, 59, 72,
709 85, 84, 0, 0, 0, 87, 86, 83, 88, 89,
713 /* YYPGOTO[NTERM-NUM]. */
714 static const yytype_int8 yypgoto
[] =
716 -93, -93, -93, -93, 114, -93, -93, -93, -93, -93,
717 -93, -93, -93, 25, -93, 93, -92, -17, 95, -93,
718 65, -93, -93, -93, 15, -93, -93, -26, 3, -93,
722 /* YYDEFGOTO[NTERM-NUM]. */
723 static const yytype_int8 yydefgoto
[] =
725 -1, 1, 2, 41, 80, 86, 43, 47, 46, 44,
726 45, 88, 116, 117, 94, 99, 100, 90, 91, 81,
727 82, 83, 114, 125, 126, 56, 105, 53, 75, 84,
731 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
732 positive, shift that token. If negative, reduce the rule which
733 number is the opposite. If zero, do what YYDEFACT says.
734 If YYTABLE_NINF, syntax error. */
735 static const yytype_int16 yytable
[] =
737 76, 48, 51, 72, 54, 73, 52, 123, 74, 3,
738 123, -102, 78, 60, 89, 95, 4, 5, 6, 7,
739 8, 9, 10, 11, 12, 72, 103, 78, 13, 14,
740 65, 4, 5, 6, 7, 8, 9, 10, 11, 12,
741 67, 26, 73, 13, 14, 74, 55, 121, 33, 92,
742 92, 96, 97, 98, 61, 118, 26, 79, 111, 57,
743 115, 122, 49, 33, 73, 40, 130, 74, 131, 72,
744 120, 66, 79, 50, 119, 129, 119, 58, 59, 62,
745 40, 68, 63, 118, 64, 69, 70, 71, 51, 104,
746 85, 87, 106, 136, 92, 107, 92, 108, 109, 138,
747 110, 124, 128, 139, 136, 4, 5, 6, 7, 8,
748 9, 10, 11, 12, 72, 140, 42, 13, 14, 15,
749 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
750 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
751 36, 127, 93, 102, 72, 137, 112, 37, 0, 38,
752 39, 0, 0, 0, 40, 132, 133, 134, 0, 0,
753 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
754 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
755 0, 0, 135, 73, 0, 0, 74
758 static const yytype_int16 yycheck
[] =
760 33, 51, 41, 3, 3, 42, 45, 99, 45, 0,
761 102, 0, 1, 3, 51, 48, 5, 6, 7, 8,
762 9, 10, 11, 12, 13, 3, 52, 1, 17, 18,
763 3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
764 3, 30, 42, 17, 18, 45, 45, 92, 37, 46,
765 47, 51, 52, 53, 44, 88, 30, 46, 47, 3,
766 86, 94, 41, 37, 42, 54, 48, 45, 50, 3,
767 4, 44, 46, 41, 91, 120, 93, 4, 4, 41,
768 54, 44, 3, 116, 41, 41, 3, 3, 41, 3,
769 45, 51, 3, 126, 91, 3, 93, 3, 50, 132,
770 50, 43, 4, 4, 137, 5, 6, 7, 8, 9,
771 10, 11, 12, 13, 3, 51, 2, 17, 18, 19,
772 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
773 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
774 40, 116, 47, 50, 3, 130, 81, 47, -1, 49,
775 50, -1, -1, -1, 54, 14, 15, 16, -1, -1,
776 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
777 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
778 -1, -1, 41, 42, -1, -1, 45
781 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
782 symbol of state STATE-NUM. */
783 static const yytype_uint8 yystos
[] =
785 0, 56, 57, 0, 5, 6, 7, 8, 9, 10,
786 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
787 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
788 34, 35, 36, 37, 38, 39, 40, 47, 49, 50,
789 54, 58, 59, 61, 64, 65, 63, 62, 51, 41,
790 41, 41, 45, 82, 3, 45, 80, 3, 4, 4,
791 3, 44, 41, 3, 41, 3, 44, 3, 44, 41,
792 3, 3, 3, 42, 45, 83, 85, 86, 1, 46,
793 59, 74, 75, 76, 84, 45, 60, 51, 66, 51,
794 72, 73, 83, 73, 69, 85, 51, 52, 53, 70,
795 71, 85, 70, 82, 3, 81, 3, 3, 3, 50,
796 50, 47, 75, 87, 77, 82, 67, 68, 85, 72,
797 4, 86, 85, 71, 43, 78, 79, 68, 4, 86,
798 48, 50, 14, 15, 16, 41, 85, 79, 85, 4,
802 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
803 static const yytype_uint8 yyr1
[] =
805 0, 55, 56, 57, 57, 58, 58, 58, 58, 58,
806 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
807 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
808 58, 58, 59, 59, 59, 59, 59, 59, 59, 59,
809 59, 60, 60, 59, 62, 61, 63, 61, 61, 64,
810 65, 65, 65, 65, 66, 66, 67, 67, 68, 68,
811 69, 69, 70, 70, 71, 71, 71, 71, 72, 72,
812 72, 72, 72, 73, 73, 74, 74, 75, 75, 75,
813 77, 76, 78, 78, 78, 79, 79, 79, 79, 79,
814 79, 80, 80, 81, 81, 82, 83, 83, 84, 85,
818 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
819 static const yytype_uint8 yyr2
[] =
821 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
822 2, 2, 2, 2, 3, 1, 2, 2, 2, 2,
823 3, 1, 1, 2, 3, 2, 2, 2, 1, 1,
824 1, 1, 1, 1, 2, 3, 3, 1, 1, 2,
825 3, 0, 1, 3, 0, 3, 0, 3, 3, 3,
826 1, 1, 1, 1, 0, 1, 1, 2, 1, 2,
827 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
828 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
829 0, 3, 1, 3, 2, 0, 2, 2, 3, 3,
830 3, 1, 1, 0, 1, 1, 1, 1, 1, 1,
835 #define yyerrok (yyerrstatus = 0)
836 #define yyclearin (yychar = YYEMPTY)
840 #define YYACCEPT goto yyacceptlab
841 #define YYABORT goto yyabortlab
842 #define YYERROR goto yyerrorlab
845 /* Like YYERROR except do call yyerror. This remains here temporarily
846 to ease the transition to the new meaning of YYERROR, for GCC.
847 Once GCC version 2 has supplanted version 1, this can go. */
849 #define YYFAIL goto yyerrlab
851 #define YYRECOVERING() (!!yyerrstatus)
853 #define YYBACKUP(Token, Value) \
855 if (yychar == YYEMPTY && yylen == 1) \
859 yytoken = YYTRANSLATE (yychar); \
865 yyerror (YY_("syntax error: cannot back up")); \
872 #define YYERRCODE 256
875 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
876 If N is 0, then set CURRENT to the empty location which ends
877 the previous symbol: RHS[0] (always defined). */
879 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
880 #ifndef YYLLOC_DEFAULT
881 # define YYLLOC_DEFAULT(Current, Rhs, N) \
885 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
886 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
887 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
888 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
892 (Current).first_line = (Current).last_line = \
893 YYRHSLOC (Rhs, 0).last_line; \
894 (Current).first_column = (Current).last_column = \
895 YYRHSLOC (Rhs, 0).last_column; \
901 /* YY_LOCATION_PRINT -- Print the location on the stream.
902 This macro was not mandated originally: define only if we know
903 we won't break user code: when these are the locations we know. */
905 #ifndef YY_LOCATION_PRINT
906 # if YYLTYPE_IS_TRIVIAL
907 # define YY_LOCATION_PRINT(File, Loc) \
908 fprintf (File, "%d.%d-%d.%d", \
909 (Loc).first_line, (Loc).first_column, \
910 (Loc).last_line, (Loc).last_column)
912 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
917 /* YYLEX -- calling `yylex' with the right arguments. */
920 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
922 # define YYLEX yylex (&yylval, &yylloc)
925 /* Enable debugging if requested. */
929 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
930 # define YYFPRINTF fprintf
933 # define YYDPRINTF(Args) \
939 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
943 YYFPRINTF (stderr, "%s ", Title); \
944 yy_symbol_print (stderr, \
945 Type, Value, Location); \
946 YYFPRINTF (stderr, "\n"); \
951 /*--------------------------------.
952 | Print this symbol on YYOUTPUT. |
953 `--------------------------------*/
956 #if (defined __STDC__ || defined __C99__FUNC__ \
957 || defined __cplusplus || defined _MSC_VER)
959 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
962 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
965 YYSTYPE
const * const yyvaluep
;
966 YYLTYPE
const * const yylocationp
;
973 if (yytype
< YYNTOKENS
)
974 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
982 /* Line 647 of yacc.c */
983 #line 178 "parse-gram.y"
984 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
985 /* Line 647 of yacc.c */
986 #line 987 "src/parse-gram.c"
991 /* Line 647 of yacc.c */
992 #line 190 "parse-gram.y"
993 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
994 /* Line 647 of yacc.c */
995 #line 996 "src/parse-gram.c"
998 case 23: // "%<flag>"
1000 /* Line 647 of yacc.c */
1001 #line 186 "parse-gram.y"
1002 { fprintf (stderr
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1003 /* Line 647 of yacc.c */
1004 #line 1005 "src/parse-gram.c"
1009 /* Line 647 of yacc.c */
1010 #line 180 "parse-gram.y"
1011 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1012 /* Line 647 of yacc.c */
1013 #line 1014 "src/parse-gram.c"
1018 /* Line 647 of yacc.c */
1019 #line 172 "parse-gram.y"
1020 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
1021 /* Line 647 of yacc.c */
1022 #line 1023 "src/parse-gram.c"
1025 case 43: // "epilogue"
1027 /* Line 647 of yacc.c */
1028 #line 180 "parse-gram.y"
1029 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1030 /* Line 647 of yacc.c */
1031 #line 1032 "src/parse-gram.c"
1034 case 45: // "identifier"
1036 /* Line 647 of yacc.c */
1037 #line 184 "parse-gram.y"
1038 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1039 /* Line 647 of yacc.c */
1040 #line 1041 "src/parse-gram.c"
1043 case 46: // "identifier:"
1045 /* Line 647 of yacc.c */
1046 #line 185 "parse-gram.y"
1047 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
1048 /* Line 647 of yacc.c */
1049 #line 1050 "src/parse-gram.c"
1052 case 49: // "%{...%}"
1054 /* Line 647 of yacc.c */
1055 #line 180 "parse-gram.y"
1056 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1057 /* Line 647 of yacc.c */
1058 #line 1059 "src/parse-gram.c"
1063 /* Line 647 of yacc.c */
1064 #line 187 "parse-gram.y"
1065 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1066 /* Line 647 of yacc.c */
1067 #line 1068 "src/parse-gram.c"
1070 case 80: // variable
1072 /* Line 647 of yacc.c */
1073 #line 184 "parse-gram.y"
1074 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1075 /* Line 647 of yacc.c */
1076 #line 1077 "src/parse-gram.c"
1079 case 81: // content.opt
1081 /* Line 647 of yacc.c */
1082 #line 180 "parse-gram.y"
1083 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1084 /* Line 647 of yacc.c */
1085 #line 1086 "src/parse-gram.c"
1088 case 82: // braceless
1090 /* Line 647 of yacc.c */
1091 #line 180 "parse-gram.y"
1092 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1093 /* Line 647 of yacc.c */
1094 #line 1095 "src/parse-gram.c"
1099 /* Line 647 of yacc.c */
1100 #line 193 "parse-gram.y"
1101 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1102 /* Line 647 of yacc.c */
1103 #line 1104 "src/parse-gram.c"
1106 case 84: // id_colon
1108 /* Line 647 of yacc.c */
1109 #line 194 "parse-gram.y"
1110 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1111 /* Line 647 of yacc.c */
1112 #line 1113 "src/parse-gram.c"
1117 /* Line 647 of yacc.c */
1118 #line 193 "parse-gram.y"
1119 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1120 /* Line 647 of yacc.c */
1121 #line 1122 "src/parse-gram.c"
1124 case 86: // string_as_id
1126 /* Line 647 of yacc.c */
1127 #line 193 "parse-gram.y"
1128 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1129 /* Line 647 of yacc.c */
1130 #line 1131 "src/parse-gram.c"
1139 /*--------------------------------.
1140 | Print this symbol on YYOUTPUT. |
1141 `--------------------------------*/
1143 #if (defined __STDC__ || defined __C99__FUNC__ \
1144 || defined __cplusplus || defined _MSC_VER)
1146 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1149 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1152 YYSTYPE
const * const yyvaluep
;
1153 YYLTYPE
const * const yylocationp
;
1156 if (yytype
< YYNTOKENS
)
1157 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1159 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1161 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1162 YYFPRINTF (yyoutput
, ": ");
1163 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1164 YYFPRINTF (yyoutput
, ")");
1167 /*------------------------------------------------------------------.
1168 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1170 `------------------------------------------------------------------*/
1172 #if (defined __STDC__ || defined __C99__FUNC__ \
1173 || defined __cplusplus || defined _MSC_VER)
1175 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1178 yy_stack_print (yybottom
, yytop
)
1179 yytype_int16
*yybottom
;
1180 yytype_int16
*yytop
;
1183 YYFPRINTF (stderr
, "Stack now");
1184 for (; yybottom
<= yytop
; yybottom
++)
1186 int yybot
= *yybottom
;
1187 YYFPRINTF (stderr
, " %d", yybot
);
1189 YYFPRINTF (stderr
, "\n");
1192 # define YY_STACK_PRINT(Bottom, Top) \
1195 yy_stack_print ((Bottom), (Top)); \
1199 /*------------------------------------------------.
1200 | Report that the YYRULE is going to be reduced. |
1201 `------------------------------------------------*/
1203 #if (defined __STDC__ || defined __C99__FUNC__ \
1204 || defined __cplusplus || defined _MSC_VER)
1206 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1209 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1210 yytype_int16
*yyssp
;
1216 unsigned long int yylno
= yyrline
[yyrule
];
1217 int yynrhs
= yyr2
[yyrule
];
1219 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1221 /* The symbols being reduced. */
1222 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1224 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1225 yy_symbol_print (stderr
,
1226 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1227 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1228 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1229 YYFPRINTF (stderr
, "\n");
1233 # define YY_REDUCE_PRINT(Rule) \
1236 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1239 /* Nonzero means print parse trace. It is left uninitialized so that
1240 multiple parsers can coexist. */
1242 #else /* !YYDEBUG */
1243 # define YYDPRINTF(Args)
1244 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1245 # define YY_STACK_PRINT(Bottom, Top)
1246 # define YY_REDUCE_PRINT(Rule)
1247 #endif /* !YYDEBUG */
1250 /* YYINITDEPTH -- initial size of the parser's stacks. */
1252 # define YYINITDEPTH 200
1255 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1256 if the built-in stack extension method is used).
1258 Do not make this value too large; the results are undefined if
1259 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1260 evaluated with infinite-precision integer arithmetic. */
1263 # define YYMAXDEPTH 10000
1271 # if defined __GLIBC__ && defined _STRING_H
1272 # define yystrlen strlen
1274 /* Return the length of YYSTR. */
1275 #if (defined __STDC__ || defined __C99__FUNC__ \
1276 || defined __cplusplus || defined _MSC_VER)
1278 yystrlen (const char *yystr
)
1286 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1294 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1295 # define yystpcpy stpcpy
1297 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1299 #if (defined __STDC__ || defined __C99__FUNC__ \
1300 || defined __cplusplus || defined _MSC_VER)
1302 yystpcpy (char *yydest
, const char *yysrc
)
1305 yystpcpy (yydest
, yysrc
)
1311 const char *yys
= yysrc
;
1313 while ((*yyd
++ = *yys
++) != '\0')
1322 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1323 quotes and backslashes, so that it's suitable for yyerror. The
1324 heuristic is that double-quoting is unnecessary unless the string
1325 contains an apostrophe, a comma, or backslash (other than
1326 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1327 null, do not copy; instead, return the length of what the result
1330 yytnamerr (char *yyres
, const char *yystr
)
1335 char const *yyp
= yystr
;
1342 goto do_not_strip_quotes
;
1346 goto do_not_strip_quotes
;
1359 do_not_strip_quotes
: ;
1363 return yystrlen (yystr
);
1365 return yystpcpy (yyres
, yystr
) - yyres
;
1369 /* Copy into YYRESULT an error message about the unexpected token
1370 YYTOKEN while in state YYSTATE. Return the number of bytes copied,
1371 including the terminating null byte. If YYRESULT is null, do not
1372 copy anything; just return the number of bytes that would be
1373 copied. As a special case, return 0 if an ordinary "syntax error"
1374 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1375 size calculation. */
1377 yysyntax_error (char *yyresult
, int yystate
, int yytoken
)
1379 int yyn
= yypact
[yystate
];
1381 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1385 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1386 YYSIZE_T yysize
= yysize0
;
1388 int yysize_overflow
= 0;
1389 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1390 /* Internationalized format string. */
1391 const char *yyformat
= 0;
1392 /* Arguments of yyformat. */
1393 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1395 /* Start YYX at -YYN if negative to avoid negative indexes in
1397 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1399 /* Stay within bounds of both yycheck and yytname. */
1400 int yychecklim
= YYLAST
- yyn
+ 1;
1401 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1402 /* Number of reported tokens (one for the "unexpected", one per
1407 yyarg
[yycount
++] = yytname
[yytoken
];
1409 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1410 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1412 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1418 yyarg
[yycount
++] = yytname
[yyx
];
1419 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1420 yysize_overflow
|= (yysize1
< yysize
);
1426 #define YYCASE_(N, S) \
1430 YYCASE_(1, YY_("syntax error, unexpected %s"));
1431 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1432 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1433 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1434 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1438 yysize1
= yysize
+ yystrlen (yyformat
);
1439 yysize_overflow
|= (yysize1
< yysize
);
1442 if (yysize_overflow
)
1443 return YYSIZE_MAXIMUM
;
1447 /* Avoid sprintf, as that infringes on the user's name space.
1448 Don't have undefined behavior even if the translation
1449 produced a string with the wrong number of "%s"s. */
1450 char *yyp
= yyresult
;
1452 while ((*yyp
= *yyformat
) != '\0')
1453 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1455 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1467 #endif /* YYERROR_VERBOSE */
1470 /*-----------------------------------------------.
1471 | Release the memory associated to this symbol. |
1472 `-----------------------------------------------*/
1475 #if (defined __STDC__ || defined __C99__FUNC__ \
1476 || defined __cplusplus || defined _MSC_VER)
1478 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1481 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1485 YYLTYPE
*yylocationp
;
1489 YYUSE (yylocationp
);
1493 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1502 /* Prevent warnings from -Wmissing-prototypes. */
1503 #ifdef YYPARSE_PARAM
1504 #if (defined __STDC__ || defined __C99__FUNC__ \
1505 || defined __cplusplus || defined _MSC_VER)
1506 int yyparse (void *YYPARSE_PARAM
);
1510 #else /* ! YYPARSE_PARAM */
1511 #if (defined __STDC__ || defined __C99__FUNC__ \
1512 || defined __cplusplus || defined _MSC_VER)
1517 #endif /* ! YYPARSE_PARAM */
1523 /*-------------------------.
1524 | yyparse or yypush_parse. |
1525 `-------------------------*/
1527 #ifdef YYPARSE_PARAM
1528 #if (defined __STDC__ || defined __C99__FUNC__ \
1529 || defined __cplusplus || defined _MSC_VER)
1531 yyparse (void *YYPARSE_PARAM
)
1534 yyparse (YYPARSE_PARAM
)
1535 void *YYPARSE_PARAM
;
1537 #else /* ! YYPARSE_PARAM */
1538 #if (defined __STDC__ || defined __C99__FUNC__ \
1539 || defined __cplusplus || defined _MSC_VER)
1549 /* The lookahead symbol. */
1552 /* The semantic value of the lookahead symbol. */
1555 /* Location data for the lookahead symbol. */
1558 /* Number of syntax errors so far. */
1562 /* Number of tokens to shift before error messages enabled. */
1565 /* The stacks and their tools:
1566 `yyss': related to states.
1567 `yyvs': related to semantic values.
1568 `yyls': related to locations.
1570 Refer to the stacks thru separate pointers, to allow yyoverflow
1571 to reallocate them elsewhere. */
1573 /* The state stack. */
1574 yytype_int16 yyssa
[YYINITDEPTH
];
1576 yytype_int16
*yyssp
;
1578 /* The semantic value stack. */
1579 YYSTYPE yyvsa
[YYINITDEPTH
];
1583 /* The location stack. */
1584 YYLTYPE yylsa
[YYINITDEPTH
];
1588 /* The locations where the error started and ended. */
1589 YYLTYPE yyerror_range
[2];
1591 YYSIZE_T yystacksize
;
1595 /* Lookahead token as an internal (translated) token number. */
1597 /* The variables used to return semantic value and location from the
1603 /* Buffer for error messages, and its allocated size. */
1605 char *yymsg
= yymsgbuf
;
1606 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1609 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1611 /* The number of symbols on the RHS of the reduced rule.
1612 Keep to zero when no symbol should be popped. */
1619 yystacksize
= YYINITDEPTH
;
1621 YYDPRINTF ((stderr
, "Starting parse\n"));
1626 yychar
= YYEMPTY
; /* Cause a token to be read. */
1628 /* Initialize stack pointers.
1629 Waste one element of value and location stack
1630 so that they stay on the same level as the state stack.
1631 The wasted elements are never initialized. */
1636 #if YYLTYPE_IS_TRIVIAL
1637 /* Initialize the default location before parsing starts. */
1638 yylloc
.first_line
= yylloc
.last_line
= 1;
1639 yylloc
.first_column
= yylloc
.last_column
= 1;
1642 /* User initialization code. */
1643 /* Line 1173 of yacc.c */
1644 #line 84 "parse-gram.y"
1646 /* Bison's grammar can initial empty locations, hence a default
1647 location is needed. */
1648 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1649 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1651 /* Line 1173 of yacc.c */
1652 #line 1653 "src/parse-gram.c"
1657 /*------------------------------------------------------------.
1658 | yynewstate -- Push a new state, which is found in yystate. |
1659 `------------------------------------------------------------*/
1661 /* In all cases, when you get here, the value and location stacks
1662 have just been pushed. So pushing a state here evens the stacks. */
1668 if (yyss
+ yystacksize
- 1 <= yyssp
)
1670 /* Get the current used size of the three stacks, in elements. */
1671 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1675 /* Give user a chance to reallocate the stack. Use copies of
1676 these so that the &'s don't force the real ones into
1678 YYSTYPE
*yyvs1
= yyvs
;
1679 yytype_int16
*yyss1
= yyss
;
1680 YYLTYPE
*yyls1
= yyls
;
1682 /* Each stack pointer address is followed by the size of the
1683 data in use in that stack, in bytes. This used to be a
1684 conditional around just the two extra args, but that might
1685 be undefined if yyoverflow is a macro. */
1686 yyoverflow (YY_("memory exhausted"),
1687 &yyss1
, yysize
* sizeof (*yyssp
),
1688 &yyvs1
, yysize
* sizeof (*yyvsp
),
1689 &yyls1
, yysize
* sizeof (*yylsp
),
1696 #else /* no yyoverflow */
1697 # ifndef YYSTACK_RELOCATE
1698 goto yyexhaustedlab
;
1700 /* Extend the stack our own way. */
1701 if (YYMAXDEPTH
<= yystacksize
)
1702 goto yyexhaustedlab
;
1704 if (YYMAXDEPTH
< yystacksize
)
1705 yystacksize
= YYMAXDEPTH
;
1708 yytype_int16
*yyss1
= yyss
;
1709 union yyalloc
*yyptr
=
1710 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1712 goto yyexhaustedlab
;
1713 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1714 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1715 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1716 # undef YYSTACK_RELOCATE
1718 YYSTACK_FREE (yyss1
);
1721 #endif /* no yyoverflow */
1723 yyssp
= yyss
+ yysize
- 1;
1724 yyvsp
= yyvs
+ yysize
- 1;
1725 yylsp
= yyls
+ yysize
- 1;
1727 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1728 (unsigned long int) yystacksize
));
1730 if (yyss
+ yystacksize
- 1 <= yyssp
)
1734 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1736 if (yystate
== YYFINAL
)
1746 /* Do appropriate processing given the current state. Read a
1747 lookahead token if we need one and don't already have one. */
1749 /* First try to decide what to do without reference to lookahead token. */
1750 yyn
= yypact
[yystate
];
1751 if (yyn
== YYPACT_NINF
)
1754 /* Not known => get a lookahead token if don't already have one. */
1756 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1757 if (yychar
== YYEMPTY
)
1759 YYDPRINTF ((stderr
, "Reading a token: "));
1763 if (yychar
<= YYEOF
)
1765 yychar
= yytoken
= YYEOF
;
1766 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1770 yytoken
= YYTRANSLATE (yychar
);
1771 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1774 /* If the proper action on seeing token YYTOKEN is to reduce or to
1775 detect an error, take that action. */
1777 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1782 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1788 /* Count tokens shifted since error; after three, turn off error
1793 /* Shift the lookahead token. */
1794 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1796 /* Discard the shifted token. */
1805 /*-----------------------------------------------------------.
1806 | yydefault -- do the default action for the current state. |
1807 `-----------------------------------------------------------*/
1809 yyn
= yydefact
[yystate
];
1815 /*-----------------------------.
1816 | yyreduce -- Do a reduction. |
1817 `-----------------------------*/
1819 /* yyn is the number of a rule to reduce with. */
1822 /* If YYLEN is nonzero, implement the default value of the action:
1825 Otherwise, the following line sets YYVAL to garbage.
1826 This behavior is undocumented and Bison
1827 users should not rely upon it. Assigning to YYVAL
1828 unconditionally makes the parser a bit smaller, and it avoids a
1829 GCC warning that YYVAL may be used uninitialized. */
1830 yyval
= yyvsp
[1-yylen
];
1832 /* Default location. */
1833 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1834 YY_REDUCE_PRINT (yyn
);
1838 /* Line 1380 of yacc.c */
1839 #line 217 "parse-gram.y"
1841 code_props plain_code
;
1842 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
1843 code_props_translate_code (&plain_code
);
1844 gram_scanner_last_string_free ();
1845 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1846 plain_code
.code
, (yylsp
[0]));
1847 code_scanner_last_string_free ();
1849 /* Line 1380 of yacc.c */
1850 #line 1851 "src/parse-gram.c"
1854 /* Line 1380 of yacc.c */
1855 #line 227 "parse-gram.y"
1857 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
1859 /* Line 1380 of yacc.c */
1860 #line 1861 "src/parse-gram.c"
1864 /* Line 1380 of yacc.c */
1865 #line 231 "parse-gram.y"
1867 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
1868 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
1870 /* Line 1380 of yacc.c */
1871 #line 1872 "src/parse-gram.c"
1875 /* Line 1380 of yacc.c */
1876 #line 235 "parse-gram.y"
1877 { defines_flag
= true; }
1878 /* Line 1380 of yacc.c */
1879 #line 1880 "src/parse-gram.c"
1883 /* Line 1380 of yacc.c */
1884 #line 237 "parse-gram.y"
1886 defines_flag
= true;
1887 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
1889 /* Line 1380 of yacc.c */
1890 #line 1891 "src/parse-gram.c"
1894 /* Line 1380 of yacc.c */
1895 #line 241 "parse-gram.y"
1896 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
1897 /* Line 1380 of yacc.c */
1898 #line 1899 "src/parse-gram.c"
1902 /* Line 1380 of yacc.c */
1903 #line 242 "parse-gram.y"
1904 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
1905 /* Line 1380 of yacc.c */
1906 #line 1907 "src/parse-gram.c"
1910 /* Line 1380 of yacc.c */
1911 #line 243 "parse-gram.y"
1912 { spec_file_prefix
= (yyvsp
[0].chars
); }
1913 /* Line 1380 of yacc.c */
1914 #line 1915 "src/parse-gram.c"
1918 /* Line 1380 of yacc.c */
1919 #line 244 "parse-gram.y"
1920 { spec_file_prefix
= (yyvsp
[0].chars
); }
1921 /* Line 1380 of yacc.c */
1922 #line 1923 "src/parse-gram.c"
1926 /* Line 1380 of yacc.c */
1927 #line 246 "parse-gram.y"
1929 nondeterministic_parser
= true;
1932 /* Line 1380 of yacc.c */
1933 #line 1934 "src/parse-gram.c"
1937 /* Line 1380 of yacc.c */
1938 #line 251 "parse-gram.y"
1941 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
1942 code_props_translate_code (&action
);
1943 gram_scanner_last_string_free ();
1944 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
1945 code_scanner_last_string_free ();
1947 /* Line 1380 of yacc.c */
1948 #line 1949 "src/parse-gram.c"
1952 /* Line 1380 of yacc.c */
1953 #line 259 "parse-gram.y"
1954 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
1955 /* Line 1380 of yacc.c */
1956 #line 1957 "src/parse-gram.c"
1960 /* Line 1380 of yacc.c */
1961 #line 260 "parse-gram.y"
1962 { add_param ("lex_param", (yyvsp
[0].code
), (yylsp
[0])); }
1963 /* Line 1380 of yacc.c */
1964 #line 1965 "src/parse-gram.c"
1968 /* Line 1380 of yacc.c */
1969 #line 261 "parse-gram.y"
1970 { spec_name_prefix
= (yyvsp
[0].chars
); }
1971 /* Line 1380 of yacc.c */
1972 #line 1973 "src/parse-gram.c"
1976 /* Line 1380 of yacc.c */
1977 #line 262 "parse-gram.y"
1978 { spec_name_prefix
= (yyvsp
[0].chars
); }
1979 /* Line 1380 of yacc.c */
1980 #line 1981 "src/parse-gram.c"
1984 /* Line 1380 of yacc.c */
1985 #line 263 "parse-gram.y"
1986 { no_lines_flag
= true; }
1987 /* Line 1380 of yacc.c */
1988 #line 1989 "src/parse-gram.c"
1992 /* Line 1380 of yacc.c */
1993 #line 264 "parse-gram.y"
1994 { nondeterministic_parser
= true; }
1995 /* Line 1380 of yacc.c */
1996 #line 1997 "src/parse-gram.c"
2000 /* Line 1380 of yacc.c */
2001 #line 265 "parse-gram.y"
2002 { spec_outfile
= (yyvsp
[0].chars
); }
2003 /* Line 1380 of yacc.c */
2004 #line 2005 "src/parse-gram.c"
2008 /* Line 1380 of yacc.c */
2009 #line 266 "parse-gram.y"
2010 { spec_outfile
= (yyvsp
[0].chars
); }
2011 /* Line 1380 of yacc.c */
2012 #line 2013 "src/parse-gram.c"
2016 /* Line 1380 of yacc.c */
2017 #line 267 "parse-gram.y"
2018 { add_param ("parse_param", (yyvsp
[0].code
), (yylsp
[0])); }
2019 /* Line 1380 of yacc.c */
2020 #line 2021 "src/parse-gram.c"
2024 /* Line 1380 of yacc.c */
2025 #line 268 "parse-gram.y"
2026 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2027 /* Line 1380 of yacc.c */
2028 #line 2029 "src/parse-gram.c"
2032 /* Line 1380 of yacc.c */
2033 #line 270 "parse-gram.y"
2035 char const *skeleton_user
= (yyvsp
[0].chars
);
2036 if (strchr (skeleton_user
, '/'))
2038 size_t dir_length
= strlen (current_file
);
2039 char *skeleton_build
;
2040 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2042 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2045 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2048 strncpy (skeleton_build
, current_file
, dir_length
);
2049 skeleton_build
[dir_length
++] = '/';
2051 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2052 skeleton_user
= uniqstr_new (skeleton_build
);
2053 free (skeleton_build
);
2055 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2057 /* Line 1380 of yacc.c */
2058 #line 2059 "src/parse-gram.c"
2062 /* Line 1380 of yacc.c */
2063 #line 293 "parse-gram.y"
2064 { token_table_flag
= true; }
2065 /* Line 1380 of yacc.c */
2066 #line 2067 "src/parse-gram.c"
2070 /* Line 1380 of yacc.c */
2071 #line 294 "parse-gram.y"
2072 { report_flag
|= report_states
; }
2073 /* Line 1380 of yacc.c */
2074 #line 2075 "src/parse-gram.c"
2078 /* Line 1380 of yacc.c */
2079 #line 295 "parse-gram.y"
2080 { yacc_flag
= true; }
2081 /* Line 1380 of yacc.c */
2082 #line 2083 "src/parse-gram.c"
2086 /* Line 1380 of yacc.c */
2087 #line 303 "parse-gram.y"
2089 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2091 /* Line 1380 of yacc.c */
2092 #line 2093 "src/parse-gram.c"
2096 /* Line 1380 of yacc.c */
2097 #line 307 "parse-gram.y"
2100 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2101 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2102 symbol_list_free ((yyvsp
[0].list
));
2104 /* Line 1380 of yacc.c */
2105 #line 2106 "src/parse-gram.c"
2109 /* Line 1380 of yacc.c */
2110 #line 314 "parse-gram.y"
2113 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2114 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2115 symbol_list_free ((yyvsp
[0].list
));
2117 /* Line 1380 of yacc.c */
2118 #line 2119 "src/parse-gram.c"
2122 /* Line 1380 of yacc.c */
2123 #line 321 "parse-gram.y"
2125 default_prec
= true;
2127 /* Line 1380 of yacc.c */
2128 #line 2129 "src/parse-gram.c"
2132 /* Line 1380 of yacc.c */
2133 #line 325 "parse-gram.y"
2135 default_prec
= false;
2137 /* Line 1380 of yacc.c */
2138 #line 2139 "src/parse-gram.c"
2142 /* Line 1380 of yacc.c */
2143 #line 329 "parse-gram.y"
2145 /* Do not invoke muscle_percent_code_grow here since it invokes
2146 muscle_user_name_list_grow. */
2147 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2148 code_scanner_last_string_free ();
2150 /* Line 1380 of yacc.c */
2151 #line 2152 "src/parse-gram.c"
2155 /* Line 1380 of yacc.c */
2156 #line 336 "parse-gram.y"
2158 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2159 code_scanner_last_string_free ();
2161 /* Line 1380 of yacc.c */
2162 #line 2163 "src/parse-gram.c"
2166 /* Line 1380 of yacc.c */
2167 #line 350 "parse-gram.y"
2169 /* Line 1380 of yacc.c */
2170 #line 2171 "src/parse-gram.c"
2174 /* Line 1380 of yacc.c */
2175 #line 351 "parse-gram.y"
2176 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2177 /* Line 1380 of yacc.c */
2178 #line 2179 "src/parse-gram.c"
2182 /* Line 1380 of yacc.c */
2183 #line 356 "parse-gram.y"
2186 muscle_code_grow ("stype", (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 367 "parse-gram.y"
2196 { current_class
= nterm_sym
; }
2197 /* Line 1380 of yacc.c */
2198 #line 2199 "src/parse-gram.c"
2202 /* Line 1380 of yacc.c */
2203 #line 368 "parse-gram.y"
2205 current_class
= unknown_sym
;
2206 current_type
= NULL
;
2208 /* Line 1380 of yacc.c */
2209 #line 2210 "src/parse-gram.c"
2213 /* Line 1380 of yacc.c */
2214 #line 372 "parse-gram.y"
2215 { current_class
= token_sym
; }
2216 /* Line 1380 of yacc.c */
2217 #line 2218 "src/parse-gram.c"
2221 /* Line 1380 of yacc.c */
2222 #line 373 "parse-gram.y"
2224 current_class
= unknown_sym
;
2225 current_type
= NULL
;
2227 /* Line 1380 of yacc.c */
2228 #line 2229 "src/parse-gram.c"
2232 /* Line 1380 of yacc.c */
2233 #line 378 "parse-gram.y"
2237 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2238 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2239 symbol_list_free ((yyvsp
[0].list
));
2241 /* Line 1380 of yacc.c */
2242 #line 2243 "src/parse-gram.c"
2246 /* Line 1380 of yacc.c */
2247 #line 389 "parse-gram.y"
2251 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2253 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2254 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2256 symbol_list_free ((yyvsp
[0].list
));
2257 current_type
= NULL
;
2259 /* Line 1380 of yacc.c */
2260 #line 2261 "src/parse-gram.c"
2264 /* Line 1380 of yacc.c */
2265 #line 403 "parse-gram.y"
2266 { (yyval
.assoc
) = left_assoc
; }
2267 /* Line 1380 of yacc.c */
2268 #line 2269 "src/parse-gram.c"
2272 /* Line 1380 of yacc.c */
2273 #line 404 "parse-gram.y"
2274 { (yyval
.assoc
) = right_assoc
; }
2275 /* Line 1380 of yacc.c */
2276 #line 2277 "src/parse-gram.c"
2280 /* Line 1380 of yacc.c */
2281 #line 405 "parse-gram.y"
2282 { (yyval
.assoc
) = non_assoc
; }
2283 /* Line 1380 of yacc.c */
2284 #line 2285 "src/parse-gram.c"
2288 /* Line 1380 of yacc.c */
2289 #line 406 "parse-gram.y"
2290 { (yyval
.assoc
) = precedence_assoc
; }
2291 /* Line 1380 of yacc.c */
2292 #line 2293 "src/parse-gram.c"
2296 /* Line 1380 of yacc.c */
2297 #line 410 "parse-gram.y"
2298 { current_type
= NULL
; }
2299 /* Line 1380 of yacc.c */
2300 #line 2301 "src/parse-gram.c"
2304 /* Line 1380 of yacc.c */
2305 #line 411 "parse-gram.y"
2306 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2307 /* Line 1380 of yacc.c */
2308 #line 2309 "src/parse-gram.c"
2312 /* Line 1380 of yacc.c */
2313 #line 417 "parse-gram.y"
2314 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2315 /* Line 1380 of yacc.c */
2316 #line 2317 "src/parse-gram.c"
2320 /* Line 1380 of yacc.c */
2321 #line 419 "parse-gram.y"
2322 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2323 /* Line 1380 of yacc.c */
2324 #line 2325 "src/parse-gram.c"
2328 /* Line 1380 of yacc.c */
2329 #line 423 "parse-gram.y"
2330 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2331 /* Line 1380 of yacc.c */
2332 #line 2333 "src/parse-gram.c"
2336 /* Line 1380 of yacc.c */
2337 #line 424 "parse-gram.y"
2338 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2339 /* Line 1380 of yacc.c */
2340 #line 2341 "src/parse-gram.c"
2344 /* Line 1380 of yacc.c */
2345 #line 430 "parse-gram.y"
2346 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2347 /* Line 1380 of yacc.c */
2348 #line 2349 "src/parse-gram.c"
2352 /* Line 1380 of yacc.c */
2353 #line 432 "parse-gram.y"
2354 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2355 /* Line 1380 of yacc.c */
2356 #line 2357 "src/parse-gram.c"
2360 /* Line 1380 of yacc.c */
2361 #line 436 "parse-gram.y"
2362 { (yyval
.list
) = (yyvsp
[0].list
); }
2363 /* Line 1380 of yacc.c */
2364 #line 2365 "src/parse-gram.c"
2368 /* Line 1380 of yacc.c */
2369 #line 437 "parse-gram.y"
2370 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2371 /* Line 1380 of yacc.c */
2372 #line 2373 "src/parse-gram.c"
2376 /* Line 1380 of yacc.c */
2377 #line 441 "parse-gram.y"
2378 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2379 /* Line 1380 of yacc.c */
2380 #line 2381 "src/parse-gram.c"
2384 /* Line 1380 of yacc.c */
2385 #line 442 "parse-gram.y"
2386 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2387 /* Line 1380 of yacc.c */
2388 #line 2389 "src/parse-gram.c"
2392 /* Line 1380 of yacc.c */
2393 #line 443 "parse-gram.y"
2394 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2395 /* Line 1380 of yacc.c */
2396 #line 2397 "src/parse-gram.c"
2400 /* Line 1380 of yacc.c */
2401 #line 444 "parse-gram.y"
2402 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2403 /* Line 1380 of yacc.c */
2404 #line 2405 "src/parse-gram.c"
2408 /* Line 1380 of yacc.c */
2409 #line 450 "parse-gram.y"
2411 current_type
= (yyvsp
[0].uniqstr
);
2414 /* Line 1380 of yacc.c */
2415 #line 2416 "src/parse-gram.c"
2419 /* Line 1380 of yacc.c */
2420 #line 455 "parse-gram.y"
2422 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2423 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2425 /* Line 1380 of yacc.c */
2426 #line 2427 "src/parse-gram.c"
2430 /* Line 1380 of yacc.c */
2431 #line 460 "parse-gram.y"
2433 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2434 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2435 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2437 /* Line 1380 of yacc.c */
2438 #line 2439 "src/parse-gram.c"
2442 /* Line 1380 of yacc.c */
2443 #line 466 "parse-gram.y"
2445 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2446 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2447 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2449 /* Line 1380 of yacc.c */
2450 #line 2451 "src/parse-gram.c"
2454 /* Line 1380 of yacc.c */
2455 #line 472 "parse-gram.y"
2457 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2458 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2459 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2460 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2462 /* Line 1380 of yacc.c */
2463 #line 2464 "src/parse-gram.c"
2467 /* Line 1380 of yacc.c */
2468 #line 502 "parse-gram.y"
2472 /* Line 1380 of yacc.c */
2473 #line 2474 "src/parse-gram.c"
2477 /* Line 1380 of yacc.c */
2478 #line 508 "parse-gram.y"
2479 { current_lhs
= (yyvsp
[0].symbol
); current_lhs_location
= (yylsp
[0]); }
2480 /* Line 1380 of yacc.c */
2481 #line 2482 "src/parse-gram.c"
2485 /* Line 1380 of yacc.c */
2486 #line 512 "parse-gram.y"
2487 { grammar_current_rule_end ((yylsp
[0])); }
2488 /* Line 1380 of yacc.c */
2489 #line 2490 "src/parse-gram.c"
2493 /* Line 1380 of yacc.c */
2494 #line 513 "parse-gram.y"
2495 { grammar_current_rule_end ((yylsp
[0])); }
2496 /* Line 1380 of yacc.c */
2497 #line 2498 "src/parse-gram.c"
2501 /* Line 1380 of yacc.c */
2502 #line 519 "parse-gram.y"
2503 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2504 /* Line 1380 of yacc.c */
2505 #line 2506 "src/parse-gram.c"
2509 /* Line 1380 of yacc.c */
2510 #line 521 "parse-gram.y"
2511 { grammar_current_rule_symbol_append ((yyvsp
[0].symbol
), (yylsp
[0])); }
2512 /* Line 1380 of yacc.c */
2513 #line 2514 "src/parse-gram.c"
2517 /* Line 1380 of yacc.c */
2518 #line 523 "parse-gram.y"
2519 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0])); }
2520 /* Line 1380 of yacc.c */
2521 #line 2522 "src/parse-gram.c"
2525 /* Line 1380 of yacc.c */
2526 #line 525 "parse-gram.y"
2527 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2528 /* Line 1380 of yacc.c */
2529 #line 2530 "src/parse-gram.c"
2533 /* Line 1380 of yacc.c */
2534 #line 527 "parse-gram.y"
2535 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2536 /* Line 1380 of yacc.c */
2537 #line 2538 "src/parse-gram.c"
2541 /* Line 1380 of yacc.c */
2542 #line 529 "parse-gram.y"
2543 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2544 /* Line 1380 of yacc.c */
2545 #line 2546 "src/parse-gram.c"
2549 /* Line 1380 of yacc.c */
2550 #line 541 "parse-gram.y"
2551 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2552 /* Line 1380 of yacc.c */
2553 #line 2554 "src/parse-gram.c"
2557 /* Line 1380 of yacc.c */
2558 #line 546 "parse-gram.y"
2559 { (yyval
.chars
) = ""; }
2560 /* Line 1380 of yacc.c */
2561 #line 2562 "src/parse-gram.c"
2565 /* Line 1380 of yacc.c */
2566 #line 557 "parse-gram.y"
2568 code_props plain_code
;
2569 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2570 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2571 code_props_translate_code (&plain_code
);
2572 gram_scanner_last_string_free ();
2573 (yyval
.chars
) = plain_code
.code
;
2575 /* Line 1380 of yacc.c */
2576 #line 2577 "src/parse-gram.c"
2580 /* Line 1380 of yacc.c */
2581 #line 577 "parse-gram.y"
2582 { (yyval
.symbol
) = symbol_from_uniqstr ((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 579 "parse-gram.y"
2591 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2592 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2593 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2595 /* Line 1380 of yacc.c */
2596 #line 2597 "src/parse-gram.c"
2600 /* Line 1380 of yacc.c */
2601 #line 587 "parse-gram.y"
2602 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2603 /* Line 1380 of yacc.c */
2604 #line 2605 "src/parse-gram.c"
2608 /* Line 1380 of yacc.c */
2609 #line 599 "parse-gram.y"
2611 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2612 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2614 /* Line 1380 of yacc.c */
2615 #line 2616 "src/parse-gram.c"
2619 /* Line 1380 of yacc.c */
2620 #line 608 "parse-gram.y"
2622 code_props plain_code
;
2623 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2624 code_props_translate_code (&plain_code
);
2625 gram_scanner_last_string_free ();
2626 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2627 code_scanner_last_string_free ();
2629 /* Line 1380 of yacc.c */
2630 #line 2631 "src/parse-gram.c"
2634 /* Line 1380 of yacc.c */
2635 #line 2636 "src/parse-gram.c"
2638 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2642 YY_STACK_PRINT (yyss
, yyssp
);
2647 /* Now `shift' the result of the reduction. Determine what state
2648 that goes to, based on the state we popped back to and the rule
2649 number reduced by. */
2653 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2654 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2655 yystate
= yytable
[yystate
];
2657 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2662 /*------------------------------------.
2663 | yyerrlab -- here on detecting error |
2664 `------------------------------------*/
2666 /* If not already recovering from an error, report this error. */
2670 #if ! YYERROR_VERBOSE
2671 yyerror (YY_("syntax error"));
2674 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yytoken
);
2675 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2677 YYSIZE_T yyalloc
= 2 * yysize
;
2678 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2679 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2680 if (yymsg
!= yymsgbuf
)
2681 YYSTACK_FREE (yymsg
);
2682 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2684 yymsg_alloc
= yyalloc
;
2688 yymsg_alloc
= sizeof yymsgbuf
;
2692 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2694 (void) yysyntax_error (yymsg
, yystate
, yytoken
);
2699 yyerror (YY_("syntax error"));
2701 goto yyexhaustedlab
;
2707 yyerror_range
[0] = yylloc
;
2709 if (yyerrstatus
== 3)
2711 /* If just tried and failed to reuse lookahead token after an
2712 error, discard it. */
2714 if (yychar
<= YYEOF
)
2716 /* Return failure if at end of input. */
2717 if (yychar
== YYEOF
)
2722 yydestruct ("Error: discarding",
2723 yytoken
, &yylval
, &yylloc
);
2728 /* Else will try to reuse lookahead token after shifting the error
2733 /*---------------------------------------------------.
2734 | yyerrorlab -- error raised explicitly by YYERROR. |
2735 `---------------------------------------------------*/
2738 /* Pacify compilers like GCC when the user code never invokes
2739 YYERROR and the label yyerrorlab therefore never appears in user
2741 if (/*CONSTCOND*/ 0)
2744 yyerror_range
[0] = yylsp
[1-yylen
];
2745 /* Do not reclaim the symbols of the rule which action triggered
2749 YY_STACK_PRINT (yyss
, yyssp
);
2754 /*-------------------------------------------------------------.
2755 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2756 `-------------------------------------------------------------*/
2758 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2762 yyn
= yypact
[yystate
];
2763 if (yyn
!= YYPACT_NINF
)
2766 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2774 /* Pop the current state because it cannot handle the error token. */
2778 yyerror_range
[0] = *yylsp
;
2779 yydestruct ("Error: popping",
2780 yystos
[yystate
], yyvsp
, yylsp
);
2783 YY_STACK_PRINT (yyss
, yyssp
);
2788 yyerror_range
[1] = yylloc
;
2789 /* Using YYLLOC is tempting, but would change the location of
2790 the lookahead. YYLOC is available though. */
2791 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2794 /* Shift the error token. */
2795 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2801 /*-------------------------------------.
2802 | yyacceptlab -- YYACCEPT comes here. |
2803 `-------------------------------------*/
2808 /*-----------------------------------.
2809 | yyabortlab -- YYABORT comes here. |
2810 `-----------------------------------*/
2815 #if !defined(yyoverflow) || YYERROR_VERBOSE
2816 /*-------------------------------------------------.
2817 | yyexhaustedlab -- memory exhaustion comes here. |
2818 `-------------------------------------------------*/
2820 yyerror (YY_("memory exhausted"));
2826 if (yychar
!= YYEMPTY
)
2827 yydestruct ("Cleanup: discarding lookahead",
2828 yytoken
, &yylval
, &yylloc
);
2829 /* Do not reclaim the symbols of the rule which action triggered
2830 this YYABORT or YYACCEPT. */
2832 YY_STACK_PRINT (yyss
, yyssp
);
2833 while (yyssp
!= yyss
)
2835 yydestruct ("Cleanup: popping",
2836 yystos
[*yyssp
], yyvsp
, yylsp
);
2841 YYSTACK_FREE (yyss
);
2844 if (yymsg
!= yymsgbuf
)
2845 YYSTACK_FREE (yymsg
);
2847 /* Make sure YYID is used. */
2848 return YYID (yyresult
);
2851 /* Line 1599 of yacc.c */
2852 #line 618 "parse-gram.y"
2856 /* Return the location of the left-hand side of a rule whose
2857 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2858 the right-hand side, and return an empty location equal to the end
2859 boundary of RHS[0] if the right-hand side is empty. */
2862 lloc_default (YYLTYPE
const *rhs
, int n
)
2867 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2868 The bug is fixed in 7.4.2m, but play it safe for now. */
2869 loc
.start
= rhs
[n
].end
;
2870 loc
.end
= rhs
[n
].end
;
2872 /* Ignore empty nonterminals the start of the the right-hand side.
2873 Do not bother to ignore them at the end of the right-hand side,
2874 since empty nonterminals have the same end as their predecessors. */
2875 for (i
= 1; i
<= n
; i
++)
2876 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2878 loc
.start
= rhs
[i
].start
;
2886 /* Add a lex-param or a parse-param (depending on TYPE) with
2887 declaration DECL and location LOC. */
2890 add_param (char const *type
, char *decl
, location loc
)
2892 static char const alphanum
[26 + 26 + 1 + 10] =
2893 "abcdefghijklmnopqrstuvwxyz"
2894 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2897 char const *name_start
= NULL
;
2900 /* Stop on last actual character. */
2901 for (p
= decl
; p
[1]; p
++)
2903 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2904 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2907 /* Strip the surrounding '{' and '}', and any blanks just inside
2909 while (*--p
== ' ' || *p
== '\t')
2912 while (*++decl
== ' ' || *decl
== '\t')
2916 complain_at (loc
, _("missing identifier in parameter declaration"));
2923 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2927 name
= xmalloc (name_len
+ 1);
2928 memcpy (name
, name_start
, name_len
);
2929 name
[name_len
] = '\0';
2930 muscle_pair_list_grow (type
, decl
, name
);
2934 gram_scanner_last_string_free ();
2939 version_check (location
const *loc
, char const *version
)
2941 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2943 complain_at (*loc
, "require bison %s, but have %s",
2944 version
, PACKAGE_VERSION
);
2950 gram_error (location
const *loc
, char const *msg
)
2952 complain_at (*loc
, "%s", msg
);
2956 token_name (int type
)
2958 return yytname
[YYTRANSLATE (type
)];
2969 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2970 return quotearg_style (escape_quoting_style
, buf
);