1 /* A Bison parser, made by GNU Bison 2.4.1.206-8a8b-dirty. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2010 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.4.1.206-8a8b-dirty"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 1
64 /* Substitute the variable and function names. */
65 #define yyparse gram_parse
66 #define yylex gram_lex
67 #define yyerror gram_error
68 #define yylval gram_lval
69 #define yychar gram_char
70 #define yydebug gram_debug
71 #define yynerrs gram_nerrs
72 #define yylloc gram_lloc
74 /* Copy the first part of user declarations. */
76 /* Line 251 of yacc.c */
77 #line 1 "parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
80 Copyright (C) 2002-2010 Free Software Foundation, Inc.
82 This file is part of Bison, the GNU Compiler Compiler.
84 This program is free software: you can redistribute it and/or modify
85 it under the terms of the GNU General Public License as published by
86 the Free Software Foundation, either version 3 of the License, or
87 (at your option) any later version.
89 This program is distributed in the hope that it will be useful,
90 but WITHOUT ANY WARRANTY; without even the implied warranty of
91 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92 GNU General Public License for more details.
94 You should have received a copy of the GNU General Public License
95 along with this program. If not, see <http://www.gnu.org/licenses/>. */
100 #include "complain.h"
101 #include "conflicts.h"
105 #include "muscle-tab.h"
106 #include "named-ref.h"
107 #include "quotearg.h"
110 #include "scan-gram.h"
111 #include "scan-code.h"
113 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
114 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
116 #define YY_LOCATION_PRINT(File, Loc) \
117 location_print (File, Loc)
119 static void version_check (location
const *loc
, char const *version
);
121 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
122 FIXME: depends on the undocumented availability of YYLLOC. */
124 #define yyerror(Msg) \
125 gram_error (&yylloc, Msg)
126 static void gram_error (location
const *, char const *);
128 static char const *char_name (char);
130 /** Add a lex-param or a parse-param.
132 * \param type \a lex_param or \a parse_param
133 * \param decl the formal argument
134 * \param loc the location in the source.
136 static void add_param (char const *type
, char *decl
, location loc
);
139 static symbol_class current_class
= unknown_sym
;
140 static uniqstr current_type
= NULL
;
141 static symbol
*current_lhs
;
142 static location current_lhs_location
;
143 static named_ref
*current_lhs_named_ref
;
144 static int current_prec
= 0;
146 #define YYTYPE_INT16 int_fast16_t
147 #define YYTYPE_INT8 int_fast8_t
148 #define YYTYPE_UINT16 uint_fast16_t
149 #define YYTYPE_UINT8 uint_fast8_t
152 /* Line 251 of yacc.c */
153 #line 154 "parse-gram.c"
155 /* Enabling traces. */
160 /* Enabling verbose error messages. */
161 #ifdef YYERROR_VERBOSE
162 # undef YYERROR_VERBOSE
163 # define YYERROR_VERBOSE 1
165 # define YYERROR_VERBOSE 1
168 /* Enabling the token table. */
169 #ifndef YYTOKEN_TABLE
170 # define YYTOKEN_TABLE 0
177 /* Put the tokens into the symbol table, so that GDB and other debuggers
186 PERCENT_DESTRUCTOR
= 263,
187 PERCENT_PRINTER
= 264,
190 PERCENT_NONASSOC
= 267,
196 PERCENT_DEFAULT_PREC
= 273,
197 PERCENT_DEFINE
= 274,
198 PERCENT_DEFINES
= 275,
199 PERCENT_ERROR_VERBOSE
= 276,
200 PERCENT_EXPECT
= 277,
201 PERCENT_EXPECT_RR
= 278,
202 PERCENT_FILE_PREFIX
= 279,
203 PERCENT_GLR_PARSER
= 280,
204 PERCENT_INITIAL_ACTION
= 281,
205 PERCENT_LANGUAGE
= 282,
206 PERCENT_LEX_PARAM
= 283,
207 PERCENT_LOCATIONS
= 284,
208 PERCENT_NAME_PREFIX
= 285,
209 PERCENT_NO_DEFAULT_PREC
= 286,
210 PERCENT_NO_LINES
= 287,
211 PERCENT_NONDETERMINISTIC_PARSER
= 288,
212 PERCENT_OUTPUT
= 289,
213 PERCENT_PARSE_PARAM
= 290,
214 PERCENT_PURE_PARSER
= 291,
215 PERCENT_REQUIRE
= 292,
216 PERCENT_SKELETON
= 293,
218 PERCENT_TOKEN_TABLE
= 295,
219 PERCENT_VERBOSE
= 296,
228 PERCENT_PERCENT
= 305,
242 #define PERCENT_TOKEN 260
243 #define PERCENT_NTERM 261
244 #define PERCENT_TYPE 262
245 #define PERCENT_DESTRUCTOR 263
246 #define PERCENT_PRINTER 264
247 #define PERCENT_LEFT 265
248 #define PERCENT_RIGHT 266
249 #define PERCENT_NONASSOC 267
250 #define PERCENT_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
281 #define BRACKETED_ID 299
287 #define PERCENT_PERCENT 305
290 #define SEMICOLON 308
292 #define TYPE_TAG_ANY 310
293 #define TYPE_TAG_NONE 311
294 #define PERCENT_UNION 312
299 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
300 typedef union YYSTYPE
303 /* Line 276 of yacc.c */
304 #line 93 "parse-gram.y"
313 unsigned char character
;
314 named_ref
*named_ref
;
318 /* Line 276 of yacc.c */
319 #line 320 "parse-gram.c"
321 # define YYSTYPE_IS_TRIVIAL 1
322 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
323 # define YYSTYPE_IS_DECLARED 1
326 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
327 typedef struct YYLTYPE
334 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
335 # define YYLTYPE_IS_DECLARED 1
336 # define YYLTYPE_IS_TRIVIAL 1
340 /* Copy the second part of user declarations. */
343 /* Line 326 of yacc.c */
344 #line 345 "parse-gram.c"
351 typedef YYTYPE_UINT8 yytype_uint8
;
353 typedef unsigned char yytype_uint8
;
357 typedef YYTYPE_INT8 yytype_int8
;
358 #elif (defined __STDC__ || defined __C99__FUNC__ \
359 || defined __cplusplus || defined _MSC_VER)
360 typedef signed char yytype_int8
;
362 typedef short int yytype_int8
;
366 typedef YYTYPE_UINT16 yytype_uint16
;
368 typedef unsigned short int yytype_uint16
;
372 typedef YYTYPE_INT16 yytype_int16
;
374 typedef short int yytype_int16
;
378 # ifdef __SIZE_TYPE__
379 # define YYSIZE_T __SIZE_TYPE__
380 # elif defined size_t
381 # define YYSIZE_T size_t
382 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
385 # define YYSIZE_T size_t
387 # define YYSIZE_T unsigned int
391 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
394 # if defined YYENABLE_NLS && YYENABLE_NLS
396 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
397 # define YY_(msgid) dgettext ("bison-runtime", msgid)
401 # define YY_(msgid) msgid
405 /* Suppress unused-variable warnings by "using" E. */
406 #if ! defined lint || defined __GNUC__
407 # define YYUSE(e) ((void) (e))
409 # define YYUSE(e) /* empty */
412 /* Identity function, used to suppress warnings about constant conditions. */
416 #if (defined __STDC__ || defined __C99__FUNC__ \
417 || defined __cplusplus || defined _MSC_VER)
430 #if ! defined yyoverflow || YYERROR_VERBOSE
432 /* The parser invokes alloca or malloc; define the necessary symbols. */
434 # ifdef YYSTACK_USE_ALLOCA
435 # if YYSTACK_USE_ALLOCA
437 # define YYSTACK_ALLOC __builtin_alloca
438 # elif defined __BUILTIN_VA_ARG_INCR
439 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
441 # define YYSTACK_ALLOC __alloca
442 # elif defined _MSC_VER
443 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
444 # define alloca _alloca
446 # define YYSTACK_ALLOC alloca
447 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
448 || defined __cplusplus || defined _MSC_VER)
449 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
458 # ifdef YYSTACK_ALLOC
459 /* Pacify GCC's `empty if-body' warning. */
460 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
461 # ifndef YYSTACK_ALLOC_MAXIMUM
462 /* The OS might guarantee only one guard page at the bottom of the stack,
463 and a page size can be as small as 4096 bytes. So we cannot safely
464 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
465 to allow for a few compiler-allocated temporary stack slots. */
466 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
469 # define YYSTACK_ALLOC YYMALLOC
470 # define YYSTACK_FREE YYFREE
471 # ifndef YYSTACK_ALLOC_MAXIMUM
472 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
474 # if (defined __cplusplus && ! defined _STDLIB_H \
475 && ! ((defined YYMALLOC || defined malloc) \
476 && (defined YYFREE || defined free)))
477 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
483 # define YYMALLOC malloc
484 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
485 || defined __cplusplus || defined _MSC_VER)
486 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
491 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
492 || defined __cplusplus || defined _MSC_VER)
493 void free (void *); /* INFRINGES ON USER NAME SPACE */
497 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
500 #if (! defined yyoverflow \
501 && (! defined __cplusplus \
502 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
503 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
505 /* A type that is properly aligned for any stack member. */
508 yytype_int16 yyss_alloc
;
513 /* The size of the maximum gap between one aligned stack and the next. */
514 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
516 /* The size of an array large to enough to hold all stacks, each with
518 # define YYSTACK_BYTES(N) \
519 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
520 + 2 * YYSTACK_GAP_MAXIMUM)
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]; \
540 /* Relocate STACK from its old location to the new one. The
541 local variables YYSIZE and YYSTACKSIZE give the old and new number of
542 elements in the stack, and YYPTR gives the new location of the
543 stack. Advance YYPTR to a properly aligned location for the next
545 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
548 YYSIZE_T yynewbytes; \
549 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
550 Stack = &yyptr->Stack_alloc; \
551 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
552 yyptr += yynewbytes / sizeof (*yyptr); \
558 /* YYFINAL -- State number of the termination state. */
560 /* YYLAST -- Last index in YYTABLE. */
563 /* YYNTOKENS -- Number of terminals. */
565 /* YYNNTS -- Number of nonterminals. */
567 /* YYNRULES -- Number of rules. */
569 /* YYNRULES -- Number of states. */
570 #define YYNSTATES 148
572 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
574 #define YYMAXUTOK 312
576 #define YYTRANSLATE(YYX) \
577 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
579 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
580 static const yytype_uint8 yytranslate
[] =
582 0, 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, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
608 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
609 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
610 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
611 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
612 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
617 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
619 static const yytype_uint16 yyprhs
[] =
621 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
622 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
623 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
624 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
625 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
626 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
627 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
628 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
629 206, 209, 212, 213, 218, 220, 224, 227, 228, 232,
630 236, 240, 244, 248, 249, 251, 253, 255, 256, 258,
631 260, 262, 264, 266, 268, 270, 272, 274, 275
634 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
635 static const yytype_int8 yyrhs
[] =
637 59, 0, -1, 60, 50, 77, 91, -1, -1, 60,
638 61, -1, 62, -1, 52, -1, 17, -1, 19, 84,
639 85, -1, 20, -1, 20, 3, -1, 21, -1, 22,
640 4, -1, 23, 4, -1, 24, 3, -1, 24, 47,
641 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
642 28, 43, -1, 29, -1, 30, 3, -1, 30, 47,
643 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
644 47, 3, -1, 35, 43, -1, 36, -1, 37, 3,
645 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
646 53, -1, 67, -1, 64, -1, 39, 89, -1, 8,
647 43, 73, -1, 9, 43, 73, -1, 18, -1, 31,
648 -1, 16, 86, -1, 16, 48, 86, -1, -1, 48,
649 -1, 57, 63, 86, -1, -1, 6, 65, 76, -1,
650 -1, 5, 66, 76, -1, 7, 54, 72, -1, 68,
651 69, 70, -1, 10, -1, 11, -1, 12, -1, -1,
652 54, -1, 71, -1, 70, 71, -1, 89, -1, 89,
653 4, -1, 89, -1, 72, 89, -1, 74, -1, 73,
654 74, -1, 89, -1, 54, -1, 55, -1, 56, -1,
655 54, -1, 87, -1, 87, 4, -1, 87, 90, -1,
656 87, 4, 90, -1, 75, -1, 76, 75, -1, 78,
657 -1, 77, 78, -1, 79, -1, 62, 53, -1, 1,
658 53, -1, -1, 88, 83, 80, 81, -1, 82, -1,
659 81, 51, 82, -1, 81, 53, -1, -1, 82, 89,
660 83, -1, 82, 43, 83, -1, 82, 13, 89, -1,
661 82, 14, 4, -1, 82, 15, 54, -1, -1, 44,
662 -1, 48, -1, 3, -1, -1, 48, -1, 3, -1,
663 43, -1, 48, -1, 45, -1, 49, -1, 87, -1,
664 90, -1, 3, -1, -1, 50, 46, -1
667 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
668 static const yytype_uint16 yyrline
[] =
670 0, 208, 208, 216, 218, 222, 223, 233, 234, 239,
671 240, 245, 246, 247, 248, 249, 250, 255, 264, 265,
672 266, 267, 268, 269, 270, 271, 272, 273, 274, 289,
673 290, 314, 315, 316, 317, 321, 322, 323, 327, 334,
674 341, 345, 349, 356, 371, 372, 376, 388, 388, 393,
675 393, 398, 409, 424, 425, 426, 430, 431, 436, 438,
676 443, 444, 449, 451, 456, 457, 461, 462, 463, 464,
677 469, 474, 479, 485, 491, 502, 503, 512, 513, 519,
678 520, 521, 528, 528, 533, 534, 535, 540, 542, 544,
679 546, 548, 550, 555, 557, 568, 569, 574, 575, 576,
680 585, 605, 607, 616, 621, 622, 627, 634, 636
684 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
685 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
686 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
687 static const char *const yytname
[] =
689 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
690 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
691 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
692 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
693 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
694 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
695 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
696 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
697 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
698 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
699 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
700 "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"", "\"=\"",
701 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
702 "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
703 "input", "prologue_declarations", "prologue_declaration",
704 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
705 "precedence_declaration", "precedence_declarator", "type.opt",
706 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
707 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
708 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
709 "named_ref.opt", "variable", "content.opt", "braceless", "id",
710 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
715 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
717 static const yytype_uint16 yytoknum
[] =
719 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
720 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
721 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
722 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
723 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
724 305, 306, 307, 308, 309, 310, 311, 312
728 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
729 static const yytype_uint8 yyr1
[] =
731 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
732 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
733 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
734 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
735 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
736 64, 64, 67, 68, 68, 68, 69, 69, 70, 70,
737 71, 71, 72, 72, 73, 73, 74, 74, 74, 74,
738 75, 75, 75, 75, 75, 76, 76, 77, 77, 78,
739 78, 78, 80, 79, 81, 81, 81, 82, 82, 82,
740 82, 82, 82, 83, 83, 84, 84, 85, 85, 85,
741 86, 87, 87, 88, 89, 89, 90, 91, 91
744 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
745 static const yytype_uint8 yyr2
[] =
747 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
748 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
749 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
750 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
751 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
752 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
753 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
754 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
755 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
756 3, 3, 3, 0, 1, 1, 1, 0, 1, 1,
757 1, 1, 1, 1, 1, 1, 1, 0, 2
760 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
761 Performed when YYTABLE doesn't specify something else to do. Zero
762 means the default is an error. */
763 static const yytype_uint8 yydefact
[] =
765 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
766 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
767 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
768 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
769 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
770 0, 0, 0, 100, 0, 42, 96, 95, 97, 10,
771 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
772 0, 27, 29, 30, 106, 102, 101, 104, 37, 105,
773 0, 103, 0, 0, 77, 79, 93, 45, 0, 57,
774 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
775 69, 38, 64, 66, 39, 43, 99, 98, 8, 15,
776 22, 26, 81, 80, 0, 78, 2, 94, 82, 46,
777 52, 58, 60, 76, 72, 73, 63, 65, 108, 87,
778 59, 61, 74, 83, 84, 87, 86, 0, 0, 0,
779 93, 93, 85, 90, 91, 92, 89, 88
782 /* YYDEFGOTO[NTERM-NUM]. */
783 static const yytype_int16 yydefgoto
[] =
785 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
786 47, 90, 120, 121, 96, 101, 102, 92, 93, 83,
787 84, 85, 129, 133, 134, 118, 58, 108, 55, 77,
791 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
793 #define YYPACT_NINF -91
794 static const yytype_int16 yypact
[] =
796 -91, 3, 103, -91, -91, -91, -36, 2, 10, -91,
797 -91, -91, 9, -91, -91, 32, 60, -91, 65, 67,
798 27, -91, 41, 73, 51, -91, 39, -91, -91, -91,
799 40, 52, -91, 93, 95, 33, -91, -91, -91, 15,
800 -91, -91, 53, -91, -91, -91, -91, 46, 43, 43,
801 33, 11, 11, -91, 61, -91, -91, -91, 35, -91,
802 -91, -91, -91, 100, -91, -91, -91, -91, 102, -91,
803 113, -91, -91, -91, -91, -91, -91, -91, -91, -91,
804 64, -91, 94, 1, -91, -91, 62, -91, 61, -91,
805 33, -91, -91, 43, 86, 43, 33, -91, -91, -91,
806 -91, 11, -91, -91, 11, -91, -91, -91, -91, -91,
807 -91, -91, -91, -91, 72, -91, -91, -91, -91, -91,
808 33, -91, 142, -91, 145, -91, -91, -91, -91, -91,
809 -91, -91, -91, 17, 34, -91, -91, 33, 146, 97,
810 62, 62, 34, -91, -91, -91, -91, -91
813 /* YYPGOTO[NTERM-NUM]. */
814 static const yytype_int16 yypgoto
[] =
816 -91, -91, -91, -91, 147, -91, -91, -91, -91, -91,
817 -91, -91, -91, 37, -91, 106, -60, -33, 105, -91,
818 69, -91, -91, -91, 24, -48, -91, -91, -49, -20,
822 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
823 positive, shift that token. If negative, reduce the rule which
824 number is the opposite. If YYTABLE_NINF, syntax error. */
825 #define YYTABLE_NINF -108
826 static const yytype_int16 yytable
[] =
828 78, -107, 80, 3, 125, 105, 4, 5, 6, 7,
829 8, 9, 10, 11, 74, 97, 80, 12, 50, 14,
830 4, 5, 6, 7, 8, 9, 10, 11, 94, 94,
831 62, 12, 27, 14, 132, 56, 74, 74, 106, 119,
832 35, 127, 67, 69, 127, 51, 27, 137, 138, 139,
833 81, 114, 53, 52, 35, 122, 75, 54, 42, 76,
834 123, 126, 123, 59, 81, 98, 99, 100, 135, 60,
835 136, 61, 42, 94, 63, 94, 65, 140, 75, 75,
836 57, 76, 76, 107, 64, 122, 68, 70, 75, 74,
837 124, 76, 146, 147, 66, 71, 72, 91, 73, 141,
838 89, 87, 143, 109, 53, 110, 117, 141, 4, 5,
839 6, 7, 8, 9, 10, 11, 111, 112, 128, 12,
840 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
841 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
842 33, 34, 35, 36, 37, 38, 131, 113, 74, 44,
843 144, 145, 115, 39, 95, 40, 41, 130, 104, 142,
847 #define yypact_value_is_default(yystate) \
850 #define yytable_value_is_error(yytable_value) \
853 static const yytype_uint8 yycheck
[] =
855 35, 0, 1, 0, 94, 54, 5, 6, 7, 8,
856 9, 10, 11, 12, 3, 50, 1, 16, 54, 18,
857 5, 6, 7, 8, 9, 10, 11, 12, 48, 49,
858 3, 16, 31, 18, 124, 3, 3, 3, 3, 88,
859 39, 101, 3, 3, 104, 43, 31, 13, 14, 15,
860 49, 50, 43, 43, 39, 90, 45, 48, 57, 48,
861 93, 96, 95, 3, 49, 54, 55, 56, 51, 4,
862 53, 4, 57, 93, 47, 95, 3, 43, 45, 45,
863 48, 48, 48, 48, 43, 120, 47, 47, 45, 3,
864 4, 48, 140, 141, 43, 43, 3, 54, 3, 134,
865 54, 48, 137, 3, 43, 3, 44, 142, 5, 6,
866 7, 8, 9, 10, 11, 12, 3, 53, 46, 16,
867 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
868 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
869 37, 38, 39, 40, 41, 42, 4, 53, 3, 2,
870 4, 54, 83, 50, 49, 52, 53, 120, 52, 135,
874 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
875 symbol of state STATE-NUM. */
876 static const yytype_uint8 yystos
[] =
878 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
879 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
880 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
881 34, 35, 36, 37, 38, 39, 40, 41, 42, 50,
882 52, 53, 57, 61, 62, 64, 67, 68, 66, 65,
883 54, 43, 43, 43, 48, 86, 3, 48, 84, 3,
884 4, 4, 3, 47, 43, 3, 43, 3, 47, 3,
885 47, 43, 3, 3, 3, 45, 48, 87, 89, 90,
886 1, 49, 62, 77, 78, 79, 88, 48, 63, 54,
887 69, 54, 75, 76, 87, 76, 72, 89, 54, 55,
888 56, 73, 74, 89, 73, 86, 3, 48, 85, 3,
889 3, 3, 53, 53, 50, 78, 91, 44, 83, 86,
890 70, 71, 89, 75, 4, 90, 89, 74, 46, 80,
891 71, 4, 90, 81, 82, 51, 53, 13, 14, 15,
892 43, 89, 82, 89, 4, 54, 83, 83
895 #define yyerrok (yyerrstatus = 0)
896 #define yyclearin (yychar = YYEMPTY)
900 #define YYACCEPT goto yyacceptlab
901 #define YYABORT goto yyabortlab
902 #define YYERROR goto yyerrorlab
905 /* Like YYERROR except do call yyerror. This remains here temporarily
906 to ease the transition to the new meaning of YYERROR, for GCC.
907 Once GCC version 2 has supplanted version 1, this can go. However,
908 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
909 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
912 #define YYFAIL goto yyerrlab
914 /* This is here to suppress warnings from the GCC cpp's
915 -Wunused-macros. Normally we don't worry about that warning, but
916 some users do, and we want to make it easy for users to remove
917 YYFAIL uses, which will produce warnings from Bison 2.5. */
920 #define YYRECOVERING() (!!yyerrstatus)
922 #define YYBACKUP(Token, Value) \
924 if (yychar == YYEMPTY && yylen == 1) \
933 yyerror (YY_("syntax error: cannot back up")); \
940 #define YYERRCODE 256
943 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
944 If N is 0, then set CURRENT to the empty location which ends
945 the previous symbol: RHS[0] (always defined). */
947 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
948 #ifndef YYLLOC_DEFAULT
949 # define YYLLOC_DEFAULT(Current, Rhs, N) \
953 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
954 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
955 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
956 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
960 (Current).first_line = (Current).last_line = \
961 YYRHSLOC (Rhs, 0).last_line; \
962 (Current).first_column = (Current).last_column = \
963 YYRHSLOC (Rhs, 0).last_column; \
969 /* YY_LOCATION_PRINT -- Print the location on the stream.
970 This macro was not mandated originally: define only if we know
971 we won't break user code: when these are the locations we know. */
973 #ifndef YY_LOCATION_PRINT
974 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
975 # define YY_LOCATION_PRINT(File, Loc) \
976 fprintf (File, "%d.%d-%d.%d", \
977 (Loc).first_line, (Loc).first_column, \
978 (Loc).last_line, (Loc).last_column)
980 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
985 /* YYLEX -- calling `yylex' with the right arguments. */
988 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
990 # define YYLEX yylex (&yylval, &yylloc)
993 /* Enable debugging if requested. */
997 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
998 # define YYFPRINTF fprintf
1001 # define YYDPRINTF(Args) \
1007 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1011 YYFPRINTF (stderr, "%s ", Title); \
1012 yy_symbol_print (stderr, \
1013 Type, Value, Location); \
1014 YYFPRINTF (stderr, "\n"); \
1019 /*--------------------------------.
1020 | Print this symbol on YYOUTPUT. |
1021 `--------------------------------*/
1024 #if (defined __STDC__ || defined __C99__FUNC__ \
1025 || defined __cplusplus || defined _MSC_VER)
1027 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1030 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1033 YYSTYPE
const * const yyvaluep
;
1034 YYLTYPE
const * const yylocationp
;
1039 YYUSE (yylocationp
);
1041 if (yytype
< YYNTOKENS
)
1042 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1048 case 3: /* "\"string\"" */
1050 /* Line 797 of yacc.c */
1051 #line 183 "parse-gram.y"
1052 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1054 /* Line 797 of yacc.c */
1055 #line 1056 "parse-gram.c"
1057 case 4: /* "\"integer\"" */
1059 /* Line 797 of yacc.c */
1060 #line 195 "parse-gram.y"
1061 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1063 /* Line 797 of yacc.c */
1064 #line 1065 "parse-gram.c"
1066 case 43: /* "\"{...}\"" */
1068 /* Line 797 of yacc.c */
1069 #line 185 "parse-gram.y"
1070 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1072 /* Line 797 of yacc.c */
1073 #line 1074 "parse-gram.c"
1075 case 44: /* "\"[identifier]\"" */
1077 /* Line 797 of yacc.c */
1078 #line 190 "parse-gram.y"
1079 { fprintf (stderr
, "[%s]", (yyvaluep
->uniqstr
)); };
1081 /* Line 797 of yacc.c */
1082 #line 1083 "parse-gram.c"
1084 case 45: /* "\"char\"" */
1086 /* Line 797 of yacc.c */
1087 #line 177 "parse-gram.y"
1088 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1090 /* Line 797 of yacc.c */
1091 #line 1092 "parse-gram.c"
1093 case 46: /* "\"epilogue\"" */
1095 /* Line 797 of yacc.c */
1096 #line 185 "parse-gram.y"
1097 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1099 /* Line 797 of yacc.c */
1100 #line 1101 "parse-gram.c"
1102 case 48: /* "\"identifier\"" */
1104 /* Line 797 of yacc.c */
1105 #line 189 "parse-gram.y"
1106 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1108 /* Line 797 of yacc.c */
1109 #line 1110 "parse-gram.c"
1111 case 49: /* "\"identifier:\"" */
1113 /* Line 797 of yacc.c */
1114 #line 191 "parse-gram.y"
1115 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1117 /* Line 797 of yacc.c */
1118 #line 1119 "parse-gram.c"
1120 case 52: /* "\"%{...%}\"" */
1122 /* Line 797 of yacc.c */
1123 #line 185 "parse-gram.y"
1124 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1126 /* Line 797 of yacc.c */
1127 #line 1128 "parse-gram.c"
1129 case 54: /* "\"type\"" */
1131 /* Line 797 of yacc.c */
1132 #line 192 "parse-gram.y"
1133 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1135 /* Line 797 of yacc.c */
1136 #line 1137 "parse-gram.c"
1138 case 71: /* "symbol.prec" */
1140 /* Line 797 of yacc.c */
1141 #line 198 "parse-gram.y"
1142 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1144 /* Line 797 of yacc.c */
1145 #line 1146 "parse-gram.c"
1147 case 84: /* "variable" */
1149 /* Line 797 of yacc.c */
1150 #line 189 "parse-gram.y"
1151 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1153 /* Line 797 of yacc.c */
1154 #line 1155 "parse-gram.c"
1156 case 85: /* "content.opt" */
1158 /* Line 797 of yacc.c */
1159 #line 185 "parse-gram.y"
1160 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1162 /* Line 797 of yacc.c */
1163 #line 1164 "parse-gram.c"
1165 case 86: /* "braceless" */
1167 /* Line 797 of yacc.c */
1168 #line 185 "parse-gram.y"
1169 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1171 /* Line 797 of yacc.c */
1172 #line 1173 "parse-gram.c"
1176 /* Line 797 of yacc.c */
1177 #line 198 "parse-gram.y"
1178 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1180 /* Line 797 of yacc.c */
1181 #line 1182 "parse-gram.c"
1183 case 88: /* "id_colon" */
1185 /* Line 797 of yacc.c */
1186 #line 199 "parse-gram.y"
1187 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1189 /* Line 797 of yacc.c */
1190 #line 1191 "parse-gram.c"
1192 case 89: /* "symbol" */
1194 /* Line 797 of yacc.c */
1195 #line 198 "parse-gram.y"
1196 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1198 /* Line 797 of yacc.c */
1199 #line 1200 "parse-gram.c"
1201 case 90: /* "string_as_id" */
1203 /* Line 797 of yacc.c */
1204 #line 198 "parse-gram.y"
1205 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1207 /* Line 797 of yacc.c */
1208 #line 1209 "parse-gram.c"
1216 /*--------------------------------.
1217 | Print this symbol on YYOUTPUT. |
1218 `--------------------------------*/
1220 #if (defined __STDC__ || defined __C99__FUNC__ \
1221 || defined __cplusplus || defined _MSC_VER)
1223 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1226 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1229 YYSTYPE
const * const yyvaluep
;
1230 YYLTYPE
const * const yylocationp
;
1233 if (yytype
< YYNTOKENS
)
1234 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1236 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1238 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1239 YYFPRINTF (yyoutput
, ": ");
1240 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1241 YYFPRINTF (yyoutput
, ")");
1244 /*------------------------------------------------------------------.
1245 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1247 `------------------------------------------------------------------*/
1249 #if (defined __STDC__ || defined __C99__FUNC__ \
1250 || defined __cplusplus || defined _MSC_VER)
1252 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1255 yy_stack_print (yybottom
, yytop
)
1256 yytype_int16
*yybottom
;
1257 yytype_int16
*yytop
;
1260 YYFPRINTF (stderr
, "Stack now");
1261 for (; yybottom
<= yytop
; yybottom
++)
1263 int yybot
= *yybottom
;
1264 YYFPRINTF (stderr
, " %d", yybot
);
1266 YYFPRINTF (stderr
, "\n");
1269 # define YY_STACK_PRINT(Bottom, Top) \
1272 yy_stack_print ((Bottom), (Top)); \
1276 /*------------------------------------------------.
1277 | Report that the YYRULE is going to be reduced. |
1278 `------------------------------------------------*/
1280 #if (defined __STDC__ || defined __C99__FUNC__ \
1281 || defined __cplusplus || defined _MSC_VER)
1283 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1286 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1292 int yynrhs
= yyr2
[yyrule
];
1294 unsigned long int yylno
= yyrline
[yyrule
];
1295 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1297 /* The symbols being reduced. */
1298 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1300 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1301 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1302 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1303 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1304 YYFPRINTF (stderr
, "\n");
1308 # define YY_REDUCE_PRINT(Rule) \
1311 yy_reduce_print (yyvsp, yylsp, Rule); \
1314 /* Nonzero means print parse trace. It is left uninitialized so that
1315 multiple parsers can coexist. */
1317 #else /* !YYDEBUG */
1318 # define YYDPRINTF(Args)
1319 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1320 # define YY_STACK_PRINT(Bottom, Top)
1321 # define YY_REDUCE_PRINT(Rule)
1322 #endif /* !YYDEBUG */
1325 /* YYINITDEPTH -- initial size of the parser's stacks. */
1327 # define YYINITDEPTH 200
1330 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1331 if the built-in stack extension method is used).
1333 Do not make this value too large; the results are undefined if
1334 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1335 evaluated with infinite-precision integer arithmetic. */
1338 # define YYMAXDEPTH 10000
1346 # if defined __GLIBC__ && defined _STRING_H
1347 # define yystrlen strlen
1349 /* Return the length of YYSTR. */
1350 #if (defined __STDC__ || defined __C99__FUNC__ \
1351 || defined __cplusplus || defined _MSC_VER)
1353 yystrlen (const char *yystr
)
1361 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1369 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1370 # define yystpcpy stpcpy
1372 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1374 #if (defined __STDC__ || defined __C99__FUNC__ \
1375 || defined __cplusplus || defined _MSC_VER)
1377 yystpcpy (char *yydest
, const char *yysrc
)
1380 yystpcpy (yydest
, yysrc
)
1386 const char *yys
= yysrc
;
1388 while ((*yyd
++ = *yys
++) != '\0')
1397 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1398 quotes and backslashes, so that it's suitable for yyerror. The
1399 heuristic is that double-quoting is unnecessary unless the string
1400 contains an apostrophe, a comma, or backslash (other than
1401 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1402 null, do not copy; instead, return the length of what the result
1405 yytnamerr (char *yyres
, const char *yystr
)
1410 char const *yyp
= yystr
;
1417 goto do_not_strip_quotes
;
1421 goto do_not_strip_quotes
;
1434 do_not_strip_quotes
: ;
1438 return yystrlen (yystr
);
1440 return yystpcpy (yyres
, yystr
) - yyres
;
1444 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1445 about the unexpected token YYTOKEN while in state YYSTATE.
1447 Return 0 if *YYMSG was successfully written. Return 1 if an ordinary
1448 "syntax error" message will suffice instead. Return 2 if *YYMSG is
1449 not large enough to hold the message. In the last case, also set
1450 *YYMSG_ALLOC to either (a) the required number of bytes or (b) zero
1451 if the required number of bytes is too large to store. */
1453 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1454 int yystate
, int yytoken
)
1456 int yyn
= yypact
[yystate
];
1458 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1462 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1463 YYSIZE_T yysize
= yysize0
;
1465 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1466 /* Internationalized format string. */
1467 const char *yyformat
= 0;
1468 /* Arguments of yyformat. */
1469 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1471 /* Start YYX at -YYN if negative to avoid negative indexes in
1472 YYCHECK. In other words, skip the first -YYN actions for this
1473 state because they are default actions. */
1474 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1476 /* Stay within bounds of both yycheck and yytname. */
1477 int yychecklim
= YYLAST
- yyn
+ 1;
1478 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1479 /* Number of reported tokens (one for the "unexpected", one per
1484 yyarg
[yycount
++] = yytname
[yytoken
];
1486 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1487 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1488 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1490 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1496 yyarg
[yycount
++] = yytname
[yyx
];
1497 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1498 if (! (yysize
<= yysize1
1499 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1510 #define YYCASE_(N, S) \
1514 YYCASE_(1, YY_("syntax error, unexpected %s"));
1515 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1516 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1517 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1518 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1522 yysize1
= yysize
+ yystrlen (yyformat
);
1523 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1531 if (*yymsg_alloc
< yysize
)
1533 *yymsg_alloc
= 2 * yysize
;
1534 if (! (yysize
<= *yymsg_alloc
1535 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1536 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1540 /* Avoid sprintf, as that infringes on the user's name space.
1541 Don't have undefined behavior even if the translation
1542 produced a string with the wrong number of "%s"s. */
1546 while ((*yyp
= *yyformat
) != '\0')
1547 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1549 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1561 #endif /* YYERROR_VERBOSE */
1564 /*-----------------------------------------------.
1565 | Release the memory associated to this symbol. |
1566 `-----------------------------------------------*/
1569 #if (defined __STDC__ || defined __C99__FUNC__ \
1570 || defined __cplusplus || defined _MSC_VER)
1572 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1575 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1579 YYLTYPE
*yylocationp
;
1583 YYUSE (yylocationp
);
1587 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1598 /* Prevent warnings from -Wmissing-prototypes. */
1599 #ifdef YYPARSE_PARAM
1600 #if defined __STDC__ || defined __cplusplus
1601 int yyparse (void *YYPARSE_PARAM
);
1605 #else /* ! YYPARSE_PARAM */
1606 #if defined __STDC__ || defined __cplusplus
1611 #endif /* ! YYPARSE_PARAM */
1618 #ifdef YYPARSE_PARAM
1619 #if (defined __STDC__ || defined __C99__FUNC__ \
1620 || defined __cplusplus || defined _MSC_VER)
1622 yyparse (void *YYPARSE_PARAM
)
1625 yyparse (YYPARSE_PARAM
)
1626 void *YYPARSE_PARAM
;
1628 #else /* ! YYPARSE_PARAM */
1629 #if (defined __STDC__ || defined __C99__FUNC__ \
1630 || defined __cplusplus || defined _MSC_VER)
1640 /* The lookahead symbol. */
1643 /* The semantic value of the lookahead symbol. */
1646 /* Location data for the lookahead symbol. */
1649 /* Number of syntax errors so far. */
1653 /* Number of tokens to shift before error messages enabled. */
1656 /* The stacks and their tools:
1657 `yyss': related to states.
1658 `yyvs': related to semantic values.
1659 `yyls': related to locations.
1661 Refer to the stacks thru separate pointers, to allow yyoverflow
1662 to reallocate them elsewhere. */
1664 /* The state stack. */
1665 yytype_int16 yyssa
[YYINITDEPTH
];
1667 yytype_int16
*yyssp
;
1669 /* The semantic value stack. */
1670 YYSTYPE yyvsa
[YYINITDEPTH
];
1674 /* The location stack. */
1675 YYLTYPE yylsa
[YYINITDEPTH
];
1679 /* The locations where the error started and ended. */
1680 YYLTYPE yyerror_range
[3];
1682 YYSIZE_T yystacksize
;
1686 /* Lookahead token as an internal (translated) token number. */
1688 /* The variables used to return semantic value and location from the
1694 /* Buffer for error messages, and its allocated size. */
1696 char *yymsg
= yymsgbuf
;
1697 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1700 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1702 /* The number of symbols on the RHS of the reduced rule.
1703 Keep to zero when no symbol should be popped. */
1710 yystacksize
= YYINITDEPTH
;
1712 YYDPRINTF ((stderr
, "Starting parse\n"));
1717 yychar
= YYEMPTY
; /* Cause a token to be read. */
1719 /* Initialize stack pointers.
1720 Waste one element of value and location stack
1721 so that they stay on the same level as the state stack.
1722 The wasted elements are never initialized. */
1727 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1728 /* Initialize the default location before parsing starts. */
1729 yylloc
.first_line
= yylloc
.last_line
= 1;
1730 yylloc
.first_column
= yylloc
.last_column
= 1;
1733 /* User initialization code. */
1735 /* Line 1280 of yacc.c */
1736 #line 85 "parse-gram.y"
1738 /* Bison's grammar can initial empty locations, hence a default
1739 location is needed. */
1740 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1741 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1744 /* Line 1280 of yacc.c */
1745 #line 1746 "parse-gram.c"
1750 /*------------------------------------------------------------.
1751 | yynewstate -- Push a new state, which is found in yystate. |
1752 `------------------------------------------------------------*/
1754 /* In all cases, when you get here, the value and location stacks
1755 have just been pushed. So pushing a state here evens the stacks. */
1761 if (yyss
+ yystacksize
- 1 <= yyssp
)
1763 /* Get the current used size of the three stacks, in elements. */
1764 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1768 /* Give user a chance to reallocate the stack. Use copies of
1769 these so that the &'s don't force the real ones into
1771 YYSTYPE
*yyvs1
= yyvs
;
1772 yytype_int16
*yyss1
= yyss
;
1773 YYLTYPE
*yyls1
= yyls
;
1775 /* Each stack pointer address is followed by the size of the
1776 data in use in that stack, in bytes. This used to be a
1777 conditional around just the two extra args, but that might
1778 be undefined if yyoverflow is a macro. */
1779 yyoverflow (YY_("memory exhausted"),
1780 &yyss1
, yysize
* sizeof (*yyssp
),
1781 &yyvs1
, yysize
* sizeof (*yyvsp
),
1782 &yyls1
, yysize
* sizeof (*yylsp
),
1789 #else /* no yyoverflow */
1790 # ifndef YYSTACK_RELOCATE
1791 goto yyexhaustedlab
;
1793 /* Extend the stack our own way. */
1794 if (YYMAXDEPTH
<= yystacksize
)
1795 goto yyexhaustedlab
;
1797 if (YYMAXDEPTH
< yystacksize
)
1798 yystacksize
= YYMAXDEPTH
;
1801 yytype_int16
*yyss1
= yyss
;
1802 union yyalloc
*yyptr
=
1803 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1805 goto yyexhaustedlab
;
1806 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1807 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1808 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1809 # undef YYSTACK_RELOCATE
1811 YYSTACK_FREE (yyss1
);
1814 #endif /* no yyoverflow */
1816 yyssp
= yyss
+ yysize
- 1;
1817 yyvsp
= yyvs
+ yysize
- 1;
1818 yylsp
= yyls
+ yysize
- 1;
1820 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1821 (unsigned long int) yystacksize
));
1823 if (yyss
+ yystacksize
- 1 <= yyssp
)
1827 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1829 if (yystate
== YYFINAL
)
1839 /* Do appropriate processing given the current state. Read a
1840 lookahead token if we need one and don't already have one. */
1842 /* First try to decide what to do without reference to lookahead token. */
1843 yyn
= yypact
[yystate
];
1844 if (yypact_value_is_default (yyn
))
1847 /* Not known => get a lookahead token if don't already have one. */
1849 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1850 if (yychar
== YYEMPTY
)
1852 YYDPRINTF ((stderr
, "Reading a token: "));
1856 if (yychar
<= YYEOF
)
1858 yychar
= yytoken
= YYEOF
;
1859 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1863 yytoken
= YYTRANSLATE (yychar
);
1864 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1867 /* If the proper action on seeing token YYTOKEN is to reduce or to
1868 detect an error, take that action. */
1870 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1875 if (yytable_value_is_error (yyn
))
1881 /* Count tokens shifted since error; after three, turn off error
1886 /* Shift the lookahead token. */
1887 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1889 /* Discard the shifted token. */
1898 /*-----------------------------------------------------------.
1899 | yydefault -- do the default action for the current state. |
1900 `-----------------------------------------------------------*/
1902 yyn
= yydefact
[yystate
];
1908 /*-----------------------------.
1909 | yyreduce -- Do a reduction. |
1910 `-----------------------------*/
1912 /* yyn is the number of a rule to reduce with. */
1915 /* If YYLEN is nonzero, implement the default value of the action:
1918 Otherwise, the following line sets YYVAL to garbage.
1919 This behavior is undocumented and Bison
1920 users should not rely upon it. Assigning to YYVAL
1921 unconditionally makes the parser a bit smaller, and it avoids a
1922 GCC warning that YYVAL may be used uninitialized. */
1923 yyval
= yyvsp
[1-yylen
];
1925 /* Default location. */
1926 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1927 YY_REDUCE_PRINT (yyn
);
1932 /* Line 1493 of yacc.c */
1933 #line 224 "parse-gram.y"
1935 code_props plain_code
;
1936 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1937 code_props_translate_code (&plain_code
);
1938 gram_scanner_last_string_free ();
1939 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1940 plain_code
.code
, (yylsp
[(1) - (1)]));
1941 code_scanner_last_string_free ();
1947 /* Line 1493 of yacc.c */
1948 #line 233 "parse-gram.y"
1949 { debug_flag
= true; }
1954 /* Line 1493 of yacc.c */
1955 #line 235 "parse-gram.y"
1957 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
),
1958 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
1964 /* Line 1493 of yacc.c */
1965 #line 239 "parse-gram.y"
1966 { defines_flag
= true; }
1971 /* Line 1493 of yacc.c */
1972 #line 241 "parse-gram.y"
1974 defines_flag
= true;
1975 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1981 /* Line 1493 of yacc.c */
1982 #line 245 "parse-gram.y"
1983 { error_verbose
= true; }
1988 /* Line 1493 of yacc.c */
1989 #line 246 "parse-gram.y"
1990 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1995 /* Line 1493 of yacc.c */
1996 #line 247 "parse-gram.y"
1997 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2002 /* Line 1493 of yacc.c */
2003 #line 248 "parse-gram.y"
2004 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
2009 /* Line 1493 of yacc.c */
2010 #line 249 "parse-gram.y"
2011 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
2016 /* Line 1493 of yacc.c */
2017 #line 251 "parse-gram.y"
2019 nondeterministic_parser
= true;
2026 /* Line 1493 of yacc.c */
2027 #line 256 "parse-gram.y"
2030 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
2031 code_props_translate_code (&action
);
2032 gram_scanner_last_string_free ();
2033 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2034 code_scanner_last_string_free ();
2040 /* Line 1493 of yacc.c */
2041 #line 264 "parse-gram.y"
2042 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, (yylsp
[(1) - (2)])); }
2047 /* Line 1493 of yacc.c */
2048 #line 265 "parse-gram.y"
2049 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2054 /* Line 1493 of yacc.c */
2055 #line 266 "parse-gram.y"
2056 { locations_flag
= true; }
2061 /* Line 1493 of yacc.c */
2062 #line 267 "parse-gram.y"
2063 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2068 /* Line 1493 of yacc.c */
2069 #line 268 "parse-gram.y"
2070 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2075 /* Line 1493 of yacc.c */
2076 #line 269 "parse-gram.y"
2077 { no_lines_flag
= true; }
2082 /* Line 1493 of yacc.c */
2083 #line 270 "parse-gram.y"
2084 { nondeterministic_parser
= true; }
2089 /* Line 1493 of yacc.c */
2090 #line 271 "parse-gram.y"
2091 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2096 /* Line 1493 of yacc.c */
2097 #line 272 "parse-gram.y"
2098 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2103 /* Line 1493 of yacc.c */
2104 #line 273 "parse-gram.y"
2105 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2110 /* Line 1493 of yacc.c */
2111 #line 275 "parse-gram.y"
2113 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2114 `%define api.pure' in a backward-compatible manner here. First, don't
2115 complain if %pure-parser is specified multiple times. */
2116 if (!muscle_find_const ("percent_define(api.pure)"))
2117 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2118 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2119 /* In all cases, use api.pure now so that the backend doesn't complain if
2120 the skeleton ignores api.pure, but do warn now if there's a previous
2121 conflicting definition from an actual %define. */
2122 if (!muscle_percent_define_flag_if ("api.pure"))
2123 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2124 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2130 /* Line 1493 of yacc.c */
2131 #line 289 "parse-gram.y"
2132 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2137 /* Line 1493 of yacc.c */
2138 #line 291 "parse-gram.y"
2140 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2141 if (strchr (skeleton_user
, '/'))
2143 size_t dir_length
= strlen (current_file
);
2144 char *skeleton_build
;
2145 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2147 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2150 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2153 strncpy (skeleton_build
, current_file
, dir_length
);
2154 skeleton_build
[dir_length
++] = '/';
2156 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2157 skeleton_user
= uniqstr_new (skeleton_build
);
2158 free (skeleton_build
);
2160 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[(1) - (2)]));
2166 /* Line 1493 of yacc.c */
2167 #line 314 "parse-gram.y"
2168 { token_table_flag
= true; }
2173 /* Line 1493 of yacc.c */
2174 #line 315 "parse-gram.y"
2175 { report_flag
|= report_states
; }
2180 /* Line 1493 of yacc.c */
2181 #line 316 "parse-gram.y"
2182 { yacc_flag
= true; }
2187 /* Line 1493 of yacc.c */
2188 #line 324 "parse-gram.y"
2190 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2196 /* Line 1493 of yacc.c */
2197 #line 328 "parse-gram.y"
2200 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2201 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2202 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2208 /* Line 1493 of yacc.c */
2209 #line 335 "parse-gram.y"
2212 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2213 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2214 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2220 /* Line 1493 of yacc.c */
2221 #line 342 "parse-gram.y"
2223 default_prec
= true;
2229 /* Line 1493 of yacc.c */
2230 #line 346 "parse-gram.y"
2232 default_prec
= false;
2238 /* Line 1493 of yacc.c */
2239 #line 350 "parse-gram.y"
2241 /* Do not invoke muscle_percent_code_grow here since it invokes
2242 muscle_user_name_list_grow. */
2243 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2244 code_scanner_last_string_free ();
2250 /* Line 1493 of yacc.c */
2251 #line 357 "parse-gram.y"
2253 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2254 code_scanner_last_string_free ();
2260 /* Line 1493 of yacc.c */
2261 #line 371 "parse-gram.y"
2267 /* Line 1493 of yacc.c */
2268 #line 372 "parse-gram.y"
2269 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2274 /* Line 1493 of yacc.c */
2275 #line 377 "parse-gram.y"
2278 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2279 code_scanner_last_string_free ();
2285 /* Line 1493 of yacc.c */
2286 #line 388 "parse-gram.y"
2287 { current_class
= nterm_sym
; }
2292 /* Line 1493 of yacc.c */
2293 #line 389 "parse-gram.y"
2295 current_class
= unknown_sym
;
2296 current_type
= NULL
;
2302 /* Line 1493 of yacc.c */
2303 #line 393 "parse-gram.y"
2304 { current_class
= token_sym
; }
2309 /* Line 1493 of yacc.c */
2310 #line 394 "parse-gram.y"
2312 current_class
= unknown_sym
;
2313 current_type
= NULL
;
2319 /* Line 1493 of yacc.c */
2320 #line 399 "parse-gram.y"
2324 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2325 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2326 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2332 /* Line 1493 of yacc.c */
2333 #line 410 "parse-gram.y"
2337 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2339 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2340 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2342 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2343 current_type
= NULL
;
2349 /* Line 1493 of yacc.c */
2350 #line 424 "parse-gram.y"
2351 { (yyval
.assoc
) = left_assoc
; }
2356 /* Line 1493 of yacc.c */
2357 #line 425 "parse-gram.y"
2358 { (yyval
.assoc
) = right_assoc
; }
2363 /* Line 1493 of yacc.c */
2364 #line 426 "parse-gram.y"
2365 { (yyval
.assoc
) = non_assoc
; }
2370 /* Line 1493 of yacc.c */
2371 #line 430 "parse-gram.y"
2372 { current_type
= NULL
; }
2377 /* Line 1493 of yacc.c */
2378 #line 431 "parse-gram.y"
2379 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2384 /* Line 1493 of yacc.c */
2385 #line 437 "parse-gram.y"
2386 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2391 /* Line 1493 of yacc.c */
2392 #line 439 "parse-gram.y"
2393 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2398 /* Line 1493 of yacc.c */
2399 #line 443 "parse-gram.y"
2400 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2405 /* Line 1493 of yacc.c */
2406 #line 444 "parse-gram.y"
2407 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2412 /* Line 1493 of yacc.c */
2413 #line 450 "parse-gram.y"
2414 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2419 /* Line 1493 of yacc.c */
2420 #line 452 "parse-gram.y"
2421 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2426 /* Line 1493 of yacc.c */
2427 #line 456 "parse-gram.y"
2428 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2433 /* Line 1493 of yacc.c */
2434 #line 457 "parse-gram.y"
2435 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2440 /* Line 1493 of yacc.c */
2441 #line 461 "parse-gram.y"
2442 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2447 /* Line 1493 of yacc.c */
2448 #line 462 "parse-gram.y"
2449 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2454 /* Line 1493 of yacc.c */
2455 #line 463 "parse-gram.y"
2456 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2461 /* Line 1493 of yacc.c */
2462 #line 464 "parse-gram.y"
2463 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2468 /* Line 1493 of yacc.c */
2469 #line 470 "parse-gram.y"
2471 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2478 /* Line 1493 of yacc.c */
2479 #line 475 "parse-gram.y"
2481 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2482 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2488 /* Line 1493 of yacc.c */
2489 #line 480 "parse-gram.y"
2491 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2492 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2493 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2499 /* Line 1493 of yacc.c */
2500 #line 486 "parse-gram.y"
2502 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2503 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2504 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2510 /* Line 1493 of yacc.c */
2511 #line 492 "parse-gram.y"
2513 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2514 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2515 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2516 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2522 /* Line 1493 of yacc.c */
2523 #line 522 "parse-gram.y"
2531 /* Line 1493 of yacc.c */
2532 #line 528 "parse-gram.y"
2533 { current_lhs
= (yyvsp
[(1) - (2)].symbol
); current_lhs_location
= (yylsp
[(1) - (2)]);
2534 current_lhs_named_ref
= (yyvsp
[(2) - (2)].named_ref
); }
2539 /* Line 1493 of yacc.c */
2540 #line 533 "parse-gram.y"
2541 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2546 /* Line 1493 of yacc.c */
2547 #line 534 "parse-gram.y"
2548 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2553 /* Line 1493 of yacc.c */
2554 #line 540 "parse-gram.y"
2555 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2556 current_lhs_named_ref
); }
2561 /* Line 1493 of yacc.c */
2562 #line 543 "parse-gram.y"
2563 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (3)].symbol
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2568 /* Line 1493 of yacc.c */
2569 #line 545 "parse-gram.y"
2570 { grammar_current_rule_action_append ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2575 /* Line 1493 of yacc.c */
2576 #line 547 "parse-gram.y"
2577 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2582 /* Line 1493 of yacc.c */
2583 #line 549 "parse-gram.y"
2584 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2589 /* Line 1493 of yacc.c */
2590 #line 551 "parse-gram.y"
2591 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2596 /* Line 1493 of yacc.c */
2597 #line 555 "parse-gram.y"
2598 { (yyval
.named_ref
) = 0; }
2603 /* Line 1493 of yacc.c */
2604 #line 557 "parse-gram.y"
2605 { (yyval
.named_ref
) = named_ref_new((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2610 /* Line 1493 of yacc.c */
2611 #line 569 "parse-gram.y"
2612 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2617 /* Line 1493 of yacc.c */
2618 #line 574 "parse-gram.y"
2619 { (yyval
.chars
) = ""; }
2624 /* Line 1493 of yacc.c */
2625 #line 575 "parse-gram.y"
2626 { (yyval
.chars
) = (yyvsp
[(1) - (1)].uniqstr
); }
2631 /* Line 1493 of yacc.c */
2632 #line 586 "parse-gram.y"
2634 code_props plain_code
;
2635 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2636 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2637 code_props_translate_code (&plain_code
);
2638 gram_scanner_last_string_free ();
2639 (yyval
.chars
) = plain_code
.code
;
2645 /* Line 1493 of yacc.c */
2646 #line 606 "parse-gram.y"
2647 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2652 /* Line 1493 of yacc.c */
2653 #line 608 "parse-gram.y"
2655 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2656 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2657 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2663 /* Line 1493 of yacc.c */
2664 #line 616 "parse-gram.y"
2665 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2670 /* Line 1493 of yacc.c */
2671 #line 628 "parse-gram.y"
2673 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2674 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2680 /* Line 1493 of yacc.c */
2681 #line 637 "parse-gram.y"
2683 code_props plain_code
;
2684 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2685 code_props_translate_code (&plain_code
);
2686 gram_scanner_last_string_free ();
2687 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2688 code_scanner_last_string_free ();
2694 /* Line 1493 of yacc.c */
2695 #line 2696 "parse-gram.c"
2698 /* User semantic actions sometimes alter yychar, and that requires
2699 that yytoken be updated with the new translation. We take the
2700 approach of translating immediately before every use of yytoken.
2701 One alternative is translating here after every semantic action,
2702 but that translation would be missed if the semantic action invokes
2703 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2704 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2705 incorrect destructor might then be invoked immediately. In the
2706 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2707 to an incorrect destructor call or verbose syntax error message
2708 before the lookahead is translated. */
2709 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2713 YY_STACK_PRINT (yyss
, yyssp
);
2718 /* Now `shift' the result of the reduction. Determine what state
2719 that goes to, based on the state we popped back to and the rule
2720 number reduced by. */
2724 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2725 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2726 yystate
= yytable
[yystate
];
2728 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2733 /*------------------------------------.
2734 | yyerrlab -- here on detecting error |
2735 `------------------------------------*/
2737 /* Make sure we have latest lookahead translation. See comments at
2738 user semantic actions for why this is necessary. */
2739 yytoken
= YYTRANSLATE (yychar
);
2741 /* If not already recovering from an error, report this error. */
2745 #if ! YYERROR_VERBOSE
2746 yyerror (YY_("syntax error"));
2750 int yysyntax_error_status
=
2751 yysyntax_error (&yymsg_alloc
, &yymsg
, yystate
, yytoken
);
2752 if (yysyntax_error_status
== 2 && 0 < yymsg_alloc
)
2754 if (yymsg
!= yymsgbuf
)
2755 YYSTACK_FREE (yymsg
);
2756 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2760 yymsg_alloc
= sizeof yymsgbuf
;
2762 if (yysyntax_error_status
== 0)
2765 yyerror (YY_("syntax error"));
2766 if (yysyntax_error_status
== 2)
2767 goto yyexhaustedlab
;
2773 yyerror_range
[1] = yylloc
;
2775 if (yyerrstatus
== 3)
2777 /* If just tried and failed to reuse lookahead token after an
2778 error, discard it. */
2780 if (yychar
<= YYEOF
)
2782 /* Return failure if at end of input. */
2783 if (yychar
== YYEOF
)
2788 yydestruct ("Error: discarding",
2789 yytoken
, &yylval
, &yylloc
);
2794 /* Else will try to reuse lookahead token after shifting the error
2799 /*---------------------------------------------------.
2800 | yyerrorlab -- error raised explicitly by YYERROR. |
2801 `---------------------------------------------------*/
2804 /* Pacify compilers like GCC when the user code never invokes
2805 YYERROR and the label yyerrorlab therefore never appears in user
2807 if (/*CONSTCOND*/ 0)
2810 yyerror_range
[1] = yylsp
[1-yylen
];
2811 /* Do not reclaim the symbols of the rule which action triggered
2815 YY_STACK_PRINT (yyss
, yyssp
);
2820 /*-------------------------------------------------------------.
2821 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2822 `-------------------------------------------------------------*/
2824 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2828 yyn
= yypact
[yystate
];
2829 if (!yypact_value_is_default (yyn
))
2832 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2840 /* Pop the current state because it cannot handle the error token. */
2844 yyerror_range
[1] = *yylsp
;
2845 yydestruct ("Error: popping",
2846 yystos
[yystate
], yyvsp
, yylsp
);
2849 YY_STACK_PRINT (yyss
, yyssp
);
2854 yyerror_range
[2] = yylloc
;
2855 /* Using YYLLOC is tempting, but would change the location of
2856 the lookahead. YYLOC is available though. */
2857 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2860 /* Shift the error token. */
2861 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2867 /*-------------------------------------.
2868 | yyacceptlab -- YYACCEPT comes here. |
2869 `-------------------------------------*/
2874 /*-----------------------------------.
2875 | yyabortlab -- YYABORT comes here. |
2876 `-----------------------------------*/
2881 #if !defined(yyoverflow) || YYERROR_VERBOSE
2882 /*-------------------------------------------------.
2883 | yyexhaustedlab -- memory exhaustion comes here. |
2884 `-------------------------------------------------*/
2886 yyerror (YY_("memory exhausted"));
2892 if (yychar
!= YYEMPTY
)
2894 /* Make sure we have latest lookahead translation. See comments at
2895 user semantic actions for why this is necessary. */
2896 yytoken
= YYTRANSLATE (yychar
);
2897 yydestruct ("Cleanup: discarding lookahead",
2898 yytoken
, &yylval
, &yylloc
);
2900 /* Do not reclaim the symbols of the rule which action triggered
2901 this YYABORT or YYACCEPT. */
2903 YY_STACK_PRINT (yyss
, yyssp
);
2904 while (yyssp
!= yyss
)
2906 yydestruct ("Cleanup: popping",
2907 yystos
[*yyssp
], yyvsp
, yylsp
);
2912 YYSTACK_FREE (yyss
);
2915 if (yymsg
!= yymsgbuf
)
2916 YYSTACK_FREE (yymsg
);
2918 /* Make sure YYID is used. */
2919 return YYID (yyresult
);
2924 /* Line 1724 of yacc.c */
2925 #line 647 "parse-gram.y"
2929 /* Return the location of the left-hand side of a rule whose
2930 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2931 the right-hand side, and return an empty location equal to the end
2932 boundary of RHS[0] if the right-hand side is empty. */
2935 lloc_default (YYLTYPE
const *rhs
, int n
)
2940 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2941 The bug is fixed in 7.4.2m, but play it safe for now. */
2942 loc
.start
= rhs
[n
].end
;
2943 loc
.end
= rhs
[n
].end
;
2945 /* Ignore empty nonterminals the start of the the right-hand side.
2946 Do not bother to ignore them at the end of the right-hand side,
2947 since empty nonterminals have the same end as their predecessors. */
2948 for (i
= 1; i
<= n
; i
++)
2949 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2951 loc
.start
= rhs
[i
].start
;
2959 /* Add a lex-param or a parse-param (depending on TYPE) with
2960 declaration DECL and location LOC. */
2963 add_param (char const *type
, char *decl
, location loc
)
2965 static char const alphanum
[26 + 26 + 1 + 10] =
2966 "abcdefghijklmnopqrstuvwxyz"
2967 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2970 char const *name_start
= NULL
;
2973 /* Stop on last actual character. */
2974 for (p
= decl
; p
[1]; p
++)
2976 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2977 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2980 /* Strip the surrounding '{' and '}', and any blanks just inside
2982 while (*--p
== ' ' || *p
== '\t')
2985 while (*++decl
== ' ' || *decl
== '\t')
2989 complain_at (loc
, _("missing identifier in parameter declaration"));
2996 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3000 name
= xmalloc (name_len
+ 1);
3001 memcpy (name
, name_start
, name_len
);
3002 name
[name_len
] = '\0';
3003 muscle_pair_list_grow (type
, decl
, name
);
3007 gram_scanner_last_string_free ();
3012 version_check (location
const *loc
, char const *version
)
3014 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3016 complain_at (*loc
, "require bison %s, but have %s",
3017 version
, PACKAGE_VERSION
);
3023 gram_error (location
const *loc
, char const *msg
)
3025 complain_at (*loc
, "%s", msg
);
3029 token_name (int type
)
3031 return yytname
[YYTRANSLATE (type
)];
3042 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3043 return quotearg_style (escape_quoting_style
, buf
);