1 /* A Bison parser, made by GNU Bison 2.4.1.247-0e0f-dirty. */
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.247-0e0f-dirty"
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 251 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 251 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 276 of yacc.c */
306 #line 94 "parse-gram.y"
315 unsigned char character
;
316 named_ref
*named_ref
;
320 /* Line 276 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 326 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)
432 #if ! defined yyoverflow || YYERROR_VERBOSE
434 /* The parser invokes alloca or malloc; define the necessary symbols. */
436 # ifdef YYSTACK_USE_ALLOCA
437 # if YYSTACK_USE_ALLOCA
439 # define YYSTACK_ALLOC __builtin_alloca
440 # elif defined __BUILTIN_VA_ARG_INCR
441 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
443 # define YYSTACK_ALLOC __alloca
444 # elif defined _MSC_VER
445 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
446 # define alloca _alloca
448 # define YYSTACK_ALLOC alloca
449 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
450 || defined __cplusplus || defined _MSC_VER)
451 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
452 # ifndef EXIT_SUCCESS
453 # define EXIT_SUCCESS 0
460 # ifdef YYSTACK_ALLOC
461 /* Pacify GCC's `empty if-body' warning. */
462 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
463 # ifndef YYSTACK_ALLOC_MAXIMUM
464 /* The OS might guarantee only one guard page at the bottom of the stack,
465 and a page size can be as small as 4096 bytes. So we cannot safely
466 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
467 to allow for a few compiler-allocated temporary stack slots. */
468 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
471 # define YYSTACK_ALLOC YYMALLOC
472 # define YYSTACK_FREE YYFREE
473 # ifndef YYSTACK_ALLOC_MAXIMUM
474 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
476 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
477 && ! ((defined YYMALLOC || defined malloc) \
478 && (defined YYFREE || defined free)))
479 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
480 # ifndef EXIT_SUCCESS
481 # define EXIT_SUCCESS 0
485 # define YYMALLOC malloc
486 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
487 || defined __cplusplus || defined _MSC_VER)
488 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
493 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
494 || defined __cplusplus || defined _MSC_VER)
495 void free (void *); /* INFRINGES ON USER NAME SPACE */
499 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
502 #if (! defined yyoverflow \
503 && (! defined __cplusplus \
504 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
505 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
507 /* A type that is properly aligned for any stack member. */
510 yytype_int16 yyss_alloc
;
515 /* The size of the maximum gap between one aligned stack and the next. */
516 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
518 /* The size of an array large to enough to hold all stacks, each with
520 # define YYSTACK_BYTES(N) \
521 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
522 + 2 * YYSTACK_GAP_MAXIMUM)
524 /* Copy COUNT objects from FROM to TO. The source and destination do
527 # if defined __GNUC__ && 1 < __GNUC__
528 # define YYCOPY(To, From, Count) \
529 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
531 # define YYCOPY(To, From, Count) \
535 for (yyi = 0; yyi < (Count); yyi++) \
536 (To)[yyi] = (From)[yyi]; \
542 /* Relocate STACK from its old location to the new one. The
543 local variables YYSIZE and YYSTACKSIZE give the old and new number of
544 elements in the stack, and YYPTR gives the new location of the
545 stack. Advance YYPTR to a properly aligned location for the next
547 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
550 YYSIZE_T yynewbytes; \
551 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
552 Stack = &yyptr->Stack_alloc; \
553 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
554 yyptr += yynewbytes / sizeof (*yyptr); \
560 /* YYFINAL -- State number of the termination state. */
562 /* YYLAST -- Last index in YYTABLE. */
565 /* YYNTOKENS -- Number of terminals. */
567 /* YYNNTS -- Number of nonterminals. */
569 /* YYNRULES -- Number of rules. */
571 /* YYNRULES -- Number of states. */
572 #define YYNSTATES 148
574 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
576 #define YYMAXUTOK 312
578 #define YYTRANSLATE(YYX) \
579 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
581 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
582 static const yytype_uint8 yytranslate
[] =
584 0, 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, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
610 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
611 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
612 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
613 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
614 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
619 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
621 static const yytype_uint16 yyprhs
[] =
623 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
624 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
625 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
626 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
627 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
628 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
629 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
630 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
631 206, 209, 212, 213, 218, 220, 224, 227, 228, 232,
632 236, 240, 244, 248, 249, 251, 253, 255, 256, 258,
633 260, 262, 264, 266, 268, 270, 272, 274, 275
636 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
637 static const yytype_int8 yyrhs
[] =
639 59, 0, -1, 60, 50, 77, 91, -1, -1, 60,
640 61, -1, 62, -1, 52, -1, 17, -1, 19, 84,
641 85, -1, 20, -1, 20, 3, -1, 21, -1, 22,
642 4, -1, 23, 4, -1, 24, 3, -1, 24, 47,
643 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
644 28, 43, -1, 29, -1, 30, 3, -1, 30, 47,
645 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
646 47, 3, -1, 35, 43, -1, 36, -1, 37, 3,
647 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
648 53, -1, 67, -1, 64, -1, 39, 89, -1, 8,
649 43, 73, -1, 9, 43, 73, -1, 18, -1, 31,
650 -1, 16, 86, -1, 16, 48, 86, -1, -1, 48,
651 -1, 57, 63, 86, -1, -1, 6, 65, 76, -1,
652 -1, 5, 66, 76, -1, 7, 54, 72, -1, 68,
653 69, 70, -1, 10, -1, 11, -1, 12, -1, -1,
654 54, -1, 71, -1, 70, 71, -1, 89, -1, 89,
655 4, -1, 89, -1, 72, 89, -1, 74, -1, 73,
656 74, -1, 89, -1, 54, -1, 55, -1, 56, -1,
657 54, -1, 87, -1, 87, 4, -1, 87, 90, -1,
658 87, 4, 90, -1, 75, -1, 76, 75, -1, 78,
659 -1, 77, 78, -1, 79, -1, 62, 53, -1, 1,
660 53, -1, -1, 88, 83, 80, 81, -1, 82, -1,
661 81, 51, 82, -1, 81, 53, -1, -1, 82, 89,
662 83, -1, 82, 43, 83, -1, 82, 13, 89, -1,
663 82, 14, 4, -1, 82, 15, 54, -1, -1, 44,
664 -1, 48, -1, 3, -1, -1, 48, -1, 3, -1,
665 43, -1, 48, -1, 45, -1, 49, -1, 87, -1,
666 90, -1, 3, -1, -1, 50, 46, -1
669 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
670 static const yytype_uint16 yyrline
[] =
672 0, 209, 209, 217, 219, 223, 224, 234, 235, 240,
673 241, 246, 247, 248, 249, 250, 251, 256, 265, 266,
674 267, 268, 269, 270, 271, 272, 273, 274, 275, 290,
675 291, 315, 316, 317, 318, 322, 323, 324, 328, 335,
676 342, 346, 350, 357, 372, 373, 377, 389, 389, 394,
677 394, 399, 410, 425, 426, 427, 431, 432, 437, 439,
678 444, 445, 450, 452, 457, 458, 462, 463, 464, 465,
679 470, 475, 480, 486, 492, 503, 504, 513, 514, 520,
680 521, 522, 529, 529, 534, 535, 536, 541, 543, 545,
681 547, 549, 551, 556, 558, 569, 570, 575, 576, 577,
682 586, 606, 608, 617, 622, 623, 628, 635, 637
686 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
687 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
688 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
689 static const char *const yytname
[] =
691 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
692 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
693 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
694 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
695 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
696 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
697 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
698 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
699 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
700 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
701 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
702 "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"", "\"=\"",
703 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
704 "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
705 "input", "prologue_declarations", "prologue_declaration",
706 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
707 "precedence_declaration", "precedence_declarator", "type.opt",
708 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
709 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
710 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
711 "named_ref.opt", "variable", "content.opt", "braceless", "id",
712 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
717 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
719 static const yytype_uint16 yytoknum
[] =
721 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
722 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
723 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
724 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
725 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
726 305, 306, 307, 308, 309, 310, 311, 312
730 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
731 static const yytype_uint8 yyr1
[] =
733 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
734 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
735 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
736 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
737 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
738 64, 64, 67, 68, 68, 68, 69, 69, 70, 70,
739 71, 71, 72, 72, 73, 73, 74, 74, 74, 74,
740 75, 75, 75, 75, 75, 76, 76, 77, 77, 78,
741 78, 78, 80, 79, 81, 81, 81, 82, 82, 82,
742 82, 82, 82, 83, 83, 84, 84, 85, 85, 85,
743 86, 87, 87, 88, 89, 89, 90, 91, 91
746 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
747 static const yytype_uint8 yyr2
[] =
749 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
750 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
751 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
752 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
753 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
754 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
755 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
756 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
757 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
758 3, 3, 3, 0, 1, 1, 1, 0, 1, 1,
759 1, 1, 1, 1, 1, 1, 1, 0, 2
762 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
763 Performed when YYTABLE doesn't specify something else to do. Zero
764 means the default is an error. */
765 static const yytype_uint8 yydefact
[] =
767 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
768 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
769 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
770 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
771 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
772 0, 0, 0, 100, 0, 42, 96, 95, 97, 10,
773 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
774 0, 27, 29, 30, 106, 102, 101, 104, 37, 105,
775 0, 103, 0, 0, 77, 79, 93, 45, 0, 57,
776 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
777 69, 38, 64, 66, 39, 43, 99, 98, 8, 15,
778 22, 26, 81, 80, 0, 78, 2, 94, 82, 46,
779 52, 58, 60, 76, 72, 73, 63, 65, 108, 87,
780 59, 61, 74, 83, 84, 87, 86, 0, 0, 0,
781 93, 93, 85, 90, 91, 92, 89, 88
784 /* YYDEFGOTO[NTERM-NUM]. */
785 static const yytype_int16 yydefgoto
[] =
787 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
788 47, 90, 120, 121, 96, 101, 102, 92, 93, 83,
789 84, 85, 129, 133, 134, 118, 58, 108, 55, 77,
793 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
795 #define YYPACT_NINF -91
796 static const yytype_int16 yypact
[] =
798 -91, 3, 103, -91, -91, -91, -36, 2, 10, -91,
799 -91, -91, 9, -91, -91, 32, 60, -91, 65, 67,
800 27, -91, 41, 73, 51, -91, 39, -91, -91, -91,
801 40, 52, -91, 93, 95, 33, -91, -91, -91, 15,
802 -91, -91, 53, -91, -91, -91, -91, 46, 43, 43,
803 33, 11, 11, -91, 61, -91, -91, -91, 35, -91,
804 -91, -91, -91, 100, -91, -91, -91, -91, 102, -91,
805 113, -91, -91, -91, -91, -91, -91, -91, -91, -91,
806 64, -91, 94, 1, -91, -91, 62, -91, 61, -91,
807 33, -91, -91, 43, 86, 43, 33, -91, -91, -91,
808 -91, 11, -91, -91, 11, -91, -91, -91, -91, -91,
809 -91, -91, -91, -91, 72, -91, -91, -91, -91, -91,
810 33, -91, 142, -91, 145, -91, -91, -91, -91, -91,
811 -91, -91, -91, 17, 34, -91, -91, 33, 146, 97,
812 62, 62, 34, -91, -91, -91, -91, -91
815 /* YYPGOTO[NTERM-NUM]. */
816 static const yytype_int16 yypgoto
[] =
818 -91, -91, -91, -91, 147, -91, -91, -91, -91, -91,
819 -91, -91, -91, 37, -91, 106, -60, -33, 105, -91,
820 69, -91, -91, -91, 24, -48, -91, -91, -49, -20,
824 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
825 positive, shift that token. If negative, reduce the rule which
826 number is the opposite. If YYTABLE_NINF, syntax error. */
827 #define YYTABLE_NINF -108
828 static const yytype_int16 yytable
[] =
830 78, -107, 80, 3, 125, 105, 4, 5, 6, 7,
831 8, 9, 10, 11, 74, 97, 80, 12, 50, 14,
832 4, 5, 6, 7, 8, 9, 10, 11, 94, 94,
833 62, 12, 27, 14, 132, 56, 74, 74, 106, 119,
834 35, 127, 67, 69, 127, 51, 27, 137, 138, 139,
835 81, 114, 53, 52, 35, 122, 75, 54, 42, 76,
836 123, 126, 123, 59, 81, 98, 99, 100, 135, 60,
837 136, 61, 42, 94, 63, 94, 65, 140, 75, 75,
838 57, 76, 76, 107, 64, 122, 68, 70, 75, 74,
839 124, 76, 146, 147, 66, 71, 72, 91, 73, 141,
840 89, 87, 143, 109, 53, 110, 117, 141, 4, 5,
841 6, 7, 8, 9, 10, 11, 111, 112, 128, 12,
842 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
843 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
844 33, 34, 35, 36, 37, 38, 131, 113, 74, 44,
845 144, 145, 115, 39, 95, 40, 41, 130, 104, 142,
849 #define yypact_value_is_default(yystate) \
852 #define yytable_value_is_error(yytable_value) \
855 static const yytype_uint8 yycheck
[] =
857 35, 0, 1, 0, 94, 54, 5, 6, 7, 8,
858 9, 10, 11, 12, 3, 50, 1, 16, 54, 18,
859 5, 6, 7, 8, 9, 10, 11, 12, 48, 49,
860 3, 16, 31, 18, 124, 3, 3, 3, 3, 88,
861 39, 101, 3, 3, 104, 43, 31, 13, 14, 15,
862 49, 50, 43, 43, 39, 90, 45, 48, 57, 48,
863 93, 96, 95, 3, 49, 54, 55, 56, 51, 4,
864 53, 4, 57, 93, 47, 95, 3, 43, 45, 45,
865 48, 48, 48, 48, 43, 120, 47, 47, 45, 3,
866 4, 48, 140, 141, 43, 43, 3, 54, 3, 134,
867 54, 48, 137, 3, 43, 3, 44, 142, 5, 6,
868 7, 8, 9, 10, 11, 12, 3, 53, 46, 16,
869 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
870 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
871 37, 38, 39, 40, 41, 42, 4, 53, 3, 2,
872 4, 54, 83, 50, 49, 52, 53, 120, 52, 135,
876 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
877 symbol of state STATE-NUM. */
878 static const yytype_uint8 yystos
[] =
880 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
881 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
882 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
883 34, 35, 36, 37, 38, 39, 40, 41, 42, 50,
884 52, 53, 57, 61, 62, 64, 67, 68, 66, 65,
885 54, 43, 43, 43, 48, 86, 3, 48, 84, 3,
886 4, 4, 3, 47, 43, 3, 43, 3, 47, 3,
887 47, 43, 3, 3, 3, 45, 48, 87, 89, 90,
888 1, 49, 62, 77, 78, 79, 88, 48, 63, 54,
889 69, 54, 75, 76, 87, 76, 72, 89, 54, 55,
890 56, 73, 74, 89, 73, 86, 3, 48, 85, 3,
891 3, 3, 53, 53, 50, 78, 91, 44, 83, 86,
892 70, 71, 89, 75, 4, 90, 89, 74, 46, 80,
893 71, 4, 90, 81, 82, 51, 53, 13, 14, 15,
894 43, 89, 82, 89, 4, 54, 83, 83
897 #define yyerrok (yyerrstatus = 0)
898 #define yyclearin (yychar = YYEMPTY)
902 #define YYACCEPT goto yyacceptlab
903 #define YYABORT goto yyabortlab
904 #define YYERROR goto yyerrorlab
907 /* Like YYERROR except do call yyerror. This remains here temporarily
908 to ease the transition to the new meaning of YYERROR, for GCC.
909 Once GCC version 2 has supplanted version 1, this can go. However,
910 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
911 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
914 #define YYFAIL goto yyerrlab
916 /* This is here to suppress warnings from the GCC cpp's
917 -Wunused-macros. Normally we don't worry about that warning, but
918 some users do, and we want to make it easy for users to remove
919 YYFAIL uses, which will produce warnings from Bison 2.5. */
922 #define YYRECOVERING() (!!yyerrstatus)
924 #define YYBACKUP(Token, Value) \
926 if (yychar == YYEMPTY && yylen == 1) \
935 yyerror (YY_("syntax error: cannot back up")); \
942 #define YYERRCODE 256
945 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
946 If N is 0, then set CURRENT to the empty location which ends
947 the previous symbol: RHS[0] (always defined). */
949 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
950 #ifndef YYLLOC_DEFAULT
951 # define YYLLOC_DEFAULT(Current, Rhs, N) \
955 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
956 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
957 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
958 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
962 (Current).first_line = (Current).last_line = \
963 YYRHSLOC (Rhs, 0).last_line; \
964 (Current).first_column = (Current).last_column = \
965 YYRHSLOC (Rhs, 0).last_column; \
971 /* YY_LOCATION_PRINT -- Print the location on the stream.
972 This macro was not mandated originally: define only if we know
973 we won't break user code: when these are the locations we know. */
975 #ifndef YY_LOCATION_PRINT
976 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
977 # define YY_LOCATION_PRINT(File, Loc) \
978 fprintf (File, "%d.%d-%d.%d", \
979 (Loc).first_line, (Loc).first_column, \
980 (Loc).last_line, (Loc).last_column)
982 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
987 /* YYLEX -- calling `yylex' with the right arguments. */
990 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
992 # define YYLEX yylex (&yylval, &yylloc)
995 /* Enable debugging if requested. */
999 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1000 # define YYFPRINTF fprintf
1003 # define YYDPRINTF(Args) \
1009 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1013 YYFPRINTF (stderr, "%s ", Title); \
1014 yy_symbol_print (stderr, \
1015 Type, Value, Location); \
1016 YYFPRINTF (stderr, "\n"); \
1021 /*--------------------------------.
1022 | Print this symbol on YYOUTPUT. |
1023 `--------------------------------*/
1026 #if (defined __STDC__ || defined __C99__FUNC__ \
1027 || defined __cplusplus || defined _MSC_VER)
1029 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1032 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1035 YYSTYPE
const * const yyvaluep
;
1036 YYLTYPE
const * const yylocationp
;
1041 YYUSE (yylocationp
);
1043 if (yytype
< YYNTOKENS
)
1044 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1050 case 3: /* "\"string\"" */
1052 /* Line 797 of yacc.c */
1053 #line 184 "parse-gram.y"
1054 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1056 /* Line 797 of yacc.c */
1057 #line 1058 "parse-gram.c"
1059 case 4: /* "\"integer\"" */
1061 /* Line 797 of yacc.c */
1062 #line 196 "parse-gram.y"
1063 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1065 /* Line 797 of yacc.c */
1066 #line 1067 "parse-gram.c"
1068 case 43: /* "\"{...}\"" */
1070 /* Line 797 of yacc.c */
1071 #line 186 "parse-gram.y"
1072 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1074 /* Line 797 of yacc.c */
1075 #line 1076 "parse-gram.c"
1077 case 44: /* "\"[identifier]\"" */
1079 /* Line 797 of yacc.c */
1080 #line 191 "parse-gram.y"
1081 { fprintf (stderr
, "[%s]", (yyvaluep
->uniqstr
)); };
1083 /* Line 797 of yacc.c */
1084 #line 1085 "parse-gram.c"
1086 case 45: /* "\"char\"" */
1088 /* Line 797 of yacc.c */
1089 #line 178 "parse-gram.y"
1090 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1092 /* Line 797 of yacc.c */
1093 #line 1094 "parse-gram.c"
1095 case 46: /* "\"epilogue\"" */
1097 /* Line 797 of yacc.c */
1098 #line 186 "parse-gram.y"
1099 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1101 /* Line 797 of yacc.c */
1102 #line 1103 "parse-gram.c"
1104 case 48: /* "\"identifier\"" */
1106 /* Line 797 of yacc.c */
1107 #line 190 "parse-gram.y"
1108 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1110 /* Line 797 of yacc.c */
1111 #line 1112 "parse-gram.c"
1113 case 49: /* "\"identifier:\"" */
1115 /* Line 797 of yacc.c */
1116 #line 192 "parse-gram.y"
1117 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1119 /* Line 797 of yacc.c */
1120 #line 1121 "parse-gram.c"
1122 case 52: /* "\"%{...%}\"" */
1124 /* Line 797 of yacc.c */
1125 #line 186 "parse-gram.y"
1126 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1128 /* Line 797 of yacc.c */
1129 #line 1130 "parse-gram.c"
1131 case 54: /* "\"type\"" */
1133 /* Line 797 of yacc.c */
1134 #line 193 "parse-gram.y"
1135 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1137 /* Line 797 of yacc.c */
1138 #line 1139 "parse-gram.c"
1140 case 71: /* "symbol.prec" */
1142 /* Line 797 of yacc.c */
1143 #line 199 "parse-gram.y"
1144 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1146 /* Line 797 of yacc.c */
1147 #line 1148 "parse-gram.c"
1149 case 84: /* "variable" */
1151 /* Line 797 of yacc.c */
1152 #line 190 "parse-gram.y"
1153 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1155 /* Line 797 of yacc.c */
1156 #line 1157 "parse-gram.c"
1158 case 85: /* "content.opt" */
1160 /* Line 797 of yacc.c */
1161 #line 186 "parse-gram.y"
1162 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1164 /* Line 797 of yacc.c */
1165 #line 1166 "parse-gram.c"
1167 case 86: /* "braceless" */
1169 /* Line 797 of yacc.c */
1170 #line 186 "parse-gram.y"
1171 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1173 /* Line 797 of yacc.c */
1174 #line 1175 "parse-gram.c"
1178 /* Line 797 of yacc.c */
1179 #line 199 "parse-gram.y"
1180 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1182 /* Line 797 of yacc.c */
1183 #line 1184 "parse-gram.c"
1185 case 88: /* "id_colon" */
1187 /* Line 797 of yacc.c */
1188 #line 200 "parse-gram.y"
1189 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1191 /* Line 797 of yacc.c */
1192 #line 1193 "parse-gram.c"
1194 case 89: /* "symbol" */
1196 /* Line 797 of yacc.c */
1197 #line 199 "parse-gram.y"
1198 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1200 /* Line 797 of yacc.c */
1201 #line 1202 "parse-gram.c"
1203 case 90: /* "string_as_id" */
1205 /* Line 797 of yacc.c */
1206 #line 199 "parse-gram.y"
1207 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1209 /* Line 797 of yacc.c */
1210 #line 1211 "parse-gram.c"
1218 /*--------------------------------.
1219 | Print this symbol on YYOUTPUT. |
1220 `--------------------------------*/
1222 #if (defined __STDC__ || defined __C99__FUNC__ \
1223 || defined __cplusplus || defined _MSC_VER)
1225 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1228 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1231 YYSTYPE
const * const yyvaluep
;
1232 YYLTYPE
const * const yylocationp
;
1235 if (yytype
< YYNTOKENS
)
1236 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1238 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1240 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1241 YYFPRINTF (yyoutput
, ": ");
1242 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1243 YYFPRINTF (yyoutput
, ")");
1246 /*------------------------------------------------------------------.
1247 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1249 `------------------------------------------------------------------*/
1251 #if (defined __STDC__ || defined __C99__FUNC__ \
1252 || defined __cplusplus || defined _MSC_VER)
1254 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1257 yy_stack_print (yybottom
, yytop
)
1258 yytype_int16
*yybottom
;
1259 yytype_int16
*yytop
;
1262 YYFPRINTF (stderr
, "Stack now");
1263 for (; yybottom
<= yytop
; yybottom
++)
1265 int yybot
= *yybottom
;
1266 YYFPRINTF (stderr
, " %d", yybot
);
1268 YYFPRINTF (stderr
, "\n");
1271 # define YY_STACK_PRINT(Bottom, Top) \
1274 yy_stack_print ((Bottom), (Top)); \
1278 /*------------------------------------------------.
1279 | Report that the YYRULE is going to be reduced. |
1280 `------------------------------------------------*/
1282 #if (defined __STDC__ || defined __C99__FUNC__ \
1283 || defined __cplusplus || defined _MSC_VER)
1285 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1288 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1294 int yynrhs
= yyr2
[yyrule
];
1296 unsigned long int yylno
= yyrline
[yyrule
];
1297 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1299 /* The symbols being reduced. */
1300 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1302 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1303 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1304 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1305 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1306 YYFPRINTF (stderr
, "\n");
1310 # define YY_REDUCE_PRINT(Rule) \
1313 yy_reduce_print (yyvsp, yylsp, Rule); \
1316 /* Nonzero means print parse trace. It is left uninitialized so that
1317 multiple parsers can coexist. */
1319 #else /* !YYDEBUG */
1320 # define YYDPRINTF(Args)
1321 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1322 # define YY_STACK_PRINT(Bottom, Top)
1323 # define YY_REDUCE_PRINT(Rule)
1324 #endif /* !YYDEBUG */
1327 /* YYINITDEPTH -- initial size of the parser's stacks. */
1329 # define YYINITDEPTH 200
1332 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1333 if the built-in stack extension method is used).
1335 Do not make this value too large; the results are undefined if
1336 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1337 evaluated with infinite-precision integer arithmetic. */
1340 # define YYMAXDEPTH 10000
1348 # if defined __GLIBC__ && defined _STRING_H
1349 # define yystrlen strlen
1351 /* Return the length of YYSTR. */
1352 #if (defined __STDC__ || defined __C99__FUNC__ \
1353 || defined __cplusplus || defined _MSC_VER)
1355 yystrlen (const char *yystr
)
1363 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1371 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1372 # define yystpcpy stpcpy
1374 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1376 #if (defined __STDC__ || defined __C99__FUNC__ \
1377 || defined __cplusplus || defined _MSC_VER)
1379 yystpcpy (char *yydest
, const char *yysrc
)
1382 yystpcpy (yydest
, yysrc
)
1388 const char *yys
= yysrc
;
1390 while ((*yyd
++ = *yys
++) != '\0')
1399 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1400 quotes and backslashes, so that it's suitable for yyerror. The
1401 heuristic is that double-quoting is unnecessary unless the string
1402 contains an apostrophe, a comma, or backslash (other than
1403 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1404 null, do not copy; instead, return the length of what the result
1407 yytnamerr (char *yyres
, const char *yystr
)
1412 char const *yyp
= yystr
;
1419 goto do_not_strip_quotes
;
1423 goto do_not_strip_quotes
;
1436 do_not_strip_quotes
: ;
1440 return yystrlen (yystr
);
1442 return yystpcpy (yyres
, yystr
) - yyres
;
1446 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1447 about the unexpected token YYTOKEN while in state YYSTATE.
1449 Return 0 if *YYMSG was successfully written. Return 1 if an ordinary
1450 "syntax error" message will suffice instead. Return 2 if *YYMSG is
1451 not large enough to hold the message. In the last case, also set
1452 *YYMSG_ALLOC to either (a) the required number of bytes or (b) zero
1453 if the required number of bytes is too large to store. */
1455 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1456 int yystate
, int yytoken
)
1458 int yyn
= yypact
[yystate
];
1460 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1464 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1465 YYSIZE_T yysize
= yysize0
;
1467 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1468 /* Internationalized format string. */
1469 const char *yyformat
= 0;
1470 /* Arguments of yyformat. */
1471 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1473 /* Start YYX at -YYN if negative to avoid negative indexes in
1474 YYCHECK. In other words, skip the first -YYN actions for
1475 this state because they are default actions. */
1476 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1478 /* Stay within bounds of both yycheck and yytname. */
1479 int yychecklim
= YYLAST
- yyn
+ 1;
1480 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1481 /* Number of reported tokens (one for the "unexpected", one per
1486 yyarg
[yycount
++] = yytname
[yytoken
];
1488 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1489 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1490 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1492 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1498 yyarg
[yycount
++] = yytname
[yyx
];
1499 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1500 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1511 #define YYCASE_(N, S) \
1515 YYCASE_(1, YY_("syntax error, unexpected %s"));
1516 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1517 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1518 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1519 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1523 yysize1
= yysize
+ yystrlen (yyformat
);
1524 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1532 if (*yymsg_alloc
< yysize
)
1534 *yymsg_alloc
= 2 * yysize
;
1535 if (! (yysize
<= *yymsg_alloc
1536 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1537 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1541 /* Avoid sprintf, as that infringes on the user's name space.
1542 Don't have undefined behavior even if the translation
1543 produced a string with the wrong number of "%s"s. */
1547 while ((*yyp
= *yyformat
) != '\0')
1548 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1550 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1562 #endif /* YYERROR_VERBOSE */
1565 /*-----------------------------------------------.
1566 | Release the memory associated to this symbol. |
1567 `-----------------------------------------------*/
1570 #if (defined __STDC__ || defined __C99__FUNC__ \
1571 || defined __cplusplus || defined _MSC_VER)
1573 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1576 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1580 YYLTYPE
*yylocationp
;
1584 YYUSE (yylocationp
);
1588 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1599 /* Prevent warnings from -Wmissing-prototypes. */
1600 #ifdef YYPARSE_PARAM
1601 #if defined __STDC__ || defined __cplusplus
1602 int yyparse (void *YYPARSE_PARAM
);
1606 #else /* ! YYPARSE_PARAM */
1607 #if defined __STDC__ || defined __cplusplus
1612 #endif /* ! YYPARSE_PARAM */
1619 #ifdef YYPARSE_PARAM
1620 #if (defined __STDC__ || defined __C99__FUNC__ \
1621 || defined __cplusplus || defined _MSC_VER)
1623 yyparse (void *YYPARSE_PARAM
)
1626 yyparse (YYPARSE_PARAM
)
1627 void *YYPARSE_PARAM
;
1629 #else /* ! YYPARSE_PARAM */
1630 #if (defined __STDC__ || defined __C99__FUNC__ \
1631 || defined __cplusplus || defined _MSC_VER)
1641 /* The lookahead symbol. */
1644 /* The semantic value of the lookahead symbol. */
1647 /* Location data for the lookahead symbol. */
1650 /* Number of syntax errors so far. */
1654 /* Number of tokens to shift before error messages enabled. */
1657 /* The stacks and their tools:
1658 `yyss': related to states.
1659 `yyvs': related to semantic values.
1660 `yyls': related to locations.
1662 Refer to the stacks thru separate pointers, to allow yyoverflow
1663 to reallocate them elsewhere. */
1665 /* The state stack. */
1666 yytype_int16 yyssa
[YYINITDEPTH
];
1668 yytype_int16
*yyssp
;
1670 /* The semantic value stack. */
1671 YYSTYPE yyvsa
[YYINITDEPTH
];
1675 /* The location stack. */
1676 YYLTYPE yylsa
[YYINITDEPTH
];
1680 /* The locations where the error started and ended. */
1681 YYLTYPE yyerror_range
[3];
1683 YYSIZE_T yystacksize
;
1687 /* Lookahead token as an internal (translated) token number. */
1689 /* The variables used to return semantic value and location from the
1695 /* Buffer for error messages, and its allocated size. */
1697 char *yymsg
= yymsgbuf
;
1698 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1701 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1703 /* The number of symbols on the RHS of the reduced rule.
1704 Keep to zero when no symbol should be popped. */
1711 yystacksize
= YYINITDEPTH
;
1713 YYDPRINTF ((stderr
, "Starting parse\n"));
1718 yychar
= YYEMPTY
; /* Cause a token to be read. */
1720 /* Initialize stack pointers.
1721 Waste one element of value and location stack
1722 so that they stay on the same level as the state stack.
1723 The wasted elements are never initialized. */
1728 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1729 /* Initialize the default location before parsing starts. */
1730 yylloc
.first_line
= yylloc
.last_line
= 1;
1731 yylloc
.first_column
= yylloc
.last_column
= 1;
1734 /* User initialization code. */
1736 /* Line 1279 of yacc.c */
1737 #line 86 "parse-gram.y"
1739 /* Bison's grammar can initial empty locations, hence a default
1740 location is needed. */
1741 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1742 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1745 /* Line 1279 of yacc.c */
1746 #line 1747 "parse-gram.c"
1751 /*------------------------------------------------------------.
1752 | yynewstate -- Push a new state, which is found in yystate. |
1753 `------------------------------------------------------------*/
1755 /* In all cases, when you get here, the value and location stacks
1756 have just been pushed. So pushing a state here evens the stacks. */
1762 if (yyss
+ yystacksize
- 1 <= yyssp
)
1764 /* Get the current used size of the three stacks, in elements. */
1765 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1769 /* Give user a chance to reallocate the stack. Use copies of
1770 these so that the &'s don't force the real ones into
1772 YYSTYPE
*yyvs1
= yyvs
;
1773 yytype_int16
*yyss1
= yyss
;
1774 YYLTYPE
*yyls1
= yyls
;
1776 /* Each stack pointer address is followed by the size of the
1777 data in use in that stack, in bytes. This used to be a
1778 conditional around just the two extra args, but that might
1779 be undefined if yyoverflow is a macro. */
1780 yyoverflow (YY_("memory exhausted"),
1781 &yyss1
, yysize
* sizeof (*yyssp
),
1782 &yyvs1
, yysize
* sizeof (*yyvsp
),
1783 &yyls1
, yysize
* sizeof (*yylsp
),
1790 #else /* no yyoverflow */
1791 # ifndef YYSTACK_RELOCATE
1792 goto yyexhaustedlab
;
1794 /* Extend the stack our own way. */
1795 if (YYMAXDEPTH
<= yystacksize
)
1796 goto yyexhaustedlab
;
1798 if (YYMAXDEPTH
< yystacksize
)
1799 yystacksize
= YYMAXDEPTH
;
1802 yytype_int16
*yyss1
= yyss
;
1803 union yyalloc
*yyptr
=
1804 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1806 goto yyexhaustedlab
;
1807 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1808 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1809 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1810 # undef YYSTACK_RELOCATE
1812 YYSTACK_FREE (yyss1
);
1815 #endif /* no yyoverflow */
1817 yyssp
= yyss
+ yysize
- 1;
1818 yyvsp
= yyvs
+ yysize
- 1;
1819 yylsp
= yyls
+ yysize
- 1;
1821 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1822 (unsigned long int) yystacksize
));
1824 if (yyss
+ yystacksize
- 1 <= yyssp
)
1828 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1830 if (yystate
== YYFINAL
)
1840 /* Do appropriate processing given the current state. Read a
1841 lookahead token if we need one and don't already have one. */
1843 /* First try to decide what to do without reference to lookahead token. */
1844 yyn
= yypact
[yystate
];
1845 if (yypact_value_is_default (yyn
))
1848 /* Not known => get a lookahead token if don't already have one. */
1850 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1851 if (yychar
== YYEMPTY
)
1853 YYDPRINTF ((stderr
, "Reading a token: "));
1857 if (yychar
<= YYEOF
)
1859 yychar
= yytoken
= YYEOF
;
1860 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1864 yytoken
= YYTRANSLATE (yychar
);
1865 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1868 /* If the proper action on seeing token YYTOKEN is to reduce or to
1869 detect an error, take that action. */
1871 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1876 if (yytable_value_is_error (yyn
))
1882 /* Count tokens shifted since error; after three, turn off error
1887 /* Shift the lookahead token. */
1888 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1890 /* Discard the shifted token. */
1899 /*-----------------------------------------------------------.
1900 | yydefault -- do the default action for the current state. |
1901 `-----------------------------------------------------------*/
1903 yyn
= yydefact
[yystate
];
1909 /*-----------------------------.
1910 | yyreduce -- Do a reduction. |
1911 `-----------------------------*/
1913 /* yyn is the number of a rule to reduce with. */
1916 /* If YYLEN is nonzero, implement the default value of the action:
1919 Otherwise, the following line sets YYVAL to garbage.
1920 This behavior is undocumented and Bison
1921 users should not rely upon it. Assigning to YYVAL
1922 unconditionally makes the parser a bit smaller, and it avoids a
1923 GCC warning that YYVAL may be used uninitialized. */
1924 yyval
= yyvsp
[1-yylen
];
1926 /* Default location. */
1927 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1928 YY_REDUCE_PRINT (yyn
);
1933 /* Line 1492 of yacc.c */
1934 #line 225 "parse-gram.y"
1936 code_props plain_code
;
1937 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1938 code_props_translate_code (&plain_code
);
1939 gram_scanner_last_string_free ();
1940 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1941 plain_code
.code
, (yylsp
[(1) - (1)]));
1942 code_scanner_last_string_free ();
1948 /* Line 1492 of yacc.c */
1949 #line 234 "parse-gram.y"
1950 { debug_flag
= true; }
1955 /* Line 1492 of yacc.c */
1956 #line 236 "parse-gram.y"
1958 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
),
1959 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
1965 /* Line 1492 of yacc.c */
1966 #line 240 "parse-gram.y"
1967 { defines_flag
= true; }
1972 /* Line 1492 of yacc.c */
1973 #line 242 "parse-gram.y"
1975 defines_flag
= true;
1976 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1982 /* Line 1492 of yacc.c */
1983 #line 246 "parse-gram.y"
1984 { error_verbose
= true; }
1989 /* Line 1492 of yacc.c */
1990 #line 247 "parse-gram.y"
1991 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1996 /* Line 1492 of yacc.c */
1997 #line 248 "parse-gram.y"
1998 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2003 /* Line 1492 of yacc.c */
2004 #line 249 "parse-gram.y"
2005 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
2010 /* Line 1492 of yacc.c */
2011 #line 250 "parse-gram.y"
2012 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
2017 /* Line 1492 of yacc.c */
2018 #line 252 "parse-gram.y"
2020 nondeterministic_parser
= true;
2027 /* Line 1492 of yacc.c */
2028 #line 257 "parse-gram.y"
2031 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
2032 code_props_translate_code (&action
);
2033 gram_scanner_last_string_free ();
2034 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2035 code_scanner_last_string_free ();
2041 /* Line 1492 of yacc.c */
2042 #line 265 "parse-gram.y"
2043 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, (yylsp
[(1) - (2)])); }
2048 /* Line 1492 of yacc.c */
2049 #line 266 "parse-gram.y"
2050 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2055 /* Line 1492 of yacc.c */
2056 #line 267 "parse-gram.y"
2057 { locations_flag
= true; }
2062 /* Line 1492 of yacc.c */
2063 #line 268 "parse-gram.y"
2064 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2069 /* Line 1492 of yacc.c */
2070 #line 269 "parse-gram.y"
2071 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2076 /* Line 1492 of yacc.c */
2077 #line 270 "parse-gram.y"
2078 { no_lines_flag
= true; }
2083 /* Line 1492 of yacc.c */
2084 #line 271 "parse-gram.y"
2085 { nondeterministic_parser
= true; }
2090 /* Line 1492 of yacc.c */
2091 #line 272 "parse-gram.y"
2092 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2097 /* Line 1492 of yacc.c */
2098 #line 273 "parse-gram.y"
2099 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2104 /* Line 1492 of yacc.c */
2105 #line 274 "parse-gram.y"
2106 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2111 /* Line 1492 of yacc.c */
2112 #line 276 "parse-gram.y"
2114 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2115 `%define api.pure' in a backward-compatible manner here. First, don't
2116 complain if %pure-parser is specified multiple times. */
2117 if (!muscle_find_const ("percent_define(api.pure)"))
2118 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2119 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2120 /* In all cases, use api.pure now so that the backend doesn't complain if
2121 the skeleton ignores api.pure, but do warn now if there's a previous
2122 conflicting definition from an actual %define. */
2123 if (!muscle_percent_define_flag_if ("api.pure"))
2124 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2125 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2131 /* Line 1492 of yacc.c */
2132 #line 290 "parse-gram.y"
2133 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2138 /* Line 1492 of yacc.c */
2139 #line 292 "parse-gram.y"
2141 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2142 if (strchr (skeleton_user
, '/'))
2144 size_t dir_length
= strlen (current_file
);
2145 char *skeleton_build
;
2146 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2148 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2151 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2154 strncpy (skeleton_build
, current_file
, dir_length
);
2155 skeleton_build
[dir_length
++] = '/';
2157 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2158 skeleton_user
= uniqstr_new (skeleton_build
);
2159 free (skeleton_build
);
2161 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[(1) - (2)]));
2167 /* Line 1492 of yacc.c */
2168 #line 315 "parse-gram.y"
2169 { token_table_flag
= true; }
2174 /* Line 1492 of yacc.c */
2175 #line 316 "parse-gram.y"
2176 { report_flag
|= report_states
; }
2181 /* Line 1492 of yacc.c */
2182 #line 317 "parse-gram.y"
2183 { yacc_flag
= true; }
2188 /* Line 1492 of yacc.c */
2189 #line 325 "parse-gram.y"
2191 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2197 /* Line 1492 of yacc.c */
2198 #line 329 "parse-gram.y"
2201 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2202 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2203 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2209 /* Line 1492 of yacc.c */
2210 #line 336 "parse-gram.y"
2213 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2214 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2215 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2221 /* Line 1492 of yacc.c */
2222 #line 343 "parse-gram.y"
2224 default_prec
= true;
2230 /* Line 1492 of yacc.c */
2231 #line 347 "parse-gram.y"
2233 default_prec
= false;
2239 /* Line 1492 of yacc.c */
2240 #line 351 "parse-gram.y"
2242 /* Do not invoke muscle_percent_code_grow here since it invokes
2243 muscle_user_name_list_grow. */
2244 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2245 code_scanner_last_string_free ();
2251 /* Line 1492 of yacc.c */
2252 #line 358 "parse-gram.y"
2254 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2255 code_scanner_last_string_free ();
2261 /* Line 1492 of yacc.c */
2262 #line 372 "parse-gram.y"
2268 /* Line 1492 of yacc.c */
2269 #line 373 "parse-gram.y"
2270 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2275 /* Line 1492 of yacc.c */
2276 #line 378 "parse-gram.y"
2279 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2280 code_scanner_last_string_free ();
2286 /* Line 1492 of yacc.c */
2287 #line 389 "parse-gram.y"
2288 { current_class
= nterm_sym
; }
2293 /* Line 1492 of yacc.c */
2294 #line 390 "parse-gram.y"
2296 current_class
= unknown_sym
;
2297 current_type
= NULL
;
2303 /* Line 1492 of yacc.c */
2304 #line 394 "parse-gram.y"
2305 { current_class
= token_sym
; }
2310 /* Line 1492 of yacc.c */
2311 #line 395 "parse-gram.y"
2313 current_class
= unknown_sym
;
2314 current_type
= NULL
;
2320 /* Line 1492 of yacc.c */
2321 #line 400 "parse-gram.y"
2325 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2326 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2327 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2333 /* Line 1492 of yacc.c */
2334 #line 411 "parse-gram.y"
2338 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2340 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2341 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2343 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2344 current_type
= NULL
;
2350 /* Line 1492 of yacc.c */
2351 #line 425 "parse-gram.y"
2352 { (yyval
.assoc
) = left_assoc
; }
2357 /* Line 1492 of yacc.c */
2358 #line 426 "parse-gram.y"
2359 { (yyval
.assoc
) = right_assoc
; }
2364 /* Line 1492 of yacc.c */
2365 #line 427 "parse-gram.y"
2366 { (yyval
.assoc
) = non_assoc
; }
2371 /* Line 1492 of yacc.c */
2372 #line 431 "parse-gram.y"
2373 { current_type
= NULL
; }
2378 /* Line 1492 of yacc.c */
2379 #line 432 "parse-gram.y"
2380 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2385 /* Line 1492 of yacc.c */
2386 #line 438 "parse-gram.y"
2387 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2392 /* Line 1492 of yacc.c */
2393 #line 440 "parse-gram.y"
2394 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2399 /* Line 1492 of yacc.c */
2400 #line 444 "parse-gram.y"
2401 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2406 /* Line 1492 of yacc.c */
2407 #line 445 "parse-gram.y"
2408 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2413 /* Line 1492 of yacc.c */
2414 #line 451 "parse-gram.y"
2415 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2420 /* Line 1492 of yacc.c */
2421 #line 453 "parse-gram.y"
2422 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2427 /* Line 1492 of yacc.c */
2428 #line 457 "parse-gram.y"
2429 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2434 /* Line 1492 of yacc.c */
2435 #line 458 "parse-gram.y"
2436 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2441 /* Line 1492 of yacc.c */
2442 #line 462 "parse-gram.y"
2443 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2448 /* Line 1492 of yacc.c */
2449 #line 463 "parse-gram.y"
2450 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2455 /* Line 1492 of yacc.c */
2456 #line 464 "parse-gram.y"
2457 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2462 /* Line 1492 of yacc.c */
2463 #line 465 "parse-gram.y"
2464 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2469 /* Line 1492 of yacc.c */
2470 #line 471 "parse-gram.y"
2472 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2479 /* Line 1492 of yacc.c */
2480 #line 476 "parse-gram.y"
2482 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2483 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2489 /* Line 1492 of yacc.c */
2490 #line 481 "parse-gram.y"
2492 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2493 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2494 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2500 /* Line 1492 of yacc.c */
2501 #line 487 "parse-gram.y"
2503 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2504 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2505 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2511 /* Line 1492 of yacc.c */
2512 #line 493 "parse-gram.y"
2514 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2515 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2516 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2517 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2523 /* Line 1492 of yacc.c */
2524 #line 523 "parse-gram.y"
2532 /* Line 1492 of yacc.c */
2533 #line 529 "parse-gram.y"
2534 { current_lhs
= (yyvsp
[(1) - (2)].symbol
); current_lhs_location
= (yylsp
[(1) - (2)]);
2535 current_lhs_named_ref
= (yyvsp
[(2) - (2)].named_ref
); }
2540 /* Line 1492 of yacc.c */
2541 #line 534 "parse-gram.y"
2542 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2547 /* Line 1492 of yacc.c */
2548 #line 535 "parse-gram.y"
2549 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2554 /* Line 1492 of yacc.c */
2555 #line 541 "parse-gram.y"
2556 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2557 current_lhs_named_ref
); }
2562 /* Line 1492 of yacc.c */
2563 #line 544 "parse-gram.y"
2564 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (3)].symbol
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2569 /* Line 1492 of yacc.c */
2570 #line 546 "parse-gram.y"
2571 { grammar_current_rule_action_append ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2576 /* Line 1492 of yacc.c */
2577 #line 548 "parse-gram.y"
2578 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2583 /* Line 1492 of yacc.c */
2584 #line 550 "parse-gram.y"
2585 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2590 /* Line 1492 of yacc.c */
2591 #line 552 "parse-gram.y"
2592 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2597 /* Line 1492 of yacc.c */
2598 #line 556 "parse-gram.y"
2599 { (yyval
.named_ref
) = 0; }
2604 /* Line 1492 of yacc.c */
2605 #line 558 "parse-gram.y"
2606 { (yyval
.named_ref
) = named_ref_new((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2611 /* Line 1492 of yacc.c */
2612 #line 570 "parse-gram.y"
2613 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2618 /* Line 1492 of yacc.c */
2619 #line 575 "parse-gram.y"
2620 { (yyval
.chars
) = ""; }
2625 /* Line 1492 of yacc.c */
2626 #line 576 "parse-gram.y"
2627 { (yyval
.chars
) = (yyvsp
[(1) - (1)].uniqstr
); }
2632 /* Line 1492 of yacc.c */
2633 #line 587 "parse-gram.y"
2635 code_props plain_code
;
2636 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2637 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2638 code_props_translate_code (&plain_code
);
2639 gram_scanner_last_string_free ();
2640 (yyval
.chars
) = plain_code
.code
;
2646 /* Line 1492 of yacc.c */
2647 #line 607 "parse-gram.y"
2648 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2653 /* Line 1492 of yacc.c */
2654 #line 609 "parse-gram.y"
2656 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2657 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2658 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2664 /* Line 1492 of yacc.c */
2665 #line 617 "parse-gram.y"
2666 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2671 /* Line 1492 of yacc.c */
2672 #line 629 "parse-gram.y"
2674 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2675 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2681 /* Line 1492 of yacc.c */
2682 #line 638 "parse-gram.y"
2684 code_props plain_code
;
2685 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2686 code_props_translate_code (&plain_code
);
2687 gram_scanner_last_string_free ();
2688 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2689 code_scanner_last_string_free ();
2695 /* Line 1492 of yacc.c */
2696 #line 2697 "parse-gram.c"
2699 /* User semantic actions sometimes alter yychar, and that requires
2700 that yytoken be updated with the new translation. We take the
2701 approach of translating immediately before every use of yytoken.
2702 One alternative is translating here after every semantic action,
2703 but that translation would be missed if the semantic action invokes
2704 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2705 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2706 incorrect destructor might then be invoked immediately. In the
2707 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2708 to an incorrect destructor call or verbose syntax error message
2709 before the lookahead is translated. */
2710 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2714 YY_STACK_PRINT (yyss
, yyssp
);
2719 /* Now `shift' the result of the reduction. Determine what state
2720 that goes to, based on the state we popped back to and the rule
2721 number reduced by. */
2725 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2726 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2727 yystate
= yytable
[yystate
];
2729 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2734 /*------------------------------------.
2735 | yyerrlab -- here on detecting error |
2736 `------------------------------------*/
2738 /* Make sure we have latest lookahead translation. See comments at
2739 user semantic actions for why this is necessary. */
2740 yytoken
= YYTRANSLATE (yychar
);
2742 /* If not already recovering from an error, report this error. */
2746 #if ! YYERROR_VERBOSE
2747 yyerror (YY_("syntax error"));
2749 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, yystate, \
2752 char const *yymsgp
= YY_("syntax error");
2753 int yysyntax_error_status
= YYSYNTAX_ERROR
;
2754 if (yysyntax_error_status
== 0)
2756 else if (yysyntax_error_status
== 2 && 0 < yymsg_alloc
)
2758 if (yymsg
!= yymsgbuf
)
2759 YYSTACK_FREE (yymsg
);
2760 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2764 yymsg_alloc
= sizeof yymsgbuf
;
2768 yysyntax_error_status
= YYSYNTAX_ERROR
;
2773 if (yysyntax_error_status
== 2)
2774 goto yyexhaustedlab
;
2776 # undef YYSYNTAX_ERROR
2780 yyerror_range
[1] = yylloc
;
2782 if (yyerrstatus
== 3)
2784 /* If just tried and failed to reuse lookahead token after an
2785 error, discard it. */
2787 if (yychar
<= YYEOF
)
2789 /* Return failure if at end of input. */
2790 if (yychar
== YYEOF
)
2795 yydestruct ("Error: discarding",
2796 yytoken
, &yylval
, &yylloc
);
2801 /* Else will try to reuse lookahead token after shifting the error
2806 /*---------------------------------------------------.
2807 | yyerrorlab -- error raised explicitly by YYERROR. |
2808 `---------------------------------------------------*/
2811 /* Pacify compilers like GCC when the user code never invokes
2812 YYERROR and the label yyerrorlab therefore never appears in user
2814 if (/*CONSTCOND*/ 0)
2817 yyerror_range
[1] = yylsp
[1-yylen
];
2818 /* Do not reclaim the symbols of the rule which action triggered
2822 YY_STACK_PRINT (yyss
, yyssp
);
2827 /*-------------------------------------------------------------.
2828 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2829 `-------------------------------------------------------------*/
2831 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2835 yyn
= yypact
[yystate
];
2836 if (!yypact_value_is_default (yyn
))
2839 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2847 /* Pop the current state because it cannot handle the error token. */
2851 yyerror_range
[1] = *yylsp
;
2852 yydestruct ("Error: popping",
2853 yystos
[yystate
], yyvsp
, yylsp
);
2856 YY_STACK_PRINT (yyss
, yyssp
);
2861 yyerror_range
[2] = yylloc
;
2862 /* Using YYLLOC is tempting, but would change the location of
2863 the lookahead. YYLOC is available though. */
2864 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2867 /* Shift the error token. */
2868 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2874 /*-------------------------------------.
2875 | yyacceptlab -- YYACCEPT comes here. |
2876 `-------------------------------------*/
2881 /*-----------------------------------.
2882 | yyabortlab -- YYABORT comes here. |
2883 `-----------------------------------*/
2888 #if !defined(yyoverflow) || YYERROR_VERBOSE
2889 /*-------------------------------------------------.
2890 | yyexhaustedlab -- memory exhaustion comes here. |
2891 `-------------------------------------------------*/
2893 yyerror (YY_("memory exhausted"));
2899 if (yychar
!= YYEMPTY
)
2901 /* Make sure we have latest lookahead translation. See comments at
2902 user semantic actions for why this is necessary. */
2903 yytoken
= YYTRANSLATE (yychar
);
2904 yydestruct ("Cleanup: discarding lookahead",
2905 yytoken
, &yylval
, &yylloc
);
2907 /* Do not reclaim the symbols of the rule which action triggered
2908 this YYABORT or YYACCEPT. */
2910 YY_STACK_PRINT (yyss
, yyssp
);
2911 while (yyssp
!= yyss
)
2913 yydestruct ("Cleanup: popping",
2914 yystos
[*yyssp
], yyvsp
, yylsp
);
2919 YYSTACK_FREE (yyss
);
2922 if (yymsg
!= yymsgbuf
)
2923 YYSTACK_FREE (yymsg
);
2925 /* Make sure YYID is used. */
2926 return YYID (yyresult
);
2931 /* Line 1729 of yacc.c */
2932 #line 648 "parse-gram.y"
2936 /* Return the location of the left-hand side of a rule whose
2937 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2938 the right-hand side, and return an empty location equal to the end
2939 boundary of RHS[0] if the right-hand side is empty. */
2942 lloc_default (YYLTYPE
const *rhs
, int n
)
2947 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2948 The bug is fixed in 7.4.2m, but play it safe for now. */
2949 loc
.start
= rhs
[n
].end
;
2950 loc
.end
= rhs
[n
].end
;
2952 /* Ignore empty nonterminals the start of the the right-hand side.
2953 Do not bother to ignore them at the end of the right-hand side,
2954 since empty nonterminals have the same end as their predecessors. */
2955 for (i
= 1; i
<= n
; i
++)
2956 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2958 loc
.start
= rhs
[i
].start
;
2966 /* Add a lex-param or a parse-param (depending on TYPE) with
2967 declaration DECL and location LOC. */
2970 add_param (char const *type
, char *decl
, location loc
)
2972 static char const alphanum
[26 + 26 + 1 + 10] =
2973 "abcdefghijklmnopqrstuvwxyz"
2974 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2977 char const *name_start
= NULL
;
2980 /* Stop on last actual character. */
2981 for (p
= decl
; p
[1]; p
++)
2983 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2984 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2987 /* Strip the surrounding '{' and '}', and any blanks just inside
2989 while (*--p
== ' ' || *p
== '\t')
2992 while (*++decl
== ' ' || *decl
== '\t')
2996 complain_at (loc
, _("missing identifier in parameter declaration"));
3003 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3007 name
= xmalloc (name_len
+ 1);
3008 memcpy (name
, name_start
, name_len
);
3009 name
[name_len
] = '\0';
3010 muscle_pair_list_grow (type
, decl
, name
);
3014 gram_scanner_last_string_free ();
3019 version_check (location
const *loc
, char const *version
)
3021 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3023 complain_at (*loc
, "require bison %s, but have %s",
3024 version
, PACKAGE_VERSION
);
3030 gram_error (location
const *loc
, char const *msg
)
3032 complain_at (*loc
, "%s", msg
);
3036 token_name (int type
)
3038 return yytname
[YYTRANSLATE (type
)];
3049 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3050 return quotearg_style (escape_quoting_style
, buf
);