1 /* A Bison parser, made by GNU Bison 2.4.1.252-dcd39. */
3 /* Skeleton 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, 2010 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.1.252-dcd39"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 1
65 /* Substitute the variable and function names. */
66 #define yyparse gram_parse
67 #define yylex gram_lex
68 #define yyerror gram_error
69 #define yylval gram_lval
70 #define yychar gram_char
71 #define yydebug gram_debug
72 #define yynerrs gram_nerrs
73 #define yylloc gram_lloc
75 /* Copy the first part of user declarations. */
77 /* Line 268 of yacc.c */
78 #line 1 "parse-gram.y"
79 /* Bison Grammar Parser -*- C -*-
81 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
82 Free Software Foundation, Inc.
84 This file is part of Bison, the GNU Compiler Compiler.
86 This program is free software: you can redistribute it and/or modify
87 it under the terms of the GNU General Public License as published by
88 the Free Software Foundation, either version 3 of the License, or
89 (at your option) any later version.
91 This program is distributed in the hope that it will be useful,
92 but WITHOUT ANY WARRANTY; without even the implied warranty of
93 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
94 GNU General Public License for more details.
96 You should have received a copy of the GNU General Public License
97 along with this program. If not, see <http://www.gnu.org/licenses/>. */
102 #include "complain.h"
103 #include "conflicts.h"
107 #include "muscle-tab.h"
108 #include "named-ref.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 named_ref
*current_lhs_named_ref
;
146 static int current_prec
= 0;
148 #define YYTYPE_INT16 int_fast16_t
149 #define YYTYPE_INT8 int_fast8_t
150 #define YYTYPE_UINT16 uint_fast16_t
151 #define YYTYPE_UINT8 uint_fast8_t
154 /* Line 268 of yacc.c */
155 #line 156 "parse-gram.c"
157 /* Enabling traces. */
162 /* Enabling verbose error messages. */
163 #ifdef YYERROR_VERBOSE
164 # undef YYERROR_VERBOSE
165 # define YYERROR_VERBOSE 1
167 # define YYERROR_VERBOSE 1
170 /* Enabling the token table. */
171 #ifndef YYTOKEN_TABLE
172 # define YYTOKEN_TABLE 0
179 /* Put the tokens into the symbol table, so that GDB and other debuggers
188 PERCENT_DESTRUCTOR
= 263,
189 PERCENT_PRINTER
= 264,
192 PERCENT_NONASSOC
= 267,
198 PERCENT_DEFAULT_PREC
= 273,
199 PERCENT_DEFINE
= 274,
200 PERCENT_DEFINES
= 275,
201 PERCENT_ERROR_VERBOSE
= 276,
202 PERCENT_EXPECT
= 277,
203 PERCENT_EXPECT_RR
= 278,
204 PERCENT_FILE_PREFIX
= 279,
205 PERCENT_GLR_PARSER
= 280,
206 PERCENT_INITIAL_ACTION
= 281,
207 PERCENT_LANGUAGE
= 282,
208 PERCENT_LEX_PARAM
= 283,
209 PERCENT_LOCATIONS
= 284,
210 PERCENT_NAME_PREFIX
= 285,
211 PERCENT_NO_DEFAULT_PREC
= 286,
212 PERCENT_NO_LINES
= 287,
213 PERCENT_NONDETERMINISTIC_PARSER
= 288,
214 PERCENT_OUTPUT
= 289,
215 PERCENT_PARSE_PARAM
= 290,
216 PERCENT_PURE_PARSER
= 291,
217 PERCENT_REQUIRE
= 292,
218 PERCENT_SKELETON
= 293,
220 PERCENT_TOKEN_TABLE
= 295,
221 PERCENT_VERBOSE
= 296,
230 PERCENT_PERCENT
= 305,
244 #define PERCENT_TOKEN 260
245 #define PERCENT_NTERM 261
246 #define PERCENT_TYPE 262
247 #define PERCENT_DESTRUCTOR 263
248 #define PERCENT_PRINTER 264
249 #define PERCENT_LEFT 265
250 #define PERCENT_RIGHT 266
251 #define PERCENT_NONASSOC 267
252 #define PERCENT_PREC 268
253 #define PERCENT_DPREC 269
254 #define PERCENT_MERGE 270
255 #define PERCENT_CODE 271
256 #define PERCENT_DEBUG 272
257 #define PERCENT_DEFAULT_PREC 273
258 #define PERCENT_DEFINE 274
259 #define PERCENT_DEFINES 275
260 #define PERCENT_ERROR_VERBOSE 276
261 #define PERCENT_EXPECT 277
262 #define PERCENT_EXPECT_RR 278
263 #define PERCENT_FILE_PREFIX 279
264 #define PERCENT_GLR_PARSER 280
265 #define PERCENT_INITIAL_ACTION 281
266 #define PERCENT_LANGUAGE 282
267 #define PERCENT_LEX_PARAM 283
268 #define PERCENT_LOCATIONS 284
269 #define PERCENT_NAME_PREFIX 285
270 #define PERCENT_NO_DEFAULT_PREC 286
271 #define PERCENT_NO_LINES 287
272 #define PERCENT_NONDETERMINISTIC_PARSER 288
273 #define PERCENT_OUTPUT 289
274 #define PERCENT_PARSE_PARAM 290
275 #define PERCENT_PURE_PARSER 291
276 #define PERCENT_REQUIRE 292
277 #define PERCENT_SKELETON 293
278 #define PERCENT_START 294
279 #define PERCENT_TOKEN_TABLE 295
280 #define PERCENT_VERBOSE 296
281 #define PERCENT_YACC 297
282 #define BRACED_CODE 298
283 #define BRACKETED_ID 299
289 #define PERCENT_PERCENT 305
292 #define SEMICOLON 308
294 #define TYPE_TAG_ANY 310
295 #define TYPE_TAG_NONE 311
296 #define PERCENT_UNION 312
301 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
302 typedef union YYSTYPE
305 /* Line 293 of yacc.c */
306 #line 95 "parse-gram.y"
315 unsigned char character
;
316 named_ref
*named_ref
;
320 /* Line 293 of yacc.c */
321 #line 322 "parse-gram.c"
323 # define YYSTYPE_IS_TRIVIAL 1
324 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
325 # define YYSTYPE_IS_DECLARED 1
328 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
329 typedef struct YYLTYPE
336 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
337 # define YYLTYPE_IS_DECLARED 1
338 # define YYLTYPE_IS_TRIVIAL 1
342 /* Copy the second part of user declarations. */
345 /* Line 343 of yacc.c */
346 #line 347 "parse-gram.c"
353 typedef YYTYPE_UINT8 yytype_uint8
;
355 typedef unsigned char yytype_uint8
;
359 typedef YYTYPE_INT8 yytype_int8
;
360 #elif (defined __STDC__ || defined __C99__FUNC__ \
361 || defined __cplusplus || defined _MSC_VER)
362 typedef signed char yytype_int8
;
364 typedef short int yytype_int8
;
368 typedef YYTYPE_UINT16 yytype_uint16
;
370 typedef unsigned short int yytype_uint16
;
374 typedef YYTYPE_INT16 yytype_int16
;
376 typedef short int yytype_int16
;
380 # ifdef __SIZE_TYPE__
381 # define YYSIZE_T __SIZE_TYPE__
382 # elif defined size_t
383 # define YYSIZE_T size_t
384 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
385 || defined __cplusplus || defined _MSC_VER)
386 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
387 # define YYSIZE_T size_t
389 # define YYSIZE_T unsigned int
393 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
396 # if defined YYENABLE_NLS && YYENABLE_NLS
398 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
399 # define YY_(msgid) dgettext ("bison-runtime", msgid)
403 # define YY_(msgid) msgid
407 /* Suppress unused-variable warnings by "using" E. */
408 #if ! defined lint || defined __GNUC__
409 # define YYUSE(e) ((void) (e))
411 # define YYUSE(e) /* empty */
414 /* Identity function, used to suppress warnings about constant conditions. */
418 #if (defined __STDC__ || defined __C99__FUNC__ \
419 || defined __cplusplus || defined _MSC_VER)
434 /* The parser invokes alloca or malloc; define the necessary symbols. */
436 # ifdef YYSTACK_ALLOC
437 /* Pacify GCC's `empty if-body' warning. */
438 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
439 # ifndef YYSTACK_ALLOC_MAXIMUM
440 /* The OS might guarantee only one guard page at the bottom of the stack,
441 and a page size can be as small as 4096 bytes. So we cannot safely
442 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
443 to allow for a few compiler-allocated temporary stack slots. */
444 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
447 # define YYSTACK_ALLOC YYMALLOC
448 # define YYSTACK_FREE YYFREE
449 # ifndef YYSTACK_ALLOC_MAXIMUM
450 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
452 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
453 && ! ((defined YYMALLOC || defined malloc) \
454 && (defined YYFREE || defined free)))
455 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
456 # ifndef EXIT_SUCCESS
457 # define EXIT_SUCCESS 0
461 # define YYMALLOC malloc
462 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
463 || defined __cplusplus || defined _MSC_VER)
464 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
469 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
470 || defined __cplusplus || defined _MSC_VER)
471 void free (void *); /* INFRINGES ON USER NAME SPACE */
475 # define YYCOPY_NEEDED 1
479 #if (! defined yyoverflow \
480 && (! defined __cplusplus \
481 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
482 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
484 /* A type that is properly aligned for any stack member. */
487 yytype_int16 yyss_alloc
;
492 /* The size of the maximum gap between one aligned stack and the next. */
493 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
495 /* The size of an array large to enough to hold all stacks, each with
497 # define YYSTACK_BYTES(N) \
498 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
499 + 2 * YYSTACK_GAP_MAXIMUM)
501 # define YYCOPY_NEEDED 1
503 /* Relocate STACK from its old location to the new one. The
504 local variables YYSIZE and YYSTACKSIZE give the old and new number of
505 elements in the stack, and YYPTR gives the new location of the
506 stack. Advance YYPTR to a properly aligned location for the next
508 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
511 YYSIZE_T yynewbytes; \
512 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
513 Stack = &yyptr->Stack_alloc; \
514 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
515 yyptr += yynewbytes / sizeof (*yyptr); \
521 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
522 /* Copy COUNT objects from FROM to TO. The source and destination do
525 # if defined __GNUC__ && 1 < __GNUC__
526 # define YYCOPY(To, From, Count) \
527 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
529 # define YYCOPY(To, From, Count) \
533 for (yyi = 0; yyi < (Count); yyi++) \
534 (To)[yyi] = (From)[yyi]; \
539 #endif /* !YYCOPY_NEEDED */
541 /* YYFINAL -- State number of the termination state. */
543 /* YYLAST -- Last index in YYTABLE. */
546 /* YYNTOKENS -- Number of terminals. */
548 /* YYNNTS -- Number of nonterminals. */
550 /* YYNRULES -- Number of rules. */
552 /* YYNRULES -- Number of states. */
553 #define YYNSTATES 148
555 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
557 #define YYMAXUTOK 312
559 #define YYTRANSLATE(YYX) \
560 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
562 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
563 static const yytype_uint8 yytranslate
[] =
565 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
591 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
592 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
593 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
594 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
595 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
600 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
602 static const yytype_uint16 yyprhs
[] =
604 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
605 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
606 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
607 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
608 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
609 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
610 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
611 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
612 206, 209, 212, 213, 218, 220, 224, 227, 228, 232,
613 236, 240, 244, 248, 249, 251, 253, 255, 256, 258,
614 260, 262, 264, 266, 268, 270, 272, 274, 275
617 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
618 static const yytype_int8 yyrhs
[] =
620 59, 0, -1, 60, 50, 77, 91, -1, -1, 60,
621 61, -1, 62, -1, 52, -1, 17, -1, 19, 84,
622 85, -1, 20, -1, 20, 3, -1, 21, -1, 22,
623 4, -1, 23, 4, -1, 24, 3, -1, 24, 47,
624 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
625 28, 43, -1, 29, -1, 30, 3, -1, 30, 47,
626 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
627 47, 3, -1, 35, 43, -1, 36, -1, 37, 3,
628 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
629 53, -1, 67, -1, 64, -1, 39, 89, -1, 8,
630 43, 73, -1, 9, 43, 73, -1, 18, -1, 31,
631 -1, 16, 86, -1, 16, 48, 86, -1, -1, 48,
632 -1, 57, 63, 86, -1, -1, 6, 65, 76, -1,
633 -1, 5, 66, 76, -1, 7, 54, 72, -1, 68,
634 69, 70, -1, 10, -1, 11, -1, 12, -1, -1,
635 54, -1, 71, -1, 70, 71, -1, 89, -1, 89,
636 4, -1, 89, -1, 72, 89, -1, 74, -1, 73,
637 74, -1, 89, -1, 54, -1, 55, -1, 56, -1,
638 54, -1, 87, -1, 87, 4, -1, 87, 90, -1,
639 87, 4, 90, -1, 75, -1, 76, 75, -1, 78,
640 -1, 77, 78, -1, 79, -1, 62, 53, -1, 1,
641 53, -1, -1, 88, 83, 80, 81, -1, 82, -1,
642 81, 51, 82, -1, 81, 53, -1, -1, 82, 89,
643 83, -1, 82, 43, 83, -1, 82, 13, 89, -1,
644 82, 14, 4, -1, 82, 15, 54, -1, -1, 44,
645 -1, 48, -1, 3, -1, -1, 48, -1, 3, -1,
646 43, -1, 48, -1, 45, -1, 49, -1, 87, -1,
647 90, -1, 3, -1, -1, 50, 46, -1
650 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
651 static const yytype_uint16 yyrline
[] =
653 0, 210, 210, 218, 220, 224, 225, 235, 236, 241,
654 242, 247, 248, 249, 250, 251, 252, 257, 266, 267,
655 268, 269, 270, 271, 272, 273, 274, 275, 276, 291,
656 292, 316, 317, 318, 319, 323, 324, 325, 329, 336,
657 343, 347, 351, 358, 373, 374, 378, 390, 390, 395,
658 395, 400, 411, 426, 427, 428, 432, 433, 438, 440,
659 445, 446, 451, 453, 458, 459, 463, 464, 465, 466,
660 471, 476, 481, 487, 493, 504, 505, 514, 515, 521,
661 522, 523, 530, 530, 535, 536, 537, 542, 544, 546,
662 548, 550, 552, 557, 559, 570, 571, 576, 577, 578,
663 587, 607, 609, 618, 623, 624, 629, 636, 638
667 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
668 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
669 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
670 static const char *const yytname
[] =
672 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
673 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
674 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
675 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
676 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
677 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
678 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
679 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
680 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
681 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
682 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
683 "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"", "\"=\"",
684 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
685 "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
686 "input", "prologue_declarations", "prologue_declaration",
687 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
688 "precedence_declaration", "precedence_declarator", "type.opt",
689 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
690 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
691 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
692 "named_ref.opt", "variable", "content.opt", "braceless", "id",
693 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
698 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
700 static const yytype_uint16 yytoknum
[] =
702 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
703 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
704 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
705 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
706 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
707 305, 306, 307, 308, 309, 310, 311, 312
711 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
712 static const yytype_uint8 yyr1
[] =
714 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
715 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
716 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
717 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
718 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
719 64, 64, 67, 68, 68, 68, 69, 69, 70, 70,
720 71, 71, 72, 72, 73, 73, 74, 74, 74, 74,
721 75, 75, 75, 75, 75, 76, 76, 77, 77, 78,
722 78, 78, 80, 79, 81, 81, 81, 82, 82, 82,
723 82, 82, 82, 83, 83, 84, 84, 85, 85, 85,
724 86, 87, 87, 88, 89, 89, 90, 91, 91
727 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
728 static const yytype_uint8 yyr2
[] =
730 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
731 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
732 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
733 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
734 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
735 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
736 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
737 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
738 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
739 3, 3, 3, 0, 1, 1, 1, 0, 1, 1,
740 1, 1, 1, 1, 1, 1, 1, 0, 2
743 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
744 Performed when YYTABLE doesn't specify something else to do. Zero
745 means the default is an error. */
746 static const yytype_uint8 yydefact
[] =
748 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
749 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
750 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
751 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
752 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
753 0, 0, 0, 100, 0, 42, 96, 95, 97, 10,
754 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
755 0, 27, 29, 30, 106, 102, 101, 104, 37, 105,
756 0, 103, 0, 0, 77, 79, 93, 45, 0, 57,
757 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
758 69, 38, 64, 66, 39, 43, 99, 98, 8, 15,
759 22, 26, 81, 80, 0, 78, 2, 94, 82, 46,
760 52, 58, 60, 76, 72, 73, 63, 65, 108, 87,
761 59, 61, 74, 83, 84, 87, 86, 0, 0, 0,
762 93, 93, 85, 90, 91, 92, 89, 88
765 /* YYDEFGOTO[NTERM-NUM]. */
766 static const yytype_int16 yydefgoto
[] =
768 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
769 47, 90, 120, 121, 96, 101, 102, 92, 93, 83,
770 84, 85, 129, 133, 134, 118, 58, 108, 55, 77,
774 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
776 #define YYPACT_NINF -91
777 static const yytype_int16 yypact
[] =
779 -91, 3, 103, -91, -91, -91, -36, 2, 10, -91,
780 -91, -91, 9, -91, -91, 32, 60, -91, 65, 67,
781 27, -91, 41, 73, 51, -91, 39, -91, -91, -91,
782 40, 52, -91, 93, 95, 33, -91, -91, -91, 15,
783 -91, -91, 53, -91, -91, -91, -91, 46, 43, 43,
784 33, 11, 11, -91, 61, -91, -91, -91, 35, -91,
785 -91, -91, -91, 100, -91, -91, -91, -91, 102, -91,
786 113, -91, -91, -91, -91, -91, -91, -91, -91, -91,
787 64, -91, 94, 1, -91, -91, 62, -91, 61, -91,
788 33, -91, -91, 43, 86, 43, 33, -91, -91, -91,
789 -91, 11, -91, -91, 11, -91, -91, -91, -91, -91,
790 -91, -91, -91, -91, 72, -91, -91, -91, -91, -91,
791 33, -91, 142, -91, 145, -91, -91, -91, -91, -91,
792 -91, -91, -91, 17, 34, -91, -91, 33, 146, 97,
793 62, 62, 34, -91, -91, -91, -91, -91
796 /* YYPGOTO[NTERM-NUM]. */
797 static const yytype_int16 yypgoto
[] =
799 -91, -91, -91, -91, 147, -91, -91, -91, -91, -91,
800 -91, -91, -91, 37, -91, 106, -60, -33, 105, -91,
801 69, -91, -91, -91, 24, -48, -91, -91, -49, -20,
805 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
806 positive, shift that token. If negative, reduce the rule which
807 number is the opposite. If YYTABLE_NINF, syntax error. */
808 #define YYTABLE_NINF -108
809 static const yytype_int16 yytable
[] =
811 78, -107, 80, 3, 125, 105, 4, 5, 6, 7,
812 8, 9, 10, 11, 74, 97, 80, 12, 50, 14,
813 4, 5, 6, 7, 8, 9, 10, 11, 94, 94,
814 62, 12, 27, 14, 132, 56, 74, 74, 106, 119,
815 35, 127, 67, 69, 127, 51, 27, 137, 138, 139,
816 81, 114, 53, 52, 35, 122, 75, 54, 42, 76,
817 123, 126, 123, 59, 81, 98, 99, 100, 135, 60,
818 136, 61, 42, 94, 63, 94, 65, 140, 75, 75,
819 57, 76, 76, 107, 64, 122, 68, 70, 75, 74,
820 124, 76, 146, 147, 66, 71, 72, 91, 73, 141,
821 89, 87, 143, 109, 53, 110, 117, 141, 4, 5,
822 6, 7, 8, 9, 10, 11, 111, 112, 128, 12,
823 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
824 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
825 33, 34, 35, 36, 37, 38, 131, 113, 74, 44,
826 144, 145, 115, 39, 95, 40, 41, 130, 104, 142,
830 #define yypact_value_is_default(yystate) \
833 #define yytable_value_is_error(yytable_value) \
836 static const yytype_uint8 yycheck
[] =
838 35, 0, 1, 0, 94, 54, 5, 6, 7, 8,
839 9, 10, 11, 12, 3, 50, 1, 16, 54, 18,
840 5, 6, 7, 8, 9, 10, 11, 12, 48, 49,
841 3, 16, 31, 18, 124, 3, 3, 3, 3, 88,
842 39, 101, 3, 3, 104, 43, 31, 13, 14, 15,
843 49, 50, 43, 43, 39, 90, 45, 48, 57, 48,
844 93, 96, 95, 3, 49, 54, 55, 56, 51, 4,
845 53, 4, 57, 93, 47, 95, 3, 43, 45, 45,
846 48, 48, 48, 48, 43, 120, 47, 47, 45, 3,
847 4, 48, 140, 141, 43, 43, 3, 54, 3, 134,
848 54, 48, 137, 3, 43, 3, 44, 142, 5, 6,
849 7, 8, 9, 10, 11, 12, 3, 53, 46, 16,
850 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
851 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
852 37, 38, 39, 40, 41, 42, 4, 53, 3, 2,
853 4, 54, 83, 50, 49, 52, 53, 120, 52, 135,
857 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
858 symbol of state STATE-NUM. */
859 static const yytype_uint8 yystos
[] =
861 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
862 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
863 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
864 34, 35, 36, 37, 38, 39, 40, 41, 42, 50,
865 52, 53, 57, 61, 62, 64, 67, 68, 66, 65,
866 54, 43, 43, 43, 48, 86, 3, 48, 84, 3,
867 4, 4, 3, 47, 43, 3, 43, 3, 47, 3,
868 47, 43, 3, 3, 3, 45, 48, 87, 89, 90,
869 1, 49, 62, 77, 78, 79, 88, 48, 63, 54,
870 69, 54, 75, 76, 87, 76, 72, 89, 54, 55,
871 56, 73, 74, 89, 73, 86, 3, 48, 85, 3,
872 3, 3, 53, 53, 50, 78, 91, 44, 83, 86,
873 70, 71, 89, 75, 4, 90, 89, 74, 46, 80,
874 71, 4, 90, 81, 82, 51, 53, 13, 14, 15,
875 43, 89, 82, 89, 4, 54, 83, 83
878 #define yyerrok (yyerrstatus = 0)
879 #define yyclearin (yychar = YYEMPTY)
883 #define YYACCEPT goto yyacceptlab
884 #define YYABORT goto yyabortlab
885 #define YYERROR goto yyerrorlab
888 /* Like YYERROR except do call yyerror. This remains here temporarily
889 to ease the transition to the new meaning of YYERROR, for GCC.
890 Once GCC version 2 has supplanted version 1, this can go. However,
891 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
892 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
895 #define YYFAIL goto yyerrlab
897 /* This is here to suppress warnings from the GCC cpp's
898 -Wunused-macros. Normally we don't worry about that warning, but
899 some users do, and we want to make it easy for users to remove
900 YYFAIL uses, which will produce warnings from Bison 2.5. */
903 #define YYRECOVERING() (!!yyerrstatus)
905 #define YYBACKUP(Token, Value) \
907 if (yychar == YYEMPTY && yylen == 1) \
912 YY_LAC_DISCARD ("YYBACKUP"); \
917 yyerror (YY_("syntax error: cannot back up")); \
924 #define YYERRCODE 256
927 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
928 If N is 0, then set CURRENT to the empty location which ends
929 the previous symbol: RHS[0] (always defined). */
931 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
932 #ifndef YYLLOC_DEFAULT
933 # define YYLLOC_DEFAULT(Current, Rhs, N) \
937 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
938 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
939 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
940 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
944 (Current).first_line = (Current).last_line = \
945 YYRHSLOC (Rhs, 0).last_line; \
946 (Current).first_column = (Current).last_column = \
947 YYRHSLOC (Rhs, 0).last_column; \
953 /* YY_LOCATION_PRINT -- Print the location on the stream.
954 This macro was not mandated originally: define only if we know
955 we won't break user code: when these are the locations we know. */
957 #ifndef YY_LOCATION_PRINT
958 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
959 # define YY_LOCATION_PRINT(File, Loc) \
960 fprintf (File, "%d.%d-%d.%d", \
961 (Loc).first_line, (Loc).first_column, \
962 (Loc).last_line, (Loc).last_column)
964 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
969 /* YYLEX -- calling `yylex' with the right arguments. */
972 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
974 # define YYLEX yylex (&yylval, &yylloc)
977 /* Enable debugging if requested. */
981 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
982 # define YYFPRINTF fprintf
985 # define YYDPRINTF(Args) \
991 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
995 YYFPRINTF (stderr, "%s ", Title); \
996 yy_symbol_print (stderr, \
997 Type, Value, Location); \
998 YYFPRINTF (stderr, "\n"); \
1003 /*--------------------------------.
1004 | Print this symbol on YYOUTPUT. |
1005 `--------------------------------*/
1008 #if (defined __STDC__ || defined __C99__FUNC__ \
1009 || defined __cplusplus || defined _MSC_VER)
1011 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1014 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1017 YYSTYPE
const * const yyvaluep
;
1018 YYLTYPE
const * const yylocationp
;
1023 YYUSE (yylocationp
);
1025 if (yytype
< YYNTOKENS
)
1026 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1032 case 3: /* "\"string\"" */
1034 /* Line 819 of yacc.c */
1035 #line 185 "parse-gram.y"
1036 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1038 /* Line 819 of yacc.c */
1039 #line 1040 "parse-gram.c"
1041 case 4: /* "\"integer\"" */
1043 /* Line 819 of yacc.c */
1044 #line 197 "parse-gram.y"
1045 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1047 /* Line 819 of yacc.c */
1048 #line 1049 "parse-gram.c"
1050 case 43: /* "\"{...}\"" */
1052 /* Line 819 of yacc.c */
1053 #line 187 "parse-gram.y"
1054 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1056 /* Line 819 of yacc.c */
1057 #line 1058 "parse-gram.c"
1059 case 44: /* "\"[identifier]\"" */
1061 /* Line 819 of yacc.c */
1062 #line 192 "parse-gram.y"
1063 { fprintf (stderr
, "[%s]", (yyvaluep
->uniqstr
)); };
1065 /* Line 819 of yacc.c */
1066 #line 1067 "parse-gram.c"
1068 case 45: /* "\"char\"" */
1070 /* Line 819 of yacc.c */
1071 #line 179 "parse-gram.y"
1072 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1074 /* Line 819 of yacc.c */
1075 #line 1076 "parse-gram.c"
1077 case 46: /* "\"epilogue\"" */
1079 /* Line 819 of yacc.c */
1080 #line 187 "parse-gram.y"
1081 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1083 /* Line 819 of yacc.c */
1084 #line 1085 "parse-gram.c"
1086 case 48: /* "\"identifier\"" */
1088 /* Line 819 of yacc.c */
1089 #line 191 "parse-gram.y"
1090 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1092 /* Line 819 of yacc.c */
1093 #line 1094 "parse-gram.c"
1095 case 49: /* "\"identifier:\"" */
1097 /* Line 819 of yacc.c */
1098 #line 193 "parse-gram.y"
1099 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1101 /* Line 819 of yacc.c */
1102 #line 1103 "parse-gram.c"
1104 case 52: /* "\"%{...%}\"" */
1106 /* Line 819 of yacc.c */
1107 #line 187 "parse-gram.y"
1108 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1110 /* Line 819 of yacc.c */
1111 #line 1112 "parse-gram.c"
1113 case 54: /* "\"type\"" */
1115 /* Line 819 of yacc.c */
1116 #line 194 "parse-gram.y"
1117 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1119 /* Line 819 of yacc.c */
1120 #line 1121 "parse-gram.c"
1122 case 71: /* "symbol.prec" */
1124 /* Line 819 of yacc.c */
1125 #line 200 "parse-gram.y"
1126 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1128 /* Line 819 of yacc.c */
1129 #line 1130 "parse-gram.c"
1131 case 84: /* "variable" */
1133 /* Line 819 of yacc.c */
1134 #line 191 "parse-gram.y"
1135 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1137 /* Line 819 of yacc.c */
1138 #line 1139 "parse-gram.c"
1140 case 85: /* "content.opt" */
1142 /* Line 819 of yacc.c */
1143 #line 187 "parse-gram.y"
1144 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1146 /* Line 819 of yacc.c */
1147 #line 1148 "parse-gram.c"
1149 case 86: /* "braceless" */
1151 /* Line 819 of yacc.c */
1152 #line 187 "parse-gram.y"
1153 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1155 /* Line 819 of yacc.c */
1156 #line 1157 "parse-gram.c"
1160 /* Line 819 of yacc.c */
1161 #line 200 "parse-gram.y"
1162 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1164 /* Line 819 of yacc.c */
1165 #line 1166 "parse-gram.c"
1167 case 88: /* "id_colon" */
1169 /* Line 819 of yacc.c */
1170 #line 201 "parse-gram.y"
1171 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1173 /* Line 819 of yacc.c */
1174 #line 1175 "parse-gram.c"
1176 case 89: /* "symbol" */
1178 /* Line 819 of yacc.c */
1179 #line 200 "parse-gram.y"
1180 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1182 /* Line 819 of yacc.c */
1183 #line 1184 "parse-gram.c"
1185 case 90: /* "string_as_id" */
1187 /* Line 819 of yacc.c */
1188 #line 200 "parse-gram.y"
1189 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1191 /* Line 819 of yacc.c */
1192 #line 1193 "parse-gram.c"
1200 /*--------------------------------.
1201 | Print this symbol on YYOUTPUT. |
1202 `--------------------------------*/
1204 #if (defined __STDC__ || defined __C99__FUNC__ \
1205 || defined __cplusplus || defined _MSC_VER)
1207 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1210 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1213 YYSTYPE
const * const yyvaluep
;
1214 YYLTYPE
const * const yylocationp
;
1217 if (yytype
< YYNTOKENS
)
1218 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1220 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1222 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1223 YYFPRINTF (yyoutput
, ": ");
1224 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1225 YYFPRINTF (yyoutput
, ")");
1228 /*------------------------------------------------------------------.
1229 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1231 `------------------------------------------------------------------*/
1233 #if (defined __STDC__ || defined __C99__FUNC__ \
1234 || defined __cplusplus || defined _MSC_VER)
1236 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1239 yy_stack_print (yybottom
, yytop
)
1240 yytype_int16
*yybottom
;
1241 yytype_int16
*yytop
;
1244 YYFPRINTF (stderr
, "Stack now");
1245 for (; yybottom
<= yytop
; yybottom
++)
1247 int yybot
= *yybottom
;
1248 YYFPRINTF (stderr
, " %d", yybot
);
1250 YYFPRINTF (stderr
, "\n");
1253 # define YY_STACK_PRINT(Bottom, Top) \
1256 yy_stack_print ((Bottom), (Top)); \
1260 /*------------------------------------------------.
1261 | Report that the YYRULE is going to be reduced. |
1262 `------------------------------------------------*/
1264 #if (defined __STDC__ || defined __C99__FUNC__ \
1265 || defined __cplusplus || defined _MSC_VER)
1267 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1270 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1276 int yynrhs
= yyr2
[yyrule
];
1278 unsigned long int yylno
= yyrline
[yyrule
];
1279 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1281 /* The symbols being reduced. */
1282 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1284 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1285 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1286 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1287 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1288 YYFPRINTF (stderr
, "\n");
1292 # define YY_REDUCE_PRINT(Rule) \
1295 yy_reduce_print (yyvsp, yylsp, Rule); \
1298 /* Nonzero means print parse trace. It is left uninitialized so that
1299 multiple parsers can coexist. */
1301 #else /* !YYDEBUG */
1302 # define YYDPRINTF(Args)
1303 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1304 # define YY_STACK_PRINT(Bottom, Top)
1305 # define YY_REDUCE_PRINT(Rule)
1306 #endif /* !YYDEBUG */
1309 /* YYINITDEPTH -- initial size of the parser's stacks. */
1311 # define YYINITDEPTH 200
1314 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1315 if the built-in stack extension method is used).
1317 Do not make this value too large; the results are undefined if
1318 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1319 evaluated with infinite-precision integer arithmetic. */
1322 # define YYMAXDEPTH 10000
1325 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1326 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1327 stack, and such that *YYCAPACITY is the maximum number of elements it
1328 can hold without a reallocation, make sure there is enough room to
1329 store YYADD more elements. If not, allocate a new stack using
1330 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1331 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1332 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1333 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1334 required. Return 1 if memory is exhausted. */
1336 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1338 char const *yydebug_prefix
,
1339 char const *yydebug_suffix
,
1341 yytype_int16
**yybottom
,
1342 yytype_int16
*yybottom_no_free
,
1343 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1345 YYSIZE_T yysize_old
=
1346 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1347 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1348 if (*yycapacity
< yysize_new
)
1350 YYSIZE_T yyalloc
= 2 * yysize_new
;
1351 yytype_int16
*yybottom_new
;
1352 /* Use YYMAXDEPTH for maximum stack size given that the stack
1353 should never need to grow larger than the main state stack
1354 needs to grow without LAC. */
1355 if (YYMAXDEPTH
< yysize_new
)
1357 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1361 if (YYMAXDEPTH
< yyalloc
)
1362 yyalloc
= YYMAXDEPTH
;
1364 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1367 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1371 if (*yytop
!= yytop_empty
)
1373 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1374 *yytop
= yybottom_new
+ (yysize_old
- 1);
1376 if (*yybottom
!= yybottom_no_free
)
1377 YYSTACK_FREE (*yybottom
);
1378 *yybottom
= yybottom_new
;
1379 *yycapacity
= yyalloc
;
1384 /* Establish the initial context for the current lookahead if no initial
1385 context is currently established.
1387 We define a context as a snapshot of the parser stacks. We define
1388 the initial context for a lookahead as the context in which the
1389 parser initially examines that lookahead in order to select a
1390 syntactic action. Thus, if the lookahead eventually proves
1391 syntactically unacceptable (possibly in a later context reached via a
1392 series of reductions), the initial context can be used to determine
1393 the exact set of tokens that would be syntactically acceptable in the
1394 lookahead's place. Moreover, it is the context after which any
1395 further semantic actions would be erroneous because they would be
1396 determined by a syntactically unacceptable token.
1398 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1399 performed in an inconsistent state (which, for the purposes of LAC,
1400 includes consistent states that don't know they're consistent because
1401 their default reductions have been disabled). Iff there is a
1402 lookahead token, it should also be invoked before reporting a syntax
1403 error. This latter case is for the sake of the debugging output.
1405 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1406 follows. If no initial context is currently established for the
1407 current lookahead, then check if that lookahead can eventually be
1408 shifted if syntactic actions continue from the current context.
1409 Report a syntax error if it cannot. */
1410 #define YY_LAC_ESTABLISH \
1412 if (!yy_lac_established) \
1414 YYDPRINTF ((stderr, \
1415 "LAC: initial context established for %s\n", \
1416 yytname[yytoken])); \
1417 yy_lac_established = 1; \
1419 int yy_lac_status = \
1420 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1421 if (yy_lac_status == 2) \
1422 goto yyexhaustedlab; \
1423 if (yy_lac_status == 1) \
1429 /* Discard any previous initial lookahead context because of Event,
1430 which may be a lookahead change or an invalidation of the currently
1431 established initial context for the current lookahead.
1433 The most common example of a lookahead change is a shift. An example
1434 of both cases is syntax error recovery. That is, a syntax error
1435 occurs when the lookahead is syntactically erroneous for the
1436 currently established initial context, so error recovery manipulates
1437 the parser stacks to try to find a new initial context in which the
1438 current lookahead is syntactically acceptable. If it fails to find
1439 such a context, it discards the lookahead. */
1441 # define YY_LAC_DISCARD(Event) \
1443 if (yy_lac_established) \
1446 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1448 yy_lac_established = 0; \
1452 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1455 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1456 eventually (after perhaps some reductions) be shifted, return 1 if
1457 not, or return 2 if memory is exhausted. As preconditions and
1458 postconditions: *YYES_CAPACITY is the allocated size of the array to
1459 which *YYES points, and either *YYES = YYESA or *YYES points to an
1460 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1461 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1462 any old *YYES other than YYESA. */
1464 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1465 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1467 yytype_int16
*yyes_prev
= yyssp
;
1468 yytype_int16
*yyesp
= yyes_prev
;
1469 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1470 if (yytoken
== YYUNDEFTOK
)
1472 YYDPRINTF ((stderr
, " Always Err\n"));
1477 int yyrule
= yypact
[*yyesp
];
1478 if (yypact_value_is_default (yyrule
)
1479 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1480 || yycheck
[yyrule
] != yytoken
)
1482 yyrule
= yydefact
[*yyesp
];
1485 YYDPRINTF ((stderr
, " Err\n"));
1491 yyrule
= yytable
[yyrule
];
1492 if (yytable_value_is_error (yyrule
))
1494 YYDPRINTF ((stderr
, " Err\n"));
1499 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1505 YYSIZE_T yylen
= yyr2
[yyrule
];
1506 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1507 if (yyesp
!= yyes_prev
)
1509 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1522 yyesp
= yyes_prev
-= yylen
;
1527 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1528 yystate
= yypgoto
[yylhs
] + *yyesp
;
1529 if (yystate
< 0 || YYLAST
< yystate
1530 || yycheck
[yystate
] != *yyesp
)
1531 yystate
= yydefgoto
[yylhs
];
1533 yystate
= yytable
[yystate
];
1535 if (yyesp
== yyes_prev
)
1542 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1546 yyes
, yyesa
, &yyesp
, yyes_prev
))
1548 YYDPRINTF ((stderr
, "\n"));
1553 YYDPRINTF ((stderr
, " G%d", *yyesp
));
1562 # if defined __GLIBC__ && defined _STRING_H
1563 # define yystrlen strlen
1565 /* Return the length of YYSTR. */
1566 #if (defined __STDC__ || defined __C99__FUNC__ \
1567 || defined __cplusplus || defined _MSC_VER)
1569 yystrlen (const char *yystr
)
1577 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1585 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1586 # define yystpcpy stpcpy
1588 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1590 #if (defined __STDC__ || defined __C99__FUNC__ \
1591 || defined __cplusplus || defined _MSC_VER)
1593 yystpcpy (char *yydest
, const char *yysrc
)
1596 yystpcpy (yydest
, yysrc
)
1602 const char *yys
= yysrc
;
1604 while ((*yyd
++ = *yys
++) != '\0')
1613 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1614 quotes and backslashes, so that it's suitable for yyerror. The
1615 heuristic is that double-quoting is unnecessary unless the string
1616 contains an apostrophe, a comma, or backslash (other than
1617 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1618 null, do not copy; instead, return the length of what the result
1621 yytnamerr (char *yyres
, const char *yystr
)
1626 char const *yyp
= yystr
;
1633 goto do_not_strip_quotes
;
1637 goto do_not_strip_quotes
;
1650 do_not_strip_quotes
: ;
1654 return yystrlen (yystr
);
1656 return yystpcpy (yyres
, yystr
) - yyres
;
1660 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1661 about the unexpected token YYTOKEN for the state stack whose top is
1662 YYSSP. In order to see if a particular token T is a
1663 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1665 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1666 not large enough to hold the message. In that case, also set
1667 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1668 required number of bytes is too large to store or if
1669 yy_lac returned 2. */
1671 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1672 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1673 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1675 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1676 YYSIZE_T yysize
= yysize0
;
1678 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1679 /* Internationalized format string. */
1680 const char *yyformat
= 0;
1681 /* Arguments of yyformat. */
1682 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1683 /* Number of reported tokens (one for the "unexpected", one per
1687 /* There are many possibilities here to consider:
1688 - Assume YYFAIL is not used. It's too flawed to consider. See
1689 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1690 for details. YYERROR is fine as it does not invoke this
1692 - If this state is a consistent state with a default action, then
1693 the only way this function was invoked is if the default action
1694 is an error action. In that case, don't check for expected
1695 tokens because there are none.
1696 - The only way there can be no lookahead present (in yychar) is if
1697 this state is a consistent state with a default action. Thus,
1698 detecting the absence of a lookahead is sufficient to determine
1699 that there is no unexpected or expected token to report. In that
1700 case, just report a simple "syntax error".
1701 - Don't assume there isn't a lookahead just because this state is a
1702 consistent state with a default action. There might have been a
1703 previous inconsistent state, consistent state with a non-default
1704 action, or user semantic action that manipulated yychar.
1705 In the first two cases, it might appear that the current syntax
1706 error should have been detected in the previous state when yy_lac
1707 was invoked. However, at that time, there might have been a
1708 different syntax error that discarded a different initial context
1709 during error recovery, leaving behind the current lookahead.
1711 if (yytoken
!= YYEMPTY
)
1713 int yyn
= yypact
[*yyssp
];
1714 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1715 yyarg
[yycount
++] = yytname
[yytoken
];
1716 if (!yypact_value_is_default (yyn
))
1720 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1721 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1724 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1726 if (yy_lac_status
== 2)
1728 if (yy_lac_status
== 1)
1731 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1737 yyarg
[yycount
++] = yytname
[yyx
];
1738 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1739 if (! (yysize
<= yysize1
1740 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1747 YYFPRINTF (stderr
, "No expected tokens.\n");
1753 # define YYCASE_(N, S) \
1757 YYCASE_(0, YY_("syntax error"));
1758 YYCASE_(1, YY_("syntax error, unexpected %s"));
1759 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1760 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1761 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1762 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1766 yysize1
= yysize
+ yystrlen (yyformat
);
1767 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1771 if (*yymsg_alloc
< yysize
)
1773 *yymsg_alloc
= 2 * yysize
;
1774 if (! (yysize
<= *yymsg_alloc
1775 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1776 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1780 /* Avoid sprintf, as that infringes on the user's name space.
1781 Don't have undefined behavior even if the translation
1782 produced a string with the wrong number of "%s"s. */
1786 while ((*yyp
= *yyformat
) != '\0')
1787 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1789 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1800 #endif /* YYERROR_VERBOSE */
1802 /*-----------------------------------------------.
1803 | Release the memory associated to this symbol. |
1804 `-----------------------------------------------*/
1807 #if (defined __STDC__ || defined __C99__FUNC__ \
1808 || defined __cplusplus || defined _MSC_VER)
1810 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1813 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1817 YYLTYPE
*yylocationp
;
1821 YYUSE (yylocationp
);
1825 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1836 /* Prevent warnings from -Wmissing-prototypes. */
1837 #ifdef YYPARSE_PARAM
1838 #if defined __STDC__ || defined __cplusplus
1839 int yyparse (void *YYPARSE_PARAM
);
1843 #else /* ! YYPARSE_PARAM */
1844 #if defined __STDC__ || defined __cplusplus
1849 #endif /* ! YYPARSE_PARAM */
1856 #ifdef YYPARSE_PARAM
1857 #if (defined __STDC__ || defined __C99__FUNC__ \
1858 || defined __cplusplus || defined _MSC_VER)
1860 yyparse (void *YYPARSE_PARAM
)
1863 yyparse (YYPARSE_PARAM
)
1864 void *YYPARSE_PARAM
;
1866 #else /* ! YYPARSE_PARAM */
1867 #if (defined __STDC__ || defined __C99__FUNC__ \
1868 || defined __cplusplus || defined _MSC_VER)
1878 /* The lookahead symbol. */
1881 /* The semantic value of the lookahead symbol. */
1884 /* Location data for the lookahead symbol. */
1887 /* Number of syntax errors so far. */
1891 /* Number of tokens to shift before error messages enabled. */
1894 /* The stacks and their tools:
1895 `yyss': related to states.
1896 `yyvs': related to semantic values.
1897 `yyls': related to locations.
1899 Refer to the stacks thru separate pointers, to allow yyoverflow
1900 to reallocate them elsewhere. */
1902 /* The state stack. */
1903 yytype_int16 yyssa
[YYINITDEPTH
];
1905 yytype_int16
*yyssp
;
1907 /* The semantic value stack. */
1908 YYSTYPE yyvsa
[YYINITDEPTH
];
1912 /* The location stack. */
1913 YYLTYPE yylsa
[YYINITDEPTH
];
1917 /* The locations where the error started and ended. */
1918 YYLTYPE yyerror_range
[3];
1920 YYSIZE_T yystacksize
;
1922 yytype_int16 yyesa
[20];
1924 YYSIZE_T yyes_capacity
;
1926 int yy_lac_established
= 0;
1929 /* Lookahead token as an internal (translated) token number. */
1931 /* The variables used to return semantic value and location from the
1937 /* Buffer for error messages, and its allocated size. */
1939 char *yymsg
= yymsgbuf
;
1940 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1943 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1945 /* The number of symbols on the RHS of the reduced rule.
1946 Keep to zero when no symbol should be popped. */
1953 yystacksize
= YYINITDEPTH
;
1956 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1957 if (YYMAXDEPTH
< yyes_capacity
)
1958 yyes_capacity
= YYMAXDEPTH
;
1960 YYDPRINTF ((stderr
, "Starting parse\n"));
1965 yychar
= YYEMPTY
; /* Cause a token to be read. */
1967 /* Initialize stack pointers.
1968 Waste one element of value and location stack
1969 so that they stay on the same level as the state stack.
1970 The wasted elements are never initialized. */
1975 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1976 /* Initialize the default location before parsing starts. */
1977 yylloc
.first_line
= yylloc
.last_line
= 1;
1978 yylloc
.first_column
= yylloc
.last_column
= 1;
1981 /* User initialization code. */
1983 /* Line 1590 of yacc.c */
1984 #line 87 "parse-gram.y"
1986 /* Bison's grammar can initial empty locations, hence a default
1987 location is needed. */
1988 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1989 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1992 /* Line 1590 of yacc.c */
1993 #line 1994 "parse-gram.c"
1998 /*------------------------------------------------------------.
1999 | yynewstate -- Push a new state, which is found in yystate. |
2000 `------------------------------------------------------------*/
2002 /* In all cases, when you get here, the value and location stacks
2003 have just been pushed. So pushing a state here evens the stacks. */
2009 if (yyss
+ yystacksize
- 1 <= yyssp
)
2011 /* Get the current used size of the three stacks, in elements. */
2012 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2016 /* Give user a chance to reallocate the stack. Use copies of
2017 these so that the &'s don't force the real ones into
2019 YYSTYPE
*yyvs1
= yyvs
;
2020 yytype_int16
*yyss1
= yyss
;
2021 YYLTYPE
*yyls1
= yyls
;
2023 /* Each stack pointer address is followed by the size of the
2024 data in use in that stack, in bytes. This used to be a
2025 conditional around just the two extra args, but that might
2026 be undefined if yyoverflow is a macro. */
2027 yyoverflow (YY_("memory exhausted"),
2028 &yyss1
, yysize
* sizeof (*yyssp
),
2029 &yyvs1
, yysize
* sizeof (*yyvsp
),
2030 &yyls1
, yysize
* sizeof (*yylsp
),
2037 #else /* no yyoverflow */
2038 # ifndef YYSTACK_RELOCATE
2039 goto yyexhaustedlab
;
2041 /* Extend the stack our own way. */
2042 if (YYMAXDEPTH
<= yystacksize
)
2043 goto yyexhaustedlab
;
2045 if (YYMAXDEPTH
< yystacksize
)
2046 yystacksize
= YYMAXDEPTH
;
2049 yytype_int16
*yyss1
= yyss
;
2050 union yyalloc
*yyptr
=
2051 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2053 goto yyexhaustedlab
;
2054 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2055 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2056 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2057 # undef YYSTACK_RELOCATE
2059 YYSTACK_FREE (yyss1
);
2062 #endif /* no yyoverflow */
2064 yyssp
= yyss
+ yysize
- 1;
2065 yyvsp
= yyvs
+ yysize
- 1;
2066 yylsp
= yyls
+ yysize
- 1;
2068 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2069 (unsigned long int) yystacksize
));
2071 if (yyss
+ yystacksize
- 1 <= yyssp
)
2075 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2077 if (yystate
== YYFINAL
)
2087 /* Do appropriate processing given the current state. Read a
2088 lookahead token if we need one and don't already have one. */
2090 /* First try to decide what to do without reference to lookahead token. */
2091 yyn
= yypact
[yystate
];
2092 if (yypact_value_is_default (yyn
))
2095 /* Not known => get a lookahead token if don't already have one. */
2097 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2098 if (yychar
== YYEMPTY
)
2100 YYDPRINTF ((stderr
, "Reading a token: "));
2104 if (yychar
<= YYEOF
)
2106 yychar
= yytoken
= YYEOF
;
2107 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2111 yytoken
= YYTRANSLATE (yychar
);
2112 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2115 /* If the proper action on seeing token YYTOKEN is to reduce or to
2116 detect an error, take that action. */
2118 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2126 if (yytable_value_is_error (yyn
))
2133 /* Count tokens shifted since error; after three, turn off error
2138 /* Shift the lookahead token. */
2139 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2141 /* Discard the shifted token. */
2143 YY_LAC_DISCARD ("shift");
2151 /*-----------------------------------------------------------.
2152 | yydefault -- do the default action for the current state. |
2153 `-----------------------------------------------------------*/
2155 yyn
= yydefact
[yystate
];
2161 /*-----------------------------.
2162 | yyreduce -- Do a reduction. |
2163 `-----------------------------*/
2165 /* yyn is the number of a rule to reduce with. */
2168 /* If YYLEN is nonzero, implement the default value of the action:
2171 Otherwise, the following line sets YYVAL to garbage.
2172 This behavior is undocumented and Bison
2173 users should not rely upon it. Assigning to YYVAL
2174 unconditionally makes the parser a bit smaller, and it avoids a
2175 GCC warning that YYVAL may be used uninitialized. */
2176 yyval
= yyvsp
[1-yylen
];
2178 /* Default location. */
2179 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2180 YY_REDUCE_PRINT (yyn
);
2182 int yychar_backup
= yychar
;
2187 /* Line 1806 of yacc.c */
2188 #line 226 "parse-gram.y"
2190 code_props plain_code
;
2191 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
2192 code_props_translate_code (&plain_code
);
2193 gram_scanner_last_string_free ();
2194 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2195 plain_code
.code
, (yylsp
[(1) - (1)]));
2196 code_scanner_last_string_free ();
2202 /* Line 1806 of yacc.c */
2203 #line 235 "parse-gram.y"
2204 { debug_flag
= true; }
2209 /* Line 1806 of yacc.c */
2210 #line 237 "parse-gram.y"
2212 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
),
2213 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2219 /* Line 1806 of yacc.c */
2220 #line 241 "parse-gram.y"
2221 { defines_flag
= true; }
2226 /* Line 1806 of yacc.c */
2227 #line 243 "parse-gram.y"
2229 defines_flag
= true;
2230 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
2236 /* Line 1806 of yacc.c */
2237 #line 247 "parse-gram.y"
2238 { error_verbose
= true; }
2243 /* Line 1806 of yacc.c */
2244 #line 248 "parse-gram.y"
2245 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2250 /* Line 1806 of yacc.c */
2251 #line 249 "parse-gram.y"
2252 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2257 /* Line 1806 of yacc.c */
2258 #line 250 "parse-gram.y"
2259 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
2264 /* Line 1806 of yacc.c */
2265 #line 251 "parse-gram.y"
2266 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
2271 /* Line 1806 of yacc.c */
2272 #line 253 "parse-gram.y"
2274 nondeterministic_parser
= true;
2281 /* Line 1806 of yacc.c */
2282 #line 258 "parse-gram.y"
2285 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
2286 code_props_translate_code (&action
);
2287 gram_scanner_last_string_free ();
2288 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2289 code_scanner_last_string_free ();
2295 /* Line 1806 of yacc.c */
2296 #line 266 "parse-gram.y"
2297 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, (yylsp
[(1) - (2)])); }
2302 /* Line 1806 of yacc.c */
2303 #line 267 "parse-gram.y"
2304 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2309 /* Line 1806 of yacc.c */
2310 #line 268 "parse-gram.y"
2311 { locations_flag
= true; }
2316 /* Line 1806 of yacc.c */
2317 #line 269 "parse-gram.y"
2318 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2323 /* Line 1806 of yacc.c */
2324 #line 270 "parse-gram.y"
2325 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2330 /* Line 1806 of yacc.c */
2331 #line 271 "parse-gram.y"
2332 { no_lines_flag
= true; }
2337 /* Line 1806 of yacc.c */
2338 #line 272 "parse-gram.y"
2339 { nondeterministic_parser
= true; }
2344 /* Line 1806 of yacc.c */
2345 #line 273 "parse-gram.y"
2346 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2351 /* Line 1806 of yacc.c */
2352 #line 274 "parse-gram.y"
2353 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2358 /* Line 1806 of yacc.c */
2359 #line 275 "parse-gram.y"
2360 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2365 /* Line 1806 of yacc.c */
2366 #line 277 "parse-gram.y"
2368 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2369 `%define api.pure' in a backward-compatible manner here. First, don't
2370 complain if %pure-parser is specified multiple times. */
2371 if (!muscle_find_const ("percent_define(api.pure)"))
2372 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2373 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2374 /* In all cases, use api.pure now so that the backend doesn't complain if
2375 the skeleton ignores api.pure, but do warn now if there's a previous
2376 conflicting definition from an actual %define. */
2377 if (!muscle_percent_define_flag_if ("api.pure"))
2378 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2379 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2385 /* Line 1806 of yacc.c */
2386 #line 291 "parse-gram.y"
2387 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2392 /* Line 1806 of yacc.c */
2393 #line 293 "parse-gram.y"
2395 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2396 if (strchr (skeleton_user
, '/'))
2398 size_t dir_length
= strlen (current_file
);
2399 char *skeleton_build
;
2400 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2402 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2405 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2408 strncpy (skeleton_build
, current_file
, dir_length
);
2409 skeleton_build
[dir_length
++] = '/';
2411 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2412 skeleton_user
= uniqstr_new (skeleton_build
);
2413 free (skeleton_build
);
2415 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[(1) - (2)]));
2421 /* Line 1806 of yacc.c */
2422 #line 316 "parse-gram.y"
2423 { token_table_flag
= true; }
2428 /* Line 1806 of yacc.c */
2429 #line 317 "parse-gram.y"
2430 { report_flag
|= report_states
; }
2435 /* Line 1806 of yacc.c */
2436 #line 318 "parse-gram.y"
2437 { yacc_flag
= true; }
2442 /* Line 1806 of yacc.c */
2443 #line 326 "parse-gram.y"
2445 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2451 /* Line 1806 of yacc.c */
2452 #line 330 "parse-gram.y"
2455 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2456 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2457 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2463 /* Line 1806 of yacc.c */
2464 #line 337 "parse-gram.y"
2467 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2468 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2469 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2475 /* Line 1806 of yacc.c */
2476 #line 344 "parse-gram.y"
2478 default_prec
= true;
2484 /* Line 1806 of yacc.c */
2485 #line 348 "parse-gram.y"
2487 default_prec
= false;
2493 /* Line 1806 of yacc.c */
2494 #line 352 "parse-gram.y"
2496 /* Do not invoke muscle_percent_code_grow here since it invokes
2497 muscle_user_name_list_grow. */
2498 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2499 code_scanner_last_string_free ();
2505 /* Line 1806 of yacc.c */
2506 #line 359 "parse-gram.y"
2508 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2509 code_scanner_last_string_free ();
2515 /* Line 1806 of yacc.c */
2516 #line 373 "parse-gram.y"
2522 /* Line 1806 of yacc.c */
2523 #line 374 "parse-gram.y"
2524 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2529 /* Line 1806 of yacc.c */
2530 #line 379 "parse-gram.y"
2533 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2534 code_scanner_last_string_free ();
2540 /* Line 1806 of yacc.c */
2541 #line 390 "parse-gram.y"
2542 { current_class
= nterm_sym
; }
2547 /* Line 1806 of yacc.c */
2548 #line 391 "parse-gram.y"
2550 current_class
= unknown_sym
;
2551 current_type
= NULL
;
2557 /* Line 1806 of yacc.c */
2558 #line 395 "parse-gram.y"
2559 { current_class
= token_sym
; }
2564 /* Line 1806 of yacc.c */
2565 #line 396 "parse-gram.y"
2567 current_class
= unknown_sym
;
2568 current_type
= NULL
;
2574 /* Line 1806 of yacc.c */
2575 #line 401 "parse-gram.y"
2579 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2580 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2581 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2587 /* Line 1806 of yacc.c */
2588 #line 412 "parse-gram.y"
2592 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2594 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2595 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2597 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2598 current_type
= NULL
;
2604 /* Line 1806 of yacc.c */
2605 #line 426 "parse-gram.y"
2606 { (yyval
.assoc
) = left_assoc
; }
2611 /* Line 1806 of yacc.c */
2612 #line 427 "parse-gram.y"
2613 { (yyval
.assoc
) = right_assoc
; }
2618 /* Line 1806 of yacc.c */
2619 #line 428 "parse-gram.y"
2620 { (yyval
.assoc
) = non_assoc
; }
2625 /* Line 1806 of yacc.c */
2626 #line 432 "parse-gram.y"
2627 { current_type
= NULL
; }
2632 /* Line 1806 of yacc.c */
2633 #line 433 "parse-gram.y"
2634 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2639 /* Line 1806 of yacc.c */
2640 #line 439 "parse-gram.y"
2641 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2646 /* Line 1806 of yacc.c */
2647 #line 441 "parse-gram.y"
2648 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2653 /* Line 1806 of yacc.c */
2654 #line 445 "parse-gram.y"
2655 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2660 /* Line 1806 of yacc.c */
2661 #line 446 "parse-gram.y"
2662 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2667 /* Line 1806 of yacc.c */
2668 #line 452 "parse-gram.y"
2669 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2674 /* Line 1806 of yacc.c */
2675 #line 454 "parse-gram.y"
2676 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2681 /* Line 1806 of yacc.c */
2682 #line 458 "parse-gram.y"
2683 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2688 /* Line 1806 of yacc.c */
2689 #line 459 "parse-gram.y"
2690 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2695 /* Line 1806 of yacc.c */
2696 #line 463 "parse-gram.y"
2697 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2702 /* Line 1806 of yacc.c */
2703 #line 464 "parse-gram.y"
2704 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2709 /* Line 1806 of yacc.c */
2710 #line 465 "parse-gram.y"
2711 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2716 /* Line 1806 of yacc.c */
2717 #line 466 "parse-gram.y"
2718 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2723 /* Line 1806 of yacc.c */
2724 #line 472 "parse-gram.y"
2726 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2733 /* Line 1806 of yacc.c */
2734 #line 477 "parse-gram.y"
2736 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2737 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2743 /* Line 1806 of yacc.c */
2744 #line 482 "parse-gram.y"
2746 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2747 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2748 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2754 /* Line 1806 of yacc.c */
2755 #line 488 "parse-gram.y"
2757 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2758 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2759 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2765 /* Line 1806 of yacc.c */
2766 #line 494 "parse-gram.y"
2768 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2769 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2770 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2771 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2777 /* Line 1806 of yacc.c */
2778 #line 524 "parse-gram.y"
2786 /* Line 1806 of yacc.c */
2787 #line 530 "parse-gram.y"
2788 { current_lhs
= (yyvsp
[(1) - (2)].symbol
); current_lhs_location
= (yylsp
[(1) - (2)]);
2789 current_lhs_named_ref
= (yyvsp
[(2) - (2)].named_ref
); }
2794 /* Line 1806 of yacc.c */
2795 #line 535 "parse-gram.y"
2796 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2801 /* Line 1806 of yacc.c */
2802 #line 536 "parse-gram.y"
2803 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2808 /* Line 1806 of yacc.c */
2809 #line 542 "parse-gram.y"
2810 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2811 current_lhs_named_ref
); }
2816 /* Line 1806 of yacc.c */
2817 #line 545 "parse-gram.y"
2818 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (3)].symbol
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2823 /* Line 1806 of yacc.c */
2824 #line 547 "parse-gram.y"
2825 { grammar_current_rule_action_append ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2830 /* Line 1806 of yacc.c */
2831 #line 549 "parse-gram.y"
2832 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2837 /* Line 1806 of yacc.c */
2838 #line 551 "parse-gram.y"
2839 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2844 /* Line 1806 of yacc.c */
2845 #line 553 "parse-gram.y"
2846 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2851 /* Line 1806 of yacc.c */
2852 #line 557 "parse-gram.y"
2853 { (yyval
.named_ref
) = 0; }
2858 /* Line 1806 of yacc.c */
2859 #line 559 "parse-gram.y"
2860 { (yyval
.named_ref
) = named_ref_new((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2865 /* Line 1806 of yacc.c */
2866 #line 571 "parse-gram.y"
2867 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2872 /* Line 1806 of yacc.c */
2873 #line 576 "parse-gram.y"
2874 { (yyval
.chars
) = ""; }
2879 /* Line 1806 of yacc.c */
2880 #line 577 "parse-gram.y"
2881 { (yyval
.chars
) = (yyvsp
[(1) - (1)].uniqstr
); }
2886 /* Line 1806 of yacc.c */
2887 #line 588 "parse-gram.y"
2889 code_props plain_code
;
2890 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2891 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2892 code_props_translate_code (&plain_code
);
2893 gram_scanner_last_string_free ();
2894 (yyval
.chars
) = plain_code
.code
;
2900 /* Line 1806 of yacc.c */
2901 #line 608 "parse-gram.y"
2902 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2907 /* Line 1806 of yacc.c */
2908 #line 610 "parse-gram.y"
2910 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2911 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2912 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2918 /* Line 1806 of yacc.c */
2919 #line 618 "parse-gram.y"
2920 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2925 /* Line 1806 of yacc.c */
2926 #line 630 "parse-gram.y"
2928 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2929 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2935 /* Line 1806 of yacc.c */
2936 #line 639 "parse-gram.y"
2938 code_props plain_code
;
2939 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2940 code_props_translate_code (&plain_code
);
2941 gram_scanner_last_string_free ();
2942 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2943 code_scanner_last_string_free ();
2949 /* Line 1806 of yacc.c */
2950 #line 2951 "parse-gram.c"
2953 if (yychar_backup
!= yychar
)
2954 YY_LAC_DISCARD ("yychar change");
2956 /* User semantic actions sometimes alter yychar, and that requires
2957 that yytoken be updated with the new translation. We take the
2958 approach of translating immediately before every use of yytoken.
2959 One alternative is translating here after every semantic action,
2960 but that translation would be missed if the semantic action invokes
2961 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2962 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2963 incorrect destructor might then be invoked immediately. In the
2964 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2965 to an incorrect destructor call or verbose syntax error message
2966 before the lookahead is translated. */
2967 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2971 YY_STACK_PRINT (yyss
, yyssp
);
2976 /* Now `shift' the result of the reduction. Determine what state
2977 that goes to, based on the state we popped back to and the rule
2978 number reduced by. */
2982 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2983 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2984 yystate
= yytable
[yystate
];
2986 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2991 /*------------------------------------.
2992 | yyerrlab -- here on detecting error |
2993 `------------------------------------*/
2995 /* Make sure we have latest lookahead translation. See comments at
2996 user semantic actions for why this is necessary. */
2997 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2999 /* If not already recovering from an error, report this error. */
3003 #if ! YYERROR_VERBOSE
3004 yyerror (YY_("syntax error"));
3006 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3007 yyesa, &yyes, &yyes_capacity, \
3010 char const *yymsgp
= YY_("syntax error");
3011 int yysyntax_error_status
;
3012 if (yychar
!= YYEMPTY
)
3014 yysyntax_error_status
= YYSYNTAX_ERROR
;
3015 if (yysyntax_error_status
== 0)
3017 else if (yysyntax_error_status
== 1)
3019 if (yymsg
!= yymsgbuf
)
3020 YYSTACK_FREE (yymsg
);
3021 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3025 yymsg_alloc
= sizeof yymsgbuf
;
3026 yysyntax_error_status
= 2;
3030 yysyntax_error_status
= YYSYNTAX_ERROR
;
3035 if (yysyntax_error_status
== 2)
3036 goto yyexhaustedlab
;
3038 # undef YYSYNTAX_ERROR
3042 yyerror_range
[1] = yylloc
;
3044 if (yyerrstatus
== 3)
3046 /* If just tried and failed to reuse lookahead token after an
3047 error, discard it. */
3049 if (yychar
<= YYEOF
)
3051 /* Return failure if at end of input. */
3052 if (yychar
== YYEOF
)
3057 yydestruct ("Error: discarding",
3058 yytoken
, &yylval
, &yylloc
);
3063 /* Else will try to reuse lookahead token after shifting the error
3068 /*---------------------------------------------------.
3069 | yyerrorlab -- error raised explicitly by YYERROR. |
3070 `---------------------------------------------------*/
3073 /* Pacify compilers like GCC when the user code never invokes
3074 YYERROR and the label yyerrorlab therefore never appears in user
3076 if (/*CONSTCOND*/ 0)
3079 yyerror_range
[1] = yylsp
[1-yylen
];
3080 /* Do not reclaim the symbols of the rule which action triggered
3084 YY_STACK_PRINT (yyss
, yyssp
);
3089 /*-------------------------------------------------------------.
3090 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3091 `-------------------------------------------------------------*/
3093 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3097 yyn
= yypact
[yystate
];
3098 if (!yypact_value_is_default (yyn
))
3101 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3109 /* Pop the current state because it cannot handle the error token. */
3113 yyerror_range
[1] = *yylsp
;
3114 yydestruct ("Error: popping",
3115 yystos
[yystate
], yyvsp
, yylsp
);
3118 YY_STACK_PRINT (yyss
, yyssp
);
3121 /* If the stack popping above didn't lose the initial context for the
3122 current lookahead token, the shift below will for sure. */
3123 YY_LAC_DISCARD ("error recovery");
3127 yyerror_range
[2] = yylloc
;
3128 /* Using YYLLOC is tempting, but would change the location of
3129 the lookahead. YYLOC is available though. */
3130 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3133 /* Shift the error token. */
3134 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3140 /*-------------------------------------.
3141 | yyacceptlab -- YYACCEPT comes here. |
3142 `-------------------------------------*/
3147 /*-----------------------------------.
3148 | yyabortlab -- YYABORT comes here. |
3149 `-----------------------------------*/
3155 /*-------------------------------------------------.
3156 | yyexhaustedlab -- memory exhaustion comes here. |
3157 `-------------------------------------------------*/
3159 yyerror (YY_("memory exhausted"));
3165 if (yychar
!= YYEMPTY
)
3167 /* Make sure we have latest lookahead translation. See comments at
3168 user semantic actions for why this is necessary. */
3169 yytoken
= YYTRANSLATE (yychar
);
3170 yydestruct ("Cleanup: discarding lookahead",
3171 yytoken
, &yylval
, &yylloc
);
3173 /* Do not reclaim the symbols of the rule which action triggered
3174 this YYABORT or YYACCEPT. */
3176 YY_STACK_PRINT (yyss
, yyssp
);
3177 while (yyssp
!= yyss
)
3179 yydestruct ("Cleanup: popping",
3180 yystos
[*yyssp
], yyvsp
, yylsp
);
3185 YYSTACK_FREE (yyss
);
3188 YYSTACK_FREE (yyes
);
3190 if (yymsg
!= yymsgbuf
)
3191 YYSTACK_FREE (yymsg
);
3193 /* Make sure YYID is used. */
3194 return YYID (yyresult
);
3199 /* Line 2067 of yacc.c */
3200 #line 649 "parse-gram.y"
3204 /* Return the location of the left-hand side of a rule whose
3205 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3206 the right-hand side, and return an empty location equal to the end
3207 boundary of RHS[0] if the right-hand side is empty. */
3210 lloc_default (YYLTYPE
const *rhs
, int n
)
3215 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3216 The bug is fixed in 7.4.2m, but play it safe for now. */
3217 loc
.start
= rhs
[n
].end
;
3218 loc
.end
= rhs
[n
].end
;
3220 /* Ignore empty nonterminals the start of the the right-hand side.
3221 Do not bother to ignore them at the end of the right-hand side,
3222 since empty nonterminals have the same end as their predecessors. */
3223 for (i
= 1; i
<= n
; i
++)
3224 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3226 loc
.start
= rhs
[i
].start
;
3234 /* Add a lex-param or a parse-param (depending on TYPE) with
3235 declaration DECL and location LOC. */
3238 add_param (char const *type
, char *decl
, location loc
)
3240 static char const alphanum
[26 + 26 + 1 + 10] =
3241 "abcdefghijklmnopqrstuvwxyz"
3242 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3245 char const *name_start
= NULL
;
3248 /* Stop on last actual character. */
3249 for (p
= decl
; p
[1]; p
++)
3251 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3252 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3255 /* Strip the surrounding '{' and '}', and any blanks just inside
3257 while (*--p
== ' ' || *p
== '\t')
3260 while (*++decl
== ' ' || *decl
== '\t')
3264 complain_at (loc
, _("missing identifier in parameter declaration"));
3271 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3275 name
= xmalloc (name_len
+ 1);
3276 memcpy (name
, name_start
, name_len
);
3277 name
[name_len
] = '\0';
3278 muscle_pair_list_grow (type
, decl
, name
);
3282 gram_scanner_last_string_free ();
3287 version_check (location
const *loc
, char const *version
)
3289 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3291 complain_at (*loc
, "require bison %s, but have %s",
3292 version
, PACKAGE_VERSION
);
3298 gram_error (location
const *loc
, char const *msg
)
3300 complain_at (*loc
, "%s", msg
);
3304 token_name (int type
)
3306 return yytname
[YYTRANSLATE (type
)];
3317 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3318 return quotearg_style (escape_quoting_style
, buf
);