2 /* A Bison parser, made by GNU Bison 2.3a+. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA. */
24 /* As a special exception, you may create a larger work that contains
25 part or all of the Bison parser skeleton and distribute that work
26 under terms of your choice, so long as that work isn't itself a
27 parser generator using the skeleton or a modified version thereof
28 as a parser skeleton. Alternatively, if you modify or redistribute
29 the parser skeleton itself, you may (at your option) remove this
30 special exception, which will cause the skeleton and the resulting
31 Bison output files to be licensed under the GNU General Public
32 License without this special exception.
34 This special exception was added by the Free Software Foundation in
35 version 2.2 of Bison. */
37 /* C LALR(1) parser skeleton written by Richard Stallman, by
38 simplifying the original so-called "semantic" parser. */
40 /* All symbols defined below should begin with yy or YY, to avoid
41 infringing on user name space. This should be done even for local
42 variables, as they might otherwise be expanded by user macros.
43 There are some unavoidable exceptions within include files to
44 define necessary library symbols; they are noted "INFRINGES ON
45 USER NAME SPACE" below. */
47 /* Identify Bison output. */
51 #define YYBISON_VERSION "2.3a+"
54 #define YYSKELETON_NAME "yacc.c"
65 /* Using locations. */
66 #define YYLSP_NEEDED 1
68 /* Substitute the variable and function names. */
69 #define yyparse gram_parse
70 #define yylex gram_lex
71 #define yyerror gram_error
72 #define yylval gram_lval
73 #define yychar gram_char
74 #define yydebug gram_debug
75 #define yynerrs gram_nerrs
76 #define yylloc gram_lloc
78 /* Copy the first part of user declarations. */
80 /* Line 1535 of yacc.c */
81 #line 1 "parse-gram.y"
82 /* Bison Grammar Parser -*- C -*-
84 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
87 This file is part of Bison, the GNU Compiler Compiler.
89 This program is free software; you can redistribute it and/or modify
90 it under the terms of the GNU General Public License as published by
91 the Free Software Foundation; either version 2 of the License, or
92 (at your option) any later version.
94 This program is distributed in the hope that it will be useful,
95 but WITHOUT ANY WARRANTY; without even the implied warranty of
96 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
97 GNU General Public License for more details.
99 You should have received a copy of the GNU General Public License
100 along with this program; if not, write to the Free Software
101 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
108 #include <strverscmp.h>
110 #include "complain.h"
111 #include "conflicts.h"
115 #include "muscle_tab.h"
116 #include "quotearg.h"
119 #include "scan-gram.h"
120 #include "scan-code.h"
122 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
123 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
125 #define YY_LOCATION_PRINT(File, Loc) \
126 location_print (File, Loc)
128 static void version_check (location
const *loc
, char const *version
);
130 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
131 FIXME: depends on the undocumented availability of YYLLOC. */
133 #define yyerror(Msg) \
134 gram_error (&yylloc, Msg)
135 static void gram_error (location
const *, char const *);
137 static char const *char_name (char);
139 /** Add a lex-param or a parse-param.
141 * \param type \a lex_param or \a parse_param
142 * \param decl the formal argument
143 * \param loc the location in the source.
145 static void add_param (char const *type
, char *decl
, location loc
);
148 static symbol_class current_class
= unknown_sym
;
149 static uniqstr current_type
= NULL
;
150 static symbol
*current_lhs
;
151 static location current_lhs_location
;
152 static int current_prec
= 0;
154 #define YYTYPE_INT16 int_fast16_t
155 #define YYTYPE_INT8 int_fast8_t
156 #define YYTYPE_UINT16 uint_fast16_t
157 #define YYTYPE_UINT8 uint_fast8_t
160 /* Line 1535 of yacc.c */
161 #line 162 "parse-gram.c"
163 /* Enabling traces. */
168 /* Enabling verbose error messages. */
169 #ifdef YYERROR_VERBOSE
170 # undef YYERROR_VERBOSE
171 # define YYERROR_VERBOSE 1
173 # define YYERROR_VERBOSE 1
176 /* Enabling the token table. */
177 #ifndef YYTOKEN_TABLE
178 # define YYTOKEN_TABLE 0
185 /* Put the tokens into the symbol table, so that GDB and other debuggers
194 PERCENT_DESTRUCTOR
= 263,
195 PERCENT_PRINTER
= 264,
198 PERCENT_NONASSOC
= 267,
204 PERCENT_DEFAULT_PREC
= 273,
205 PERCENT_DEFINE
= 274,
206 PERCENT_DEFINES
= 275,
207 PERCENT_ERROR_VERBOSE
= 276,
208 PERCENT_EXPECT
= 277,
209 PERCENT_EXPECT_RR
= 278,
210 PERCENT_FILE_PREFIX
= 279,
211 PERCENT_GLR_PARSER
= 280,
212 PERCENT_INITIAL_ACTION
= 281,
213 PERCENT_LANGUAGE
= 282,
214 PERCENT_LEX_PARAM
= 283,
215 PERCENT_LOCATIONS
= 284,
216 PERCENT_NAME_PREFIX
= 285,
217 PERCENT_NO_DEFAULT_PREC
= 286,
218 PERCENT_NO_LINES
= 287,
219 PERCENT_NONDETERMINISTIC_PARSER
= 288,
220 PERCENT_OUTPUT
= 289,
221 PERCENT_PARSE_PARAM
= 290,
222 PERCENT_PURE_PARSER
= 291,
223 PERCENT_PUSH_PARSER
= 292,
224 PERCENT_PUSH_PULL_PARSER
= 293,
225 PERCENT_REQUIRE
= 294,
226 PERCENT_SKELETON
= 295,
228 PERCENT_TOKEN_TABLE
= 297,
229 PERCENT_VERBOSE
= 298,
237 PERCENT_PERCENT
= 306,
251 #define PERCENT_TOKEN 260
252 #define PERCENT_NTERM 261
253 #define PERCENT_TYPE 262
254 #define PERCENT_DESTRUCTOR 263
255 #define PERCENT_PRINTER 264
256 #define PERCENT_LEFT 265
257 #define PERCENT_RIGHT 266
258 #define PERCENT_NONASSOC 267
259 #define PERCENT_PREC 268
260 #define PERCENT_DPREC 269
261 #define PERCENT_MERGE 270
262 #define PERCENT_CODE 271
263 #define PERCENT_DEBUG 272
264 #define PERCENT_DEFAULT_PREC 273
265 #define PERCENT_DEFINE 274
266 #define PERCENT_DEFINES 275
267 #define PERCENT_ERROR_VERBOSE 276
268 #define PERCENT_EXPECT 277
269 #define PERCENT_EXPECT_RR 278
270 #define PERCENT_FILE_PREFIX 279
271 #define PERCENT_GLR_PARSER 280
272 #define PERCENT_INITIAL_ACTION 281
273 #define PERCENT_LANGUAGE 282
274 #define PERCENT_LEX_PARAM 283
275 #define PERCENT_LOCATIONS 284
276 #define PERCENT_NAME_PREFIX 285
277 #define PERCENT_NO_DEFAULT_PREC 286
278 #define PERCENT_NO_LINES 287
279 #define PERCENT_NONDETERMINISTIC_PARSER 288
280 #define PERCENT_OUTPUT 289
281 #define PERCENT_PARSE_PARAM 290
282 #define PERCENT_PURE_PARSER 291
283 #define PERCENT_PUSH_PARSER 292
284 #define PERCENT_PUSH_PULL_PARSER 293
285 #define PERCENT_REQUIRE 294
286 #define PERCENT_SKELETON 295
287 #define PERCENT_START 296
288 #define PERCENT_TOKEN_TABLE 297
289 #define PERCENT_VERBOSE 298
290 #define PERCENT_YACC 299
291 #define BRACED_CODE 300
297 #define PERCENT_PERCENT 306
300 #define SEMICOLON 309
302 #define TYPE_TAG_ANY 311
303 #define TYPE_TAG_NONE 312
304 #define PERCENT_UNION 313
309 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
310 typedef union YYSTYPE
312 /* Line 1535 of yacc.c */
313 #line 97 "parse-gram.y"
322 unsigned char character
;
325 /* Line 1535 of yacc.c */
326 #line 327 "parse-gram.c"
328 # define YYSTYPE_IS_TRIVIAL 1
329 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
330 # define YYSTYPE_IS_DECLARED 1
333 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
334 typedef struct YYLTYPE
341 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
342 # define YYLTYPE_IS_DECLARED 1
343 # define YYLTYPE_IS_TRIVIAL 1
347 /* Copy the second part of user declarations. */
350 /* Line 1535 of yacc.c */
351 #line 352 "parse-gram.c"
358 typedef YYTYPE_UINT8 yytype_uint8
;
360 typedef unsigned char yytype_uint8
;
364 typedef YYTYPE_INT8 yytype_int8
;
365 #elif (defined __STDC__ || defined __C99__FUNC__ \
366 || defined __cplusplus || defined _MSC_VER)
367 typedef signed char yytype_int8
;
369 typedef short int yytype_int8
;
373 typedef YYTYPE_UINT16 yytype_uint16
;
375 typedef unsigned short int yytype_uint16
;
379 typedef YYTYPE_INT16 yytype_int16
;
381 typedef short int yytype_int16
;
385 # ifdef __SIZE_TYPE__
386 # define YYSIZE_T __SIZE_TYPE__
387 # elif defined size_t
388 # define YYSIZE_T size_t
389 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
390 || defined __cplusplus || defined _MSC_VER)
391 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
392 # define YYSIZE_T size_t
394 # define YYSIZE_T unsigned int
398 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
403 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
404 # define YY_(msgid) dgettext ("bison-runtime", msgid)
408 # define YY_(msgid) msgid
412 /* Suppress unused-variable warnings by "using" E. */
413 #if ! defined lint || defined __GNUC__
414 # define YYUSE(e) ((void) (e))
416 # define YYUSE(e) /* empty */
419 /* Identity function, used to suppress warnings about constant conditions. */
423 #if (defined __STDC__ || defined __C99__FUNC__ \
424 || defined __cplusplus || defined _MSC_VER)
437 #if ! defined yyoverflow || YYERROR_VERBOSE
439 /* The parser invokes alloca or malloc; define the necessary symbols. */
441 # ifdef YYSTACK_USE_ALLOCA
442 # if YYSTACK_USE_ALLOCA
444 # define YYSTACK_ALLOC __builtin_alloca
445 # elif defined __BUILTIN_VA_ARG_INCR
446 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
448 # define YYSTACK_ALLOC __alloca
449 # elif defined _MSC_VER
450 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
451 # define alloca _alloca
453 # define YYSTACK_ALLOC alloca
454 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
455 || defined __cplusplus || defined _MSC_VER)
456 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
465 # ifdef YYSTACK_ALLOC
466 /* Pacify GCC's `empty if-body' warning. */
467 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
468 # ifndef YYSTACK_ALLOC_MAXIMUM
469 /* The OS might guarantee only one guard page at the bottom of the stack,
470 and a page size can be as small as 4096 bytes. So we cannot safely
471 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
472 to allow for a few compiler-allocated temporary stack slots. */
473 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
476 # define YYSTACK_ALLOC YYMALLOC
477 # define YYSTACK_FREE YYFREE
478 # ifndef YYSTACK_ALLOC_MAXIMUM
479 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
481 # if (defined __cplusplus && ! defined _STDLIB_H \
482 && ! ((defined YYMALLOC || defined malloc) \
483 && (defined YYFREE || defined free)))
484 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
490 # define YYMALLOC malloc
491 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
492 || defined __cplusplus || defined _MSC_VER)
493 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
498 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
499 || defined __cplusplus || defined _MSC_VER)
500 void free (void *); /* INFRINGES ON USER NAME SPACE */
504 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
507 #if (! defined yyoverflow \
508 && (! defined __cplusplus \
509 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
510 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
512 /* A type that is properly aligned for any stack member. */
520 /* The size of the maximum gap between one aligned stack and the next. */
521 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
523 /* The size of an array large to enough to hold all stacks, each with
525 # define YYSTACK_BYTES(N) \
526 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
527 + 2 * YYSTACK_GAP_MAXIMUM)
529 /* Copy COUNT objects from FROM to TO. The source and destination do
532 # if defined __GNUC__ && 1 < __GNUC__
533 # define YYCOPY(To, From, Count) \
534 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
536 # define YYCOPY(To, From, Count) \
540 for (yyi = 0; yyi < (Count); yyi++) \
541 (To)[yyi] = (From)[yyi]; \
547 /* Relocate STACK from its old location to the new one. The
548 local variables YYSIZE and YYSTACKSIZE give the old and new number of
549 elements in the stack, and YYPTR gives the new location of the
550 stack. Advance YYPTR to a properly aligned location for the next
552 # define YYSTACK_RELOCATE(Stack) \
555 YYSIZE_T yynewbytes; \
556 YYCOPY (&yyptr->Stack, Stack, yysize); \
557 Stack = &yyptr->Stack; \
558 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
559 yyptr += yynewbytes / sizeof (*yyptr); \
565 /* YYFINAL -- State number of the termination state. */
567 /* YYLAST -- Last index in YYTABLE. */
570 /* YYNTOKENS -- Number of terminals. */
572 /* YYNNTS -- Number of nonterminals. */
574 /* YYNRULES -- Number of rules. */
576 /* YYNRULES -- Number of states. */
577 #define YYNSTATES 141
579 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
581 #define YYMAXUTOK 313
583 #define YYTRANSLATE(YYX) \
584 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
586 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
587 static const yytype_uint8 yytranslate
[] =
589 0, 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, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
615 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
616 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
617 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
618 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
619 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
624 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
626 static const yytype_uint16 yyprhs
[] =
628 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
629 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
630 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
631 80, 82, 85, 88, 90, 92, 94, 96, 98, 100,
632 103, 107, 111, 113, 115, 118, 122, 123, 125, 129,
633 130, 134, 135, 139, 143, 147, 149, 151, 153, 154,
634 156, 158, 161, 163, 166, 168, 170, 172, 174, 176,
635 178, 181, 184, 188, 190, 193, 195, 198, 200, 203,
636 206, 207, 211, 213, 217, 220, 221, 224, 227, 231,
637 235, 239, 241, 243, 244, 246, 248, 250, 252, 254,
641 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
642 static const yytype_int8 yyrhs
[] =
644 60, 0, -1, 61, 51, 76, 89, -1, -1, 61,
645 62, -1, 63, -1, 53, -1, 17, -1, 19, 82,
646 83, -1, 20, -1, 20, 3, -1, 21, -1, 22,
647 4, -1, 23, 4, -1, 24, 3, -1, 24, 48,
648 3, -1, 25, -1, 26, 45, -1, 27, 3, -1,
649 28, 45, -1, 29, -1, 30, 3, -1, 30, 48,
650 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
651 48, 3, -1, 35, 45, -1, 36, -1, 37, -1,
652 38, -1, 39, 3, -1, 40, 3, -1, 42, -1,
653 43, -1, 44, -1, 54, -1, 68, -1, 65, -1,
654 41, 87, -1, 8, 45, 72, -1, 9, 45, 72,
655 -1, 18, -1, 31, -1, 16, 84, -1, 16, 49,
656 84, -1, -1, 49, -1, 58, 64, 45, -1, -1,
657 6, 66, 75, -1, -1, 5, 67, 75, -1, 7,
658 55, 71, -1, 69, 70, 71, -1, 10, -1, 11,
659 -1, 12, -1, -1, 55, -1, 87, -1, 71, 87,
660 -1, 73, -1, 72, 73, -1, 87, -1, 55, -1,
661 56, -1, 57, -1, 55, -1, 85, -1, 85, 4,
662 -1, 85, 88, -1, 85, 4, 88, -1, 74, -1,
663 75, 74, -1, 77, -1, 76, 77, -1, 78, -1,
664 63, 54, -1, 1, 54, -1, -1, 86, 79, 80,
665 -1, 81, -1, 80, 52, 81, -1, 80, 54, -1,
666 -1, 81, 87, -1, 81, 45, -1, 81, 13, 87,
667 -1, 81, 14, 4, -1, 81, 15, 55, -1, 49,
668 -1, 3, -1, -1, 3, -1, 45, -1, 49, -1,
669 46, -1, 50, -1, 85, -1, 88, -1, 3, -1,
673 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
674 static const yytype_uint16 yyrline
[] =
676 0, 210, 210, 218, 220, 224, 225, 234, 235, 247,
677 248, 253, 254, 255, 256, 257, 258, 263, 272, 273,
678 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
679 284, 285, 286, 287, 288, 289, 290, 294, 295, 296,
680 300, 307, 314, 318, 322, 327, 348, 349, 353, 382,
681 382, 387, 387, 392, 403, 418, 419, 420, 424, 425,
682 430, 432, 437, 438, 442, 443, 444, 445, 450, 455,
683 460, 466, 472, 483, 484, 493, 494, 500, 501, 502,
684 509, 509, 513, 514, 515, 520, 521, 523, 525, 527,
685 529, 539, 540, 546, 550, 559, 579, 581, 590, 595,
690 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
691 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
692 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
693 static const char *const yytname
[] =
695 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
696 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
697 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
698 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
699 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
700 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
701 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
702 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
703 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
704 "\"%parse-param\"", "\"%pure-parser\"", "\"%push-parser\"",
705 "\"%push-pull-parser\"", "\"%require\"", "\"%skeleton\"", "\"%start\"",
706 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"",
707 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
708 "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"", "\"<*>\"", "\"<>\"",
709 "\"%union\"", "$accept", "input", "prologue_declarations",
710 "prologue_declaration", "grammar_declaration", "union_name",
711 "symbol_declaration", "$@1", "$@2", "precedence_declaration",
712 "precedence_declarator", "type.opt", "symbols.1", "generic_symlist",
713 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
714 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
715 "variable", "content.opt", "braceless", "id", "id_colon", "symbol",
716 "string_as_id", "epilogue.opt", 0
721 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
723 static const yytype_uint16 yytoknum
[] =
725 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
726 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
727 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
728 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
729 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
730 305, 306, 307, 308, 309, 310, 311, 312, 313
734 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
735 static const yytype_uint8 yyr1
[] =
737 0, 59, 60, 61, 61, 62, 62, 62, 62, 62,
738 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
739 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
740 62, 62, 62, 62, 62, 62, 62, 63, 63, 63,
741 63, 63, 63, 63, 63, 63, 64, 64, 63, 66,
742 65, 67, 65, 65, 68, 69, 69, 69, 70, 70,
743 71, 71, 72, 72, 73, 73, 73, 73, 74, 74,
744 74, 74, 74, 75, 75, 76, 76, 77, 77, 77,
745 79, 78, 80, 80, 80, 81, 81, 81, 81, 81,
746 81, 82, 82, 83, 83, 84, 85, 85, 86, 87,
750 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
751 static const yytype_uint8 yyr2
[] =
753 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
754 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
755 1, 2, 3, 1, 1, 2, 3, 2, 1, 1,
756 1, 2, 2, 1, 1, 1, 1, 1, 1, 2,
757 3, 3, 1, 1, 2, 3, 0, 1, 3, 0,
758 3, 0, 3, 3, 3, 1, 1, 1, 0, 1,
759 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
760 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
761 0, 3, 1, 3, 2, 0, 2, 2, 3, 3,
762 3, 1, 1, 0, 1, 1, 1, 1, 1, 1,
766 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
767 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
768 means the default is an error. */
769 static const yytype_uint8 yydefact
[] =
771 3, 0, 0, 1, 51, 49, 0, 0, 0, 55,
772 56, 57, 0, 7, 42, 0, 9, 11, 0, 0,
773 0, 16, 0, 0, 0, 20, 0, 43, 23, 24,
774 0, 0, 28, 29, 30, 0, 0, 0, 33, 34,
775 35, 0, 6, 36, 46, 4, 5, 38, 37, 58,
776 0, 0, 0, 0, 0, 95, 0, 44, 92, 91,
777 93, 10, 12, 13, 14, 0, 17, 18, 19, 21,
778 0, 25, 0, 27, 31, 32, 101, 97, 96, 99,
779 39, 100, 0, 98, 0, 0, 75, 77, 80, 47,
780 0, 59, 0, 68, 73, 52, 69, 50, 53, 60,
781 65, 66, 67, 40, 62, 64, 41, 45, 94, 8,
782 15, 22, 26, 79, 78, 0, 76, 2, 85, 48,
783 54, 74, 70, 71, 61, 63, 103, 81, 82, 72,
784 85, 84, 0, 0, 0, 87, 86, 83, 88, 89,
788 /* YYDEFGOTO[NTERM-NUM]. */
789 static const yytype_int16 yydefgoto
[] =
791 -1, 1, 2, 45, 84, 90, 47, 51, 50, 48,
792 49, 92, 98, 103, 104, 94, 95, 85, 86, 87,
793 118, 127, 128, 60, 109, 57, 79, 88, 105, 81,
797 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
799 #define YYPACT_NINF -79
800 static const yytype_int16 yypact
[] =
802 -79, 5, 96, -79, -79, -79, 3, 17, 18, -79,
803 -79, -79, -8, -79, -79, 27, 61, -79, 65, 73,
804 31, -79, 41, 75, 43, -79, 32, -79, -79, -79,
805 33, 44, -79, -79, -79, 87, 89, 26, -79, -79,
806 -79, 15, -79, -79, 45, -79, -79, -79, -79, 42,
807 38, 38, 26, 11, 11, -79, 51, -79, -79, -79,
808 95, -79, -79, -79, -79, 106, -79, -79, -79, -79,
809 107, -79, 108, -79, -79, -79, -79, -79, -79, -79,
810 -79, -79, 88, -79, 90, 1, -79, -79, -79, -79,
811 54, -79, 26, -79, -79, 38, 50, 38, 26, -79,
812 -79, -79, -79, 11, -79, -79, 11, -79, -79, -79,
813 -79, -79, -79, -79, -79, 94, -79, -79, -79, -79,
814 26, -79, 140, -79, -79, -79, -79, -9, 25, -79,
815 -79, -79, 26, 141, 91, -79, -79, 25, -79, -79,
819 /* YYPGOTO[NTERM-NUM]. */
820 static const yytype_int16 yypgoto
[] =
822 -79, -79, -79, -79, 146, -79, -79, -79, -79, -79,
823 -79, -79, 59, 98, -21, -48, 102, -79, 70, -79,
824 -79, -79, 28, -79, -79, 100, -47, -79, -37, -78,
828 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
829 positive, shift that token. If negative, reduce the rule which
830 number is the opposite. If zero, do what YYDEFACT says.
831 If YYTABLE_NINF, syntax error. */
832 #define YYTABLE_NINF -103
833 static const yytype_int16 yytable
[] =
835 80, -102, 82, 96, 96, 3, 4, 5, 6, 7,
836 8, 9, 10, 11, 76, 99, 82, 12, 123, 14,
837 4, 5, 6, 7, 8, 9, 10, 11, 76, 76,
838 58, 12, 27, 14, 64, 69, 71, 55, 132, 133,
839 134, 56, 37, 130, 129, 131, 27, 121, 96, 121,
840 96, 83, 115, 76, 122, 99, 37, 77, 52, 44,
841 78, 124, 53, 54, 61, 83, 100, 101, 102, 62,
842 135, 77, 77, 44, 78, 78, 59, 63, 67, 65,
843 70, 72, 125, 124, 77, 125, 66, 78, 68, 73,
844 74, 136, 75, 93, 89, 138, 55, 91, 108, 119,
845 136, 4, 5, 6, 7, 8, 9, 10, 11, 110,
846 111, 112, 12, 13, 14, 15, 16, 17, 18, 19,
847 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
848 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
849 40, 126, 113, 76, 114, 139, 140, 41, 46, 42,
850 43, 120, 106, 97, 44, 116, 107, 0, 137
853 static const yytype_int16 yycheck
[] =
855 37, 0, 1, 50, 51, 0, 5, 6, 7, 8,
856 9, 10, 11, 12, 3, 52, 1, 16, 96, 18,
857 5, 6, 7, 8, 9, 10, 11, 12, 3, 3,
858 3, 16, 31, 18, 3, 3, 3, 45, 13, 14,
859 15, 49, 41, 52, 122, 54, 31, 95, 95, 97,
860 97, 50, 51, 3, 4, 92, 41, 46, 55, 58,
861 49, 98, 45, 45, 3, 50, 55, 56, 57, 4,
862 45, 46, 46, 58, 49, 49, 49, 4, 3, 48,
863 48, 48, 103, 120, 46, 106, 45, 49, 45, 45,
864 3, 128, 3, 55, 49, 132, 45, 55, 3, 45,
865 137, 5, 6, 7, 8, 9, 10, 11, 12, 3,
866 3, 3, 16, 17, 18, 19, 20, 21, 22, 23,
867 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
868 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
869 44, 47, 54, 3, 54, 4, 55, 51, 2, 53,
870 54, 92, 54, 51, 58, 85, 56, -1, 130
873 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
874 symbol of state STATE-NUM. */
875 static const yytype_uint8 yystos
[] =
877 0, 60, 61, 0, 5, 6, 7, 8, 9, 10,
878 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
879 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
880 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
881 44, 51, 53, 54, 58, 62, 63, 65, 68, 69,
882 67, 66, 55, 45, 45, 45, 49, 84, 3, 49,
883 82, 3, 4, 4, 3, 48, 45, 3, 45, 3,
884 48, 3, 48, 45, 3, 3, 3, 46, 49, 85,
885 87, 88, 1, 50, 63, 76, 77, 78, 86, 49,
886 64, 55, 70, 55, 74, 75, 85, 75, 71, 87,
887 55, 56, 57, 72, 73, 87, 72, 84, 3, 83,
888 3, 3, 3, 54, 54, 51, 77, 89, 79, 45,
889 71, 74, 4, 88, 87, 73, 47, 80, 81, 88,
890 52, 54, 13, 14, 15, 45, 87, 81, 87, 4,
894 #define yyerrok (yyerrstatus = 0)
895 #define yyclearin (yychar = YYEMPTY)
899 #define YYACCEPT goto yyacceptlab
900 #define YYABORT goto yyabortlab
901 #define YYERROR goto yyerrorlab
904 /* Like YYERROR except do call yyerror. This remains here temporarily
905 to ease the transition to the new meaning of YYERROR, for GCC.
906 Once GCC version 2 has supplanted version 1, this can go. */
908 #define YYFAIL goto yyerrlab
910 #define YYRECOVERING() (!!yyerrstatus)
912 #define YYBACKUP(Token, Value) \
914 if (yychar == YYEMPTY && yylen == 1) \
918 yytoken = YYTRANSLATE (yychar); \
924 yyerror (YY_("syntax error: cannot back up")); \
931 #define YYERRCODE 256
934 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
935 If N is 0, then set CURRENT to the empty location which ends
936 the previous symbol: RHS[0] (always defined). */
938 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
939 #ifndef YYLLOC_DEFAULT
940 # define YYLLOC_DEFAULT(Current, Rhs, N) \
944 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
945 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
946 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
947 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
951 (Current).first_line = (Current).last_line = \
952 YYRHSLOC (Rhs, 0).last_line; \
953 (Current).first_column = (Current).last_column = \
954 YYRHSLOC (Rhs, 0).last_column; \
960 /* YY_LOCATION_PRINT -- Print the location on the stream.
961 This macro was not mandated originally: define only if we know
962 we won't break user code: when these are the locations we know. */
964 #ifndef YY_LOCATION_PRINT
965 # if YYLTYPE_IS_TRIVIAL
966 # define YY_LOCATION_PRINT(File, Loc) \
967 fprintf (File, "%d.%d-%d.%d", \
968 (Loc).first_line, (Loc).first_column, \
969 (Loc).last_line, (Loc).last_column)
971 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
976 /* YYLEX -- calling `yylex' with the right arguments. */
979 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
981 # define YYLEX yylex (&yylval, &yylloc)
984 /* Enable debugging if requested. */
988 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
989 # define YYFPRINTF fprintf
992 # define YYDPRINTF(Args) \
998 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1002 YYFPRINTF (stderr, "%s ", Title); \
1003 yy_symbol_print (stderr, \
1004 Type, Value, Location); \
1005 YYFPRINTF (stderr, "\n"); \
1010 /*--------------------------------.
1011 | Print this symbol on YYOUTPUT. |
1012 `--------------------------------*/
1015 #if (defined __STDC__ || defined __C99__FUNC__ \
1016 || defined __cplusplus || defined _MSC_VER)
1018 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1021 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1024 YYSTYPE
const * const yyvaluep
;
1025 YYLTYPE
const * const yylocationp
;
1030 YYUSE (yylocationp
);
1032 if (yytype
< YYNTOKENS
)
1033 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1039 case 3: /* "\"string\"" */
1041 /* Line 1535 of yacc.c */
1042 #line 188 "parse-gram.y"
1043 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1045 /* Line 1535 of yacc.c */
1046 #line 1047 "parse-gram.c"
1048 case 4: /* "\"integer\"" */
1050 /* Line 1535 of yacc.c */
1051 #line 199 "parse-gram.y"
1052 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1054 /* Line 1535 of yacc.c */
1055 #line 1056 "parse-gram.c"
1057 case 45: /* "\"{...}\"" */
1059 /* Line 1535 of yacc.c */
1060 #line 190 "parse-gram.y"
1061 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1063 /* Line 1535 of yacc.c */
1064 #line 1065 "parse-gram.c"
1066 case 46: /* "\"char\"" */
1068 /* Line 1535 of yacc.c */
1069 #line 182 "parse-gram.y"
1070 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1072 /* Line 1535 of yacc.c */
1073 #line 1074 "parse-gram.c"
1075 case 47: /* "\"epilogue\"" */
1077 /* Line 1535 of yacc.c */
1078 #line 190 "parse-gram.y"
1079 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1081 /* Line 1535 of yacc.c */
1082 #line 1083 "parse-gram.c"
1084 case 49: /* "\"identifier\"" */
1086 /* Line 1535 of yacc.c */
1087 #line 195 "parse-gram.y"
1088 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1090 /* Line 1535 of yacc.c */
1091 #line 1092 "parse-gram.c"
1093 case 50: /* "\"identifier:\"" */
1095 /* Line 1535 of yacc.c */
1096 #line 196 "parse-gram.y"
1097 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1099 /* Line 1535 of yacc.c */
1100 #line 1101 "parse-gram.c"
1102 case 53: /* "\"%{...%}\"" */
1104 /* Line 1535 of yacc.c */
1105 #line 190 "parse-gram.y"
1106 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1108 /* Line 1535 of yacc.c */
1109 #line 1110 "parse-gram.c"
1111 case 55: /* "\"type\"" */
1113 /* Line 1535 of yacc.c */
1114 #line 194 "parse-gram.y"
1115 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1117 /* Line 1535 of yacc.c */
1118 #line 1119 "parse-gram.c"
1120 case 82: /* "variable" */
1122 /* Line 1535 of yacc.c */
1123 #line 195 "parse-gram.y"
1124 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1126 /* Line 1535 of yacc.c */
1127 #line 1128 "parse-gram.c"
1129 case 83: /* "content.opt" */
1131 /* Line 1535 of yacc.c */
1132 #line 190 "parse-gram.y"
1133 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1135 /* Line 1535 of yacc.c */
1136 #line 1137 "parse-gram.c"
1138 case 84: /* "braceless" */
1140 /* Line 1535 of yacc.c */
1141 #line 190 "parse-gram.y"
1142 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1144 /* Line 1535 of yacc.c */
1145 #line 1146 "parse-gram.c"
1149 /* Line 1535 of yacc.c */
1150 #line 202 "parse-gram.y"
1151 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1153 /* Line 1535 of yacc.c */
1154 #line 1155 "parse-gram.c"
1156 case 86: /* "id_colon" */
1158 /* Line 1535 of yacc.c */
1159 #line 203 "parse-gram.y"
1160 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1162 /* Line 1535 of yacc.c */
1163 #line 1164 "parse-gram.c"
1165 case 87: /* "symbol" */
1167 /* Line 1535 of yacc.c */
1168 #line 202 "parse-gram.y"
1169 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1171 /* Line 1535 of yacc.c */
1172 #line 1173 "parse-gram.c"
1174 case 88: /* "string_as_id" */
1176 /* Line 1535 of yacc.c */
1177 #line 202 "parse-gram.y"
1178 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1180 /* Line 1535 of yacc.c */
1181 #line 1182 "parse-gram.c"
1189 /*--------------------------------.
1190 | Print this symbol on YYOUTPUT. |
1191 `--------------------------------*/
1193 #if (defined __STDC__ || defined __C99__FUNC__ \
1194 || defined __cplusplus || defined _MSC_VER)
1196 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1199 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1202 YYSTYPE
const * const yyvaluep
;
1203 YYLTYPE
const * const yylocationp
;
1206 if (yytype
< YYNTOKENS
)
1207 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1209 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1211 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1212 YYFPRINTF (yyoutput
, ": ");
1213 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1214 YYFPRINTF (yyoutput
, ")");
1217 /*------------------------------------------------------------------.
1218 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1220 `------------------------------------------------------------------*/
1222 #if (defined __STDC__ || defined __C99__FUNC__ \
1223 || defined __cplusplus || defined _MSC_VER)
1225 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1228 yy_stack_print (yybottom
, yytop
)
1229 yytype_int16
*yybottom
;
1230 yytype_int16
*yytop
;
1233 YYFPRINTF (stderr
, "Stack now");
1234 for (; yybottom
<= yytop
; yybottom
++)
1236 int yybot
= *yybottom
;
1237 YYFPRINTF (stderr
, " %d", yybot
);
1239 YYFPRINTF (stderr
, "\n");
1242 # define YY_STACK_PRINT(Bottom, Top) \
1245 yy_stack_print ((Bottom), (Top)); \
1249 /*------------------------------------------------.
1250 | Report that the YYRULE is going to be reduced. |
1251 `------------------------------------------------*/
1253 #if (defined __STDC__ || defined __C99__FUNC__ \
1254 || defined __cplusplus || defined _MSC_VER)
1256 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1259 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1265 int yynrhs
= yyr2
[yyrule
];
1267 unsigned long int yylno
= yyrline
[yyrule
];
1268 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1270 /* The symbols being reduced. */
1271 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1273 fprintf (stderr
, " $%d = ", yyi
+ 1);
1274 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1275 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1276 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1277 fprintf (stderr
, "\n");
1281 # define YY_REDUCE_PRINT(Rule) \
1284 yy_reduce_print (yyvsp, yylsp, Rule); \
1287 /* Nonzero means print parse trace. It is left uninitialized so that
1288 multiple parsers can coexist. */
1290 #else /* !YYDEBUG */
1291 # define YYDPRINTF(Args)
1292 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1293 # define YY_STACK_PRINT(Bottom, Top)
1294 # define YY_REDUCE_PRINT(Rule)
1295 #endif /* !YYDEBUG */
1298 /* YYINITDEPTH -- initial size of the parser's stacks. */
1300 # define YYINITDEPTH 200
1303 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1304 if the built-in stack extension method is used).
1306 Do not make this value too large; the results are undefined if
1307 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1308 evaluated with infinite-precision integer arithmetic. */
1311 # define YYMAXDEPTH 10000
1319 # if defined __GLIBC__ && defined _STRING_H
1320 # define yystrlen strlen
1322 /* Return the length of YYSTR. */
1323 #if (defined __STDC__ || defined __C99__FUNC__ \
1324 || defined __cplusplus || defined _MSC_VER)
1326 yystrlen (const char *yystr
)
1334 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1342 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1343 # define yystpcpy stpcpy
1345 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1347 #if (defined __STDC__ || defined __C99__FUNC__ \
1348 || defined __cplusplus || defined _MSC_VER)
1350 yystpcpy (char *yydest
, const char *yysrc
)
1353 yystpcpy (yydest
, yysrc
)
1359 const char *yys
= yysrc
;
1361 while ((*yyd
++ = *yys
++) != '\0')
1370 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1371 quotes and backslashes, so that it's suitable for yyerror. The
1372 heuristic is that double-quoting is unnecessary unless the string
1373 contains an apostrophe, a comma, or backslash (other than
1374 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1375 null, do not copy; instead, return the length of what the result
1378 yytnamerr (char *yyres
, const char *yystr
)
1383 char const *yyp
= yystr
;
1390 goto do_not_strip_quotes
;
1394 goto do_not_strip_quotes
;
1407 do_not_strip_quotes
: ;
1411 return yystrlen (yystr
);
1413 return yystpcpy (yyres
, yystr
) - yyres
;
1417 /* Copy into YYRESULT an error message about the unexpected token
1418 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1419 including the terminating null byte. If YYRESULT is null, do not
1420 copy anything; just return the number of bytes that would be
1421 copied. As a special case, return 0 if an ordinary "syntax error"
1422 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1423 size calculation. */
1425 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1427 int yyn
= yypact
[yystate
];
1429 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1433 int yytype
= YYTRANSLATE (yychar
);
1434 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1435 YYSIZE_T yysize
= yysize0
;
1437 int yysize_overflow
= 0;
1438 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1439 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1443 /* This is so xgettext sees the translatable formats that are
1444 constructed on the fly. */
1445 YY_("syntax error, unexpected %s");
1446 YY_("syntax error, unexpected %s, expecting %s");
1447 YY_("syntax error, unexpected %s, expecting %s or %s");
1448 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1449 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1453 static char const yyunexpected
[] = "syntax error, unexpected %s";
1454 static char const yyexpecting
[] = ", expecting %s";
1455 static char const yyor
[] = " or %s";
1456 char yyformat
[sizeof yyunexpected
1457 + sizeof yyexpecting
- 1
1458 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1459 * (sizeof yyor
- 1))];
1460 char const *yyprefix
= yyexpecting
;
1462 /* Start YYX at -YYN if negative to avoid negative indexes in
1464 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1466 /* Stay within bounds of both yycheck and yytname. */
1467 int yychecklim
= YYLAST
- yyn
+ 1;
1468 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1471 yyarg
[0] = yytname
[yytype
];
1472 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1474 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1475 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1477 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1481 yyformat
[sizeof yyunexpected
- 1] = '\0';
1484 yyarg
[yycount
++] = yytname
[yyx
];
1485 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1486 yysize_overflow
|= (yysize1
< yysize
);
1488 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1492 yyf
= YY_(yyformat
);
1493 yysize1
= yysize
+ yystrlen (yyf
);
1494 yysize_overflow
|= (yysize1
< yysize
);
1497 if (yysize_overflow
)
1498 return YYSIZE_MAXIMUM
;
1502 /* Avoid sprintf, as that infringes on the user's name space.
1503 Don't have undefined behavior even if the translation
1504 produced a string with the wrong number of "%s"s. */
1505 char *yyp
= yyresult
;
1507 while ((*yyp
= *yyf
) != '\0')
1509 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1511 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1524 #endif /* YYERROR_VERBOSE */
1527 /*-----------------------------------------------.
1528 | Release the memory associated to this symbol. |
1529 `-----------------------------------------------*/
1532 #if (defined __STDC__ || defined __C99__FUNC__ \
1533 || defined __cplusplus || defined _MSC_VER)
1535 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1538 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1542 YYLTYPE
*yylocationp
;
1546 YYUSE (yylocationp
);
1550 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1561 /* Prevent warnings from -Wmissing-prototypes. */
1563 #ifdef YYPARSE_PARAM
1564 #if defined __STDC__ || defined __cplusplus
1565 int yyparse (void *YYPARSE_PARAM
);
1569 #else /* ! YYPARSE_PARAM */
1570 #if defined __STDC__ || defined __cplusplus
1575 #endif /* ! YYPARSE_PARAM */
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 /* Number of syntax errors so far. */
1616 /* Location data for the lookahead symbol. */
1622 /* Number of tokens to shift before error messages enabled. */
1624 /* Lookahead token as an internal (translated) token number. */
1627 /* Buffer for error messages, and its allocated size. */
1629 char *yymsg
= yymsgbuf
;
1630 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1633 /* Three stacks and their tools:
1634 `yyss': related to states,
1635 `yyvs': related to semantic values,
1636 `yyls': related to locations.
1638 Refer to the stacks thru separate pointers, to allow yyoverflow
1639 to reallocate them elsewhere. */
1641 /* The state stack. */
1642 yytype_int16 yyssa
[YYINITDEPTH
];
1643 yytype_int16
*yyss
= yyssa
;
1644 yytype_int16
*yyssp
;
1646 /* The semantic value stack. */
1647 YYSTYPE yyvsa
[YYINITDEPTH
];
1648 YYSTYPE
*yyvs
= yyvsa
;
1651 /* The location stack. */
1652 YYLTYPE yylsa
[YYINITDEPTH
];
1653 YYLTYPE
*yyls
= yylsa
;
1655 /* The locations where the error started and ended. */
1656 YYLTYPE yyerror_range
[2];
1658 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1660 YYSIZE_T yystacksize
= YYINITDEPTH
;
1662 /* The variables used to return semantic value and location from the
1667 /* The number of symbols on the RHS of the reduced rule.
1668 Keep to zero when no symbol should be popped. */
1671 YYDPRINTF ((stderr
, "Starting parse\n"));
1676 yychar
= YYEMPTY
; /* Cause a token to be read. */
1678 /* Initialize stack pointers.
1679 Waste one element of value and location stack
1680 so that they stay on the same level as the state stack.
1681 The wasted elements are never initialized. */
1686 #if YYLTYPE_IS_TRIVIAL
1687 /* Initialize the default location before parsing starts. */
1688 yylloc
.first_line
= yylloc
.last_line
= 1;
1689 yylloc
.first_column
= yylloc
.last_column
= 1;
1693 /* User initialization code. */
1695 /* Line 1535 of yacc.c */
1696 #line 89 "parse-gram.y"
1698 /* Bison's grammar can initial empty locations, hence a default
1699 location is needed. */
1700 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1701 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1704 /* Line 1535 of yacc.c */
1705 #line 1706 "parse-gram.c"
1709 /*------------------------------------------------------------.
1710 | yynewstate -- Push a new state, which is found in yystate. |
1711 `------------------------------------------------------------*/
1713 /* In all cases, when you get here, the value and location stacks
1714 have just been pushed. So pushing a state here evens the stacks. */
1720 if (yyss
+ yystacksize
- 1 <= yyssp
)
1722 /* Get the current used size of the three stacks, in elements. */
1723 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1727 /* Give user a chance to reallocate the stack. Use copies of
1728 these so that the &'s don't force the real ones into
1730 YYSTYPE
*yyvs1
= yyvs
;
1731 yytype_int16
*yyss1
= yyss
;
1732 YYLTYPE
*yyls1
= yyls
;
1734 /* Each stack pointer address is followed by the size of the
1735 data in use in that stack, in bytes. This used to be a
1736 conditional around just the two extra args, but that might
1737 be undefined if yyoverflow is a macro. */
1738 yyoverflow (YY_("memory exhausted"),
1739 &yyss1
, yysize
* sizeof (*yyssp
),
1740 &yyvs1
, yysize
* sizeof (*yyvsp
),
1741 &yyls1
, yysize
* sizeof (*yylsp
),
1747 #else /* no yyoverflow */
1748 # ifndef YYSTACK_RELOCATE
1749 goto yyexhaustedlab
;
1751 /* Extend the stack our own way. */
1752 if (YYMAXDEPTH
<= yystacksize
)
1753 goto yyexhaustedlab
;
1755 if (YYMAXDEPTH
< yystacksize
)
1756 yystacksize
= YYMAXDEPTH
;
1759 yytype_int16
*yyss1
= yyss
;
1760 union yyalloc
*yyptr
=
1761 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1763 goto yyexhaustedlab
;
1764 YYSTACK_RELOCATE (yyss
);
1765 YYSTACK_RELOCATE (yyvs
);
1766 YYSTACK_RELOCATE (yyls
);
1767 # undef YYSTACK_RELOCATE
1769 YYSTACK_FREE (yyss1
);
1772 #endif /* no yyoverflow */
1774 yyssp
= yyss
+ yysize
- 1;
1775 yyvsp
= yyvs
+ yysize
- 1;
1776 yylsp
= yyls
+ yysize
- 1;
1778 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1779 (unsigned long int) yystacksize
));
1781 if (yyss
+ yystacksize
- 1 <= yyssp
)
1785 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1787 if (yystate
== YYFINAL
)
1797 /* Do appropriate processing given the current state. Read a
1798 lookahead token if we need one and don't already have one. */
1800 /* First try to decide what to do without reference to lookahead token. */
1801 yyn
= yypact
[yystate
];
1802 if (yyn
== YYPACT_NINF
)
1805 /* Not known => get a lookahead token if don't already have one. */
1807 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1808 if (yychar
== YYEMPTY
)
1810 YYDPRINTF ((stderr
, "Reading a token: "));
1814 if (yychar
<= YYEOF
)
1816 yychar
= yytoken
= YYEOF
;
1817 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1821 yytoken
= YYTRANSLATE (yychar
);
1822 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1825 /* If the proper action on seeing token YYTOKEN is to reduce or to
1826 detect an error, take that action. */
1828 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1833 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1839 /* Count tokens shifted since error; after three, turn off error
1844 /* Shift the lookahead token. */
1845 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1847 /* Discard the shifted token. */
1856 /*-----------------------------------------------------------.
1857 | yydefault -- do the default action for the current state. |
1858 `-----------------------------------------------------------*/
1860 yyn
= yydefact
[yystate
];
1866 /*-----------------------------.
1867 | yyreduce -- Do a reduction. |
1868 `-----------------------------*/
1870 /* yyn is the number of a rule to reduce with. */
1873 /* If YYLEN is nonzero, implement the default value of the action:
1876 Otherwise, the following line sets YYVAL to garbage.
1877 This behavior is undocumented and Bison
1878 users should not rely upon it. Assigning to YYVAL
1879 unconditionally makes the parser a bit smaller, and it avoids a
1880 GCC warning that YYVAL may be used uninitialized. */
1881 yyval
= yyvsp
[1-yylen
];
1883 /* Default location. */
1884 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1885 YY_REDUCE_PRINT (yyn
);
1890 /* Line 1535 of yacc.c */
1891 #line 226 "parse-gram.y"
1893 code_props plain_code
;
1894 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1895 code_props_translate_code (&plain_code
);
1896 gram_scanner_last_string_free ();
1897 prologue_augment (plain_code
.code
, (yylsp
[(1) - (1)]), union_seen
);
1898 code_scanner_last_string_free ();
1904 /* Line 1535 of yacc.c */
1905 #line 234 "parse-gram.y"
1906 { debug_flag
= true; }
1911 /* Line 1535 of yacc.c */
1912 #line 236 "parse-gram.y"
1914 char const name_prefix
[] = "percent_define_";
1915 char *name
= xmalloc (sizeof name_prefix
+ strlen ((yyvsp
[(2) - (3)].uniqstr
)));
1916 strcpy (name
, name_prefix
);
1917 strcpy (name
+ sizeof name_prefix
- 1, (yyvsp
[(2) - (3)].uniqstr
));
1918 if (muscle_find_const (name
))
1919 warn_at ((yylsp
[(2) - (3)]), _("%s `%s' redefined"), "%define variable", (yyvsp
[(2) - (3)].uniqstr
));
1920 MUSCLE_INSERT_STRING (uniqstr_new (name
), (yyvsp
[(3) - (3)].chars
));
1922 muscle_grow_user_name_list ("user_percent_define_variables", (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
1928 /* Line 1535 of yacc.c */
1929 #line 247 "parse-gram.y"
1930 { defines_flag
= true; }
1935 /* Line 1535 of yacc.c */
1936 #line 249 "parse-gram.y"
1938 defines_flag
= true;
1939 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1945 /* Line 1535 of yacc.c */
1946 #line 253 "parse-gram.y"
1947 { error_verbose
= true; }
1952 /* Line 1535 of yacc.c */
1953 #line 254 "parse-gram.y"
1954 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1959 /* Line 1535 of yacc.c */
1960 #line 255 "parse-gram.y"
1961 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1966 /* Line 1535 of yacc.c */
1967 #line 256 "parse-gram.y"
1968 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1973 /* Line 1535 of yacc.c */
1974 #line 257 "parse-gram.y"
1975 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1980 /* Line 1535 of yacc.c */
1981 #line 259 "parse-gram.y"
1983 nondeterministic_parser
= true;
1990 /* Line 1535 of yacc.c */
1991 #line 264 "parse-gram.y"
1994 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
1995 code_props_translate_code (&action
);
1996 gram_scanner_last_string_free ();
1997 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
1998 code_scanner_last_string_free ();
2004 /* Line 1535 of yacc.c */
2005 #line 272 "parse-gram.y"
2006 { language_argmatch ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2011 /* Line 1535 of yacc.c */
2012 #line 273 "parse-gram.y"
2013 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2018 /* Line 1535 of yacc.c */
2019 #line 274 "parse-gram.y"
2020 { locations_flag
= true; }
2025 /* Line 1535 of yacc.c */
2026 #line 275 "parse-gram.y"
2027 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2032 /* Line 1535 of yacc.c */
2033 #line 276 "parse-gram.y"
2034 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2039 /* Line 1535 of yacc.c */
2040 #line 277 "parse-gram.y"
2041 { no_lines_flag
= true; }
2046 /* Line 1535 of yacc.c */
2047 #line 278 "parse-gram.y"
2048 { nondeterministic_parser
= true; }
2053 /* Line 1535 of yacc.c */
2054 #line 279 "parse-gram.y"
2055 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2060 /* Line 1535 of yacc.c */
2061 #line 280 "parse-gram.y"
2062 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2067 /* Line 1535 of yacc.c */
2068 #line 281 "parse-gram.y"
2069 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2074 /* Line 1535 of yacc.c */
2075 #line 282 "parse-gram.y"
2076 { pure_parser
= true; }
2081 /* Line 1535 of yacc.c */
2082 #line 283 "parse-gram.y"
2083 { push_parser
= true; pull_parser
= false; }
2088 /* Line 1535 of yacc.c */
2089 #line 284 "parse-gram.y"
2090 { push_parser
= true; pull_parser
= true; }
2095 /* Line 1535 of yacc.c */
2096 #line 285 "parse-gram.y"
2097 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2102 /* Line 1535 of yacc.c */
2103 #line 286 "parse-gram.y"
2104 { skeleton_arg ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2109 /* Line 1535 of yacc.c */
2110 #line 287 "parse-gram.y"
2111 { token_table_flag
= true; }
2116 /* Line 1535 of yacc.c */
2117 #line 288 "parse-gram.y"
2118 { report_flag
= report_states
; }
2123 /* Line 1535 of yacc.c */
2124 #line 289 "parse-gram.y"
2125 { yacc_flag
= true; }
2130 /* Line 1535 of yacc.c */
2131 #line 297 "parse-gram.y"
2133 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2139 /* Line 1535 of yacc.c */
2140 #line 301 "parse-gram.y"
2143 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2144 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2145 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2151 /* Line 1535 of yacc.c */
2152 #line 308 "parse-gram.y"
2155 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2156 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2157 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2163 /* Line 1535 of yacc.c */
2164 #line 315 "parse-gram.y"
2166 default_prec
= true;
2172 /* Line 1535 of yacc.c */
2173 #line 319 "parse-gram.y"
2175 default_prec
= false;
2181 /* Line 1535 of yacc.c */
2182 #line 323 "parse-gram.y"
2184 muscle_code_grow ("percent_code", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2185 code_scanner_last_string_free ();
2191 /* Line 1535 of yacc.c */
2192 #line 328 "parse-gram.y"
2194 char const name_prefix
[] = "percent_code_";
2195 char *name
= xmalloc (sizeof name_prefix
+ strlen ((yyvsp
[(2) - (3)].uniqstr
)));
2196 strcpy (name
, name_prefix
);
2197 strcpy (name
+ sizeof name_prefix
- 1, (yyvsp
[(2) - (3)].uniqstr
));
2198 muscle_code_grow (uniqstr_new (name
), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2200 code_scanner_last_string_free ();
2201 muscle_grow_user_name_list ("user_percent_code_qualifiers", (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2207 /* Line 1535 of yacc.c */
2208 #line 348 "parse-gram.y"
2214 /* Line 1535 of yacc.c */
2215 #line 349 "parse-gram.y"
2216 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2221 /* Line 1535 of yacc.c */
2222 #line 354 "parse-gram.y"
2224 char const *body
= (yyvsp
[(3) - (3)].code
);
2226 /* Concatenate the %union bodies. If this is the first %union, make sure
2227 the synchronization line appears after the opening '{' so as not to
2228 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2229 into '\n', and omit the new %union's leading '{'. */
2232 muscle_grow ("stype", "{", "");
2236 char *code
= muscle_find ("stype");
2237 code
[strlen (code
) - 1] = '\n';
2242 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2243 gram_scanner_last_string_free ();
2249 /* Line 1535 of yacc.c */
2250 #line 382 "parse-gram.y"
2251 { current_class
= nterm_sym
; }
2256 /* Line 1535 of yacc.c */
2257 #line 383 "parse-gram.y"
2259 current_class
= unknown_sym
;
2260 current_type
= NULL
;
2266 /* Line 1535 of yacc.c */
2267 #line 387 "parse-gram.y"
2268 { current_class
= token_sym
; }
2273 /* Line 1535 of yacc.c */
2274 #line 388 "parse-gram.y"
2276 current_class
= unknown_sym
;
2277 current_type
= NULL
;
2283 /* Line 1535 of yacc.c */
2284 #line 393 "parse-gram.y"
2288 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2289 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2290 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2296 /* Line 1535 of yacc.c */
2297 #line 404 "parse-gram.y"
2301 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2303 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2304 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2306 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2307 current_type
= NULL
;
2313 /* Line 1535 of yacc.c */
2314 #line 418 "parse-gram.y"
2315 { (yyval
.assoc
) = left_assoc
; }
2320 /* Line 1535 of yacc.c */
2321 #line 419 "parse-gram.y"
2322 { (yyval
.assoc
) = right_assoc
; }
2327 /* Line 1535 of yacc.c */
2328 #line 420 "parse-gram.y"
2329 { (yyval
.assoc
) = non_assoc
; }
2334 /* Line 1535 of yacc.c */
2335 #line 424 "parse-gram.y"
2336 { current_type
= NULL
; }
2341 /* Line 1535 of yacc.c */
2342 #line 425 "parse-gram.y"
2343 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2348 /* Line 1535 of yacc.c */
2349 #line 431 "parse-gram.y"
2350 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2355 /* Line 1535 of yacc.c */
2356 #line 433 "parse-gram.y"
2357 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2362 /* Line 1535 of yacc.c */
2363 #line 437 "parse-gram.y"
2364 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2369 /* Line 1535 of yacc.c */
2370 #line 438 "parse-gram.y"
2371 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2376 /* Line 1535 of yacc.c */
2377 #line 442 "parse-gram.y"
2378 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2383 /* Line 1535 of yacc.c */
2384 #line 443 "parse-gram.y"
2385 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2390 /* Line 1535 of yacc.c */
2391 #line 444 "parse-gram.y"
2392 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2397 /* Line 1535 of yacc.c */
2398 #line 445 "parse-gram.y"
2399 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2404 /* Line 1535 of yacc.c */
2405 #line 451 "parse-gram.y"
2407 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2414 /* Line 1535 of yacc.c */
2415 #line 456 "parse-gram.y"
2417 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2418 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2424 /* Line 1535 of yacc.c */
2425 #line 461 "parse-gram.y"
2427 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2428 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2429 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2435 /* Line 1535 of yacc.c */
2436 #line 467 "parse-gram.y"
2438 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2439 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2440 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2446 /* Line 1535 of yacc.c */
2447 #line 473 "parse-gram.y"
2449 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2450 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2451 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2452 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2458 /* Line 1535 of yacc.c */
2459 #line 503 "parse-gram.y"
2467 /* Line 1535 of yacc.c */
2468 #line 509 "parse-gram.y"
2469 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2474 /* Line 1535 of yacc.c */
2475 #line 513 "parse-gram.y"
2476 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2481 /* Line 1535 of yacc.c */
2482 #line 514 "parse-gram.y"
2483 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2488 /* Line 1535 of yacc.c */
2489 #line 520 "parse-gram.y"
2490 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2495 /* Line 1535 of yacc.c */
2496 #line 522 "parse-gram.y"
2497 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2502 /* Line 1535 of yacc.c */
2503 #line 524 "parse-gram.y"
2504 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2509 /* Line 1535 of yacc.c */
2510 #line 526 "parse-gram.y"
2511 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2516 /* Line 1535 of yacc.c */
2517 #line 528 "parse-gram.y"
2518 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2523 /* Line 1535 of yacc.c */
2524 #line 530 "parse-gram.y"
2525 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2530 /* Line 1535 of yacc.c */
2531 #line 540 "parse-gram.y"
2532 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2537 /* Line 1535 of yacc.c */
2538 #line 546 "parse-gram.y"
2540 static char one
[] = "1";
2541 (yyval
.chars
) = one
;
2547 /* Line 1535 of yacc.c */
2548 #line 560 "parse-gram.y"
2550 code_props plain_code
;
2551 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2552 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2553 code_props_translate_code (&plain_code
);
2554 gram_scanner_last_string_free ();
2555 (yyval
.chars
) = plain_code
.code
;
2561 /* Line 1535 of yacc.c */
2562 #line 580 "parse-gram.y"
2563 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2568 /* Line 1535 of yacc.c */
2569 #line 582 "parse-gram.y"
2571 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2572 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2573 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2579 /* Line 1535 of yacc.c */
2580 #line 590 "parse-gram.y"
2581 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2586 /* Line 1535 of yacc.c */
2587 #line 602 "parse-gram.y"
2589 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2590 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2596 /* Line 1535 of yacc.c */
2597 #line 611 "parse-gram.y"
2599 code_props plain_code
;
2600 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2601 code_props_translate_code (&plain_code
);
2602 gram_scanner_last_string_free ();
2603 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2604 code_scanner_last_string_free ();
2610 /* Line 1535 of yacc.c */
2611 #line 2612 "parse-gram.c"
2614 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2618 YY_STACK_PRINT (yyss
, yyssp
);
2623 /* Now `shift' the result of the reduction. Determine what state
2624 that goes to, based on the state we popped back to and the rule
2625 number reduced by. */
2629 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2630 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2631 yystate
= yytable
[yystate
];
2633 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2638 /*------------------------------------.
2639 | yyerrlab -- here on detecting error |
2640 `------------------------------------*/
2642 /* If not already recovering from an error, report this error. */
2646 #if ! YYERROR_VERBOSE
2647 yyerror (YY_("syntax error"));
2650 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2651 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2653 YYSIZE_T yyalloc
= 2 * yysize
;
2654 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2655 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2656 if (yymsg
!= yymsgbuf
)
2657 YYSTACK_FREE (yymsg
);
2658 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2660 yymsg_alloc
= yyalloc
;
2664 yymsg_alloc
= sizeof yymsgbuf
;
2668 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2670 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2675 yyerror (YY_("syntax error"));
2677 goto yyexhaustedlab
;
2683 yyerror_range
[0] = yylloc
;
2685 if (yyerrstatus
== 3)
2687 /* If just tried and failed to reuse lookahead token after an
2688 error, discard it. */
2690 if (yychar
<= YYEOF
)
2692 /* Return failure if at end of input. */
2693 if (yychar
== YYEOF
)
2698 yydestruct ("Error: discarding",
2699 yytoken
, &yylval
, &yylloc
);
2704 /* Else will try to reuse lookahead token after shifting the error
2709 /*---------------------------------------------------.
2710 | yyerrorlab -- error raised explicitly by YYERROR. |
2711 `---------------------------------------------------*/
2714 /* Pacify compilers like GCC when the user code never invokes
2715 YYERROR and the label yyerrorlab therefore never appears in user
2717 if (/*CONSTCOND*/ 0)
2720 yyerror_range
[0] = yylsp
[1-yylen
];
2721 /* Do not reclaim the symbols of the rule which action triggered
2725 YY_STACK_PRINT (yyss
, yyssp
);
2730 /*-------------------------------------------------------------.
2731 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2732 `-------------------------------------------------------------*/
2734 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2738 yyn
= yypact
[yystate
];
2739 if (yyn
!= YYPACT_NINF
)
2742 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2750 /* Pop the current state because it cannot handle the error token. */
2754 yyerror_range
[0] = *yylsp
;
2755 yydestruct ("Error: popping",
2756 yystos
[yystate
], yyvsp
, yylsp
);
2759 YY_STACK_PRINT (yyss
, yyssp
);
2764 yyerror_range
[1] = yylloc
;
2765 /* Using YYLLOC is tempting, but would change the location of
2766 the lookahead. YYLOC is available though. */
2767 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2770 /* Shift the error token. */
2771 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2777 /*-------------------------------------.
2778 | yyacceptlab -- YYACCEPT comes here. |
2779 `-------------------------------------*/
2784 /*-----------------------------------.
2785 | yyabortlab -- YYABORT comes here. |
2786 `-----------------------------------*/
2792 /*-------------------------------------------------.
2793 | yyexhaustedlab -- memory exhaustion comes here. |
2794 `-------------------------------------------------*/
2796 yyerror (YY_("memory exhausted"));
2802 if (yychar
!= YYEMPTY
)
2803 yydestruct ("Cleanup: discarding lookahead",
2804 yytoken
, &yylval
, &yylloc
);
2805 /* Do not reclaim the symbols of the rule which action triggered
2806 this YYABORT or YYACCEPT. */
2808 YY_STACK_PRINT (yyss
, yyssp
);
2809 while (yyssp
!= yyss
)
2811 yydestruct ("Cleanup: popping",
2812 yystos
[*yyssp
], yyvsp
, yylsp
);
2817 YYSTACK_FREE (yyss
);
2820 if (yymsg
!= yymsgbuf
)
2821 YYSTACK_FREE (yymsg
);
2823 /* Make sure YYID is used. */
2824 return YYID (yyresult
);
2829 /* Line 1535 of yacc.c */
2830 #line 621 "parse-gram.y"
2834 /* Return the location of the left-hand side of a rule whose
2835 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2836 the right-hand side, and return an empty location equal to the end
2837 boundary of RHS[0] if the right-hand side is empty. */
2840 lloc_default (YYLTYPE
const *rhs
, int n
)
2845 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2846 The bug is fixed in 7.4.2m, but play it safe for now. */
2847 loc
.start
= rhs
[n
].end
;
2848 loc
.end
= rhs
[n
].end
;
2850 /* Ignore empty nonterminals the start of the the right-hand side.
2851 Do not bother to ignore them at the end of the right-hand side,
2852 since empty nonterminals have the same end as their predecessors. */
2853 for (i
= 1; i
<= n
; i
++)
2854 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2856 loc
.start
= rhs
[i
].start
;
2864 /* Add a lex-param or a parse-param (depending on TYPE) with
2865 declaration DECL and location LOC. */
2868 add_param (char const *type
, char *decl
, location loc
)
2870 static char const alphanum
[26 + 26 + 1 + 10] =
2871 "abcdefghijklmnopqrstuvwxyz"
2872 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2875 char const *name_start
= NULL
;
2878 /* Stop on last actual character. */
2879 for (p
= decl
; p
[1]; p
++)
2881 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2882 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2885 /* Strip the surrounding '{' and '}', and any blanks just inside
2887 while (*--p
== ' ' || *p
== '\t')
2890 while (*++decl
== ' ' || *decl
== '\t')
2894 complain_at (loc
, _("missing identifier in parameter declaration"));
2901 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2905 name
= xmalloc (name_len
+ 1);
2906 memcpy (name
, name_start
, name_len
);
2907 name
[name_len
] = '\0';
2908 muscle_pair_list_grow (type
, decl
, name
);
2912 gram_scanner_last_string_free ();
2917 version_check (location
const *loc
, char const *version
)
2919 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2921 complain_at (*loc
, "require bison %s, but have %s",
2922 version
, PACKAGE_VERSION
);
2928 gram_error (location
const *loc
, char const *msg
)
2930 complain_at (*loc
, "%s", msg
);
2934 token_name (int type
)
2936 return yytname
[YYTRANSLATE (type
)];
2947 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2948 return quotearg_style (escape_quoting_style
, buf
);