1 /* A Bison parser, made by GNU Bison 2.4.336-b5c21. */
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.336-b5c21"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 1
65 /* Substitute the variable and function names. */
66 #define yyparse gram_parse
67 #define yylex gram_lex
68 #define yyerror gram_error
69 #define yylval gram_lval
70 #define yychar gram_char
71 #define yydebug gram_debug
72 #define yynerrs gram_nerrs
73 #define yylloc gram_lloc
75 /* Copy the first part of user declarations. */
76 /* Line 191 of yacc.c */
77 #line 1 "parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
80 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
83 This file is part of Bison, the GNU Compiler Compiler.
85 This program is free software: you can redistribute it and/or modify
86 it under the terms of the GNU General Public License as published by
87 the Free Software Foundation, either version 3 of the License, or
88 (at your option) any later version.
90 This program is distributed in the hope that it will be useful,
91 but WITHOUT ANY WARRANTY; without even the implied warranty of
92 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93 GNU General Public License for more details.
95 You should have received a copy of the GNU General Public License
96 along with this program. If not, see <http://www.gnu.org/licenses/>. */
101 #include "complain.h"
102 #include "conflicts.h"
106 #include "muscle-tab.h"
107 #include "quotearg.h"
110 #include "named-ref.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 "../bison/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_EXPECT
= 276,
200 PERCENT_EXPECT_RR
= 277,
202 PERCENT_FILE_PREFIX
= 279,
203 PERCENT_GLR_PARSER
= 280,
204 PERCENT_INITIAL_ACTION
= 281,
205 PERCENT_LANGUAGE
= 282,
206 PERCENT_LEX_PARAM
= 283,
207 PERCENT_NAME_PREFIX
= 284,
208 PERCENT_NO_DEFAULT_PREC
= 285,
209 PERCENT_NO_LINES
= 286,
210 PERCENT_NONDETERMINISTIC_PARSER
= 287,
211 PERCENT_OUTPUT
= 288,
212 PERCENT_PARSE_PARAM
= 289,
213 PERCENT_REQUIRE
= 290,
214 PERCENT_SKELETON
= 291,
216 PERCENT_TOKEN_TABLE
= 293,
217 PERCENT_VERBOSE
= 294,
225 PERCENT_PERCENT
= 302,
240 #define PERCENT_TOKEN 260
241 #define PERCENT_NTERM 261
242 #define PERCENT_TYPE 262
243 #define PERCENT_DESTRUCTOR 263
244 #define PERCENT_PRINTER 264
245 #define PERCENT_LEFT 265
246 #define PERCENT_RIGHT 266
247 #define PERCENT_NONASSOC 267
248 #define PERCENT_PRECEDENCE 268
249 #define PERCENT_PREC 269
250 #define PERCENT_DPREC 270
251 #define PERCENT_MERGE 271
252 #define PERCENT_CODE 272
253 #define PERCENT_DEFAULT_PREC 273
254 #define PERCENT_DEFINE 274
255 #define PERCENT_DEFINES 275
256 #define PERCENT_EXPECT 276
257 #define PERCENT_EXPECT_RR 277
258 #define PERCENT_FLAG 278
259 #define PERCENT_FILE_PREFIX 279
260 #define PERCENT_GLR_PARSER 280
261 #define PERCENT_INITIAL_ACTION 281
262 #define PERCENT_LANGUAGE 282
263 #define PERCENT_LEX_PARAM 283
264 #define PERCENT_NAME_PREFIX 284
265 #define PERCENT_NO_DEFAULT_PREC 285
266 #define PERCENT_NO_LINES 286
267 #define PERCENT_NONDETERMINISTIC_PARSER 287
268 #define PERCENT_OUTPUT 288
269 #define PERCENT_PARSE_PARAM 289
270 #define PERCENT_REQUIRE 290
271 #define PERCENT_SKELETON 291
272 #define PERCENT_START 292
273 #define PERCENT_TOKEN_TABLE 293
274 #define PERCENT_VERBOSE 294
275 #define PERCENT_YACC 295
276 #define BRACED_CODE 296
282 #define PERCENT_PERCENT 302
285 #define SEMICOLON 305
289 #define BRACKETED_ID 309
290 #define PERCENT_UNION 310
295 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
296 typedef union YYSTYPE
298 /* Line 216 of yacc.c */
299 #line 94 "parse-gram.y"
308 unsigned char character
;
309 named_ref
*named_ref
;
312 /* Line 216 of yacc.c */
313 #line 314 "../bison/src/parse-gram.c"
315 # define YYSTYPE_IS_TRIVIAL 1
316 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
317 # define YYSTYPE_IS_DECLARED 1
320 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
321 typedef struct YYLTYPE
328 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
329 # define YYLTYPE_IS_DECLARED 1
330 # define YYLTYPE_IS_TRIVIAL 1
334 /* Copy the second part of user declarations. */
336 /* Line 266 of yacc.c */
337 #line 338 "../bison/src/parse-gram.c"
344 typedef YYTYPE_UINT8 yytype_uint8
;
346 typedef unsigned char yytype_uint8
;
350 typedef YYTYPE_INT8 yytype_int8
;
351 #elif (defined __STDC__ || defined __C99__FUNC__ \
352 || defined __cplusplus || defined _MSC_VER)
353 typedef signed char yytype_int8
;
355 typedef short int yytype_int8
;
359 typedef YYTYPE_UINT16 yytype_uint16
;
361 typedef unsigned short int yytype_uint16
;
365 typedef YYTYPE_INT16 yytype_int16
;
367 typedef short int yytype_int16
;
371 # ifdef __SIZE_TYPE__
372 # define YYSIZE_T __SIZE_TYPE__
373 # elif defined size_t
374 # define YYSIZE_T size_t
375 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
376 || defined __cplusplus || defined _MSC_VER)
377 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
378 # define YYSIZE_T size_t
380 # define YYSIZE_T unsigned int
384 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
389 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
390 # define YY_(msgid) dgettext ("bison-runtime", msgid)
394 # define YY_(msgid) msgid
398 /* Suppress unused-variable warnings by "using" E. */
399 #if ! defined lint || defined __GNUC__
400 # define YYUSE(e) ((void) (e))
402 # define YYUSE(e) /* empty */
405 /* Identity function, used to suppress warnings about constant conditions. */
409 #if (defined __STDC__ || defined __C99__FUNC__ \
410 || defined __cplusplus || defined _MSC_VER)
423 #if ! defined yyoverflow || YYERROR_VERBOSE
425 /* The parser invokes alloca or malloc; define the necessary symbols. */
427 # ifdef YYSTACK_USE_ALLOCA
428 # if YYSTACK_USE_ALLOCA
430 # define YYSTACK_ALLOC __builtin_alloca
431 # elif defined __BUILTIN_VA_ARG_INCR
432 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
434 # define YYSTACK_ALLOC __alloca
435 # elif defined _MSC_VER
436 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
437 # define alloca _alloca
439 # define YYSTACK_ALLOC alloca
440 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
441 || defined __cplusplus || defined _MSC_VER)
442 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
451 # ifdef YYSTACK_ALLOC
452 /* Pacify GCC's `empty if-body' warning. */
453 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
454 # ifndef YYSTACK_ALLOC_MAXIMUM
455 /* The OS might guarantee only one guard page at the bottom of the stack,
456 and a page size can be as small as 4096 bytes. So we cannot safely
457 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
458 to allow for a few compiler-allocated temporary stack slots. */
459 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
462 # define YYSTACK_ALLOC YYMALLOC
463 # define YYSTACK_FREE YYFREE
464 # ifndef YYSTACK_ALLOC_MAXIMUM
465 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
467 # if (defined __cplusplus && ! defined _STDLIB_H \
468 && ! ((defined YYMALLOC || defined malloc) \
469 && (defined YYFREE || defined free)))
470 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
476 # define YYMALLOC malloc
477 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
478 || defined __cplusplus || defined _MSC_VER)
479 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
484 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
485 || defined __cplusplus || defined _MSC_VER)
486 void free (void *); /* INFRINGES ON USER NAME SPACE */
490 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
493 #if (! defined yyoverflow \
494 && (! defined __cplusplus \
495 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
496 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
498 /* A type that is properly aligned for any stack member. */
501 yytype_int16 yyss_alloc
;
506 /* The size of the maximum gap between one aligned stack and the next. */
507 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
509 /* The size of an array large to enough to hold all stacks, each with
511 # define YYSTACK_BYTES(N) \
512 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
513 + 2 * YYSTACK_GAP_MAXIMUM)
515 /* Copy COUNT objects from FROM to TO. The source and destination do
518 # if defined __GNUC__ && 1 < __GNUC__
519 # define YYCOPY(To, From, Count) \
520 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
522 # define YYCOPY(To, From, Count) \
526 for (yyi = 0; yyi < (Count); yyi++) \
527 (To)[yyi] = (From)[yyi]; \
533 /* Relocate STACK from its old location to the new one. The
534 local variables YYSIZE and YYSTACKSIZE give the old and new number of
535 elements in the stack, and YYPTR gives the new location of the
536 stack. Advance YYPTR to a properly aligned location for the next
538 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
541 YYSIZE_T yynewbytes; \
542 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
543 Stack = &yyptr->Stack_alloc; \
544 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
545 yyptr += yynewbytes / sizeof (*yyptr); \
551 /* YYFINAL -- State number of the termination state. */
553 /* YYLAST -- Last index in YYTABLE. */
556 /* YYNTOKENS -- Number of terminals. */
558 /* YYNNTS -- Number of nonterminals. */
560 /* YYNRULES -- Number of rules. */
562 /* YYNSTATES -- Number of states. */
563 #define YYNSTATES 145
565 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
566 by yylex, with out-of-bounds checking. */
568 #define YYMAXUTOK 310
570 #define YYTRANSLATE(YYX) \
571 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
573 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
574 as returned by yylex, without out-of-bounds checking. */
575 static const yytype_uint8 yytranslate
[] =
577 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
603 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
604 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
605 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
606 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
607 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
612 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
613 static const yytype_uint16 yyrline
[] =
615 0, 206, 206, 214, 216, 220, 221, 231, 235, 240,
616 241, 246, 247, 248, 249, 250, 255, 264, 265, 266,
617 267, 268, 269, 270, 271, 272, 273, 274, 298, 299,
618 300, 301, 305, 306, 307, 311, 318, 325, 329, 333,
619 340, 355, 356, 360, 372, 372, 377, 377, 382, 393,
620 408, 409, 410, 411, 415, 416, 421, 423, 428, 429,
621 434, 436, 441, 442, 446, 447, 448, 449, 454, 459,
622 464, 470, 476, 487, 488, 497, 498, 504, 505, 506,
623 513, 513, 518, 519, 520, 525, 527, 529, 531, 533,
624 535, 541, 543, 555, 556, 561, 562, 571, 591, 593,
625 602, 607, 608, 613, 620, 622
629 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
630 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
631 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
632 static const char *const yytname
[] =
634 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
635 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
636 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
637 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
638 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%expect\"",
639 "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"", "\"%glr-parser\"",
640 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
641 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
642 "\"%nondeterministic-parser\"", "\"%output\"", "\"%parse-param\"",
643 "\"%require\"", "\"%skeleton\"", "\"%start\"", "\"%token-table\"",
644 "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"",
645 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
646 "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"", "\"[id]\"",
647 "\"%union\"", "$accept", "input", "prologue_declarations",
648 "prologue_declaration", "grammar_declaration", "union_name",
649 "symbol_declaration", "$@1", "$@2", "precedence_declaration",
650 "precedence_declarator", "tag.opt", "symbols.prec", "symbol.prec",
651 "symbols.1", "generic_symlist", "generic_symlist_item", "symbol_def",
652 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
653 "$@3", "rhses.1", "rhs", "named_ref.opt", "variable", "content.opt",
654 "braceless", "id", "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
659 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
660 (internal) symbol number NUM (which must be that of a token). */
661 static const yytype_uint16 yytoknum
[] =
663 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
664 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
665 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
666 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
667 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
668 305, 306, 307, 308, 309, 310
672 #define YYPACT_NINF -56
674 #define YYTABLE_NINF -105
676 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
678 static const yytype_int16 yypact
[] =
680 -56, 40, 102, -56, -56, -56, 30, 19, 26, -56,
681 -56, -56, -56, -2, -56, 13, 80, 84, 85, -56,
682 29, -56, 51, 90, 54, 32, -56, -56, -56, 33,
683 55, 94, 96, 0, -56, -56, -56, 16, -56, -56,
684 57, -56, -56, -56, -56, 52, -1, -1, 0, 27,
685 27, -56, 59, -56, -56, -56, 101, -56, -56, -56,
686 -56, 113, -56, -56, -56, -56, 114, -56, 115, -56,
687 -56, -56, -56, -56, -56, -56, -56, -56, 93, -56,
688 95, 1, -56, -56, 92, -56, 59, -56, 0, -56,
689 -56, -1, 71, -1, 0, -56, -56, -56, -56, 27,
690 -56, -56, 27, -56, -56, -56, -56, -56, -56, -56,
691 -56, 62, -56, -56, -56, -56, -56, 0, -56, 140,
692 -56, 144, -56, -56, -56, -56, -56, -56, -56, -56,
693 9, 49, -56, -56, 0, 146, 97, 92, 92, 49,
694 -56, -56, -56, -56, -56
697 /* YYDEFACT[S] -- default reduction number in state S. Performed when
698 YYTABLE does not specify something else to do. Zero means the default
700 static const yytype_uint8 yydefact
[] =
702 3, 0, 0, 1, 46, 44, 0, 0, 0, 50,
703 51, 52, 53, 0, 37, 0, 9, 0, 0, 7,
704 0, 15, 0, 0, 0, 0, 38, 21, 22, 0,
705 0, 0, 0, 0, 28, 29, 30, 0, 6, 31,
706 41, 4, 5, 33, 32, 54, 0, 0, 0, 0,
707 0, 97, 0, 39, 94, 93, 95, 10, 11, 12,
708 13, 0, 16, 17, 18, 19, 0, 23, 0, 25,
709 26, 27, 103, 99, 98, 101, 34, 102, 0, 100,
710 0, 0, 75, 77, 91, 42, 0, 55, 0, 68,
711 73, 47, 69, 45, 48, 60, 65, 66, 67, 35,
712 62, 64, 36, 40, 96, 8, 14, 20, 24, 79,
713 78, 0, 76, 2, 92, 80, 43, 49, 56, 58,
714 74, 70, 71, 61, 63, 105, 85, 57, 59, 72,
715 81, 82, 85, 84, 0, 0, 0, 91, 91, 83,
719 /* YYPGOTO[NTERM-NUM]. */
720 static const yytype_int16 yypgoto
[] =
722 -56, -56, -56, -56, 151, -56, -56, -56, -56, -56,
723 -56, -56, -56, 37, -56, 105, -17, -23, 109, -56,
724 77, -56, -56, -56, 28, -51, -56, -56, -32, -42,
728 /* YYDEFGOTO[NTERM-NUM]. */
729 static const yytype_int16 yydefgoto
[] =
731 -1, 1, 2, 41, 80, 86, 43, 47, 46, 44,
732 45, 88, 117, 118, 94, 99, 100, 90, 91, 81,
733 82, 83, 126, 130, 131, 115, 56, 105, 53, 75,
737 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
738 positive, shift that token. If negative, reduce the rule which
739 number is the opposite. If zero, do what YYDEFACT says.
740 If YYTABLE_NINF, syntax error. */
741 static const yytype_int16 yytable
[] =
743 76, -104, 78, 72, 92, 92, 4, 5, 6, 7,
744 8, 9, 10, 11, 12, 95, 54, 78, 13, 14,
745 103, 4, 5, 6, 7, 8, 9, 10, 11, 12,
746 72, 26, 60, 13, 14, 65, 67, 122, 33, 51,
747 3, 73, 73, 52, 74, 74, 26, 79, 111, 92,
748 89, 92, 72, 33, 116, 119, 40, 132, 55, 133,
749 49, 123, 79, 134, 135, 136, 129, 50, 120, 73,
750 120, 40, 74, 61, 72, 121, 66, 68, 96, 97,
751 98, 48, 124, 57, 119, 124, 143, 144, 58, 59,
752 137, 73, 62, 63, 74, 64, 69, 70, 138, 71,
753 51, 140, 85, 87, 104, 125, 138, 4, 5, 6,
754 7, 8, 9, 10, 11, 12, 106, 107, 108, 13,
755 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
756 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
757 34, 35, 36, 109, 128, 110, 114, 72, 142, 37,
758 141, 38, 39, 42, 127, 102, 93, 40, 112, 0,
762 static const yytype_int16 yycheck
[] =
764 33, 0, 1, 3, 46, 47, 5, 6, 7, 8,
765 9, 10, 11, 12, 13, 48, 3, 1, 17, 18,
766 52, 5, 6, 7, 8, 9, 10, 11, 12, 13,
767 3, 30, 3, 17, 18, 3, 3, 92, 37, 41,
768 0, 42, 42, 45, 45, 45, 30, 46, 47, 91,
769 51, 93, 3, 37, 86, 88, 55, 48, 45, 50,
770 41, 94, 46, 14, 15, 16, 121, 41, 91, 42,
771 93, 55, 45, 44, 3, 4, 44, 44, 51, 52,
772 53, 51, 99, 3, 117, 102, 137, 138, 4, 4,
773 41, 42, 41, 3, 45, 41, 41, 3, 131, 3,
774 41, 134, 45, 51, 3, 43, 139, 5, 6, 7,
775 8, 9, 10, 11, 12, 13, 3, 3, 3, 17,
776 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
777 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
778 38, 39, 40, 50, 4, 50, 54, 3, 51, 47,
779 4, 49, 50, 2, 117, 50, 47, 55, 81, -1,
783 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
784 symbol of state STATE-NUM. */
785 static const yytype_uint8 yystos
[] =
787 0, 57, 58, 0, 5, 6, 7, 8, 9, 10,
788 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
789 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
790 34, 35, 36, 37, 38, 39, 40, 47, 49, 50,
791 55, 59, 60, 62, 65, 66, 64, 63, 51, 41,
792 41, 41, 45, 84, 3, 45, 82, 3, 4, 4,
793 3, 44, 41, 3, 41, 3, 44, 3, 44, 41,
794 3, 3, 3, 42, 45, 85, 87, 88, 1, 46,
795 60, 75, 76, 77, 86, 45, 61, 51, 67, 51,
796 73, 74, 85, 74, 70, 87, 51, 52, 53, 71,
797 72, 87, 71, 84, 3, 83, 3, 3, 3, 50,
798 50, 47, 76, 89, 54, 81, 84, 68, 69, 87,
799 73, 4, 88, 87, 72, 43, 78, 69, 4, 88,
800 79, 80, 48, 50, 14, 15, 16, 41, 87, 80,
804 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
805 static const yytype_uint8 yyr1
[] =
807 0, 56, 57, 58, 58, 59, 59, 59, 59, 59,
808 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
809 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
810 59, 59, 60, 60, 60, 60, 60, 60, 60, 60,
811 60, 61, 61, 60, 63, 62, 64, 62, 62, 65,
812 66, 66, 66, 66, 67, 67, 68, 68, 69, 69,
813 70, 70, 71, 71, 72, 72, 72, 72, 73, 73,
814 73, 73, 73, 74, 74, 75, 75, 76, 76, 76,
815 78, 77, 79, 79, 79, 80, 80, 80, 80, 80,
816 80, 81, 81, 82, 82, 83, 83, 84, 85, 85,
817 86, 87, 87, 88, 89, 89
820 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
821 static const yytype_uint8 yyr2
[] =
823 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
824 2, 2, 2, 2, 3, 1, 2, 2, 2, 2,
825 3, 1, 1, 2, 3, 2, 2, 2, 1, 1,
826 1, 1, 1, 1, 2, 3, 3, 1, 1, 2,
827 3, 0, 1, 3, 0, 3, 0, 3, 3, 3,
828 1, 1, 1, 1, 0, 1, 1, 2, 1, 2,
829 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
830 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
831 0, 4, 1, 3, 2, 0, 3, 3, 3, 3,
832 3, 0, 1, 1, 1, 0, 1, 1, 1, 1,
837 #define yyerrok (yyerrstatus = 0)
838 #define yyclearin (yychar = YYEMPTY)
842 #define YYACCEPT goto yyacceptlab
843 #define YYABORT goto yyabortlab
844 #define YYERROR goto yyerrorlab
847 /* Like YYERROR except do call yyerror. This remains here temporarily
848 to ease the transition to the new meaning of YYERROR, for GCC.
849 Once GCC version 2 has supplanted version 1, this can go. */
851 #define YYFAIL goto yyerrlab
853 #define YYRECOVERING() (!!yyerrstatus)
855 #define YYBACKUP(Token, Value) \
857 if (yychar == YYEMPTY && yylen == 1) \
861 yytoken = YYTRANSLATE (yychar); \
867 yyerror (YY_("syntax error: cannot back up")); \
874 #define YYERRCODE 256
877 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
878 If N is 0, then set CURRENT to the empty location which ends
879 the previous symbol: RHS[0] (always defined). */
881 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
882 #ifndef YYLLOC_DEFAULT
883 # define YYLLOC_DEFAULT(Current, Rhs, N) \
887 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
888 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
889 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
890 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
894 (Current).first_line = (Current).last_line = \
895 YYRHSLOC (Rhs, 0).last_line; \
896 (Current).first_column = (Current).last_column = \
897 YYRHSLOC (Rhs, 0).last_column; \
903 /* YY_LOCATION_PRINT -- Print the location on the stream.
904 This macro was not mandated originally: define only if we know
905 we won't break user code: when these are the locations we know. */
907 #ifndef YY_LOCATION_PRINT
908 # if YYLTYPE_IS_TRIVIAL
909 # define YY_LOCATION_PRINT(File, Loc) \
910 fprintf (File, "%d.%d-%d.%d", \
911 (Loc).first_line, (Loc).first_column, \
912 (Loc).last_line, (Loc).last_column)
914 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
919 /* YYLEX -- calling `yylex' with the right arguments. */
922 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
924 # define YYLEX yylex (&yylval, &yylloc)
927 /* Enable debugging if requested. */
931 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
932 # define YYFPRINTF fprintf
935 # define YYDPRINTF(Args) \
941 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
945 YYFPRINTF (stderr, "%s ", Title); \
946 yy_symbol_print (stderr, \
947 Type, Value, Location); \
948 YYFPRINTF (stderr, "\n"); \
953 /*--------------------------------.
954 | Print this symbol on YYOUTPUT. |
955 `--------------------------------*/
958 #if (defined __STDC__ || defined __C99__FUNC__ \
959 || defined __cplusplus || defined _MSC_VER)
961 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
964 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
967 YYSTYPE
const * const yyvaluep
;
968 YYLTYPE
const * const yylocationp
;
975 if (yytype
< YYNTOKENS
)
976 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
984 /* Line 647 of yacc.c */
985 #line 182 "parse-gram.y"
986 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
987 /* Line 647 of yacc.c */
988 #line 989 "../bison/src/parse-gram.c"
993 /* Line 647 of yacc.c */
994 #line 195 "parse-gram.y"
995 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
996 /* Line 647 of yacc.c */
997 #line 998 "../bison/src/parse-gram.c"
1000 case 23: // "%<flag>"
1002 /* Line 647 of yacc.c */
1003 #line 191 "parse-gram.y"
1004 { fprintf (stderr
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1005 /* Line 647 of yacc.c */
1006 #line 1007 "../bison/src/parse-gram.c"
1011 /* Line 647 of yacc.c */
1012 #line 184 "parse-gram.y"
1013 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1014 /* Line 647 of yacc.c */
1015 #line 1016 "../bison/src/parse-gram.c"
1020 /* Line 647 of yacc.c */
1021 #line 176 "parse-gram.y"
1022 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
1023 /* Line 647 of yacc.c */
1024 #line 1025 "../bison/src/parse-gram.c"
1027 case 43: // "epilogue"
1029 /* Line 647 of yacc.c */
1030 #line 184 "parse-gram.y"
1031 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1032 /* Line 647 of yacc.c */
1033 #line 1034 "../bison/src/parse-gram.c"
1036 case 45: // "identifier"
1038 /* Line 647 of yacc.c */
1039 #line 189 "parse-gram.y"
1040 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1041 /* Line 647 of yacc.c */
1042 #line 1043 "../bison/src/parse-gram.c"
1045 case 46: // "identifier:"
1047 /* Line 647 of yacc.c */
1048 #line 190 "parse-gram.y"
1049 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
1050 /* Line 647 of yacc.c */
1051 #line 1052 "../bison/src/parse-gram.c"
1054 case 49: // "%{...%}"
1056 /* Line 647 of yacc.c */
1057 #line 184 "parse-gram.y"
1058 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1059 /* Line 647 of yacc.c */
1060 #line 1061 "../bison/src/parse-gram.c"
1065 /* Line 647 of yacc.c */
1066 #line 192 "parse-gram.y"
1067 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1068 /* Line 647 of yacc.c */
1069 #line 1070 "../bison/src/parse-gram.c"
1072 case 82: // variable
1074 /* Line 647 of yacc.c */
1075 #line 189 "parse-gram.y"
1076 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1077 /* Line 647 of yacc.c */
1078 #line 1079 "../bison/src/parse-gram.c"
1081 case 83: // content.opt
1083 /* Line 647 of yacc.c */
1084 #line 184 "parse-gram.y"
1085 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1086 /* Line 647 of yacc.c */
1087 #line 1088 "../bison/src/parse-gram.c"
1090 case 84: // braceless
1092 /* Line 647 of yacc.c */
1093 #line 184 "parse-gram.y"
1094 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1095 /* Line 647 of yacc.c */
1096 #line 1097 "../bison/src/parse-gram.c"
1101 /* Line 647 of yacc.c */
1102 #line 198 "parse-gram.y"
1103 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1104 /* Line 647 of yacc.c */
1105 #line 1106 "../bison/src/parse-gram.c"
1108 case 86: // id_colon
1110 /* Line 647 of yacc.c */
1111 #line 199 "parse-gram.y"
1112 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1113 /* Line 647 of yacc.c */
1114 #line 1115 "../bison/src/parse-gram.c"
1119 /* Line 647 of yacc.c */
1120 #line 198 "parse-gram.y"
1121 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1122 /* Line 647 of yacc.c */
1123 #line 1124 "../bison/src/parse-gram.c"
1126 case 88: // string_as_id
1128 /* Line 647 of yacc.c */
1129 #line 198 "parse-gram.y"
1130 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1131 /* Line 647 of yacc.c */
1132 #line 1133 "../bison/src/parse-gram.c"
1141 /*--------------------------------.
1142 | Print this symbol on YYOUTPUT. |
1143 `--------------------------------*/
1145 #if (defined __STDC__ || defined __C99__FUNC__ \
1146 || defined __cplusplus || defined _MSC_VER)
1148 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1151 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1154 YYSTYPE
const * const yyvaluep
;
1155 YYLTYPE
const * const yylocationp
;
1158 if (yytype
< YYNTOKENS
)
1159 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1161 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1163 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1164 YYFPRINTF (yyoutput
, ": ");
1165 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1166 YYFPRINTF (yyoutput
, ")");
1169 /*------------------------------------------------------------------.
1170 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1172 `------------------------------------------------------------------*/
1174 #if (defined __STDC__ || defined __C99__FUNC__ \
1175 || defined __cplusplus || defined _MSC_VER)
1177 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1180 yy_stack_print (yybottom
, yytop
)
1181 yytype_int16
*yybottom
;
1182 yytype_int16
*yytop
;
1185 YYFPRINTF (stderr
, "Stack now");
1186 for (; yybottom
<= yytop
; yybottom
++)
1188 int yybot
= *yybottom
;
1189 YYFPRINTF (stderr
, " %d", yybot
);
1191 YYFPRINTF (stderr
, "\n");
1194 # define YY_STACK_PRINT(Bottom, Top) \
1197 yy_stack_print ((Bottom), (Top)); \
1201 /*------------------------------------------------.
1202 | Report that the YYRULE is going to be reduced. |
1203 `------------------------------------------------*/
1205 #if (defined __STDC__ || defined __C99__FUNC__ \
1206 || defined __cplusplus || defined _MSC_VER)
1208 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1211 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1212 yytype_int16
*yyssp
;
1218 unsigned long int yylno
= yyrline
[yyrule
];
1219 int yynrhs
= yyr2
[yyrule
];
1221 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1223 /* The symbols being reduced. */
1224 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1226 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1227 yy_symbol_print (stderr
,
1228 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1229 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1230 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1231 YYFPRINTF (stderr
, "\n");
1235 # define YY_REDUCE_PRINT(Rule) \
1238 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1241 /* Nonzero means print parse trace. It is left uninitialized so that
1242 multiple parsers can coexist. */
1244 #else /* !YYDEBUG */
1245 # define YYDPRINTF(Args)
1246 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1247 # define YY_STACK_PRINT(Bottom, Top)
1248 # define YY_REDUCE_PRINT(Rule)
1249 #endif /* !YYDEBUG */
1252 /* YYINITDEPTH -- initial size of the parser's stacks. */
1254 # define YYINITDEPTH 200
1257 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1258 if the built-in stack extension method is used).
1260 Do not make this value too large; the results are undefined if
1261 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1262 evaluated with infinite-precision integer arithmetic. */
1265 # define YYMAXDEPTH 10000
1273 # if defined __GLIBC__ && defined _STRING_H
1274 # define yystrlen strlen
1276 /* Return the length of YYSTR. */
1277 #if (defined __STDC__ || defined __C99__FUNC__ \
1278 || defined __cplusplus || defined _MSC_VER)
1280 yystrlen (const char *yystr
)
1288 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1296 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1297 # define yystpcpy stpcpy
1299 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1301 #if (defined __STDC__ || defined __C99__FUNC__ \
1302 || defined __cplusplus || defined _MSC_VER)
1304 yystpcpy (char *yydest
, const char *yysrc
)
1307 yystpcpy (yydest
, yysrc
)
1313 const char *yys
= yysrc
;
1315 while ((*yyd
++ = *yys
++) != '\0')
1324 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1325 quotes and backslashes, so that it's suitable for yyerror. The
1326 heuristic is that double-quoting is unnecessary unless the string
1327 contains an apostrophe, a comma, or backslash (other than
1328 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1329 null, do not copy; instead, return the length of what the result
1332 yytnamerr (char *yyres
, const char *yystr
)
1337 char const *yyp
= yystr
;
1344 goto do_not_strip_quotes
;
1348 goto do_not_strip_quotes
;
1361 do_not_strip_quotes
: ;
1365 return yystrlen (yystr
);
1367 return yystpcpy (yyres
, yystr
) - yyres
;
1371 /* Copy into YYRESULT an error message about the unexpected token
1372 YYTOKEN while in state YYSTATE. Return the number of bytes copied,
1373 including the terminating null byte. If YYRESULT is null, do not
1374 copy anything; just return the number of bytes that would be
1375 copied. As a special case, return 0 if an ordinary "syntax error"
1376 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1377 size calculation. */
1379 yysyntax_error (char *yyresult
, int yystate
, int yytoken
)
1381 int yyn
= yypact
[yystate
];
1383 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1387 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1388 YYSIZE_T yysize
= yysize0
;
1390 int yysize_overflow
= 0;
1391 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1392 /* Internationalized format string. */
1393 const char *yyformat
= 0;
1394 /* Arguments of yyformat. */
1395 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1397 /* Start YYX at -YYN if negative to avoid negative indexes in
1399 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1401 /* Stay within bounds of both yycheck and yytname. */
1402 int yychecklim
= YYLAST
- yyn
+ 1;
1403 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1404 /* Number of reported tokens (one for the "unexpected", one per
1409 yyarg
[yycount
++] = yytname
[yytoken
];
1411 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1412 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1414 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1420 yyarg
[yycount
++] = yytname
[yyx
];
1421 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1422 yysize_overflow
|= (yysize1
< yysize
);
1428 #define YYCASE_(N, S) \
1432 YYCASE_(1, YY_("syntax error, unexpected %s"));
1433 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1434 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1435 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1436 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1440 yysize1
= yysize
+ yystrlen (yyformat
);
1441 yysize_overflow
|= (yysize1
< yysize
);
1444 if (yysize_overflow
)
1445 return YYSIZE_MAXIMUM
;
1449 /* Avoid sprintf, as that infringes on the user's name space.
1450 Don't have undefined behavior even if the translation
1451 produced a string with the wrong number of "%s"s. */
1452 char *yyp
= yyresult
;
1454 while ((*yyp
= *yyformat
) != '\0')
1455 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1457 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1469 #endif /* YYERROR_VERBOSE */
1472 /*-----------------------------------------------.
1473 | Release the memory associated to this symbol. |
1474 `-----------------------------------------------*/
1477 #if (defined __STDC__ || defined __C99__FUNC__ \
1478 || defined __cplusplus || defined _MSC_VER)
1480 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1483 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1487 YYLTYPE
*yylocationp
;
1491 YYUSE (yylocationp
);
1495 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1504 /* Prevent warnings from -Wmissing-prototypes. */
1505 #ifdef YYPARSE_PARAM
1506 #if (defined __STDC__ || defined __C99__FUNC__ \
1507 || defined __cplusplus || defined _MSC_VER)
1508 int yyparse (void *YYPARSE_PARAM
);
1512 #else /* ! YYPARSE_PARAM */
1513 #if (defined __STDC__ || defined __C99__FUNC__ \
1514 || defined __cplusplus || defined _MSC_VER)
1519 #endif /* ! YYPARSE_PARAM */
1525 /*-------------------------.
1526 | yyparse or yypush_parse. |
1527 `-------------------------*/
1529 #ifdef YYPARSE_PARAM
1530 #if (defined __STDC__ || defined __C99__FUNC__ \
1531 || defined __cplusplus || defined _MSC_VER)
1533 yyparse (void *YYPARSE_PARAM
)
1536 yyparse (YYPARSE_PARAM
)
1537 void *YYPARSE_PARAM
;
1539 #else /* ! YYPARSE_PARAM */
1540 #if (defined __STDC__ || defined __C99__FUNC__ \
1541 || defined __cplusplus || defined _MSC_VER)
1551 /* The lookahead symbol. */
1554 /* The semantic value of the lookahead symbol. */
1557 /* Location data for the lookahead symbol. */
1560 /* Number of syntax errors so far. */
1564 /* Number of tokens to shift before error messages enabled. */
1567 /* The stacks and their tools:
1568 `yyss': related to states.
1569 `yyvs': related to semantic values.
1570 `yyls': related to locations.
1572 Refer to the stacks thru separate pointers, to allow yyoverflow
1573 to reallocate them elsewhere. */
1575 /* The state stack. */
1576 yytype_int16 yyssa
[YYINITDEPTH
];
1578 yytype_int16
*yyssp
;
1580 /* The semantic value stack. */
1581 YYSTYPE yyvsa
[YYINITDEPTH
];
1585 /* The location stack. */
1586 YYLTYPE yylsa
[YYINITDEPTH
];
1590 /* The locations where the error started and ended. */
1591 YYLTYPE yyerror_range
[2];
1593 YYSIZE_T yystacksize
;
1597 /* Lookahead token as an internal (translated) token number. */
1599 /* The variables used to return semantic value and location from the
1605 /* Buffer for error messages, and its allocated size. */
1607 char *yymsg
= yymsgbuf
;
1608 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1611 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1613 /* The number of symbols on the RHS of the reduced rule.
1614 Keep to zero when no symbol should be popped. */
1621 yystacksize
= YYINITDEPTH
;
1623 YYDPRINTF ((stderr
, "Starting parse\n"));
1628 yychar
= YYEMPTY
; /* Cause a token to be read. */
1630 /* Initialize stack pointers.
1631 Waste one element of value and location stack
1632 so that they stay on the same level as the state stack.
1633 The wasted elements are never initialized. */
1638 #if YYLTYPE_IS_TRIVIAL
1639 /* Initialize the default location before parsing starts. */
1640 yylloc
.first_line
= yylloc
.last_line
= 1;
1641 yylloc
.first_column
= yylloc
.last_column
= 1;
1644 /* User initialization code. */
1645 /* Line 1167 of yacc.c */
1646 #line 86 "parse-gram.y"
1648 /* Bison's grammar can initial empty locations, hence a default
1649 location is needed. */
1650 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1651 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1653 /* Line 1167 of yacc.c */
1654 #line 1655 "../bison/src/parse-gram.c"
1659 /*------------------------------------------------------------.
1660 | yynewstate -- Push a new state, which is found in yystate. |
1661 `------------------------------------------------------------*/
1663 /* In all cases, when you get here, the value and location stacks
1664 have just been pushed. So pushing a state here evens the stacks. */
1670 if (yyss
+ yystacksize
- 1 <= yyssp
)
1672 /* Get the current used size of the three stacks, in elements. */
1673 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1677 /* Give user a chance to reallocate the stack. Use copies of
1678 these so that the &'s don't force the real ones into
1680 YYSTYPE
*yyvs1
= yyvs
;
1681 yytype_int16
*yyss1
= yyss
;
1682 YYLTYPE
*yyls1
= yyls
;
1684 /* Each stack pointer address is followed by the size of the
1685 data in use in that stack, in bytes. This used to be a
1686 conditional around just the two extra args, but that might
1687 be undefined if yyoverflow is a macro. */
1688 yyoverflow (YY_("memory exhausted"),
1689 &yyss1
, yysize
* sizeof (*yyssp
),
1690 &yyvs1
, yysize
* sizeof (*yyvsp
),
1691 &yyls1
, yysize
* sizeof (*yylsp
),
1698 #else /* no yyoverflow */
1699 # ifndef YYSTACK_RELOCATE
1700 goto yyexhaustedlab
;
1702 /* Extend the stack our own way. */
1703 if (YYMAXDEPTH
<= yystacksize
)
1704 goto yyexhaustedlab
;
1706 if (YYMAXDEPTH
< yystacksize
)
1707 yystacksize
= YYMAXDEPTH
;
1710 yytype_int16
*yyss1
= yyss
;
1711 union yyalloc
*yyptr
=
1712 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1714 goto yyexhaustedlab
;
1715 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1716 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1717 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1718 # undef YYSTACK_RELOCATE
1720 YYSTACK_FREE (yyss1
);
1723 #endif /* no yyoverflow */
1725 yyssp
= yyss
+ yysize
- 1;
1726 yyvsp
= yyvs
+ yysize
- 1;
1727 yylsp
= yyls
+ yysize
- 1;
1729 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1730 (unsigned long int) yystacksize
));
1732 if (yyss
+ yystacksize
- 1 <= yyssp
)
1736 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1738 if (yystate
== YYFINAL
)
1748 /* Do appropriate processing given the current state. Read a
1749 lookahead token if we need one and don't already have one. */
1751 /* First try to decide what to do without reference to lookahead token. */
1752 yyn
= yypact
[yystate
];
1753 if (yyn
== YYPACT_NINF
)
1756 /* Not known => get a lookahead token if don't already have one. */
1758 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1759 if (yychar
== YYEMPTY
)
1761 YYDPRINTF ((stderr
, "Reading a token: "));
1765 if (yychar
<= YYEOF
)
1767 yychar
= yytoken
= YYEOF
;
1768 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1772 yytoken
= YYTRANSLATE (yychar
);
1773 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1776 /* If the proper action on seeing token YYTOKEN is to reduce or to
1777 detect an error, take that action. */
1779 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1784 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1790 /* Count tokens shifted since error; after three, turn off error
1795 /* Shift the lookahead token. */
1796 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1798 /* Discard the shifted token. */
1807 /*-----------------------------------------------------------.
1808 | yydefault -- do the default action for the current state. |
1809 `-----------------------------------------------------------*/
1811 yyn
= yydefact
[yystate
];
1817 /*-----------------------------.
1818 | yyreduce -- Do a reduction. |
1819 `-----------------------------*/
1821 /* yyn is the number of a rule to reduce with. */
1824 /* If YYLEN is nonzero, implement the default value of the action:
1827 Otherwise, the following line sets YYVAL to garbage.
1828 This behavior is undocumented and Bison
1829 users should not rely upon it. Assigning to YYVAL
1830 unconditionally makes the parser a bit smaller, and it avoids a
1831 GCC warning that YYVAL may be used uninitialized. */
1832 yyval
= yyvsp
[1-yylen
];
1834 /* Default location. */
1835 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1836 YY_REDUCE_PRINT (yyn
);
1840 /* Line 1380 of yacc.c */
1841 #line 222 "parse-gram.y"
1843 code_props plain_code
;
1844 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
1845 code_props_translate_code (&plain_code
);
1846 gram_scanner_last_string_free ();
1847 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1848 plain_code
.code
, (yylsp
[0]));
1849 code_scanner_last_string_free ();
1851 /* Line 1380 of yacc.c */
1852 #line 1853 "../bison/src/parse-gram.c"
1856 /* Line 1380 of yacc.c */
1857 #line 232 "parse-gram.y"
1859 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
1861 /* Line 1380 of yacc.c */
1862 #line 1863 "../bison/src/parse-gram.c"
1866 /* Line 1380 of yacc.c */
1867 #line 236 "parse-gram.y"
1869 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
1870 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
1872 /* Line 1380 of yacc.c */
1873 #line 1874 "../bison/src/parse-gram.c"
1877 /* Line 1380 of yacc.c */
1878 #line 240 "parse-gram.y"
1879 { defines_flag
= true; }
1880 /* Line 1380 of yacc.c */
1881 #line 1882 "../bison/src/parse-gram.c"
1885 /* Line 1380 of yacc.c */
1886 #line 242 "parse-gram.y"
1888 defines_flag
= true;
1889 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
1891 /* Line 1380 of yacc.c */
1892 #line 1893 "../bison/src/parse-gram.c"
1896 /* Line 1380 of yacc.c */
1897 #line 246 "parse-gram.y"
1898 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
1899 /* Line 1380 of yacc.c */
1900 #line 1901 "../bison/src/parse-gram.c"
1904 /* Line 1380 of yacc.c */
1905 #line 247 "parse-gram.y"
1906 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
1907 /* Line 1380 of yacc.c */
1908 #line 1909 "../bison/src/parse-gram.c"
1912 /* Line 1380 of yacc.c */
1913 #line 248 "parse-gram.y"
1914 { spec_file_prefix
= (yyvsp
[0].chars
); }
1915 /* Line 1380 of yacc.c */
1916 #line 1917 "../bison/src/parse-gram.c"
1920 /* Line 1380 of yacc.c */
1921 #line 249 "parse-gram.y"
1922 { spec_file_prefix
= (yyvsp
[0].chars
); }
1923 /* Line 1380 of yacc.c */
1924 #line 1925 "../bison/src/parse-gram.c"
1928 /* Line 1380 of yacc.c */
1929 #line 251 "parse-gram.y"
1931 nondeterministic_parser
= true;
1934 /* Line 1380 of yacc.c */
1935 #line 1936 "../bison/src/parse-gram.c"
1939 /* Line 1380 of yacc.c */
1940 #line 256 "parse-gram.y"
1943 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
1944 code_props_translate_code (&action
);
1945 gram_scanner_last_string_free ();
1946 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
1947 code_scanner_last_string_free ();
1949 /* Line 1380 of yacc.c */
1950 #line 1951 "../bison/src/parse-gram.c"
1954 /* Line 1380 of yacc.c */
1955 #line 264 "parse-gram.y"
1956 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
1957 /* Line 1380 of yacc.c */
1958 #line 1959 "../bison/src/parse-gram.c"
1962 /* Line 1380 of yacc.c */
1963 #line 265 "parse-gram.y"
1964 { add_param ("lex_param", (yyvsp
[0].code
), (yylsp
[0])); }
1965 /* Line 1380 of yacc.c */
1966 #line 1967 "../bison/src/parse-gram.c"
1970 /* Line 1380 of yacc.c */
1971 #line 266 "parse-gram.y"
1972 { spec_name_prefix
= (yyvsp
[0].chars
); }
1973 /* Line 1380 of yacc.c */
1974 #line 1975 "../bison/src/parse-gram.c"
1978 /* Line 1380 of yacc.c */
1979 #line 267 "parse-gram.y"
1980 { spec_name_prefix
= (yyvsp
[0].chars
); }
1981 /* Line 1380 of yacc.c */
1982 #line 1983 "../bison/src/parse-gram.c"
1986 /* Line 1380 of yacc.c */
1987 #line 268 "parse-gram.y"
1988 { no_lines_flag
= true; }
1989 /* Line 1380 of yacc.c */
1990 #line 1991 "../bison/src/parse-gram.c"
1994 /* Line 1380 of yacc.c */
1995 #line 269 "parse-gram.y"
1996 { nondeterministic_parser
= true; }
1997 /* Line 1380 of yacc.c */
1998 #line 1999 "../bison/src/parse-gram.c"
2002 /* Line 1380 of yacc.c */
2003 #line 270 "parse-gram.y"
2004 { spec_outfile
= (yyvsp
[0].chars
); }
2005 /* Line 1380 of yacc.c */
2006 #line 2007 "../bison/src/parse-gram.c"
2010 /* Line 1380 of yacc.c */
2011 #line 271 "parse-gram.y"
2012 { spec_outfile
= (yyvsp
[0].chars
); }
2013 /* Line 1380 of yacc.c */
2014 #line 2015 "../bison/src/parse-gram.c"
2018 /* Line 1380 of yacc.c */
2019 #line 272 "parse-gram.y"
2020 { add_param ("parse_param", (yyvsp
[0].code
), (yylsp
[0])); }
2021 /* Line 1380 of yacc.c */
2022 #line 2023 "../bison/src/parse-gram.c"
2026 /* Line 1380 of yacc.c */
2027 #line 273 "parse-gram.y"
2028 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2029 /* Line 1380 of yacc.c */
2030 #line 2031 "../bison/src/parse-gram.c"
2034 /* Line 1380 of yacc.c */
2035 #line 275 "parse-gram.y"
2037 char const *skeleton_user
= (yyvsp
[0].chars
);
2038 if (strchr (skeleton_user
, '/'))
2040 size_t dir_length
= strlen (current_file
);
2041 char *skeleton_build
;
2042 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2044 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2047 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2050 strncpy (skeleton_build
, current_file
, dir_length
);
2051 skeleton_build
[dir_length
++] = '/';
2053 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2054 skeleton_user
= uniqstr_new (skeleton_build
);
2055 free (skeleton_build
);
2057 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2059 /* Line 1380 of yacc.c */
2060 #line 2061 "../bison/src/parse-gram.c"
2064 /* Line 1380 of yacc.c */
2065 #line 298 "parse-gram.y"
2066 { token_table_flag
= true; }
2067 /* Line 1380 of yacc.c */
2068 #line 2069 "../bison/src/parse-gram.c"
2072 /* Line 1380 of yacc.c */
2073 #line 299 "parse-gram.y"
2074 { report_flag
|= report_states
; }
2075 /* Line 1380 of yacc.c */
2076 #line 2077 "../bison/src/parse-gram.c"
2080 /* Line 1380 of yacc.c */
2081 #line 300 "parse-gram.y"
2082 { yacc_flag
= true; }
2083 /* Line 1380 of yacc.c */
2084 #line 2085 "../bison/src/parse-gram.c"
2088 /* Line 1380 of yacc.c */
2089 #line 308 "parse-gram.y"
2091 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2093 /* Line 1380 of yacc.c */
2094 #line 2095 "../bison/src/parse-gram.c"
2098 /* Line 1380 of yacc.c */
2099 #line 312 "parse-gram.y"
2102 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2103 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2104 symbol_list_free ((yyvsp
[0].list
));
2106 /* Line 1380 of yacc.c */
2107 #line 2108 "../bison/src/parse-gram.c"
2111 /* Line 1380 of yacc.c */
2112 #line 319 "parse-gram.y"
2115 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2116 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2117 symbol_list_free ((yyvsp
[0].list
));
2119 /* Line 1380 of yacc.c */
2120 #line 2121 "../bison/src/parse-gram.c"
2124 /* Line 1380 of yacc.c */
2125 #line 326 "parse-gram.y"
2127 default_prec
= true;
2129 /* Line 1380 of yacc.c */
2130 #line 2131 "../bison/src/parse-gram.c"
2134 /* Line 1380 of yacc.c */
2135 #line 330 "parse-gram.y"
2137 default_prec
= false;
2139 /* Line 1380 of yacc.c */
2140 #line 2141 "../bison/src/parse-gram.c"
2144 /* Line 1380 of yacc.c */
2145 #line 334 "parse-gram.y"
2147 /* Do not invoke muscle_percent_code_grow here since it invokes
2148 muscle_user_name_list_grow. */
2149 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2150 code_scanner_last_string_free ();
2152 /* Line 1380 of yacc.c */
2153 #line 2154 "../bison/src/parse-gram.c"
2157 /* Line 1380 of yacc.c */
2158 #line 341 "parse-gram.y"
2160 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2161 code_scanner_last_string_free ();
2163 /* Line 1380 of yacc.c */
2164 #line 2165 "../bison/src/parse-gram.c"
2168 /* Line 1380 of yacc.c */
2169 #line 355 "parse-gram.y"
2171 /* Line 1380 of yacc.c */
2172 #line 2173 "../bison/src/parse-gram.c"
2176 /* Line 1380 of yacc.c */
2177 #line 356 "parse-gram.y"
2178 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2179 /* Line 1380 of yacc.c */
2180 #line 2181 "../bison/src/parse-gram.c"
2184 /* Line 1380 of yacc.c */
2185 #line 361 "parse-gram.y"
2188 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2189 code_scanner_last_string_free ();
2191 /* Line 1380 of yacc.c */
2192 #line 2193 "../bison/src/parse-gram.c"
2196 /* Line 1380 of yacc.c */
2197 #line 372 "parse-gram.y"
2198 { current_class
= nterm_sym
; }
2199 /* Line 1380 of yacc.c */
2200 #line 2201 "../bison/src/parse-gram.c"
2204 /* Line 1380 of yacc.c */
2205 #line 373 "parse-gram.y"
2207 current_class
= unknown_sym
;
2208 current_type
= NULL
;
2210 /* Line 1380 of yacc.c */
2211 #line 2212 "../bison/src/parse-gram.c"
2215 /* Line 1380 of yacc.c */
2216 #line 377 "parse-gram.y"
2217 { current_class
= token_sym
; }
2218 /* Line 1380 of yacc.c */
2219 #line 2220 "../bison/src/parse-gram.c"
2223 /* Line 1380 of yacc.c */
2224 #line 378 "parse-gram.y"
2226 current_class
= unknown_sym
;
2227 current_type
= NULL
;
2229 /* Line 1380 of yacc.c */
2230 #line 2231 "../bison/src/parse-gram.c"
2234 /* Line 1380 of yacc.c */
2235 #line 383 "parse-gram.y"
2239 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2240 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2241 symbol_list_free ((yyvsp
[0].list
));
2243 /* Line 1380 of yacc.c */
2244 #line 2245 "../bison/src/parse-gram.c"
2248 /* Line 1380 of yacc.c */
2249 #line 394 "parse-gram.y"
2253 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2255 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2256 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2258 symbol_list_free ((yyvsp
[0].list
));
2259 current_type
= NULL
;
2261 /* Line 1380 of yacc.c */
2262 #line 2263 "../bison/src/parse-gram.c"
2266 /* Line 1380 of yacc.c */
2267 #line 408 "parse-gram.y"
2268 { (yyval
.assoc
) = left_assoc
; }
2269 /* Line 1380 of yacc.c */
2270 #line 2271 "../bison/src/parse-gram.c"
2274 /* Line 1380 of yacc.c */
2275 #line 409 "parse-gram.y"
2276 { (yyval
.assoc
) = right_assoc
; }
2277 /* Line 1380 of yacc.c */
2278 #line 2279 "../bison/src/parse-gram.c"
2282 /* Line 1380 of yacc.c */
2283 #line 410 "parse-gram.y"
2284 { (yyval
.assoc
) = non_assoc
; }
2285 /* Line 1380 of yacc.c */
2286 #line 2287 "../bison/src/parse-gram.c"
2290 /* Line 1380 of yacc.c */
2291 #line 411 "parse-gram.y"
2292 { (yyval
.assoc
) = precedence_assoc
; }
2293 /* Line 1380 of yacc.c */
2294 #line 2295 "../bison/src/parse-gram.c"
2298 /* Line 1380 of yacc.c */
2299 #line 415 "parse-gram.y"
2300 { current_type
= NULL
; }
2301 /* Line 1380 of yacc.c */
2302 #line 2303 "../bison/src/parse-gram.c"
2306 /* Line 1380 of yacc.c */
2307 #line 416 "parse-gram.y"
2308 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2309 /* Line 1380 of yacc.c */
2310 #line 2311 "../bison/src/parse-gram.c"
2314 /* Line 1380 of yacc.c */
2315 #line 422 "parse-gram.y"
2316 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2317 /* Line 1380 of yacc.c */
2318 #line 2319 "../bison/src/parse-gram.c"
2322 /* Line 1380 of yacc.c */
2323 #line 424 "parse-gram.y"
2324 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2325 /* Line 1380 of yacc.c */
2326 #line 2327 "../bison/src/parse-gram.c"
2330 /* Line 1380 of yacc.c */
2331 #line 428 "parse-gram.y"
2332 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2333 /* Line 1380 of yacc.c */
2334 #line 2335 "../bison/src/parse-gram.c"
2338 /* Line 1380 of yacc.c */
2339 #line 429 "parse-gram.y"
2340 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2341 /* Line 1380 of yacc.c */
2342 #line 2343 "../bison/src/parse-gram.c"
2346 /* Line 1380 of yacc.c */
2347 #line 435 "parse-gram.y"
2348 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2349 /* Line 1380 of yacc.c */
2350 #line 2351 "../bison/src/parse-gram.c"
2354 /* Line 1380 of yacc.c */
2355 #line 437 "parse-gram.y"
2356 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2357 /* Line 1380 of yacc.c */
2358 #line 2359 "../bison/src/parse-gram.c"
2362 /* Line 1380 of yacc.c */
2363 #line 441 "parse-gram.y"
2364 { (yyval
.list
) = (yyvsp
[0].list
); }
2365 /* Line 1380 of yacc.c */
2366 #line 2367 "../bison/src/parse-gram.c"
2370 /* Line 1380 of yacc.c */
2371 #line 442 "parse-gram.y"
2372 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2373 /* Line 1380 of yacc.c */
2374 #line 2375 "../bison/src/parse-gram.c"
2378 /* Line 1380 of yacc.c */
2379 #line 446 "parse-gram.y"
2380 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2381 /* Line 1380 of yacc.c */
2382 #line 2383 "../bison/src/parse-gram.c"
2386 /* Line 1380 of yacc.c */
2387 #line 447 "parse-gram.y"
2388 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2389 /* Line 1380 of yacc.c */
2390 #line 2391 "../bison/src/parse-gram.c"
2394 /* Line 1380 of yacc.c */
2395 #line 448 "parse-gram.y"
2396 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2397 /* Line 1380 of yacc.c */
2398 #line 2399 "../bison/src/parse-gram.c"
2402 /* Line 1380 of yacc.c */
2403 #line 449 "parse-gram.y"
2404 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2405 /* Line 1380 of yacc.c */
2406 #line 2407 "../bison/src/parse-gram.c"
2410 /* Line 1380 of yacc.c */
2411 #line 455 "parse-gram.y"
2413 current_type
= (yyvsp
[0].uniqstr
);
2416 /* Line 1380 of yacc.c */
2417 #line 2418 "../bison/src/parse-gram.c"
2421 /* Line 1380 of yacc.c */
2422 #line 460 "parse-gram.y"
2424 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2425 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2427 /* Line 1380 of yacc.c */
2428 #line 2429 "../bison/src/parse-gram.c"
2432 /* Line 1380 of yacc.c */
2433 #line 465 "parse-gram.y"
2435 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2436 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2437 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2439 /* Line 1380 of yacc.c */
2440 #line 2441 "../bison/src/parse-gram.c"
2444 /* Line 1380 of yacc.c */
2445 #line 471 "parse-gram.y"
2447 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2448 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2449 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2451 /* Line 1380 of yacc.c */
2452 #line 2453 "../bison/src/parse-gram.c"
2456 /* Line 1380 of yacc.c */
2457 #line 477 "parse-gram.y"
2459 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2460 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2461 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2462 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2464 /* Line 1380 of yacc.c */
2465 #line 2466 "../bison/src/parse-gram.c"
2469 /* Line 1380 of yacc.c */
2470 #line 507 "parse-gram.y"
2474 /* Line 1380 of yacc.c */
2475 #line 2476 "../bison/src/parse-gram.c"
2479 /* Line 1380 of yacc.c */
2480 #line 513 "parse-gram.y"
2481 { current_lhs
= (yyvsp
[-1].symbol
); current_lhs_location
= (yylsp
[-1]);
2482 current_lhs_named_ref
= (yyvsp
[0].named_ref
); }
2483 /* Line 1380 of yacc.c */
2484 #line 2485 "../bison/src/parse-gram.c"
2488 /* Line 1380 of yacc.c */
2489 #line 518 "parse-gram.y"
2490 { grammar_current_rule_end ((yylsp
[0])); }
2491 /* Line 1380 of yacc.c */
2492 #line 2493 "../bison/src/parse-gram.c"
2496 /* Line 1380 of yacc.c */
2497 #line 519 "parse-gram.y"
2498 { grammar_current_rule_end ((yylsp
[0])); }
2499 /* Line 1380 of yacc.c */
2500 #line 2501 "../bison/src/parse-gram.c"
2504 /* Line 1380 of yacc.c */
2505 #line 525 "parse-gram.y"
2506 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2507 current_lhs_named_ref
); }
2508 /* Line 1380 of yacc.c */
2509 #line 2510 "../bison/src/parse-gram.c"
2513 /* Line 1380 of yacc.c */
2514 #line 528 "parse-gram.y"
2515 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2516 /* Line 1380 of yacc.c */
2517 #line 2518 "../bison/src/parse-gram.c"
2521 /* Line 1380 of yacc.c */
2522 #line 530 "parse-gram.y"
2523 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2524 /* Line 1380 of yacc.c */
2525 #line 2526 "../bison/src/parse-gram.c"
2529 /* Line 1380 of yacc.c */
2530 #line 532 "parse-gram.y"
2531 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2532 /* Line 1380 of yacc.c */
2533 #line 2534 "../bison/src/parse-gram.c"
2537 /* Line 1380 of yacc.c */
2538 #line 534 "parse-gram.y"
2539 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2540 /* Line 1380 of yacc.c */
2541 #line 2542 "../bison/src/parse-gram.c"
2545 /* Line 1380 of yacc.c */
2546 #line 536 "parse-gram.y"
2547 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2548 /* Line 1380 of yacc.c */
2549 #line 2550 "../bison/src/parse-gram.c"
2553 /* Line 1380 of yacc.c */
2554 #line 541 "parse-gram.y"
2555 { (yyval
.named_ref
) = 0; }
2556 /* Line 1380 of yacc.c */
2557 #line 2558 "../bison/src/parse-gram.c"
2561 /* Line 1380 of yacc.c */
2562 #line 544 "parse-gram.y"
2563 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2564 /* Line 1380 of yacc.c */
2565 #line 2566 "../bison/src/parse-gram.c"
2569 /* Line 1380 of yacc.c */
2570 #line 556 "parse-gram.y"
2571 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2572 /* Line 1380 of yacc.c */
2573 #line 2574 "../bison/src/parse-gram.c"
2577 /* Line 1380 of yacc.c */
2578 #line 561 "parse-gram.y"
2579 { (yyval
.chars
) = ""; }
2580 /* Line 1380 of yacc.c */
2581 #line 2582 "../bison/src/parse-gram.c"
2585 /* Line 1380 of yacc.c */
2586 #line 572 "parse-gram.y"
2588 code_props plain_code
;
2589 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2590 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2591 code_props_translate_code (&plain_code
);
2592 gram_scanner_last_string_free ();
2593 (yyval
.chars
) = plain_code
.code
;
2595 /* Line 1380 of yacc.c */
2596 #line 2597 "../bison/src/parse-gram.c"
2600 /* Line 1380 of yacc.c */
2601 #line 592 "parse-gram.y"
2602 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2603 /* Line 1380 of yacc.c */
2604 #line 2605 "../bison/src/parse-gram.c"
2608 /* Line 1380 of yacc.c */
2609 #line 594 "parse-gram.y"
2611 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2612 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2613 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2615 /* Line 1380 of yacc.c */
2616 #line 2617 "../bison/src/parse-gram.c"
2620 /* Line 1380 of yacc.c */
2621 #line 602 "parse-gram.y"
2622 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2623 /* Line 1380 of yacc.c */
2624 #line 2625 "../bison/src/parse-gram.c"
2628 /* Line 1380 of yacc.c */
2629 #line 614 "parse-gram.y"
2631 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2632 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2634 /* Line 1380 of yacc.c */
2635 #line 2636 "../bison/src/parse-gram.c"
2639 /* Line 1380 of yacc.c */
2640 #line 623 "parse-gram.y"
2642 code_props plain_code
;
2643 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2644 code_props_translate_code (&plain_code
);
2645 gram_scanner_last_string_free ();
2646 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2647 code_scanner_last_string_free ();
2649 /* Line 1380 of yacc.c */
2650 #line 2651 "../bison/src/parse-gram.c"
2654 /* Line 1380 of yacc.c */
2655 #line 2656 "../bison/src/parse-gram.c"
2658 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2662 YY_STACK_PRINT (yyss
, yyssp
);
2667 /* Now `shift' the result of the reduction. Determine what state
2668 that goes to, based on the state we popped back to and the rule
2669 number reduced by. */
2673 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2674 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2675 yystate
= yytable
[yystate
];
2677 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2682 /*------------------------------------.
2683 | yyerrlab -- here on detecting error |
2684 `------------------------------------*/
2686 /* If not already recovering from an error, report this error. */
2690 #if ! YYERROR_VERBOSE
2691 yyerror (YY_("syntax error"));
2694 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yytoken
);
2695 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2697 YYSIZE_T yyalloc
= 2 * yysize
;
2698 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2699 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2700 if (yymsg
!= yymsgbuf
)
2701 YYSTACK_FREE (yymsg
);
2702 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2704 yymsg_alloc
= yyalloc
;
2708 yymsg_alloc
= sizeof yymsgbuf
;
2712 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2714 (void) yysyntax_error (yymsg
, yystate
, yytoken
);
2719 yyerror (YY_("syntax error"));
2721 goto yyexhaustedlab
;
2727 yyerror_range
[0] = yylloc
;
2729 if (yyerrstatus
== 3)
2731 /* If just tried and failed to reuse lookahead token after an
2732 error, discard it. */
2734 if (yychar
<= YYEOF
)
2736 /* Return failure if at end of input. */
2737 if (yychar
== YYEOF
)
2742 yydestruct ("Error: discarding",
2743 yytoken
, &yylval
, &yylloc
);
2748 /* Else will try to reuse lookahead token after shifting the error
2753 /*---------------------------------------------------.
2754 | yyerrorlab -- error raised explicitly by YYERROR. |
2755 `---------------------------------------------------*/
2758 /* Pacify compilers like GCC when the user code never invokes
2759 YYERROR and the label yyerrorlab therefore never appears in user
2761 if (/*CONSTCOND*/ 0)
2764 yyerror_range
[0] = yylsp
[1-yylen
];
2765 /* Do not reclaim the symbols of the rule which action triggered
2769 YY_STACK_PRINT (yyss
, yyssp
);
2774 /*-------------------------------------------------------------.
2775 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2776 `-------------------------------------------------------------*/
2778 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2782 yyn
= yypact
[yystate
];
2783 if (yyn
!= YYPACT_NINF
)
2786 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2794 /* Pop the current state because it cannot handle the error token. */
2798 yyerror_range
[0] = *yylsp
;
2799 yydestruct ("Error: popping",
2800 yystos
[yystate
], yyvsp
, yylsp
);
2803 YY_STACK_PRINT (yyss
, yyssp
);
2808 yyerror_range
[1] = yylloc
;
2809 /* Using YYLLOC is tempting, but would change the location of
2810 the lookahead. YYLOC is available though. */
2811 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2814 /* Shift the error token. */
2815 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2821 /*-------------------------------------.
2822 | yyacceptlab -- YYACCEPT comes here. |
2823 `-------------------------------------*/
2828 /*-----------------------------------.
2829 | yyabortlab -- YYABORT comes here. |
2830 `-----------------------------------*/
2835 #if !defined(yyoverflow) || YYERROR_VERBOSE
2836 /*-------------------------------------------------.
2837 | yyexhaustedlab -- memory exhaustion comes here. |
2838 `-------------------------------------------------*/
2840 yyerror (YY_("memory exhausted"));
2846 if (yychar
!= YYEMPTY
)
2847 yydestruct ("Cleanup: discarding lookahead",
2848 yytoken
, &yylval
, &yylloc
);
2849 /* Do not reclaim the symbols of the rule which action triggered
2850 this YYABORT or YYACCEPT. */
2852 YY_STACK_PRINT (yyss
, yyssp
);
2853 while (yyssp
!= yyss
)
2855 yydestruct ("Cleanup: popping",
2856 yystos
[*yyssp
], yyvsp
, yylsp
);
2861 YYSTACK_FREE (yyss
);
2864 if (yymsg
!= yymsgbuf
)
2865 YYSTACK_FREE (yymsg
);
2867 /* Make sure YYID is used. */
2868 return YYID (yyresult
);
2871 /* Line 1599 of yacc.c */
2872 #line 633 "parse-gram.y"
2876 /* Return the location of the left-hand side of a rule whose
2877 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2878 the right-hand side, and return an empty location equal to the end
2879 boundary of RHS[0] if the right-hand side is empty. */
2882 lloc_default (YYLTYPE
const *rhs
, int n
)
2887 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2888 The bug is fixed in 7.4.2m, but play it safe for now. */
2889 loc
.start
= rhs
[n
].end
;
2890 loc
.end
= rhs
[n
].end
;
2892 /* Ignore empty nonterminals the start of the the right-hand side.
2893 Do not bother to ignore them at the end of the right-hand side,
2894 since empty nonterminals have the same end as their predecessors. */
2895 for (i
= 1; i
<= n
; i
++)
2896 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2898 loc
.start
= rhs
[i
].start
;
2906 /* Add a lex-param or a parse-param (depending on TYPE) with
2907 declaration DECL and location LOC. */
2910 add_param (char const *type
, char *decl
, location loc
)
2912 static char const alphanum
[26 + 26 + 1 + 10] =
2913 "abcdefghijklmnopqrstuvwxyz"
2914 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2917 char const *name_start
= NULL
;
2920 /* Stop on last actual character. */
2921 for (p
= decl
; p
[1]; p
++)
2923 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2924 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2927 /* Strip the surrounding '{' and '}', and any blanks just inside
2929 while (*--p
== ' ' || *p
== '\t')
2932 while (*++decl
== ' ' || *decl
== '\t')
2936 complain_at (loc
, _("missing identifier in parameter declaration"));
2943 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2947 name
= xmalloc (name_len
+ 1);
2948 memcpy (name
, name_start
, name_len
);
2949 name
[name_len
] = '\0';
2950 muscle_pair_list_grow (type
, decl
, name
);
2954 gram_scanner_last_string_free ();
2959 version_check (location
const *loc
, char const *version
)
2961 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2963 complain_at (*loc
, "require bison %s, but have %s",
2964 version
, PACKAGE_VERSION
);
2970 gram_error (location
const *loc
, char const *msg
)
2972 complain_at (*loc
, "%s", msg
);
2976 token_name (int type
)
2978 return yytname
[YYTRANSLATE (type
)];
2989 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2990 return quotearg_style (escape_quoting_style
, buf
);