1 /* A Bison parser, made by GNU Bison 2.4.194-c20a1-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 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.194-c20a1-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. */
77 /* Line 191 of yacc.c */
78 #line 1 "parse-gram.y"
79 /* Bison Grammar Parser -*- C -*-
81 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
84 This file is part of Bison, the GNU Compiler Compiler.
86 This program is free software: you can redistribute it and/or modify
87 it under the terms of the GNU General Public License as published by
88 the Free Software Foundation, either version 3 of the License, or
89 (at your option) any later version.
91 This program is distributed in the hope that it will be useful,
92 but WITHOUT ANY WARRANTY; without even the implied warranty of
93 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
94 GNU General Public License for more details.
96 You should have received a copy of the GNU General Public License
97 along with this program. If not, see <http://www.gnu.org/licenses/>. */
102 #include "complain.h"
103 #include "conflicts.h"
107 #include "muscle_tab.h"
108 #include "quotearg.h"
111 #include "scan-gram.h"
112 #include "scan-code.h"
114 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
115 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
117 #define YY_LOCATION_PRINT(File, Loc) \
118 location_print (File, Loc)
120 static void version_check (location
const *loc
, char const *version
);
122 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
123 FIXME: depends on the undocumented availability of YYLLOC. */
125 #define yyerror(Msg) \
126 gram_error (&yylloc, Msg)
127 static void gram_error (location
const *, char const *);
129 static char const *char_name (char);
131 /** Add a lex-param or a parse-param.
133 * \param type \a lex_param or \a parse_param
134 * \param decl the formal argument
135 * \param loc the location in the source.
137 static void add_param (char const *type
, char *decl
, location loc
);
140 static symbol_class current_class
= unknown_sym
;
141 static uniqstr current_type
= NULL
;
142 static symbol
*current_lhs
;
143 static location current_lhs_location
;
144 static int current_prec
= 0;
146 #define YYTYPE_INT16 int_fast16_t
147 #define YYTYPE_INT8 int_fast8_t
148 #define YYTYPE_UINT16 uint_fast16_t
149 #define YYTYPE_UINT8 uint_fast8_t
152 /* Line 191 of yacc.c */
153 #line 154 "../../src/parse-gram.c"
155 /* Enabling traces. */
160 /* Enabling verbose error messages. */
161 #ifdef YYERROR_VERBOSE
162 # undef YYERROR_VERBOSE
163 # define YYERROR_VERBOSE 1
165 # define YYERROR_VERBOSE 1
168 /* Enabling the token table. */
169 #ifndef YYTOKEN_TABLE
170 # define YYTOKEN_TABLE 0
177 /* Put the tokens into the symbol table, so that GDB and other debuggers
186 PERCENT_DESTRUCTOR
= 263,
187 PERCENT_PRINTER
= 264,
190 PERCENT_NONASSOC
= 267,
191 PERCENT_PRECEDENCE
= 268,
197 PERCENT_DEFAULT_PREC
= 274,
198 PERCENT_DEFINE
= 275,
199 PERCENT_DEFINES
= 276,
200 PERCENT_ERROR_VERBOSE
= 277,
201 PERCENT_EXPECT
= 278,
202 PERCENT_EXPECT_RR
= 279,
203 PERCENT_FILE_PREFIX
= 280,
204 PERCENT_GLR_PARSER
= 281,
205 PERCENT_INITIAL_ACTION
= 282,
206 PERCENT_LANGUAGE
= 283,
207 PERCENT_LEX_PARAM
= 284,
208 PERCENT_LOCATIONS
= 285,
209 PERCENT_NAME_PREFIX
= 286,
210 PERCENT_NO_DEFAULT_PREC
= 287,
211 PERCENT_NO_LINES
= 288,
212 PERCENT_NONDETERMINISTIC_PARSER
= 289,
213 PERCENT_OUTPUT
= 290,
214 PERCENT_PARSE_PARAM
= 291,
215 PERCENT_PURE_PARSER
= 292,
216 PERCENT_REQUIRE
= 293,
217 PERCENT_SKELETON
= 294,
219 PERCENT_TOKEN_TABLE
= 296,
220 PERCENT_VERBOSE
= 297,
228 PERCENT_PERCENT
= 305,
242 #define PERCENT_TOKEN 260
243 #define PERCENT_NTERM 261
244 #define PERCENT_TYPE 262
245 #define PERCENT_DESTRUCTOR 263
246 #define PERCENT_PRINTER 264
247 #define PERCENT_LEFT 265
248 #define PERCENT_RIGHT 266
249 #define PERCENT_NONASSOC 267
250 #define PERCENT_PRECEDENCE 268
251 #define PERCENT_PREC 269
252 #define PERCENT_DPREC 270
253 #define PERCENT_MERGE 271
254 #define PERCENT_CODE 272
255 #define PERCENT_DEBUG 273
256 #define PERCENT_DEFAULT_PREC 274
257 #define PERCENT_DEFINE 275
258 #define PERCENT_DEFINES 276
259 #define PERCENT_ERROR_VERBOSE 277
260 #define PERCENT_EXPECT 278
261 #define PERCENT_EXPECT_RR 279
262 #define PERCENT_FILE_PREFIX 280
263 #define PERCENT_GLR_PARSER 281
264 #define PERCENT_INITIAL_ACTION 282
265 #define PERCENT_LANGUAGE 283
266 #define PERCENT_LEX_PARAM 284
267 #define PERCENT_LOCATIONS 285
268 #define PERCENT_NAME_PREFIX 286
269 #define PERCENT_NO_DEFAULT_PREC 287
270 #define PERCENT_NO_LINES 288
271 #define PERCENT_NONDETERMINISTIC_PARSER 289
272 #define PERCENT_OUTPUT 290
273 #define PERCENT_PARSE_PARAM 291
274 #define PERCENT_PURE_PARSER 292
275 #define PERCENT_REQUIRE 293
276 #define PERCENT_SKELETON 294
277 #define PERCENT_START 295
278 #define PERCENT_TOKEN_TABLE 296
279 #define PERCENT_VERBOSE 297
280 #define PERCENT_YACC 298
281 #define BRACED_CODE 299
287 #define PERCENT_PERCENT 305
290 #define SEMICOLON 308
294 #define PERCENT_UNION 312
299 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
300 typedef union YYSTYPE
303 /* Line 216 of yacc.c */
304 #line 92 "parse-gram.y"
313 unsigned char character
;
317 /* Line 216 of yacc.c */
318 #line 319 "../../src/parse-gram.c"
320 # define YYSTYPE_IS_TRIVIAL 1
321 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
322 # define YYSTYPE_IS_DECLARED 1
325 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
326 typedef struct YYLTYPE
333 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
334 # define YYLTYPE_IS_DECLARED 1
335 # define YYLTYPE_IS_TRIVIAL 1
339 /* Copy the second part of user declarations. */
342 /* Line 266 of yacc.c */
343 #line 344 "../../src/parse-gram.c"
350 typedef YYTYPE_UINT8 yytype_uint8
;
352 typedef unsigned char yytype_uint8
;
356 typedef YYTYPE_INT8 yytype_int8
;
357 #elif (defined __STDC__ || defined __C99__FUNC__ \
358 || defined __cplusplus || defined _MSC_VER)
359 typedef signed char yytype_int8
;
361 typedef short int yytype_int8
;
365 typedef YYTYPE_UINT16 yytype_uint16
;
367 typedef unsigned short int yytype_uint16
;
371 typedef YYTYPE_INT16 yytype_int16
;
373 typedef short int yytype_int16
;
377 # ifdef __SIZE_TYPE__
378 # define YYSIZE_T __SIZE_TYPE__
379 # elif defined size_t
380 # define YYSIZE_T size_t
381 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
382 || defined __cplusplus || defined _MSC_VER)
383 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
384 # define YYSIZE_T size_t
386 # define YYSIZE_T unsigned int
390 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
395 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
396 # define YY_(msgid) dgettext ("bison-runtime", msgid)
400 # define YY_(msgid) msgid
404 /* Suppress unused-variable warnings by "using" E. */
405 #if ! defined lint || defined __GNUC__
406 # define YYUSE(e) ((void) (e))
408 # define YYUSE(e) /* empty */
411 /* Identity function, used to suppress warnings about constant conditions. */
415 #if (defined __STDC__ || defined __C99__FUNC__ \
416 || defined __cplusplus || defined _MSC_VER)
429 #if ! defined yyoverflow || YYERROR_VERBOSE
431 /* The parser invokes alloca or malloc; define the necessary symbols. */
433 # ifdef YYSTACK_USE_ALLOCA
434 # if YYSTACK_USE_ALLOCA
436 # define YYSTACK_ALLOC __builtin_alloca
437 # elif defined __BUILTIN_VA_ARG_INCR
438 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
440 # define YYSTACK_ALLOC __alloca
441 # elif defined _MSC_VER
442 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
443 # define alloca _alloca
445 # define YYSTACK_ALLOC alloca
446 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
447 || defined __cplusplus || defined _MSC_VER)
448 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
457 # ifdef YYSTACK_ALLOC
458 /* Pacify GCC's `empty if-body' warning. */
459 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
460 # ifndef YYSTACK_ALLOC_MAXIMUM
461 /* The OS might guarantee only one guard page at the bottom of the stack,
462 and a page size can be as small as 4096 bytes. So we cannot safely
463 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
464 to allow for a few compiler-allocated temporary stack slots. */
465 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
468 # define YYSTACK_ALLOC YYMALLOC
469 # define YYSTACK_FREE YYFREE
470 # ifndef YYSTACK_ALLOC_MAXIMUM
471 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
473 # if (defined __cplusplus && ! defined _STDLIB_H \
474 && ! ((defined YYMALLOC || defined malloc) \
475 && (defined YYFREE || defined free)))
476 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
482 # define YYMALLOC malloc
483 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
484 || defined __cplusplus || defined _MSC_VER)
485 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
490 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
491 || defined __cplusplus || defined _MSC_VER)
492 void free (void *); /* INFRINGES ON USER NAME SPACE */
496 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
499 #if (! defined yyoverflow \
500 && (! defined __cplusplus \
501 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
502 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
504 /* A type that is properly aligned for any stack member. */
507 yytype_int16 yyss_alloc
;
512 /* The size of the maximum gap between one aligned stack and the next. */
513 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
515 /* The size of an array large to enough to hold all stacks, each with
517 # define YYSTACK_BYTES(N) \
518 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
519 + 2 * YYSTACK_GAP_MAXIMUM)
521 /* Copy COUNT objects from FROM to TO. The source and destination do
524 # if defined __GNUC__ && 1 < __GNUC__
525 # define YYCOPY(To, From, Count) \
526 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
528 # define YYCOPY(To, From, Count) \
532 for (yyi = 0; yyi < (Count); yyi++) \
533 (To)[yyi] = (From)[yyi]; \
539 /* Relocate STACK from its old location to the new one. The
540 local variables YYSIZE and YYSTACKSIZE give the old and new number of
541 elements in the stack, and YYPTR gives the new location of the
542 stack. Advance YYPTR to a properly aligned location for the next
544 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
547 YYSIZE_T yynewbytes; \
548 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
549 Stack = &yyptr->Stack_alloc; \
550 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
551 yyptr += yynewbytes / sizeof (*yyptr); \
557 /* YYFINAL -- State number of the termination state. */
559 /* YYLAST -- Last index in YYTABLE. */
562 /* YYNTOKENS -- Number of terminals. */
564 /* YYNNTS -- Number of nonterminals. */
566 /* YYNRULES -- Number of rules. */
568 /* YYNSTATES -- Number of states. */
569 #define YYNSTATES 144
571 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
572 by yylex, with out-of-bounds checking. */
574 #define YYMAXUTOK 312
576 #define YYTRANSLATE(YYX) \
577 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
579 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
580 as returned by yylex, without out-of-bounds checking. */
581 static const yytype_uint8 yytranslate
[] =
583 0, 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, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
609 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
610 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
611 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
612 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
613 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
618 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
619 static const yytype_uint16 yyrline
[] =
621 0, 203, 203, 211, 213, 217, 218, 228, 229, 233,
622 234, 239, 240, 241, 242, 243, 244, 249, 258, 259,
623 260, 261, 262, 263, 264, 265, 266, 267, 268, 281,
624 282, 306, 307, 308, 309, 313, 314, 315, 319, 326,
625 333, 337, 341, 348, 363, 364, 368, 380, 380, 385,
626 385, 390, 401, 416, 417, 418, 419, 423, 424, 429,
627 431, 436, 437, 442, 444, 449, 450, 454, 455, 456,
628 457, 462, 467, 472, 478, 484, 495, 496, 505, 506,
629 512, 513, 514, 521, 521, 525, 526, 527, 532, 533,
630 535, 537, 539, 541, 551, 552, 558, 561, 570, 590,
631 592, 601, 606, 607, 612, 619, 621
635 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
636 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
637 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
638 static const char *const yytname
[] =
640 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
641 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
642 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
643 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
644 "\"%debug\"", "\"%default-prec\"", "\"%define\"", "\"%defines\"",
645 "\"%error-verbose\"", "\"%expect\"", "\"%expect-rr\"",
646 "\"%file-prefix\"", "\"%glr-parser\"", "\"%initial-action\"",
647 "\"%language\"", "\"%lex-param\"", "\"%locations\"", "\"%name-prefix\"",
648 "\"%no-default-prec\"", "\"%no-lines\"", "\"%nondeterministic-parser\"",
649 "\"%output\"", "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"",
650 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
651 "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"", "\"=\"",
652 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
653 "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
654 "input", "prologue_declarations", "prologue_declaration",
655 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
656 "precedence_declaration", "precedence_declarator", "tag.opt",
657 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
658 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
659 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
660 "variable", "content.opt", "braceless", "id", "id_colon", "symbol",
661 "string_as_id", "epilogue.opt", 0
666 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
667 (internal) symbol number NUM (which must be that of a token). */
668 static const yytype_uint16 yytoknum
[] =
670 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
671 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
672 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
673 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
674 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
675 305, 306, 307, 308, 309, 310, 311, 312
679 #define YYPACT_NINF -81
681 #define YYTABLE_NINF -106
683 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
685 static const yytype_int16 yypact
[] =
687 -81, 23, 111, -81, -81, -81, -28, -12, -8, -81,
688 -81, -81, -81, -13, -81, -81, 14, 43, -81, 48,
689 49, 2, -81, 10, 53, 34, -81, 13, -81, -81,
690 -81, 26, 36, -81, 54, 78, 0, -81, -81, -81,
691 58, -81, -81, 41, -81, -81, -81, -81, 28, -24,
692 -24, 0, 31, 31, -81, 44, -81, -81, -81, 81,
693 -81, -81, -81, -81, 88, -81, -81, -81, -81, 89,
694 -81, 91, -81, -81, -81, -81, -81, -81, -81, -81,
695 -81, 42, -81, 47, 1, -81, -81, -81, -81, 44,
696 -81, 0, -81, -81, -24, 40, -24, 0, -81, -81,
697 -81, -81, 31, -81, -81, 31, -81, -81, -81, -81,
698 -81, -81, -81, -81, 50, -81, -81, -81, -81, 0,
699 -81, 93, -81, 98, -81, -81, -81, -81, -14, 155,
700 -81, -81, -81, -81, -81, 0, 99, 51, -81, -81,
704 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
705 does not specify something else to do. Zero means the default is an
707 static const yytype_uint8 yydefact
[] =
709 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
710 54, 55, 56, 0, 7, 40, 0, 9, 11, 0,
711 0, 0, 16, 0, 0, 0, 20, 0, 41, 23,
712 24, 0, 0, 28, 0, 0, 0, 31, 32, 33,
713 0, 6, 34, 44, 4, 5, 36, 35, 57, 0,
714 0, 0, 0, 0, 98, 0, 42, 95, 94, 96,
715 10, 12, 13, 14, 0, 17, 18, 19, 21, 0,
716 25, 0, 27, 29, 30, 104, 100, 99, 102, 37,
717 103, 0, 101, 0, 0, 78, 80, 83, 45, 0,
718 58, 0, 71, 76, 50, 72, 48, 51, 63, 68,
719 69, 70, 38, 65, 67, 39, 43, 97, 8, 15,
720 22, 26, 82, 81, 0, 79, 2, 88, 46, 52,
721 59, 61, 77, 73, 74, 64, 66, 106, 84, 85,
722 60, 62, 75, 88, 87, 0, 0, 0, 90, 89,
726 /* YYPGOTO[NTERM-NUM]. */
727 static const yytype_int8 yypgoto
[] =
729 -81, -81, -81, -81, 100, -81, -81, -81, -81, -81,
730 -81, -81, -81, -11, -81, 56, -80, -54, 60, -81,
731 22, -81, -81, -81, -21, -81, -81, -51, -22, -81,
735 /* YYDEFGOTO[NTERM-NUM]. */
736 static const yytype_int16 yydefgoto
[] =
738 -1, 1, 2, 44, 83, 89, 46, 50, 49, 47,
739 48, 91, 119, 120, 97, 102, 103, 93, 94, 84,
740 85, 86, 117, 128, 129, 59, 108, 56, 78, 87,
744 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
745 positive, shift that token. If negative, reduce the rule which
746 number is the opposite. If zero, do what YYDEFACT says.
747 If YYTABLE_NINF, syntax error. */
748 static const yytype_int16 yytable
[] =
750 79, -105, 81, 75, 106, 63, 4, 5, 6, 7,
751 8, 9, 10, 11, 12, 98, 68, 57, 13, 124,
752 15, 76, 126, 3, 77, 126, 51, 95, 95, 70,
753 92, 54, 52, 28, 75, 55, 53, 133, 118, 134,
754 122, 36, 122, 75, 123, 76, 60, 132, 77, 64,
755 82, 114, 61, 62, 65, 121, 66, 73, 43, 81,
756 69, 125, 58, 4, 5, 6, 7, 8, 9, 10,
757 11, 12, 95, 71, 95, 13, 76, 15, 67, 77,
758 72, 74, 90, 121, 107, 99, 100, 101, 54, 88,
759 28, 109, 110, 139, 111, 112, 127, 131, 36, 141,
760 113, 75, 45, 142, 139, 143, 115, 82, 130, 105,
761 96, 0, 140, 0, 0, 43, 4, 5, 6, 7,
762 8, 9, 10, 11, 12, 0, 0, 0, 13, 14,
763 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
764 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
765 35, 36, 37, 38, 39, 0, 0, 0, 75, 0,
766 0, 40, 0, 41, 42, 0, 0, 0, 43, 135,
767 136, 137, 0, 0, 0, 0, 0, 0, 0, 0,
768 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
769 0, 0, 0, 0, 0, 0, 0, 0, 0, 138,
773 static const yytype_int16 yycheck
[] =
775 36, 0, 1, 3, 55, 3, 5, 6, 7, 8,
776 9, 10, 11, 12, 13, 51, 3, 3, 17, 95,
777 19, 45, 102, 0, 48, 105, 54, 49, 50, 3,
778 54, 44, 44, 32, 3, 48, 44, 51, 89, 53,
779 94, 40, 96, 3, 4, 45, 3, 123, 48, 47,
780 49, 50, 4, 4, 44, 91, 3, 3, 57, 1,
781 47, 97, 48, 5, 6, 7, 8, 9, 10, 11,
782 12, 13, 94, 47, 96, 17, 45, 19, 44, 48,
783 44, 3, 54, 119, 3, 54, 55, 56, 44, 48,
784 32, 3, 3, 129, 3, 53, 46, 4, 40, 135,
785 53, 3, 2, 4, 140, 54, 84, 49, 119, 53,
786 50, -1, 133, -1, -1, 57, 5, 6, 7, 8,
787 9, 10, 11, 12, 13, -1, -1, -1, 17, 18,
788 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
789 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
790 39, 40, 41, 42, 43, -1, -1, -1, 3, -1,
791 -1, 50, -1, 52, 53, -1, -1, -1, 57, 14,
792 15, 16, -1, -1, -1, -1, -1, -1, -1, -1,
793 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
794 -1, -1, -1, -1, -1, -1, -1, -1, -1, 44,
798 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
799 symbol of state STATE-NUM. */
800 static const yytype_uint8 yystos
[] =
802 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
803 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
804 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
805 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
806 50, 52, 53, 57, 61, 62, 64, 67, 68, 66,
807 65, 54, 44, 44, 44, 48, 85, 3, 48, 83,
808 3, 4, 4, 3, 47, 44, 3, 44, 3, 47,
809 3, 47, 44, 3, 3, 3, 45, 48, 86, 88,
810 89, 1, 49, 62, 77, 78, 79, 87, 48, 63,
811 54, 69, 54, 75, 76, 86, 76, 72, 88, 54,
812 55, 56, 73, 74, 88, 73, 85, 3, 84, 3,
813 3, 3, 53, 53, 50, 78, 90, 80, 85, 70,
814 71, 88, 75, 4, 89, 88, 74, 46, 81, 82,
815 71, 4, 89, 51, 53, 14, 15, 16, 44, 88,
819 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
820 static const yytype_uint8 yyr1
[] =
822 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
823 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
824 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
825 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
826 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
827 64, 64, 67, 68, 68, 68, 68, 69, 69, 70,
828 70, 71, 71, 72, 72, 73, 73, 74, 74, 74,
829 74, 75, 75, 75, 75, 75, 76, 76, 77, 77,
830 78, 78, 78, 80, 79, 81, 81, 81, 82, 82,
831 82, 82, 82, 82, 83, 83, 84, 84, 85, 86,
832 86, 87, 88, 88, 89, 90, 90
835 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
836 static const yytype_uint8 yyr2
[] =
838 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
839 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
840 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
841 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
842 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
843 3, 3, 3, 1, 1, 1, 1, 0, 1, 1,
844 2, 1, 2, 1, 2, 1, 2, 1, 1, 1,
845 1, 1, 1, 2, 2, 3, 1, 2, 1, 2,
846 1, 2, 2, 0, 3, 1, 3, 2, 0, 2,
847 2, 3, 3, 3, 1, 1, 0, 1, 1, 1,
852 #define yyerrok (yyerrstatus = 0)
853 #define yyclearin (yychar = YYEMPTY)
857 #define YYACCEPT goto yyacceptlab
858 #define YYABORT goto yyabortlab
859 #define YYERROR goto yyerrorlab
862 /* Like YYERROR except do call yyerror. This remains here temporarily
863 to ease the transition to the new meaning of YYERROR, for GCC.
864 Once GCC version 2 has supplanted version 1, this can go. */
866 #define YYFAIL goto yyerrlab
868 #define YYRECOVERING() (!!yyerrstatus)
870 #define YYBACKUP(Token, Value) \
872 if (yychar == YYEMPTY && yylen == 1) \
876 yytoken = YYTRANSLATE (yychar); \
882 yyerror (YY_("syntax error: cannot back up")); \
889 #define YYERRCODE 256
892 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
893 If N is 0, then set CURRENT to the empty location which ends
894 the previous symbol: RHS[0] (always defined). */
896 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
897 #ifndef YYLLOC_DEFAULT
898 # define YYLLOC_DEFAULT(Current, Rhs, N) \
902 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
903 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
904 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
905 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
909 (Current).first_line = (Current).last_line = \
910 YYRHSLOC (Rhs, 0).last_line; \
911 (Current).first_column = (Current).last_column = \
912 YYRHSLOC (Rhs, 0).last_column; \
918 /* YY_LOCATION_PRINT -- Print the location on the stream.
919 This macro was not mandated originally: define only if we know
920 we won't break user code: when these are the locations we know. */
922 #ifndef YY_LOCATION_PRINT
923 # if YYLTYPE_IS_TRIVIAL
924 # define YY_LOCATION_PRINT(File, Loc) \
925 fprintf (File, "%d.%d-%d.%d", \
926 (Loc).first_line, (Loc).first_column, \
927 (Loc).last_line, (Loc).last_column)
929 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
934 /* YYLEX -- calling `yylex' with the right arguments. */
937 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
939 # define YYLEX yylex (&yylval, &yylloc)
942 /* Enable debugging if requested. */
946 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
947 # define YYFPRINTF fprintf
950 # define YYDPRINTF(Args) \
956 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
960 YYFPRINTF (stderr, "%s ", Title); \
961 yy_symbol_print (stderr, \
962 Type, Value, Location); \
963 YYFPRINTF (stderr, "\n"); \
968 /*--------------------------------.
969 | Print this symbol on YYOUTPUT. |
970 `--------------------------------*/
973 #if (defined __STDC__ || defined __C99__FUNC__ \
974 || defined __cplusplus || defined _MSC_VER)
976 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
979 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
982 YYSTYPE
const * const yyvaluep
;
983 YYLTYPE
const * const yylocationp
;
990 if (yytype
< YYNTOKENS
)
991 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
997 case 3: /* "\"string\"" */
999 /* Line 650 of yacc.c */
1000 #line 181 "parse-gram.y"
1001 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); };
1003 /* Line 650 of yacc.c */
1004 #line 1005 "../../src/parse-gram.c"
1006 case 4: /* "\"integer\"" */
1008 /* Line 650 of yacc.c */
1009 #line 192 "parse-gram.y"
1010 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); };
1012 /* Line 650 of yacc.c */
1013 #line 1014 "../../src/parse-gram.c"
1015 case 44: /* "\"{...}\"" */
1017 /* Line 650 of yacc.c */
1018 #line 183 "parse-gram.y"
1019 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); };
1021 /* Line 650 of yacc.c */
1022 #line 1023 "../../src/parse-gram.c"
1024 case 45: /* "\"char\"" */
1026 /* Line 650 of yacc.c */
1027 #line 175 "parse-gram.y"
1028 { fputs (char_name (((*yyvaluep
).character
)), stderr
); };
1030 /* Line 650 of yacc.c */
1031 #line 1032 "../../src/parse-gram.c"
1033 case 46: /* "\"epilogue\"" */
1035 /* Line 650 of yacc.c */
1036 #line 183 "parse-gram.y"
1037 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); };
1039 /* Line 650 of yacc.c */
1040 #line 1041 "../../src/parse-gram.c"
1042 case 48: /* "\"identifier\"" */
1044 /* Line 650 of yacc.c */
1045 #line 188 "parse-gram.y"
1046 { fputs (((*yyvaluep
).uniqstr
), stderr
); };
1048 /* Line 650 of yacc.c */
1049 #line 1050 "../../src/parse-gram.c"
1051 case 49: /* "\"identifier:\"" */
1053 /* Line 650 of yacc.c */
1054 #line 189 "parse-gram.y"
1055 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); };
1057 /* Line 650 of yacc.c */
1058 #line 1059 "../../src/parse-gram.c"
1060 case 52: /* "\"%{...%}\"" */
1062 /* Line 650 of yacc.c */
1063 #line 183 "parse-gram.y"
1064 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); };
1066 /* Line 650 of yacc.c */
1067 #line 1068 "../../src/parse-gram.c"
1069 case 54: /* "\"<tag>\"" */
1071 /* Line 650 of yacc.c */
1072 #line 187 "parse-gram.y"
1073 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); };
1075 /* Line 650 of yacc.c */
1076 #line 1077 "../../src/parse-gram.c"
1078 case 83: /* "variable" */
1080 /* Line 650 of yacc.c */
1081 #line 188 "parse-gram.y"
1082 { fputs (((*yyvaluep
).uniqstr
), stderr
); };
1084 /* Line 650 of yacc.c */
1085 #line 1086 "../../src/parse-gram.c"
1087 case 84: /* "content.opt" */
1089 /* Line 650 of yacc.c */
1090 #line 183 "parse-gram.y"
1091 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); };
1093 /* Line 650 of yacc.c */
1094 #line 1095 "../../src/parse-gram.c"
1096 case 85: /* "braceless" */
1098 /* Line 650 of yacc.c */
1099 #line 183 "parse-gram.y"
1100 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); };
1102 /* Line 650 of yacc.c */
1103 #line 1104 "../../src/parse-gram.c"
1107 /* Line 650 of yacc.c */
1108 #line 195 "parse-gram.y"
1109 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); };
1111 /* Line 650 of yacc.c */
1112 #line 1113 "../../src/parse-gram.c"
1114 case 87: /* "id_colon" */
1116 /* Line 650 of yacc.c */
1117 #line 196 "parse-gram.y"
1118 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); };
1120 /* Line 650 of yacc.c */
1121 #line 1122 "../../src/parse-gram.c"
1123 case 88: /* "symbol" */
1125 /* Line 650 of yacc.c */
1126 #line 195 "parse-gram.y"
1127 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); };
1129 /* Line 650 of yacc.c */
1130 #line 1131 "../../src/parse-gram.c"
1132 case 89: /* "string_as_id" */
1134 /* Line 650 of yacc.c */
1135 #line 195 "parse-gram.y"
1136 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); };
1138 /* Line 650 of yacc.c */
1139 #line 1140 "../../src/parse-gram.c"
1147 /*--------------------------------.
1148 | Print this symbol on YYOUTPUT. |
1149 `--------------------------------*/
1151 #if (defined __STDC__ || defined __C99__FUNC__ \
1152 || defined __cplusplus || defined _MSC_VER)
1154 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1157 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1160 YYSTYPE
const * const yyvaluep
;
1161 YYLTYPE
const * const yylocationp
;
1164 if (yytype
< YYNTOKENS
)
1165 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1167 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1169 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1170 YYFPRINTF (yyoutput
, ": ");
1171 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1172 YYFPRINTF (yyoutput
, ")");
1175 /*------------------------------------------------------------------.
1176 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1178 `------------------------------------------------------------------*/
1180 #if (defined __STDC__ || defined __C99__FUNC__ \
1181 || defined __cplusplus || defined _MSC_VER)
1183 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1186 yy_stack_print (yybottom
, yytop
)
1187 yytype_int16
*yybottom
;
1188 yytype_int16
*yytop
;
1191 YYFPRINTF (stderr
, "Stack now");
1192 for (; yybottom
<= yytop
; yybottom
++)
1194 int yybot
= *yybottom
;
1195 YYFPRINTF (stderr
, " %d", yybot
);
1197 YYFPRINTF (stderr
, "\n");
1200 # define YY_STACK_PRINT(Bottom, Top) \
1203 yy_stack_print ((Bottom), (Top)); \
1207 /*------------------------------------------------.
1208 | Report that the YYRULE is going to be reduced. |
1209 `------------------------------------------------*/
1211 #if (defined __STDC__ || defined __C99__FUNC__ \
1212 || defined __cplusplus || defined _MSC_VER)
1214 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1217 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1218 yytype_int16
*yyssp
;
1224 unsigned long int yylno
= yyrline
[yyrule
];
1225 int yynrhs
= yyr2
[yyrule
];
1227 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1229 /* The symbols being reduced. */
1230 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1232 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1233 yy_symbol_print (stderr
,
1234 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1235 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1236 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1237 YYFPRINTF (stderr
, "\n");
1241 # define YY_REDUCE_PRINT(Rule) \
1244 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1247 /* Nonzero means print parse trace. It is left uninitialized so that
1248 multiple parsers can coexist. */
1250 #else /* !YYDEBUG */
1251 # define YYDPRINTF(Args)
1252 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1253 # define YY_STACK_PRINT(Bottom, Top)
1254 # define YY_REDUCE_PRINT(Rule)
1255 #endif /* !YYDEBUG */
1258 /* YYINITDEPTH -- initial size of the parser's stacks. */
1260 # define YYINITDEPTH 200
1263 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1264 if the built-in stack extension method is used).
1266 Do not make this value too large; the results are undefined if
1267 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1268 evaluated with infinite-precision integer arithmetic. */
1271 # define YYMAXDEPTH 10000
1279 # if defined __GLIBC__ && defined _STRING_H
1280 # define yystrlen strlen
1282 /* Return the length of YYSTR. */
1283 #if (defined __STDC__ || defined __C99__FUNC__ \
1284 || defined __cplusplus || defined _MSC_VER)
1286 yystrlen (const char *yystr
)
1294 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1302 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1303 # define yystpcpy stpcpy
1305 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1307 #if (defined __STDC__ || defined __C99__FUNC__ \
1308 || defined __cplusplus || defined _MSC_VER)
1310 yystpcpy (char *yydest
, const char *yysrc
)
1313 yystpcpy (yydest
, yysrc
)
1319 const char *yys
= yysrc
;
1321 while ((*yyd
++ = *yys
++) != '\0')
1330 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1331 quotes and backslashes, so that it's suitable for yyerror. The
1332 heuristic is that double-quoting is unnecessary unless the string
1333 contains an apostrophe, a comma, or backslash (other than
1334 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1335 null, do not copy; instead, return the length of what the result
1338 yytnamerr (char *yyres
, const char *yystr
)
1343 char const *yyp
= yystr
;
1350 goto do_not_strip_quotes
;
1354 goto do_not_strip_quotes
;
1367 do_not_strip_quotes
: ;
1371 return yystrlen (yystr
);
1373 return yystpcpy (yyres
, yystr
) - yyres
;
1377 /* Copy into YYRESULT an error message about the unexpected token
1378 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1379 including the terminating null byte. If YYRESULT is null, do not
1380 copy anything; just return the number of bytes that would be
1381 copied. As a special case, return 0 if an ordinary "syntax error"
1382 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1383 size calculation. */
1385 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1387 int yyn
= yypact
[yystate
];
1389 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1393 int yytype
= YYTRANSLATE (yychar
);
1394 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1395 YYSIZE_T yysize
= yysize0
;
1397 int yysize_overflow
= 0;
1398 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1399 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1403 /* This is so xgettext sees the translatable formats that are
1404 constructed on the fly. */
1405 YY_("syntax error, unexpected %s");
1406 YY_("syntax error, unexpected %s, expecting %s");
1407 YY_("syntax error, unexpected %s, expecting %s or %s");
1408 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1409 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1413 static char const yyunexpected
[] = "syntax error, unexpected %s";
1414 static char const yyexpecting
[] = ", expecting %s";
1415 static char const yyor
[] = " or %s";
1416 char yyformat
[sizeof yyunexpected
1417 + sizeof yyexpecting
- 1
1418 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1419 * (sizeof yyor
- 1))];
1420 char const *yyprefix
= yyexpecting
;
1422 /* Start YYX at -YYN if negative to avoid negative indexes in
1424 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1426 /* Stay within bounds of both yycheck and yytname. */
1427 int yychecklim
= YYLAST
- yyn
+ 1;
1428 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1431 yyarg
[0] = yytname
[yytype
];
1432 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1434 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1435 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1437 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1441 yyformat
[sizeof yyunexpected
- 1] = '\0';
1444 yyarg
[yycount
++] = yytname
[yyx
];
1445 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1446 yysize_overflow
|= (yysize1
< yysize
);
1448 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1452 yyf
= YY_(yyformat
);
1453 yysize1
= yysize
+ yystrlen (yyf
);
1454 yysize_overflow
|= (yysize1
< yysize
);
1457 if (yysize_overflow
)
1458 return YYSIZE_MAXIMUM
;
1462 /* Avoid sprintf, as that infringes on the user's name space.
1463 Don't have undefined behavior even if the translation
1464 produced a string with the wrong number of "%s"s. */
1465 char *yyp
= yyresult
;
1467 while ((*yyp
= *yyf
) != '\0')
1469 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1471 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1484 #endif /* YYERROR_VERBOSE */
1487 /*-----------------------------------------------.
1488 | Release the memory associated to this symbol. |
1489 `-----------------------------------------------*/
1492 #if (defined __STDC__ || defined __C99__FUNC__ \
1493 || defined __cplusplus || defined _MSC_VER)
1495 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1498 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1502 YYLTYPE
*yylocationp
;
1506 YYUSE (yylocationp
);
1510 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1520 /* Prevent warnings from -Wmissing-prototypes. */
1521 #ifdef YYPARSE_PARAM
1522 #if defined __STDC__ || defined __cplusplus
1523 int yyparse (void *YYPARSE_PARAM
);
1527 #else /* ! YYPARSE_PARAM */
1528 #if defined __STDC__ || defined __cplusplus
1533 #endif /* ! YYPARSE_PARAM */
1539 /*-------------------------.
1540 | yyparse or yypush_parse. |
1541 `-------------------------*/
1543 #ifdef YYPARSE_PARAM
1544 #if (defined __STDC__ || defined __C99__FUNC__ \
1545 || defined __cplusplus || defined _MSC_VER)
1547 yyparse (void *YYPARSE_PARAM
)
1550 yyparse (YYPARSE_PARAM
)
1551 void *YYPARSE_PARAM
;
1553 #else /* ! YYPARSE_PARAM */
1554 #if (defined __STDC__ || defined __C99__FUNC__ \
1555 || defined __cplusplus || defined _MSC_VER)
1565 /* The lookahead symbol. */
1568 /* The semantic value of the lookahead symbol. */
1571 /* Location data for the lookahead symbol. */
1574 /* Number of syntax errors so far. */
1578 /* Number of tokens to shift before error messages enabled. */
1581 /* The stacks and their tools:
1582 `yyss': related to states.
1583 `yyvs': related to semantic values.
1584 `yyls': related to locations.
1586 Refer to the stacks thru separate pointers, to allow yyoverflow
1587 to reallocate them elsewhere. */
1589 /* The state stack. */
1590 yytype_int16 yyssa
[YYINITDEPTH
];
1592 yytype_int16
*yyssp
;
1594 /* The semantic value stack. */
1595 YYSTYPE yyvsa
[YYINITDEPTH
];
1599 /* The location stack. */
1600 YYLTYPE yylsa
[YYINITDEPTH
];
1604 /* The locations where the error started and ended. */
1605 YYLTYPE yyerror_range
[2];
1607 YYSIZE_T yystacksize
;
1611 /* Lookahead token as an internal (translated) token number. */
1613 /* The variables used to return semantic value and location from the
1619 /* Buffer for error messages, and its allocated size. */
1621 char *yymsg
= yymsgbuf
;
1622 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1625 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1627 /* The number of symbols on the RHS of the reduced rule.
1628 Keep to zero when no symbol should be popped. */
1635 yystacksize
= YYINITDEPTH
;
1637 YYDPRINTF ((stderr
, "Starting parse\n"));
1642 yychar
= YYEMPTY
; /* Cause a token to be read. */
1644 /* Initialize stack pointers.
1645 Waste one element of value and location stack
1646 so that they stay on the same level as the state stack.
1647 The wasted elements are never initialized. */
1652 #if YYLTYPE_IS_TRIVIAL
1653 /* Initialize the default location before parsing starts. */
1654 yylloc
.first_line
= yylloc
.last_line
= 1;
1655 yylloc
.first_column
= yylloc
.last_column
= 1;
1658 /* User initialization code. */
1660 /* Line 1179 of yacc.c */
1661 #line 84 "parse-gram.y"
1663 /* Bison's grammar can initial empty locations, hence a default
1664 location is needed. */
1665 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1666 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1669 /* Line 1179 of yacc.c */
1670 #line 1671 "../../src/parse-gram.c"
1675 /*------------------------------------------------------------.
1676 | yynewstate -- Push a new state, which is found in yystate. |
1677 `------------------------------------------------------------*/
1679 /* In all cases, when you get here, the value and location stacks
1680 have just been pushed. So pushing a state here evens the stacks. */
1686 if (yyss
+ yystacksize
- 1 <= yyssp
)
1688 /* Get the current used size of the three stacks, in elements. */
1689 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1693 /* Give user a chance to reallocate the stack. Use copies of
1694 these so that the &'s don't force the real ones into
1696 YYSTYPE
*yyvs1
= yyvs
;
1697 yytype_int16
*yyss1
= yyss
;
1698 YYLTYPE
*yyls1
= yyls
;
1700 /* Each stack pointer address is followed by the size of the
1701 data in use in that stack, in bytes. This used to be a
1702 conditional around just the two extra args, but that might
1703 be undefined if yyoverflow is a macro. */
1704 yyoverflow (YY_("memory exhausted"),
1705 &yyss1
, yysize
* sizeof (*yyssp
),
1706 &yyvs1
, yysize
* sizeof (*yyvsp
),
1707 &yyls1
, yysize
* sizeof (*yylsp
),
1714 #else /* no yyoverflow */
1715 # ifndef YYSTACK_RELOCATE
1716 goto yyexhaustedlab
;
1718 /* Extend the stack our own way. */
1719 if (YYMAXDEPTH
<= yystacksize
)
1720 goto yyexhaustedlab
;
1722 if (YYMAXDEPTH
< yystacksize
)
1723 yystacksize
= YYMAXDEPTH
;
1726 yytype_int16
*yyss1
= yyss
;
1727 union yyalloc
*yyptr
=
1728 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1730 goto yyexhaustedlab
;
1731 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1732 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1733 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1734 # undef YYSTACK_RELOCATE
1736 YYSTACK_FREE (yyss1
);
1739 #endif /* no yyoverflow */
1741 yyssp
= yyss
+ yysize
- 1;
1742 yyvsp
= yyvs
+ yysize
- 1;
1743 yylsp
= yyls
+ yysize
- 1;
1745 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1746 (unsigned long int) yystacksize
));
1748 if (yyss
+ yystacksize
- 1 <= yyssp
)
1752 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1754 if (yystate
== YYFINAL
)
1764 /* Do appropriate processing given the current state. Read a
1765 lookahead token if we need one and don't already have one. */
1767 /* First try to decide what to do without reference to lookahead token. */
1768 yyn
= yypact
[yystate
];
1769 if (yyn
== YYPACT_NINF
)
1772 /* Not known => get a lookahead token if don't already have one. */
1774 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1775 if (yychar
== YYEMPTY
)
1777 YYDPRINTF ((stderr
, "Reading a token: "));
1781 if (yychar
<= YYEOF
)
1783 yychar
= yytoken
= YYEOF
;
1784 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1788 yytoken
= YYTRANSLATE (yychar
);
1789 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1792 /* If the proper action on seeing token YYTOKEN is to reduce or to
1793 detect an error, take that action. */
1795 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1800 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1806 /* Count tokens shifted since error; after three, turn off error
1811 /* Shift the lookahead token. */
1812 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1814 /* Discard the shifted token. */
1823 /*-----------------------------------------------------------.
1824 | yydefault -- do the default action for the current state. |
1825 `-----------------------------------------------------------*/
1827 yyn
= yydefact
[yystate
];
1833 /*-----------------------------.
1834 | yyreduce -- Do a reduction. |
1835 `-----------------------------*/
1837 /* yyn is the number of a rule to reduce with. */
1840 /* If YYLEN is nonzero, implement the default value of the action:
1843 Otherwise, the following line sets YYVAL to garbage.
1844 This behavior is undocumented and Bison
1845 users should not rely upon it. Assigning to YYVAL
1846 unconditionally makes the parser a bit smaller, and it avoids a
1847 GCC warning that YYVAL may be used uninitialized. */
1848 yyval
= yyvsp
[1-yylen
];
1850 /* Default location. */
1851 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1852 YY_REDUCE_PRINT (yyn
);
1857 /* Line 1392 of yacc.c */
1858 #line 219 "parse-gram.y"
1860 code_props plain_code
;
1861 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
1862 code_props_translate_code (&plain_code
);
1863 gram_scanner_last_string_free ();
1864 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1865 plain_code
.code
, (yylsp
[0]));
1866 code_scanner_last_string_free ();
1869 /* Line 1392 of yacc.c */
1870 #line 1871 "../../src/parse-gram.c"
1875 /* Line 1392 of yacc.c */
1876 #line 228 "parse-gram.y"
1877 { debug_flag
= true; }
1879 /* Line 1392 of yacc.c */
1880 #line 1881 "../../src/parse-gram.c"
1885 /* Line 1392 of yacc.c */
1886 #line 230 "parse-gram.y"
1888 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
));
1891 /* Line 1392 of yacc.c */
1892 #line 1893 "../../src/parse-gram.c"
1897 /* Line 1392 of yacc.c */
1898 #line 233 "parse-gram.y"
1899 { defines_flag
= true; }
1901 /* Line 1392 of yacc.c */
1902 #line 1903 "../../src/parse-gram.c"
1907 /* Line 1392 of yacc.c */
1908 #line 235 "parse-gram.y"
1910 defines_flag
= true;
1911 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
1914 /* Line 1392 of yacc.c */
1915 #line 1916 "../../src/parse-gram.c"
1920 /* Line 1392 of yacc.c */
1921 #line 239 "parse-gram.y"
1922 { error_verbose
= true; }
1924 /* Line 1392 of yacc.c */
1925 #line 1926 "../../src/parse-gram.c"
1930 /* Line 1392 of yacc.c */
1931 #line 240 "parse-gram.y"
1932 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
1934 /* Line 1392 of yacc.c */
1935 #line 1936 "../../src/parse-gram.c"
1940 /* Line 1392 of yacc.c */
1941 #line 241 "parse-gram.y"
1942 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
1944 /* Line 1392 of yacc.c */
1945 #line 1946 "../../src/parse-gram.c"
1950 /* Line 1392 of yacc.c */
1951 #line 242 "parse-gram.y"
1952 { spec_file_prefix
= (yyvsp
[0].chars
); }
1954 /* Line 1392 of yacc.c */
1955 #line 1956 "../../src/parse-gram.c"
1960 /* Line 1392 of yacc.c */
1961 #line 243 "parse-gram.y"
1962 { spec_file_prefix
= (yyvsp
[0].chars
); }
1964 /* Line 1392 of yacc.c */
1965 #line 1966 "../../src/parse-gram.c"
1970 /* Line 1392 of yacc.c */
1971 #line 245 "parse-gram.y"
1973 nondeterministic_parser
= true;
1977 /* Line 1392 of yacc.c */
1978 #line 1979 "../../src/parse-gram.c"
1983 /* Line 1392 of yacc.c */
1984 #line 250 "parse-gram.y"
1987 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
1988 code_props_translate_code (&action
);
1989 gram_scanner_last_string_free ();
1990 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
1991 code_scanner_last_string_free ();
1994 /* Line 1392 of yacc.c */
1995 #line 1996 "../../src/parse-gram.c"
2000 /* Line 1392 of yacc.c */
2001 #line 258 "parse-gram.y"
2002 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2004 /* Line 1392 of yacc.c */
2005 #line 2006 "../../src/parse-gram.c"
2010 /* Line 1392 of yacc.c */
2011 #line 259 "parse-gram.y"
2012 { add_param ("lex_param", (yyvsp
[0].code
), (yylsp
[0])); }
2014 /* Line 1392 of yacc.c */
2015 #line 2016 "../../src/parse-gram.c"
2020 /* Line 1392 of yacc.c */
2021 #line 260 "parse-gram.y"
2022 { locations_flag
= true; }
2024 /* Line 1392 of yacc.c */
2025 #line 2026 "../../src/parse-gram.c"
2030 /* Line 1392 of yacc.c */
2031 #line 261 "parse-gram.y"
2032 { spec_name_prefix
= (yyvsp
[0].chars
); }
2034 /* Line 1392 of yacc.c */
2035 #line 2036 "../../src/parse-gram.c"
2040 /* Line 1392 of yacc.c */
2041 #line 262 "parse-gram.y"
2042 { spec_name_prefix
= (yyvsp
[0].chars
); }
2044 /* Line 1392 of yacc.c */
2045 #line 2046 "../../src/parse-gram.c"
2050 /* Line 1392 of yacc.c */
2051 #line 263 "parse-gram.y"
2052 { no_lines_flag
= true; }
2054 /* Line 1392 of yacc.c */
2055 #line 2056 "../../src/parse-gram.c"
2060 /* Line 1392 of yacc.c */
2061 #line 264 "parse-gram.y"
2062 { nondeterministic_parser
= true; }
2064 /* Line 1392 of yacc.c */
2065 #line 2066 "../../src/parse-gram.c"
2070 /* Line 1392 of yacc.c */
2071 #line 265 "parse-gram.y"
2072 { spec_outfile
= (yyvsp
[0].chars
); }
2074 /* Line 1392 of yacc.c */
2075 #line 2076 "../../src/parse-gram.c"
2080 /* Line 1392 of yacc.c */
2081 #line 266 "parse-gram.y"
2082 { spec_outfile
= (yyvsp
[0].chars
); }
2084 /* Line 1392 of yacc.c */
2085 #line 2086 "../../src/parse-gram.c"
2090 /* Line 1392 of yacc.c */
2091 #line 267 "parse-gram.y"
2092 { add_param ("parse_param", (yyvsp
[0].code
), (yylsp
[0])); }
2094 /* Line 1392 of yacc.c */
2095 #line 2096 "../../src/parse-gram.c"
2100 /* Line 1392 of yacc.c */
2101 #line 269 "parse-gram.y"
2103 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2104 `%define api.pure' in a backward-compatible manner here. First, don't
2105 complain if %pure-parser is specified multiple times. */
2106 if (!muscle_find_const ("percent_define(api.pure)"))
2107 muscle_percent_define_insert ("api.pure", (yylsp
[0]), "");
2108 /* In all cases, use api.pure now so that the backend doesn't complain if
2109 the skeleton ignores api.pure, but do warn now if there's a previous
2110 conflicting definition from an actual %define. */
2111 if (!muscle_percent_define_flag_if ("api.pure"))
2112 muscle_percent_define_insert ("api.pure", (yylsp
[0]), "");
2115 /* Line 1392 of yacc.c */
2116 #line 2117 "../../src/parse-gram.c"
2121 /* Line 1392 of yacc.c */
2122 #line 281 "parse-gram.y"
2123 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2125 /* Line 1392 of yacc.c */
2126 #line 2127 "../../src/parse-gram.c"
2131 /* Line 1392 of yacc.c */
2132 #line 283 "parse-gram.y"
2134 char const *skeleton_user
= (yyvsp
[0].chars
);
2135 if (strchr (skeleton_user
, '/'))
2137 size_t dir_length
= strlen (current_file
);
2138 char *skeleton_build
;
2139 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2141 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2144 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2147 strncpy (skeleton_build
, current_file
, dir_length
);
2148 skeleton_build
[dir_length
++] = '/';
2150 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2151 skeleton_user
= uniqstr_new (skeleton_build
);
2152 free (skeleton_build
);
2154 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2157 /* Line 1392 of yacc.c */
2158 #line 2159 "../../src/parse-gram.c"
2163 /* Line 1392 of yacc.c */
2164 #line 306 "parse-gram.y"
2165 { token_table_flag
= true; }
2167 /* Line 1392 of yacc.c */
2168 #line 2169 "../../src/parse-gram.c"
2173 /* Line 1392 of yacc.c */
2174 #line 307 "parse-gram.y"
2175 { report_flag
|= report_states
; }
2177 /* Line 1392 of yacc.c */
2178 #line 2179 "../../src/parse-gram.c"
2183 /* Line 1392 of yacc.c */
2184 #line 308 "parse-gram.y"
2185 { yacc_flag
= true; }
2187 /* Line 1392 of yacc.c */
2188 #line 2189 "../../src/parse-gram.c"
2193 /* Line 1392 of yacc.c */
2194 #line 316 "parse-gram.y"
2196 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2199 /* Line 1392 of yacc.c */
2200 #line 2201 "../../src/parse-gram.c"
2205 /* Line 1392 of yacc.c */
2206 #line 320 "parse-gram.y"
2209 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2210 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2211 symbol_list_free ((yyvsp
[0].list
));
2214 /* Line 1392 of yacc.c */
2215 #line 2216 "../../src/parse-gram.c"
2220 /* Line 1392 of yacc.c */
2221 #line 327 "parse-gram.y"
2224 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2225 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2226 symbol_list_free ((yyvsp
[0].list
));
2229 /* Line 1392 of yacc.c */
2230 #line 2231 "../../src/parse-gram.c"
2235 /* Line 1392 of yacc.c */
2236 #line 334 "parse-gram.y"
2238 default_prec
= true;
2241 /* Line 1392 of yacc.c */
2242 #line 2243 "../../src/parse-gram.c"
2247 /* Line 1392 of yacc.c */
2248 #line 338 "parse-gram.y"
2250 default_prec
= false;
2253 /* Line 1392 of yacc.c */
2254 #line 2255 "../../src/parse-gram.c"
2259 /* Line 1392 of yacc.c */
2260 #line 342 "parse-gram.y"
2262 /* Do not invoke muscle_percent_code_grow here since it invokes
2263 muscle_user_name_list_grow. */
2264 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2265 code_scanner_last_string_free ();
2268 /* Line 1392 of yacc.c */
2269 #line 2270 "../../src/parse-gram.c"
2274 /* Line 1392 of yacc.c */
2275 #line 349 "parse-gram.y"
2277 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2278 code_scanner_last_string_free ();
2281 /* Line 1392 of yacc.c */
2282 #line 2283 "../../src/parse-gram.c"
2287 /* Line 1392 of yacc.c */
2288 #line 363 "parse-gram.y"
2291 /* Line 1392 of yacc.c */
2292 #line 2293 "../../src/parse-gram.c"
2297 /* Line 1392 of yacc.c */
2298 #line 364 "parse-gram.y"
2299 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2301 /* Line 1392 of yacc.c */
2302 #line 2303 "../../src/parse-gram.c"
2307 /* Line 1392 of yacc.c */
2308 #line 369 "parse-gram.y"
2311 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2312 code_scanner_last_string_free ();
2315 /* Line 1392 of yacc.c */
2316 #line 2317 "../../src/parse-gram.c"
2321 /* Line 1392 of yacc.c */
2322 #line 380 "parse-gram.y"
2323 { current_class
= nterm_sym
; }
2325 /* Line 1392 of yacc.c */
2326 #line 2327 "../../src/parse-gram.c"
2331 /* Line 1392 of yacc.c */
2332 #line 381 "parse-gram.y"
2334 current_class
= unknown_sym
;
2335 current_type
= NULL
;
2338 /* Line 1392 of yacc.c */
2339 #line 2340 "../../src/parse-gram.c"
2344 /* Line 1392 of yacc.c */
2345 #line 385 "parse-gram.y"
2346 { current_class
= token_sym
; }
2348 /* Line 1392 of yacc.c */
2349 #line 2350 "../../src/parse-gram.c"
2354 /* Line 1392 of yacc.c */
2355 #line 386 "parse-gram.y"
2357 current_class
= unknown_sym
;
2358 current_type
= NULL
;
2361 /* Line 1392 of yacc.c */
2362 #line 2363 "../../src/parse-gram.c"
2367 /* Line 1392 of yacc.c */
2368 #line 391 "parse-gram.y"
2372 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2373 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2374 symbol_list_free ((yyvsp
[0].list
));
2377 /* Line 1392 of yacc.c */
2378 #line 2379 "../../src/parse-gram.c"
2383 /* Line 1392 of yacc.c */
2384 #line 402 "parse-gram.y"
2388 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2390 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2391 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2393 symbol_list_free ((yyvsp
[0].list
));
2394 current_type
= NULL
;
2397 /* Line 1392 of yacc.c */
2398 #line 2399 "../../src/parse-gram.c"
2403 /* Line 1392 of yacc.c */
2404 #line 416 "parse-gram.y"
2405 { (yyval
.assoc
) = left_assoc
; }
2407 /* Line 1392 of yacc.c */
2408 #line 2409 "../../src/parse-gram.c"
2413 /* Line 1392 of yacc.c */
2414 #line 417 "parse-gram.y"
2415 { (yyval
.assoc
) = right_assoc
; }
2417 /* Line 1392 of yacc.c */
2418 #line 2419 "../../src/parse-gram.c"
2423 /* Line 1392 of yacc.c */
2424 #line 418 "parse-gram.y"
2425 { (yyval
.assoc
) = non_assoc
; }
2427 /* Line 1392 of yacc.c */
2428 #line 2429 "../../src/parse-gram.c"
2433 /* Line 1392 of yacc.c */
2434 #line 419 "parse-gram.y"
2435 { (yyval
.assoc
) = precedence_assoc
; }
2437 /* Line 1392 of yacc.c */
2438 #line 2439 "../../src/parse-gram.c"
2443 /* Line 1392 of yacc.c */
2444 #line 423 "parse-gram.y"
2445 { current_type
= NULL
; }
2447 /* Line 1392 of yacc.c */
2448 #line 2449 "../../src/parse-gram.c"
2453 /* Line 1392 of yacc.c */
2454 #line 424 "parse-gram.y"
2455 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2457 /* Line 1392 of yacc.c */
2458 #line 2459 "../../src/parse-gram.c"
2463 /* Line 1392 of yacc.c */
2464 #line 430 "parse-gram.y"
2465 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2467 /* Line 1392 of yacc.c */
2468 #line 2469 "../../src/parse-gram.c"
2473 /* Line 1392 of yacc.c */
2474 #line 432 "parse-gram.y"
2475 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2477 /* Line 1392 of yacc.c */
2478 #line 2479 "../../src/parse-gram.c"
2483 /* Line 1392 of yacc.c */
2484 #line 436 "parse-gram.y"
2485 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2487 /* Line 1392 of yacc.c */
2488 #line 2489 "../../src/parse-gram.c"
2493 /* Line 1392 of yacc.c */
2494 #line 437 "parse-gram.y"
2495 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2497 /* Line 1392 of yacc.c */
2498 #line 2499 "../../src/parse-gram.c"
2503 /* Line 1392 of yacc.c */
2504 #line 443 "parse-gram.y"
2505 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2507 /* Line 1392 of yacc.c */
2508 #line 2509 "../../src/parse-gram.c"
2513 /* Line 1392 of yacc.c */
2514 #line 445 "parse-gram.y"
2515 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2517 /* Line 1392 of yacc.c */
2518 #line 2519 "../../src/parse-gram.c"
2523 /* Line 1392 of yacc.c */
2524 #line 449 "parse-gram.y"
2525 { (yyval
.list
) = (yyvsp
[0].list
); }
2527 /* Line 1392 of yacc.c */
2528 #line 2529 "../../src/parse-gram.c"
2533 /* Line 1392 of yacc.c */
2534 #line 450 "parse-gram.y"
2535 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2537 /* Line 1392 of yacc.c */
2538 #line 2539 "../../src/parse-gram.c"
2543 /* Line 1392 of yacc.c */
2544 #line 454 "parse-gram.y"
2545 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2547 /* Line 1392 of yacc.c */
2548 #line 2549 "../../src/parse-gram.c"
2553 /* Line 1392 of yacc.c */
2554 #line 455 "parse-gram.y"
2555 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2557 /* Line 1392 of yacc.c */
2558 #line 2559 "../../src/parse-gram.c"
2563 /* Line 1392 of yacc.c */
2564 #line 456 "parse-gram.y"
2565 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2567 /* Line 1392 of yacc.c */
2568 #line 2569 "../../src/parse-gram.c"
2573 /* Line 1392 of yacc.c */
2574 #line 457 "parse-gram.y"
2575 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2577 /* Line 1392 of yacc.c */
2578 #line 2579 "../../src/parse-gram.c"
2583 /* Line 1392 of yacc.c */
2584 #line 463 "parse-gram.y"
2586 current_type
= (yyvsp
[0].uniqstr
);
2590 /* Line 1392 of yacc.c */
2591 #line 2592 "../../src/parse-gram.c"
2596 /* Line 1392 of yacc.c */
2597 #line 468 "parse-gram.y"
2599 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2600 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2603 /* Line 1392 of yacc.c */
2604 #line 2605 "../../src/parse-gram.c"
2609 /* Line 1392 of yacc.c */
2610 #line 473 "parse-gram.y"
2612 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2613 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2614 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2617 /* Line 1392 of yacc.c */
2618 #line 2619 "../../src/parse-gram.c"
2623 /* Line 1392 of yacc.c */
2624 #line 479 "parse-gram.y"
2626 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2627 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2628 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2631 /* Line 1392 of yacc.c */
2632 #line 2633 "../../src/parse-gram.c"
2637 /* Line 1392 of yacc.c */
2638 #line 485 "parse-gram.y"
2640 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2641 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2642 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2643 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2646 /* Line 1392 of yacc.c */
2647 #line 2648 "../../src/parse-gram.c"
2652 /* Line 1392 of yacc.c */
2653 #line 515 "parse-gram.y"
2658 /* Line 1392 of yacc.c */
2659 #line 2660 "../../src/parse-gram.c"
2664 /* Line 1392 of yacc.c */
2665 #line 521 "parse-gram.y"
2666 { current_lhs
= (yyvsp
[0].symbol
); current_lhs_location
= (yylsp
[0]); }
2668 /* Line 1392 of yacc.c */
2669 #line 2670 "../../src/parse-gram.c"
2674 /* Line 1392 of yacc.c */
2675 #line 525 "parse-gram.y"
2676 { grammar_current_rule_end ((yylsp
[0])); }
2678 /* Line 1392 of yacc.c */
2679 #line 2680 "../../src/parse-gram.c"
2684 /* Line 1392 of yacc.c */
2685 #line 526 "parse-gram.y"
2686 { grammar_current_rule_end ((yylsp
[0])); }
2688 /* Line 1392 of yacc.c */
2689 #line 2690 "../../src/parse-gram.c"
2694 /* Line 1392 of yacc.c */
2695 #line 532 "parse-gram.y"
2696 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2698 /* Line 1392 of yacc.c */
2699 #line 2700 "../../src/parse-gram.c"
2704 /* Line 1392 of yacc.c */
2705 #line 534 "parse-gram.y"
2706 { grammar_current_rule_symbol_append ((yyvsp
[0].symbol
), (yylsp
[0])); }
2708 /* Line 1392 of yacc.c */
2709 #line 2710 "../../src/parse-gram.c"
2714 /* Line 1392 of yacc.c */
2715 #line 536 "parse-gram.y"
2716 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0])); }
2718 /* Line 1392 of yacc.c */
2719 #line 2720 "../../src/parse-gram.c"
2724 /* Line 1392 of yacc.c */
2725 #line 538 "parse-gram.y"
2726 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2728 /* Line 1392 of yacc.c */
2729 #line 2730 "../../src/parse-gram.c"
2734 /* Line 1392 of yacc.c */
2735 #line 540 "parse-gram.y"
2736 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2738 /* Line 1392 of yacc.c */
2739 #line 2740 "../../src/parse-gram.c"
2744 /* Line 1392 of yacc.c */
2745 #line 542 "parse-gram.y"
2746 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2748 /* Line 1392 of yacc.c */
2749 #line 2750 "../../src/parse-gram.c"
2754 /* Line 1392 of yacc.c */
2755 #line 552 "parse-gram.y"
2756 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2758 /* Line 1392 of yacc.c */
2759 #line 2760 "../../src/parse-gram.c"
2764 /* Line 1392 of yacc.c */
2765 #line 558 "parse-gram.y"
2770 /* Line 1392 of yacc.c */
2771 #line 2772 "../../src/parse-gram.c"
2776 /* Line 1392 of yacc.c */
2777 #line 571 "parse-gram.y"
2779 code_props plain_code
;
2780 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2781 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2782 code_props_translate_code (&plain_code
);
2783 gram_scanner_last_string_free ();
2784 (yyval
.chars
) = plain_code
.code
;
2787 /* Line 1392 of yacc.c */
2788 #line 2789 "../../src/parse-gram.c"
2793 /* Line 1392 of yacc.c */
2794 #line 591 "parse-gram.y"
2795 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2797 /* Line 1392 of yacc.c */
2798 #line 2799 "../../src/parse-gram.c"
2803 /* Line 1392 of yacc.c */
2804 #line 593 "parse-gram.y"
2806 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2807 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2808 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2811 /* Line 1392 of yacc.c */
2812 #line 2813 "../../src/parse-gram.c"
2817 /* Line 1392 of yacc.c */
2818 #line 601 "parse-gram.y"
2819 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2821 /* Line 1392 of yacc.c */
2822 #line 2823 "../../src/parse-gram.c"
2827 /* Line 1392 of yacc.c */
2828 #line 613 "parse-gram.y"
2830 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2831 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2834 /* Line 1392 of yacc.c */
2835 #line 2836 "../../src/parse-gram.c"
2840 /* Line 1392 of yacc.c */
2841 #line 622 "parse-gram.y"
2843 code_props plain_code
;
2844 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2845 code_props_translate_code (&plain_code
);
2846 gram_scanner_last_string_free ();
2847 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2848 code_scanner_last_string_free ();
2851 /* Line 1392 of yacc.c */
2852 #line 2853 "../../src/parse-gram.c"
2857 /* Line 1392 of yacc.c */
2858 #line 2859 "../../src/parse-gram.c"
2861 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2865 YY_STACK_PRINT (yyss
, yyssp
);
2870 /* Now `shift' the result of the reduction. Determine what state
2871 that goes to, based on the state we popped back to and the rule
2872 number reduced by. */
2876 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2877 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2878 yystate
= yytable
[yystate
];
2880 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2885 /*------------------------------------.
2886 | yyerrlab -- here on detecting error |
2887 `------------------------------------*/
2889 /* If not already recovering from an error, report this error. */
2893 #if ! YYERROR_VERBOSE
2894 yyerror (YY_("syntax error"));
2897 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2898 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2900 YYSIZE_T yyalloc
= 2 * yysize
;
2901 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2902 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2903 if (yymsg
!= yymsgbuf
)
2904 YYSTACK_FREE (yymsg
);
2905 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2907 yymsg_alloc
= yyalloc
;
2911 yymsg_alloc
= sizeof yymsgbuf
;
2915 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2917 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2922 yyerror (YY_("syntax error"));
2924 goto yyexhaustedlab
;
2930 yyerror_range
[0] = yylloc
;
2932 if (yyerrstatus
== 3)
2934 /* If just tried and failed to reuse lookahead token after an
2935 error, discard it. */
2937 if (yychar
<= YYEOF
)
2939 /* Return failure if at end of input. */
2940 if (yychar
== YYEOF
)
2945 yydestruct ("Error: discarding",
2946 yytoken
, &yylval
, &yylloc
);
2951 /* Else will try to reuse lookahead token after shifting the error
2956 /*---------------------------------------------------.
2957 | yyerrorlab -- error raised explicitly by YYERROR. |
2958 `---------------------------------------------------*/
2961 /* Pacify compilers like GCC when the user code never invokes
2962 YYERROR and the label yyerrorlab therefore never appears in user
2964 if (/*CONSTCOND*/ 0)
2967 yyerror_range
[0] = yylsp
[1-yylen
];
2968 /* Do not reclaim the symbols of the rule which action triggered
2972 YY_STACK_PRINT (yyss
, yyssp
);
2977 /*-------------------------------------------------------------.
2978 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2979 `-------------------------------------------------------------*/
2981 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2985 yyn
= yypact
[yystate
];
2986 if (yyn
!= YYPACT_NINF
)
2989 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2997 /* Pop the current state because it cannot handle the error token. */
3001 yyerror_range
[0] = *yylsp
;
3002 yydestruct ("Error: popping",
3003 yystos
[yystate
], yyvsp
, yylsp
);
3006 YY_STACK_PRINT (yyss
, yyssp
);
3011 yyerror_range
[1] = yylloc
;
3012 /* Using YYLLOC is tempting, but would change the location of
3013 the lookahead. YYLOC is available though. */
3014 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
3017 /* Shift the error token. */
3018 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3024 /*-------------------------------------.
3025 | yyacceptlab -- YYACCEPT comes here. |
3026 `-------------------------------------*/
3031 /*-----------------------------------.
3032 | yyabortlab -- YYABORT comes here. |
3033 `-----------------------------------*/
3038 #if !defined(yyoverflow) || YYERROR_VERBOSE
3039 /*-------------------------------------------------.
3040 | yyexhaustedlab -- memory exhaustion comes here. |
3041 `-------------------------------------------------*/
3043 yyerror (YY_("memory exhausted"));
3049 if (yychar
!= YYEMPTY
)
3050 yydestruct ("Cleanup: discarding lookahead",
3051 yytoken
, &yylval
, &yylloc
);
3052 /* Do not reclaim the symbols of the rule which action triggered
3053 this YYABORT or YYACCEPT. */
3055 YY_STACK_PRINT (yyss
, yyssp
);
3056 while (yyssp
!= yyss
)
3058 yydestruct ("Cleanup: popping",
3059 yystos
[*yyssp
], yyvsp
, yylsp
);
3064 YYSTACK_FREE (yyss
);
3067 if (yymsg
!= yymsgbuf
)
3068 YYSTACK_FREE (yymsg
);
3070 /* Make sure YYID is used. */
3071 return YYID (yyresult
);
3076 /* Line 1612 of yacc.c */
3077 #line 632 "parse-gram.y"
3081 /* Return the location of the left-hand side of a rule whose
3082 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3083 the right-hand side, and return an empty location equal to the end
3084 boundary of RHS[0] if the right-hand side is empty. */
3087 lloc_default (YYLTYPE
const *rhs
, int n
)
3092 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3093 The bug is fixed in 7.4.2m, but play it safe for now. */
3094 loc
.start
= rhs
[n
].end
;
3095 loc
.end
= rhs
[n
].end
;
3097 /* Ignore empty nonterminals the start of the the right-hand side.
3098 Do not bother to ignore them at the end of the right-hand side,
3099 since empty nonterminals have the same end as their predecessors. */
3100 for (i
= 1; i
<= n
; i
++)
3101 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3103 loc
.start
= rhs
[i
].start
;
3111 /* Add a lex-param or a parse-param (depending on TYPE) with
3112 declaration DECL and location LOC. */
3115 add_param (char const *type
, char *decl
, location loc
)
3117 static char const alphanum
[26 + 26 + 1 + 10] =
3118 "abcdefghijklmnopqrstuvwxyz"
3119 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3122 char const *name_start
= NULL
;
3125 /* Stop on last actual character. */
3126 for (p
= decl
; p
[1]; p
++)
3128 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3129 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3132 /* Strip the surrounding '{' and '}', and any blanks just inside
3134 while (*--p
== ' ' || *p
== '\t')
3137 while (*++decl
== ' ' || *decl
== '\t')
3141 complain_at (loc
, _("missing identifier in parameter declaration"));
3148 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3152 name
= xmalloc (name_len
+ 1);
3153 memcpy (name
, name_start
, name_len
);
3154 name
[name_len
] = '\0';
3155 muscle_pair_list_grow (type
, decl
, name
);
3159 gram_scanner_last_string_free ();
3164 version_check (location
const *loc
, char const *version
)
3166 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3168 complain_at (*loc
, "require bison %s, but have %s",
3169 version
, PACKAGE_VERSION
);
3175 gram_error (location
const *loc
, char const *msg
)
3177 complain_at (*loc
, "%s", msg
);
3181 token_name (int type
)
3183 return yytname
[YYTRANSLATE (type
)];
3194 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3195 return quotearg_style (escape_quoting_style
, buf
);