2 /* A Bison parser, made by GNU Bison 2.4.4-738cd. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.4-738cd"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 1
66 /* Substitute the variable and function names. */
67 #define yyparse gram_parse
68 #define yylex gram_lex
69 #define yyerror gram_error
70 #define yylval gram_lval
71 #define yychar gram_char
72 #define yydebug gram_debug
73 #define yynerrs gram_nerrs
74 #define yylloc gram_lloc
76 /* Copy the first part of user declarations. */
78 /* Line 189 of yacc.c */
79 #line 1 "parse-gram.y"
80 /* Bison Grammar Parser -*- C -*-
82 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
85 This file is part of Bison, the GNU Compiler Compiler.
87 This program is free software: you can redistribute it and/or modify
88 it under the terms of the GNU General Public License as published by
89 the Free Software Foundation, either version 3 of the License, or
90 (at your option) any later version.
92 This program is distributed in the hope that it will be useful,
93 but WITHOUT ANY WARRANTY; without even the implied warranty of
94 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
95 GNU General Public License for more details.
97 You should have received a copy of the GNU General Public License
98 along with this program. If not, see <http://www.gnu.org/licenses/>. */
103 #include "complain.h"
104 #include "conflicts.h"
108 #include "muscle_tab.h"
109 #include "quotearg.h"
112 #include "scan-gram.h"
113 #include "scan-code.h"
115 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
116 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
118 #define YY_LOCATION_PRINT(File, Loc) \
119 location_print (File, Loc)
121 static void version_check (location
const *loc
, char const *version
);
123 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
124 FIXME: depends on the undocumented availability of YYLLOC. */
126 #define yyerror(Msg) \
127 gram_error (&yylloc, Msg)
128 static void gram_error (location
const *, char const *);
130 static char const *char_name (char);
132 /** Add a lex-param or a parse-param.
134 * \param type \a lex_param or \a parse_param
135 * \param decl the formal argument
136 * \param loc the location in the source.
138 static void add_param (char const *type
, char *decl
, location loc
);
141 static symbol_class current_class
= unknown_sym
;
142 static uniqstr current_type
= NULL
;
143 static symbol
*current_lhs
;
144 static location current_lhs_location
;
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
153 /* Line 189 of yacc.c */
154 #line 155 "parse-gram.c"
156 /* Enabling traces. */
161 /* Enabling verbose error messages. */
162 #ifdef YYERROR_VERBOSE
163 # undef YYERROR_VERBOSE
164 # define YYERROR_VERBOSE 1
166 # define YYERROR_VERBOSE 1
169 /* Enabling the token table. */
170 #ifndef YYTOKEN_TABLE
171 # define YYTOKEN_TABLE 0
178 /* Put the tokens into the symbol table, so that GDB and other debuggers
187 PERCENT_DESTRUCTOR
= 263,
188 PERCENT_PRINTER
= 264,
191 PERCENT_NONASSOC
= 267,
197 PERCENT_DEFAULT_PREC
= 273,
198 PERCENT_DEFINE
= 274,
199 PERCENT_DEFINES
= 275,
200 PERCENT_ERROR_VERBOSE
= 276,
201 PERCENT_EXPECT
= 277,
202 PERCENT_EXPECT_RR
= 278,
203 PERCENT_FILE_PREFIX
= 279,
204 PERCENT_GLR_PARSER
= 280,
205 PERCENT_INITIAL_ACTION
= 281,
206 PERCENT_LANGUAGE
= 282,
207 PERCENT_LEX_PARAM
= 283,
208 PERCENT_LOCATIONS
= 284,
209 PERCENT_NAME_PREFIX
= 285,
210 PERCENT_NO_DEFAULT_PREC
= 286,
211 PERCENT_NO_LINES
= 287,
212 PERCENT_NONDETERMINISTIC_PARSER
= 288,
213 PERCENT_OUTPUT
= 289,
214 PERCENT_PARSE_PARAM
= 290,
215 PERCENT_PURE_PARSER
= 291,
216 PERCENT_REQUIRE
= 292,
217 PERCENT_SKELETON
= 293,
219 PERCENT_TOKEN_TABLE
= 295,
220 PERCENT_VERBOSE
= 296,
228 PERCENT_PERCENT
= 304,
242 #define PERCENT_TOKEN 260
243 #define PERCENT_NTERM 261
244 #define PERCENT_TYPE 262
245 #define PERCENT_DESTRUCTOR 263
246 #define PERCENT_PRINTER 264
247 #define PERCENT_LEFT 265
248 #define PERCENT_RIGHT 266
249 #define PERCENT_NONASSOC 267
250 #define PERCENT_PREC 268
251 #define PERCENT_DPREC 269
252 #define PERCENT_MERGE 270
253 #define PERCENT_CODE 271
254 #define PERCENT_DEBUG 272
255 #define PERCENT_DEFAULT_PREC 273
256 #define PERCENT_DEFINE 274
257 #define PERCENT_DEFINES 275
258 #define PERCENT_ERROR_VERBOSE 276
259 #define PERCENT_EXPECT 277
260 #define PERCENT_EXPECT_RR 278
261 #define PERCENT_FILE_PREFIX 279
262 #define PERCENT_GLR_PARSER 280
263 #define PERCENT_INITIAL_ACTION 281
264 #define PERCENT_LANGUAGE 282
265 #define PERCENT_LEX_PARAM 283
266 #define PERCENT_LOCATIONS 284
267 #define PERCENT_NAME_PREFIX 285
268 #define PERCENT_NO_DEFAULT_PREC 286
269 #define PERCENT_NO_LINES 287
270 #define PERCENT_NONDETERMINISTIC_PARSER 288
271 #define PERCENT_OUTPUT 289
272 #define PERCENT_PARSE_PARAM 290
273 #define PERCENT_PURE_PARSER 291
274 #define PERCENT_REQUIRE 292
275 #define PERCENT_SKELETON 293
276 #define PERCENT_START 294
277 #define PERCENT_TOKEN_TABLE 295
278 #define PERCENT_VERBOSE 296
279 #define PERCENT_YACC 297
280 #define BRACED_CODE 298
286 #define PERCENT_PERCENT 304
289 #define SEMICOLON 307
291 #define TYPE_TAG_ANY 309
292 #define TYPE_TAG_NONE 310
293 #define PERCENT_UNION 311
298 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
299 typedef union YYSTYPE
302 /* Line 222 of yacc.c */
303 #line 92 "parse-gram.y"
312 unsigned char character
;
316 /* Line 222 of yacc.c */
317 #line 318 "parse-gram.c"
319 # define YYSTYPE_IS_TRIVIAL 1
320 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
321 # define YYSTYPE_IS_DECLARED 1
324 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
325 typedef struct YYLTYPE
332 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
333 # define YYLTYPE_IS_DECLARED 1
334 # define YYLTYPE_IS_TRIVIAL 1
338 /* Copy the second part of user declarations. */
341 /* Line 264 of yacc.c */
342 #line 343 "parse-gram.c"
349 typedef YYTYPE_UINT8 yytype_uint8
;
351 typedef unsigned char yytype_uint8
;
355 typedef YYTYPE_INT8 yytype_int8
;
356 #elif (defined __STDC__ || defined __C99__FUNC__ \
357 || defined __cplusplus || defined _MSC_VER)
358 typedef signed char yytype_int8
;
360 typedef short int yytype_int8
;
364 typedef YYTYPE_UINT16 yytype_uint16
;
366 typedef unsigned short int yytype_uint16
;
370 typedef YYTYPE_INT16 yytype_int16
;
372 typedef short int yytype_int16
;
376 # ifdef __SIZE_TYPE__
377 # define YYSIZE_T __SIZE_TYPE__
378 # elif defined size_t
379 # define YYSIZE_T size_t
380 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
381 || defined __cplusplus || defined _MSC_VER)
382 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
383 # define YYSIZE_T size_t
385 # define YYSIZE_T unsigned int
389 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
394 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
395 # define YY_(msgid) dgettext ("bison-runtime", msgid)
399 # define YY_(msgid) msgid
403 /* Suppress unused-variable warnings by "using" E. */
404 #if ! defined lint || defined __GNUC__
405 # define YYUSE(e) ((void) (e))
407 # define YYUSE(e) /* empty */
410 /* Identity function, used to suppress warnings about constant conditions. */
414 #if (defined __STDC__ || defined __C99__FUNC__ \
415 || defined __cplusplus || defined _MSC_VER)
428 #if ! defined yyoverflow || YYERROR_VERBOSE
430 /* The parser invokes alloca or malloc; define the necessary symbols. */
432 # ifdef YYSTACK_USE_ALLOCA
433 # if YYSTACK_USE_ALLOCA
435 # define YYSTACK_ALLOC __builtin_alloca
436 # elif defined __BUILTIN_VA_ARG_INCR
437 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
439 # define YYSTACK_ALLOC __alloca
440 # elif defined _MSC_VER
441 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
442 # define alloca _alloca
444 # define YYSTACK_ALLOC alloca
445 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
446 || defined __cplusplus || defined _MSC_VER)
447 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
456 # ifdef YYSTACK_ALLOC
457 /* Pacify GCC's `empty if-body' warning. */
458 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
459 # ifndef YYSTACK_ALLOC_MAXIMUM
460 /* The OS might guarantee only one guard page at the bottom of the stack,
461 and a page size can be as small as 4096 bytes. So we cannot safely
462 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
463 to allow for a few compiler-allocated temporary stack slots. */
464 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
467 # define YYSTACK_ALLOC YYMALLOC
468 # define YYSTACK_FREE YYFREE
469 # ifndef YYSTACK_ALLOC_MAXIMUM
470 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
472 # if (defined __cplusplus && ! defined _STDLIB_H \
473 && ! ((defined YYMALLOC || defined malloc) \
474 && (defined YYFREE || defined free)))
475 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
481 # define YYMALLOC malloc
482 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
483 || defined __cplusplus || defined _MSC_VER)
484 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
489 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
490 || defined __cplusplus || defined _MSC_VER)
491 void free (void *); /* INFRINGES ON USER NAME SPACE */
495 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
498 #if (! defined yyoverflow \
499 && (! defined __cplusplus \
500 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
501 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
503 /* A type that is properly aligned for any stack member. */
506 yytype_int16 yyss_alloc
;
511 /* The size of the maximum gap between one aligned stack and the next. */
512 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
514 /* The size of an array large to enough to hold all stacks, each with
516 # define YYSTACK_BYTES(N) \
517 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
518 + 2 * YYSTACK_GAP_MAXIMUM)
520 /* Copy COUNT objects from FROM to TO. The source and destination do
523 # if defined __GNUC__ && 1 < __GNUC__
524 # define YYCOPY(To, From, Count) \
525 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
527 # define YYCOPY(To, From, Count) \
531 for (yyi = 0; yyi < (Count); yyi++) \
532 (To)[yyi] = (From)[yyi]; \
538 /* Relocate STACK from its old location to the new one. The
539 local variables YYSIZE and YYSTACKSIZE give the old and new number of
540 elements in the stack, and YYPTR gives the new location of the
541 stack. Advance YYPTR to a properly aligned location for the next
543 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
546 YYSIZE_T yynewbytes; \
547 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
548 Stack = &yyptr->Stack_alloc; \
549 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
550 yyptr += yynewbytes / sizeof (*yyptr); \
556 /* YYFINAL -- State number of the termination state. */
558 /* YYLAST -- Last index in YYTABLE. */
561 /* YYNTOKENS -- Number of terminals. */
563 /* YYNNTS -- Number of nonterminals. */
565 /* YYNRULES -- Number of rules. */
567 /* YYNRULES -- Number of states. */
568 #define YYNSTATES 143
570 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
572 #define YYMAXUTOK 311
574 #define YYTRANSLATE(YYX) \
575 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
577 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
578 static const yytype_uint8 yytranslate
[] =
580 0, 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, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
606 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
607 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
608 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
609 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
610 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
615 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
617 static const yytype_uint16 yyprhs
[] =
619 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
620 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
621 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
622 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
623 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
624 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
625 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
626 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
627 206, 209, 212, 213, 217, 219, 223, 226, 227, 230,
628 233, 237, 241, 245, 247, 249, 250, 252, 254, 256,
629 258, 260, 262, 264, 266, 267
632 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
633 static const yytype_int8 yyrhs
[] =
635 58, 0, -1, 59, 49, 76, 89, -1, -1, 59,
636 60, -1, 61, -1, 51, -1, 17, -1, 19, 82,
637 83, -1, 20, -1, 20, 3, -1, 21, -1, 22,
638 4, -1, 23, 4, -1, 24, 3, -1, 24, 46,
639 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
640 28, 43, -1, 29, -1, 30, 3, -1, 30, 46,
641 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
642 46, 3, -1, 35, 43, -1, 36, -1, 37, 3,
643 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
644 52, -1, 66, -1, 63, -1, 39, 87, -1, 8,
645 43, 72, -1, 9, 43, 72, -1, 18, -1, 31,
646 -1, 16, 84, -1, 16, 47, 84, -1, -1, 47,
647 -1, 56, 62, 84, -1, -1, 6, 64, 75, -1,
648 -1, 5, 65, 75, -1, 7, 53, 71, -1, 67,
649 68, 69, -1, 10, -1, 11, -1, 12, -1, -1,
650 53, -1, 70, -1, 69, 70, -1, 87, -1, 87,
651 4, -1, 87, -1, 71, 87, -1, 73, -1, 72,
652 73, -1, 87, -1, 53, -1, 54, -1, 55, -1,
653 53, -1, 85, -1, 85, 4, -1, 85, 88, -1,
654 85, 4, 88, -1, 74, -1, 75, 74, -1, 77,
655 -1, 76, 77, -1, 78, -1, 61, 52, -1, 1,
656 52, -1, -1, 86, 79, 80, -1, 81, -1, 80,
657 50, 81, -1, 80, 52, -1, -1, 81, 87, -1,
658 81, 43, -1, 81, 13, 87, -1, 81, 14, 4,
659 -1, 81, 15, 53, -1, 47, -1, 3, -1, -1,
660 3, -1, 43, -1, 47, -1, 44, -1, 48, -1,
661 85, -1, 88, -1, 3, -1, -1, 49, 45, -1
664 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
665 static const yytype_uint16 yyrline
[] =
667 0, 202, 202, 210, 212, 216, 217, 227, 228, 232,
668 233, 238, 239, 240, 241, 242, 243, 248, 257, 258,
669 259, 260, 261, 262, 263, 264, 265, 266, 267, 280,
670 281, 305, 306, 307, 308, 312, 313, 314, 318, 325,
671 332, 336, 340, 347, 362, 363, 367, 379, 379, 384,
672 384, 389, 400, 415, 416, 417, 421, 422, 427, 429,
673 434, 435, 440, 442, 447, 448, 452, 453, 454, 455,
674 460, 465, 470, 476, 482, 493, 494, 503, 504, 510,
675 511, 512, 519, 519, 523, 524, 525, 530, 531, 533,
676 535, 537, 539, 549, 550, 556, 559, 568, 588, 590,
677 599, 604, 605, 610, 617, 619
681 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
682 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
683 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
684 static const char *const yytname
[] =
686 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
687 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
688 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
689 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
690 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
691 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
692 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
693 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
694 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
695 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
696 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
697 "\"{...}\"", "\"char\"", "\"epilogue\"", "\"=\"", "\"identifier\"",
698 "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"",
699 "\"<*>\"", "\"<>\"", "\"%union\"", "$accept", "input",
700 "prologue_declarations", "prologue_declaration", "grammar_declaration",
701 "union_name", "symbol_declaration", "$@1", "$@2",
702 "precedence_declaration", "precedence_declarator", "type.opt",
703 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
704 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
705 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
706 "variable", "content.opt", "braceless", "id", "id_colon", "symbol",
707 "string_as_id", "epilogue.opt", 0
712 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
714 static const yytype_uint16 yytoknum
[] =
716 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
717 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
718 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
719 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
720 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
721 305, 306, 307, 308, 309, 310, 311
725 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
726 static const yytype_uint8 yyr1
[] =
728 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
729 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
730 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
731 60, 60, 60, 60, 60, 61, 61, 61, 61, 61,
732 61, 61, 61, 61, 62, 62, 61, 64, 63, 65,
733 63, 63, 66, 67, 67, 67, 68, 68, 69, 69,
734 70, 70, 71, 71, 72, 72, 73, 73, 73, 73,
735 74, 74, 74, 74, 74, 75, 75, 76, 76, 77,
736 77, 77, 79, 78, 80, 80, 80, 81, 81, 81,
737 81, 81, 81, 82, 82, 83, 83, 84, 85, 85,
738 86, 87, 87, 88, 89, 89
741 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
742 static const yytype_uint8 yyr2
[] =
744 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
745 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
746 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
747 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
748 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
749 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
750 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
751 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
752 2, 2, 0, 3, 1, 3, 2, 0, 2, 2,
753 3, 3, 3, 1, 1, 0, 1, 1, 1, 1,
757 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
758 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
759 means the default is an error. */
760 static const yytype_uint8 yydefact
[] =
762 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
763 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
764 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
765 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
766 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
767 0, 0, 0, 97, 0, 42, 94, 93, 95, 10,
768 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
769 0, 27, 29, 30, 103, 99, 98, 101, 37, 102,
770 0, 100, 0, 0, 77, 79, 82, 45, 0, 57,
771 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
772 69, 38, 64, 66, 39, 43, 96, 8, 15, 22,
773 26, 81, 80, 0, 78, 2, 87, 46, 52, 58,
774 60, 76, 72, 73, 63, 65, 105, 83, 84, 59,
775 61, 74, 87, 86, 0, 0, 0, 89, 88, 85,
779 /* YYDEFGOTO[NTERM-NUM]. */
780 static const yytype_int16 yydefgoto
[] =
782 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
783 47, 90, 118, 119, 96, 101, 102, 92, 93, 83,
784 84, 85, 116, 127, 128, 58, 107, 55, 77, 86,
788 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
790 #define YYPACT_NINF -60
791 static const yytype_int16 yypact
[] =
793 -60, 18, 100, -60, -60, -60, -16, 24, 27, -60,
794 -60, -60, -8, -60, -60, 11, 70, -60, 71, 80,
795 2, -60, 46, 87, 48, -60, 31, -60, -60, -60,
796 40, 49, -60, 91, 92, 0, -60, -60, -60, 15,
797 -60, -60, 50, -60, -60, -60, -60, 43, 12, 12,
798 0, 25, 25, -60, 55, -60, -60, -60, 97, -60,
799 -60, -60, -60, 98, -60, -60, -60, -60, 99, -60,
800 110, -60, -60, -60, -60, -60, -60, -60, -60, -60,
801 51, -60, 62, 1, -60, -60, -60, -60, 55, -60,
802 0, -60, -60, 12, 84, 12, 0, -60, -60, -60,
803 -60, 25, -60, -60, 25, -60, -60, -60, -60, -60,
804 -60, -60, -60, 101, -60, -60, -60, -60, 0, -60,
805 111, -60, 140, -60, -60, -60, -60, 10, 38, -60,
806 -60, -60, -60, -60, 0, 141, 94, -60, -60, 38,
810 /* YYPGOTO[NTERM-NUM]. */
811 static const yytype_int16 yypgoto
[] =
813 -60, -60, -60, -60, 142, -60, -60, -60, -60, -60,
814 -60, -60, -60, 30, -60, 102, -59, -27, 104, -60,
815 67, -60, -60, -60, 23, -60, -60, -50, -19, -60,
819 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
820 positive, shift that token. If negative, reduce the rule which
821 number is the opposite. If zero, do what YYDEFACT says.
822 If YYTABLE_NINF, syntax error. */
823 #define YYTABLE_NINF -105
824 static const yytype_int16 yytable
[] =
826 78, -104, 80, 74, 105, 62, 4, 5, 6, 7,
827 8, 9, 10, 11, 56, 97, 80, 12, 3, 14,
828 4, 5, 6, 7, 8, 9, 10, 11, 74, 94,
829 94, 12, 27, 14, 67, 53, 123, 50, 117, 54,
830 35, 74, 125, 69, 75, 125, 27, 76, 63, 81,
831 113, 134, 135, 136, 35, 120, 75, 42, 57, 76,
832 132, 124, 133, 81, 131, 91, 121, 51, 121, 75,
833 52, 42, 76, 59, 94, 60, 94, 68, 98, 99,
834 100, 137, 75, 120, 61, 76, 70, 74, 122, 64,
835 65, 66, 71, 138, 72, 73, 89, 87, 53, 140,
836 106, 108, 109, 111, 138, 4, 5, 6, 7, 8,
837 9, 10, 11, 110, 112, 130, 12, 13, 14, 15,
838 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
839 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
840 36, 37, 38, 74, 44, 141, 126, 142, 129, 39,
841 114, 40, 41, 95, 104, 139, 42
844 static const yytype_uint8 yycheck
[] =
846 35, 0, 1, 3, 54, 3, 5, 6, 7, 8,
847 9, 10, 11, 12, 3, 50, 1, 16, 0, 18,
848 5, 6, 7, 8, 9, 10, 11, 12, 3, 48,
849 49, 16, 31, 18, 3, 43, 94, 53, 88, 47,
850 39, 3, 101, 3, 44, 104, 31, 47, 46, 48,
851 49, 13, 14, 15, 39, 90, 44, 56, 47, 47,
852 50, 96, 52, 48, 122, 53, 93, 43, 95, 44,
853 43, 56, 47, 3, 93, 4, 95, 46, 53, 54,
854 55, 43, 44, 118, 4, 47, 46, 3, 4, 43,
855 3, 43, 43, 128, 3, 3, 53, 47, 43, 134,
856 3, 3, 3, 52, 139, 5, 6, 7, 8, 9,
857 10, 11, 12, 3, 52, 4, 16, 17, 18, 19,
858 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
859 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
860 40, 41, 42, 3, 2, 4, 45, 53, 118, 49,
861 83, 51, 52, 49, 52, 132, 56
864 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
865 symbol of state STATE-NUM. */
866 static const yytype_uint8 yystos
[] =
868 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
869 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
870 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
871 34, 35, 36, 37, 38, 39, 40, 41, 42, 49,
872 51, 52, 56, 60, 61, 63, 66, 67, 65, 64,
873 53, 43, 43, 43, 47, 84, 3, 47, 82, 3,
874 4, 4, 3, 46, 43, 3, 43, 3, 46, 3,
875 46, 43, 3, 3, 3, 44, 47, 85, 87, 88,
876 1, 48, 61, 76, 77, 78, 86, 47, 62, 53,
877 68, 53, 74, 75, 85, 75, 71, 87, 53, 54,
878 55, 72, 73, 87, 72, 84, 3, 83, 3, 3,
879 3, 52, 52, 49, 77, 89, 79, 84, 69, 70,
880 87, 74, 4, 88, 87, 73, 45, 80, 81, 70,
881 4, 88, 50, 52, 13, 14, 15, 43, 87, 81,
885 #define yyerrok (yyerrstatus = 0)
886 #define yyclearin (yychar = YYEMPTY)
890 #define YYACCEPT goto yyacceptlab
891 #define YYABORT goto yyabortlab
892 #define YYERROR goto yyerrorlab
895 /* Like YYERROR except do call yyerror. This remains here temporarily
896 to ease the transition to the new meaning of YYERROR, for GCC.
897 Once GCC version 2 has supplanted version 1, this can go. */
899 #define YYFAIL goto yyerrlab
901 #define YYRECOVERING() (!!yyerrstatus)
903 #define YYBACKUP(Token, Value) \
905 if (yychar == YYEMPTY && yylen == 1) \
909 yytoken = YYTRANSLATE (yychar); \
915 yyerror (YY_("syntax error: cannot back up")); \
922 #define YYERRCODE 256
925 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
926 If N is 0, then set CURRENT to the empty location which ends
927 the previous symbol: RHS[0] (always defined). */
929 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
930 #ifndef YYLLOC_DEFAULT
931 # define YYLLOC_DEFAULT(Current, Rhs, N) \
935 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
936 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
937 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
938 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
942 (Current).first_line = (Current).last_line = \
943 YYRHSLOC (Rhs, 0).last_line; \
944 (Current).first_column = (Current).last_column = \
945 YYRHSLOC (Rhs, 0).last_column; \
951 /* YY_LOCATION_PRINT -- Print the location on the stream.
952 This macro was not mandated originally: define only if we know
953 we won't break user code: when these are the locations we know. */
955 #ifndef YY_LOCATION_PRINT
956 # if YYLTYPE_IS_TRIVIAL
957 # define YY_LOCATION_PRINT(File, Loc) \
958 fprintf (File, "%d.%d-%d.%d", \
959 (Loc).first_line, (Loc).first_column, \
960 (Loc).last_line, (Loc).last_column)
962 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
967 /* YYLEX -- calling `yylex' with the right arguments. */
970 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
972 # define YYLEX yylex (&yylval, &yylloc)
975 /* Enable debugging if requested. */
979 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
980 # define YYFPRINTF fprintf
983 # define YYDPRINTF(Args) \
989 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
993 YYFPRINTF (stderr, "%s ", Title); \
994 yy_symbol_print (stderr, \
995 Type, Value, Location); \
996 YYFPRINTF (stderr, "\n"); \
1001 /*--------------------------------.
1002 | Print this symbol on YYOUTPUT. |
1003 `--------------------------------*/
1006 #if (defined __STDC__ || defined __C99__FUNC__ \
1007 || defined __cplusplus || defined _MSC_VER)
1009 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1012 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1015 YYSTYPE
const * const yyvaluep
;
1016 YYLTYPE
const * const yylocationp
;
1021 YYUSE (yylocationp
);
1023 if (yytype
< YYNTOKENS
)
1024 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1030 case 3: /* "\"string\"" */
1032 /* Line 715 of yacc.c */
1033 #line 180 "parse-gram.y"
1034 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1036 /* Line 715 of yacc.c */
1037 #line 1038 "parse-gram.c"
1039 case 4: /* "\"integer\"" */
1041 /* Line 715 of yacc.c */
1042 #line 191 "parse-gram.y"
1043 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1045 /* Line 715 of yacc.c */
1046 #line 1047 "parse-gram.c"
1048 case 43: /* "\"{...}\"" */
1050 /* Line 715 of yacc.c */
1051 #line 182 "parse-gram.y"
1052 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1054 /* Line 715 of yacc.c */
1055 #line 1056 "parse-gram.c"
1057 case 44: /* "\"char\"" */
1059 /* Line 715 of yacc.c */
1060 #line 174 "parse-gram.y"
1061 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1063 /* Line 715 of yacc.c */
1064 #line 1065 "parse-gram.c"
1066 case 45: /* "\"epilogue\"" */
1068 /* Line 715 of yacc.c */
1069 #line 182 "parse-gram.y"
1070 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1072 /* Line 715 of yacc.c */
1073 #line 1074 "parse-gram.c"
1075 case 47: /* "\"identifier\"" */
1077 /* Line 715 of yacc.c */
1078 #line 187 "parse-gram.y"
1079 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1081 /* Line 715 of yacc.c */
1082 #line 1083 "parse-gram.c"
1084 case 48: /* "\"identifier:\"" */
1086 /* Line 715 of yacc.c */
1087 #line 188 "parse-gram.y"
1088 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1090 /* Line 715 of yacc.c */
1091 #line 1092 "parse-gram.c"
1093 case 51: /* "\"%{...%}\"" */
1095 /* Line 715 of yacc.c */
1096 #line 182 "parse-gram.y"
1097 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1099 /* Line 715 of yacc.c */
1100 #line 1101 "parse-gram.c"
1102 case 53: /* "\"type\"" */
1104 /* Line 715 of yacc.c */
1105 #line 186 "parse-gram.y"
1106 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1108 /* Line 715 of yacc.c */
1109 #line 1110 "parse-gram.c"
1111 case 82: /* "variable" */
1113 /* Line 715 of yacc.c */
1114 #line 187 "parse-gram.y"
1115 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1117 /* Line 715 of yacc.c */
1118 #line 1119 "parse-gram.c"
1120 case 83: /* "content.opt" */
1122 /* Line 715 of yacc.c */
1123 #line 182 "parse-gram.y"
1124 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1126 /* Line 715 of yacc.c */
1127 #line 1128 "parse-gram.c"
1129 case 84: /* "braceless" */
1131 /* Line 715 of yacc.c */
1132 #line 182 "parse-gram.y"
1133 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1135 /* Line 715 of yacc.c */
1136 #line 1137 "parse-gram.c"
1140 /* Line 715 of yacc.c */
1141 #line 194 "parse-gram.y"
1142 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1144 /* Line 715 of yacc.c */
1145 #line 1146 "parse-gram.c"
1147 case 86: /* "id_colon" */
1149 /* Line 715 of yacc.c */
1150 #line 195 "parse-gram.y"
1151 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1153 /* Line 715 of yacc.c */
1154 #line 1155 "parse-gram.c"
1156 case 87: /* "symbol" */
1158 /* Line 715 of yacc.c */
1159 #line 194 "parse-gram.y"
1160 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1162 /* Line 715 of yacc.c */
1163 #line 1164 "parse-gram.c"
1165 case 88: /* "string_as_id" */
1167 /* Line 715 of yacc.c */
1168 #line 194 "parse-gram.y"
1169 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1171 /* Line 715 of yacc.c */
1172 #line 1173 "parse-gram.c"
1180 /*--------------------------------.
1181 | Print this symbol on YYOUTPUT. |
1182 `--------------------------------*/
1184 #if (defined __STDC__ || defined __C99__FUNC__ \
1185 || defined __cplusplus || defined _MSC_VER)
1187 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1190 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1193 YYSTYPE
const * const yyvaluep
;
1194 YYLTYPE
const * const yylocationp
;
1197 if (yytype
< YYNTOKENS
)
1198 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1200 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1202 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1203 YYFPRINTF (yyoutput
, ": ");
1204 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1205 YYFPRINTF (yyoutput
, ")");
1208 /*------------------------------------------------------------------.
1209 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1211 `------------------------------------------------------------------*/
1213 #if (defined __STDC__ || defined __C99__FUNC__ \
1214 || defined __cplusplus || defined _MSC_VER)
1216 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1219 yy_stack_print (yybottom
, yytop
)
1220 yytype_int16
*yybottom
;
1221 yytype_int16
*yytop
;
1224 YYFPRINTF (stderr
, "Stack now");
1225 for (; yybottom
<= yytop
; yybottom
++)
1227 int yybot
= *yybottom
;
1228 YYFPRINTF (stderr
, " %d", yybot
);
1230 YYFPRINTF (stderr
, "\n");
1233 # define YY_STACK_PRINT(Bottom, Top) \
1236 yy_stack_print ((Bottom), (Top)); \
1240 /*------------------------------------------------.
1241 | Report that the YYRULE is going to be reduced. |
1242 `------------------------------------------------*/
1244 #if (defined __STDC__ || defined __C99__FUNC__ \
1245 || defined __cplusplus || defined _MSC_VER)
1247 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1250 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1256 int yynrhs
= yyr2
[yyrule
];
1258 unsigned long int yylno
= yyrline
[yyrule
];
1259 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1261 /* The symbols being reduced. */
1262 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1264 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1265 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1266 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1267 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1268 YYFPRINTF (stderr
, "\n");
1272 # define YY_REDUCE_PRINT(Rule) \
1275 yy_reduce_print (yyvsp, yylsp, Rule); \
1278 /* Nonzero means print parse trace. It is left uninitialized so that
1279 multiple parsers can coexist. */
1281 #else /* !YYDEBUG */
1282 # define YYDPRINTF(Args)
1283 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1284 # define YY_STACK_PRINT(Bottom, Top)
1285 # define YY_REDUCE_PRINT(Rule)
1286 #endif /* !YYDEBUG */
1289 /* YYINITDEPTH -- initial size of the parser's stacks. */
1291 # define YYINITDEPTH 200
1294 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1295 if the built-in stack extension method is used).
1297 Do not make this value too large; the results are undefined if
1298 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1299 evaluated with infinite-precision integer arithmetic. */
1302 # define YYMAXDEPTH 10000
1310 # if defined __GLIBC__ && defined _STRING_H
1311 # define yystrlen strlen
1313 /* Return the length of YYSTR. */
1314 #if (defined __STDC__ || defined __C99__FUNC__ \
1315 || defined __cplusplus || defined _MSC_VER)
1317 yystrlen (const char *yystr
)
1325 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1333 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1334 # define yystpcpy stpcpy
1336 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1338 #if (defined __STDC__ || defined __C99__FUNC__ \
1339 || defined __cplusplus || defined _MSC_VER)
1341 yystpcpy (char *yydest
, const char *yysrc
)
1344 yystpcpy (yydest
, yysrc
)
1350 const char *yys
= yysrc
;
1352 while ((*yyd
++ = *yys
++) != '\0')
1361 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1362 quotes and backslashes, so that it's suitable for yyerror. The
1363 heuristic is that double-quoting is unnecessary unless the string
1364 contains an apostrophe, a comma, or backslash (other than
1365 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1366 null, do not copy; instead, return the length of what the result
1369 yytnamerr (char *yyres
, const char *yystr
)
1374 char const *yyp
= yystr
;
1381 goto do_not_strip_quotes
;
1385 goto do_not_strip_quotes
;
1398 do_not_strip_quotes
: ;
1402 return yystrlen (yystr
);
1404 return yystpcpy (yyres
, yystr
) - yyres
;
1408 /* Copy into YYRESULT an error message about the unexpected token
1409 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1410 including the terminating null byte. If YYRESULT is null, do not
1411 copy anything; just return the number of bytes that would be
1412 copied. As a special case, return 0 if an ordinary "syntax error"
1413 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1414 size calculation. */
1416 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1418 int yyn
= yypact
[yystate
];
1420 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1424 int yytype
= YYTRANSLATE (yychar
);
1425 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1426 YYSIZE_T yysize
= yysize0
;
1428 int yysize_overflow
= 0;
1429 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1430 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1434 /* This is so xgettext sees the translatable formats that are
1435 constructed on the fly. */
1436 YY_("syntax error, unexpected %s");
1437 YY_("syntax error, unexpected %s, expecting %s");
1438 YY_("syntax error, unexpected %s, expecting %s or %s");
1439 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1440 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1444 static char const yyunexpected
[] = "syntax error, unexpected %s";
1445 static char const yyexpecting
[] = ", expecting %s";
1446 static char const yyor
[] = " or %s";
1447 char yyformat
[sizeof yyunexpected
1448 + sizeof yyexpecting
- 1
1449 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1450 * (sizeof yyor
- 1))];
1451 char const *yyprefix
= yyexpecting
;
1453 /* Start YYX at -YYN if negative to avoid negative indexes in
1455 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1457 /* Stay within bounds of both yycheck and yytname. */
1458 int yychecklim
= YYLAST
- yyn
+ 1;
1459 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1462 yyarg
[0] = yytname
[yytype
];
1463 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1465 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1466 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1468 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1472 yyformat
[sizeof yyunexpected
- 1] = '\0';
1475 yyarg
[yycount
++] = yytname
[yyx
];
1476 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1477 yysize_overflow
|= (yysize1
< yysize
);
1479 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1483 yyf
= YY_(yyformat
);
1484 yysize1
= yysize
+ yystrlen (yyf
);
1485 yysize_overflow
|= (yysize1
< yysize
);
1488 if (yysize_overflow
)
1489 return YYSIZE_MAXIMUM
;
1493 /* Avoid sprintf, as that infringes on the user's name space.
1494 Don't have undefined behavior even if the translation
1495 produced a string with the wrong number of "%s"s. */
1496 char *yyp
= yyresult
;
1498 while ((*yyp
= *yyf
) != '\0')
1500 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1502 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1515 #endif /* YYERROR_VERBOSE */
1518 /*-----------------------------------------------.
1519 | Release the memory associated to this symbol. |
1520 `-----------------------------------------------*/
1523 #if (defined __STDC__ || defined __C99__FUNC__ \
1524 || defined __cplusplus || defined _MSC_VER)
1526 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1529 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1533 YYLTYPE
*yylocationp
;
1537 YYUSE (yylocationp
);
1541 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1551 /* Prevent warnings from -Wmissing-prototypes. */
1552 #ifdef YYPARSE_PARAM
1553 #if defined __STDC__ || defined __cplusplus
1554 int yyparse (void *YYPARSE_PARAM
);
1558 #else /* ! YYPARSE_PARAM */
1559 #if defined __STDC__ || defined __cplusplus
1564 #endif /* ! YYPARSE_PARAM */
1570 /*-------------------------.
1571 | yyparse or yypush_parse. |
1572 `-------------------------*/
1574 #ifdef YYPARSE_PARAM
1575 #if (defined __STDC__ || defined __C99__FUNC__ \
1576 || defined __cplusplus || defined _MSC_VER)
1578 yyparse (void *YYPARSE_PARAM
)
1581 yyparse (YYPARSE_PARAM
)
1582 void *YYPARSE_PARAM
;
1584 #else /* ! YYPARSE_PARAM */
1585 #if (defined __STDC__ || defined __C99__FUNC__ \
1586 || defined __cplusplus || defined _MSC_VER)
1596 /* The lookahead symbol. */
1599 /* The semantic value of the lookahead symbol. */
1602 /* Location data for the lookahead symbol. */
1605 /* Number of syntax errors so far. */
1609 /* Number of tokens to shift before error messages enabled. */
1612 /* The stacks and their tools:
1613 `yyss': related to states.
1614 `yyvs': related to semantic values.
1615 `yyls': related to locations.
1617 Refer to the stacks thru separate pointers, to allow yyoverflow
1618 to reallocate them elsewhere. */
1620 /* The state stack. */
1621 yytype_int16 yyssa
[YYINITDEPTH
];
1623 yytype_int16
*yyssp
;
1625 /* The semantic value stack. */
1626 YYSTYPE yyvsa
[YYINITDEPTH
];
1630 /* The location stack. */
1631 YYLTYPE yylsa
[YYINITDEPTH
];
1635 /* The locations where the error started and ended. */
1636 YYLTYPE yyerror_range
[2];
1638 YYSIZE_T yystacksize
;
1642 /* Lookahead token as an internal (translated) token number. */
1644 /* The variables used to return semantic value and location from the
1650 /* Buffer for error messages, and its allocated size. */
1652 char *yymsg
= yymsgbuf
;
1653 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1656 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1658 /* The number of symbols on the RHS of the reduced rule.
1659 Keep to zero when no symbol should be popped. */
1666 yystacksize
= YYINITDEPTH
;
1668 YYDPRINTF ((stderr
, "Starting parse\n"));
1673 yychar
= YYEMPTY
; /* Cause a token to be read. */
1675 /* Initialize stack pointers.
1676 Waste one element of value and location stack
1677 so that they stay on the same level as the state stack.
1678 The wasted elements are never initialized. */
1683 #if YYLTYPE_IS_TRIVIAL
1684 /* Initialize the default location before parsing starts. */
1685 yylloc
.first_line
= yylloc
.last_line
= 1;
1686 yylloc
.first_column
= yylloc
.last_column
= 1;
1689 /* User initialization code. */
1691 /* Line 1248 of yacc.c */
1692 #line 84 "parse-gram.y"
1694 /* Bison's grammar can initial empty locations, hence a default
1695 location is needed. */
1696 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1697 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1700 /* Line 1248 of yacc.c */
1701 #line 1702 "parse-gram.c"
1706 /*------------------------------------------------------------.
1707 | yynewstate -- Push a new state, which is found in yystate. |
1708 `------------------------------------------------------------*/
1710 /* In all cases, when you get here, the value and location stacks
1711 have just been pushed. So pushing a state here evens the stacks. */
1717 if (yyss
+ yystacksize
- 1 <= yyssp
)
1719 /* Get the current used size of the three stacks, in elements. */
1720 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1724 /* Give user a chance to reallocate the stack. Use copies of
1725 these so that the &'s don't force the real ones into
1727 YYSTYPE
*yyvs1
= yyvs
;
1728 yytype_int16
*yyss1
= yyss
;
1729 YYLTYPE
*yyls1
= yyls
;
1731 /* Each stack pointer address is followed by the size of the
1732 data in use in that stack, in bytes. This used to be a
1733 conditional around just the two extra args, but that might
1734 be undefined if yyoverflow is a macro. */
1735 yyoverflow (YY_("memory exhausted"),
1736 &yyss1
, yysize
* sizeof (*yyssp
),
1737 &yyvs1
, yysize
* sizeof (*yyvsp
),
1738 &yyls1
, yysize
* sizeof (*yylsp
),
1745 #else /* no yyoverflow */
1746 # ifndef YYSTACK_RELOCATE
1747 goto yyexhaustedlab
;
1749 /* Extend the stack our own way. */
1750 if (YYMAXDEPTH
<= yystacksize
)
1751 goto yyexhaustedlab
;
1753 if (YYMAXDEPTH
< yystacksize
)
1754 yystacksize
= YYMAXDEPTH
;
1757 yytype_int16
*yyss1
= yyss
;
1758 union yyalloc
*yyptr
=
1759 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1761 goto yyexhaustedlab
;
1762 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1763 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1764 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1765 # undef YYSTACK_RELOCATE
1767 YYSTACK_FREE (yyss1
);
1770 #endif /* no yyoverflow */
1772 yyssp
= yyss
+ yysize
- 1;
1773 yyvsp
= yyvs
+ yysize
- 1;
1774 yylsp
= yyls
+ yysize
- 1;
1776 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1777 (unsigned long int) yystacksize
));
1779 if (yyss
+ yystacksize
- 1 <= yyssp
)
1783 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1785 if (yystate
== YYFINAL
)
1795 /* Do appropriate processing given the current state. Read a
1796 lookahead token if we need one and don't already have one. */
1798 /* First try to decide what to do without reference to lookahead token. */
1799 yyn
= yypact
[yystate
];
1800 if (yyn
== YYPACT_NINF
)
1803 /* Not known => get a lookahead token if don't already have one. */
1805 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1806 if (yychar
== YYEMPTY
)
1808 YYDPRINTF ((stderr
, "Reading a token: "));
1812 if (yychar
<= YYEOF
)
1814 yychar
= yytoken
= YYEOF
;
1815 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1819 yytoken
= YYTRANSLATE (yychar
);
1820 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1823 /* If the proper action on seeing token YYTOKEN is to reduce or to
1824 detect an error, take that action. */
1826 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1831 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1837 /* Count tokens shifted since error; after three, turn off error
1842 /* Shift the lookahead token. */
1843 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1845 /* Discard the shifted token. */
1854 /*-----------------------------------------------------------.
1855 | yydefault -- do the default action for the current state. |
1856 `-----------------------------------------------------------*/
1858 yyn
= yydefact
[yystate
];
1864 /*-----------------------------.
1865 | yyreduce -- Do a reduction. |
1866 `-----------------------------*/
1868 /* yyn is the number of a rule to reduce with. */
1871 /* If YYLEN is nonzero, implement the default value of the action:
1874 Otherwise, the following line sets YYVAL to garbage.
1875 This behavior is undocumented and Bison
1876 users should not rely upon it. Assigning to YYVAL
1877 unconditionally makes the parser a bit smaller, and it avoids a
1878 GCC warning that YYVAL may be used uninitialized. */
1879 yyval
= yyvsp
[1-yylen
];
1881 /* Default location. */
1882 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1883 YY_REDUCE_PRINT (yyn
);
1888 /* Line 1455 of yacc.c */
1889 #line 218 "parse-gram.y"
1891 code_props plain_code
;
1892 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1893 code_props_translate_code (&plain_code
);
1894 gram_scanner_last_string_free ();
1895 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1896 plain_code
.code
, (yylsp
[(1) - (1)]));
1897 code_scanner_last_string_free ();
1903 /* Line 1455 of yacc.c */
1904 #line 227 "parse-gram.y"
1905 { debug_flag
= true; }
1910 /* Line 1455 of yacc.c */
1911 #line 229 "parse-gram.y"
1913 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
));
1919 /* Line 1455 of yacc.c */
1920 #line 232 "parse-gram.y"
1921 { defines_flag
= true; }
1926 /* Line 1455 of yacc.c */
1927 #line 234 "parse-gram.y"
1929 defines_flag
= true;
1930 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1936 /* Line 1455 of yacc.c */
1937 #line 238 "parse-gram.y"
1938 { error_verbose
= true; }
1943 /* Line 1455 of yacc.c */
1944 #line 239 "parse-gram.y"
1945 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1950 /* Line 1455 of yacc.c */
1951 #line 240 "parse-gram.y"
1952 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1957 /* Line 1455 of yacc.c */
1958 #line 241 "parse-gram.y"
1959 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1964 /* Line 1455 of yacc.c */
1965 #line 242 "parse-gram.y"
1966 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1971 /* Line 1455 of yacc.c */
1972 #line 244 "parse-gram.y"
1974 nondeterministic_parser
= true;
1981 /* Line 1455 of yacc.c */
1982 #line 249 "parse-gram.y"
1985 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
1986 code_props_translate_code (&action
);
1987 gram_scanner_last_string_free ();
1988 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
1989 code_scanner_last_string_free ();
1995 /* Line 1455 of yacc.c */
1996 #line 257 "parse-gram.y"
1997 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, &(yylsp
[(1) - (2)])); }
2002 /* Line 1455 of yacc.c */
2003 #line 258 "parse-gram.y"
2004 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2009 /* Line 1455 of yacc.c */
2010 #line 259 "parse-gram.y"
2011 { locations_flag
= true; }
2016 /* Line 1455 of yacc.c */
2017 #line 260 "parse-gram.y"
2018 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2023 /* Line 1455 of yacc.c */
2024 #line 261 "parse-gram.y"
2025 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2030 /* Line 1455 of yacc.c */
2031 #line 262 "parse-gram.y"
2032 { no_lines_flag
= true; }
2037 /* Line 1455 of yacc.c */
2038 #line 263 "parse-gram.y"
2039 { nondeterministic_parser
= true; }
2044 /* Line 1455 of yacc.c */
2045 #line 264 "parse-gram.y"
2046 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2051 /* Line 1455 of yacc.c */
2052 #line 265 "parse-gram.y"
2053 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2058 /* Line 1455 of yacc.c */
2059 #line 266 "parse-gram.y"
2060 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2065 /* Line 1455 of yacc.c */
2066 #line 268 "parse-gram.y"
2068 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2069 `%define api.pure' in a backward-compatible manner here. First, don't
2070 complain if %pure-parser is specified multiple times. */
2071 if (!muscle_find_const ("percent_define(api.pure)"))
2072 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "");
2073 /* In all cases, use api.pure now so that the backend doesn't complain if
2074 the skeleton ignores api.pure, but do warn now if there's a previous
2075 conflicting definition from an actual %define. */
2076 if (!muscle_percent_define_flag_if ("api.pure"))
2077 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "");
2083 /* Line 1455 of yacc.c */
2084 #line 280 "parse-gram.y"
2085 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2090 /* Line 1455 of yacc.c */
2091 #line 282 "parse-gram.y"
2093 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2094 if (strchr (skeleton_user
, '/'))
2096 size_t dir_length
= strlen (current_file
);
2097 char *skeleton_build
;
2098 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2100 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2103 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2106 strncpy (skeleton_build
, current_file
, dir_length
);
2107 skeleton_build
[dir_length
++] = '/';
2109 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2110 skeleton_user
= uniqstr_new (skeleton_build
);
2111 free (skeleton_build
);
2113 skeleton_arg (skeleton_user
, grammar_prio
, &(yylsp
[(1) - (2)]));
2119 /* Line 1455 of yacc.c */
2120 #line 305 "parse-gram.y"
2121 { token_table_flag
= true; }
2126 /* Line 1455 of yacc.c */
2127 #line 306 "parse-gram.y"
2128 { report_flag
|= report_states
; }
2133 /* Line 1455 of yacc.c */
2134 #line 307 "parse-gram.y"
2135 { yacc_flag
= true; }
2140 /* Line 1455 of yacc.c */
2141 #line 315 "parse-gram.y"
2143 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2149 /* Line 1455 of yacc.c */
2150 #line 319 "parse-gram.y"
2153 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2154 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2155 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2161 /* Line 1455 of yacc.c */
2162 #line 326 "parse-gram.y"
2165 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2166 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2167 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2173 /* Line 1455 of yacc.c */
2174 #line 333 "parse-gram.y"
2176 default_prec
= true;
2182 /* Line 1455 of yacc.c */
2183 #line 337 "parse-gram.y"
2185 default_prec
= false;
2191 /* Line 1455 of yacc.c */
2192 #line 341 "parse-gram.y"
2194 /* Do not invoke muscle_percent_code_grow here since it invokes
2195 muscle_user_name_list_grow. */
2196 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2197 code_scanner_last_string_free ();
2203 /* Line 1455 of yacc.c */
2204 #line 348 "parse-gram.y"
2206 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2207 code_scanner_last_string_free ();
2213 /* Line 1455 of yacc.c */
2214 #line 362 "parse-gram.y"
2220 /* Line 1455 of yacc.c */
2221 #line 363 "parse-gram.y"
2222 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2227 /* Line 1455 of yacc.c */
2228 #line 368 "parse-gram.y"
2231 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2232 code_scanner_last_string_free ();
2238 /* Line 1455 of yacc.c */
2239 #line 379 "parse-gram.y"
2240 { current_class
= nterm_sym
; }
2245 /* Line 1455 of yacc.c */
2246 #line 380 "parse-gram.y"
2248 current_class
= unknown_sym
;
2249 current_type
= NULL
;
2255 /* Line 1455 of yacc.c */
2256 #line 384 "parse-gram.y"
2257 { current_class
= token_sym
; }
2262 /* Line 1455 of yacc.c */
2263 #line 385 "parse-gram.y"
2265 current_class
= unknown_sym
;
2266 current_type
= NULL
;
2272 /* Line 1455 of yacc.c */
2273 #line 390 "parse-gram.y"
2277 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2278 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2279 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2285 /* Line 1455 of yacc.c */
2286 #line 401 "parse-gram.y"
2290 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2292 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2293 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2295 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2296 current_type
= NULL
;
2302 /* Line 1455 of yacc.c */
2303 #line 415 "parse-gram.y"
2304 { (yyval
.assoc
) = left_assoc
; }
2309 /* Line 1455 of yacc.c */
2310 #line 416 "parse-gram.y"
2311 { (yyval
.assoc
) = right_assoc
; }
2316 /* Line 1455 of yacc.c */
2317 #line 417 "parse-gram.y"
2318 { (yyval
.assoc
) = non_assoc
; }
2323 /* Line 1455 of yacc.c */
2324 #line 421 "parse-gram.y"
2325 { current_type
= NULL
; }
2330 /* Line 1455 of yacc.c */
2331 #line 422 "parse-gram.y"
2332 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2337 /* Line 1455 of yacc.c */
2338 #line 428 "parse-gram.y"
2339 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2344 /* Line 1455 of yacc.c */
2345 #line 430 "parse-gram.y"
2346 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2351 /* Line 1455 of yacc.c */
2352 #line 434 "parse-gram.y"
2353 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2358 /* Line 1455 of yacc.c */
2359 #line 435 "parse-gram.y"
2360 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2365 /* Line 1455 of yacc.c */
2366 #line 441 "parse-gram.y"
2367 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2372 /* Line 1455 of yacc.c */
2373 #line 443 "parse-gram.y"
2374 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2379 /* Line 1455 of yacc.c */
2380 #line 447 "parse-gram.y"
2381 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2386 /* Line 1455 of yacc.c */
2387 #line 448 "parse-gram.y"
2388 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2393 /* Line 1455 of yacc.c */
2394 #line 452 "parse-gram.y"
2395 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2400 /* Line 1455 of yacc.c */
2401 #line 453 "parse-gram.y"
2402 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2407 /* Line 1455 of yacc.c */
2408 #line 454 "parse-gram.y"
2409 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2414 /* Line 1455 of yacc.c */
2415 #line 455 "parse-gram.y"
2416 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2421 /* Line 1455 of yacc.c */
2422 #line 461 "parse-gram.y"
2424 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2431 /* Line 1455 of yacc.c */
2432 #line 466 "parse-gram.y"
2434 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2435 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2441 /* Line 1455 of yacc.c */
2442 #line 471 "parse-gram.y"
2444 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2445 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2446 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2452 /* Line 1455 of yacc.c */
2453 #line 477 "parse-gram.y"
2455 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2456 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2457 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2463 /* Line 1455 of yacc.c */
2464 #line 483 "parse-gram.y"
2466 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2467 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2468 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2469 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2475 /* Line 1455 of yacc.c */
2476 #line 513 "parse-gram.y"
2484 /* Line 1455 of yacc.c */
2485 #line 519 "parse-gram.y"
2486 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2491 /* Line 1455 of yacc.c */
2492 #line 523 "parse-gram.y"
2493 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2498 /* Line 1455 of yacc.c */
2499 #line 524 "parse-gram.y"
2500 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2505 /* Line 1455 of yacc.c */
2506 #line 530 "parse-gram.y"
2507 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2512 /* Line 1455 of yacc.c */
2513 #line 532 "parse-gram.y"
2514 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2519 /* Line 1455 of yacc.c */
2520 #line 534 "parse-gram.y"
2521 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2526 /* Line 1455 of yacc.c */
2527 #line 536 "parse-gram.y"
2528 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2533 /* Line 1455 of yacc.c */
2534 #line 538 "parse-gram.y"
2535 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2540 /* Line 1455 of yacc.c */
2541 #line 540 "parse-gram.y"
2542 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2547 /* Line 1455 of yacc.c */
2548 #line 550 "parse-gram.y"
2549 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2554 /* Line 1455 of yacc.c */
2555 #line 556 "parse-gram.y"
2563 /* Line 1455 of yacc.c */
2564 #line 569 "parse-gram.y"
2566 code_props plain_code
;
2567 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2568 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2569 code_props_translate_code (&plain_code
);
2570 gram_scanner_last_string_free ();
2571 (yyval
.chars
) = plain_code
.code
;
2577 /* Line 1455 of yacc.c */
2578 #line 589 "parse-gram.y"
2579 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2584 /* Line 1455 of yacc.c */
2585 #line 591 "parse-gram.y"
2587 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2588 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2589 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2595 /* Line 1455 of yacc.c */
2596 #line 599 "parse-gram.y"
2597 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2602 /* Line 1455 of yacc.c */
2603 #line 611 "parse-gram.y"
2605 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2606 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2612 /* Line 1455 of yacc.c */
2613 #line 620 "parse-gram.y"
2615 code_props plain_code
;
2616 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2617 code_props_translate_code (&plain_code
);
2618 gram_scanner_last_string_free ();
2619 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2620 code_scanner_last_string_free ();
2626 /* Line 1455 of yacc.c */
2627 #line 2628 "parse-gram.c"
2630 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2634 YY_STACK_PRINT (yyss
, yyssp
);
2639 /* Now `shift' the result of the reduction. Determine what state
2640 that goes to, based on the state we popped back to and the rule
2641 number reduced by. */
2645 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2646 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2647 yystate
= yytable
[yystate
];
2649 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2654 /*------------------------------------.
2655 | yyerrlab -- here on detecting error |
2656 `------------------------------------*/
2658 /* If not already recovering from an error, report this error. */
2662 #if ! YYERROR_VERBOSE
2663 yyerror (YY_("syntax error"));
2666 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2667 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2669 YYSIZE_T yyalloc
= 2 * yysize
;
2670 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2671 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2672 if (yymsg
!= yymsgbuf
)
2673 YYSTACK_FREE (yymsg
);
2674 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2676 yymsg_alloc
= yyalloc
;
2680 yymsg_alloc
= sizeof yymsgbuf
;
2684 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2686 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2691 yyerror (YY_("syntax error"));
2693 goto yyexhaustedlab
;
2699 yyerror_range
[0] = yylloc
;
2701 if (yyerrstatus
== 3)
2703 /* If just tried and failed to reuse lookahead token after an
2704 error, discard it. */
2706 if (yychar
<= YYEOF
)
2708 /* Return failure if at end of input. */
2709 if (yychar
== YYEOF
)
2714 yydestruct ("Error: discarding",
2715 yytoken
, &yylval
, &yylloc
);
2720 /* Else will try to reuse lookahead token after shifting the error
2725 /*---------------------------------------------------.
2726 | yyerrorlab -- error raised explicitly by YYERROR. |
2727 `---------------------------------------------------*/
2730 /* Pacify compilers like GCC when the user code never invokes
2731 YYERROR and the label yyerrorlab therefore never appears in user
2733 if (/*CONSTCOND*/ 0)
2736 yyerror_range
[0] = yylsp
[1-yylen
];
2737 /* Do not reclaim the symbols of the rule which action triggered
2741 YY_STACK_PRINT (yyss
, yyssp
);
2746 /*-------------------------------------------------------------.
2747 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2748 `-------------------------------------------------------------*/
2750 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2754 yyn
= yypact
[yystate
];
2755 if (yyn
!= YYPACT_NINF
)
2758 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2766 /* Pop the current state because it cannot handle the error token. */
2770 yyerror_range
[0] = *yylsp
;
2771 yydestruct ("Error: popping",
2772 yystos
[yystate
], yyvsp
, yylsp
);
2775 YY_STACK_PRINT (yyss
, yyssp
);
2780 yyerror_range
[1] = yylloc
;
2781 /* Using YYLLOC is tempting, but would change the location of
2782 the lookahead. YYLOC is available though. */
2783 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2786 /* Shift the error token. */
2787 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2793 /*-------------------------------------.
2794 | yyacceptlab -- YYACCEPT comes here. |
2795 `-------------------------------------*/
2800 /*-----------------------------------.
2801 | yyabortlab -- YYABORT comes here. |
2802 `-----------------------------------*/
2807 #if !defined(yyoverflow) || YYERROR_VERBOSE
2808 /*-------------------------------------------------.
2809 | yyexhaustedlab -- memory exhaustion comes here. |
2810 `-------------------------------------------------*/
2812 yyerror (YY_("memory exhausted"));
2818 if (yychar
!= YYEMPTY
)
2819 yydestruct ("Cleanup: discarding lookahead",
2820 yytoken
, &yylval
, &yylloc
);
2821 /* Do not reclaim the symbols of the rule which action triggered
2822 this YYABORT or YYACCEPT. */
2824 YY_STACK_PRINT (yyss
, yyssp
);
2825 while (yyssp
!= yyss
)
2827 yydestruct ("Cleanup: popping",
2828 yystos
[*yyssp
], yyvsp
, yylsp
);
2833 YYSTACK_FREE (yyss
);
2836 if (yymsg
!= yymsgbuf
)
2837 YYSTACK_FREE (yymsg
);
2839 /* Make sure YYID is used. */
2840 return YYID (yyresult
);
2845 /* Line 1675 of yacc.c */
2846 #line 630 "parse-gram.y"
2850 /* Return the location of the left-hand side of a rule whose
2851 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2852 the right-hand side, and return an empty location equal to the end
2853 boundary of RHS[0] if the right-hand side is empty. */
2856 lloc_default (YYLTYPE
const *rhs
, int n
)
2861 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2862 The bug is fixed in 7.4.2m, but play it safe for now. */
2863 loc
.start
= rhs
[n
].end
;
2864 loc
.end
= rhs
[n
].end
;
2866 /* Ignore empty nonterminals the start of the the right-hand side.
2867 Do not bother to ignore them at the end of the right-hand side,
2868 since empty nonterminals have the same end as their predecessors. */
2869 for (i
= 1; i
<= n
; i
++)
2870 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2872 loc
.start
= rhs
[i
].start
;
2880 /* Add a lex-param or a parse-param (depending on TYPE) with
2881 declaration DECL and location LOC. */
2884 add_param (char const *type
, char *decl
, location loc
)
2886 static char const alphanum
[26 + 26 + 1 + 10] =
2887 "abcdefghijklmnopqrstuvwxyz"
2888 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2891 char const *name_start
= NULL
;
2894 /* Stop on last actual character. */
2895 for (p
= decl
; p
[1]; p
++)
2897 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2898 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2901 /* Strip the surrounding '{' and '}', and any blanks just inside
2903 while (*--p
== ' ' || *p
== '\t')
2906 while (*++decl
== ' ' || *decl
== '\t')
2910 complain_at (loc
, _("missing identifier in parameter declaration"));
2917 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2921 name
= xmalloc (name_len
+ 1);
2922 memcpy (name
, name_start
, name_len
);
2923 name
[name_len
] = '\0';
2924 muscle_pair_list_grow (type
, decl
, name
);
2928 gram_scanner_last_string_free ();
2933 version_check (location
const *loc
, char const *version
)
2935 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2937 complain_at (*loc
, "require bison %s, but have %s",
2938 version
, PACKAGE_VERSION
);
2944 gram_error (location
const *loc
, char const *msg
)
2946 complain_at (*loc
, "%s", msg
);
2950 token_name (int type
)
2952 return yytname
[YYTRANSLATE (type
)];
2963 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2964 return quotearg_style (escape_quoting_style
, buf
);