1 /* A Bison parser, made by GNU Bison 2.4.1.128-4bb9. */
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 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.128-4bb9"
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 190 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 Free
82 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 190 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,
229 PERCENT_PERCENT
= 304,
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
288 #define PERCENT_PERCENT 304
291 #define SEMICOLON 307
293 #define TYPE_TAG_ANY 309
294 #define TYPE_TAG_NONE 310
295 #define BRACKETED_ID 311
296 #define PERCENT_UNION 312
301 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
302 typedef union YYSTYPE
305 /* Line 215 of yacc.c */
306 #line 94 "parse-gram.y"
315 unsigned char character
;
316 named_ref
*named_ref
;
320 /* Line 215 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 265 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)
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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
450 || defined __cplusplus || defined _MSC_VER)
451 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
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 _STDLIB_H \
477 && ! ((defined YYMALLOC || defined malloc) \
478 && (defined YYFREE || defined free)))
479 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
485 # define YYMALLOC malloc
486 # if ! defined malloc && ! defined _STDLIB_H && (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 _STDLIB_H && (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 147
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, 273
636 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
637 static const yytype_int8 yyrhs
[] =
639 59, 0, -1, 60, 49, 77, 91, -1, -1, 60,
640 61, -1, 62, -1, 51, -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, 46,
643 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
644 28, 43, -1, 29, -1, 30, 3, -1, 30, 46,
645 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
646 46, 3, -1, 35, 43, -1, 36, -1, 37, 3,
647 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
648 52, -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, 47, 86, -1, -1, 47,
651 -1, 57, 63, 86, -1, -1, 6, 65, 76, -1,
652 -1, 5, 66, 76, -1, 7, 53, 72, -1, 68,
653 69, 70, -1, 10, -1, 11, -1, 12, -1, -1,
654 53, -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, 53, -1, 54, -1, 55, -1,
657 53, -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, 52, -1, 1,
660 52, -1, -1, 88, 83, 80, 81, -1, 82, -1,
661 81, 50, 82, -1, 81, 52, -1, -1, 82, 89,
662 83, -1, 82, 43, 83, -1, 82, 13, 89, -1,
663 82, 14, 4, -1, 82, 15, 53, -1, -1, 56,
664 -1, 47, -1, 3, -1, -1, 3, -1, 43, -1,
665 47, -1, 44, -1, 48, -1, 87, -1, 90, -1,
666 3, -1, -1, 49, 45, -1
669 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
670 static const yytype_uint16 yyrline
[] =
672 0, 207, 207, 215, 217, 221, 222, 232, 233, 238,
673 239, 244, 245, 246, 247, 248, 249, 254, 263, 264,
674 265, 266, 267, 268, 269, 270, 271, 272, 273, 288,
675 289, 313, 314, 315, 316, 320, 321, 322, 326, 333,
676 340, 344, 348, 355, 370, 371, 375, 387, 387, 392,
677 392, 397, 408, 423, 424, 425, 429, 430, 435, 437,
678 442, 443, 448, 450, 455, 456, 460, 461, 462, 463,
679 468, 473, 478, 484, 490, 501, 502, 511, 512, 518,
680 519, 520, 527, 527, 532, 533, 534, 539, 541, 543,
681 545, 547, 549, 554, 556, 567, 568, 573, 574, 583,
682 603, 605, 614, 619, 620, 625, 632, 634
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 "\"{...}\"", "\"char\"", "\"epilogue\"", "\"=\"", "\"identifier\"",
703 "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"",
704 "\"<*>\"", "\"<>\"", "\"[identifier]\"", "\"%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, 86,
743 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, 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, 99, 0, 42, 96, 95, 97, 10,
773 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
774 0, 27, 29, 30, 105, 101, 100, 103, 37, 104,
775 0, 102, 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, 98, 8, 15, 22,
778 26, 81, 80, 0, 78, 2, 94, 82, 46, 52,
779 58, 60, 76, 72, 73, 63, 65, 107, 87, 59,
780 61, 74, 83, 84, 87, 86, 0, 0, 0, 93,
781 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, 119, 120, 96, 101, 102, 92, 93, 83,
789 84, 85, 128, 132, 133, 117, 58, 107, 55, 77,
793 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
795 #define YYPACT_NINF -60
796 static const yytype_int16 yypact
[] =
798 -60, 4, 102, -60, -60, -60, 7, 10, 22, -60,
799 -60, -60, -6, -60, -60, 27, 40, -60, 65, 72,
800 2, -60, 35, 79, 47, -60, 11, -60, -60, -60,
801 25, 48, -60, 89, 90, 0, -60, -60, -60, 15,
802 -60, -60, 52, -60, -60, -60, -60, 41, -2, -2,
803 0, 26, 26, -60, 59, -60, -60, -60, 92, -60,
804 -60, -60, -60, 100, -60, -60, -60, -60, 101, -60,
805 112, -60, -60, -60, -60, -60, -60, -60, -60, -60,
806 64, -60, 93, 1, -60, -60, 49, -60, 59, -60,
807 0, -60, -60, -2, 83, -2, 0, -60, -60, -60,
808 -60, 26, -60, -60, 26, -60, -60, -60, -60, -60,
809 -60, -60, -60, 103, -60, -60, -60, -60, -60, 0,
810 -60, 113, -60, 143, -60, -60, -60, -60, -60, -60,
811 -60, -60, -16, 53, -60, -60, 0, 145, 94, 49,
812 49, 53, -60, -60, -60, -60, -60
815 /* YYPGOTO[NTERM-NUM]. */
816 static const yytype_int16 yypgoto
[] =
818 -60, -60, -60, -60, 148, -60, -60, -60, -60, -60,
819 -60, -60, -60, 33, -60, 104, -42, -18, 106, -60,
820 74, -60, -60, -60, 24, -51, -60, -60, -36, -10,
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 -107
828 static const yytype_int16 yytable
[] =
830 78, -106, 80, 74, 3, 62, 4, 5, 6, 7,
831 8, 9, 10, 11, 67, 97, 80, 12, 105, 14,
832 4, 5, 6, 7, 8, 9, 10, 11, 69, 74,
833 56, 12, 27, 14, 134, 124, 135, 53, 94, 94,
834 35, 54, 75, 59, 75, 76, 27, 76, 63, 81,
835 113, 91, 118, 51, 35, 121, 74, 68, 42, 126,
836 50, 125, 126, 81, 131, 52, 136, 137, 138, 60,
837 75, 70, 42, 76, 57, 122, 61, 122, 64, 98,
838 99, 100, 65, 94, 121, 94, 74, 123, 145, 146,
839 66, 71, 72, 73, 89, 106, 139, 75, 140, 87,
840 76, 142, 53, 108, 109, 116, 140, 4, 5, 6,
841 7, 8, 9, 10, 11, 110, 111, 130, 12, 13,
842 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
843 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
844 34, 35, 36, 37, 38, 112, 74, 144, 127, 143,
845 44, 39, 129, 40, 41, 95, 104, 114, 141, 42
848 #define yypact_value_is_default(yystate) \
851 #define yytable_value_is_error(yytable_value) \
854 static const yytype_uint8 yycheck
[] =
856 35, 0, 1, 3, 0, 3, 5, 6, 7, 8,
857 9, 10, 11, 12, 3, 50, 1, 16, 54, 18,
858 5, 6, 7, 8, 9, 10, 11, 12, 3, 3,
859 3, 16, 31, 18, 50, 94, 52, 43, 48, 49,
860 39, 47, 44, 3, 44, 47, 31, 47, 46, 48,
861 49, 53, 88, 43, 39, 90, 3, 46, 57, 101,
862 53, 96, 104, 48, 123, 43, 13, 14, 15, 4,
863 44, 46, 57, 47, 47, 93, 4, 95, 43, 53,
864 54, 55, 3, 93, 119, 95, 3, 4, 139, 140,
865 43, 43, 3, 3, 53, 3, 43, 44, 133, 47,
866 47, 136, 43, 3, 3, 56, 141, 5, 6, 7,
867 8, 9, 10, 11, 12, 3, 52, 4, 16, 17,
868 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
869 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
870 38, 39, 40, 41, 42, 52, 3, 53, 45, 4,
871 2, 49, 119, 51, 52, 49, 52, 83, 134, 57
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, 49,
882 51, 52, 57, 61, 62, 64, 67, 68, 66, 65,
883 53, 43, 43, 43, 47, 86, 3, 47, 84, 3,
884 4, 4, 3, 46, 43, 3, 43, 3, 46, 3,
885 46, 43, 3, 3, 3, 44, 47, 87, 89, 90,
886 1, 48, 62, 77, 78, 79, 88, 47, 63, 53,
887 69, 53, 75, 76, 87, 76, 72, 89, 53, 54,
888 55, 73, 74, 89, 73, 86, 3, 85, 3, 3,
889 3, 52, 52, 49, 78, 91, 56, 83, 86, 70,
890 71, 89, 75, 4, 90, 89, 74, 45, 80, 71,
891 4, 90, 81, 82, 50, 52, 13, 14, 15, 43,
892 89, 82, 89, 4, 53, 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. */
909 #define YYFAIL goto yyerrlab
911 #define YYRECOVERING() (!!yyerrstatus)
913 #define YYBACKUP(Token, Value) \
915 if (yychar == YYEMPTY && yylen == 1) \
919 yytoken = YYTRANSLATE (yychar); \
925 yyerror (YY_("syntax error: cannot back up")); \
932 #define YYERRCODE 256
935 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
936 If N is 0, then set CURRENT to the empty location which ends
937 the previous symbol: RHS[0] (always defined). */
939 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
940 #ifndef YYLLOC_DEFAULT
941 # define YYLLOC_DEFAULT(Current, Rhs, N) \
945 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
946 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
947 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
948 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
952 (Current).first_line = (Current).last_line = \
953 YYRHSLOC (Rhs, 0).last_line; \
954 (Current).first_column = (Current).last_column = \
955 YYRHSLOC (Rhs, 0).last_column; \
961 /* YY_LOCATION_PRINT -- Print the location on the stream.
962 This macro was not mandated originally: define only if we know
963 we won't break user code: when these are the locations we know. */
965 #ifndef YY_LOCATION_PRINT
966 # if YYLTYPE_IS_TRIVIAL
967 # define YY_LOCATION_PRINT(File, Loc) \
968 fprintf (File, "%d.%d-%d.%d", \
969 (Loc).first_line, (Loc).first_column, \
970 (Loc).last_line, (Loc).last_column)
972 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
977 /* YYLEX -- calling `yylex' with the right arguments. */
980 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
982 # define YYLEX yylex (&yylval, &yylloc)
985 /* Enable debugging if requested. */
989 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
990 # define YYFPRINTF fprintf
993 # define YYDPRINTF(Args) \
999 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1003 YYFPRINTF (stderr, "%s ", Title); \
1004 yy_symbol_print (stderr, \
1005 Type, Value, Location); \
1006 YYFPRINTF (stderr, "\n"); \
1011 /*--------------------------------.
1012 | Print this symbol on YYOUTPUT. |
1013 `--------------------------------*/
1016 #if (defined __STDC__ || defined __C99__FUNC__ \
1017 || defined __cplusplus || defined _MSC_VER)
1019 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1022 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1025 YYSTYPE
const * const yyvaluep
;
1026 YYLTYPE
const * const yylocationp
;
1031 YYUSE (yylocationp
);
1033 if (yytype
< YYNTOKENS
)
1034 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1040 case 3: /* "\"string\"" */
1042 /* Line 721 of yacc.c */
1043 #line 184 "parse-gram.y"
1044 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1046 /* Line 721 of yacc.c */
1047 #line 1048 "parse-gram.c"
1049 case 4: /* "\"integer\"" */
1051 /* Line 721 of yacc.c */
1052 #line 196 "parse-gram.y"
1053 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1055 /* Line 721 of yacc.c */
1056 #line 1057 "parse-gram.c"
1058 case 43: /* "\"{...}\"" */
1060 /* Line 721 of yacc.c */
1061 #line 186 "parse-gram.y"
1062 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1064 /* Line 721 of yacc.c */
1065 #line 1066 "parse-gram.c"
1067 case 44: /* "\"char\"" */
1069 /* Line 721 of yacc.c */
1070 #line 178 "parse-gram.y"
1071 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1073 /* Line 721 of yacc.c */
1074 #line 1075 "parse-gram.c"
1076 case 45: /* "\"epilogue\"" */
1078 /* Line 721 of yacc.c */
1079 #line 186 "parse-gram.y"
1080 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1082 /* Line 721 of yacc.c */
1083 #line 1084 "parse-gram.c"
1085 case 47: /* "\"identifier\"" */
1087 /* Line 721 of yacc.c */
1088 #line 192 "parse-gram.y"
1089 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1091 /* Line 721 of yacc.c */
1092 #line 1093 "parse-gram.c"
1094 case 48: /* "\"identifier:\"" */
1096 /* Line 721 of yacc.c */
1097 #line 193 "parse-gram.y"
1098 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1100 /* Line 721 of yacc.c */
1101 #line 1102 "parse-gram.c"
1103 case 51: /* "\"%{...%}\"" */
1105 /* Line 721 of yacc.c */
1106 #line 186 "parse-gram.y"
1107 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1109 /* Line 721 of yacc.c */
1110 #line 1111 "parse-gram.c"
1112 case 53: /* "\"type\"" */
1114 /* Line 721 of yacc.c */
1115 #line 191 "parse-gram.y"
1116 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1118 /* Line 721 of yacc.c */
1119 #line 1120 "parse-gram.c"
1121 case 84: /* "variable" */
1123 /* Line 721 of yacc.c */
1124 #line 192 "parse-gram.y"
1125 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1127 /* Line 721 of yacc.c */
1128 #line 1129 "parse-gram.c"
1130 case 85: /* "content.opt" */
1132 /* Line 721 of yacc.c */
1133 #line 186 "parse-gram.y"
1134 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1136 /* Line 721 of yacc.c */
1137 #line 1138 "parse-gram.c"
1139 case 86: /* "braceless" */
1141 /* Line 721 of yacc.c */
1142 #line 186 "parse-gram.y"
1143 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1145 /* Line 721 of yacc.c */
1146 #line 1147 "parse-gram.c"
1150 /* Line 721 of yacc.c */
1151 #line 199 "parse-gram.y"
1152 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1154 /* Line 721 of yacc.c */
1155 #line 1156 "parse-gram.c"
1157 case 88: /* "id_colon" */
1159 /* Line 721 of yacc.c */
1160 #line 200 "parse-gram.y"
1161 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1163 /* Line 721 of yacc.c */
1164 #line 1165 "parse-gram.c"
1166 case 89: /* "symbol" */
1168 /* Line 721 of yacc.c */
1169 #line 199 "parse-gram.y"
1170 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1172 /* Line 721 of yacc.c */
1173 #line 1174 "parse-gram.c"
1175 case 90: /* "string_as_id" */
1177 /* Line 721 of yacc.c */
1178 #line 199 "parse-gram.y"
1179 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1181 /* Line 721 of yacc.c */
1182 #line 1183 "parse-gram.c"
1190 /*--------------------------------.
1191 | Print this symbol on YYOUTPUT. |
1192 `--------------------------------*/
1194 #if (defined __STDC__ || defined __C99__FUNC__ \
1195 || defined __cplusplus || defined _MSC_VER)
1197 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1200 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1203 YYSTYPE
const * const yyvaluep
;
1204 YYLTYPE
const * const yylocationp
;
1207 if (yytype
< YYNTOKENS
)
1208 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1210 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1212 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1213 YYFPRINTF (yyoutput
, ": ");
1214 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1215 YYFPRINTF (yyoutput
, ")");
1218 /*------------------------------------------------------------------.
1219 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1221 `------------------------------------------------------------------*/
1223 #if (defined __STDC__ || defined __C99__FUNC__ \
1224 || defined __cplusplus || defined _MSC_VER)
1226 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1229 yy_stack_print (yybottom
, yytop
)
1230 yytype_int16
*yybottom
;
1231 yytype_int16
*yytop
;
1234 YYFPRINTF (stderr
, "Stack now");
1235 for (; yybottom
<= yytop
; yybottom
++)
1237 int yybot
= *yybottom
;
1238 YYFPRINTF (stderr
, " %d", yybot
);
1240 YYFPRINTF (stderr
, "\n");
1243 # define YY_STACK_PRINT(Bottom, Top) \
1246 yy_stack_print ((Bottom), (Top)); \
1250 /*------------------------------------------------.
1251 | Report that the YYRULE is going to be reduced. |
1252 `------------------------------------------------*/
1254 #if (defined __STDC__ || defined __C99__FUNC__ \
1255 || defined __cplusplus || defined _MSC_VER)
1257 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1260 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1266 int yynrhs
= yyr2
[yyrule
];
1268 unsigned long int yylno
= yyrline
[yyrule
];
1269 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1271 /* The symbols being reduced. */
1272 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1274 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1275 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1276 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1277 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1278 YYFPRINTF (stderr
, "\n");
1282 # define YY_REDUCE_PRINT(Rule) \
1285 yy_reduce_print (yyvsp, yylsp, Rule); \
1288 /* Nonzero means print parse trace. It is left uninitialized so that
1289 multiple parsers can coexist. */
1291 #else /* !YYDEBUG */
1292 # define YYDPRINTF(Args)
1293 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1294 # define YY_STACK_PRINT(Bottom, Top)
1295 # define YY_REDUCE_PRINT(Rule)
1296 #endif /* !YYDEBUG */
1299 /* YYINITDEPTH -- initial size of the parser's stacks. */
1301 # define YYINITDEPTH 200
1304 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1305 if the built-in stack extension method is used).
1307 Do not make this value too large; the results are undefined if
1308 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1309 evaluated with infinite-precision integer arithmetic. */
1312 # define YYMAXDEPTH 10000
1320 # if defined __GLIBC__ && defined _STRING_H
1321 # define yystrlen strlen
1323 /* Return the length of YYSTR. */
1324 #if (defined __STDC__ || defined __C99__FUNC__ \
1325 || defined __cplusplus || defined _MSC_VER)
1327 yystrlen (const char *yystr
)
1335 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1343 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1344 # define yystpcpy stpcpy
1346 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1348 #if (defined __STDC__ || defined __C99__FUNC__ \
1349 || defined __cplusplus || defined _MSC_VER)
1351 yystpcpy (char *yydest
, const char *yysrc
)
1354 yystpcpy (yydest
, yysrc
)
1360 const char *yys
= yysrc
;
1362 while ((*yyd
++ = *yys
++) != '\0')
1371 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1372 quotes and backslashes, so that it's suitable for yyerror. The
1373 heuristic is that double-quoting is unnecessary unless the string
1374 contains an apostrophe, a comma, or backslash (other than
1375 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1376 null, do not copy; instead, return the length of what the result
1379 yytnamerr (char *yyres
, const char *yystr
)
1384 char const *yyp
= yystr
;
1391 goto do_not_strip_quotes
;
1395 goto do_not_strip_quotes
;
1408 do_not_strip_quotes
: ;
1412 return yystrlen (yystr
);
1414 return yystpcpy (yyres
, yystr
) - yyres
;
1418 /* Copy into YYRESULT an error message about the unexpected token
1419 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1420 including the terminating null byte. If YYRESULT is null, do not
1421 copy anything; just return the number of bytes that would be
1422 copied. As a special case, return 0 if an ordinary "syntax error"
1423 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1424 size calculation. */
1426 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1428 int yyn
= yypact
[yystate
];
1430 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1434 int yytype
= YYTRANSLATE (yychar
);
1435 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1436 YYSIZE_T yysize
= yysize0
;
1438 int yysize_overflow
= 0;
1439 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1440 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1444 /* This is so xgettext sees the translatable formats that are
1445 constructed on the fly. */
1446 YY_("syntax error, unexpected %s");
1447 YY_("syntax error, unexpected %s, expecting %s");
1448 YY_("syntax error, unexpected %s, expecting %s or %s");
1449 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1450 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1454 static char const yyunexpected
[] = "syntax error, unexpected %s";
1455 static char const yyexpecting
[] = ", expecting %s";
1456 static char const yyor
[] = " or %s";
1457 char yyformat
[sizeof yyunexpected
1458 + sizeof yyexpecting
- 1
1459 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1460 * (sizeof yyor
- 1))];
1461 char const *yyprefix
= yyexpecting
;
1463 /* Start YYX at -YYN if negative to avoid negative indexes in
1464 YYCHECK. In other words, skip the first -YYN actions for this
1465 state because they are default actions. */
1466 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1468 /* Stay within bounds of both yycheck and yytname. */
1469 int yychecklim
= YYLAST
- yyn
+ 1;
1470 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1473 yyarg
[0] = yytname
[yytype
];
1474 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1476 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1477 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1478 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1480 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1484 yyformat
[sizeof yyunexpected
- 1] = '\0';
1487 yyarg
[yycount
++] = yytname
[yyx
];
1488 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1489 yysize_overflow
|= (yysize1
< yysize
);
1491 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1495 yyf
= YY_(yyformat
);
1496 yysize1
= yysize
+ yystrlen (yyf
);
1497 yysize_overflow
|= (yysize1
< yysize
);
1500 if (yysize_overflow
)
1501 return YYSIZE_MAXIMUM
;
1505 /* Avoid sprintf, as that infringes on the user's name space.
1506 Don't have undefined behavior even if the translation
1507 produced a string with the wrong number of "%s"s. */
1508 char *yyp
= yyresult
;
1510 while ((*yyp
= *yyf
) != '\0')
1512 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1514 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1527 #endif /* YYERROR_VERBOSE */
1530 /*-----------------------------------------------.
1531 | Release the memory associated to this symbol. |
1532 `-----------------------------------------------*/
1535 #if (defined __STDC__ || defined __C99__FUNC__ \
1536 || defined __cplusplus || defined _MSC_VER)
1538 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1541 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1545 YYLTYPE
*yylocationp
;
1549 YYUSE (yylocationp
);
1553 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1563 /* Prevent warnings from -Wmissing-prototypes. */
1564 #ifdef YYPARSE_PARAM
1565 #if defined __STDC__ || defined __cplusplus
1566 int yyparse (void *YYPARSE_PARAM
);
1570 #else /* ! YYPARSE_PARAM */
1571 #if defined __STDC__ || defined __cplusplus
1576 #endif /* ! YYPARSE_PARAM */
1582 /*-------------------------.
1583 | yyparse or yypush_parse. |
1584 `-------------------------*/
1586 #ifdef YYPARSE_PARAM
1587 #if (defined __STDC__ || defined __C99__FUNC__ \
1588 || defined __cplusplus || defined _MSC_VER)
1590 yyparse (void *YYPARSE_PARAM
)
1593 yyparse (YYPARSE_PARAM
)
1594 void *YYPARSE_PARAM
;
1596 #else /* ! YYPARSE_PARAM */
1597 #if (defined __STDC__ || defined __C99__FUNC__ \
1598 || defined __cplusplus || defined _MSC_VER)
1608 /* The lookahead symbol. */
1611 /* The semantic value of the lookahead symbol. */
1614 /* Location data for the lookahead symbol. */
1617 /* Number of syntax errors so far. */
1621 /* Number of tokens to shift before error messages enabled. */
1624 /* The stacks and their tools:
1625 `yyss': related to states.
1626 `yyvs': related to semantic values.
1627 `yyls': related to locations.
1629 Refer to the stacks thru separate pointers, to allow yyoverflow
1630 to reallocate them elsewhere. */
1632 /* The state stack. */
1633 yytype_int16 yyssa
[YYINITDEPTH
];
1635 yytype_int16
*yyssp
;
1637 /* The semantic value stack. */
1638 YYSTYPE yyvsa
[YYINITDEPTH
];
1642 /* The location stack. */
1643 YYLTYPE yylsa
[YYINITDEPTH
];
1647 /* The locations where the error started and ended. */
1648 YYLTYPE yyerror_range
[2];
1650 YYSIZE_T yystacksize
;
1654 /* Lookahead token as an internal (translated) token number. */
1656 /* The variables used to return semantic value and location from the
1662 /* Buffer for error messages, and its allocated size. */
1664 char *yymsg
= yymsgbuf
;
1665 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1668 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1670 /* The number of symbols on the RHS of the reduced rule.
1671 Keep to zero when no symbol should be popped. */
1678 yystacksize
= YYINITDEPTH
;
1680 YYDPRINTF ((stderr
, "Starting parse\n"));
1685 yychar
= YYEMPTY
; /* Cause a token to be read. */
1687 /* Initialize stack pointers.
1688 Waste one element of value and location stack
1689 so that they stay on the same level as the state stack.
1690 The wasted elements are never initialized. */
1695 #if YYLTYPE_IS_TRIVIAL
1696 /* Initialize the default location before parsing starts. */
1697 yylloc
.first_line
= yylloc
.last_line
= 1;
1698 yylloc
.first_column
= yylloc
.last_column
= 1;
1701 /* User initialization code. */
1703 /* Line 1250 of yacc.c */
1704 #line 86 "parse-gram.y"
1706 /* Bison's grammar can initial empty locations, hence a default
1707 location is needed. */
1708 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1709 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1712 /* Line 1250 of yacc.c */
1713 #line 1714 "parse-gram.c"
1718 /*------------------------------------------------------------.
1719 | yynewstate -- Push a new state, which is found in yystate. |
1720 `------------------------------------------------------------*/
1722 /* In all cases, when you get here, the value and location stacks
1723 have just been pushed. So pushing a state here evens the stacks. */
1729 if (yyss
+ yystacksize
- 1 <= yyssp
)
1731 /* Get the current used size of the three stacks, in elements. */
1732 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1736 /* Give user a chance to reallocate the stack. Use copies of
1737 these so that the &'s don't force the real ones into
1739 YYSTYPE
*yyvs1
= yyvs
;
1740 yytype_int16
*yyss1
= yyss
;
1741 YYLTYPE
*yyls1
= yyls
;
1743 /* Each stack pointer address is followed by the size of the
1744 data in use in that stack, in bytes. This used to be a
1745 conditional around just the two extra args, but that might
1746 be undefined if yyoverflow is a macro. */
1747 yyoverflow (YY_("memory exhausted"),
1748 &yyss1
, yysize
* sizeof (*yyssp
),
1749 &yyvs1
, yysize
* sizeof (*yyvsp
),
1750 &yyls1
, yysize
* sizeof (*yylsp
),
1757 #else /* no yyoverflow */
1758 # ifndef YYSTACK_RELOCATE
1759 goto yyexhaustedlab
;
1761 /* Extend the stack our own way. */
1762 if (YYMAXDEPTH
<= yystacksize
)
1763 goto yyexhaustedlab
;
1765 if (YYMAXDEPTH
< yystacksize
)
1766 yystacksize
= YYMAXDEPTH
;
1769 yytype_int16
*yyss1
= yyss
;
1770 union yyalloc
*yyptr
=
1771 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1773 goto yyexhaustedlab
;
1774 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1775 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1776 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1777 # undef YYSTACK_RELOCATE
1779 YYSTACK_FREE (yyss1
);
1782 #endif /* no yyoverflow */
1784 yyssp
= yyss
+ yysize
- 1;
1785 yyvsp
= yyvs
+ yysize
- 1;
1786 yylsp
= yyls
+ yysize
- 1;
1788 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1789 (unsigned long int) yystacksize
));
1791 if (yyss
+ yystacksize
- 1 <= yyssp
)
1795 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1797 if (yystate
== YYFINAL
)
1807 /* Do appropriate processing given the current state. Read a
1808 lookahead token if we need one and don't already have one. */
1810 /* First try to decide what to do without reference to lookahead token. */
1811 yyn
= yypact
[yystate
];
1812 if (yypact_value_is_default (yyn
))
1815 /* Not known => get a lookahead token if don't already have one. */
1817 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1818 if (yychar
== YYEMPTY
)
1820 YYDPRINTF ((stderr
, "Reading a token: "));
1824 if (yychar
<= YYEOF
)
1826 yychar
= yytoken
= YYEOF
;
1827 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1831 yytoken
= YYTRANSLATE (yychar
);
1832 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1835 /* If the proper action on seeing token YYTOKEN is to reduce or to
1836 detect an error, take that action. */
1838 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1843 if (yytable_value_is_error (yyn
))
1849 /* Count tokens shifted since error; after three, turn off error
1854 /* Shift the lookahead token. */
1855 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1857 /* Discard the shifted token. */
1866 /*-----------------------------------------------------------.
1867 | yydefault -- do the default action for the current state. |
1868 `-----------------------------------------------------------*/
1870 yyn
= yydefact
[yystate
];
1876 /*-----------------------------.
1877 | yyreduce -- Do a reduction. |
1878 `-----------------------------*/
1880 /* yyn is the number of a rule to reduce with. */
1883 /* If YYLEN is nonzero, implement the default value of the action:
1886 Otherwise, the following line sets YYVAL to garbage.
1887 This behavior is undocumented and Bison
1888 users should not rely upon it. Assigning to YYVAL
1889 unconditionally makes the parser a bit smaller, and it avoids a
1890 GCC warning that YYVAL may be used uninitialized. */
1891 yyval
= yyvsp
[1-yylen
];
1893 /* Default location. */
1894 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1895 YY_REDUCE_PRINT (yyn
);
1900 /* Line 1463 of yacc.c */
1901 #line 223 "parse-gram.y"
1903 code_props plain_code
;
1904 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1905 code_props_translate_code (&plain_code
);
1906 gram_scanner_last_string_free ();
1907 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1908 plain_code
.code
, (yylsp
[(1) - (1)]));
1909 code_scanner_last_string_free ();
1915 /* Line 1463 of yacc.c */
1916 #line 232 "parse-gram.y"
1917 { debug_flag
= true; }
1922 /* Line 1463 of yacc.c */
1923 #line 234 "parse-gram.y"
1925 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
),
1926 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
1932 /* Line 1463 of yacc.c */
1933 #line 238 "parse-gram.y"
1934 { defines_flag
= true; }
1939 /* Line 1463 of yacc.c */
1940 #line 240 "parse-gram.y"
1942 defines_flag
= true;
1943 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1949 /* Line 1463 of yacc.c */
1950 #line 244 "parse-gram.y"
1951 { error_verbose
= true; }
1956 /* Line 1463 of yacc.c */
1957 #line 245 "parse-gram.y"
1958 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1963 /* Line 1463 of yacc.c */
1964 #line 246 "parse-gram.y"
1965 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1970 /* Line 1463 of yacc.c */
1971 #line 247 "parse-gram.y"
1972 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1977 /* Line 1463 of yacc.c */
1978 #line 248 "parse-gram.y"
1979 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1984 /* Line 1463 of yacc.c */
1985 #line 250 "parse-gram.y"
1987 nondeterministic_parser
= true;
1994 /* Line 1463 of yacc.c */
1995 #line 255 "parse-gram.y"
1998 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
1999 code_props_translate_code (&action
);
2000 gram_scanner_last_string_free ();
2001 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2002 code_scanner_last_string_free ();
2008 /* Line 1463 of yacc.c */
2009 #line 263 "parse-gram.y"
2010 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, (yylsp
[(1) - (2)])); }
2015 /* Line 1463 of yacc.c */
2016 #line 264 "parse-gram.y"
2017 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2022 /* Line 1463 of yacc.c */
2023 #line 265 "parse-gram.y"
2024 { locations_flag
= true; }
2029 /* Line 1463 of yacc.c */
2030 #line 266 "parse-gram.y"
2031 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2036 /* Line 1463 of yacc.c */
2037 #line 267 "parse-gram.y"
2038 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2043 /* Line 1463 of yacc.c */
2044 #line 268 "parse-gram.y"
2045 { no_lines_flag
= true; }
2050 /* Line 1463 of yacc.c */
2051 #line 269 "parse-gram.y"
2052 { nondeterministic_parser
= true; }
2057 /* Line 1463 of yacc.c */
2058 #line 270 "parse-gram.y"
2059 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2064 /* Line 1463 of yacc.c */
2065 #line 271 "parse-gram.y"
2066 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2071 /* Line 1463 of yacc.c */
2072 #line 272 "parse-gram.y"
2073 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2078 /* Line 1463 of yacc.c */
2079 #line 274 "parse-gram.y"
2081 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2082 `%define api.pure' in a backward-compatible manner here. First, don't
2083 complain if %pure-parser is specified multiple times. */
2084 if (!muscle_find_const ("percent_define(api.pure)"))
2085 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2086 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2087 /* In all cases, use api.pure now so that the backend doesn't complain if
2088 the skeleton ignores api.pure, but do warn now if there's a previous
2089 conflicting definition from an actual %define. */
2090 if (!muscle_percent_define_flag_if ("api.pure"))
2091 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2092 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2098 /* Line 1463 of yacc.c */
2099 #line 288 "parse-gram.y"
2100 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2105 /* Line 1463 of yacc.c */
2106 #line 290 "parse-gram.y"
2108 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2109 if (strchr (skeleton_user
, '/'))
2111 size_t dir_length
= strlen (current_file
);
2112 char *skeleton_build
;
2113 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2115 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2118 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2121 strncpy (skeleton_build
, current_file
, dir_length
);
2122 skeleton_build
[dir_length
++] = '/';
2124 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2125 skeleton_user
= uniqstr_new (skeleton_build
);
2126 free (skeleton_build
);
2128 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[(1) - (2)]));
2134 /* Line 1463 of yacc.c */
2135 #line 313 "parse-gram.y"
2136 { token_table_flag
= true; }
2141 /* Line 1463 of yacc.c */
2142 #line 314 "parse-gram.y"
2143 { report_flag
|= report_states
; }
2148 /* Line 1463 of yacc.c */
2149 #line 315 "parse-gram.y"
2150 { yacc_flag
= true; }
2155 /* Line 1463 of yacc.c */
2156 #line 323 "parse-gram.y"
2158 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2164 /* Line 1463 of yacc.c */
2165 #line 327 "parse-gram.y"
2168 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2169 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2170 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2176 /* Line 1463 of yacc.c */
2177 #line 334 "parse-gram.y"
2180 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2181 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2182 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2188 /* Line 1463 of yacc.c */
2189 #line 341 "parse-gram.y"
2191 default_prec
= true;
2197 /* Line 1463 of yacc.c */
2198 #line 345 "parse-gram.y"
2200 default_prec
= false;
2206 /* Line 1463 of yacc.c */
2207 #line 349 "parse-gram.y"
2209 /* Do not invoke muscle_percent_code_grow here since it invokes
2210 muscle_user_name_list_grow. */
2211 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2212 code_scanner_last_string_free ();
2218 /* Line 1463 of yacc.c */
2219 #line 356 "parse-gram.y"
2221 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2222 code_scanner_last_string_free ();
2228 /* Line 1463 of yacc.c */
2229 #line 370 "parse-gram.y"
2235 /* Line 1463 of yacc.c */
2236 #line 371 "parse-gram.y"
2237 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2242 /* Line 1463 of yacc.c */
2243 #line 376 "parse-gram.y"
2246 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2247 code_scanner_last_string_free ();
2253 /* Line 1463 of yacc.c */
2254 #line 387 "parse-gram.y"
2255 { current_class
= nterm_sym
; }
2260 /* Line 1463 of yacc.c */
2261 #line 388 "parse-gram.y"
2263 current_class
= unknown_sym
;
2264 current_type
= NULL
;
2270 /* Line 1463 of yacc.c */
2271 #line 392 "parse-gram.y"
2272 { current_class
= token_sym
; }
2277 /* Line 1463 of yacc.c */
2278 #line 393 "parse-gram.y"
2280 current_class
= unknown_sym
;
2281 current_type
= NULL
;
2287 /* Line 1463 of yacc.c */
2288 #line 398 "parse-gram.y"
2292 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2293 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2294 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2300 /* Line 1463 of yacc.c */
2301 #line 409 "parse-gram.y"
2305 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2307 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2308 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2310 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2311 current_type
= NULL
;
2317 /* Line 1463 of yacc.c */
2318 #line 423 "parse-gram.y"
2319 { (yyval
.assoc
) = left_assoc
; }
2324 /* Line 1463 of yacc.c */
2325 #line 424 "parse-gram.y"
2326 { (yyval
.assoc
) = right_assoc
; }
2331 /* Line 1463 of yacc.c */
2332 #line 425 "parse-gram.y"
2333 { (yyval
.assoc
) = non_assoc
; }
2338 /* Line 1463 of yacc.c */
2339 #line 429 "parse-gram.y"
2340 { current_type
= NULL
; }
2345 /* Line 1463 of yacc.c */
2346 #line 430 "parse-gram.y"
2347 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2352 /* Line 1463 of yacc.c */
2353 #line 436 "parse-gram.y"
2354 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2359 /* Line 1463 of yacc.c */
2360 #line 438 "parse-gram.y"
2361 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2366 /* Line 1463 of yacc.c */
2367 #line 442 "parse-gram.y"
2368 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2373 /* Line 1463 of yacc.c */
2374 #line 443 "parse-gram.y"
2375 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2380 /* Line 1463 of yacc.c */
2381 #line 449 "parse-gram.y"
2382 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2387 /* Line 1463 of yacc.c */
2388 #line 451 "parse-gram.y"
2389 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2394 /* Line 1463 of yacc.c */
2395 #line 455 "parse-gram.y"
2396 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2401 /* Line 1463 of yacc.c */
2402 #line 456 "parse-gram.y"
2403 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2408 /* Line 1463 of yacc.c */
2409 #line 460 "parse-gram.y"
2410 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2415 /* Line 1463 of yacc.c */
2416 #line 461 "parse-gram.y"
2417 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2422 /* Line 1463 of yacc.c */
2423 #line 462 "parse-gram.y"
2424 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2429 /* Line 1463 of yacc.c */
2430 #line 463 "parse-gram.y"
2431 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2436 /* Line 1463 of yacc.c */
2437 #line 469 "parse-gram.y"
2439 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2446 /* Line 1463 of yacc.c */
2447 #line 474 "parse-gram.y"
2449 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2450 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2456 /* Line 1463 of yacc.c */
2457 #line 479 "parse-gram.y"
2459 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2460 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2461 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2467 /* Line 1463 of yacc.c */
2468 #line 485 "parse-gram.y"
2470 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2471 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2472 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2478 /* Line 1463 of yacc.c */
2479 #line 491 "parse-gram.y"
2481 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2482 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2483 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2484 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2490 /* Line 1463 of yacc.c */
2491 #line 521 "parse-gram.y"
2499 /* Line 1463 of yacc.c */
2500 #line 527 "parse-gram.y"
2501 { current_lhs
= (yyvsp
[(1) - (2)].symbol
); current_lhs_location
= (yylsp
[(1) - (2)]);
2502 current_lhs_named_ref
= (yyvsp
[(2) - (2)].named_ref
); }
2507 /* Line 1463 of yacc.c */
2508 #line 532 "parse-gram.y"
2509 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2514 /* Line 1463 of yacc.c */
2515 #line 533 "parse-gram.y"
2516 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2521 /* Line 1463 of yacc.c */
2522 #line 539 "parse-gram.y"
2523 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2524 current_lhs_named_ref
); }
2529 /* Line 1463 of yacc.c */
2530 #line 542 "parse-gram.y"
2531 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (3)].symbol
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2536 /* Line 1463 of yacc.c */
2537 #line 544 "parse-gram.y"
2538 { grammar_current_rule_action_append ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2543 /* Line 1463 of yacc.c */
2544 #line 546 "parse-gram.y"
2545 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2550 /* Line 1463 of yacc.c */
2551 #line 548 "parse-gram.y"
2552 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2557 /* Line 1463 of yacc.c */
2558 #line 550 "parse-gram.y"
2559 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2564 /* Line 1463 of yacc.c */
2565 #line 554 "parse-gram.y"
2566 { (yyval
.named_ref
) = 0; }
2571 /* Line 1463 of yacc.c */
2572 #line 556 "parse-gram.y"
2573 { (yyval
.named_ref
) = named_ref_new((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2578 /* Line 1463 of yacc.c */
2579 #line 568 "parse-gram.y"
2580 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2585 /* Line 1463 of yacc.c */
2586 #line 573 "parse-gram.y"
2587 { (yyval
.chars
) = ""; }
2592 /* Line 1463 of yacc.c */
2593 #line 584 "parse-gram.y"
2595 code_props plain_code
;
2596 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2597 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2598 code_props_translate_code (&plain_code
);
2599 gram_scanner_last_string_free ();
2600 (yyval
.chars
) = plain_code
.code
;
2606 /* Line 1463 of yacc.c */
2607 #line 604 "parse-gram.y"
2608 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2613 /* Line 1463 of yacc.c */
2614 #line 606 "parse-gram.y"
2616 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2617 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2618 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2624 /* Line 1463 of yacc.c */
2625 #line 614 "parse-gram.y"
2626 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2631 /* Line 1463 of yacc.c */
2632 #line 626 "parse-gram.y"
2634 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2635 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2641 /* Line 1463 of yacc.c */
2642 #line 635 "parse-gram.y"
2644 code_props plain_code
;
2645 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2646 code_props_translate_code (&plain_code
);
2647 gram_scanner_last_string_free ();
2648 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2649 code_scanner_last_string_free ();
2655 /* Line 1463 of yacc.c */
2656 #line 2657 "parse-gram.c"
2659 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2663 YY_STACK_PRINT (yyss
, yyssp
);
2668 /* Now `shift' the result of the reduction. Determine what state
2669 that goes to, based on the state we popped back to and the rule
2670 number reduced by. */
2674 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2675 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2676 yystate
= yytable
[yystate
];
2678 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2683 /*------------------------------------.
2684 | yyerrlab -- here on detecting error |
2685 `------------------------------------*/
2687 /* If not already recovering from an error, report this error. */
2691 #if ! YYERROR_VERBOSE
2692 yyerror (YY_("syntax error"));
2695 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2696 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2698 YYSIZE_T yyalloc
= 2 * yysize
;
2699 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2700 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2701 if (yymsg
!= yymsgbuf
)
2702 YYSTACK_FREE (yymsg
);
2703 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2705 yymsg_alloc
= yyalloc
;
2709 yymsg_alloc
= sizeof yymsgbuf
;
2713 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2715 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2720 yyerror (YY_("syntax error"));
2722 goto yyexhaustedlab
;
2728 yyerror_range
[0] = yylloc
;
2730 if (yyerrstatus
== 3)
2732 /* If just tried and failed to reuse lookahead token after an
2733 error, discard it. */
2735 if (yychar
<= YYEOF
)
2737 /* Return failure if at end of input. */
2738 if (yychar
== YYEOF
)
2743 yydestruct ("Error: discarding",
2744 yytoken
, &yylval
, &yylloc
);
2749 /* Else will try to reuse lookahead token after shifting the error
2754 /*---------------------------------------------------.
2755 | yyerrorlab -- error raised explicitly by YYERROR. |
2756 `---------------------------------------------------*/
2759 /* Pacify compilers like GCC when the user code never invokes
2760 YYERROR and the label yyerrorlab therefore never appears in user
2762 if (/*CONSTCOND*/ 0)
2765 yyerror_range
[0] = yylsp
[1-yylen
];
2766 /* Do not reclaim the symbols of the rule which action triggered
2770 YY_STACK_PRINT (yyss
, yyssp
);
2775 /*-------------------------------------------------------------.
2776 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2777 `-------------------------------------------------------------*/
2779 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2783 yyn
= yypact
[yystate
];
2784 if (!yypact_value_is_default (yyn
))
2787 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2795 /* Pop the current state because it cannot handle the error token. */
2799 yyerror_range
[0] = *yylsp
;
2800 yydestruct ("Error: popping",
2801 yystos
[yystate
], yyvsp
, yylsp
);
2804 YY_STACK_PRINT (yyss
, yyssp
);
2809 yyerror_range
[1] = yylloc
;
2810 /* Using YYLLOC is tempting, but would change the location of
2811 the lookahead. YYLOC is available though. */
2812 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2815 /* Shift the error token. */
2816 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2822 /*-------------------------------------.
2823 | yyacceptlab -- YYACCEPT comes here. |
2824 `-------------------------------------*/
2829 /*-----------------------------------.
2830 | yyabortlab -- YYABORT comes here. |
2831 `-----------------------------------*/
2836 #if !defined(yyoverflow) || YYERROR_VERBOSE
2837 /*-------------------------------------------------.
2838 | yyexhaustedlab -- memory exhaustion comes here. |
2839 `-------------------------------------------------*/
2841 yyerror (YY_("memory exhausted"));
2847 if (yychar
!= YYEMPTY
)
2848 yydestruct ("Cleanup: discarding lookahead",
2849 yytoken
, &yylval
, &yylloc
);
2850 /* Do not reclaim the symbols of the rule which action triggered
2851 this YYABORT or YYACCEPT. */
2853 YY_STACK_PRINT (yyss
, yyssp
);
2854 while (yyssp
!= yyss
)
2856 yydestruct ("Cleanup: popping",
2857 yystos
[*yyssp
], yyvsp
, yylsp
);
2862 YYSTACK_FREE (yyss
);
2865 if (yymsg
!= yymsgbuf
)
2866 YYSTACK_FREE (yymsg
);
2868 /* Make sure YYID is used. */
2869 return YYID (yyresult
);
2874 /* Line 1683 of yacc.c */
2875 #line 645 "parse-gram.y"
2879 /* Return the location of the left-hand side of a rule whose
2880 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2881 the right-hand side, and return an empty location equal to the end
2882 boundary of RHS[0] if the right-hand side is empty. */
2885 lloc_default (YYLTYPE
const *rhs
, int n
)
2890 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2891 The bug is fixed in 7.4.2m, but play it safe for now. */
2892 loc
.start
= rhs
[n
].end
;
2893 loc
.end
= rhs
[n
].end
;
2895 /* Ignore empty nonterminals the start of the the right-hand side.
2896 Do not bother to ignore them at the end of the right-hand side,
2897 since empty nonterminals have the same end as their predecessors. */
2898 for (i
= 1; i
<= n
; i
++)
2899 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2901 loc
.start
= rhs
[i
].start
;
2909 /* Add a lex-param or a parse-param (depending on TYPE) with
2910 declaration DECL and location LOC. */
2913 add_param (char const *type
, char *decl
, location loc
)
2915 static char const alphanum
[26 + 26 + 1 + 10] =
2916 "abcdefghijklmnopqrstuvwxyz"
2917 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2920 char const *name_start
= NULL
;
2923 /* Stop on last actual character. */
2924 for (p
= decl
; p
[1]; p
++)
2926 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2927 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2930 /* Strip the surrounding '{' and '}', and any blanks just inside
2932 while (*--p
== ' ' || *p
== '\t')
2935 while (*++decl
== ' ' || *decl
== '\t')
2939 complain_at (loc
, _("missing identifier in parameter declaration"));
2946 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2950 name
= xmalloc (name_len
+ 1);
2951 memcpy (name
, name_start
, name_len
);
2952 name
[name_len
] = '\0';
2953 muscle_pair_list_grow (type
, decl
, name
);
2957 gram_scanner_last_string_free ();
2962 version_check (location
const *loc
, char const *version
)
2964 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2966 complain_at (*loc
, "require bison %s, but have %s",
2967 version
, PACKAGE_VERSION
);
2973 gram_error (location
const *loc
, char const *msg
)
2975 complain_at (*loc
, "%s", msg
);
2979 token_name (int type
)
2981 return yytname
[YYTRANSLATE (type
)];
2992 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2993 return quotearg_style (escape_quoting_style
, buf
);