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,
193 PERCENT_NONASSOC
= 267,
198 PERCENT_CODE_TOP
= 272,
200 PERCENT_DEFAULT_PREC
= 274,
201 PERCENT_DEFINE
= 275,
202 PERCENT_DEFINES
= 276,
203 PERCENT_ERROR_VERBOSE
= 277,
204 PERCENT_EXPECT
= 278,
205 PERCENT_EXPECT_RR
= 279,
206 PERCENT_FILE_PREFIX
= 280,
207 PERCENT_GLR_PARSER
= 281,
208 PERCENT_INITIAL_ACTION
= 282,
209 PERCENT_LEX_PARAM
= 283,
210 PERCENT_LOCATIONS
= 284,
211 PERCENT_NAME_PREFIX
= 285,
212 PERCENT_NO_DEFAULT_PREC
= 286,
213 PERCENT_NO_LINES
= 287,
214 PERCENT_NONDETERMINISTIC_PARSER
= 288,
215 PERCENT_OUTPUT
= 289,
216 PERCENT_PARSE_PARAM
= 290,
217 PERCENT_PROVIDES
= 291,
218 PERCENT_PURE_PARSER
= 292,
219 PERCENT_PUSH_PARSER
= 293,
220 PERCENT_REQUIRE
= 294,
221 PERCENT_REQUIRES
= 295,
222 PERCENT_SKELETON
= 296,
224 PERCENT_TOKEN_TABLE
= 298,
225 PERCENT_VERBOSE
= 299,
233 PERCENT_PERCENT
= 307,
247 #define PERCENT_TOKEN 260
248 #define PERCENT_NTERM 261
249 #define PERCENT_TYPE 262
250 #define PERCENT_DESTRUCTOR 263
251 #define PERCENT_PRINTER 264
252 #define PERCENT_LEFT 265
253 #define PERCENT_RIGHT 266
254 #define PERCENT_NONASSOC 267
255 #define PERCENT_PREC 268
256 #define PERCENT_DPREC 269
257 #define PERCENT_MERGE 270
258 #define PERCENT_CODE 271
259 #define PERCENT_CODE_TOP 272
260 #define PERCENT_DEBUG 273
261 #define PERCENT_DEFAULT_PREC 274
262 #define PERCENT_DEFINE 275
263 #define PERCENT_DEFINES 276
264 #define PERCENT_ERROR_VERBOSE 277
265 #define PERCENT_EXPECT 278
266 #define PERCENT_EXPECT_RR 279
267 #define PERCENT_FILE_PREFIX 280
268 #define PERCENT_GLR_PARSER 281
269 #define PERCENT_INITIAL_ACTION 282
270 #define PERCENT_LEX_PARAM 283
271 #define PERCENT_LOCATIONS 284
272 #define PERCENT_NAME_PREFIX 285
273 #define PERCENT_NO_DEFAULT_PREC 286
274 #define PERCENT_NO_LINES 287
275 #define PERCENT_NONDETERMINISTIC_PARSER 288
276 #define PERCENT_OUTPUT 289
277 #define PERCENT_PARSE_PARAM 290
278 #define PERCENT_PROVIDES 291
279 #define PERCENT_PURE_PARSER 292
280 #define PERCENT_PUSH_PARSER 293
281 #define PERCENT_REQUIRE 294
282 #define PERCENT_REQUIRES 295
283 #define PERCENT_SKELETON 296
284 #define PERCENT_START 297
285 #define PERCENT_TOKEN_TABLE 298
286 #define PERCENT_VERBOSE 299
287 #define PERCENT_YACC 300
288 #define BRACED_CODE 301
294 #define PERCENT_PERCENT 307
297 #define SEMICOLON 310
299 #define TYPE_TAG_ANY 312
300 #define TYPE_TAG_NONE 313
301 #define PERCENT_UNION 314
306 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
307 typedef union YYSTYPE
309 /* Line 198 of yacc.c */
310 #line 98 "parse-gram.y"
318 unsigned char character
;
321 /* Line 198 of yacc.c */
322 #line 323 "parse-gram.c"
324 # define YYSTYPE_IS_TRIVIAL 1
325 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
326 # define YYSTYPE_IS_DECLARED 1
329 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
330 typedef struct YYLTYPE
337 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
338 # define YYLTYPE_IS_DECLARED 1
339 # define YYLTYPE_IS_TRIVIAL 1
343 /* Copy the second part of user declarations. */
346 /* Line 221 of yacc.c */
347 #line 348 "parse-gram.c"
354 typedef YYTYPE_UINT8 yytype_uint8
;
356 typedef unsigned char yytype_uint8
;
360 typedef YYTYPE_INT8 yytype_int8
;
361 #elif (defined __STDC__ || defined __C99__FUNC__ \
362 || defined __cplusplus || defined _MSC_VER)
363 typedef signed char yytype_int8
;
365 typedef short int yytype_int8
;
369 typedef YYTYPE_UINT16 yytype_uint16
;
371 typedef unsigned short int yytype_uint16
;
375 typedef YYTYPE_INT16 yytype_int16
;
377 typedef short int yytype_int16
;
381 # ifdef __SIZE_TYPE__
382 # define YYSIZE_T __SIZE_TYPE__
383 # elif defined size_t
384 # define YYSIZE_T size_t
385 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
386 || defined __cplusplus || defined _MSC_VER)
387 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
388 # define YYSIZE_T size_t
390 # define YYSIZE_T unsigned int
394 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
399 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
400 # define YY_(msgid) dgettext ("bison-runtime", msgid)
404 # define YY_(msgid) msgid
408 /* Suppress unused-variable warnings by "using" E. */
409 #if ! defined lint || defined __GNUC__
410 # define YYUSE(e) ((void) (e))
412 # define YYUSE(e) /* empty */
415 /* Identity function, used to suppress warnings about constant conditions. */
419 #if (defined __STDC__ || defined __C99__FUNC__ \
420 || defined __cplusplus || defined _MSC_VER)
433 #if ! defined yyoverflow || YYERROR_VERBOSE
435 /* The parser invokes alloca or malloc; define the necessary symbols. */
437 # ifdef YYSTACK_USE_ALLOCA
438 # if YYSTACK_USE_ALLOCA
440 # define YYSTACK_ALLOC __builtin_alloca
441 # elif defined __BUILTIN_VA_ARG_INCR
442 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
444 # define YYSTACK_ALLOC __alloca
445 # elif defined _MSC_VER
446 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
447 # define alloca _alloca
449 # define YYSTACK_ALLOC alloca
450 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
451 || defined __cplusplus || defined _MSC_VER)
452 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
461 # ifdef YYSTACK_ALLOC
462 /* Pacify GCC's `empty if-body' warning. */
463 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
464 # ifndef YYSTACK_ALLOC_MAXIMUM
465 /* The OS might guarantee only one guard page at the bottom of the stack,
466 and a page size can be as small as 4096 bytes. So we cannot safely
467 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
468 to allow for a few compiler-allocated temporary stack slots. */
469 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
472 # define YYSTACK_ALLOC YYMALLOC
473 # define YYSTACK_FREE YYFREE
474 # ifndef YYSTACK_ALLOC_MAXIMUM
475 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
477 # if (defined __cplusplus && ! defined _STDLIB_H \
478 && ! ((defined YYMALLOC || defined malloc) \
479 && (defined YYFREE || defined free)))
480 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
486 # define YYMALLOC malloc
487 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
488 || defined __cplusplus || defined _MSC_VER)
489 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
494 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
495 || defined __cplusplus || defined _MSC_VER)
496 void free (void *); /* INFRINGES ON USER NAME SPACE */
500 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
503 #if (! defined yyoverflow \
504 && (! defined __cplusplus \
505 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
506 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
508 /* A type that is properly aligned for any stack member. */
516 /* The size of the maximum gap between one aligned stack and the next. */
517 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
519 /* The size of an array large to enough to hold all stacks, each with
521 # define YYSTACK_BYTES(N) \
522 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
523 + 2 * YYSTACK_GAP_MAXIMUM)
525 /* Copy COUNT objects from FROM to TO. The source and destination do
528 # if defined __GNUC__ && 1 < __GNUC__
529 # define YYCOPY(To, From, Count) \
530 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
532 # define YYCOPY(To, From, Count) \
536 for (yyi = 0; yyi < (Count); yyi++) \
537 (To)[yyi] = (From)[yyi]; \
543 /* Relocate STACK from its old location to the new one. The
544 local variables YYSIZE and YYSTACKSIZE give the old and new number of
545 elements in the stack, and YYPTR gives the new location of the
546 stack. Advance YYPTR to a properly aligned location for the next
548 # define YYSTACK_RELOCATE(Stack) \
551 YYSIZE_T yynewbytes; \
552 YYCOPY (&yyptr->Stack, Stack, yysize); \
553 Stack = &yyptr->Stack; \
554 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
555 yyptr += yynewbytes / sizeof (*yyptr); \
561 /* YYFINAL -- State number of the termination state. */
563 /* YYLAST -- Last index in YYTABLE. */
566 /* YYNTOKENS -- Number of terminals. */
568 /* YYNNTS -- Number of nonterminals. */
570 /* YYNRULES -- Number of rules. */
572 /* YYNRULES -- Number of states. */
573 #define YYNSTATES 138
575 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
577 #define YYMAXUTOK 314
579 #define YYTRANSLATE(YYX) \
580 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
582 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
583 static const yytype_uint8 yytranslate
[] =
585 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
611 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
612 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
613 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
614 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
615 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
620 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
622 static const yytype_uint8 yyprhs
[] =
624 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
625 24, 26, 29, 32, 36, 38, 41, 44, 46, 50,
626 52, 54, 58, 61, 63, 65, 68, 71, 73, 75,
627 77, 79, 81, 83, 86, 90, 94, 96, 98, 101,
628 104, 107, 110, 111, 113, 117, 118, 122, 123, 127,
629 131, 135, 137, 139, 141, 142, 144, 146, 149, 151,
630 154, 156, 158, 160, 162, 164, 166, 169, 172, 176,
631 178, 181, 183, 186, 188, 191, 194, 195, 199, 201,
632 205, 208, 209, 212, 215, 219, 223, 227, 229, 231,
633 232, 234, 236, 238, 240, 242, 244, 246, 248, 249
636 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
637 static const yytype_int8 yyrhs
[] =
639 61, 0, -1, 62, 52, 77, 90, -1, -1, 62,
640 63, -1, 64, -1, 54, -1, 18, -1, 20, 3,
641 84, -1, 21, -1, 22, -1, 23, 4, -1, 24,
642 4, -1, 25, 49, 3, -1, 26, -1, 27, 46,
643 -1, 28, 46, -1, 29, -1, 30, 49, 3, -1,
644 32, -1, 33, -1, 34, 49, 3, -1, 35, 46,
645 -1, 37, -1, 38, -1, 39, 3, -1, 41, 3,
646 -1, 43, -1, 44, -1, 45, -1, 55, -1, 69,
647 -1, 66, -1, 42, 88, -1, 8, 46, 73, -1,
648 9, 46, 73, -1, 19, -1, 31, -1, 16, 85,
649 -1, 17, 85, -1, 36, 85, -1, 40, 85, -1,
650 -1, 50, -1, 59, 65, 46, -1, -1, 6, 67,
651 76, -1, -1, 5, 68, 76, -1, 7, 56, 72,
652 -1, 70, 71, 72, -1, 10, -1, 11, -1, 12,
653 -1, -1, 56, -1, 88, -1, 72, 88, -1, 74,
654 -1, 73, 74, -1, 88, -1, 56, -1, 57, -1,
655 58, -1, 56, -1, 86, -1, 86, 4, -1, 86,
656 89, -1, 86, 4, 89, -1, 75, -1, 76, 75,
657 -1, 78, -1, 77, 78, -1, 79, -1, 64, 55,
658 -1, 1, 55, -1, -1, 87, 80, 81, -1, 82,
659 -1, 81, 53, 82, -1, 81, 55, -1, -1, 82,
660 88, -1, 82, 46, -1, 82, 13, 88, -1, 82,
661 14, 4, -1, 82, 15, 56, -1, 3, -1, 85,
662 -1, -1, 83, -1, 46, -1, 50, -1, 47, -1,
663 51, -1, 86, -1, 89, -1, 3, -1, -1, 52,
667 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
668 static const yytype_uint16 yyrline
[] =
670 0, 209, 209, 217, 219, 223, 224, 225, 226, 227,
671 228, 229, 230, 231, 232, 237, 241, 242, 243, 244,
672 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
673 255, 259, 260, 261, 265, 273, 281, 285, 289, 290,
674 291, 292, 303, 304, 308, 336, 336, 341, 341, 346,
675 357, 372, 373, 374, 378, 379, 384, 386, 391, 392,
676 396, 397, 398, 399, 404, 409, 414, 420, 426, 437,
677 438, 447, 448, 454, 455, 456, 463, 463, 467, 468,
678 469, 474, 475, 477, 479, 481, 483, 493, 494, 500,
679 504, 509, 525, 527, 536, 541, 542, 547, 554, 556
683 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
684 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
685 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
686 static const char *const yytname
[] =
688 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
689 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
690 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
691 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%code-top\"", "\"%debug\"",
692 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
693 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
694 "\"%initial-action\"", "\"%lex-param\"", "\"%locations\"",
695 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
696 "\"%nondeterministic-parser\"", "\"%output\"", "\"%parse-param\"",
697 "\"%provides\"", "\"%pure-parser\"", "\"%push-parser\"", "\"%require\"",
698 "\"%requires\"", "\"%skeleton\"", "\"%start\"", "\"%token-table\"",
699 "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"",
700 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
701 "\"%{...%}\"", "\";\"", "\"type\"", "\"<*>\"", "\"<!>\"", "\"%union\"",
702 "$accept", "input", "prologue_declarations", "prologue_declaration",
703 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
704 "precedence_declaration", "precedence_declarator", "type.opt",
705 "symbols.1", "generic_symlist", "generic_symlist_item", "symbol_def",
706 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
707 "$@3", "rhses.1", "rhs", "content", "content.opt", "braceless", "id",
708 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
713 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
715 static const yytype_uint16 yytoknum
[] =
717 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
718 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
719 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
720 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
721 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
722 305, 306, 307, 308, 309, 310, 311, 312, 313, 314
726 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
727 static const yytype_uint8 yyr1
[] =
729 0, 60, 61, 62, 62, 63, 63, 63, 63, 63,
730 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
731 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
732 63, 64, 64, 64, 64, 64, 64, 64, 64, 64,
733 64, 64, 65, 65, 64, 67, 66, 68, 66, 66,
734 69, 70, 70, 70, 71, 71, 72, 72, 73, 73,
735 74, 74, 74, 74, 75, 75, 75, 75, 75, 76,
736 76, 77, 77, 78, 78, 78, 80, 79, 81, 81,
737 81, 82, 82, 82, 82, 82, 82, 83, 83, 84,
738 84, 85, 86, 86, 87, 88, 88, 89, 90, 90
741 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
742 static const yytype_uint8 yyr2
[] =
744 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
745 1, 2, 2, 3, 1, 2, 2, 1, 3, 1,
746 1, 3, 2, 1, 1, 2, 2, 1, 1, 1,
747 1, 1, 1, 2, 3, 3, 1, 1, 2, 2,
748 2, 2, 0, 1, 3, 0, 3, 0, 3, 3,
749 3, 1, 1, 1, 0, 1, 1, 2, 1, 2,
750 1, 1, 1, 1, 1, 1, 2, 2, 3, 1,
751 2, 1, 2, 1, 2, 2, 0, 3, 1, 3,
752 2, 0, 2, 2, 3, 3, 3, 1, 1, 0,
753 1, 1, 1, 1, 1, 1, 1, 1, 0, 2
756 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
757 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
758 means the default is an error. */
759 static const yytype_uint8 yydefact
[] =
761 3, 0, 0, 1, 47, 45, 0, 0, 0, 51,
762 52, 53, 0, 0, 7, 36, 0, 9, 10, 0,
763 0, 0, 14, 0, 0, 17, 0, 37, 19, 20,
764 0, 0, 0, 23, 24, 0, 0, 0, 0, 27,
765 28, 29, 0, 6, 30, 42, 4, 5, 32, 31,
766 54, 0, 0, 0, 0, 0, 91, 38, 39, 89,
767 11, 12, 0, 15, 16, 0, 0, 22, 40, 25,
768 41, 26, 97, 93, 92, 95, 33, 96, 0, 94,
769 0, 0, 71, 73, 76, 43, 0, 55, 0, 64,
770 69, 48, 65, 46, 49, 56, 61, 62, 63, 34,
771 58, 60, 35, 87, 90, 8, 88, 13, 18, 21,
772 75, 74, 0, 72, 2, 81, 44, 50, 70, 66,
773 67, 57, 59, 99, 77, 78, 68, 81, 80, 0,
774 0, 0, 83, 82, 79, 84, 85, 86
777 /* YYDEFGOTO[NTERM-NUM]. */
778 static const yytype_int8 yydefgoto
[] =
780 -1, 1, 2, 46, 80, 86, 48, 52, 51, 49,
781 50, 88, 94, 99, 100, 90, 91, 81, 82, 83,
782 115, 124, 125, 104, 105, 57, 75, 84, 101, 77,
786 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
788 #define YYPACT_NINF -89
789 static const yytype_int16 yypact
[] =
791 -89, 14, 112, -89, -89, -89, -33, -16, -11, -89,
792 -89, -89, -6, -6, -89, -89, 39, -89, -89, 42,
793 43, 5, -89, 9, 11, -89, 10, -89, -89, -89,
794 12, 24, -6, -89, -89, 48, -6, 68, 30, -89,
795 -89, -89, 57, -89, -89, 28, -89, -89, -89, -89,
796 29, -31, -31, 30, 25, 25, -89, -89, -89, 2,
797 -89, -89, 86, -89, -89, 87, 89, -89, -89, -89,
798 -89, -89, -89, -89, -89, -89, -89, -89, 40, -89,
799 45, 1, -89, -89, -89, -89, 52, -89, 30, -89,
800 -89, -31, 35, -31, 30, -89, -89, -89, -89, 25,
801 -89, -89, 25, -89, -89, -89, -89, -89, -89, -89,
802 -89, -89, 46, -89, -89, -89, -89, 30, -89, 98,
803 -89, -89, -89, -89, -26, 155, -89, -89, -89, 30,
804 99, 49, -89, -89, 155, -89, -89, -89
807 /* YYPGOTO[NTERM-NUM]. */
808 static const yytype_int8 yypgoto
[] =
810 -89, -89, -89, -89, 100, -89, -89, -89, -89, -89,
811 -89, -89, 16, 51, -78, -57, 55, -89, 31, -89,
812 -89, -89, -18, -89, -89, -10, -7, -89, -38, -88,
816 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
817 positive, shift that token. If negative, reduce the rule which
818 number is the opposite. If zero, do what YYDEFACT says.
819 If YYTABLE_NINF, syntax error. */
820 #define YYTABLE_NINF -99
821 static const yytype_int16 yytable
[] =
823 76, -98, 78, 58, 120, 103, 4, 5, 6, 7,
824 8, 9, 10, 11, 3, 95, 73, 12, 13, 74,
825 15, 122, 68, 53, 122, 89, 70, 127, 72, 128,
826 54, 126, 27, 72, 118, 55, 118, 32, 72, 119,
827 56, 36, 59, 38, 92, 92, 60, 61, 56, 106,
828 95, 69, 79, 112, 62, 63, 121, 64, 78, 65,
829 45, 66, 4, 5, 6, 7, 8, 9, 10, 11,
830 67, 71, 73, 12, 13, 74, 15, 73, 85, 121,
831 74, 96, 97, 98, 92, 87, 92, 133, 27, 107,
832 108, 135, 109, 32, 123, 110, 133, 36, 116, 38,
833 111, 72, 47, 136, 117, 137, 102, 93, 79, 134,
834 0, 0, 113, 0, 0, 0, 45, 4, 5, 6,
835 7, 8, 9, 10, 11, 0, 0, 0, 12, 13,
836 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
837 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
838 34, 35, 36, 37, 38, 39, 40, 41, 72, 0,
839 0, 0, 0, 0, 42, 0, 43, 44, 129, 130,
840 131, 45, 0, 0, 0, 0, 0, 0, 0, 0,
841 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
842 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
846 static const yytype_int16 yycheck
[] =
848 38, 0, 1, 13, 92, 3, 5, 6, 7, 8,
849 9, 10, 11, 12, 0, 53, 47, 16, 17, 50,
850 19, 99, 32, 56, 102, 56, 36, 53, 3, 55,
851 46, 119, 31, 3, 91, 46, 93, 36, 3, 4,
852 46, 40, 3, 42, 51, 52, 4, 4, 46, 59,
853 88, 3, 51, 52, 49, 46, 94, 46, 1, 49,
854 59, 49, 5, 6, 7, 8, 9, 10, 11, 12,
855 46, 3, 47, 16, 17, 50, 19, 47, 50, 117,
856 50, 56, 57, 58, 91, 56, 93, 125, 31, 3,
857 3, 129, 3, 36, 48, 55, 134, 40, 46, 42,
858 55, 3, 2, 4, 88, 56, 55, 52, 51, 127,
859 -1, -1, 81, -1, -1, -1, 59, 5, 6, 7,
860 8, 9, 10, 11, 12, -1, -1, -1, 16, 17,
861 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
862 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
863 38, 39, 40, 41, 42, 43, 44, 45, 3, -1,
864 -1, -1, -1, -1, 52, -1, 54, 55, 13, 14,
865 15, 59, -1, -1, -1, -1, -1, -1, -1, -1,
866 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
867 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
868 -1, 46, 47, -1, -1, 50
871 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
872 symbol of state STATE-NUM. */
873 static const yytype_uint8 yystos
[] =
875 0, 61, 62, 0, 5, 6, 7, 8, 9, 10,
876 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
877 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
878 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
879 44, 45, 52, 54, 55, 59, 63, 64, 66, 69,
880 70, 68, 67, 56, 46, 46, 46, 85, 85, 3,
881 4, 4, 49, 46, 46, 49, 49, 46, 85, 3,
882 85, 3, 3, 47, 50, 86, 88, 89, 1, 51,
883 64, 77, 78, 79, 87, 50, 65, 56, 71, 56,
884 75, 76, 86, 76, 72, 88, 56, 57, 58, 73,
885 74, 88, 73, 3, 83, 84, 85, 3, 3, 3,
886 55, 55, 52, 78, 90, 80, 46, 72, 75, 4,
887 89, 88, 74, 48, 81, 82, 89, 53, 55, 13,
888 14, 15, 46, 88, 82, 88, 4, 56
891 #define yyerrok (yyerrstatus = 0)
892 #define yyclearin (yychar = YYEMPTY)
896 #define YYACCEPT goto yyacceptlab
897 #define YYABORT goto yyabortlab
898 #define YYERROR goto yyerrorlab
901 /* Like YYERROR except do call yyerror. This remains here temporarily
902 to ease the transition to the new meaning of YYERROR, for GCC.
903 Once GCC version 2 has supplanted version 1, this can go. */
905 #define YYFAIL goto yyerrlab
907 #define YYRECOVERING() (!!yyerrstatus)
909 #define YYBACKUP(Token, Value) \
911 if (yychar == YYEMPTY && yylen == 1) \
915 yytoken = YYTRANSLATE (yychar); \
921 yyerror (YY_("syntax error: cannot back up")); \
928 #define YYERRCODE 256
931 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
932 If N is 0, then set CURRENT to the empty location which ends
933 the previous symbol: RHS[0] (always defined). */
935 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
936 #ifndef YYLLOC_DEFAULT
937 # define YYLLOC_DEFAULT(Current, Rhs, N) \
941 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
942 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
943 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
944 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
948 (Current).first_line = (Current).last_line = \
949 YYRHSLOC (Rhs, 0).last_line; \
950 (Current).first_column = (Current).last_column = \
951 YYRHSLOC (Rhs, 0).last_column; \
957 /* YY_LOCATION_PRINT -- Print the location on the stream.
958 This macro was not mandated originally: define only if we know
959 we won't break user code: when these are the locations we know. */
961 #ifndef YY_LOCATION_PRINT
962 # if YYLTYPE_IS_TRIVIAL
963 # define YY_LOCATION_PRINT(File, Loc) \
964 fprintf (File, "%d.%d-%d.%d", \
965 (Loc).first_line, (Loc).first_column, \
966 (Loc).last_line, (Loc).last_column)
968 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
973 /* YYLEX -- calling `yylex' with the right arguments. */
976 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
978 # define YYLEX yylex (&yylval, &yylloc)
981 /* Enable debugging if requested. */
985 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
986 # define YYFPRINTF fprintf
989 # define YYDPRINTF(Args) \
995 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
999 YYFPRINTF (stderr, "%s ", Title); \
1000 yy_symbol_print (stderr, \
1001 Type, Value, Location); \
1002 YYFPRINTF (stderr, "\n"); \
1007 /*--------------------------------.
1008 | Print this symbol on YYOUTPUT. |
1009 `--------------------------------*/
1012 #if (defined __STDC__ || defined __C99__FUNC__ \
1013 || defined __cplusplus || defined _MSC_VER)
1015 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1018 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1021 YYSTYPE
const * const yyvaluep
;
1022 YYLTYPE
const * const yylocationp
;
1027 YYUSE (yylocationp
);
1029 if (yytype
< YYNTOKENS
)
1030 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1036 case 3: /* "\"string\"" */
1038 /* Line 670 of yacc.c */
1039 #line 187 "parse-gram.y"
1040 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1042 /* Line 670 of yacc.c */
1043 #line 1044 "parse-gram.c"
1045 case 4: /* "\"integer\"" */
1047 /* Line 670 of yacc.c */
1048 #line 198 "parse-gram.y"
1049 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1051 /* Line 670 of yacc.c */
1052 #line 1053 "parse-gram.c"
1054 case 46: /* "\"{...}\"" */
1056 /* Line 670 of yacc.c */
1057 #line 189 "parse-gram.y"
1058 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1060 /* Line 670 of yacc.c */
1061 #line 1062 "parse-gram.c"
1063 case 47: /* "\"char\"" */
1065 /* Line 670 of yacc.c */
1066 #line 182 "parse-gram.y"
1067 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1069 /* Line 670 of yacc.c */
1070 #line 1071 "parse-gram.c"
1072 case 48: /* "\"epilogue\"" */
1074 /* Line 670 of yacc.c */
1075 #line 189 "parse-gram.y"
1076 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1078 /* Line 670 of yacc.c */
1079 #line 1080 "parse-gram.c"
1081 case 50: /* "\"identifier\"" */
1083 /* Line 670 of yacc.c */
1084 #line 194 "parse-gram.y"
1085 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1087 /* Line 670 of yacc.c */
1088 #line 1089 "parse-gram.c"
1090 case 51: /* "\"identifier:\"" */
1092 /* Line 670 of yacc.c */
1093 #line 195 "parse-gram.y"
1094 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1096 /* Line 670 of yacc.c */
1097 #line 1098 "parse-gram.c"
1099 case 54: /* "\"%{...%}\"" */
1101 /* Line 670 of yacc.c */
1102 #line 189 "parse-gram.y"
1103 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1105 /* Line 670 of yacc.c */
1106 #line 1107 "parse-gram.c"
1108 case 56: /* "\"type\"" */
1110 /* Line 670 of yacc.c */
1111 #line 193 "parse-gram.y"
1112 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1114 /* Line 670 of yacc.c */
1115 #line 1116 "parse-gram.c"
1117 case 83: /* "content" */
1119 /* Line 670 of yacc.c */
1120 #line 189 "parse-gram.y"
1121 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1123 /* Line 670 of yacc.c */
1124 #line 1125 "parse-gram.c"
1126 case 84: /* "content.opt" */
1128 /* Line 670 of yacc.c */
1129 #line 189 "parse-gram.y"
1130 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1132 /* Line 670 of yacc.c */
1133 #line 1134 "parse-gram.c"
1135 case 85: /* "braceless" */
1137 /* Line 670 of yacc.c */
1138 #line 189 "parse-gram.y"
1139 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1141 /* Line 670 of yacc.c */
1142 #line 1143 "parse-gram.c"
1146 /* Line 670 of yacc.c */
1147 #line 201 "parse-gram.y"
1148 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1150 /* Line 670 of yacc.c */
1151 #line 1152 "parse-gram.c"
1153 case 87: /* "id_colon" */
1155 /* Line 670 of yacc.c */
1156 #line 202 "parse-gram.y"
1157 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1159 /* Line 670 of yacc.c */
1160 #line 1161 "parse-gram.c"
1162 case 88: /* "symbol" */
1164 /* Line 670 of yacc.c */
1165 #line 201 "parse-gram.y"
1166 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1168 /* Line 670 of yacc.c */
1169 #line 1170 "parse-gram.c"
1171 case 89: /* "string_as_id" */
1173 /* Line 670 of yacc.c */
1174 #line 201 "parse-gram.y"
1175 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1177 /* Line 670 of yacc.c */
1178 #line 1179 "parse-gram.c"
1186 /*--------------------------------.
1187 | Print this symbol on YYOUTPUT. |
1188 `--------------------------------*/
1190 #if (defined __STDC__ || defined __C99__FUNC__ \
1191 || defined __cplusplus || defined _MSC_VER)
1193 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1196 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1199 YYSTYPE
const * const yyvaluep
;
1200 YYLTYPE
const * const yylocationp
;
1203 if (yytype
< YYNTOKENS
)
1204 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1206 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1208 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1209 YYFPRINTF (yyoutput
, ": ");
1210 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1211 YYFPRINTF (yyoutput
, ")");
1214 /*------------------------------------------------------------------.
1215 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1217 `------------------------------------------------------------------*/
1219 #if (defined __STDC__ || defined __C99__FUNC__ \
1220 || defined __cplusplus || defined _MSC_VER)
1222 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1225 yy_stack_print (yybottom
, yytop
)
1226 yytype_int16
*yybottom
;
1227 yytype_int16
*yytop
;
1230 YYFPRINTF (stderr
, "Stack now");
1231 for (; yybottom
<= yytop
; yybottom
++)
1233 int yybot
= *yybottom
;
1234 YYFPRINTF (stderr
, " %d", yybot
);
1236 YYFPRINTF (stderr
, "\n");
1239 # define YY_STACK_PRINT(Bottom, Top) \
1242 yy_stack_print ((Bottom), (Top)); \
1246 /*------------------------------------------------.
1247 | Report that the YYRULE is going to be reduced. |
1248 `------------------------------------------------*/
1250 #if (defined __STDC__ || defined __C99__FUNC__ \
1251 || defined __cplusplus || defined _MSC_VER)
1253 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1256 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1262 int yynrhs
= yyr2
[yyrule
];
1264 unsigned long int yylno
= yyrline
[yyrule
];
1265 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1267 /* The symbols being reduced. */
1268 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1270 fprintf (stderr
, " $%d = ", yyi
+ 1);
1271 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1272 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1273 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1274 fprintf (stderr
, "\n");
1278 # define YY_REDUCE_PRINT(Rule) \
1281 yy_reduce_print (yyvsp, yylsp, Rule); \
1284 /* Nonzero means print parse trace. It is left uninitialized so that
1285 multiple parsers can coexist. */
1287 #else /* !YYDEBUG */
1288 # define YYDPRINTF(Args)
1289 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1290 # define YY_STACK_PRINT(Bottom, Top)
1291 # define YY_REDUCE_PRINT(Rule)
1292 #endif /* !YYDEBUG */
1295 /* YYINITDEPTH -- initial size of the parser's stacks. */
1297 # define YYINITDEPTH 200
1300 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1301 if the built-in stack extension method is used).
1303 Do not make this value too large; the results are undefined if
1304 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1305 evaluated with infinite-precision integer arithmetic. */
1308 # define YYMAXDEPTH 10000
1316 # if defined __GLIBC__ && defined _STRING_H
1317 # define yystrlen strlen
1319 /* Return the length of YYSTR. */
1320 #if (defined __STDC__ || defined __C99__FUNC__ \
1321 || defined __cplusplus || defined _MSC_VER)
1323 yystrlen (const char *yystr
)
1331 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1339 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1340 # define yystpcpy stpcpy
1342 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1344 #if (defined __STDC__ || defined __C99__FUNC__ \
1345 || defined __cplusplus || defined _MSC_VER)
1347 yystpcpy (char *yydest
, const char *yysrc
)
1350 yystpcpy (yydest
, yysrc
)
1356 const char *yys
= yysrc
;
1358 while ((*yyd
++ = *yys
++) != '\0')
1367 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1368 quotes and backslashes, so that it's suitable for yyerror. The
1369 heuristic is that double-quoting is unnecessary unless the string
1370 contains an apostrophe, a comma, or backslash (other than
1371 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1372 null, do not copy; instead, return the length of what the result
1375 yytnamerr (char *yyres
, const char *yystr
)
1380 char const *yyp
= yystr
;
1387 goto do_not_strip_quotes
;
1391 goto do_not_strip_quotes
;
1404 do_not_strip_quotes
: ;
1408 return yystrlen (yystr
);
1410 return yystpcpy (yyres
, yystr
) - yyres
;
1414 /* Copy into YYRESULT an error message about the unexpected token
1415 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1416 including the terminating null byte. If YYRESULT is null, do not
1417 copy anything; just return the number of bytes that would be
1418 copied. As a special case, return 0 if an ordinary "syntax error"
1419 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1420 size calculation. */
1422 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1424 int yyn
= yypact
[yystate
];
1426 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1430 int yytype
= YYTRANSLATE (yychar
);
1431 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1432 YYSIZE_T yysize
= yysize0
;
1434 int yysize_overflow
= 0;
1435 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1436 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1440 /* This is so xgettext sees the translatable formats that are
1441 constructed on the fly. */
1442 YY_("syntax error, unexpected %s");
1443 YY_("syntax error, unexpected %s, expecting %s");
1444 YY_("syntax error, unexpected %s, expecting %s or %s");
1445 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1446 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1450 static char const yyunexpected
[] = "syntax error, unexpected %s";
1451 static char const yyexpecting
[] = ", expecting %s";
1452 static char const yyor
[] = " or %s";
1453 char yyformat
[sizeof yyunexpected
1454 + sizeof yyexpecting
- 1
1455 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1456 * (sizeof yyor
- 1))];
1457 char const *yyprefix
= yyexpecting
;
1459 /* Start YYX at -YYN if negative to avoid negative indexes in
1461 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1463 /* Stay within bounds of both yycheck and yytname. */
1464 int yychecklim
= YYLAST
- yyn
+ 1;
1465 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1468 yyarg
[0] = yytname
[yytype
];
1469 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1471 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1472 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1474 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1478 yyformat
[sizeof yyunexpected
- 1] = '\0';
1481 yyarg
[yycount
++] = yytname
[yyx
];
1482 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1483 yysize_overflow
|= (yysize1
< yysize
);
1485 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1489 yyf
= YY_(yyformat
);
1490 yysize1
= yysize
+ yystrlen (yyf
);
1491 yysize_overflow
|= (yysize1
< yysize
);
1494 if (yysize_overflow
)
1495 return YYSIZE_MAXIMUM
;
1499 /* Avoid sprintf, as that infringes on the user's name space.
1500 Don't have undefined behavior even if the translation
1501 produced a string with the wrong number of "%s"s. */
1502 char *yyp
= yyresult
;
1504 while ((*yyp
= *yyf
) != '\0')
1506 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1508 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1521 #endif /* YYERROR_VERBOSE */
1524 /*-----------------------------------------------.
1525 | Release the memory associated to this symbol. |
1526 `-----------------------------------------------*/
1529 #if (defined __STDC__ || defined __C99__FUNC__ \
1530 || defined __cplusplus || defined _MSC_VER)
1532 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1535 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1539 YYLTYPE
*yylocationp
;
1543 YYUSE (yylocationp
);
1547 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1558 /* Prevent warnings from -Wmissing-prototypes. */
1560 #ifdef YYPARSE_PARAM
1561 #if defined __STDC__ || defined __cplusplus
1562 int yyparse (void *YYPARSE_PARAM
);
1566 #else /* ! YYPARSE_PARAM */
1567 #if defined __STDC__ || defined __cplusplus
1572 #endif /* ! YYPARSE_PARAM */
1583 #ifdef YYPARSE_PARAM
1584 #if (defined __STDC__ || defined __C99__FUNC__ \
1585 || defined __cplusplus || defined _MSC_VER)
1587 yyparse (void *YYPARSE_PARAM
)
1590 yyparse (YYPARSE_PARAM
)
1591 void *YYPARSE_PARAM
;
1593 #else /* ! YYPARSE_PARAM */
1594 #if (defined __STDC__ || defined __C99__FUNC__ \
1595 || defined __cplusplus || defined _MSC_VER)
1605 /* The lookahead symbol. */
1608 /* The semantic value of the lookahead symbol. */
1611 /* Number of syntax errors so far. */
1613 /* Location data for the lookahead symbol. */
1619 /* Number of tokens to shift before error messages enabled. */
1621 /* Lookahead token as an internal (translated) token number. */
1624 /* Buffer for error messages, and its allocated size. */
1626 char *yymsg
= yymsgbuf
;
1627 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1630 /* Three stacks and their tools:
1631 `yyss': related to states,
1632 `yyvs': related to semantic values,
1633 `yyls': related to locations.
1635 Refer to the stacks thru separate pointers, to allow yyoverflow
1636 to reallocate them elsewhere. */
1638 /* The state stack. */
1639 yytype_int16 yyssa
[YYINITDEPTH
];
1640 yytype_int16
*yyss
= yyssa
;
1641 yytype_int16
*yyssp
;
1643 /* The semantic value stack. */
1644 YYSTYPE yyvsa
[YYINITDEPTH
];
1645 YYSTYPE
*yyvs
= yyvsa
;
1648 /* The location stack. */
1649 YYLTYPE yylsa
[YYINITDEPTH
];
1650 YYLTYPE
*yyls
= yylsa
;
1652 /* The locations where the error started and ended. */
1653 YYLTYPE yyerror_range
[2];
1655 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1657 YYSIZE_T yystacksize
= YYINITDEPTH
;
1659 /* The variables used to return semantic value and location from the
1664 /* The number of symbols on the RHS of the reduced rule.
1665 Keep to zero when no symbol should be popped. */
1668 YYDPRINTF ((stderr
, "Starting parse\n"));
1673 yychar
= YYEMPTY
; /* Cause a token to be read. */
1675 /* Initialize stack pointers.
1676 Waste one element of value and location stack
1677 so that they stay on the same level as the state stack.
1678 The wasted elements are never initialized. */
1683 #if YYLTYPE_IS_TRIVIAL
1684 /* Initialize the default location before parsing starts. */
1685 yylloc
.first_line
= yylloc
.last_line
= 1;
1686 yylloc
.first_column
= yylloc
.last_column
= 1;
1690 /* User initialization code. */
1692 /* Line 1082 of yacc.c */
1693 #line 89 "parse-gram.y"
1695 /* Bison's grammar can initial empty locations, hence a default
1696 location is needed. */
1697 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1698 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1701 /* Line 1082 of yacc.c */
1702 #line 1703 "parse-gram.c"
1706 /*------------------------------------------------------------.
1707 | yynewstate -- Push a new state, which is found in yystate. |
1708 `------------------------------------------------------------*/
1710 /* In all cases, when you get here, the value and location stacks
1711 have just been pushed. So pushing a state here evens the stacks. */
1717 if (yyss
+ yystacksize
- 1 <= yyssp
)
1719 /* Get the current used size of the three stacks, in elements. */
1720 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1724 /* Give user a chance to reallocate the stack. Use copies of
1725 these so that the &'s don't force the real ones into
1727 YYSTYPE
*yyvs1
= yyvs
;
1728 yytype_int16
*yyss1
= yyss
;
1729 YYLTYPE
*yyls1
= yyls
;
1731 /* Each stack pointer address is followed by the size of the
1732 data in use in that stack, in bytes. This used to be a
1733 conditional around just the two extra args, but that might
1734 be undefined if yyoverflow is a macro. */
1735 yyoverflow (YY_("memory exhausted"),
1736 &yyss1
, yysize
* sizeof (*yyssp
),
1737 &yyvs1
, yysize
* sizeof (*yyvsp
),
1738 &yyls1
, yysize
* sizeof (*yylsp
),
1744 #else /* no yyoverflow */
1745 # ifndef YYSTACK_RELOCATE
1746 goto yyexhaustedlab
;
1748 /* Extend the stack our own way. */
1749 if (YYMAXDEPTH
<= yystacksize
)
1750 goto yyexhaustedlab
;
1752 if (YYMAXDEPTH
< yystacksize
)
1753 yystacksize
= YYMAXDEPTH
;
1756 yytype_int16
*yyss1
= yyss
;
1757 union yyalloc
*yyptr
=
1758 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1760 goto yyexhaustedlab
;
1761 YYSTACK_RELOCATE (yyss
);
1762 YYSTACK_RELOCATE (yyvs
);
1763 YYSTACK_RELOCATE (yyls
);
1764 # undef YYSTACK_RELOCATE
1766 YYSTACK_FREE (yyss1
);
1769 #endif /* no yyoverflow */
1771 yyssp
= yyss
+ yysize
- 1;
1772 yyvsp
= yyvs
+ yysize
- 1;
1773 yylsp
= yyls
+ yysize
- 1;
1775 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1776 (unsigned long int) yystacksize
));
1778 if (yyss
+ yystacksize
- 1 <= yyssp
)
1782 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1784 if (yystate
== YYFINAL
)
1794 /* Do appropriate processing given the current state. Read a
1795 lookahead token if we need one and don't already have one. */
1797 /* First try to decide what to do without reference to lookahead token. */
1798 yyn
= yypact
[yystate
];
1799 if (yyn
== YYPACT_NINF
)
1802 /* Not known => get a lookahead token if don't already have one. */
1804 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1805 if (yychar
== YYEMPTY
)
1807 YYDPRINTF ((stderr
, "Reading a token: "));
1811 if (yychar
<= YYEOF
)
1813 yychar
= yytoken
= YYEOF
;
1814 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1818 yytoken
= YYTRANSLATE (yychar
);
1819 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1822 /* If the proper action on seeing token YYTOKEN is to reduce or to
1823 detect an error, take that action. */
1825 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1830 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1836 /* Count tokens shifted since error; after three, turn off error
1841 /* Shift the lookahead token. */
1842 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1844 /* Discard the shifted token. */
1853 /*-----------------------------------------------------------.
1854 | yydefault -- do the default action for the current state. |
1855 `-----------------------------------------------------------*/
1857 yyn
= yydefact
[yystate
];
1863 /*-----------------------------.
1864 | yyreduce -- Do a reduction. |
1865 `-----------------------------*/
1867 /* yyn is the number of a rule to reduce with. */
1870 /* If YYLEN is nonzero, implement the default value of the action:
1873 Otherwise, the following line sets YYVAL to garbage.
1874 This behavior is undocumented and Bison
1875 users should not rely upon it. Assigning to YYVAL
1876 unconditionally makes the parser a bit smaller, and it avoids a
1877 GCC warning that YYVAL may be used uninitialized. */
1878 yyval
= yyvsp
[1-yylen
];
1880 /* Default location. */
1881 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1882 YY_REDUCE_PRINT (yyn
);
1887 /* Line 1269 of yacc.c */
1888 #line 224 "parse-gram.y"
1889 { prologue_augment (translate_code ((yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)])), (yylsp
[(1) - (1)]), union_seen
); }
1894 /* Line 1269 of yacc.c */
1895 #line 225 "parse-gram.y"
1896 { debug_flag
= true; }
1901 /* Line 1269 of yacc.c */
1902 #line 226 "parse-gram.y"
1903 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1908 /* Line 1269 of yacc.c */
1909 #line 227 "parse-gram.y"
1910 { defines_flag
= true; }
1915 /* Line 1269 of yacc.c */
1916 #line 228 "parse-gram.y"
1917 { error_verbose
= true; }
1922 /* Line 1269 of yacc.c */
1923 #line 229 "parse-gram.y"
1924 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1929 /* Line 1269 of yacc.c */
1930 #line 230 "parse-gram.y"
1931 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1936 /* Line 1269 of yacc.c */
1937 #line 231 "parse-gram.y"
1938 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1943 /* Line 1269 of yacc.c */
1944 #line 233 "parse-gram.y"
1946 nondeterministic_parser
= true;
1953 /* Line 1269 of yacc.c */
1954 #line 238 "parse-gram.y"
1956 muscle_code_grow ("initial_action", translate_symbol_action ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1962 /* Line 1269 of yacc.c */
1963 #line 241 "parse-gram.y"
1964 { add_param ("lex_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1969 /* Line 1269 of yacc.c */
1970 #line 242 "parse-gram.y"
1971 { locations_flag
= true; }
1976 /* Line 1269 of yacc.c */
1977 #line 243 "parse-gram.y"
1978 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
1983 /* Line 1269 of yacc.c */
1984 #line 244 "parse-gram.y"
1985 { no_lines_flag
= true; }
1990 /* Line 1269 of yacc.c */
1991 #line 245 "parse-gram.y"
1992 { nondeterministic_parser
= true; }
1997 /* Line 1269 of yacc.c */
1998 #line 246 "parse-gram.y"
1999 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2004 /* Line 1269 of yacc.c */
2005 #line 247 "parse-gram.y"
2006 { add_param ("parse_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2011 /* Line 1269 of yacc.c */
2012 #line 248 "parse-gram.y"
2013 { pure_parser
= true; }
2018 /* Line 1269 of yacc.c */
2019 #line 249 "parse-gram.y"
2020 { push_parser
= true; }
2025 /* Line 1269 of yacc.c */
2026 #line 250 "parse-gram.y"
2027 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2032 /* Line 1269 of yacc.c */
2033 #line 251 "parse-gram.y"
2034 { skeleton
= (yyvsp
[(2) - (2)].chars
); }
2039 /* Line 1269 of yacc.c */
2040 #line 252 "parse-gram.y"
2041 { token_table_flag
= true; }
2046 /* Line 1269 of yacc.c */
2047 #line 253 "parse-gram.y"
2048 { report_flag
= report_states
; }
2053 /* Line 1269 of yacc.c */
2054 #line 254 "parse-gram.y"
2055 { yacc_flag
= true; }
2060 /* Line 1269 of yacc.c */
2061 #line 262 "parse-gram.y"
2063 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2069 /* Line 1269 of yacc.c */
2070 #line 266 "parse-gram.y"
2073 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2074 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2075 symbol_list_destructor_set (list
, action
, (yylsp
[(2) - (3)]));
2076 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2082 /* Line 1269 of yacc.c */
2083 #line 274 "parse-gram.y"
2086 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2087 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2088 symbol_list_printer_set (list
, action
, (yylsp
[(2) - (3)]));
2089 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2095 /* Line 1269 of yacc.c */
2096 #line 282 "parse-gram.y"
2098 default_prec
= true;
2104 /* Line 1269 of yacc.c */
2105 #line 286 "parse-gram.y"
2107 default_prec
= false;
2113 /* Line 1269 of yacc.c */
2114 #line 289 "parse-gram.y"
2115 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), true); }
2120 /* Line 1269 of yacc.c */
2121 #line 290 "parse-gram.y"
2122 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), false); }
2127 /* Line 1269 of yacc.c */
2128 #line 291 "parse-gram.y"
2129 { muscle_code_grow ("provides", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2134 /* Line 1269 of yacc.c */
2135 #line 292 "parse-gram.y"
2136 { muscle_code_grow ("requires", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2141 /* Line 1269 of yacc.c */
2142 #line 303 "parse-gram.y"
2148 /* Line 1269 of yacc.c */
2149 #line 304 "parse-gram.y"
2150 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2155 /* Line 1269 of yacc.c */
2156 #line 309 "parse-gram.y"
2158 char const *body
= (yyvsp
[(3) - (3)].chars
);
2160 /* Concatenate the %union bodies. If this is the first %union, make sure
2161 the synchronization line appears after the opening '{' so as not to
2162 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2163 into '\n', and omit the new %union's leading '{'. */
2166 muscle_grow ("stype", "{", "");
2170 char *code
= muscle_find ("stype");
2171 code
[strlen (code
) - 1] = '\n';
2176 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2182 /* Line 1269 of yacc.c */
2183 #line 336 "parse-gram.y"
2184 { current_class
= nterm_sym
; }
2189 /* Line 1269 of yacc.c */
2190 #line 337 "parse-gram.y"
2192 current_class
= unknown_sym
;
2193 current_type
= NULL
;
2199 /* Line 1269 of yacc.c */
2200 #line 341 "parse-gram.y"
2201 { current_class
= token_sym
; }
2206 /* Line 1269 of yacc.c */
2207 #line 342 "parse-gram.y"
2209 current_class
= unknown_sym
;
2210 current_type
= NULL
;
2216 /* Line 1269 of yacc.c */
2217 #line 347 "parse-gram.y"
2221 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2222 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2223 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2229 /* Line 1269 of yacc.c */
2230 #line 358 "parse-gram.y"
2234 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2236 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2237 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2239 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2240 current_type
= NULL
;
2246 /* Line 1269 of yacc.c */
2247 #line 372 "parse-gram.y"
2248 { (yyval
.assoc
) = left_assoc
; }
2253 /* Line 1269 of yacc.c */
2254 #line 373 "parse-gram.y"
2255 { (yyval
.assoc
) = right_assoc
; }
2260 /* Line 1269 of yacc.c */
2261 #line 374 "parse-gram.y"
2262 { (yyval
.assoc
) = non_assoc
; }
2267 /* Line 1269 of yacc.c */
2268 #line 378 "parse-gram.y"
2269 { current_type
= NULL
; }
2274 /* Line 1269 of yacc.c */
2275 #line 379 "parse-gram.y"
2276 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2281 /* Line 1269 of yacc.c */
2282 #line 385 "parse-gram.y"
2283 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2288 /* Line 1269 of yacc.c */
2289 #line 387 "parse-gram.y"
2290 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2295 /* Line 1269 of yacc.c */
2296 #line 391 "parse-gram.y"
2297 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2302 /* Line 1269 of yacc.c */
2303 #line 392 "parse-gram.y"
2304 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2309 /* Line 1269 of yacc.c */
2310 #line 396 "parse-gram.y"
2311 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2316 /* Line 1269 of yacc.c */
2317 #line 397 "parse-gram.y"
2318 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2323 /* Line 1269 of yacc.c */
2324 #line 398 "parse-gram.y"
2325 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2330 /* Line 1269 of yacc.c */
2331 #line 399 "parse-gram.y"
2332 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2337 /* Line 1269 of yacc.c */
2338 #line 405 "parse-gram.y"
2340 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2347 /* Line 1269 of yacc.c */
2348 #line 410 "parse-gram.y"
2350 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2351 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2357 /* Line 1269 of yacc.c */
2358 #line 415 "parse-gram.y"
2360 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2361 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2362 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2368 /* Line 1269 of yacc.c */
2369 #line 421 "parse-gram.y"
2371 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2372 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2373 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2379 /* Line 1269 of yacc.c */
2380 #line 427 "parse-gram.y"
2382 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2383 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2384 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2385 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2391 /* Line 1269 of yacc.c */
2392 #line 457 "parse-gram.y"
2400 /* Line 1269 of yacc.c */
2401 #line 463 "parse-gram.y"
2402 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2407 /* Line 1269 of yacc.c */
2408 #line 467 "parse-gram.y"
2409 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2414 /* Line 1269 of yacc.c */
2415 #line 468 "parse-gram.y"
2416 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2421 /* Line 1269 of yacc.c */
2422 #line 474 "parse-gram.y"
2423 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2428 /* Line 1269 of yacc.c */
2429 #line 476 "parse-gram.y"
2430 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2435 /* Line 1269 of yacc.c */
2436 #line 478 "parse-gram.y"
2437 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2442 /* Line 1269 of yacc.c */
2443 #line 480 "parse-gram.y"
2444 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2449 /* Line 1269 of yacc.c */
2450 #line 482 "parse-gram.y"
2451 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2456 /* Line 1269 of yacc.c */
2457 #line 484 "parse-gram.y"
2458 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2463 /* Line 1269 of yacc.c */
2464 #line 500 "parse-gram.y"
2466 static char one
[] = "1";
2467 (yyval
.chars
) = one
;
2473 /* Line 1269 of yacc.c */
2474 #line 510 "parse-gram.y"
2476 (yyvsp
[(1) - (1)].chars
)[strlen ((yyvsp
[(1) - (1)].chars
)) - 1] = '\n';
2477 (yyval
.chars
) = translate_code ((yyvsp
[(1) - (1)].chars
) + 1, (yylsp
[(1) - (1)]));
2483 /* Line 1269 of yacc.c */
2484 #line 526 "parse-gram.y"
2485 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2490 /* Line 1269 of yacc.c */
2491 #line 528 "parse-gram.y"
2493 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2494 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2495 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2501 /* Line 1269 of yacc.c */
2502 #line 536 "parse-gram.y"
2503 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2508 /* Line 1269 of yacc.c */
2509 #line 548 "parse-gram.y"
2511 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2512 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2518 /* Line 1269 of yacc.c */
2519 #line 557 "parse-gram.y"
2521 muscle_code_grow ("epilogue", translate_code ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
2522 gram_scanner_last_string_free ();
2528 /* Line 1269 of yacc.c */
2529 #line 2530 "parse-gram.c"
2532 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2536 YY_STACK_PRINT (yyss
, yyssp
);
2541 /* Now `shift' the result of the reduction. Determine what state
2542 that goes to, based on the state we popped back to and the rule
2543 number reduced by. */
2547 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2548 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2549 yystate
= yytable
[yystate
];
2551 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2556 /*------------------------------------.
2557 | yyerrlab -- here on detecting error |
2558 `------------------------------------*/
2560 /* If not already recovering from an error, report this error. */
2564 #if ! YYERROR_VERBOSE
2565 yyerror (YY_("syntax error"));
2568 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2569 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2571 YYSIZE_T yyalloc
= 2 * yysize
;
2572 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2573 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2574 if (yymsg
!= yymsgbuf
)
2575 YYSTACK_FREE (yymsg
);
2576 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2578 yymsg_alloc
= yyalloc
;
2582 yymsg_alloc
= sizeof yymsgbuf
;
2586 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2588 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2593 yyerror (YY_("syntax error"));
2595 goto yyexhaustedlab
;
2601 yyerror_range
[0] = yylloc
;
2603 if (yyerrstatus
== 3)
2605 /* If just tried and failed to reuse lookahead token after an
2606 error, discard it. */
2608 if (yychar
<= YYEOF
)
2610 /* Return failure if at end of input. */
2611 if (yychar
== YYEOF
)
2616 yydestruct ("Error: discarding",
2617 yytoken
, &yylval
, &yylloc
);
2622 /* Else will try to reuse lookahead token after shifting the error
2627 /*---------------------------------------------------.
2628 | yyerrorlab -- error raised explicitly by YYERROR. |
2629 `---------------------------------------------------*/
2632 /* Pacify compilers like GCC when the user code never invokes
2633 YYERROR and the label yyerrorlab therefore never appears in user
2635 if (/*CONSTCOND*/ 0)
2638 yyerror_range
[0] = yylsp
[1-yylen
];
2639 /* Do not reclaim the symbols of the rule which action triggered
2643 YY_STACK_PRINT (yyss
, yyssp
);
2648 /*-------------------------------------------------------------.
2649 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2650 `-------------------------------------------------------------*/
2652 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2656 yyn
= yypact
[yystate
];
2657 if (yyn
!= YYPACT_NINF
)
2660 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2668 /* Pop the current state because it cannot handle the error token. */
2672 yyerror_range
[0] = *yylsp
;
2673 yydestruct ("Error: popping",
2674 yystos
[yystate
], yyvsp
, yylsp
);
2677 YY_STACK_PRINT (yyss
, yyssp
);
2682 yyerror_range
[1] = yylloc
;
2683 /* Using YYLLOC is tempting, but would change the location of
2684 the lookahead. YYLOC is available though. */
2685 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2688 /* Shift the error token. */
2689 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2695 /*-------------------------------------.
2696 | yyacceptlab -- YYACCEPT comes here. |
2697 `-------------------------------------*/
2702 /*-----------------------------------.
2703 | yyabortlab -- YYABORT comes here. |
2704 `-----------------------------------*/
2710 /*-------------------------------------------------.
2711 | yyexhaustedlab -- memory exhaustion comes here. |
2712 `-------------------------------------------------*/
2714 yyerror (YY_("memory exhausted"));
2720 if (yychar
!= YYEMPTY
)
2721 yydestruct ("Cleanup: discarding lookahead",
2722 yytoken
, &yylval
, &yylloc
);
2723 /* Do not reclaim the symbols of the rule which action triggered
2724 this YYABORT or YYACCEPT. */
2726 YY_STACK_PRINT (yyss
, yyssp
);
2727 while (yyssp
!= yyss
)
2729 yydestruct ("Cleanup: popping",
2730 yystos
[*yyssp
], yyvsp
, yylsp
);
2735 YYSTACK_FREE (yyss
);
2738 if (yymsg
!= yymsgbuf
)
2739 YYSTACK_FREE (yymsg
);
2741 /* Make sure YYID is used. */
2742 return YYID (yyresult
);
2747 /* Line 1486 of yacc.c */
2748 #line 563 "parse-gram.y"
2752 /* Return the location of the left-hand side of a rule whose
2753 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2754 the right-hand side, and return an empty location equal to the end
2755 boundary of RHS[0] if the right-hand side is empty. */
2758 lloc_default (YYLTYPE
const *rhs
, int n
)
2763 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2764 The bug is fixed in 7.4.2m, but play it safe for now. */
2765 loc
.start
= rhs
[n
].end
;
2766 loc
.end
= rhs
[n
].end
;
2768 /* Ignore empty nonterminals the start of the the right-hand side.
2769 Do not bother to ignore them at the end of the right-hand side,
2770 since empty nonterminals have the same end as their predecessors. */
2771 for (i
= 1; i
<= n
; i
++)
2772 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2774 loc
.start
= rhs
[i
].start
;
2782 /* Add a lex-param or a parse-param (depending on TYPE) with
2783 declaration DECL and location LOC. */
2786 add_param (char const *type
, char *decl
, location loc
)
2788 static char const alphanum
[26 + 26 + 1 + 10] =
2789 "abcdefghijklmnopqrstuvwxyz"
2790 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2793 char const *name_start
= NULL
;
2796 /* Stop on last actual character. */
2797 for (p
= decl
; p
[1]; p
++)
2799 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2800 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2803 /* Strip the surrounding '{' and '}', and any blanks just inside
2805 while (*--p
== ' ' || *p
== '\t')
2808 while (*++decl
== ' ' || *decl
== '\t')
2812 complain_at (loc
, _("missing identifier in parameter declaration"));
2819 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2823 name
= xmalloc (name_len
+ 1);
2824 memcpy (name
, name_start
, name_len
);
2825 name
[name_len
] = '\0';
2826 muscle_pair_list_grow (type
, decl
, name
);
2830 gram_scanner_last_string_free ();
2835 version_check (location
const *loc
, char const *version
)
2837 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2839 complain_at (*loc
, "require bison %s, but have %s",
2840 version
, PACKAGE_VERSION
);
2846 gram_error (location
const *loc
, char const *msg
)
2848 complain_at (*loc
, "%s", msg
);
2852 token_name (int type
)
2854 return yytname
[YYTRANSLATE (type
)];
2865 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2866 return quotearg_style (escape_quoting_style
, buf
);