1 /* A Bison parser, made by GNU Bison 2.3a+. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3a+"
53 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 1
64 /* Substitute the variable and function names. */
65 #define yyparse gram_parse
66 #define yylex gram_lex
67 #define yyerror gram_error
68 #define yylval gram_lval
69 #define yychar gram_char
70 #define yydebug gram_debug
71 #define yynerrs gram_nerrs
72 #define yylloc gram_lloc
74 /* Copy the first part of user declarations. */
76 /* Line 164 of yacc.c */
77 #line 1 "parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
80 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
82 This file is part of Bison, the GNU Compiler Compiler.
84 This program is free software; you can redistribute it and/or modify
85 it under the terms of the GNU General Public License as published by
86 the Free Software Foundation; either version 2 of the License, or
87 (at your option) any later version.
89 This program is distributed in the hope that it will be useful,
90 but WITHOUT ANY WARRANTY; without even the implied warranty of
91 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92 GNU General Public License for more details.
94 You should have received a copy of the GNU General Public License
95 along with this program; if not, write to the Free Software
96 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
103 #include <strverscmp.h>
105 #include "complain.h"
106 #include "conflicts.h"
110 #include "muscle_tab.h"
111 #include "quotearg.h"
114 #include "scan-gram.h"
115 #include "scan-code.h"
117 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
118 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
120 #define YY_LOCATION_PRINT(File, Loc) \
121 location_print (File, Loc)
123 static void version_check (location
const *loc
, char const *version
);
125 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
126 FIXME: depends on the undocumented availability of YYLLOC. */
128 #define yyerror(Msg) \
129 gram_error (&yylloc, Msg)
130 static void gram_error (location
const *, char const *);
132 static char const *char_name (char);
134 /** Add a lex-param or a parse-param.
136 * \param type \a lex_param or \a parse_param
137 * \param decl the formal argument
138 * \param loc the location in the source.
140 static void add_param (char const *type
, char *decl
, location loc
);
143 static symbol_class current_class
= unknown_sym
;
144 static uniqstr current_type
= NULL
;
145 static symbol
*current_lhs
;
146 static location current_lhs_location
;
147 static int current_prec
= 0;
149 #define YYTYPE_INT16 int_fast16_t
150 #define YYTYPE_INT8 int_fast8_t
151 #define YYTYPE_UINT16 uint_fast16_t
152 #define YYTYPE_UINT8 uint_fast8_t
155 /* Line 164 of yacc.c */
156 #line 157 "parse-gram.c"
158 /* Enabling traces. */
163 /* Enabling verbose error messages. */
164 #ifdef YYERROR_VERBOSE
165 # undef YYERROR_VERBOSE
166 # define YYERROR_VERBOSE 1
168 # define YYERROR_VERBOSE 1
171 /* Enabling the token table. */
172 #ifndef YYTOKEN_TABLE
173 # define YYTOKEN_TABLE 0
180 /* Put the tokens into the symbol table, so that GDB and other debuggers
189 PERCENT_DESTRUCTOR
= 263,
190 PERCENT_PRINTER
= 264,
191 PERCENT_SYMBOL_DEFAULT
= 265,
194 PERCENT_NONASSOC
= 268,
199 PERCENT_CODE_TOP
= 273,
201 PERCENT_DEFAULT_PREC
= 275,
202 PERCENT_DEFINE
= 276,
203 PERCENT_DEFINES
= 277,
204 PERCENT_ERROR_VERBOSE
= 278,
205 PERCENT_EXPECT
= 279,
206 PERCENT_EXPECT_RR
= 280,
207 PERCENT_FILE_PREFIX
= 281,
208 PERCENT_GLR_PARSER
= 282,
209 PERCENT_INITIAL_ACTION
= 283,
210 PERCENT_LEX_PARAM
= 284,
211 PERCENT_LOCATIONS
= 285,
212 PERCENT_NAME_PREFIX
= 286,
213 PERCENT_NO_DEFAULT_PREC
= 287,
214 PERCENT_NO_LINES
= 288,
215 PERCENT_NONDETERMINISTIC_PARSER
= 289,
216 PERCENT_OUTPUT
= 290,
217 PERCENT_PARSE_PARAM
= 291,
218 PERCENT_PROVIDES
= 292,
219 PERCENT_PURE_PARSER
= 293,
220 PERCENT_PUSH_PARSER
= 294,
221 PERCENT_REQUIRE
= 295,
222 PERCENT_REQUIRES
= 296,
223 PERCENT_SKELETON
= 297,
225 PERCENT_TOKEN_TABLE
= 299,
226 PERCENT_VERBOSE
= 300,
234 PERCENT_PERCENT
= 308,
246 #define PERCENT_TOKEN 260
247 #define PERCENT_NTERM 261
248 #define PERCENT_TYPE 262
249 #define PERCENT_DESTRUCTOR 263
250 #define PERCENT_PRINTER 264
251 #define PERCENT_SYMBOL_DEFAULT 265
252 #define PERCENT_LEFT 266
253 #define PERCENT_RIGHT 267
254 #define PERCENT_NONASSOC 268
255 #define PERCENT_PREC 269
256 #define PERCENT_DPREC 270
257 #define PERCENT_MERGE 271
258 #define PERCENT_CODE 272
259 #define PERCENT_CODE_TOP 273
260 #define PERCENT_DEBUG 274
261 #define PERCENT_DEFAULT_PREC 275
262 #define PERCENT_DEFINE 276
263 #define PERCENT_DEFINES 277
264 #define PERCENT_ERROR_VERBOSE 278
265 #define PERCENT_EXPECT 279
266 #define PERCENT_EXPECT_RR 280
267 #define PERCENT_FILE_PREFIX 281
268 #define PERCENT_GLR_PARSER 282
269 #define PERCENT_INITIAL_ACTION 283
270 #define PERCENT_LEX_PARAM 284
271 #define PERCENT_LOCATIONS 285
272 #define PERCENT_NAME_PREFIX 286
273 #define PERCENT_NO_DEFAULT_PREC 287
274 #define PERCENT_NO_LINES 288
275 #define PERCENT_NONDETERMINISTIC_PARSER 289
276 #define PERCENT_OUTPUT 290
277 #define PERCENT_PARSE_PARAM 291
278 #define PERCENT_PROVIDES 292
279 #define PERCENT_PURE_PARSER 293
280 #define PERCENT_PUSH_PARSER 294
281 #define PERCENT_REQUIRE 295
282 #define PERCENT_REQUIRES 296
283 #define PERCENT_SKELETON 297
284 #define PERCENT_START 298
285 #define PERCENT_TOKEN_TABLE 299
286 #define PERCENT_VERBOSE 300
287 #define PERCENT_YACC 301
288 #define BRACED_CODE 302
294 #define PERCENT_PERCENT 308
297 #define SEMICOLON 311
299 #define PERCENT_UNION 313
304 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
305 typedef union YYSTYPE
307 /* Line 198 of yacc.c */
308 #line 98 "parse-gram.y"
316 unsigned char character
;
319 /* Line 198 of yacc.c */
320 #line 321 "parse-gram.c"
322 # define YYSTYPE_IS_TRIVIAL 1
323 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
324 # define YYSTYPE_IS_DECLARED 1
327 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
328 typedef struct YYLTYPE
335 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
336 # define YYLTYPE_IS_DECLARED 1
337 # define YYLTYPE_IS_TRIVIAL 1
341 /* Copy the second part of user declarations. */
344 /* Line 221 of yacc.c */
345 #line 346 "parse-gram.c"
352 typedef YYTYPE_UINT8 yytype_uint8
;
354 typedef unsigned char yytype_uint8
;
358 typedef YYTYPE_INT8 yytype_int8
;
359 #elif (defined __STDC__ || defined __C99__FUNC__ \
360 || defined __cplusplus || defined _MSC_VER)
361 typedef signed char yytype_int8
;
363 typedef short int yytype_int8
;
367 typedef YYTYPE_UINT16 yytype_uint16
;
369 typedef unsigned short int yytype_uint16
;
373 typedef YYTYPE_INT16 yytype_int16
;
375 typedef short int yytype_int16
;
379 # ifdef __SIZE_TYPE__
380 # define YYSIZE_T __SIZE_TYPE__
381 # elif defined size_t
382 # define YYSIZE_T size_t
383 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
384 || defined __cplusplus || defined _MSC_VER)
385 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
386 # define YYSIZE_T size_t
388 # define YYSIZE_T unsigned int
392 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
397 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
398 # define YY_(msgid) dgettext ("bison-runtime", msgid)
402 # define YY_(msgid) msgid
406 /* Suppress unused-variable warnings by "using" E. */
407 #if ! defined lint || defined __GNUC__
408 # define YYUSE(e) ((void) (e))
410 # define YYUSE(e) /* empty */
413 /* Identity function, used to suppress warnings about constant conditions. */
417 #if (defined __STDC__ || defined __C99__FUNC__ \
418 || defined __cplusplus || defined _MSC_VER)
431 #if ! defined yyoverflow || YYERROR_VERBOSE
433 /* The parser invokes alloca or malloc; define the necessary symbols. */
435 # ifdef YYSTACK_USE_ALLOCA
436 # if YYSTACK_USE_ALLOCA
438 # define YYSTACK_ALLOC __builtin_alloca
439 # elif defined __BUILTIN_VA_ARG_INCR
440 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
442 # define YYSTACK_ALLOC __alloca
443 # elif defined _MSC_VER
444 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
445 # define alloca _alloca
447 # define YYSTACK_ALLOC alloca
448 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
449 || defined __cplusplus || defined _MSC_VER)
450 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
459 # ifdef YYSTACK_ALLOC
460 /* Pacify GCC's `empty if-body' warning. */
461 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
462 # ifndef YYSTACK_ALLOC_MAXIMUM
463 /* The OS might guarantee only one guard page at the bottom of the stack,
464 and a page size can be as small as 4096 bytes. So we cannot safely
465 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
466 to allow for a few compiler-allocated temporary stack slots. */
467 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
470 # define YYSTACK_ALLOC YYMALLOC
471 # define YYSTACK_FREE YYFREE
472 # ifndef YYSTACK_ALLOC_MAXIMUM
473 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
475 # if (defined __cplusplus && ! defined _STDLIB_H \
476 && ! ((defined YYMALLOC || defined malloc) \
477 && (defined YYFREE || defined free)))
478 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
484 # define YYMALLOC malloc
485 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
486 || defined __cplusplus || defined _MSC_VER)
487 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
492 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
493 || defined __cplusplus || defined _MSC_VER)
494 void free (void *); /* INFRINGES ON USER NAME SPACE */
498 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
501 #if (! defined yyoverflow \
502 && (! defined __cplusplus \
503 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
504 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
506 /* A type that is properly aligned for any stack member. */
514 /* The size of the maximum gap between one aligned stack and the next. */
515 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
517 /* The size of an array large to enough to hold all stacks, each with
519 # define YYSTACK_BYTES(N) \
520 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
521 + 2 * YYSTACK_GAP_MAXIMUM)
523 /* Copy COUNT objects from FROM to TO. The source and destination do
526 # if defined __GNUC__ && 1 < __GNUC__
527 # define YYCOPY(To, From, Count) \
528 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
530 # define YYCOPY(To, From, Count) \
534 for (yyi = 0; yyi < (Count); yyi++) \
535 (To)[yyi] = (From)[yyi]; \
541 /* Relocate STACK from its old location to the new one. The
542 local variables YYSIZE and YYSTACKSIZE give the old and new number of
543 elements in the stack, and YYPTR gives the new location of the
544 stack. Advance YYPTR to a properly aligned location for the next
546 # define YYSTACK_RELOCATE(Stack) \
549 YYSIZE_T yynewbytes; \
550 YYCOPY (&yyptr->Stack, Stack, yysize); \
551 Stack = &yyptr->Stack; \
552 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
553 yyptr += yynewbytes / sizeof (*yyptr); \
559 /* YYFINAL -- State number of the termination state. */
561 /* YYLAST -- Last index in YYTABLE. */
564 /* YYNTOKENS -- Number of terminals. */
566 /* YYNNTS -- Number of nonterminals. */
568 /* YYNRULES -- Number of rules. */
570 /* YYNRULES -- Number of states. */
571 #define YYNSTATES 137
573 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
575 #define YYMAXUTOK 313
577 #define YYTRANSLATE(YYX) \
578 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
580 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
581 static const yytype_uint8 yytranslate
[] =
583 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
609 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
610 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
611 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
612 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
613 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
618 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
620 static const yytype_uint8 yyprhs
[] =
622 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
623 24, 26, 29, 32, 36, 38, 41, 44, 46, 50,
624 52, 54, 58, 61, 63, 65, 68, 71, 73, 75,
625 77, 79, 81, 83, 86, 90, 94, 96, 98, 101,
626 104, 107, 110, 111, 113, 117, 118, 122, 123, 127,
627 131, 135, 137, 139, 141, 142, 144, 146, 149, 151,
628 154, 156, 158, 160, 162, 164, 167, 170, 174, 176,
629 179, 181, 184, 186, 189, 192, 193, 197, 199, 203,
630 206, 207, 210, 213, 217, 221, 225, 227, 229, 230,
631 232, 234, 236, 238, 240, 242, 244, 246, 247
634 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
635 static const yytype_int8 yyrhs
[] =
637 60, 0, -1, 61, 53, 76, 89, -1, -1, 61,
638 62, -1, 63, -1, 55, -1, 19, -1, 21, 3,
639 83, -1, 22, -1, 23, -1, 24, 4, -1, 25,
640 4, -1, 26, 50, 3, -1, 27, -1, 28, 47,
641 -1, 29, 47, -1, 30, -1, 31, 50, 3, -1,
642 33, -1, 34, -1, 35, 50, 3, -1, 36, 47,
643 -1, 38, -1, 39, -1, 40, 3, -1, 42, 3,
644 -1, 44, -1, 45, -1, 46, -1, 56, -1, 68,
645 -1, 65, -1, 43, 87, -1, 8, 47, 72, -1,
646 9, 47, 72, -1, 20, -1, 32, -1, 17, 84,
647 -1, 18, 84, -1, 37, 84, -1, 41, 84, -1,
648 -1, 51, -1, 58, 64, 47, -1, -1, 6, 66,
649 75, -1, -1, 5, 67, 75, -1, 7, 57, 71,
650 -1, 69, 70, 71, -1, 11, -1, 12, -1, 13,
651 -1, -1, 57, -1, 87, -1, 71, 87, -1, 73,
652 -1, 72, 73, -1, 87, -1, 57, -1, 10, -1,
653 57, -1, 85, -1, 85, 4, -1, 85, 88, -1,
654 85, 4, 88, -1, 74, -1, 75, 74, -1, 77,
655 -1, 76, 77, -1, 78, -1, 63, 56, -1, 1,
656 56, -1, -1, 86, 79, 80, -1, 81, -1, 80,
657 54, 81, -1, 80, 56, -1, -1, 81, 87, -1,
658 81, 47, -1, 81, 14, 87, -1, 81, 15, 4,
659 -1, 81, 16, 57, -1, 3, -1, 84, -1, -1,
660 82, -1, 47, -1, 51, -1, 48, -1, 52, -1,
661 85, -1, 88, -1, 3, -1, -1, 53, 49, -1
664 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
665 static const yytype_uint16 yyrline
[] =
667 0, 209, 209, 217, 219, 223, 224, 225, 226, 227,
668 228, 229, 230, 231, 232, 237, 241, 242, 243, 244,
669 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
670 255, 259, 260, 261, 265, 273, 281, 285, 289, 290,
671 291, 292, 303, 304, 308, 336, 336, 341, 341, 346,
672 357, 372, 373, 374, 378, 379, 384, 386, 391, 392,
673 396, 397, 398, 403, 408, 413, 419, 425, 436, 437,
674 446, 447, 453, 454, 455, 462, 462, 466, 467, 468,
675 473, 474, 476, 478, 480, 482, 492, 493, 499, 503,
676 508, 524, 526, 535, 540, 541, 546, 553, 555
680 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
681 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
682 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
683 static const char *const yytname
[] =
685 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
686 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
687 "\"%printer\"", "\"%symbol-default\"", "\"%left\"", "\"%right\"",
688 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
689 "\"%code-top\"", "\"%debug\"", "\"%default-prec\"", "\"%define\"",
690 "\"%defines\"", "\"%error-verbose\"", "\"%expect\"", "\"%expect-rr\"",
691 "\"%file-prefix\"", "\"%glr-parser\"", "\"%initial-action\"",
692 "\"%lex-param\"", "\"%locations\"", "\"%name-prefix\"",
693 "\"%no-default-prec\"", "\"%no-lines\"", "\"%nondeterministic-parser\"",
694 "\"%output\"", "\"%parse-param\"", "\"%provides\"", "\"%pure-parser\"",
695 "\"%push-parser\"", "\"%require\"", "\"%requires\"", "\"%skeleton\"",
696 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
697 "\"{...}\"", "\"char\"", "\"epilogue\"", "\"=\"", "\"identifier\"",
698 "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"",
699 "\"%union\"", "$accept", "input", "prologue_declarations",
700 "prologue_declaration", "grammar_declaration", "union_name",
701 "symbol_declaration", "@1", "@2", "precedence_declaration",
702 "precedence_declarator", "type.opt", "symbols.1", "generic_symlist",
703 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
704 "rules_or_grammar_declaration", "rules", "@3", "rhses.1", "rhs",
705 "content", "content.opt", "braceless", "id", "id_colon", "symbol",
706 "string_as_id", "epilogue.opt", 0
711 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
713 static const yytype_uint16 yytoknum
[] =
715 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
716 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
717 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
718 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
719 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
720 305, 306, 307, 308, 309, 310, 311, 312, 313
724 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
725 static const yytype_uint8 yyr1
[] =
727 0, 59, 60, 61, 61, 62, 62, 62, 62, 62,
728 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
729 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
730 62, 63, 63, 63, 63, 63, 63, 63, 63, 63,
731 63, 63, 64, 64, 63, 66, 65, 67, 65, 65,
732 68, 69, 69, 69, 70, 70, 71, 71, 72, 72,
733 73, 73, 73, 74, 74, 74, 74, 74, 75, 75,
734 76, 76, 77, 77, 77, 79, 78, 80, 80, 80,
735 81, 81, 81, 81, 81, 81, 82, 82, 83, 83,
736 84, 85, 85, 86, 87, 87, 88, 89, 89
739 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
740 static const yytype_uint8 yyr2
[] =
742 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
743 1, 2, 2, 3, 1, 2, 2, 1, 3, 1,
744 1, 3, 2, 1, 1, 2, 2, 1, 1, 1,
745 1, 1, 1, 2, 3, 3, 1, 1, 2, 2,
746 2, 2, 0, 1, 3, 0, 3, 0, 3, 3,
747 3, 1, 1, 1, 0, 1, 1, 2, 1, 2,
748 1, 1, 1, 1, 1, 2, 2, 3, 1, 2,
749 1, 2, 1, 2, 2, 0, 3, 1, 3, 2,
750 0, 2, 2, 3, 3, 3, 1, 1, 0, 1,
751 1, 1, 1, 1, 1, 1, 1, 0, 2
754 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
755 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
756 means the default is an error. */
757 static const yytype_uint8 yydefact
[] =
759 3, 0, 0, 1, 47, 45, 0, 0, 0, 51,
760 52, 53, 0, 0, 7, 36, 0, 9, 10, 0,
761 0, 0, 14, 0, 0, 17, 0, 37, 19, 20,
762 0, 0, 0, 23, 24, 0, 0, 0, 0, 27,
763 28, 29, 0, 6, 30, 42, 4, 5, 32, 31,
764 54, 0, 0, 0, 0, 0, 90, 38, 39, 88,
765 11, 12, 0, 15, 16, 0, 0, 22, 40, 25,
766 41, 26, 96, 92, 91, 94, 33, 95, 0, 93,
767 0, 0, 70, 72, 75, 43, 0, 55, 0, 63,
768 68, 48, 64, 46, 49, 56, 62, 61, 34, 58,
769 60, 35, 86, 89, 8, 87, 13, 18, 21, 74,
770 73, 0, 71, 2, 80, 44, 50, 69, 65, 66,
771 57, 59, 98, 76, 77, 67, 80, 79, 0, 0,
772 0, 82, 81, 78, 83, 84, 85
775 /* YYDEFGOTO[NTERM-NUM]. */
776 static const yytype_int8 yydefgoto
[] =
778 -1, 1, 2, 46, 80, 86, 48, 52, 51, 49,
779 50, 88, 94, 98, 99, 90, 91, 81, 82, 83,
780 114, 123, 124, 103, 104, 57, 75, 84, 100, 77,
784 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
786 #define YYPACT_NINF -82
787 static const yytype_int16 yypact
[] =
789 -82, 4, 91, -82, -82, -82, -52, -31, -24, -82,
790 -82, -82, -8, -8, -82, -82, 49, -82, -82, 53,
791 54, 12, -82, 16, 26, -82, 30, -82, -82, -82,
792 32, 36, -8, -82, -82, 81, -8, 82, 0, -82,
793 -82, -82, 23, -82, -82, 37, -82, -82, -82, -82,
794 34, 19, 19, 0, 17, 17, -82, -82, -82, 14,
795 -82, -82, 84, -82, -82, 86, 90, -82, -82, -82,
796 -82, -82, -82, -82, -82, -82, -82, -82, 38, -82,
797 45, 1, -82, -82, -82, -82, 58, -82, 0, -82,
798 -82, 19, 43, 19, 0, -82, -82, -82, 17, -82,
799 -82, 17, -82, -82, -82, -82, -82, -82, -82, -82,
800 -82, 57, -82, -82, -82, -82, 0, -82, 104, -82,
801 -82, -82, -82, 15, 136, -82, -82, -82, 0, 88,
802 85, -82, -82, 136, -82, -82, -82
805 /* YYPGOTO[NTERM-NUM]. */
806 static const yytype_int16 yypgoto
[] =
808 -82, -82, -82, -82, 141, -82, -82, -82, -82, -82,
809 -82, -82, 50, 93, -76, -14, 101, -82, 64, -82,
810 -82, -82, 28, -82, -82, 13, 89, -82, -38, -81,
814 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
815 positive, shift that token. If negative, reduce the rule which
816 number is the opposite. If zero, do what YYDEFACT says.
817 If YYTABLE_NINF, syntax error. */
818 #define YYTABLE_NINF -98
819 static const yytype_int16 yytable
[] =
821 76, -97, 78, 72, 3, 53, 4, 5, 6, 7,
822 8, 119, 9, 10, 11, 95, 54, 102, 12, 13,
823 72, 15, 121, 55, 78, 121, 58, 96, 4, 5,
824 6, 7, 8, 27, 9, 10, 11, 125, 32, 56,
825 12, 13, 36, 15, 38, 68, 72, 118, 73, 70,
826 95, 74, 59, 79, 111, 27, 120, 60, 61, 45,
827 32, 56, 62, 63, 36, 73, 38, 73, 74, 126,
828 74, 127, 105, 64, 97, 79, 89, 117, 120, 117,
829 65, 45, 66, 67, 69, 71, 132, 106, 85, 107,
830 134, 87, 135, 108, 109, 132, 4, 5, 6, 7,
831 8, 110, 9, 10, 11, 115, 122, 72, 12, 13,
832 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
833 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
834 34, 35, 36, 37, 38, 39, 40, 41, 116, 72,
835 92, 92, 136, 47, 42, 112, 43, 44, 101, 45,
836 128, 129, 130, 93, 133, 0, 0, 0, 0, 0,
837 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
838 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
839 92, 0, 92, 131, 73, 0, 0, 74
842 static const yytype_int16 yycheck
[] =
844 38, 0, 1, 3, 0, 57, 5, 6, 7, 8,
845 9, 92, 11, 12, 13, 53, 47, 3, 17, 18,
846 3, 20, 98, 47, 1, 101, 13, 10, 5, 6,
847 7, 8, 9, 32, 11, 12, 13, 118, 37, 47,
848 17, 18, 41, 20, 43, 32, 3, 4, 48, 36,
849 88, 51, 3, 52, 53, 32, 94, 4, 4, 58,
850 37, 47, 50, 47, 41, 48, 43, 48, 51, 54,
851 51, 56, 59, 47, 57, 52, 57, 91, 116, 93,
852 50, 58, 50, 47, 3, 3, 124, 3, 51, 3,
853 128, 57, 4, 3, 56, 133, 5, 6, 7, 8,
854 9, 56, 11, 12, 13, 47, 49, 3, 17, 18,
855 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
856 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
857 39, 40, 41, 42, 43, 44, 45, 46, 88, 3,
858 51, 52, 57, 2, 53, 81, 55, 56, 55, 58,
859 14, 15, 16, 52, 126, -1, -1, -1, -1, -1,
860 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
861 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
862 91, -1, 93, 47, 48, -1, -1, 51
865 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
866 symbol of state STATE-NUM. */
867 static const yytype_uint8 yystos
[] =
869 0, 60, 61, 0, 5, 6, 7, 8, 9, 11,
870 12, 13, 17, 18, 19, 20, 21, 22, 23, 24,
871 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
872 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
873 45, 46, 53, 55, 56, 58, 62, 63, 65, 68,
874 69, 67, 66, 57, 47, 47, 47, 84, 84, 3,
875 4, 4, 50, 47, 47, 50, 50, 47, 84, 3,
876 84, 3, 3, 48, 51, 85, 87, 88, 1, 52,
877 63, 76, 77, 78, 86, 51, 64, 57, 70, 57,
878 74, 75, 85, 75, 71, 87, 10, 57, 72, 73,
879 87, 72, 3, 82, 83, 84, 3, 3, 3, 56,
880 56, 53, 77, 89, 79, 47, 71, 74, 4, 88,
881 87, 73, 49, 80, 81, 88, 54, 56, 14, 15,
882 16, 47, 87, 81, 87, 4, 57
885 #define yyerrok (yyerrstatus = 0)
886 #define yyclearin (yychar = YYEMPTY)
890 #define YYACCEPT goto yyacceptlab
891 #define YYABORT goto yyabortlab
892 #define YYERROR goto yyerrorlab
895 /* Like YYERROR except do call yyerror. This remains here temporarily
896 to ease the transition to the new meaning of YYERROR, for GCC.
897 Once GCC version 2 has supplanted version 1, this can go. */
899 #define YYFAIL goto yyerrlab
901 #define YYRECOVERING() (!!yyerrstatus)
903 #define YYBACKUP(Token, Value) \
905 if (yychar == YYEMPTY && yylen == 1) \
909 yytoken = YYTRANSLATE (yychar); \
915 yyerror (YY_("syntax error: cannot back up")); \
922 #define YYERRCODE 256
925 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
926 If N is 0, then set CURRENT to the empty location which ends
927 the previous symbol: RHS[0] (always defined). */
929 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
930 #ifndef YYLLOC_DEFAULT
931 # define YYLLOC_DEFAULT(Current, Rhs, N) \
935 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
936 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
937 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
938 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
942 (Current).first_line = (Current).last_line = \
943 YYRHSLOC (Rhs, 0).last_line; \
944 (Current).first_column = (Current).last_column = \
945 YYRHSLOC (Rhs, 0).last_column; \
951 /* YY_LOCATION_PRINT -- Print the location on the stream.
952 This macro was not mandated originally: define only if we know
953 we won't break user code: when these are the locations we know. */
955 #ifndef YY_LOCATION_PRINT
956 # if YYLTYPE_IS_TRIVIAL
957 # define YY_LOCATION_PRINT(File, Loc) \
958 fprintf (File, "%d.%d-%d.%d", \
959 (Loc).first_line, (Loc).first_column, \
960 (Loc).last_line, (Loc).last_column)
962 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
967 /* YYLEX -- calling `yylex' with the right arguments. */
970 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
972 # define YYLEX yylex (&yylval, &yylloc)
975 /* Enable debugging if requested. */
979 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
980 # define YYFPRINTF fprintf
983 # define YYDPRINTF(Args) \
989 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
993 YYFPRINTF (stderr, "%s ", Title); \
994 yy_symbol_print (stderr, \
995 Type, Value, Location); \
996 YYFPRINTF (stderr, "\n"); \
1001 /*--------------------------------.
1002 | Print this symbol on YYOUTPUT. |
1003 `--------------------------------*/
1006 #if (defined __STDC__ || defined __C99__FUNC__ \
1007 || defined __cplusplus || defined _MSC_VER)
1009 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1012 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1015 YYSTYPE
const * const yyvaluep
;
1016 YYLTYPE
const * const yylocationp
;
1021 YYUSE (yylocationp
);
1023 if (yytype
< YYNTOKENS
)
1024 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1030 case 3: /* "\"string\"" */
1032 /* Line 670 of yacc.c */
1033 #line 187 "parse-gram.y"
1034 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1036 /* Line 670 of yacc.c */
1037 #line 1038 "parse-gram.c"
1039 case 4: /* "\"integer\"" */
1041 /* Line 670 of yacc.c */
1042 #line 198 "parse-gram.y"
1043 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1045 /* Line 670 of yacc.c */
1046 #line 1047 "parse-gram.c"
1048 case 47: /* "\"{...}\"" */
1050 /* Line 670 of yacc.c */
1051 #line 189 "parse-gram.y"
1052 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1054 /* Line 670 of yacc.c */
1055 #line 1056 "parse-gram.c"
1057 case 48: /* "\"char\"" */
1059 /* Line 670 of yacc.c */
1060 #line 182 "parse-gram.y"
1061 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1063 /* Line 670 of yacc.c */
1064 #line 1065 "parse-gram.c"
1066 case 49: /* "\"epilogue\"" */
1068 /* Line 670 of yacc.c */
1069 #line 189 "parse-gram.y"
1070 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1072 /* Line 670 of yacc.c */
1073 #line 1074 "parse-gram.c"
1075 case 51: /* "\"identifier\"" */
1077 /* Line 670 of yacc.c */
1078 #line 194 "parse-gram.y"
1079 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1081 /* Line 670 of yacc.c */
1082 #line 1083 "parse-gram.c"
1084 case 52: /* "\"identifier:\"" */
1086 /* Line 670 of yacc.c */
1087 #line 195 "parse-gram.y"
1088 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1090 /* Line 670 of yacc.c */
1091 #line 1092 "parse-gram.c"
1093 case 55: /* "\"%{...%}\"" */
1095 /* Line 670 of yacc.c */
1096 #line 189 "parse-gram.y"
1097 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1099 /* Line 670 of yacc.c */
1100 #line 1101 "parse-gram.c"
1102 case 57: /* "\"type\"" */
1104 /* Line 670 of yacc.c */
1105 #line 193 "parse-gram.y"
1106 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1108 /* Line 670 of yacc.c */
1109 #line 1110 "parse-gram.c"
1111 case 82: /* "content" */
1113 /* Line 670 of yacc.c */
1114 #line 189 "parse-gram.y"
1115 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1117 /* Line 670 of yacc.c */
1118 #line 1119 "parse-gram.c"
1120 case 83: /* "content.opt" */
1122 /* Line 670 of yacc.c */
1123 #line 189 "parse-gram.y"
1124 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1126 /* Line 670 of yacc.c */
1127 #line 1128 "parse-gram.c"
1129 case 84: /* "braceless" */
1131 /* Line 670 of yacc.c */
1132 #line 189 "parse-gram.y"
1133 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1135 /* Line 670 of yacc.c */
1136 #line 1137 "parse-gram.c"
1140 /* Line 670 of yacc.c */
1141 #line 201 "parse-gram.y"
1142 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1144 /* Line 670 of yacc.c */
1145 #line 1146 "parse-gram.c"
1147 case 86: /* "id_colon" */
1149 /* Line 670 of yacc.c */
1150 #line 202 "parse-gram.y"
1151 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1153 /* Line 670 of yacc.c */
1154 #line 1155 "parse-gram.c"
1156 case 87: /* "symbol" */
1158 /* Line 670 of yacc.c */
1159 #line 201 "parse-gram.y"
1160 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1162 /* Line 670 of yacc.c */
1163 #line 1164 "parse-gram.c"
1165 case 88: /* "string_as_id" */
1167 /* Line 670 of yacc.c */
1168 #line 201 "parse-gram.y"
1169 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1171 /* Line 670 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 1082 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 1082 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 1269 of yacc.c */
1882 #line 224 "parse-gram.y"
1883 { prologue_augment (translate_code ((yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)])), (yylsp
[(1) - (1)]), union_seen
); }
1888 /* Line 1269 of yacc.c */
1889 #line 225 "parse-gram.y"
1890 { debug_flag
= true; }
1895 /* Line 1269 of yacc.c */
1896 #line 226 "parse-gram.y"
1897 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1902 /* Line 1269 of yacc.c */
1903 #line 227 "parse-gram.y"
1904 { defines_flag
= true; }
1909 /* Line 1269 of yacc.c */
1910 #line 228 "parse-gram.y"
1911 { error_verbose
= true; }
1916 /* Line 1269 of yacc.c */
1917 #line 229 "parse-gram.y"
1918 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1923 /* Line 1269 of yacc.c */
1924 #line 230 "parse-gram.y"
1925 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1930 /* Line 1269 of yacc.c */
1931 #line 231 "parse-gram.y"
1932 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1937 /* Line 1269 of yacc.c */
1938 #line 233 "parse-gram.y"
1940 nondeterministic_parser
= true;
1947 /* Line 1269 of yacc.c */
1948 #line 238 "parse-gram.y"
1950 muscle_code_grow ("initial_action", translate_symbol_action ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1956 /* Line 1269 of yacc.c */
1957 #line 241 "parse-gram.y"
1958 { add_param ("lex_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1963 /* Line 1269 of yacc.c */
1964 #line 242 "parse-gram.y"
1965 { locations_flag
= true; }
1970 /* Line 1269 of yacc.c */
1971 #line 243 "parse-gram.y"
1972 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
1977 /* Line 1269 of yacc.c */
1978 #line 244 "parse-gram.y"
1979 { no_lines_flag
= true; }
1984 /* Line 1269 of yacc.c */
1985 #line 245 "parse-gram.y"
1986 { nondeterministic_parser
= true; }
1991 /* Line 1269 of yacc.c */
1992 #line 246 "parse-gram.y"
1993 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
1998 /* Line 1269 of yacc.c */
1999 #line 247 "parse-gram.y"
2000 { add_param ("parse_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2005 /* Line 1269 of yacc.c */
2006 #line 248 "parse-gram.y"
2007 { pure_parser
= true; }
2012 /* Line 1269 of yacc.c */
2013 #line 249 "parse-gram.y"
2014 { push_parser
= true; }
2019 /* Line 1269 of yacc.c */
2020 #line 250 "parse-gram.y"
2021 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2026 /* Line 1269 of yacc.c */
2027 #line 251 "parse-gram.y"
2028 { skeleton
= (yyvsp
[(2) - (2)].chars
); }
2033 /* Line 1269 of yacc.c */
2034 #line 252 "parse-gram.y"
2035 { token_table_flag
= true; }
2040 /* Line 1269 of yacc.c */
2041 #line 253 "parse-gram.y"
2042 { report_flag
= report_states
; }
2047 /* Line 1269 of yacc.c */
2048 #line 254 "parse-gram.y"
2049 { yacc_flag
= true; }
2054 /* Line 1269 of yacc.c */
2055 #line 262 "parse-gram.y"
2057 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2063 /* Line 1269 of yacc.c */
2064 #line 266 "parse-gram.y"
2067 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2068 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2069 symbol_list_destructor_set (list
, action
, (yylsp
[(2) - (3)]));
2070 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2076 /* Line 1269 of yacc.c */
2077 #line 274 "parse-gram.y"
2080 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2081 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2082 symbol_list_printer_set (list
, action
, (yylsp
[(2) - (3)]));
2083 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2089 /* Line 1269 of yacc.c */
2090 #line 282 "parse-gram.y"
2092 default_prec
= true;
2098 /* Line 1269 of yacc.c */
2099 #line 286 "parse-gram.y"
2101 default_prec
= false;
2107 /* Line 1269 of yacc.c */
2108 #line 289 "parse-gram.y"
2109 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), true); }
2114 /* Line 1269 of yacc.c */
2115 #line 290 "parse-gram.y"
2116 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), false); }
2121 /* Line 1269 of yacc.c */
2122 #line 291 "parse-gram.y"
2123 { muscle_code_grow ("provides", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2128 /* Line 1269 of yacc.c */
2129 #line 292 "parse-gram.y"
2130 { muscle_code_grow ("requires", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2135 /* Line 1269 of yacc.c */
2136 #line 303 "parse-gram.y"
2142 /* Line 1269 of yacc.c */
2143 #line 304 "parse-gram.y"
2144 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2149 /* Line 1269 of yacc.c */
2150 #line 309 "parse-gram.y"
2152 char const *body
= (yyvsp
[(3) - (3)].chars
);
2154 /* Concatenate the %union bodies. If this is the first %union, make sure
2155 the synchronization line appears after the opening '{' so as not to
2156 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2157 into '\n', and omit the new %union's leading '{'. */
2160 muscle_grow ("stype", "{", "");
2164 char *code
= muscle_find ("stype");
2165 code
[strlen (code
) - 1] = '\n';
2170 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2176 /* Line 1269 of yacc.c */
2177 #line 336 "parse-gram.y"
2178 { current_class
= nterm_sym
; }
2183 /* Line 1269 of yacc.c */
2184 #line 337 "parse-gram.y"
2186 current_class
= unknown_sym
;
2187 current_type
= NULL
;
2193 /* Line 1269 of yacc.c */
2194 #line 341 "parse-gram.y"
2195 { current_class
= token_sym
; }
2200 /* Line 1269 of yacc.c */
2201 #line 342 "parse-gram.y"
2203 current_class
= unknown_sym
;
2204 current_type
= NULL
;
2210 /* Line 1269 of yacc.c */
2211 #line 347 "parse-gram.y"
2215 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2216 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2217 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2223 /* Line 1269 of yacc.c */
2224 #line 358 "parse-gram.y"
2228 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2230 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2231 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2233 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2234 current_type
= NULL
;
2240 /* Line 1269 of yacc.c */
2241 #line 372 "parse-gram.y"
2242 { (yyval
.assoc
) = left_assoc
; }
2247 /* Line 1269 of yacc.c */
2248 #line 373 "parse-gram.y"
2249 { (yyval
.assoc
) = right_assoc
; }
2254 /* Line 1269 of yacc.c */
2255 #line 374 "parse-gram.y"
2256 { (yyval
.assoc
) = non_assoc
; }
2261 /* Line 1269 of yacc.c */
2262 #line 378 "parse-gram.y"
2263 { current_type
= NULL
; }
2268 /* Line 1269 of yacc.c */
2269 #line 379 "parse-gram.y"
2270 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2275 /* Line 1269 of yacc.c */
2276 #line 385 "parse-gram.y"
2277 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2282 /* Line 1269 of yacc.c */
2283 #line 387 "parse-gram.y"
2284 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2289 /* Line 1269 of yacc.c */
2290 #line 391 "parse-gram.y"
2291 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2296 /* Line 1269 of yacc.c */
2297 #line 392 "parse-gram.y"
2298 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2303 /* Line 1269 of yacc.c */
2304 #line 396 "parse-gram.y"
2305 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2310 /* Line 1269 of yacc.c */
2311 #line 397 "parse-gram.y"
2312 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2317 /* Line 1269 of yacc.c */
2318 #line 398 "parse-gram.y"
2319 { (yyval
.list
) = symbol_list_default_new ((yylsp
[(1) - (1)])); }
2324 /* Line 1269 of yacc.c */
2325 #line 404 "parse-gram.y"
2327 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2334 /* Line 1269 of yacc.c */
2335 #line 409 "parse-gram.y"
2337 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2338 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2344 /* Line 1269 of yacc.c */
2345 #line 414 "parse-gram.y"
2347 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2348 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2349 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2355 /* Line 1269 of yacc.c */
2356 #line 420 "parse-gram.y"
2358 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2359 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2360 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2366 /* Line 1269 of yacc.c */
2367 #line 426 "parse-gram.y"
2369 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2370 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2371 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2372 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2378 /* Line 1269 of yacc.c */
2379 #line 456 "parse-gram.y"
2387 /* Line 1269 of yacc.c */
2388 #line 462 "parse-gram.y"
2389 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2394 /* Line 1269 of yacc.c */
2395 #line 466 "parse-gram.y"
2396 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2401 /* Line 1269 of yacc.c */
2402 #line 467 "parse-gram.y"
2403 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2408 /* Line 1269 of yacc.c */
2409 #line 473 "parse-gram.y"
2410 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2415 /* Line 1269 of yacc.c */
2416 #line 475 "parse-gram.y"
2417 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2422 /* Line 1269 of yacc.c */
2423 #line 477 "parse-gram.y"
2424 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2429 /* Line 1269 of yacc.c */
2430 #line 479 "parse-gram.y"
2431 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2436 /* Line 1269 of yacc.c */
2437 #line 481 "parse-gram.y"
2438 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2443 /* Line 1269 of yacc.c */
2444 #line 483 "parse-gram.y"
2445 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2450 /* Line 1269 of yacc.c */
2451 #line 499 "parse-gram.y"
2453 static char one
[] = "1";
2454 (yyval
.chars
) = one
;
2460 /* Line 1269 of yacc.c */
2461 #line 509 "parse-gram.y"
2463 (yyvsp
[(1) - (1)].chars
)[strlen ((yyvsp
[(1) - (1)].chars
)) - 1] = '\n';
2464 (yyval
.chars
) = translate_code ((yyvsp
[(1) - (1)].chars
) + 1, (yylsp
[(1) - (1)]));
2470 /* Line 1269 of yacc.c */
2471 #line 525 "parse-gram.y"
2472 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2477 /* Line 1269 of yacc.c */
2478 #line 527 "parse-gram.y"
2480 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2481 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2482 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2488 /* Line 1269 of yacc.c */
2489 #line 535 "parse-gram.y"
2490 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2495 /* Line 1269 of yacc.c */
2496 #line 547 "parse-gram.y"
2498 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2499 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2505 /* Line 1269 of yacc.c */
2506 #line 556 "parse-gram.y"
2508 muscle_code_grow ("epilogue", translate_code ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
2509 gram_scanner_last_string_free ();
2515 /* Line 1269 of yacc.c */
2516 #line 2517 "parse-gram.c"
2519 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2523 YY_STACK_PRINT (yyss
, yyssp
);
2528 /* Now `shift' the result of the reduction. Determine what state
2529 that goes to, based on the state we popped back to and the rule
2530 number reduced by. */
2534 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2535 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2536 yystate
= yytable
[yystate
];
2538 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2543 /*------------------------------------.
2544 | yyerrlab -- here on detecting error |
2545 `------------------------------------*/
2547 /* If not already recovering from an error, report this error. */
2551 #if ! YYERROR_VERBOSE
2552 yyerror (YY_("syntax error"));
2555 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2556 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2558 YYSIZE_T yyalloc
= 2 * yysize
;
2559 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2560 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2561 if (yymsg
!= yymsgbuf
)
2562 YYSTACK_FREE (yymsg
);
2563 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2565 yymsg_alloc
= yyalloc
;
2569 yymsg_alloc
= sizeof yymsgbuf
;
2573 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2575 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2580 yyerror (YY_("syntax error"));
2582 goto yyexhaustedlab
;
2588 yyerror_range
[0] = yylloc
;
2590 if (yyerrstatus
== 3)
2592 /* If just tried and failed to reuse lookahead token after an
2593 error, discard it. */
2595 if (yychar
<= YYEOF
)
2597 /* Return failure if at end of input. */
2598 if (yychar
== YYEOF
)
2603 yydestruct ("Error: discarding",
2604 yytoken
, &yylval
, &yylloc
);
2609 /* Else will try to reuse lookahead token after shifting the error
2614 /*---------------------------------------------------.
2615 | yyerrorlab -- error raised explicitly by YYERROR. |
2616 `---------------------------------------------------*/
2619 /* Pacify compilers like GCC when the user code never invokes
2620 YYERROR and the label yyerrorlab therefore never appears in user
2622 if (/*CONSTCOND*/ 0)
2625 yyerror_range
[0] = yylsp
[1-yylen
];
2626 /* Do not reclaim the symbols of the rule which action triggered
2630 YY_STACK_PRINT (yyss
, yyssp
);
2635 /*-------------------------------------------------------------.
2636 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2637 `-------------------------------------------------------------*/
2639 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2643 yyn
= yypact
[yystate
];
2644 if (yyn
!= YYPACT_NINF
)
2647 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2655 /* Pop the current state because it cannot handle the error token. */
2659 yyerror_range
[0] = *yylsp
;
2660 yydestruct ("Error: popping",
2661 yystos
[yystate
], yyvsp
, yylsp
);
2664 YY_STACK_PRINT (yyss
, yyssp
);
2669 yyerror_range
[1] = yylloc
;
2670 /* Using YYLLOC is tempting, but would change the location of
2671 the lookahead. YYLOC is available though. */
2672 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2675 /* Shift the error token. */
2676 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2682 /*-------------------------------------.
2683 | yyacceptlab -- YYACCEPT comes here. |
2684 `-------------------------------------*/
2689 /*-----------------------------------.
2690 | yyabortlab -- YYABORT comes here. |
2691 `-----------------------------------*/
2697 /*-------------------------------------------------.
2698 | yyexhaustedlab -- memory exhaustion comes here. |
2699 `-------------------------------------------------*/
2701 yyerror (YY_("memory exhausted"));
2707 if (yychar
!= YYEMPTY
)
2708 yydestruct ("Cleanup: discarding lookahead",
2709 yytoken
, &yylval
, &yylloc
);
2710 /* Do not reclaim the symbols of the rule which action triggered
2711 this YYABORT or YYACCEPT. */
2713 YY_STACK_PRINT (yyss
, yyssp
);
2714 while (yyssp
!= yyss
)
2716 yydestruct ("Cleanup: popping",
2717 yystos
[*yyssp
], yyvsp
, yylsp
);
2722 YYSTACK_FREE (yyss
);
2725 if (yymsg
!= yymsgbuf
)
2726 YYSTACK_FREE (yymsg
);
2728 /* Make sure YYID is used. */
2729 return YYID (yyresult
);
2734 /* Line 1486 of yacc.c */
2735 #line 562 "parse-gram.y"
2739 /* Return the location of the left-hand side of a rule whose
2740 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2741 the right-hand side, and return an empty location equal to the end
2742 boundary of RHS[0] if the right-hand side is empty. */
2745 lloc_default (YYLTYPE
const *rhs
, int n
)
2750 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2751 The bug is fixed in 7.4.2m, but play it safe for now. */
2752 loc
.start
= rhs
[n
].end
;
2753 loc
.end
= rhs
[n
].end
;
2755 /* Ignore empty nonterminals the start of the the right-hand side.
2756 Do not bother to ignore them at the end of the right-hand side,
2757 since empty nonterminals have the same end as their predecessors. */
2758 for (i
= 1; i
<= n
; i
++)
2759 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2761 loc
.start
= rhs
[i
].start
;
2769 /* Add a lex-param or a parse-param (depending on TYPE) with
2770 declaration DECL and location LOC. */
2773 add_param (char const *type
, char *decl
, location loc
)
2775 static char const alphanum
[26 + 26 + 1 + 10] =
2776 "abcdefghijklmnopqrstuvwxyz"
2777 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2780 char const *name_start
= NULL
;
2783 /* Stop on last actual character. */
2784 for (p
= decl
; p
[1]; p
++)
2786 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2787 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2790 /* Strip the surrounding '{' and '}', and any blanks just inside
2792 while (*--p
== ' ' || *p
== '\t')
2795 while (*++decl
== ' ' || *decl
== '\t')
2799 complain_at (loc
, _("missing identifier in parameter declaration"));
2806 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2810 name
= xmalloc (name_len
+ 1);
2811 memcpy (name
, name_start
, name_len
);
2812 name
[name_len
] = '\0';
2813 muscle_pair_list_grow (type
, decl
, name
);
2817 gram_scanner_last_string_free ();
2822 version_check (location
const *loc
, char const *version
)
2824 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2826 complain_at (*loc
, "require bison %s, but have %s",
2827 version
, PACKAGE_VERSION
);
2833 gram_error (location
const *loc
, char const *msg
)
2835 complain_at (*loc
, "%s", msg
);
2839 token_name (int type
)
2841 return yytname
[YYTRANSLATE (type
)];
2852 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2853 return quotearg_style (escape_quoting_style
, buf
);