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 139
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, 240, 242, 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, 88, -1, -1, 61,
645 62, -1, 63, -1, 53, -1, 17, -1, 19, 3,
646 82, -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, 86, -1, 8, 45, 72, -1, 9, 45, 72,
655 -1, 18, -1, 31, -1, 16, 83, -1, 16, 3,
656 83, -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, 86, -1, 71, 86,
660 -1, 73, -1, 72, 73, -1, 86, -1, 55, -1,
661 56, -1, 57, -1, 55, -1, 84, -1, 84, 4,
662 -1, 84, 87, -1, 84, 4, 87, -1, 74, -1,
663 75, 74, -1, 77, -1, 76, 77, -1, 78, -1,
664 63, 54, -1, 1, 54, -1, -1, 85, 79, 80,
665 -1, 81, -1, 80, 52, 81, -1, 80, 54, -1,
666 -1, 81, 86, -1, 81, 45, -1, 81, 13, 86,
667 -1, 81, 14, 4, -1, 81, 15, 55, -1, -1,
668 3, -1, 45, -1, 49, -1, 46, -1, 50, -1,
669 84, -1, 87, -1, 3, -1, -1, 51, 47, -1
672 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
673 static const yytype_uint16 yyrline
[] =
675 0, 210, 210, 218, 220, 224, 225, 234, 235, 249,
676 250, 255, 256, 257, 258, 259, 260, 265, 274, 275,
677 276, 277, 278, 279, 280, 281, 282, 283, 284, 285,
678 286, 287, 288, 289, 290, 291, 292, 296, 297, 298,
679 302, 309, 316, 320, 324, 329, 352, 353, 357, 386,
680 386, 391, 391, 396, 407, 422, 423, 424, 428, 429,
681 434, 436, 441, 442, 446, 447, 448, 449, 454, 459,
682 464, 470, 476, 487, 488, 497, 498, 504, 505, 506,
683 513, 513, 517, 518, 519, 524, 525, 527, 529, 531,
684 533, 545, 549, 558, 578, 580, 589, 594, 595, 600,
689 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
690 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
691 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
692 static const char *const yytname
[] =
694 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
695 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
696 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
697 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
698 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
699 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
700 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
701 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
702 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
703 "\"%parse-param\"", "\"%pure-parser\"", "\"%push-parser\"",
704 "\"%push-pull-parser\"", "\"%require\"", "\"%skeleton\"", "\"%start\"",
705 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"",
706 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
707 "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"", "\"<*>\"", "\"<>\"",
708 "\"%union\"", "$accept", "input", "prologue_declarations",
709 "prologue_declaration", "grammar_declaration", "union_name",
710 "symbol_declaration", "$@1", "$@2", "precedence_declaration",
711 "precedence_declarator", "type.opt", "symbols.1", "generic_symlist",
712 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
713 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
714 "content.opt", "braceless", "id", "id_colon", "symbol", "string_as_id",
720 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
722 static const yytype_uint16 yytoknum
[] =
724 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
725 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
726 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
727 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
728 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
729 305, 306, 307, 308, 309, 310, 311, 312, 313
733 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
734 static const yytype_uint8 yyr1
[] =
736 0, 59, 60, 61, 61, 62, 62, 62, 62, 62,
737 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
738 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
739 62, 62, 62, 62, 62, 62, 62, 63, 63, 63,
740 63, 63, 63, 63, 63, 63, 64, 64, 63, 66,
741 65, 67, 65, 65, 68, 69, 69, 69, 70, 70,
742 71, 71, 72, 72, 73, 73, 73, 73, 74, 74,
743 74, 74, 74, 75, 75, 76, 76, 77, 77, 77,
744 79, 78, 80, 80, 80, 81, 81, 81, 81, 81,
745 81, 82, 82, 83, 84, 84, 85, 86, 86, 87,
749 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
750 static const yytype_uint8 yyr2
[] =
752 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
753 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
754 1, 2, 3, 1, 1, 2, 3, 2, 1, 1,
755 1, 2, 2, 1, 1, 1, 1, 1, 1, 2,
756 3, 3, 1, 1, 2, 3, 0, 1, 3, 0,
757 3, 0, 3, 3, 3, 1, 1, 1, 0, 1,
758 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
759 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
760 0, 3, 1, 3, 2, 0, 2, 2, 3, 3,
761 3, 0, 1, 1, 1, 1, 1, 1, 1, 1,
765 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
766 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
767 means the default is an error. */
768 static const yytype_uint8 yydefact
[] =
770 3, 0, 0, 1, 51, 49, 0, 0, 0, 55,
771 56, 57, 0, 7, 42, 0, 9, 11, 0, 0,
772 0, 16, 0, 0, 0, 20, 0, 43, 23, 24,
773 0, 0, 28, 29, 30, 0, 0, 0, 33, 34,
774 35, 0, 6, 36, 46, 4, 5, 38, 37, 58,
775 0, 0, 0, 0, 0, 0, 93, 44, 91, 10,
776 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
777 0, 27, 31, 32, 99, 95, 94, 97, 39, 98,
778 0, 96, 0, 0, 75, 77, 80, 47, 0, 59,
779 0, 68, 73, 52, 69, 50, 53, 60, 65, 66,
780 67, 40, 62, 64, 41, 45, 92, 8, 15, 22,
781 26, 79, 78, 0, 76, 2, 85, 48, 54, 74,
782 70, 71, 61, 63, 101, 81, 82, 72, 85, 84,
783 0, 0, 0, 87, 86, 83, 88, 89, 90
786 /* YYDEFGOTO[NTERM-NUM]. */
787 static const yytype_int8 yydefgoto
[] =
789 -1, 1, 2, 45, 82, 88, 47, 51, 50, 48,
790 49, 90, 96, 101, 102, 92, 93, 83, 84, 85,
791 116, 125, 126, 107, 57, 77, 86, 103, 79, 115
794 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
796 #define YYPACT_NINF -93
797 static const yytype_int16 yypact
[] =
799 -93, 8, 94, -93, -93, -93, -41, -20, -6, -93,
800 -93, -93, 4, -93, -93, 42, 54, -93, 56, 64,
801 2, -93, 28, 71, 34, -93, 3, -93, -93, -93,
802 6, 35, -93, -93, -93, 79, 81, -2, -93, -93,
803 -93, 25, -93, -93, 36, -93, -93, -93, -93, 31,
804 9, 9, -2, 21, 21, 43, -93, -93, 84, -93,
805 -93, -93, -93, 87, -93, -93, -93, -93, 88, -93,
806 89, -93, -93, -93, -93, -93, -93, -93, -93, -93,
807 40, -93, 41, 11, -93, -93, -93, -93, 51, -93,
808 -2, -93, -93, 9, 68, 9, -2, -93, -93, -93,
809 -93, 21, -93, -93, 21, -93, -93, -93, -93, -93,
810 -93, -93, -93, 50, -93, -93, -93, -93, -2, -93,
811 104, -93, -93, -93, -93, -14, 136, -93, -93, -93,
812 -2, 105, 53, -93, -93, 136, -93, -93, -93
815 /* YYPGOTO[NTERM-NUM]. */
816 static const yytype_int16 yypgoto
[] =
818 -93, -93, -93, -93, 138, -93, -93, -93, -93, -93,
819 -93, -93, 52, 90, -91, -30, 92, -93, 58, -93,
820 -93, -93, 18, -93, 98, -47, -93, -37, -92, -93
823 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
824 positive, shift that token. If negative, reduce the rule which
825 number is the opposite. If zero, do what YYDEFACT says.
826 If YYTABLE_NINF, syntax error. */
827 #define YYTABLE_NINF -101
828 static const yytype_int16 yytable
[] =
830 78, 74, 121, 94, 94, 62, 67, 55, 3, 69,
831 123, -100, 80, 123, 52, 97, 4, 5, 6, 7,
832 8, 9, 10, 11, 74, 53, 80, 12, 127, 14,
833 4, 5, 6, 7, 8, 9, 10, 11, 128, 54,
834 129, 12, 27, 14, 75, 58, 94, 76, 94, 56,
835 63, 68, 37, 97, 70, 75, 27, 59, 76, 122,
836 60, 81, 113, 119, 91, 119, 37, 75, 61, 44,
837 76, 74, 120, 64, 65, 81, 98, 99, 100, 66,
838 71, 122, 72, 44, 73, 87, 89, 106, 56, 134,
839 108, 109, 110, 136, 111, 112, 117, 124, 134, 4,
840 5, 6, 7, 8, 9, 10, 11, 74, 138, 137,
841 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
842 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
843 32, 33, 34, 35, 36, 37, 38, 39, 40, 74,
844 46, 114, 118, 95, 104, 41, 135, 42, 43, 130,
845 131, 132, 44, 105, 0, 0, 0, 0, 0, 0,
846 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
847 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
851 static const yytype_int16 yycheck
[] =
853 37, 3, 94, 50, 51, 3, 3, 3, 0, 3,
854 101, 0, 1, 104, 55, 52, 5, 6, 7, 8,
855 9, 10, 11, 12, 3, 45, 1, 16, 120, 18,
856 5, 6, 7, 8, 9, 10, 11, 12, 52, 45,
857 54, 16, 31, 18, 46, 3, 93, 49, 95, 45,
858 48, 48, 41, 90, 48, 46, 31, 3, 49, 96,
859 4, 50, 51, 93, 55, 95, 41, 46, 4, 58,
860 49, 3, 4, 45, 3, 50, 55, 56, 57, 45,
861 45, 118, 3, 58, 3, 49, 55, 3, 45, 126,
862 3, 3, 3, 130, 54, 54, 45, 47, 135, 5,
863 6, 7, 8, 9, 10, 11, 12, 3, 55, 4,
864 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
865 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
866 36, 37, 38, 39, 40, 41, 42, 43, 44, 3,
867 2, 83, 90, 51, 54, 51, 128, 53, 54, 13,
868 14, 15, 58, 55, -1, -1, -1, -1, -1, -1,
869 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
870 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
871 -1, 45, 46, -1, -1, 49
874 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
875 symbol of state STATE-NUM. */
876 static const yytype_uint8 yystos
[] =
878 0, 60, 61, 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, 43,
882 44, 51, 53, 54, 58, 62, 63, 65, 68, 69,
883 67, 66, 55, 45, 45, 3, 45, 83, 3, 3,
884 4, 4, 3, 48, 45, 3, 45, 3, 48, 3,
885 48, 45, 3, 3, 3, 46, 49, 84, 86, 87,
886 1, 50, 63, 76, 77, 78, 85, 49, 64, 55,
887 70, 55, 74, 75, 84, 75, 71, 86, 55, 56,
888 57, 72, 73, 86, 72, 83, 3, 82, 3, 3,
889 3, 54, 54, 51, 77, 88, 79, 45, 71, 74,
890 4, 87, 86, 73, 47, 80, 81, 87, 52, 54,
891 13, 14, 15, 45, 86, 81, 86, 4, 55
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: /* "content.opt" */
1122 /* Line 1535 of yacc.c */
1123 #line 190 "parse-gram.y"
1124 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1126 /* Line 1535 of yacc.c */
1127 #line 1128 "parse-gram.c"
1129 case 83: /* "braceless" */
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"
1140 /* Line 1535 of yacc.c */
1141 #line 202 "parse-gram.y"
1142 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1144 /* Line 1535 of yacc.c */
1145 #line 1146 "parse-gram.c"
1147 case 85: /* "id_colon" */
1149 /* Line 1535 of yacc.c */
1150 #line 203 "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: /* "symbol" */
1158 /* Line 1535 of yacc.c */
1159 #line 202 "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: /* "string_as_id" */
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"
1180 /*--------------------------------.
1181 | Print this symbol on YYOUTPUT. |
1182 `--------------------------------*/
1184 #if (defined __STDC__ || defined __C99__FUNC__ \
1185 || defined __cplusplus || defined _MSC_VER)
1187 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1190 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1193 YYSTYPE
const * const yyvaluep
;
1194 YYLTYPE
const * const yylocationp
;
1197 if (yytype
< YYNTOKENS
)
1198 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1200 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1202 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1203 YYFPRINTF (yyoutput
, ": ");
1204 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1205 YYFPRINTF (yyoutput
, ")");
1208 /*------------------------------------------------------------------.
1209 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1211 `------------------------------------------------------------------*/
1213 #if (defined __STDC__ || defined __C99__FUNC__ \
1214 || defined __cplusplus || defined _MSC_VER)
1216 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1219 yy_stack_print (yybottom
, yytop
)
1220 yytype_int16
*yybottom
;
1221 yytype_int16
*yytop
;
1224 YYFPRINTF (stderr
, "Stack now");
1225 for (; yybottom
<= yytop
; yybottom
++)
1227 int yybot
= *yybottom
;
1228 YYFPRINTF (stderr
, " %d", yybot
);
1230 YYFPRINTF (stderr
, "\n");
1233 # define YY_STACK_PRINT(Bottom, Top) \
1236 yy_stack_print ((Bottom), (Top)); \
1240 /*------------------------------------------------.
1241 | Report that the YYRULE is going to be reduced. |
1242 `------------------------------------------------*/
1244 #if (defined __STDC__ || defined __C99__FUNC__ \
1245 || defined __cplusplus || defined _MSC_VER)
1247 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1250 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1256 int yynrhs
= yyr2
[yyrule
];
1258 unsigned long int yylno
= yyrline
[yyrule
];
1259 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1261 /* The symbols being reduced. */
1262 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1264 fprintf (stderr
, " $%d = ", yyi
+ 1);
1265 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1266 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1267 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1268 fprintf (stderr
, "\n");
1272 # define YY_REDUCE_PRINT(Rule) \
1275 yy_reduce_print (yyvsp, yylsp, Rule); \
1278 /* Nonzero means print parse trace. It is left uninitialized so that
1279 multiple parsers can coexist. */
1281 #else /* !YYDEBUG */
1282 # define YYDPRINTF(Args)
1283 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1284 # define YY_STACK_PRINT(Bottom, Top)
1285 # define YY_REDUCE_PRINT(Rule)
1286 #endif /* !YYDEBUG */
1289 /* YYINITDEPTH -- initial size of the parser's stacks. */
1291 # define YYINITDEPTH 200
1294 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1295 if the built-in stack extension method is used).
1297 Do not make this value too large; the results are undefined if
1298 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1299 evaluated with infinite-precision integer arithmetic. */
1302 # define YYMAXDEPTH 10000
1310 # if defined __GLIBC__ && defined _STRING_H
1311 # define yystrlen strlen
1313 /* Return the length of YYSTR. */
1314 #if (defined __STDC__ || defined __C99__FUNC__ \
1315 || defined __cplusplus || defined _MSC_VER)
1317 yystrlen (const char *yystr
)
1325 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1333 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1334 # define yystpcpy stpcpy
1336 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1338 #if (defined __STDC__ || defined __C99__FUNC__ \
1339 || defined __cplusplus || defined _MSC_VER)
1341 yystpcpy (char *yydest
, const char *yysrc
)
1344 yystpcpy (yydest
, yysrc
)
1350 const char *yys
= yysrc
;
1352 while ((*yyd
++ = *yys
++) != '\0')
1361 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1362 quotes and backslashes, so that it's suitable for yyerror. The
1363 heuristic is that double-quoting is unnecessary unless the string
1364 contains an apostrophe, a comma, or backslash (other than
1365 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1366 null, do not copy; instead, return the length of what the result
1369 yytnamerr (char *yyres
, const char *yystr
)
1374 char const *yyp
= yystr
;
1381 goto do_not_strip_quotes
;
1385 goto do_not_strip_quotes
;
1398 do_not_strip_quotes
: ;
1402 return yystrlen (yystr
);
1404 return yystpcpy (yyres
, yystr
) - yyres
;
1408 /* Copy into YYRESULT an error message about the unexpected token
1409 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1410 including the terminating null byte. If YYRESULT is null, do not
1411 copy anything; just return the number of bytes that would be
1412 copied. As a special case, return 0 if an ordinary "syntax error"
1413 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1414 size calculation. */
1416 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1418 int yyn
= yypact
[yystate
];
1420 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1424 int yytype
= YYTRANSLATE (yychar
);
1425 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1426 YYSIZE_T yysize
= yysize0
;
1428 int yysize_overflow
= 0;
1429 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1430 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1434 /* This is so xgettext sees the translatable formats that are
1435 constructed on the fly. */
1436 YY_("syntax error, unexpected %s");
1437 YY_("syntax error, unexpected %s, expecting %s");
1438 YY_("syntax error, unexpected %s, expecting %s or %s");
1439 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1440 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1444 static char const yyunexpected
[] = "syntax error, unexpected %s";
1445 static char const yyexpecting
[] = ", expecting %s";
1446 static char const yyor
[] = " or %s";
1447 char yyformat
[sizeof yyunexpected
1448 + sizeof yyexpecting
- 1
1449 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1450 * (sizeof yyor
- 1))];
1451 char const *yyprefix
= yyexpecting
;
1453 /* Start YYX at -YYN if negative to avoid negative indexes in
1455 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1457 /* Stay within bounds of both yycheck and yytname. */
1458 int yychecklim
= YYLAST
- yyn
+ 1;
1459 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1462 yyarg
[0] = yytname
[yytype
];
1463 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1465 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1466 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1468 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1472 yyformat
[sizeof yyunexpected
- 1] = '\0';
1475 yyarg
[yycount
++] = yytname
[yyx
];
1476 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1477 yysize_overflow
|= (yysize1
< yysize
);
1479 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1483 yyf
= YY_(yyformat
);
1484 yysize1
= yysize
+ yystrlen (yyf
);
1485 yysize_overflow
|= (yysize1
< yysize
);
1488 if (yysize_overflow
)
1489 return YYSIZE_MAXIMUM
;
1493 /* Avoid sprintf, as that infringes on the user's name space.
1494 Don't have undefined behavior even if the translation
1495 produced a string with the wrong number of "%s"s. */
1496 char *yyp
= yyresult
;
1498 while ((*yyp
= *yyf
) != '\0')
1500 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1502 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1515 #endif /* YYERROR_VERBOSE */
1518 /*-----------------------------------------------.
1519 | Release the memory associated to this symbol. |
1520 `-----------------------------------------------*/
1523 #if (defined __STDC__ || defined __C99__FUNC__ \
1524 || defined __cplusplus || defined _MSC_VER)
1526 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1529 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1533 YYLTYPE
*yylocationp
;
1537 YYUSE (yylocationp
);
1541 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1552 /* Prevent warnings from -Wmissing-prototypes. */
1554 #ifdef YYPARSE_PARAM
1555 #if defined __STDC__ || defined __cplusplus
1556 int yyparse (void *YYPARSE_PARAM
);
1560 #else /* ! YYPARSE_PARAM */
1561 #if defined __STDC__ || defined __cplusplus
1566 #endif /* ! YYPARSE_PARAM */
1577 #ifdef YYPARSE_PARAM
1578 #if (defined __STDC__ || defined __C99__FUNC__ \
1579 || defined __cplusplus || defined _MSC_VER)
1581 yyparse (void *YYPARSE_PARAM
)
1584 yyparse (YYPARSE_PARAM
)
1585 void *YYPARSE_PARAM
;
1587 #else /* ! YYPARSE_PARAM */
1588 #if (defined __STDC__ || defined __C99__FUNC__ \
1589 || defined __cplusplus || defined _MSC_VER)
1599 /* The lookahead symbol. */
1602 /* The semantic value of the lookahead symbol. */
1605 /* Number of syntax errors so far. */
1607 /* Location data for the lookahead symbol. */
1613 /* Number of tokens to shift before error messages enabled. */
1615 /* Lookahead token as an internal (translated) token number. */
1618 /* Buffer for error messages, and its allocated size. */
1620 char *yymsg
= yymsgbuf
;
1621 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1624 /* Three 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
];
1634 yytype_int16
*yyss
= yyssa
;
1635 yytype_int16
*yyssp
;
1637 /* The semantic value stack. */
1638 YYSTYPE yyvsa
[YYINITDEPTH
];
1639 YYSTYPE
*yyvs
= yyvsa
;
1642 /* The location stack. */
1643 YYLTYPE yylsa
[YYINITDEPTH
];
1644 YYLTYPE
*yyls
= yylsa
;
1646 /* The locations where the error started and ended. */
1647 YYLTYPE yyerror_range
[2];
1649 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1651 YYSIZE_T yystacksize
= YYINITDEPTH
;
1653 /* The variables used to return semantic value and location from the
1658 /* The number of symbols on the RHS of the reduced rule.
1659 Keep to zero when no symbol should be popped. */
1662 YYDPRINTF ((stderr
, "Starting parse\n"));
1667 yychar
= YYEMPTY
; /* Cause a token to be read. */
1669 /* Initialize stack pointers.
1670 Waste one element of value and location stack
1671 so that they stay on the same level as the state stack.
1672 The wasted elements are never initialized. */
1677 #if YYLTYPE_IS_TRIVIAL
1678 /* Initialize the default location before parsing starts. */
1679 yylloc
.first_line
= yylloc
.last_line
= 1;
1680 yylloc
.first_column
= yylloc
.last_column
= 1;
1684 /* User initialization code. */
1686 /* Line 1535 of yacc.c */
1687 #line 89 "parse-gram.y"
1689 /* Bison's grammar can initial empty locations, hence a default
1690 location is needed. */
1691 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1692 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1695 /* Line 1535 of yacc.c */
1696 #line 1697 "parse-gram.c"
1700 /*------------------------------------------------------------.
1701 | yynewstate -- Push a new state, which is found in yystate. |
1702 `------------------------------------------------------------*/
1704 /* In all cases, when you get here, the value and location stacks
1705 have just been pushed. So pushing a state here evens the stacks. */
1711 if (yyss
+ yystacksize
- 1 <= yyssp
)
1713 /* Get the current used size of the three stacks, in elements. */
1714 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1718 /* Give user a chance to reallocate the stack. Use copies of
1719 these so that the &'s don't force the real ones into
1721 YYSTYPE
*yyvs1
= yyvs
;
1722 yytype_int16
*yyss1
= yyss
;
1723 YYLTYPE
*yyls1
= yyls
;
1725 /* Each stack pointer address is followed by the size of the
1726 data in use in that stack, in bytes. This used to be a
1727 conditional around just the two extra args, but that might
1728 be undefined if yyoverflow is a macro. */
1729 yyoverflow (YY_("memory exhausted"),
1730 &yyss1
, yysize
* sizeof (*yyssp
),
1731 &yyvs1
, yysize
* sizeof (*yyvsp
),
1732 &yyls1
, yysize
* sizeof (*yylsp
),
1738 #else /* no yyoverflow */
1739 # ifndef YYSTACK_RELOCATE
1740 goto yyexhaustedlab
;
1742 /* Extend the stack our own way. */
1743 if (YYMAXDEPTH
<= yystacksize
)
1744 goto yyexhaustedlab
;
1746 if (YYMAXDEPTH
< yystacksize
)
1747 yystacksize
= YYMAXDEPTH
;
1750 yytype_int16
*yyss1
= yyss
;
1751 union yyalloc
*yyptr
=
1752 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1754 goto yyexhaustedlab
;
1755 YYSTACK_RELOCATE (yyss
);
1756 YYSTACK_RELOCATE (yyvs
);
1757 YYSTACK_RELOCATE (yyls
);
1758 # undef YYSTACK_RELOCATE
1760 YYSTACK_FREE (yyss1
);
1763 #endif /* no yyoverflow */
1765 yyssp
= yyss
+ yysize
- 1;
1766 yyvsp
= yyvs
+ yysize
- 1;
1767 yylsp
= yyls
+ yysize
- 1;
1769 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1770 (unsigned long int) yystacksize
));
1772 if (yyss
+ yystacksize
- 1 <= yyssp
)
1776 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1778 if (yystate
== YYFINAL
)
1788 /* Do appropriate processing given the current state. Read a
1789 lookahead token if we need one and don't already have one. */
1791 /* First try to decide what to do without reference to lookahead token. */
1792 yyn
= yypact
[yystate
];
1793 if (yyn
== YYPACT_NINF
)
1796 /* Not known => get a lookahead token if don't already have one. */
1798 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1799 if (yychar
== YYEMPTY
)
1801 YYDPRINTF ((stderr
, "Reading a token: "));
1805 if (yychar
<= YYEOF
)
1807 yychar
= yytoken
= YYEOF
;
1808 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1812 yytoken
= YYTRANSLATE (yychar
);
1813 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1816 /* If the proper action on seeing token YYTOKEN is to reduce or to
1817 detect an error, take that action. */
1819 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1824 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1830 /* Count tokens shifted since error; after three, turn off error
1835 /* Shift the lookahead token. */
1836 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1838 /* Discard the shifted token. */
1847 /*-----------------------------------------------------------.
1848 | yydefault -- do the default action for the current state. |
1849 `-----------------------------------------------------------*/
1851 yyn
= yydefact
[yystate
];
1857 /*-----------------------------.
1858 | yyreduce -- Do a reduction. |
1859 `-----------------------------*/
1861 /* yyn is the number of a rule to reduce with. */
1864 /* If YYLEN is nonzero, implement the default value of the action:
1867 Otherwise, the following line sets YYVAL to garbage.
1868 This behavior is undocumented and Bison
1869 users should not rely upon it. Assigning to YYVAL
1870 unconditionally makes the parser a bit smaller, and it avoids a
1871 GCC warning that YYVAL may be used uninitialized. */
1872 yyval
= yyvsp
[1-yylen
];
1874 /* Default location. */
1875 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1876 YY_REDUCE_PRINT (yyn
);
1881 /* Line 1535 of yacc.c */
1882 #line 226 "parse-gram.y"
1884 code_props plain_code
;
1885 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1886 code_props_translate_code (&plain_code
);
1887 gram_scanner_last_string_free ();
1888 prologue_augment (plain_code
.code
, (yylsp
[(1) - (1)]), union_seen
);
1889 code_scanner_last_string_free ();
1895 /* Line 1535 of yacc.c */
1896 #line 234 "parse-gram.y"
1897 { debug_flag
= true; }
1902 /* Line 1535 of yacc.c */
1903 #line 236 "parse-gram.y"
1905 /* FIXME: Special characters in $2 may break %define.
1906 For example: `['. */
1907 char const name_prefix
[] = "percent_define_";
1908 char *name
= xmalloc (sizeof name_prefix
+ strlen ((yyvsp
[(2) - (3)].chars
)));
1909 strcpy (name
, name_prefix
);
1910 strcpy (name
+ sizeof name_prefix
- 1, (yyvsp
[(2) - (3)].chars
));
1911 if (muscle_find_const (name
))
1912 warn_at ((yylsp
[(2) - (3)]), _("%s `%s' redefined"), "%define variable", (yyvsp
[(2) - (3)].chars
));
1913 MUSCLE_INSERT_STRING (uniqstr_new (name
), (yyvsp
[(3) - (3)].chars
));
1915 muscle_grow_user_name_list ("user_percent_define_variables", (yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
1921 /* Line 1535 of yacc.c */
1922 #line 249 "parse-gram.y"
1923 { defines_flag
= true; }
1928 /* Line 1535 of yacc.c */
1929 #line 251 "parse-gram.y"
1931 defines_flag
= true;
1932 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1938 /* Line 1535 of yacc.c */
1939 #line 255 "parse-gram.y"
1940 { error_verbose
= true; }
1945 /* Line 1535 of yacc.c */
1946 #line 256 "parse-gram.y"
1947 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1952 /* Line 1535 of yacc.c */
1953 #line 257 "parse-gram.y"
1954 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1959 /* Line 1535 of yacc.c */
1960 #line 258 "parse-gram.y"
1961 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1966 /* Line 1535 of yacc.c */
1967 #line 259 "parse-gram.y"
1968 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1973 /* Line 1535 of yacc.c */
1974 #line 261 "parse-gram.y"
1976 nondeterministic_parser
= true;
1983 /* Line 1535 of yacc.c */
1984 #line 266 "parse-gram.y"
1987 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
1988 code_props_translate_code (&action
);
1989 gram_scanner_last_string_free ();
1990 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
1991 code_scanner_last_string_free ();
1997 /* Line 1535 of yacc.c */
1998 #line 274 "parse-gram.y"
1999 { language_argmatch ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2004 /* Line 1535 of yacc.c */
2005 #line 275 "parse-gram.y"
2006 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2011 /* Line 1535 of yacc.c */
2012 #line 276 "parse-gram.y"
2013 { locations_flag
= true; }
2018 /* Line 1535 of yacc.c */
2019 #line 277 "parse-gram.y"
2020 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2025 /* Line 1535 of yacc.c */
2026 #line 278 "parse-gram.y"
2027 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2032 /* Line 1535 of yacc.c */
2033 #line 279 "parse-gram.y"
2034 { no_lines_flag
= true; }
2039 /* Line 1535 of yacc.c */
2040 #line 280 "parse-gram.y"
2041 { nondeterministic_parser
= true; }
2046 /* Line 1535 of yacc.c */
2047 #line 281 "parse-gram.y"
2048 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2053 /* Line 1535 of yacc.c */
2054 #line 282 "parse-gram.y"
2055 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2060 /* Line 1535 of yacc.c */
2061 #line 283 "parse-gram.y"
2062 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2067 /* Line 1535 of yacc.c */
2068 #line 284 "parse-gram.y"
2069 { pure_parser
= true; }
2074 /* Line 1535 of yacc.c */
2075 #line 285 "parse-gram.y"
2076 { push_parser
= true; pull_parser
= false; }
2081 /* Line 1535 of yacc.c */
2082 #line 286 "parse-gram.y"
2083 { push_parser
= true; pull_parser
= true; }
2088 /* Line 1535 of yacc.c */
2089 #line 287 "parse-gram.y"
2090 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2095 /* Line 1535 of yacc.c */
2096 #line 288 "parse-gram.y"
2097 { skeleton_arg ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2102 /* Line 1535 of yacc.c */
2103 #line 289 "parse-gram.y"
2104 { token_table_flag
= true; }
2109 /* Line 1535 of yacc.c */
2110 #line 290 "parse-gram.y"
2111 { report_flag
= report_states
; }
2116 /* Line 1535 of yacc.c */
2117 #line 291 "parse-gram.y"
2118 { yacc_flag
= true; }
2123 /* Line 1535 of yacc.c */
2124 #line 299 "parse-gram.y"
2126 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2132 /* Line 1535 of yacc.c */
2133 #line 303 "parse-gram.y"
2136 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2137 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2138 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2144 /* Line 1535 of yacc.c */
2145 #line 310 "parse-gram.y"
2148 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2149 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2150 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2156 /* Line 1535 of yacc.c */
2157 #line 317 "parse-gram.y"
2159 default_prec
= true;
2165 /* Line 1535 of yacc.c */
2166 #line 321 "parse-gram.y"
2168 default_prec
= false;
2174 /* Line 1535 of yacc.c */
2175 #line 325 "parse-gram.y"
2177 muscle_code_grow ("percent_code", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2178 code_scanner_last_string_free ();
2184 /* Line 1535 of yacc.c */
2185 #line 330 "parse-gram.y"
2187 /* FIXME: Special characters in $2 may break %code.
2188 For example: `['. */
2189 char const name_prefix
[] = "percent_code_";
2190 char *name
= xmalloc (sizeof name_prefix
+ strlen ((yyvsp
[(2) - (3)].chars
)));
2191 strcpy (name
, name_prefix
);
2192 strcpy (name
+ sizeof name_prefix
- 1, (yyvsp
[(2) - (3)].chars
));
2193 muscle_code_grow (uniqstr_new (name
), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2195 code_scanner_last_string_free ();
2196 muscle_grow_user_name_list ("user_percent_code_qualifiers", (yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2202 /* Line 1535 of yacc.c */
2203 #line 352 "parse-gram.y"
2209 /* Line 1535 of yacc.c */
2210 #line 353 "parse-gram.y"
2211 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2216 /* Line 1535 of yacc.c */
2217 #line 358 "parse-gram.y"
2219 char const *body
= (yyvsp
[(3) - (3)].code
);
2221 /* Concatenate the %union bodies. If this is the first %union, make sure
2222 the synchronization line appears after the opening '{' so as not to
2223 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2224 into '\n', and omit the new %union's leading '{'. */
2227 muscle_grow ("stype", "{", "");
2231 char *code
= muscle_find ("stype");
2232 code
[strlen (code
) - 1] = '\n';
2237 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2238 gram_scanner_last_string_free ();
2244 /* Line 1535 of yacc.c */
2245 #line 386 "parse-gram.y"
2246 { current_class
= nterm_sym
; }
2251 /* Line 1535 of yacc.c */
2252 #line 387 "parse-gram.y"
2254 current_class
= unknown_sym
;
2255 current_type
= NULL
;
2261 /* Line 1535 of yacc.c */
2262 #line 391 "parse-gram.y"
2263 { current_class
= token_sym
; }
2268 /* Line 1535 of yacc.c */
2269 #line 392 "parse-gram.y"
2271 current_class
= unknown_sym
;
2272 current_type
= NULL
;
2278 /* Line 1535 of yacc.c */
2279 #line 397 "parse-gram.y"
2283 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2284 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2285 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2291 /* Line 1535 of yacc.c */
2292 #line 408 "parse-gram.y"
2296 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2298 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2299 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2301 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2302 current_type
= NULL
;
2308 /* Line 1535 of yacc.c */
2309 #line 422 "parse-gram.y"
2310 { (yyval
.assoc
) = left_assoc
; }
2315 /* Line 1535 of yacc.c */
2316 #line 423 "parse-gram.y"
2317 { (yyval
.assoc
) = right_assoc
; }
2322 /* Line 1535 of yacc.c */
2323 #line 424 "parse-gram.y"
2324 { (yyval
.assoc
) = non_assoc
; }
2329 /* Line 1535 of yacc.c */
2330 #line 428 "parse-gram.y"
2331 { current_type
= NULL
; }
2336 /* Line 1535 of yacc.c */
2337 #line 429 "parse-gram.y"
2338 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2343 /* Line 1535 of yacc.c */
2344 #line 435 "parse-gram.y"
2345 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2350 /* Line 1535 of yacc.c */
2351 #line 437 "parse-gram.y"
2352 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2357 /* Line 1535 of yacc.c */
2358 #line 441 "parse-gram.y"
2359 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2364 /* Line 1535 of yacc.c */
2365 #line 442 "parse-gram.y"
2366 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2371 /* Line 1535 of yacc.c */
2372 #line 446 "parse-gram.y"
2373 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2378 /* Line 1535 of yacc.c */
2379 #line 447 "parse-gram.y"
2380 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2385 /* Line 1535 of yacc.c */
2386 #line 448 "parse-gram.y"
2387 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2392 /* Line 1535 of yacc.c */
2393 #line 449 "parse-gram.y"
2394 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2399 /* Line 1535 of yacc.c */
2400 #line 455 "parse-gram.y"
2402 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2409 /* Line 1535 of yacc.c */
2410 #line 460 "parse-gram.y"
2412 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2413 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2419 /* Line 1535 of yacc.c */
2420 #line 465 "parse-gram.y"
2422 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2423 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2424 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2430 /* Line 1535 of yacc.c */
2431 #line 471 "parse-gram.y"
2433 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2434 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2435 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2441 /* Line 1535 of yacc.c */
2442 #line 477 "parse-gram.y"
2444 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2445 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2446 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2447 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2453 /* Line 1535 of yacc.c */
2454 #line 507 "parse-gram.y"
2462 /* Line 1535 of yacc.c */
2463 #line 513 "parse-gram.y"
2464 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2469 /* Line 1535 of yacc.c */
2470 #line 517 "parse-gram.y"
2471 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2476 /* Line 1535 of yacc.c */
2477 #line 518 "parse-gram.y"
2478 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2483 /* Line 1535 of yacc.c */
2484 #line 524 "parse-gram.y"
2485 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2490 /* Line 1535 of yacc.c */
2491 #line 526 "parse-gram.y"
2492 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2497 /* Line 1535 of yacc.c */
2498 #line 528 "parse-gram.y"
2499 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2504 /* Line 1535 of yacc.c */
2505 #line 530 "parse-gram.y"
2506 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2511 /* Line 1535 of yacc.c */
2512 #line 532 "parse-gram.y"
2513 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2518 /* Line 1535 of yacc.c */
2519 #line 534 "parse-gram.y"
2520 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2525 /* Line 1535 of yacc.c */
2526 #line 545 "parse-gram.y"
2528 static char one
[] = "1";
2529 (yyval
.chars
) = one
;
2535 /* Line 1535 of yacc.c */
2536 #line 559 "parse-gram.y"
2538 code_props plain_code
;
2539 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2540 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2541 code_props_translate_code (&plain_code
);
2542 gram_scanner_last_string_free ();
2543 (yyval
.chars
) = plain_code
.code
;
2549 /* Line 1535 of yacc.c */
2550 #line 579 "parse-gram.y"
2551 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2556 /* Line 1535 of yacc.c */
2557 #line 581 "parse-gram.y"
2559 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2560 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2561 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2567 /* Line 1535 of yacc.c */
2568 #line 589 "parse-gram.y"
2569 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2574 /* Line 1535 of yacc.c */
2575 #line 601 "parse-gram.y"
2577 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2578 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2584 /* Line 1535 of yacc.c */
2585 #line 610 "parse-gram.y"
2587 code_props plain_code
;
2588 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2589 code_props_translate_code (&plain_code
);
2590 gram_scanner_last_string_free ();
2591 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2592 code_scanner_last_string_free ();
2598 /* Line 1535 of yacc.c */
2599 #line 2600 "parse-gram.c"
2602 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2606 YY_STACK_PRINT (yyss
, yyssp
);
2611 /* Now `shift' the result of the reduction. Determine what state
2612 that goes to, based on the state we popped back to and the rule
2613 number reduced by. */
2617 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2618 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2619 yystate
= yytable
[yystate
];
2621 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2626 /*------------------------------------.
2627 | yyerrlab -- here on detecting error |
2628 `------------------------------------*/
2630 /* If not already recovering from an error, report this error. */
2634 #if ! YYERROR_VERBOSE
2635 yyerror (YY_("syntax error"));
2638 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2639 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2641 YYSIZE_T yyalloc
= 2 * yysize
;
2642 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2643 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2644 if (yymsg
!= yymsgbuf
)
2645 YYSTACK_FREE (yymsg
);
2646 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2648 yymsg_alloc
= yyalloc
;
2652 yymsg_alloc
= sizeof yymsgbuf
;
2656 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2658 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2663 yyerror (YY_("syntax error"));
2665 goto yyexhaustedlab
;
2671 yyerror_range
[0] = yylloc
;
2673 if (yyerrstatus
== 3)
2675 /* If just tried and failed to reuse lookahead token after an
2676 error, discard it. */
2678 if (yychar
<= YYEOF
)
2680 /* Return failure if at end of input. */
2681 if (yychar
== YYEOF
)
2686 yydestruct ("Error: discarding",
2687 yytoken
, &yylval
, &yylloc
);
2692 /* Else will try to reuse lookahead token after shifting the error
2697 /*---------------------------------------------------.
2698 | yyerrorlab -- error raised explicitly by YYERROR. |
2699 `---------------------------------------------------*/
2702 /* Pacify compilers like GCC when the user code never invokes
2703 YYERROR and the label yyerrorlab therefore never appears in user
2705 if (/*CONSTCOND*/ 0)
2708 yyerror_range
[0] = yylsp
[1-yylen
];
2709 /* Do not reclaim the symbols of the rule which action triggered
2713 YY_STACK_PRINT (yyss
, yyssp
);
2718 /*-------------------------------------------------------------.
2719 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2720 `-------------------------------------------------------------*/
2722 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2726 yyn
= yypact
[yystate
];
2727 if (yyn
!= YYPACT_NINF
)
2730 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2738 /* Pop the current state because it cannot handle the error token. */
2742 yyerror_range
[0] = *yylsp
;
2743 yydestruct ("Error: popping",
2744 yystos
[yystate
], yyvsp
, yylsp
);
2747 YY_STACK_PRINT (yyss
, yyssp
);
2752 yyerror_range
[1] = yylloc
;
2753 /* Using YYLLOC is tempting, but would change the location of
2754 the lookahead. YYLOC is available though. */
2755 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2758 /* Shift the error token. */
2759 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2765 /*-------------------------------------.
2766 | yyacceptlab -- YYACCEPT comes here. |
2767 `-------------------------------------*/
2772 /*-----------------------------------.
2773 | yyabortlab -- YYABORT comes here. |
2774 `-----------------------------------*/
2780 /*-------------------------------------------------.
2781 | yyexhaustedlab -- memory exhaustion comes here. |
2782 `-------------------------------------------------*/
2784 yyerror (YY_("memory exhausted"));
2790 if (yychar
!= YYEMPTY
)
2791 yydestruct ("Cleanup: discarding lookahead",
2792 yytoken
, &yylval
, &yylloc
);
2793 /* Do not reclaim the symbols of the rule which action triggered
2794 this YYABORT or YYACCEPT. */
2796 YY_STACK_PRINT (yyss
, yyssp
);
2797 while (yyssp
!= yyss
)
2799 yydestruct ("Cleanup: popping",
2800 yystos
[*yyssp
], yyvsp
, yylsp
);
2805 YYSTACK_FREE (yyss
);
2808 if (yymsg
!= yymsgbuf
)
2809 YYSTACK_FREE (yymsg
);
2811 /* Make sure YYID is used. */
2812 return YYID (yyresult
);
2817 /* Line 1535 of yacc.c */
2818 #line 620 "parse-gram.y"
2822 /* Return the location of the left-hand side of a rule whose
2823 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2824 the right-hand side, and return an empty location equal to the end
2825 boundary of RHS[0] if the right-hand side is empty. */
2828 lloc_default (YYLTYPE
const *rhs
, int n
)
2833 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2834 The bug is fixed in 7.4.2m, but play it safe for now. */
2835 loc
.start
= rhs
[n
].end
;
2836 loc
.end
= rhs
[n
].end
;
2838 /* Ignore empty nonterminals the start of the the right-hand side.
2839 Do not bother to ignore them at the end of the right-hand side,
2840 since empty nonterminals have the same end as their predecessors. */
2841 for (i
= 1; i
<= n
; i
++)
2842 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2844 loc
.start
= rhs
[i
].start
;
2852 /* Add a lex-param or a parse-param (depending on TYPE) with
2853 declaration DECL and location LOC. */
2856 add_param (char const *type
, char *decl
, location loc
)
2858 static char const alphanum
[26 + 26 + 1 + 10] =
2859 "abcdefghijklmnopqrstuvwxyz"
2860 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2863 char const *name_start
= NULL
;
2866 /* Stop on last actual character. */
2867 for (p
= decl
; p
[1]; p
++)
2869 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2870 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2873 /* Strip the surrounding '{' and '}', and any blanks just inside
2875 while (*--p
== ' ' || *p
== '\t')
2878 while (*++decl
== ' ' || *decl
== '\t')
2882 complain_at (loc
, _("missing identifier in parameter declaration"));
2889 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2893 name
= xmalloc (name_len
+ 1);
2894 memcpy (name
, name_start
, name_len
);
2895 name
[name_len
] = '\0';
2896 muscle_pair_list_grow (type
, decl
, name
);
2900 gram_scanner_last_string_free ();
2905 version_check (location
const *loc
, char const *version
)
2907 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2909 complain_at (*loc
, "require bison %s, but have %s",
2910 version
, PACKAGE_VERSION
);
2916 gram_error (location
const *loc
, char const *msg
)
2918 complain_at (*loc
, "%s", msg
);
2922 token_name (int type
)
2924 return yytname
[YYTRANSLATE (type
)];
2935 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2936 return quotearg_style (escape_quoting_style
, buf
);