1 /* A Bison parser, made by GNU Bison 2.4.390-0aaa. */
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.390-0aaa"
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 "named-ref.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 named_ref
*current_lhs_named_ref
;
145 static int current_prec
= 0;
147 #define YYTYPE_INT16 int_fast16_t
148 #define YYTYPE_INT8 int_fast8_t
149 #define YYTYPE_UINT16 uint_fast16_t
150 #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,
196 PERCENT_DEFAULT_PREC
= 273,
197 PERCENT_DEFINE
= 274,
198 PERCENT_DEFINES
= 275,
199 PERCENT_ERROR_VERBOSE
= 276,
200 PERCENT_EXPECT
= 277,
201 PERCENT_EXPECT_RR
= 278,
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_NAME_PREFIX
= 285,
209 PERCENT_NO_DEFAULT_PREC
= 286,
210 PERCENT_NO_LINES
= 287,
211 PERCENT_NONDETERMINISTIC_PARSER
= 288,
212 PERCENT_OUTPUT
= 289,
213 PERCENT_PARSE_PARAM
= 290,
214 PERCENT_REQUIRE
= 291,
215 PERCENT_SKELETON
= 292,
217 PERCENT_TOKEN_TABLE
= 294,
218 PERCENT_VERBOSE
= 295,
226 PERCENT_PERCENT
= 303,
241 #define PERCENT_TOKEN 260
242 #define PERCENT_NTERM 261
243 #define PERCENT_TYPE 262
244 #define PERCENT_DESTRUCTOR 263
245 #define PERCENT_PRINTER 264
246 #define PERCENT_LEFT 265
247 #define PERCENT_RIGHT 266
248 #define PERCENT_NONASSOC 267
249 #define PERCENT_PRECEDENCE 268
250 #define PERCENT_PREC 269
251 #define PERCENT_DPREC 270
252 #define PERCENT_MERGE 271
253 #define PERCENT_CODE 272
254 #define PERCENT_DEFAULT_PREC 273
255 #define PERCENT_DEFINE 274
256 #define PERCENT_DEFINES 275
257 #define PERCENT_ERROR_VERBOSE 276
258 #define PERCENT_EXPECT 277
259 #define PERCENT_EXPECT_RR 278
260 #define PERCENT_FLAG 279
261 #define PERCENT_FILE_PREFIX 280
262 #define PERCENT_GLR_PARSER 281
263 #define PERCENT_INITIAL_ACTION 282
264 #define PERCENT_LANGUAGE 283
265 #define PERCENT_LEX_PARAM 284
266 #define PERCENT_NAME_PREFIX 285
267 #define PERCENT_NO_DEFAULT_PREC 286
268 #define PERCENT_NO_LINES 287
269 #define PERCENT_NONDETERMINISTIC_PARSER 288
270 #define PERCENT_OUTPUT 289
271 #define PERCENT_PARSE_PARAM 290
272 #define PERCENT_REQUIRE 291
273 #define PERCENT_SKELETON 292
274 #define PERCENT_START 293
275 #define PERCENT_TOKEN_TABLE 294
276 #define PERCENT_VERBOSE 295
277 #define PERCENT_YACC 296
278 #define BRACED_CODE 297
284 #define PERCENT_PERCENT 303
287 #define SEMICOLON 306
291 #define BRACKETED_ID 310
292 #define PERCENT_UNION 311
297 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
298 typedef union YYSTYPE
300 /* Line 216 of yacc.c */
301 #line 94 "parse-gram.y"
310 unsigned char character
;
311 named_ref
*named_ref
;
314 /* Line 216 of yacc.c */
315 #line 316 "src/parse-gram.c"
317 # define YYSTYPE_IS_TRIVIAL 1
318 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
319 # define YYSTYPE_IS_DECLARED 1
322 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
323 typedef struct YYLTYPE
330 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
331 # define YYLTYPE_IS_DECLARED 1
332 # define YYLTYPE_IS_TRIVIAL 1
336 /* Copy the second part of user declarations. */
338 /* Line 266 of yacc.c */
339 #line 340 "src/parse-gram.c"
346 typedef YYTYPE_UINT8 yytype_uint8
;
348 typedef unsigned char yytype_uint8
;
352 typedef YYTYPE_INT8 yytype_int8
;
353 #elif (defined __STDC__ || defined __C99__FUNC__ \
354 || defined __cplusplus || defined _MSC_VER)
355 typedef signed char yytype_int8
;
357 typedef short int yytype_int8
;
361 typedef YYTYPE_UINT16 yytype_uint16
;
363 typedef unsigned short int yytype_uint16
;
367 typedef YYTYPE_INT16 yytype_int16
;
369 typedef short int yytype_int16
;
373 # ifdef __SIZE_TYPE__
374 # define YYSIZE_T __SIZE_TYPE__
375 # elif defined size_t
376 # define YYSIZE_T size_t
377 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
378 || defined __cplusplus || defined _MSC_VER)
379 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
380 # define YYSIZE_T size_t
382 # define YYSIZE_T unsigned int
386 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
391 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
392 # define YY_(msgid) dgettext ("bison-runtime", msgid)
396 # define YY_(msgid) msgid
400 /* Suppress unused-variable warnings by "using" E. */
401 #if ! defined lint || defined __GNUC__
402 # define YYUSE(e) ((void) (e))
404 # define YYUSE(e) /* empty */
407 /* Identity function, used to suppress warnings about constant conditions. */
411 #if (defined __STDC__ || defined __C99__FUNC__ \
412 || defined __cplusplus || defined _MSC_VER)
425 #if ! defined yyoverflow || YYERROR_VERBOSE
427 /* The parser invokes alloca or malloc; define the necessary symbols. */
429 # ifdef YYSTACK_USE_ALLOCA
430 # if YYSTACK_USE_ALLOCA
432 # define YYSTACK_ALLOC __builtin_alloca
433 # elif defined __BUILTIN_VA_ARG_INCR
434 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
436 # define YYSTACK_ALLOC __alloca
437 # elif defined _MSC_VER
438 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
439 # define alloca _alloca
441 # define YYSTACK_ALLOC alloca
442 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
443 || defined __cplusplus || defined _MSC_VER)
444 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
453 # ifdef YYSTACK_ALLOC
454 /* Pacify GCC's `empty if-body' warning. */
455 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
456 # ifndef YYSTACK_ALLOC_MAXIMUM
457 /* The OS might guarantee only one guard page at the bottom of the stack,
458 and a page size can be as small as 4096 bytes. So we cannot safely
459 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
460 to allow for a few compiler-allocated temporary stack slots. */
461 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
464 # define YYSTACK_ALLOC YYMALLOC
465 # define YYSTACK_FREE YYFREE
466 # ifndef YYSTACK_ALLOC_MAXIMUM
467 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
469 # if (defined __cplusplus && ! defined _STDLIB_H \
470 && ! ((defined YYMALLOC || defined malloc) \
471 && (defined YYFREE || defined free)))
472 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
478 # define YYMALLOC malloc
479 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
480 || defined __cplusplus || defined _MSC_VER)
481 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
486 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
487 || defined __cplusplus || defined _MSC_VER)
488 void free (void *); /* INFRINGES ON USER NAME SPACE */
492 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
495 #if (! defined yyoverflow \
496 && (! defined __cplusplus \
497 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
498 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
500 /* A type that is properly aligned for any stack member. */
503 yytype_int16 yyss_alloc
;
508 /* The size of the maximum gap between one aligned stack and the next. */
509 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
511 /* The size of an array large to enough to hold all stacks, each with
513 # define YYSTACK_BYTES(N) \
514 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
515 + 2 * YYSTACK_GAP_MAXIMUM)
517 /* Copy COUNT objects from FROM to TO. The source and destination do
520 # if defined __GNUC__ && 1 < __GNUC__
521 # define YYCOPY(To, From, Count) \
522 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
524 # define YYCOPY(To, From, Count) \
528 for (yyi = 0; yyi < (Count); yyi++) \
529 (To)[yyi] = (From)[yyi]; \
535 /* Relocate STACK from its old location to the new one. The
536 local variables YYSIZE and YYSTACKSIZE give the old and new number of
537 elements in the stack, and YYPTR gives the new location of the
538 stack. Advance YYPTR to a properly aligned location for the next
540 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
543 YYSIZE_T yynewbytes; \
544 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
545 Stack = &yyptr->Stack_alloc; \
546 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
547 yyptr += yynewbytes / sizeof (*yyptr); \
553 /* YYFINAL -- State number of the termination state. */
555 /* YYLAST -- Last index in YYTABLE. */
558 /* YYNTOKENS -- Number of terminals. */
560 /* YYNNTS -- Number of nonterminals. */
562 /* YYNRULES -- Number of rules. */
564 /* YYNSTATES -- Number of states. */
565 #define YYNSTATES 146
567 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
568 by yylex, with out-of-bounds checking. */
570 #define YYMAXUTOK 311
572 #define YYTRANSLATE(YYX) \
573 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
575 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
576 as returned by yylex, without out-of-bounds checking. */
577 static const yytype_uint8 yytranslate
[] =
579 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
605 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
606 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
607 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
608 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
609 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
614 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
615 static const yytype_uint16 yyrline
[] =
617 0, 207, 207, 215, 217, 221, 222, 232, 236, 241,
618 242, 247, 252, 253, 254, 255, 256, 261, 270, 271,
619 272, 273, 274, 275, 276, 277, 278, 279, 280, 304,
620 305, 306, 307, 311, 312, 313, 317, 324, 331, 335,
621 339, 346, 361, 362, 366, 378, 378, 383, 383, 388,
622 399, 414, 415, 416, 417, 421, 422, 427, 429, 434,
623 435, 440, 442, 447, 448, 452, 453, 454, 455, 460,
624 465, 470, 476, 482, 493, 494, 503, 504, 510, 511,
625 512, 519, 519, 524, 525, 526, 531, 533, 535, 537,
626 539, 541, 546, 548, 559, 560, 565, 566, 575, 595,
627 597, 606, 611, 612, 617, 624, 626
631 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
632 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
633 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
634 static const char *const yytname
[] =
636 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
637 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
638 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
639 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
640 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
641 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
642 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
643 "\"%lex-param\"", "\"%name-prefix\"", "\"%no-default-prec\"",
644 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
645 "\"%parse-param\"", "\"%require\"", "\"%skeleton\"", "\"%start\"",
646 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"",
647 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
648 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
649 "\"[identifier]\"", "\"%union\"", "$accept", "input",
650 "prologue_declarations", "prologue_declaration", "grammar_declaration",
651 "union_name", "symbol_declaration", "$@1", "$@2",
652 "precedence_declaration", "precedence_declarator", "tag.opt",
653 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
654 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
655 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
656 "named_ref.opt", "variable", "content.opt", "braceless", "id",
657 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
662 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
663 (internal) symbol number NUM (which must be that of a token). */
664 static const yytype_uint16 yytoknum
[] =
666 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
667 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
668 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
669 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
670 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
671 305, 306, 307, 308, 309, 310, 311
675 #define YYPACT_NINF -53
677 #define yypact_value_is_default(yystate) \
680 #define YYTABLE_NINF -106
682 #define yytable_value_is_error(yytable_value) \
685 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
687 static const yytype_int16 yypact
[] =
689 -53, 5, 102, -53, -53, -53, -10, 8, 27, -53,
690 -53, -53, -53, 18, -53, 32, 55, -53, 70, 77,
691 -53, 17, -53, 43, 91, 53, 41, -53, -53, -53,
692 42, 54, 94, 96, 0, -53, -53, -53, 16, -53,
693 -53, 56, -53, -53, -53, -53, 48, 30, 30, 0,
694 13, 13, -53, 61, -53, -53, -53, 101, -53, -53,
695 -53, -53, 113, -53, -53, -53, -53, 114, -53, 115,
696 -53, -53, -53, -53, -53, -53, -53, -53, -53, 93,
697 -53, 95, 1, -53, -53, 50, -53, 61, -53, 0,
698 -53, -53, 30, 33, 30, 0, -53, -53, -53, -53,
699 13, -53, -53, 13, -53, -53, -53, -53, -53, -53,
700 -53, -53, 103, -53, -53, -53, -53, -53, 0, -53,
701 141, -53, 145, -53, -53, -53, -53, -53, -53, -53,
702 -53, 39, 37, -53, -53, 0, 147, 97, 50, 50,
703 37, -53, -53, -53, -53, -53
706 /* YYDEFACT[S] -- default reduction number in state S. Performed when
707 YYTABLE does not specify something else to do. Zero means the default
709 static const yytype_uint8 yydefact
[] =
711 3, 0, 0, 1, 47, 45, 0, 0, 0, 51,
712 52, 53, 54, 0, 38, 0, 9, 11, 0, 0,
713 7, 0, 16, 0, 0, 0, 0, 39, 22, 23,
714 0, 0, 0, 0, 0, 29, 30, 31, 0, 6,
715 32, 42, 4, 5, 34, 33, 55, 0, 0, 0,
716 0, 0, 98, 0, 40, 95, 94, 96, 10, 12,
717 13, 14, 0, 17, 18, 19, 20, 0, 24, 0,
718 26, 27, 28, 104, 100, 99, 102, 35, 103, 0,
719 101, 0, 0, 76, 78, 92, 43, 0, 56, 0,
720 69, 74, 48, 70, 46, 49, 61, 66, 67, 68,
721 36, 63, 65, 37, 41, 97, 8, 15, 21, 25,
722 80, 79, 0, 77, 2, 93, 81, 44, 50, 57,
723 59, 75, 71, 72, 62, 64, 106, 86, 58, 60,
724 73, 82, 83, 86, 85, 0, 0, 0, 92, 92,
725 84, 89, 90, 91, 88, 87
728 /* YYPGOTO[NTERM-NUM]. */
729 static const yytype_int16 yypgoto
[] =
731 -53, -53, -53, -53, 152, -53, -53, -53, -53, -53,
732 -53, -53, -53, 38, -53, 104, -32, -3, 109, -53,
733 78, -53, -53, -53, 26, -46, -53, -53, -49, -17,
737 /* YYDEFGOTO[NTERM-NUM]. */
738 static const yytype_int16 yydefgoto
[] =
740 -1, 1, 2, 42, 81, 87, 44, 48, 47, 45,
741 46, 89, 118, 119, 95, 100, 101, 91, 92, 82,
742 83, 84, 127, 131, 132, 116, 57, 106, 54, 76,
746 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
747 positive, shift that token. If negative, reduce the rule which
748 number is the opposite. If YYTABLE_NINF, syntax error. */
749 static const yytype_int16 yytable
[] =
751 77, -105, 79, 73, 104, 3, 4, 5, 6, 7,
752 8, 9, 10, 11, 12, 96, 73, 79, 13, 14,
753 61, 4, 5, 6, 7, 8, 9, 10, 11, 12,
754 93, 93, 27, 13, 14, 55, 73, 122, 117, 34,
755 73, 123, 49, 74, 66, 68, 75, 27, 80, 112,
756 50, 135, 136, 137, 34, 120, 74, 41, 58, 75,
757 52, 124, 62, 80, 53, 97, 98, 99, 125, 51,
758 130, 125, 41, 74, 59, 93, 75, 93, 56, 138,
759 74, 60, 90, 75, 120, 63, 67, 69, 133, 121,
760 134, 121, 144, 145, 64, 65, 70, 71, 139, 72,
761 88, 141, 86, 52, 105, 115, 139, 4, 5, 6,
762 7, 8, 9, 10, 11, 12, 107, 108, 109, 13,
763 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
764 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
765 34, 35, 36, 37, 110, 129, 111, 126, 73, 143,
766 38, 142, 39, 40, 43, 103, 128, 94, 41, 140,
770 static const yytype_uint8 yycheck
[] =
772 34, 0, 1, 3, 53, 0, 5, 6, 7, 8,
773 9, 10, 11, 12, 13, 49, 3, 1, 17, 18,
774 3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
775 47, 48, 31, 17, 18, 3, 3, 4, 87, 38,
776 3, 93, 52, 43, 3, 3, 46, 31, 47, 48,
777 42, 14, 15, 16, 38, 89, 43, 56, 3, 46,
778 42, 95, 45, 47, 46, 52, 53, 54, 100, 42,
779 122, 103, 56, 43, 4, 92, 46, 94, 46, 42,
780 43, 4, 52, 46, 118, 42, 45, 45, 49, 92,
781 51, 94, 138, 139, 3, 42, 42, 3, 132, 3,
782 52, 135, 46, 42, 3, 55, 140, 5, 6, 7,
783 8, 9, 10, 11, 12, 13, 3, 3, 3, 17,
784 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
785 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
786 38, 39, 40, 41, 51, 4, 51, 44, 3, 52,
787 48, 4, 50, 51, 2, 51, 118, 48, 56, 133,
791 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
792 symbol of state STATE-NUM. */
793 static const yytype_uint8 yystos
[] =
795 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
796 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
797 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
798 34, 35, 36, 37, 38, 39, 40, 41, 48, 50,
799 51, 56, 60, 61, 63, 66, 67, 65, 64, 52,
800 42, 42, 42, 46, 85, 3, 46, 83, 3, 4,
801 4, 3, 45, 42, 3, 42, 3, 45, 3, 45,
802 42, 3, 3, 3, 43, 46, 86, 88, 89, 1,
803 47, 61, 76, 77, 78, 87, 46, 62, 52, 68,
804 52, 74, 75, 86, 75, 71, 88, 52, 53, 54,
805 72, 73, 88, 72, 85, 3, 84, 3, 3, 3,
806 51, 51, 48, 77, 90, 55, 82, 85, 69, 70,
807 88, 74, 4, 89, 88, 73, 44, 79, 70, 4,
808 89, 80, 81, 49, 51, 14, 15, 16, 42, 88,
809 81, 88, 4, 52, 82, 82
812 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
813 static const yytype_uint8 yyr1
[] =
815 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
816 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
817 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
818 60, 60, 60, 61, 61, 61, 61, 61, 61, 61,
819 61, 61, 62, 62, 61, 64, 63, 65, 63, 63,
820 66, 67, 67, 67, 67, 68, 68, 69, 69, 70,
821 70, 71, 71, 72, 72, 73, 73, 73, 73, 74,
822 74, 74, 74, 74, 75, 75, 76, 76, 77, 77,
823 77, 79, 78, 80, 80, 80, 81, 81, 81, 81,
824 81, 81, 82, 82, 83, 83, 84, 84, 85, 86,
825 86, 87, 88, 88, 89, 90, 90
828 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
829 static const yytype_uint8 yyr2
[] =
831 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
832 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
833 2, 3, 1, 1, 2, 3, 2, 2, 2, 1,
834 1, 1, 1, 1, 1, 2, 3, 3, 1, 1,
835 2, 3, 0, 1, 3, 0, 3, 0, 3, 3,
836 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
837 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
838 1, 2, 2, 3, 1, 2, 1, 2, 1, 2,
839 2, 0, 4, 1, 3, 2, 0, 3, 3, 3,
840 3, 3, 0, 1, 1, 1, 0, 1, 1, 1,
845 #define yyerrok (yyerrstatus = 0)
846 #define yyclearin (yychar = YYEMPTY)
850 #define YYACCEPT goto yyacceptlab
851 #define YYABORT goto yyabortlab
852 #define YYERROR goto yyerrorlab
855 /* Like YYERROR except do call yyerror. This remains here temporarily
856 to ease the transition to the new meaning of YYERROR, for GCC.
857 Once GCC version 2 has supplanted version 1, this can go. */
859 #define YYFAIL goto yyerrlab
861 #define YYRECOVERING() (!!yyerrstatus)
863 #define YYBACKUP(Token, Value) \
865 if (yychar == YYEMPTY && yylen == 1) \
869 yytoken = YYTRANSLATE (yychar); \
875 yyerror (YY_("syntax error: cannot back up")); \
882 #define YYERRCODE 256
885 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
886 If N is 0, then set CURRENT to the empty location which ends
887 the previous symbol: RHS[0] (always defined). */
889 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
890 #ifndef YYLLOC_DEFAULT
891 # define YYLLOC_DEFAULT(Current, Rhs, N) \
895 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
896 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
897 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
898 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
902 (Current).first_line = (Current).last_line = \
903 YYRHSLOC (Rhs, 0).last_line; \
904 (Current).first_column = (Current).last_column = \
905 YYRHSLOC (Rhs, 0).last_column; \
911 /* YY_LOCATION_PRINT -- Print the location on the stream.
912 This macro was not mandated originally: define only if we know
913 we won't break user code: when these are the locations we know. */
915 #ifndef YY_LOCATION_PRINT
916 # if YYLTYPE_IS_TRIVIAL
917 # define YY_LOCATION_PRINT(File, Loc) \
918 fprintf (File, "%d.%d-%d.%d", \
919 (Loc).first_line, (Loc).first_column, \
920 (Loc).last_line, (Loc).last_column)
922 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
927 /* YYLEX -- calling `yylex' with the right arguments. */
930 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
932 # define YYLEX yylex (&yylval, &yylloc)
935 /* Enable debugging if requested. */
939 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
940 # define YYFPRINTF fprintf
943 # define YYDPRINTF(Args) \
949 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
953 YYFPRINTF (stderr, "%s ", Title); \
954 yy_symbol_print (stderr, \
955 Type, Value, Location); \
956 YYFPRINTF (stderr, "\n"); \
961 /*--------------------------------.
962 | Print this symbol on YYOUTPUT. |
963 `--------------------------------*/
966 #if (defined __STDC__ || defined __C99__FUNC__ \
967 || defined __cplusplus || defined _MSC_VER)
969 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
972 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
975 YYSTYPE
const * const yyvaluep
;
976 YYLTYPE
const * const yylocationp
;
983 if (yytype
< YYNTOKENS
)
984 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
992 /* Line 653 of yacc.c */
993 #line 183 "parse-gram.y"
994 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
995 /* Line 653 of yacc.c */
996 #line 997 "src/parse-gram.c"
1001 /* Line 653 of yacc.c */
1002 #line 196 "parse-gram.y"
1003 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
1004 /* Line 653 of yacc.c */
1005 #line 1006 "src/parse-gram.c"
1008 case 24: // "%<flag>"
1010 /* Line 653 of yacc.c */
1011 #line 192 "parse-gram.y"
1012 { fprintf (stderr
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1013 /* Line 653 of yacc.c */
1014 #line 1015 "src/parse-gram.c"
1019 /* Line 653 of yacc.c */
1020 #line 185 "parse-gram.y"
1021 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1022 /* Line 653 of yacc.c */
1023 #line 1024 "src/parse-gram.c"
1028 /* Line 653 of yacc.c */
1029 #line 177 "parse-gram.y"
1030 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
1031 /* Line 653 of yacc.c */
1032 #line 1033 "src/parse-gram.c"
1035 case 44: // "epilogue"
1037 /* Line 653 of yacc.c */
1038 #line 185 "parse-gram.y"
1039 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1040 /* Line 653 of yacc.c */
1041 #line 1042 "src/parse-gram.c"
1044 case 46: // "identifier"
1046 /* Line 653 of yacc.c */
1047 #line 190 "parse-gram.y"
1048 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1049 /* Line 653 of yacc.c */
1050 #line 1051 "src/parse-gram.c"
1053 case 47: // "identifier:"
1055 /* Line 653 of yacc.c */
1056 #line 191 "parse-gram.y"
1057 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
1058 /* Line 653 of yacc.c */
1059 #line 1060 "src/parse-gram.c"
1062 case 50: // "%{...%}"
1064 /* Line 653 of yacc.c */
1065 #line 185 "parse-gram.y"
1066 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1067 /* Line 653 of yacc.c */
1068 #line 1069 "src/parse-gram.c"
1073 /* Line 653 of yacc.c */
1074 #line 193 "parse-gram.y"
1075 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1076 /* Line 653 of yacc.c */
1077 #line 1078 "src/parse-gram.c"
1080 case 83: // variable
1082 /* Line 653 of yacc.c */
1083 #line 190 "parse-gram.y"
1084 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1085 /* Line 653 of yacc.c */
1086 #line 1087 "src/parse-gram.c"
1089 case 84: // content.opt
1091 /* Line 653 of yacc.c */
1092 #line 185 "parse-gram.y"
1093 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1094 /* Line 653 of yacc.c */
1095 #line 1096 "src/parse-gram.c"
1098 case 85: // braceless
1100 /* Line 653 of yacc.c */
1101 #line 185 "parse-gram.y"
1102 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1103 /* Line 653 of yacc.c */
1104 #line 1105 "src/parse-gram.c"
1109 /* Line 653 of yacc.c */
1110 #line 199 "parse-gram.y"
1111 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1112 /* Line 653 of yacc.c */
1113 #line 1114 "src/parse-gram.c"
1116 case 87: // id_colon
1118 /* Line 653 of yacc.c */
1119 #line 200 "parse-gram.y"
1120 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1121 /* Line 653 of yacc.c */
1122 #line 1123 "src/parse-gram.c"
1127 /* Line 653 of yacc.c */
1128 #line 199 "parse-gram.y"
1129 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1130 /* Line 653 of yacc.c */
1131 #line 1132 "src/parse-gram.c"
1134 case 89: // string_as_id
1136 /* Line 653 of yacc.c */
1137 #line 199 "parse-gram.y"
1138 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1139 /* Line 653 of yacc.c */
1140 #line 1141 "src/parse-gram.c"
1149 /*--------------------------------.
1150 | Print this symbol on YYOUTPUT. |
1151 `--------------------------------*/
1153 #if (defined __STDC__ || defined __C99__FUNC__ \
1154 || defined __cplusplus || defined _MSC_VER)
1156 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1159 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1162 YYSTYPE
const * const yyvaluep
;
1163 YYLTYPE
const * const yylocationp
;
1166 if (yytype
< YYNTOKENS
)
1167 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1169 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1171 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1172 YYFPRINTF (yyoutput
, ": ");
1173 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1174 YYFPRINTF (yyoutput
, ")");
1177 /*------------------------------------------------------------------.
1178 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1180 `------------------------------------------------------------------*/
1182 #if (defined __STDC__ || defined __C99__FUNC__ \
1183 || defined __cplusplus || defined _MSC_VER)
1185 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1188 yy_stack_print (yybottom
, yytop
)
1189 yytype_int16
*yybottom
;
1190 yytype_int16
*yytop
;
1193 YYFPRINTF (stderr
, "Stack now");
1194 for (; yybottom
<= yytop
; yybottom
++)
1196 int yybot
= *yybottom
;
1197 YYFPRINTF (stderr
, " %d", yybot
);
1199 YYFPRINTF (stderr
, "\n");
1202 # define YY_STACK_PRINT(Bottom, Top) \
1205 yy_stack_print ((Bottom), (Top)); \
1209 /*------------------------------------------------.
1210 | Report that the YYRULE is going to be reduced. |
1211 `------------------------------------------------*/
1213 #if (defined __STDC__ || defined __C99__FUNC__ \
1214 || defined __cplusplus || defined _MSC_VER)
1216 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1219 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1220 yytype_int16
*yyssp
;
1226 unsigned long int yylno
= yyrline
[yyrule
];
1227 int yynrhs
= yyr2
[yyrule
];
1229 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1231 /* The symbols being reduced. */
1232 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1234 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1235 yy_symbol_print (stderr
,
1236 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1237 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1238 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1239 YYFPRINTF (stderr
, "\n");
1243 # define YY_REDUCE_PRINT(Rule) \
1246 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1249 /* Nonzero means print parse trace. It is left uninitialized so that
1250 multiple parsers can coexist. */
1252 #else /* !YYDEBUG */
1253 # define YYDPRINTF(Args)
1254 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1255 # define YY_STACK_PRINT(Bottom, Top)
1256 # define YY_REDUCE_PRINT(Rule)
1257 #endif /* !YYDEBUG */
1260 /* YYINITDEPTH -- initial size of the parser's stacks. */
1262 # define YYINITDEPTH 200
1265 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1266 if the built-in stack extension method is used).
1268 Do not make this value too large; the results are undefined if
1269 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1270 evaluated with infinite-precision integer arithmetic. */
1273 # define YYMAXDEPTH 10000
1281 # if defined __GLIBC__ && defined _STRING_H
1282 # define yystrlen strlen
1284 /* Return the length of YYSTR. */
1285 #if (defined __STDC__ || defined __C99__FUNC__ \
1286 || defined __cplusplus || defined _MSC_VER)
1288 yystrlen (const char *yystr
)
1296 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1304 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1305 # define yystpcpy stpcpy
1307 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1309 #if (defined __STDC__ || defined __C99__FUNC__ \
1310 || defined __cplusplus || defined _MSC_VER)
1312 yystpcpy (char *yydest
, const char *yysrc
)
1315 yystpcpy (yydest
, yysrc
)
1321 const char *yys
= yysrc
;
1323 while ((*yyd
++ = *yys
++) != '\0')
1332 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1333 quotes and backslashes, so that it's suitable for yyerror. The
1334 heuristic is that double-quoting is unnecessary unless the string
1335 contains an apostrophe, a comma, or backslash (other than
1336 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1337 null, do not copy; instead, return the length of what the result
1340 yytnamerr (char *yyres
, const char *yystr
)
1345 char const *yyp
= yystr
;
1352 goto do_not_strip_quotes
;
1356 goto do_not_strip_quotes
;
1369 do_not_strip_quotes
: ;
1373 return yystrlen (yystr
);
1375 return yystpcpy (yyres
, yystr
) - yyres
;
1379 /* Copy into YYRESULT an error message about the unexpected token
1380 YYTOKEN while in state YYSTATE. Return the number of bytes copied,
1381 including the terminating null byte. If YYRESULT is null, do not
1382 copy anything; just return the number of bytes that would be
1383 copied. As a special case, return 0 if an ordinary "syntax error"
1384 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1385 size calculation. */
1387 yysyntax_error (char *yyresult
, int yystate
, int yytoken
)
1389 int yyn
= yypact
[yystate
];
1391 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1395 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1396 YYSIZE_T yysize
= yysize0
;
1398 int yysize_overflow
= 0;
1399 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1400 /* Internationalized format string. */
1401 const char *yyformat
= 0;
1402 /* Arguments of yyformat. */
1403 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1405 /* Start YYX at -YYN if negative to avoid negative indexes in
1406 YYCHECK. In other words, skip the first -YYN actions for this
1407 state because they are default actions. */
1408 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1410 /* Stay within bounds of both yycheck and yytname. */
1411 int yychecklim
= YYLAST
- yyn
+ 1;
1412 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1413 /* Number of reported tokens (one for the "unexpected", one per
1418 yyarg
[yycount
++] = yytname
[yytoken
];
1420 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1421 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1422 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1424 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1430 yyarg
[yycount
++] = yytname
[yyx
];
1431 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1432 yysize_overflow
|= (yysize1
< yysize
);
1438 #define YYCASE_(N, S) \
1442 YYCASE_(1, YY_("syntax error, unexpected %s"));
1443 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1444 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1445 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1446 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1450 yysize1
= yysize
+ yystrlen (yyformat
);
1451 yysize_overflow
|= (yysize1
< yysize
);
1454 if (yysize_overflow
)
1455 return YYSIZE_MAXIMUM
;
1459 /* Avoid sprintf, as that infringes on the user's name space.
1460 Don't have undefined behavior even if the translation
1461 produced a string with the wrong number of "%s"s. */
1462 char *yyp
= yyresult
;
1464 while ((*yyp
= *yyformat
) != '\0')
1465 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1467 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1479 #endif /* YYERROR_VERBOSE */
1482 /*-----------------------------------------------.
1483 | Release the memory associated to this symbol. |
1484 `-----------------------------------------------*/
1487 #if (defined __STDC__ || defined __C99__FUNC__ \
1488 || defined __cplusplus || defined _MSC_VER)
1490 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1493 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1497 YYLTYPE
*yylocationp
;
1501 YYUSE (yylocationp
);
1505 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1514 /* Prevent warnings from -Wmissing-prototypes. */
1515 #ifdef YYPARSE_PARAM
1516 #if (defined __STDC__ || defined __C99__FUNC__ \
1517 || defined __cplusplus || defined _MSC_VER)
1518 int yyparse (void *YYPARSE_PARAM
);
1522 #else /* ! YYPARSE_PARAM */
1523 #if (defined __STDC__ || defined __C99__FUNC__ \
1524 || defined __cplusplus || defined _MSC_VER)
1529 #endif /* ! YYPARSE_PARAM */
1535 /*-------------------------.
1536 | yyparse or yypush_parse. |
1537 `-------------------------*/
1539 #ifdef YYPARSE_PARAM
1540 #if (defined __STDC__ || defined __C99__FUNC__ \
1541 || defined __cplusplus || defined _MSC_VER)
1543 yyparse (void *YYPARSE_PARAM
)
1546 yyparse (YYPARSE_PARAM
)
1547 void *YYPARSE_PARAM
;
1549 #else /* ! YYPARSE_PARAM */
1550 #if (defined __STDC__ || defined __C99__FUNC__ \
1551 || defined __cplusplus || defined _MSC_VER)
1561 /* The lookahead symbol. */
1564 /* The semantic value of the lookahead symbol. */
1567 /* Location data for the lookahead symbol. */
1570 /* Number of syntax errors so far. */
1574 /* Number of tokens to shift before error messages enabled. */
1577 /* The stacks and their tools:
1578 `yyss': related to states.
1579 `yyvs': related to semantic values.
1580 `yyls': related to locations.
1582 Refer to the stacks thru separate pointers, to allow yyoverflow
1583 to reallocate them elsewhere. */
1585 /* The state stack. */
1586 yytype_int16 yyssa
[YYINITDEPTH
];
1588 yytype_int16
*yyssp
;
1590 /* The semantic value stack. */
1591 YYSTYPE yyvsa
[YYINITDEPTH
];
1595 /* The location stack. */
1596 YYLTYPE yylsa
[YYINITDEPTH
];
1600 /* The locations where the error started and ended. */
1601 YYLTYPE yyerror_range
[2];
1603 YYSIZE_T yystacksize
;
1607 /* Lookahead token as an internal (translated) token number. */
1609 /* The variables used to return semantic value and location from the
1615 /* Buffer for error messages, and its allocated size. */
1617 char *yymsg
= yymsgbuf
;
1618 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1621 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1623 /* The number of symbols on the RHS of the reduced rule.
1624 Keep to zero when no symbol should be popped. */
1631 yystacksize
= YYINITDEPTH
;
1633 YYDPRINTF ((stderr
, "Starting parse\n"));
1638 yychar
= YYEMPTY
; /* Cause a token to be read. */
1640 /* Initialize stack pointers.
1641 Waste one element of value and location stack
1642 so that they stay on the same level as the state stack.
1643 The wasted elements are never initialized. */
1648 #if YYLTYPE_IS_TRIVIAL
1649 /* Initialize the default location before parsing starts. */
1650 yylloc
.first_line
= yylloc
.last_line
= 1;
1651 yylloc
.first_column
= yylloc
.last_column
= 1;
1654 /* User initialization code. */
1655 /* Line 1175 of yacc.c */
1656 #line 86 "parse-gram.y"
1658 /* Bison's grammar can initial empty locations, hence a default
1659 location is needed. */
1660 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1661 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1663 /* Line 1175 of yacc.c */
1664 #line 1665 "src/parse-gram.c"
1669 /*------------------------------------------------------------.
1670 | yynewstate -- Push a new state, which is found in yystate. |
1671 `------------------------------------------------------------*/
1673 /* In all cases, when you get here, the value and location stacks
1674 have just been pushed. So pushing a state here evens the stacks. */
1680 if (yyss
+ yystacksize
- 1 <= yyssp
)
1682 /* Get the current used size of the three stacks, in elements. */
1683 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1687 /* Give user a chance to reallocate the stack. Use copies of
1688 these so that the &'s don't force the real ones into
1690 YYSTYPE
*yyvs1
= yyvs
;
1691 yytype_int16
*yyss1
= yyss
;
1692 YYLTYPE
*yyls1
= yyls
;
1694 /* Each stack pointer address is followed by the size of the
1695 data in use in that stack, in bytes. This used to be a
1696 conditional around just the two extra args, but that might
1697 be undefined if yyoverflow is a macro. */
1698 yyoverflow (YY_("memory exhausted"),
1699 &yyss1
, yysize
* sizeof (*yyssp
),
1700 &yyvs1
, yysize
* sizeof (*yyvsp
),
1701 &yyls1
, yysize
* sizeof (*yylsp
),
1708 #else /* no yyoverflow */
1709 # ifndef YYSTACK_RELOCATE
1710 goto yyexhaustedlab
;
1712 /* Extend the stack our own way. */
1713 if (YYMAXDEPTH
<= yystacksize
)
1714 goto yyexhaustedlab
;
1716 if (YYMAXDEPTH
< yystacksize
)
1717 yystacksize
= YYMAXDEPTH
;
1720 yytype_int16
*yyss1
= yyss
;
1721 union yyalloc
*yyptr
=
1722 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1724 goto yyexhaustedlab
;
1725 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1726 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1727 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1728 # undef YYSTACK_RELOCATE
1730 YYSTACK_FREE (yyss1
);
1733 #endif /* no yyoverflow */
1735 yyssp
= yyss
+ yysize
- 1;
1736 yyvsp
= yyvs
+ yysize
- 1;
1737 yylsp
= yyls
+ yysize
- 1;
1739 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1740 (unsigned long int) yystacksize
));
1742 if (yyss
+ yystacksize
- 1 <= yyssp
)
1746 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1748 if (yystate
== YYFINAL
)
1758 /* Do appropriate processing given the current state. Read a
1759 lookahead token if we need one and don't already have one. */
1761 /* First try to decide what to do without reference to lookahead token. */
1762 yyn
= yypact
[yystate
];
1763 if (yypact_value_is_default (yyn
))
1766 /* Not known => get a lookahead token if don't already have one. */
1768 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1769 if (yychar
== YYEMPTY
)
1771 YYDPRINTF ((stderr
, "Reading a token: "));
1775 if (yychar
<= YYEOF
)
1777 yychar
= yytoken
= YYEOF
;
1778 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1782 yytoken
= YYTRANSLATE (yychar
);
1783 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1786 /* If the proper action on seeing token YYTOKEN is to reduce or to
1787 detect an error, take that action. */
1789 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1794 if (yytable_value_is_error (yyn
))
1800 /* Count tokens shifted since error; after three, turn off error
1805 /* Shift the lookahead token. */
1806 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1808 /* Discard the shifted token. */
1817 /*-----------------------------------------------------------.
1818 | yydefault -- do the default action for the current state. |
1819 `-----------------------------------------------------------*/
1821 yyn
= yydefact
[yystate
];
1827 /*-----------------------------.
1828 | yyreduce -- Do a reduction. |
1829 `-----------------------------*/
1831 /* yyn is the number of a rule to reduce with. */
1834 /* If YYLEN is nonzero, implement the default value of the action:
1837 Otherwise, the following line sets YYVAL to garbage.
1838 This behavior is undocumented and Bison
1839 users should not rely upon it. Assigning to YYVAL
1840 unconditionally makes the parser a bit smaller, and it avoids a
1841 GCC warning that YYVAL may be used uninitialized. */
1842 yyval
= yyvsp
[1-yylen
];
1844 /* Default location. */
1845 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1846 YY_REDUCE_PRINT (yyn
);
1850 /* Line 1388 of yacc.c */
1851 #line 223 "parse-gram.y"
1853 code_props plain_code
;
1854 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
1855 code_props_translate_code (&plain_code
);
1856 gram_scanner_last_string_free ();
1857 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1858 plain_code
.code
, (yylsp
[0]));
1859 code_scanner_last_string_free ();
1861 /* Line 1388 of yacc.c */
1862 #line 1863 "src/parse-gram.c"
1866 /* Line 1388 of yacc.c */
1867 #line 233 "parse-gram.y"
1869 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
1871 /* Line 1388 of yacc.c */
1872 #line 1873 "src/parse-gram.c"
1876 /* Line 1388 of yacc.c */
1877 #line 237 "parse-gram.y"
1879 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
1880 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
1882 /* Line 1388 of yacc.c */
1883 #line 1884 "src/parse-gram.c"
1887 /* Line 1388 of yacc.c */
1888 #line 241 "parse-gram.y"
1889 { defines_flag
= true; }
1890 /* Line 1388 of yacc.c */
1891 #line 1892 "src/parse-gram.c"
1895 /* Line 1388 of yacc.c */
1896 #line 243 "parse-gram.y"
1898 defines_flag
= true;
1899 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
1901 /* Line 1388 of yacc.c */
1902 #line 1903 "src/parse-gram.c"
1906 /* Line 1388 of yacc.c */
1907 #line 248 "parse-gram.y"
1909 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
1910 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
1912 /* Line 1388 of yacc.c */
1913 #line 1914 "src/parse-gram.c"
1917 /* Line 1388 of yacc.c */
1918 #line 252 "parse-gram.y"
1919 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
1920 /* Line 1388 of yacc.c */
1921 #line 1922 "src/parse-gram.c"
1925 /* Line 1388 of yacc.c */
1926 #line 253 "parse-gram.y"
1927 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
1928 /* Line 1388 of yacc.c */
1929 #line 1930 "src/parse-gram.c"
1933 /* Line 1388 of yacc.c */
1934 #line 254 "parse-gram.y"
1935 { spec_file_prefix
= (yyvsp
[0].chars
); }
1936 /* Line 1388 of yacc.c */
1937 #line 1938 "src/parse-gram.c"
1941 /* Line 1388 of yacc.c */
1942 #line 255 "parse-gram.y"
1943 { spec_file_prefix
= (yyvsp
[0].chars
); }
1944 /* Line 1388 of yacc.c */
1945 #line 1946 "src/parse-gram.c"
1949 /* Line 1388 of yacc.c */
1950 #line 257 "parse-gram.y"
1952 nondeterministic_parser
= true;
1955 /* Line 1388 of yacc.c */
1956 #line 1957 "src/parse-gram.c"
1960 /* Line 1388 of yacc.c */
1961 #line 262 "parse-gram.y"
1964 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
1965 code_props_translate_code (&action
);
1966 gram_scanner_last_string_free ();
1967 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
1968 code_scanner_last_string_free ();
1970 /* Line 1388 of yacc.c */
1971 #line 1972 "src/parse-gram.c"
1975 /* Line 1388 of yacc.c */
1976 #line 270 "parse-gram.y"
1977 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
1978 /* Line 1388 of yacc.c */
1979 #line 1980 "src/parse-gram.c"
1983 /* Line 1388 of yacc.c */
1984 #line 271 "parse-gram.y"
1985 { add_param ("lex_param", (yyvsp
[0].code
), (yylsp
[0])); }
1986 /* Line 1388 of yacc.c */
1987 #line 1988 "src/parse-gram.c"
1991 /* Line 1388 of yacc.c */
1992 #line 272 "parse-gram.y"
1993 { spec_name_prefix
= (yyvsp
[0].chars
); }
1994 /* Line 1388 of yacc.c */
1995 #line 1996 "src/parse-gram.c"
1999 /* Line 1388 of yacc.c */
2000 #line 273 "parse-gram.y"
2001 { spec_name_prefix
= (yyvsp
[0].chars
); }
2002 /* Line 1388 of yacc.c */
2003 #line 2004 "src/parse-gram.c"
2007 /* Line 1388 of yacc.c */
2008 #line 274 "parse-gram.y"
2009 { no_lines_flag
= true; }
2010 /* Line 1388 of yacc.c */
2011 #line 2012 "src/parse-gram.c"
2015 /* Line 1388 of yacc.c */
2016 #line 275 "parse-gram.y"
2017 { nondeterministic_parser
= true; }
2018 /* Line 1388 of yacc.c */
2019 #line 2020 "src/parse-gram.c"
2023 /* Line 1388 of yacc.c */
2024 #line 276 "parse-gram.y"
2025 { spec_outfile
= (yyvsp
[0].chars
); }
2026 /* Line 1388 of yacc.c */
2027 #line 2028 "src/parse-gram.c"
2031 /* Line 1388 of yacc.c */
2032 #line 277 "parse-gram.y"
2033 { spec_outfile
= (yyvsp
[0].chars
); }
2034 /* Line 1388 of yacc.c */
2035 #line 2036 "src/parse-gram.c"
2039 /* Line 1388 of yacc.c */
2040 #line 278 "parse-gram.y"
2041 { add_param ("parse_param", (yyvsp
[0].code
), (yylsp
[0])); }
2042 /* Line 1388 of yacc.c */
2043 #line 2044 "src/parse-gram.c"
2047 /* Line 1388 of yacc.c */
2048 #line 279 "parse-gram.y"
2049 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2050 /* Line 1388 of yacc.c */
2051 #line 2052 "src/parse-gram.c"
2055 /* Line 1388 of yacc.c */
2056 #line 281 "parse-gram.y"
2058 char const *skeleton_user
= (yyvsp
[0].chars
);
2059 if (strchr (skeleton_user
, '/'))
2061 size_t dir_length
= strlen (current_file
);
2062 char *skeleton_build
;
2063 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2065 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2068 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2071 strncpy (skeleton_build
, current_file
, dir_length
);
2072 skeleton_build
[dir_length
++] = '/';
2074 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2075 skeleton_user
= uniqstr_new (skeleton_build
);
2076 free (skeleton_build
);
2078 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2080 /* Line 1388 of yacc.c */
2081 #line 2082 "src/parse-gram.c"
2085 /* Line 1388 of yacc.c */
2086 #line 304 "parse-gram.y"
2087 { token_table_flag
= true; }
2088 /* Line 1388 of yacc.c */
2089 #line 2090 "src/parse-gram.c"
2093 /* Line 1388 of yacc.c */
2094 #line 305 "parse-gram.y"
2095 { report_flag
|= report_states
; }
2096 /* Line 1388 of yacc.c */
2097 #line 2098 "src/parse-gram.c"
2101 /* Line 1388 of yacc.c */
2102 #line 306 "parse-gram.y"
2103 { yacc_flag
= true; }
2104 /* Line 1388 of yacc.c */
2105 #line 2106 "src/parse-gram.c"
2109 /* Line 1388 of yacc.c */
2110 #line 314 "parse-gram.y"
2112 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2114 /* Line 1388 of yacc.c */
2115 #line 2116 "src/parse-gram.c"
2119 /* Line 1388 of yacc.c */
2120 #line 318 "parse-gram.y"
2123 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2124 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2125 symbol_list_free ((yyvsp
[0].list
));
2127 /* Line 1388 of yacc.c */
2128 #line 2129 "src/parse-gram.c"
2132 /* Line 1388 of yacc.c */
2133 #line 325 "parse-gram.y"
2136 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2137 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2138 symbol_list_free ((yyvsp
[0].list
));
2140 /* Line 1388 of yacc.c */
2141 #line 2142 "src/parse-gram.c"
2145 /* Line 1388 of yacc.c */
2146 #line 332 "parse-gram.y"
2148 default_prec
= true;
2150 /* Line 1388 of yacc.c */
2151 #line 2152 "src/parse-gram.c"
2155 /* Line 1388 of yacc.c */
2156 #line 336 "parse-gram.y"
2158 default_prec
= false;
2160 /* Line 1388 of yacc.c */
2161 #line 2162 "src/parse-gram.c"
2165 /* Line 1388 of yacc.c */
2166 #line 340 "parse-gram.y"
2168 /* Do not invoke muscle_percent_code_grow here since it invokes
2169 muscle_user_name_list_grow. */
2170 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2171 code_scanner_last_string_free ();
2173 /* Line 1388 of yacc.c */
2174 #line 2175 "src/parse-gram.c"
2178 /* Line 1388 of yacc.c */
2179 #line 347 "parse-gram.y"
2181 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2182 code_scanner_last_string_free ();
2184 /* Line 1388 of yacc.c */
2185 #line 2186 "src/parse-gram.c"
2189 /* Line 1388 of yacc.c */
2190 #line 361 "parse-gram.y"
2192 /* Line 1388 of yacc.c */
2193 #line 2194 "src/parse-gram.c"
2197 /* Line 1388 of yacc.c */
2198 #line 362 "parse-gram.y"
2199 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2200 /* Line 1388 of yacc.c */
2201 #line 2202 "src/parse-gram.c"
2205 /* Line 1388 of yacc.c */
2206 #line 367 "parse-gram.y"
2209 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2210 code_scanner_last_string_free ();
2212 /* Line 1388 of yacc.c */
2213 #line 2214 "src/parse-gram.c"
2217 /* Line 1388 of yacc.c */
2218 #line 378 "parse-gram.y"
2219 { current_class
= nterm_sym
; }
2220 /* Line 1388 of yacc.c */
2221 #line 2222 "src/parse-gram.c"
2225 /* Line 1388 of yacc.c */
2226 #line 379 "parse-gram.y"
2228 current_class
= unknown_sym
;
2229 current_type
= NULL
;
2231 /* Line 1388 of yacc.c */
2232 #line 2233 "src/parse-gram.c"
2236 /* Line 1388 of yacc.c */
2237 #line 383 "parse-gram.y"
2238 { current_class
= token_sym
; }
2239 /* Line 1388 of yacc.c */
2240 #line 2241 "src/parse-gram.c"
2244 /* Line 1388 of yacc.c */
2245 #line 384 "parse-gram.y"
2247 current_class
= unknown_sym
;
2248 current_type
= NULL
;
2250 /* Line 1388 of yacc.c */
2251 #line 2252 "src/parse-gram.c"
2255 /* Line 1388 of yacc.c */
2256 #line 389 "parse-gram.y"
2260 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2261 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2262 symbol_list_free ((yyvsp
[0].list
));
2264 /* Line 1388 of yacc.c */
2265 #line 2266 "src/parse-gram.c"
2269 /* Line 1388 of yacc.c */
2270 #line 400 "parse-gram.y"
2274 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2276 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2277 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2279 symbol_list_free ((yyvsp
[0].list
));
2280 current_type
= NULL
;
2282 /* Line 1388 of yacc.c */
2283 #line 2284 "src/parse-gram.c"
2287 /* Line 1388 of yacc.c */
2288 #line 414 "parse-gram.y"
2289 { (yyval
.assoc
) = left_assoc
; }
2290 /* Line 1388 of yacc.c */
2291 #line 2292 "src/parse-gram.c"
2295 /* Line 1388 of yacc.c */
2296 #line 415 "parse-gram.y"
2297 { (yyval
.assoc
) = right_assoc
; }
2298 /* Line 1388 of yacc.c */
2299 #line 2300 "src/parse-gram.c"
2303 /* Line 1388 of yacc.c */
2304 #line 416 "parse-gram.y"
2305 { (yyval
.assoc
) = non_assoc
; }
2306 /* Line 1388 of yacc.c */
2307 #line 2308 "src/parse-gram.c"
2311 /* Line 1388 of yacc.c */
2312 #line 417 "parse-gram.y"
2313 { (yyval
.assoc
) = precedence_assoc
; }
2314 /* Line 1388 of yacc.c */
2315 #line 2316 "src/parse-gram.c"
2319 /* Line 1388 of yacc.c */
2320 #line 421 "parse-gram.y"
2321 { current_type
= NULL
; }
2322 /* Line 1388 of yacc.c */
2323 #line 2324 "src/parse-gram.c"
2327 /* Line 1388 of yacc.c */
2328 #line 422 "parse-gram.y"
2329 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2330 /* Line 1388 of yacc.c */
2331 #line 2332 "src/parse-gram.c"
2335 /* Line 1388 of yacc.c */
2336 #line 428 "parse-gram.y"
2337 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2338 /* Line 1388 of yacc.c */
2339 #line 2340 "src/parse-gram.c"
2343 /* Line 1388 of yacc.c */
2344 #line 430 "parse-gram.y"
2345 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2346 /* Line 1388 of yacc.c */
2347 #line 2348 "src/parse-gram.c"
2351 /* Line 1388 of yacc.c */
2352 #line 434 "parse-gram.y"
2353 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2354 /* Line 1388 of yacc.c */
2355 #line 2356 "src/parse-gram.c"
2359 /* Line 1388 of yacc.c */
2360 #line 435 "parse-gram.y"
2361 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2362 /* Line 1388 of yacc.c */
2363 #line 2364 "src/parse-gram.c"
2367 /* Line 1388 of yacc.c */
2368 #line 441 "parse-gram.y"
2369 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2370 /* Line 1388 of yacc.c */
2371 #line 2372 "src/parse-gram.c"
2375 /* Line 1388 of yacc.c */
2376 #line 443 "parse-gram.y"
2377 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2378 /* Line 1388 of yacc.c */
2379 #line 2380 "src/parse-gram.c"
2383 /* Line 1388 of yacc.c */
2384 #line 447 "parse-gram.y"
2385 { (yyval
.list
) = (yyvsp
[0].list
); }
2386 /* Line 1388 of yacc.c */
2387 #line 2388 "src/parse-gram.c"
2391 /* Line 1388 of yacc.c */
2392 #line 448 "parse-gram.y"
2393 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2394 /* Line 1388 of yacc.c */
2395 #line 2396 "src/parse-gram.c"
2399 /* Line 1388 of yacc.c */
2400 #line 452 "parse-gram.y"
2401 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2402 /* Line 1388 of yacc.c */
2403 #line 2404 "src/parse-gram.c"
2407 /* Line 1388 of yacc.c */
2408 #line 453 "parse-gram.y"
2409 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2410 /* Line 1388 of yacc.c */
2411 #line 2412 "src/parse-gram.c"
2415 /* Line 1388 of yacc.c */
2416 #line 454 "parse-gram.y"
2417 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2418 /* Line 1388 of yacc.c */
2419 #line 2420 "src/parse-gram.c"
2423 /* Line 1388 of yacc.c */
2424 #line 455 "parse-gram.y"
2425 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2426 /* Line 1388 of yacc.c */
2427 #line 2428 "src/parse-gram.c"
2431 /* Line 1388 of yacc.c */
2432 #line 461 "parse-gram.y"
2434 current_type
= (yyvsp
[0].uniqstr
);
2437 /* Line 1388 of yacc.c */
2438 #line 2439 "src/parse-gram.c"
2442 /* Line 1388 of yacc.c */
2443 #line 466 "parse-gram.y"
2445 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2446 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2448 /* Line 1388 of yacc.c */
2449 #line 2450 "src/parse-gram.c"
2453 /* Line 1388 of yacc.c */
2454 #line 471 "parse-gram.y"
2456 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2457 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2458 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2460 /* Line 1388 of yacc.c */
2461 #line 2462 "src/parse-gram.c"
2465 /* Line 1388 of yacc.c */
2466 #line 477 "parse-gram.y"
2468 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2469 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2470 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2472 /* Line 1388 of yacc.c */
2473 #line 2474 "src/parse-gram.c"
2477 /* Line 1388 of yacc.c */
2478 #line 483 "parse-gram.y"
2480 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2481 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2482 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2483 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2485 /* Line 1388 of yacc.c */
2486 #line 2487 "src/parse-gram.c"
2490 /* Line 1388 of yacc.c */
2491 #line 513 "parse-gram.y"
2495 /* Line 1388 of yacc.c */
2496 #line 2497 "src/parse-gram.c"
2500 /* Line 1388 of yacc.c */
2501 #line 519 "parse-gram.y"
2502 { current_lhs
= (yyvsp
[-1].symbol
); current_lhs_location
= (yylsp
[-1]);
2503 current_lhs_named_ref
= (yyvsp
[0].named_ref
); }
2504 /* Line 1388 of yacc.c */
2505 #line 2506 "src/parse-gram.c"
2509 /* Line 1388 of yacc.c */
2510 #line 524 "parse-gram.y"
2511 { grammar_current_rule_end ((yylsp
[0])); }
2512 /* Line 1388 of yacc.c */
2513 #line 2514 "src/parse-gram.c"
2517 /* Line 1388 of yacc.c */
2518 #line 525 "parse-gram.y"
2519 { grammar_current_rule_end ((yylsp
[0])); }
2520 /* Line 1388 of yacc.c */
2521 #line 2522 "src/parse-gram.c"
2525 /* Line 1388 of yacc.c */
2526 #line 531 "parse-gram.y"
2527 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2528 current_lhs_named_ref
); }
2529 /* Line 1388 of yacc.c */
2530 #line 2531 "src/parse-gram.c"
2534 /* Line 1388 of yacc.c */
2535 #line 534 "parse-gram.y"
2536 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2537 /* Line 1388 of yacc.c */
2538 #line 2539 "src/parse-gram.c"
2542 /* Line 1388 of yacc.c */
2543 #line 536 "parse-gram.y"
2544 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2545 /* Line 1388 of yacc.c */
2546 #line 2547 "src/parse-gram.c"
2550 /* Line 1388 of yacc.c */
2551 #line 538 "parse-gram.y"
2552 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2553 /* Line 1388 of yacc.c */
2554 #line 2555 "src/parse-gram.c"
2558 /* Line 1388 of yacc.c */
2559 #line 540 "parse-gram.y"
2560 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2561 /* Line 1388 of yacc.c */
2562 #line 2563 "src/parse-gram.c"
2566 /* Line 1388 of yacc.c */
2567 #line 542 "parse-gram.y"
2568 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2569 /* Line 1388 of yacc.c */
2570 #line 2571 "src/parse-gram.c"
2574 /* Line 1388 of yacc.c */
2575 #line 546 "parse-gram.y"
2576 { (yyval
.named_ref
) = 0; }
2577 /* Line 1388 of yacc.c */
2578 #line 2579 "src/parse-gram.c"
2582 /* Line 1388 of yacc.c */
2583 #line 548 "parse-gram.y"
2584 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2585 /* Line 1388 of yacc.c */
2586 #line 2587 "src/parse-gram.c"
2590 /* Line 1388 of yacc.c */
2591 #line 560 "parse-gram.y"
2592 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2593 /* Line 1388 of yacc.c */
2594 #line 2595 "src/parse-gram.c"
2598 /* Line 1388 of yacc.c */
2599 #line 565 "parse-gram.y"
2600 { (yyval
.chars
) = ""; }
2601 /* Line 1388 of yacc.c */
2602 #line 2603 "src/parse-gram.c"
2606 /* Line 1388 of yacc.c */
2607 #line 576 "parse-gram.y"
2609 code_props plain_code
;
2610 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2611 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2612 code_props_translate_code (&plain_code
);
2613 gram_scanner_last_string_free ();
2614 (yyval
.chars
) = plain_code
.code
;
2616 /* Line 1388 of yacc.c */
2617 #line 2618 "src/parse-gram.c"
2621 /* Line 1388 of yacc.c */
2622 #line 596 "parse-gram.y"
2623 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2624 /* Line 1388 of yacc.c */
2625 #line 2626 "src/parse-gram.c"
2629 /* Line 1388 of yacc.c */
2630 #line 598 "parse-gram.y"
2632 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2633 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2634 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2636 /* Line 1388 of yacc.c */
2637 #line 2638 "src/parse-gram.c"
2641 /* Line 1388 of yacc.c */
2642 #line 606 "parse-gram.y"
2643 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2644 /* Line 1388 of yacc.c */
2645 #line 2646 "src/parse-gram.c"
2649 /* Line 1388 of yacc.c */
2650 #line 618 "parse-gram.y"
2652 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2653 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2655 /* Line 1388 of yacc.c */
2656 #line 2657 "src/parse-gram.c"
2660 /* Line 1388 of yacc.c */
2661 #line 627 "parse-gram.y"
2663 code_props plain_code
;
2664 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2665 code_props_translate_code (&plain_code
);
2666 gram_scanner_last_string_free ();
2667 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2668 code_scanner_last_string_free ();
2670 /* Line 1388 of yacc.c */
2671 #line 2672 "src/parse-gram.c"
2675 /* Line 1388 of yacc.c */
2676 #line 2677 "src/parse-gram.c"
2679 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2683 YY_STACK_PRINT (yyss
, yyssp
);
2688 /* Now `shift' the result of the reduction. Determine what state
2689 that goes to, based on the state we popped back to and the rule
2690 number reduced by. */
2694 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2695 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2696 yystate
= yytable
[yystate
];
2698 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2703 /*------------------------------------.
2704 | yyerrlab -- here on detecting error |
2705 `------------------------------------*/
2707 /* If not already recovering from an error, report this error. */
2711 #if ! YYERROR_VERBOSE
2712 yyerror (YY_("syntax error"));
2715 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yytoken
);
2716 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2718 YYSIZE_T yyalloc
= 2 * yysize
;
2719 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2720 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2721 if (yymsg
!= yymsgbuf
)
2722 YYSTACK_FREE (yymsg
);
2723 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2725 yymsg_alloc
= yyalloc
;
2729 yymsg_alloc
= sizeof yymsgbuf
;
2733 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2735 (void) yysyntax_error (yymsg
, yystate
, yytoken
);
2740 yyerror (YY_("syntax error"));
2742 goto yyexhaustedlab
;
2748 yyerror_range
[0] = yylloc
;
2750 if (yyerrstatus
== 3)
2752 /* If just tried and failed to reuse lookahead token after an
2753 error, discard it. */
2755 if (yychar
<= YYEOF
)
2757 /* Return failure if at end of input. */
2758 if (yychar
== YYEOF
)
2763 yydestruct ("Error: discarding",
2764 yytoken
, &yylval
, &yylloc
);
2769 /* Else will try to reuse lookahead token after shifting the error
2774 /*---------------------------------------------------.
2775 | yyerrorlab -- error raised explicitly by YYERROR. |
2776 `---------------------------------------------------*/
2779 /* Pacify compilers like GCC when the user code never invokes
2780 YYERROR and the label yyerrorlab therefore never appears in user
2782 if (/*CONSTCOND*/ 0)
2785 yyerror_range
[0] = yylsp
[1-yylen
];
2786 /* Do not reclaim the symbols of the rule which action triggered
2790 YY_STACK_PRINT (yyss
, yyssp
);
2795 /*-------------------------------------------------------------.
2796 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2797 `-------------------------------------------------------------*/
2799 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2803 yyn
= yypact
[yystate
];
2804 if (!yypact_value_is_default (yyn
))
2807 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2815 /* Pop the current state because it cannot handle the error token. */
2819 yyerror_range
[0] = *yylsp
;
2820 yydestruct ("Error: popping",
2821 yystos
[yystate
], yyvsp
, yylsp
);
2824 YY_STACK_PRINT (yyss
, yyssp
);
2829 yyerror_range
[1] = yylloc
;
2830 /* Using YYLLOC is tempting, but would change the location of
2831 the lookahead. YYLOC is available though. */
2832 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2835 /* Shift the error token. */
2836 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2842 /*-------------------------------------.
2843 | yyacceptlab -- YYACCEPT comes here. |
2844 `-------------------------------------*/
2849 /*-----------------------------------.
2850 | yyabortlab -- YYABORT comes here. |
2851 `-----------------------------------*/
2856 #if !defined(yyoverflow) || YYERROR_VERBOSE
2857 /*-------------------------------------------------.
2858 | yyexhaustedlab -- memory exhaustion comes here. |
2859 `-------------------------------------------------*/
2861 yyerror (YY_("memory exhausted"));
2867 if (yychar
!= YYEMPTY
)
2868 yydestruct ("Cleanup: discarding lookahead",
2869 yytoken
, &yylval
, &yylloc
);
2870 /* Do not reclaim the symbols of the rule which action triggered
2871 this YYABORT or YYACCEPT. */
2873 YY_STACK_PRINT (yyss
, yyssp
);
2874 while (yyssp
!= yyss
)
2876 yydestruct ("Cleanup: popping",
2877 yystos
[*yyssp
], yyvsp
, yylsp
);
2882 YYSTACK_FREE (yyss
);
2885 if (yymsg
!= yymsgbuf
)
2886 YYSTACK_FREE (yymsg
);
2888 /* Make sure YYID is used. */
2889 return YYID (yyresult
);
2892 /* Line 1607 of yacc.c */
2893 #line 637 "parse-gram.y"
2897 /* Return the location of the left-hand side of a rule whose
2898 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2899 the right-hand side, and return an empty location equal to the end
2900 boundary of RHS[0] if the right-hand side is empty. */
2903 lloc_default (YYLTYPE
const *rhs
, int n
)
2908 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2909 The bug is fixed in 7.4.2m, but play it safe for now. */
2910 loc
.start
= rhs
[n
].end
;
2911 loc
.end
= rhs
[n
].end
;
2913 /* Ignore empty nonterminals the start of the the right-hand side.
2914 Do not bother to ignore them at the end of the right-hand side,
2915 since empty nonterminals have the same end as their predecessors. */
2916 for (i
= 1; i
<= n
; i
++)
2917 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2919 loc
.start
= rhs
[i
].start
;
2927 /* Add a lex-param or a parse-param (depending on TYPE) with
2928 declaration DECL and location LOC. */
2931 add_param (char const *type
, char *decl
, location loc
)
2933 static char const alphanum
[26 + 26 + 1 + 10] =
2934 "abcdefghijklmnopqrstuvwxyz"
2935 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2938 char const *name_start
= NULL
;
2941 /* Stop on last actual character. */
2942 for (p
= decl
; p
[1]; p
++)
2944 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2945 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2948 /* Strip the surrounding '{' and '}', and any blanks just inside
2950 while (*--p
== ' ' || *p
== '\t')
2953 while (*++decl
== ' ' || *decl
== '\t')
2957 complain_at (loc
, _("missing identifier in parameter declaration"));
2964 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2968 name
= xmalloc (name_len
+ 1);
2969 memcpy (name
, name_start
, name_len
);
2970 name
[name_len
] = '\0';
2971 muscle_pair_list_grow (type
, decl
, name
);
2975 gram_scanner_last_string_free ();
2980 version_check (location
const *loc
, char const *version
)
2982 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2984 complain_at (*loc
, "require bison %s, but have %s",
2985 version
, PACKAGE_VERSION
);
2991 gram_error (location
const *loc
, char const *msg
)
2993 complain_at (*loc
, "%s", msg
);
2997 token_name (int type
)
2999 return yytname
[YYTRANSLATE (type
)];
3010 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3011 return quotearg_style (escape_quoting_style
, buf
);