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 97 "parse-gram.y"
319 unsigned char character
;
322 /* Line 198 of yacc.c */
323 #line 324 "parse-gram.c"
325 # define YYSTYPE_IS_TRIVIAL 1
326 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
327 # define YYSTYPE_IS_DECLARED 1
330 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
331 typedef struct YYLTYPE
338 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
339 # define YYLTYPE_IS_DECLARED 1
340 # define YYLTYPE_IS_TRIVIAL 1
344 /* Copy the second part of user declarations. */
347 /* Line 221 of yacc.c */
348 #line 349 "parse-gram.c"
355 typedef YYTYPE_UINT8 yytype_uint8
;
357 typedef unsigned char yytype_uint8
;
361 typedef YYTYPE_INT8 yytype_int8
;
362 #elif (defined __STDC__ || defined __C99__FUNC__ \
363 || defined __cplusplus || defined _MSC_VER)
364 typedef signed char yytype_int8
;
366 typedef short int yytype_int8
;
370 typedef YYTYPE_UINT16 yytype_uint16
;
372 typedef unsigned short int yytype_uint16
;
376 typedef YYTYPE_INT16 yytype_int16
;
378 typedef short int yytype_int16
;
382 # ifdef __SIZE_TYPE__
383 # define YYSIZE_T __SIZE_TYPE__
384 # elif defined size_t
385 # define YYSIZE_T size_t
386 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
387 || defined __cplusplus || defined _MSC_VER)
388 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
389 # define YYSIZE_T size_t
391 # define YYSIZE_T unsigned int
395 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
400 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
401 # define YY_(msgid) dgettext ("bison-runtime", msgid)
405 # define YY_(msgid) msgid
409 /* Suppress unused-variable warnings by "using" E. */
410 #if ! defined lint || defined __GNUC__
411 # define YYUSE(e) ((void) (e))
413 # define YYUSE(e) /* empty */
416 /* Identity function, used to suppress warnings about constant conditions. */
420 #if (defined __STDC__ || defined __C99__FUNC__ \
421 || defined __cplusplus || defined _MSC_VER)
434 #if ! defined yyoverflow || YYERROR_VERBOSE
436 /* The parser invokes alloca or malloc; define the necessary symbols. */
438 # ifdef YYSTACK_USE_ALLOCA
439 # if YYSTACK_USE_ALLOCA
441 # define YYSTACK_ALLOC __builtin_alloca
442 # elif defined __BUILTIN_VA_ARG_INCR
443 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
445 # define YYSTACK_ALLOC __alloca
446 # elif defined _MSC_VER
447 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
448 # define alloca _alloca
450 # define YYSTACK_ALLOC alloca
451 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
452 || defined __cplusplus || defined _MSC_VER)
453 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
462 # ifdef YYSTACK_ALLOC
463 /* Pacify GCC's `empty if-body' warning. */
464 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
465 # ifndef YYSTACK_ALLOC_MAXIMUM
466 /* The OS might guarantee only one guard page at the bottom of the stack,
467 and a page size can be as small as 4096 bytes. So we cannot safely
468 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
469 to allow for a few compiler-allocated temporary stack slots. */
470 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
473 # define YYSTACK_ALLOC YYMALLOC
474 # define YYSTACK_FREE YYFREE
475 # ifndef YYSTACK_ALLOC_MAXIMUM
476 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
478 # if (defined __cplusplus && ! defined _STDLIB_H \
479 && ! ((defined YYMALLOC || defined malloc) \
480 && (defined YYFREE || defined free)))
481 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
487 # define YYMALLOC malloc
488 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
489 || defined __cplusplus || defined _MSC_VER)
490 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
495 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
496 || defined __cplusplus || defined _MSC_VER)
497 void free (void *); /* INFRINGES ON USER NAME SPACE */
501 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
504 #if (! defined yyoverflow \
505 && (! defined __cplusplus \
506 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
507 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
509 /* A type that is properly aligned for any stack member. */
517 /* The size of the maximum gap between one aligned stack and the next. */
518 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
520 /* The size of an array large to enough to hold all stacks, each with
522 # define YYSTACK_BYTES(N) \
523 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
524 + 2 * YYSTACK_GAP_MAXIMUM)
526 /* Copy COUNT objects from FROM to TO. The source and destination do
529 # if defined __GNUC__ && 1 < __GNUC__
530 # define YYCOPY(To, From, Count) \
531 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
533 # define YYCOPY(To, From, Count) \
537 for (yyi = 0; yyi < (Count); yyi++) \
538 (To)[yyi] = (From)[yyi]; \
544 /* Relocate STACK from its old location to the new one. The
545 local variables YYSIZE and YYSTACKSIZE give the old and new number of
546 elements in the stack, and YYPTR gives the new location of the
547 stack. Advance YYPTR to a properly aligned location for the next
549 # define YYSTACK_RELOCATE(Stack) \
552 YYSIZE_T yynewbytes; \
553 YYCOPY (&yyptr->Stack, Stack, yysize); \
554 Stack = &yyptr->Stack; \
555 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
556 yyptr += yynewbytes / sizeof (*yyptr); \
562 /* YYFINAL -- State number of the termination state. */
564 /* YYLAST -- Last index in YYTABLE. */
567 /* YYNTOKENS -- Number of terminals. */
569 /* YYNNTS -- Number of nonterminals. */
571 /* YYNRULES -- Number of rules. */
573 /* YYNRULES -- Number of states. */
574 #define YYNSTATES 138
576 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
578 #define YYMAXUTOK 314
580 #define YYTRANSLATE(YYX) \
581 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
583 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
584 static const yytype_uint8 yytranslate
[] =
586 0, 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, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
612 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
613 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
614 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
615 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
616 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
621 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
623 static const yytype_uint8 yyprhs
[] =
625 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
626 24, 26, 29, 32, 36, 38, 41, 44, 46, 50,
627 52, 54, 58, 61, 63, 65, 68, 71, 73, 75,
628 77, 79, 81, 83, 86, 90, 94, 96, 98, 101,
629 104, 107, 110, 111, 113, 117, 118, 122, 123, 127,
630 131, 135, 137, 139, 141, 142, 144, 146, 149, 151,
631 154, 156, 158, 160, 162, 164, 166, 169, 172, 176,
632 178, 181, 183, 186, 188, 191, 194, 195, 199, 201,
633 205, 208, 209, 212, 215, 219, 223, 227, 229, 231,
634 232, 234, 236, 238, 240, 242, 244, 246, 248, 249
637 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
638 static const yytype_int8 yyrhs
[] =
640 61, 0, -1, 62, 52, 77, 90, -1, -1, 62,
641 63, -1, 64, -1, 54, -1, 18, -1, 20, 3,
642 84, -1, 21, -1, 22, -1, 23, 4, -1, 24,
643 4, -1, 25, 49, 3, -1, 26, -1, 27, 46,
644 -1, 28, 46, -1, 29, -1, 30, 49, 3, -1,
645 32, -1, 33, -1, 34, 49, 3, -1, 35, 46,
646 -1, 37, -1, 38, -1, 39, 3, -1, 41, 3,
647 -1, 43, -1, 44, -1, 45, -1, 55, -1, 69,
648 -1, 66, -1, 42, 88, -1, 8, 46, 73, -1,
649 9, 46, 73, -1, 19, -1, 31, -1, 16, 85,
650 -1, 17, 85, -1, 36, 85, -1, 40, 85, -1,
651 -1, 50, -1, 59, 65, 46, -1, -1, 6, 67,
652 76, -1, -1, 5, 68, 76, -1, 7, 56, 72,
653 -1, 70, 71, 72, -1, 10, -1, 11, -1, 12,
654 -1, -1, 56, -1, 88, -1, 72, 88, -1, 74,
655 -1, 73, 74, -1, 88, -1, 56, -1, 57, -1,
656 58, -1, 56, -1, 86, -1, 86, 4, -1, 86,
657 89, -1, 86, 4, 89, -1, 75, -1, 76, 75,
658 -1, 78, -1, 77, 78, -1, 79, -1, 64, 55,
659 -1, 1, 55, -1, -1, 87, 80, 81, -1, 82,
660 -1, 81, 53, 82, -1, 81, 55, -1, -1, 82,
661 88, -1, 82, 46, -1, 82, 13, 88, -1, 82,
662 14, 4, -1, 82, 15, 56, -1, 3, -1, 85,
663 -1, -1, 83, -1, 46, -1, 50, -1, 47, -1,
664 51, -1, 86, -1, 89, -1, 3, -1, -1, 52,
668 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
669 static const yytype_uint16 yyrline
[] =
671 0, 210, 210, 218, 220, 224, 225, 226, 227, 228,
672 229, 230, 231, 232, 233, 238, 242, 243, 244, 245,
673 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
674 256, 260, 261, 262, 266, 274, 282, 286, 290, 291,
675 292, 293, 304, 305, 309, 337, 337, 342, 342, 347,
676 358, 373, 374, 375, 379, 380, 385, 387, 392, 393,
677 397, 398, 399, 400, 405, 410, 415, 421, 427, 438,
678 439, 448, 449, 455, 456, 457, 464, 464, 468, 469,
679 470, 475, 476, 478, 480, 482, 484, 494, 495, 501,
680 505, 510, 526, 528, 537, 542, 543, 548, 555, 557
684 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
685 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
686 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
687 static const char *const yytname
[] =
689 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
690 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
691 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
692 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%code-top\"", "\"%debug\"",
693 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
694 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
695 "\"%initial-action\"", "\"%lex-param\"", "\"%locations\"",
696 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
697 "\"%nondeterministic-parser\"", "\"%output\"", "\"%parse-param\"",
698 "\"%provides\"", "\"%pure-parser\"", "\"%push-parser\"", "\"%require\"",
699 "\"%requires\"", "\"%skeleton\"", "\"%start\"", "\"%token-table\"",
700 "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"",
701 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
702 "\"%{...%}\"", "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"",
703 "$accept", "input", "prologue_declarations", "prologue_declaration",
704 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
705 "precedence_declaration", "precedence_declarator", "type.opt",
706 "symbols.1", "generic_symlist", "generic_symlist_item", "symbol_def",
707 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
708 "$@3", "rhses.1", "rhs", "content", "content.opt", "braceless", "id",
709 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
714 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
716 static const yytype_uint16 yytoknum
[] =
718 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
719 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
720 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
721 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
722 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
723 305, 306, 307, 308, 309, 310, 311, 312, 313, 314
727 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
728 static const yytype_uint8 yyr1
[] =
730 0, 60, 61, 62, 62, 63, 63, 63, 63, 63,
731 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
732 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
733 63, 64, 64, 64, 64, 64, 64, 64, 64, 64,
734 64, 64, 65, 65, 64, 67, 66, 68, 66, 66,
735 69, 70, 70, 70, 71, 71, 72, 72, 73, 73,
736 74, 74, 74, 74, 75, 75, 75, 75, 75, 76,
737 76, 77, 77, 78, 78, 78, 80, 79, 81, 81,
738 81, 82, 82, 82, 82, 82, 82, 83, 83, 84,
739 84, 85, 86, 86, 87, 88, 88, 89, 90, 90
742 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
743 static const yytype_uint8 yyr2
[] =
745 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
746 1, 2, 2, 3, 1, 2, 2, 1, 3, 1,
747 1, 3, 2, 1, 1, 2, 2, 1, 1, 1,
748 1, 1, 1, 2, 3, 3, 1, 1, 2, 2,
749 2, 2, 0, 1, 3, 0, 3, 0, 3, 3,
750 3, 1, 1, 1, 0, 1, 1, 2, 1, 2,
751 1, 1, 1, 1, 1, 1, 2, 2, 3, 1,
752 2, 1, 2, 1, 2, 2, 0, 3, 1, 3,
753 2, 0, 2, 2, 3, 3, 3, 1, 1, 0,
754 1, 1, 1, 1, 1, 1, 1, 1, 0, 2
757 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
758 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
759 means the default is an error. */
760 static const yytype_uint8 yydefact
[] =
762 3, 0, 0, 1, 47, 45, 0, 0, 0, 51,
763 52, 53, 0, 0, 7, 36, 0, 9, 10, 0,
764 0, 0, 14, 0, 0, 17, 0, 37, 19, 20,
765 0, 0, 0, 23, 24, 0, 0, 0, 0, 27,
766 28, 29, 0, 6, 30, 42, 4, 5, 32, 31,
767 54, 0, 0, 0, 0, 0, 91, 38, 39, 89,
768 11, 12, 0, 15, 16, 0, 0, 22, 40, 25,
769 41, 26, 97, 93, 92, 95, 33, 96, 0, 94,
770 0, 0, 71, 73, 76, 43, 0, 55, 0, 64,
771 69, 48, 65, 46, 49, 56, 61, 62, 63, 34,
772 58, 60, 35, 87, 90, 8, 88, 13, 18, 21,
773 75, 74, 0, 72, 2, 81, 44, 50, 70, 66,
774 67, 57, 59, 99, 77, 78, 68, 81, 80, 0,
775 0, 0, 83, 82, 79, 84, 85, 86
778 /* YYDEFGOTO[NTERM-NUM]. */
779 static const yytype_int8 yydefgoto
[] =
781 -1, 1, 2, 46, 80, 86, 48, 52, 51, 49,
782 50, 88, 94, 99, 100, 90, 91, 81, 82, 83,
783 115, 124, 125, 104, 105, 57, 75, 84, 101, 77,
787 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
789 #define YYPACT_NINF -89
790 static const yytype_int16 yypact
[] =
792 -89, 14, 112, -89, -89, -89, -33, -16, -11, -89,
793 -89, -89, -6, -6, -89, -89, 39, -89, -89, 42,
794 43, 5, -89, 9, 11, -89, 10, -89, -89, -89,
795 12, 24, -6, -89, -89, 48, -6, 68, 30, -89,
796 -89, -89, 57, -89, -89, 28, -89, -89, -89, -89,
797 29, -31, -31, 30, 25, 25, -89, -89, -89, 2,
798 -89, -89, 86, -89, -89, 87, 89, -89, -89, -89,
799 -89, -89, -89, -89, -89, -89, -89, -89, 40, -89,
800 45, 1, -89, -89, -89, -89, 52, -89, 30, -89,
801 -89, -31, 35, -31, 30, -89, -89, -89, -89, 25,
802 -89, -89, 25, -89, -89, -89, -89, -89, -89, -89,
803 -89, -89, 46, -89, -89, -89, -89, 30, -89, 98,
804 -89, -89, -89, -89, -26, 155, -89, -89, -89, 30,
805 99, 49, -89, -89, 155, -89, -89, -89
808 /* YYPGOTO[NTERM-NUM]. */
809 static const yytype_int8 yypgoto
[] =
811 -89, -89, -89, -89, 100, -89, -89, -89, -89, -89,
812 -89, -89, 16, 51, -78, -57, 55, -89, 31, -89,
813 -89, -89, -18, -89, -89, -10, -7, -89, -38, -88,
817 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
818 positive, shift that token. If negative, reduce the rule which
819 number is the opposite. If zero, do what YYDEFACT says.
820 If YYTABLE_NINF, syntax error. */
821 #define YYTABLE_NINF -99
822 static const yytype_int16 yytable
[] =
824 76, -98, 78, 58, 120, 103, 4, 5, 6, 7,
825 8, 9, 10, 11, 3, 95, 73, 12, 13, 74,
826 15, 122, 68, 53, 122, 89, 70, 127, 72, 128,
827 54, 126, 27, 72, 118, 55, 118, 32, 72, 119,
828 56, 36, 59, 38, 92, 92, 60, 61, 56, 106,
829 95, 69, 79, 112, 62, 63, 121, 64, 78, 65,
830 45, 66, 4, 5, 6, 7, 8, 9, 10, 11,
831 67, 71, 73, 12, 13, 74, 15, 73, 85, 121,
832 74, 96, 97, 98, 92, 87, 92, 133, 27, 107,
833 108, 135, 109, 32, 123, 110, 133, 36, 116, 38,
834 111, 72, 47, 136, 117, 137, 102, 93, 79, 134,
835 0, 0, 113, 0, 0, 0, 45, 4, 5, 6,
836 7, 8, 9, 10, 11, 0, 0, 0, 12, 13,
837 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
838 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
839 34, 35, 36, 37, 38, 39, 40, 41, 72, 0,
840 0, 0, 0, 0, 42, 0, 43, 44, 129, 130,
841 131, 45, 0, 0, 0, 0, 0, 0, 0, 0,
842 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
843 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
847 static const yytype_int16 yycheck
[] =
849 38, 0, 1, 13, 92, 3, 5, 6, 7, 8,
850 9, 10, 11, 12, 0, 53, 47, 16, 17, 50,
851 19, 99, 32, 56, 102, 56, 36, 53, 3, 55,
852 46, 119, 31, 3, 91, 46, 93, 36, 3, 4,
853 46, 40, 3, 42, 51, 52, 4, 4, 46, 59,
854 88, 3, 51, 52, 49, 46, 94, 46, 1, 49,
855 59, 49, 5, 6, 7, 8, 9, 10, 11, 12,
856 46, 3, 47, 16, 17, 50, 19, 47, 50, 117,
857 50, 56, 57, 58, 91, 56, 93, 125, 31, 3,
858 3, 129, 3, 36, 48, 55, 134, 40, 46, 42,
859 55, 3, 2, 4, 88, 56, 55, 52, 51, 127,
860 -1, -1, 81, -1, -1, -1, 59, 5, 6, 7,
861 8, 9, 10, 11, 12, -1, -1, -1, 16, 17,
862 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
863 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
864 38, 39, 40, 41, 42, 43, 44, 45, 3, -1,
865 -1, -1, -1, -1, 52, -1, 54, 55, 13, 14,
866 15, 59, -1, -1, -1, -1, -1, -1, -1, -1,
867 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
868 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
869 -1, 46, 47, -1, -1, 50
872 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
873 symbol of state STATE-NUM. */
874 static const yytype_uint8 yystos
[] =
876 0, 61, 62, 0, 5, 6, 7, 8, 9, 10,
877 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
878 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
879 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
880 44, 45, 52, 54, 55, 59, 63, 64, 66, 69,
881 70, 68, 67, 56, 46, 46, 46, 85, 85, 3,
882 4, 4, 49, 46, 46, 49, 49, 46, 85, 3,
883 85, 3, 3, 47, 50, 86, 88, 89, 1, 51,
884 64, 77, 78, 79, 87, 50, 65, 56, 71, 56,
885 75, 76, 86, 76, 72, 88, 56, 57, 58, 73,
886 74, 88, 73, 3, 83, 84, 85, 3, 3, 3,
887 55, 55, 52, 78, 90, 80, 46, 72, 75, 4,
888 89, 88, 74, 48, 81, 82, 89, 53, 55, 13,
889 14, 15, 46, 88, 82, 88, 4, 56
892 #define yyerrok (yyerrstatus = 0)
893 #define yyclearin (yychar = YYEMPTY)
897 #define YYACCEPT goto yyacceptlab
898 #define YYABORT goto yyabortlab
899 #define YYERROR goto yyerrorlab
902 /* Like YYERROR except do call yyerror. This remains here temporarily
903 to ease the transition to the new meaning of YYERROR, for GCC.
904 Once GCC version 2 has supplanted version 1, this can go. */
906 #define YYFAIL goto yyerrlab
908 #define YYRECOVERING() (!!yyerrstatus)
910 #define YYBACKUP(Token, Value) \
912 if (yychar == YYEMPTY && yylen == 1) \
916 yytoken = YYTRANSLATE (yychar); \
922 yyerror (YY_("syntax error: cannot back up")); \
929 #define YYERRCODE 256
932 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
933 If N is 0, then set CURRENT to the empty location which ends
934 the previous symbol: RHS[0] (always defined). */
936 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
937 #ifndef YYLLOC_DEFAULT
938 # define YYLLOC_DEFAULT(Current, Rhs, N) \
942 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
943 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
944 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
945 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
949 (Current).first_line = (Current).last_line = \
950 YYRHSLOC (Rhs, 0).last_line; \
951 (Current).first_column = (Current).last_column = \
952 YYRHSLOC (Rhs, 0).last_column; \
958 /* YY_LOCATION_PRINT -- Print the location on the stream.
959 This macro was not mandated originally: define only if we know
960 we won't break user code: when these are the locations we know. */
962 #ifndef YY_LOCATION_PRINT
963 # if YYLTYPE_IS_TRIVIAL
964 # define YY_LOCATION_PRINT(File, Loc) \
965 fprintf (File, "%d.%d-%d.%d", \
966 (Loc).first_line, (Loc).first_column, \
967 (Loc).last_line, (Loc).last_column)
969 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
974 /* YYLEX -- calling `yylex' with the right arguments. */
977 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
979 # define YYLEX yylex (&yylval, &yylloc)
982 /* Enable debugging if requested. */
986 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
987 # define YYFPRINTF fprintf
990 # define YYDPRINTF(Args) \
996 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1000 YYFPRINTF (stderr, "%s ", Title); \
1001 yy_symbol_print (stderr, \
1002 Type, Value, Location); \
1003 YYFPRINTF (stderr, "\n"); \
1008 /*--------------------------------.
1009 | Print this symbol on YYOUTPUT. |
1010 `--------------------------------*/
1013 #if (defined __STDC__ || defined __C99__FUNC__ \
1014 || defined __cplusplus || defined _MSC_VER)
1016 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1019 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1022 YYSTYPE
const * const yyvaluep
;
1023 YYLTYPE
const * const yylocationp
;
1028 YYUSE (yylocationp
);
1030 if (yytype
< YYNTOKENS
)
1031 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1037 case 3: /* "\"string\"" */
1039 /* Line 670 of yacc.c */
1040 #line 188 "parse-gram.y"
1041 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1043 /* Line 670 of yacc.c */
1044 #line 1045 "parse-gram.c"
1046 case 4: /* "\"integer\"" */
1048 /* Line 670 of yacc.c */
1049 #line 199 "parse-gram.y"
1050 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1052 /* Line 670 of yacc.c */
1053 #line 1054 "parse-gram.c"
1055 case 46: /* "\"{...}\"" */
1057 /* Line 670 of yacc.c */
1058 #line 190 "parse-gram.y"
1059 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1061 /* Line 670 of yacc.c */
1062 #line 1063 "parse-gram.c"
1064 case 47: /* "\"char\"" */
1066 /* Line 670 of yacc.c */
1067 #line 182 "parse-gram.y"
1068 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1070 /* Line 670 of yacc.c */
1071 #line 1072 "parse-gram.c"
1073 case 48: /* "\"epilogue\"" */
1075 /* Line 670 of yacc.c */
1076 #line 190 "parse-gram.y"
1077 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1079 /* Line 670 of yacc.c */
1080 #line 1081 "parse-gram.c"
1082 case 50: /* "\"identifier\"" */
1084 /* Line 670 of yacc.c */
1085 #line 195 "parse-gram.y"
1086 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1088 /* Line 670 of yacc.c */
1089 #line 1090 "parse-gram.c"
1091 case 51: /* "\"identifier:\"" */
1093 /* Line 670 of yacc.c */
1094 #line 196 "parse-gram.y"
1095 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1097 /* Line 670 of yacc.c */
1098 #line 1099 "parse-gram.c"
1100 case 54: /* "\"%{...%}\"" */
1102 /* Line 670 of yacc.c */
1103 #line 190 "parse-gram.y"
1104 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1106 /* Line 670 of yacc.c */
1107 #line 1108 "parse-gram.c"
1109 case 56: /* "\"type\"" */
1111 /* Line 670 of yacc.c */
1112 #line 194 "parse-gram.y"
1113 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1115 /* Line 670 of yacc.c */
1116 #line 1117 "parse-gram.c"
1118 case 83: /* "content" */
1120 /* Line 670 of yacc.c */
1121 #line 190 "parse-gram.y"
1122 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1124 /* Line 670 of yacc.c */
1125 #line 1126 "parse-gram.c"
1127 case 84: /* "content.opt" */
1129 /* Line 670 of yacc.c */
1130 #line 190 "parse-gram.y"
1131 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1133 /* Line 670 of yacc.c */
1134 #line 1135 "parse-gram.c"
1136 case 85: /* "braceless" */
1138 /* Line 670 of yacc.c */
1139 #line 190 "parse-gram.y"
1140 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1142 /* Line 670 of yacc.c */
1143 #line 1144 "parse-gram.c"
1147 /* Line 670 of yacc.c */
1148 #line 202 "parse-gram.y"
1149 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1151 /* Line 670 of yacc.c */
1152 #line 1153 "parse-gram.c"
1154 case 87: /* "id_colon" */
1156 /* Line 670 of yacc.c */
1157 #line 203 "parse-gram.y"
1158 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1160 /* Line 670 of yacc.c */
1161 #line 1162 "parse-gram.c"
1163 case 88: /* "symbol" */
1165 /* Line 670 of yacc.c */
1166 #line 202 "parse-gram.y"
1167 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1169 /* Line 670 of yacc.c */
1170 #line 1171 "parse-gram.c"
1172 case 89: /* "string_as_id" */
1174 /* Line 670 of yacc.c */
1175 #line 202 "parse-gram.y"
1176 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1178 /* Line 670 of yacc.c */
1179 #line 1180 "parse-gram.c"
1187 /*--------------------------------.
1188 | Print this symbol on YYOUTPUT. |
1189 `--------------------------------*/
1191 #if (defined __STDC__ || defined __C99__FUNC__ \
1192 || defined __cplusplus || defined _MSC_VER)
1194 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1197 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1200 YYSTYPE
const * const yyvaluep
;
1201 YYLTYPE
const * const yylocationp
;
1204 if (yytype
< YYNTOKENS
)
1205 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1207 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1209 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1210 YYFPRINTF (yyoutput
, ": ");
1211 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1212 YYFPRINTF (yyoutput
, ")");
1215 /*------------------------------------------------------------------.
1216 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1218 `------------------------------------------------------------------*/
1220 #if (defined __STDC__ || defined __C99__FUNC__ \
1221 || defined __cplusplus || defined _MSC_VER)
1223 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1226 yy_stack_print (yybottom
, yytop
)
1227 yytype_int16
*yybottom
;
1228 yytype_int16
*yytop
;
1231 YYFPRINTF (stderr
, "Stack now");
1232 for (; yybottom
<= yytop
; yybottom
++)
1234 int yybot
= *yybottom
;
1235 YYFPRINTF (stderr
, " %d", yybot
);
1237 YYFPRINTF (stderr
, "\n");
1240 # define YY_STACK_PRINT(Bottom, Top) \
1243 yy_stack_print ((Bottom), (Top)); \
1247 /*------------------------------------------------.
1248 | Report that the YYRULE is going to be reduced. |
1249 `------------------------------------------------*/
1251 #if (defined __STDC__ || defined __C99__FUNC__ \
1252 || defined __cplusplus || defined _MSC_VER)
1254 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1257 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1263 int yynrhs
= yyr2
[yyrule
];
1265 unsigned long int yylno
= yyrline
[yyrule
];
1266 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1268 /* The symbols being reduced. */
1269 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1271 fprintf (stderr
, " $%d = ", yyi
+ 1);
1272 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1273 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1274 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1275 fprintf (stderr
, "\n");
1279 # define YY_REDUCE_PRINT(Rule) \
1282 yy_reduce_print (yyvsp, yylsp, Rule); \
1285 /* Nonzero means print parse trace. It is left uninitialized so that
1286 multiple parsers can coexist. */
1288 #else /* !YYDEBUG */
1289 # define YYDPRINTF(Args)
1290 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1291 # define YY_STACK_PRINT(Bottom, Top)
1292 # define YY_REDUCE_PRINT(Rule)
1293 #endif /* !YYDEBUG */
1296 /* YYINITDEPTH -- initial size of the parser's stacks. */
1298 # define YYINITDEPTH 200
1301 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1302 if the built-in stack extension method is used).
1304 Do not make this value too large; the results are undefined if
1305 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1306 evaluated with infinite-precision integer arithmetic. */
1309 # define YYMAXDEPTH 10000
1317 # if defined __GLIBC__ && defined _STRING_H
1318 # define yystrlen strlen
1320 /* Return the length of YYSTR. */
1321 #if (defined __STDC__ || defined __C99__FUNC__ \
1322 || defined __cplusplus || defined _MSC_VER)
1324 yystrlen (const char *yystr
)
1332 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1340 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1341 # define yystpcpy stpcpy
1343 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1345 #if (defined __STDC__ || defined __C99__FUNC__ \
1346 || defined __cplusplus || defined _MSC_VER)
1348 yystpcpy (char *yydest
, const char *yysrc
)
1351 yystpcpy (yydest
, yysrc
)
1357 const char *yys
= yysrc
;
1359 while ((*yyd
++ = *yys
++) != '\0')
1368 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1369 quotes and backslashes, so that it's suitable for yyerror. The
1370 heuristic is that double-quoting is unnecessary unless the string
1371 contains an apostrophe, a comma, or backslash (other than
1372 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1373 null, do not copy; instead, return the length of what the result
1376 yytnamerr (char *yyres
, const char *yystr
)
1381 char const *yyp
= yystr
;
1388 goto do_not_strip_quotes
;
1392 goto do_not_strip_quotes
;
1405 do_not_strip_quotes
: ;
1409 return yystrlen (yystr
);
1411 return yystpcpy (yyres
, yystr
) - yyres
;
1415 /* Copy into YYRESULT an error message about the unexpected token
1416 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1417 including the terminating null byte. If YYRESULT is null, do not
1418 copy anything; just return the number of bytes that would be
1419 copied. As a special case, return 0 if an ordinary "syntax error"
1420 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1421 size calculation. */
1423 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1425 int yyn
= yypact
[yystate
];
1427 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1431 int yytype
= YYTRANSLATE (yychar
);
1432 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1433 YYSIZE_T yysize
= yysize0
;
1435 int yysize_overflow
= 0;
1436 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1437 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1441 /* This is so xgettext sees the translatable formats that are
1442 constructed on the fly. */
1443 YY_("syntax error, unexpected %s");
1444 YY_("syntax error, unexpected %s, expecting %s");
1445 YY_("syntax error, unexpected %s, expecting %s or %s");
1446 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1447 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1451 static char const yyunexpected
[] = "syntax error, unexpected %s";
1452 static char const yyexpecting
[] = ", expecting %s";
1453 static char const yyor
[] = " or %s";
1454 char yyformat
[sizeof yyunexpected
1455 + sizeof yyexpecting
- 1
1456 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1457 * (sizeof yyor
- 1))];
1458 char const *yyprefix
= yyexpecting
;
1460 /* Start YYX at -YYN if negative to avoid negative indexes in
1462 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1464 /* Stay within bounds of both yycheck and yytname. */
1465 int yychecklim
= YYLAST
- yyn
+ 1;
1466 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1469 yyarg
[0] = yytname
[yytype
];
1470 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1472 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1473 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1475 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1479 yyformat
[sizeof yyunexpected
- 1] = '\0';
1482 yyarg
[yycount
++] = yytname
[yyx
];
1483 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1484 yysize_overflow
|= (yysize1
< yysize
);
1486 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1490 yyf
= YY_(yyformat
);
1491 yysize1
= yysize
+ yystrlen (yyf
);
1492 yysize_overflow
|= (yysize1
< yysize
);
1495 if (yysize_overflow
)
1496 return YYSIZE_MAXIMUM
;
1500 /* Avoid sprintf, as that infringes on the user's name space.
1501 Don't have undefined behavior even if the translation
1502 produced a string with the wrong number of "%s"s. */
1503 char *yyp
= yyresult
;
1505 while ((*yyp
= *yyf
) != '\0')
1507 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1509 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1522 #endif /* YYERROR_VERBOSE */
1525 /*-----------------------------------------------.
1526 | Release the memory associated to this symbol. |
1527 `-----------------------------------------------*/
1530 #if (defined __STDC__ || defined __C99__FUNC__ \
1531 || defined __cplusplus || defined _MSC_VER)
1533 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1536 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1540 YYLTYPE
*yylocationp
;
1544 YYUSE (yylocationp
);
1548 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1559 /* Prevent warnings from -Wmissing-prototypes. */
1561 #ifdef YYPARSE_PARAM
1562 #if defined __STDC__ || defined __cplusplus
1563 int yyparse (void *YYPARSE_PARAM
);
1567 #else /* ! YYPARSE_PARAM */
1568 #if defined __STDC__ || defined __cplusplus
1573 #endif /* ! YYPARSE_PARAM */
1584 #ifdef YYPARSE_PARAM
1585 #if (defined __STDC__ || defined __C99__FUNC__ \
1586 || defined __cplusplus || defined _MSC_VER)
1588 yyparse (void *YYPARSE_PARAM
)
1591 yyparse (YYPARSE_PARAM
)
1592 void *YYPARSE_PARAM
;
1594 #else /* ! YYPARSE_PARAM */
1595 #if (defined __STDC__ || defined __C99__FUNC__ \
1596 || defined __cplusplus || defined _MSC_VER)
1606 /* The lookahead symbol. */
1609 /* The semantic value of the lookahead symbol. */
1612 /* Number of syntax errors so far. */
1614 /* Location data for the lookahead symbol. */
1620 /* Number of tokens to shift before error messages enabled. */
1622 /* Lookahead token as an internal (translated) token number. */
1625 /* Buffer for error messages, and its allocated size. */
1627 char *yymsg
= yymsgbuf
;
1628 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1631 /* Three stacks and their tools:
1632 `yyss': related to states,
1633 `yyvs': related to semantic values,
1634 `yyls': related to locations.
1636 Refer to the stacks thru separate pointers, to allow yyoverflow
1637 to reallocate them elsewhere. */
1639 /* The state stack. */
1640 yytype_int16 yyssa
[YYINITDEPTH
];
1641 yytype_int16
*yyss
= yyssa
;
1642 yytype_int16
*yyssp
;
1644 /* The semantic value stack. */
1645 YYSTYPE yyvsa
[YYINITDEPTH
];
1646 YYSTYPE
*yyvs
= yyvsa
;
1649 /* The location stack. */
1650 YYLTYPE yylsa
[YYINITDEPTH
];
1651 YYLTYPE
*yyls
= yylsa
;
1653 /* The locations where the error started and ended. */
1654 YYLTYPE yyerror_range
[2];
1656 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1658 YYSIZE_T yystacksize
= YYINITDEPTH
;
1660 /* The variables used to return semantic value and location from the
1665 /* The number of symbols on the RHS of the reduced rule.
1666 Keep to zero when no symbol should be popped. */
1669 YYDPRINTF ((stderr
, "Starting parse\n"));
1674 yychar
= YYEMPTY
; /* Cause a token to be read. */
1676 /* Initialize stack pointers.
1677 Waste one element of value and location stack
1678 so that they stay on the same level as the state stack.
1679 The wasted elements are never initialized. */
1684 #if YYLTYPE_IS_TRIVIAL
1685 /* Initialize the default location before parsing starts. */
1686 yylloc
.first_line
= yylloc
.last_line
= 1;
1687 yylloc
.first_column
= yylloc
.last_column
= 1;
1691 /* User initialization code. */
1693 /* Line 1082 of yacc.c */
1694 #line 89 "parse-gram.y"
1696 /* Bison's grammar can initial empty locations, hence a default
1697 location is needed. */
1698 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1699 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1702 /* Line 1082 of yacc.c */
1703 #line 1704 "parse-gram.c"
1707 /*------------------------------------------------------------.
1708 | yynewstate -- Push a new state, which is found in yystate. |
1709 `------------------------------------------------------------*/
1711 /* In all cases, when you get here, the value and location stacks
1712 have just been pushed. So pushing a state here evens the stacks. */
1718 if (yyss
+ yystacksize
- 1 <= yyssp
)
1720 /* Get the current used size of the three stacks, in elements. */
1721 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1725 /* Give user a chance to reallocate the stack. Use copies of
1726 these so that the &'s don't force the real ones into
1728 YYSTYPE
*yyvs1
= yyvs
;
1729 yytype_int16
*yyss1
= yyss
;
1730 YYLTYPE
*yyls1
= yyls
;
1732 /* Each stack pointer address is followed by the size of the
1733 data in use in that stack, in bytes. This used to be a
1734 conditional around just the two extra args, but that might
1735 be undefined if yyoverflow is a macro. */
1736 yyoverflow (YY_("memory exhausted"),
1737 &yyss1
, yysize
* sizeof (*yyssp
),
1738 &yyvs1
, yysize
* sizeof (*yyvsp
),
1739 &yyls1
, yysize
* sizeof (*yylsp
),
1745 #else /* no yyoverflow */
1746 # ifndef YYSTACK_RELOCATE
1747 goto yyexhaustedlab
;
1749 /* Extend the stack our own way. */
1750 if (YYMAXDEPTH
<= yystacksize
)
1751 goto yyexhaustedlab
;
1753 if (YYMAXDEPTH
< yystacksize
)
1754 yystacksize
= YYMAXDEPTH
;
1757 yytype_int16
*yyss1
= yyss
;
1758 union yyalloc
*yyptr
=
1759 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1761 goto yyexhaustedlab
;
1762 YYSTACK_RELOCATE (yyss
);
1763 YYSTACK_RELOCATE (yyvs
);
1764 YYSTACK_RELOCATE (yyls
);
1765 # undef YYSTACK_RELOCATE
1767 YYSTACK_FREE (yyss1
);
1770 #endif /* no yyoverflow */
1772 yyssp
= yyss
+ yysize
- 1;
1773 yyvsp
= yyvs
+ yysize
- 1;
1774 yylsp
= yyls
+ yysize
- 1;
1776 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1777 (unsigned long int) yystacksize
));
1779 if (yyss
+ yystacksize
- 1 <= yyssp
)
1783 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1785 if (yystate
== YYFINAL
)
1795 /* Do appropriate processing given the current state. Read a
1796 lookahead token if we need one and don't already have one. */
1798 /* First try to decide what to do without reference to lookahead token. */
1799 yyn
= yypact
[yystate
];
1800 if (yyn
== YYPACT_NINF
)
1803 /* Not known => get a lookahead token if don't already have one. */
1805 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1806 if (yychar
== YYEMPTY
)
1808 YYDPRINTF ((stderr
, "Reading a token: "));
1812 if (yychar
<= YYEOF
)
1814 yychar
= yytoken
= YYEOF
;
1815 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1819 yytoken
= YYTRANSLATE (yychar
);
1820 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1823 /* If the proper action on seeing token YYTOKEN is to reduce or to
1824 detect an error, take that action. */
1826 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1831 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1837 /* Count tokens shifted since error; after three, turn off error
1842 /* Shift the lookahead token. */
1843 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1845 /* Discard the shifted token. */
1854 /*-----------------------------------------------------------.
1855 | yydefault -- do the default action for the current state. |
1856 `-----------------------------------------------------------*/
1858 yyn
= yydefact
[yystate
];
1864 /*-----------------------------.
1865 | yyreduce -- Do a reduction. |
1866 `-----------------------------*/
1868 /* yyn is the number of a rule to reduce with. */
1871 /* If YYLEN is nonzero, implement the default value of the action:
1874 Otherwise, the following line sets YYVAL to garbage.
1875 This behavior is undocumented and Bison
1876 users should not rely upon it. Assigning to YYVAL
1877 unconditionally makes the parser a bit smaller, and it avoids a
1878 GCC warning that YYVAL may be used uninitialized. */
1879 yyval
= yyvsp
[1-yylen
];
1881 /* Default location. */
1882 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1883 YY_REDUCE_PRINT (yyn
);
1888 /* Line 1269 of yacc.c */
1889 #line 225 "parse-gram.y"
1890 { prologue_augment (translate_code ((yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)])), (yylsp
[(1) - (1)]), union_seen
); }
1895 /* Line 1269 of yacc.c */
1896 #line 226 "parse-gram.y"
1897 { debug_flag
= true; }
1902 /* Line 1269 of yacc.c */
1903 #line 227 "parse-gram.y"
1904 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1909 /* Line 1269 of yacc.c */
1910 #line 228 "parse-gram.y"
1911 { defines_flag
= true; }
1916 /* Line 1269 of yacc.c */
1917 #line 229 "parse-gram.y"
1918 { error_verbose
= true; }
1923 /* Line 1269 of yacc.c */
1924 #line 230 "parse-gram.y"
1925 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1930 /* Line 1269 of yacc.c */
1931 #line 231 "parse-gram.y"
1932 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1937 /* Line 1269 of yacc.c */
1938 #line 232 "parse-gram.y"
1939 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1944 /* Line 1269 of yacc.c */
1945 #line 234 "parse-gram.y"
1947 nondeterministic_parser
= true;
1954 /* Line 1269 of yacc.c */
1955 #line 239 "parse-gram.y"
1957 muscle_code_grow ("initial_action", translate_symbol_action ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1963 /* Line 1269 of yacc.c */
1964 #line 242 "parse-gram.y"
1965 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
1970 /* Line 1269 of yacc.c */
1971 #line 243 "parse-gram.y"
1972 { locations_flag
= true; }
1977 /* Line 1269 of yacc.c */
1978 #line 244 "parse-gram.y"
1979 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
1984 /* Line 1269 of yacc.c */
1985 #line 245 "parse-gram.y"
1986 { no_lines_flag
= true; }
1991 /* Line 1269 of yacc.c */
1992 #line 246 "parse-gram.y"
1993 { nondeterministic_parser
= true; }
1998 /* Line 1269 of yacc.c */
1999 #line 247 "parse-gram.y"
2000 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2005 /* Line 1269 of yacc.c */
2006 #line 248 "parse-gram.y"
2007 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2012 /* Line 1269 of yacc.c */
2013 #line 249 "parse-gram.y"
2014 { pure_parser
= true; }
2019 /* Line 1269 of yacc.c */
2020 #line 250 "parse-gram.y"
2021 { push_parser
= true; }
2026 /* Line 1269 of yacc.c */
2027 #line 251 "parse-gram.y"
2028 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2033 /* Line 1269 of yacc.c */
2034 #line 252 "parse-gram.y"
2035 { skeleton
= (yyvsp
[(2) - (2)].chars
); }
2040 /* Line 1269 of yacc.c */
2041 #line 253 "parse-gram.y"
2042 { token_table_flag
= true; }
2047 /* Line 1269 of yacc.c */
2048 #line 254 "parse-gram.y"
2049 { report_flag
= report_states
; }
2054 /* Line 1269 of yacc.c */
2055 #line 255 "parse-gram.y"
2056 { yacc_flag
= true; }
2061 /* Line 1269 of yacc.c */
2062 #line 263 "parse-gram.y"
2064 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2070 /* Line 1269 of yacc.c */
2071 #line 267 "parse-gram.y"
2074 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2075 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2076 symbol_list_destructor_set (list
, action
, (yylsp
[(2) - (3)]));
2077 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2083 /* Line 1269 of yacc.c */
2084 #line 275 "parse-gram.y"
2087 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2088 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2089 symbol_list_printer_set (list
, action
, (yylsp
[(2) - (3)]));
2090 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2096 /* Line 1269 of yacc.c */
2097 #line 283 "parse-gram.y"
2099 default_prec
= true;
2105 /* Line 1269 of yacc.c */
2106 #line 287 "parse-gram.y"
2108 default_prec
= false;
2114 /* Line 1269 of yacc.c */
2115 #line 290 "parse-gram.y"
2116 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), true); }
2121 /* Line 1269 of yacc.c */
2122 #line 291 "parse-gram.y"
2123 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), false); }
2128 /* Line 1269 of yacc.c */
2129 #line 292 "parse-gram.y"
2130 { muscle_code_grow ("provides", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2135 /* Line 1269 of yacc.c */
2136 #line 293 "parse-gram.y"
2137 { muscle_code_grow ("requires", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2142 /* Line 1269 of yacc.c */
2143 #line 304 "parse-gram.y"
2149 /* Line 1269 of yacc.c */
2150 #line 305 "parse-gram.y"
2151 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2156 /* Line 1269 of yacc.c */
2157 #line 310 "parse-gram.y"
2159 char const *body
= (yyvsp
[(3) - (3)].code
);
2161 /* Concatenate the %union bodies. If this is the first %union, make sure
2162 the synchronization line appears after the opening '{' so as not to
2163 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2164 into '\n', and omit the new %union's leading '{'. */
2167 muscle_grow ("stype", "{", "");
2171 char *code
= muscle_find ("stype");
2172 code
[strlen (code
) - 1] = '\n';
2177 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2183 /* Line 1269 of yacc.c */
2184 #line 337 "parse-gram.y"
2185 { current_class
= nterm_sym
; }
2190 /* Line 1269 of yacc.c */
2191 #line 338 "parse-gram.y"
2193 current_class
= unknown_sym
;
2194 current_type
= NULL
;
2200 /* Line 1269 of yacc.c */
2201 #line 342 "parse-gram.y"
2202 { current_class
= token_sym
; }
2207 /* Line 1269 of yacc.c */
2208 #line 343 "parse-gram.y"
2210 current_class
= unknown_sym
;
2211 current_type
= NULL
;
2217 /* Line 1269 of yacc.c */
2218 #line 348 "parse-gram.y"
2222 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2223 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2224 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2230 /* Line 1269 of yacc.c */
2231 #line 359 "parse-gram.y"
2235 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2237 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2238 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2240 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2241 current_type
= NULL
;
2247 /* Line 1269 of yacc.c */
2248 #line 373 "parse-gram.y"
2249 { (yyval
.assoc
) = left_assoc
; }
2254 /* Line 1269 of yacc.c */
2255 #line 374 "parse-gram.y"
2256 { (yyval
.assoc
) = right_assoc
; }
2261 /* Line 1269 of yacc.c */
2262 #line 375 "parse-gram.y"
2263 { (yyval
.assoc
) = non_assoc
; }
2268 /* Line 1269 of yacc.c */
2269 #line 379 "parse-gram.y"
2270 { current_type
= NULL
; }
2275 /* Line 1269 of yacc.c */
2276 #line 380 "parse-gram.y"
2277 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2282 /* Line 1269 of yacc.c */
2283 #line 386 "parse-gram.y"
2284 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2289 /* Line 1269 of yacc.c */
2290 #line 388 "parse-gram.y"
2291 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2296 /* Line 1269 of yacc.c */
2297 #line 392 "parse-gram.y"
2298 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2303 /* Line 1269 of yacc.c */
2304 #line 393 "parse-gram.y"
2305 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2310 /* Line 1269 of yacc.c */
2311 #line 397 "parse-gram.y"
2312 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2317 /* Line 1269 of yacc.c */
2318 #line 398 "parse-gram.y"
2319 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2324 /* Line 1269 of yacc.c */
2325 #line 399 "parse-gram.y"
2326 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2331 /* Line 1269 of yacc.c */
2332 #line 400 "parse-gram.y"
2333 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2338 /* Line 1269 of yacc.c */
2339 #line 406 "parse-gram.y"
2341 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2348 /* Line 1269 of yacc.c */
2349 #line 411 "parse-gram.y"
2351 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2352 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2358 /* Line 1269 of yacc.c */
2359 #line 416 "parse-gram.y"
2361 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2362 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2363 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2369 /* Line 1269 of yacc.c */
2370 #line 422 "parse-gram.y"
2372 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2373 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2374 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2380 /* Line 1269 of yacc.c */
2381 #line 428 "parse-gram.y"
2383 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2384 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2385 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2386 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2392 /* Line 1269 of yacc.c */
2393 #line 458 "parse-gram.y"
2401 /* Line 1269 of yacc.c */
2402 #line 464 "parse-gram.y"
2403 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2408 /* Line 1269 of yacc.c */
2409 #line 468 "parse-gram.y"
2410 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2415 /* Line 1269 of yacc.c */
2416 #line 469 "parse-gram.y"
2417 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2422 /* Line 1269 of yacc.c */
2423 #line 475 "parse-gram.y"
2424 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2429 /* Line 1269 of yacc.c */
2430 #line 477 "parse-gram.y"
2431 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2436 /* Line 1269 of yacc.c */
2437 #line 479 "parse-gram.y"
2438 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2443 /* Line 1269 of yacc.c */
2444 #line 481 "parse-gram.y"
2445 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2450 /* Line 1269 of yacc.c */
2451 #line 483 "parse-gram.y"
2452 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2457 /* Line 1269 of yacc.c */
2458 #line 485 "parse-gram.y"
2459 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2464 /* Line 1269 of yacc.c */
2465 #line 501 "parse-gram.y"
2467 static char one
[] = "1";
2468 (yyval
.chars
) = one
;
2474 /* Line 1269 of yacc.c */
2475 #line 511 "parse-gram.y"
2477 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2478 (yyval
.chars
) = translate_code ((yyvsp
[(1) - (1)].code
) + 1, (yylsp
[(1) - (1)]));
2484 /* Line 1269 of yacc.c */
2485 #line 527 "parse-gram.y"
2486 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2491 /* Line 1269 of yacc.c */
2492 #line 529 "parse-gram.y"
2494 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2495 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2496 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2502 /* Line 1269 of yacc.c */
2503 #line 537 "parse-gram.y"
2504 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2509 /* Line 1269 of yacc.c */
2510 #line 549 "parse-gram.y"
2512 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2513 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2519 /* Line 1269 of yacc.c */
2520 #line 558 "parse-gram.y"
2522 muscle_code_grow ("epilogue", translate_code ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
2523 gram_scanner_last_string_free ();
2529 /* Line 1269 of yacc.c */
2530 #line 2531 "parse-gram.c"
2533 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2537 YY_STACK_PRINT (yyss
, yyssp
);
2542 /* Now `shift' the result of the reduction. Determine what state
2543 that goes to, based on the state we popped back to and the rule
2544 number reduced by. */
2548 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2549 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2550 yystate
= yytable
[yystate
];
2552 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2557 /*------------------------------------.
2558 | yyerrlab -- here on detecting error |
2559 `------------------------------------*/
2561 /* If not already recovering from an error, report this error. */
2565 #if ! YYERROR_VERBOSE
2566 yyerror (YY_("syntax error"));
2569 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2570 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2572 YYSIZE_T yyalloc
= 2 * yysize
;
2573 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2574 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2575 if (yymsg
!= yymsgbuf
)
2576 YYSTACK_FREE (yymsg
);
2577 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2579 yymsg_alloc
= yyalloc
;
2583 yymsg_alloc
= sizeof yymsgbuf
;
2587 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2589 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2594 yyerror (YY_("syntax error"));
2596 goto yyexhaustedlab
;
2602 yyerror_range
[0] = yylloc
;
2604 if (yyerrstatus
== 3)
2606 /* If just tried and failed to reuse lookahead token after an
2607 error, discard it. */
2609 if (yychar
<= YYEOF
)
2611 /* Return failure if at end of input. */
2612 if (yychar
== YYEOF
)
2617 yydestruct ("Error: discarding",
2618 yytoken
, &yylval
, &yylloc
);
2623 /* Else will try to reuse lookahead token after shifting the error
2628 /*---------------------------------------------------.
2629 | yyerrorlab -- error raised explicitly by YYERROR. |
2630 `---------------------------------------------------*/
2633 /* Pacify compilers like GCC when the user code never invokes
2634 YYERROR and the label yyerrorlab therefore never appears in user
2636 if (/*CONSTCOND*/ 0)
2639 yyerror_range
[0] = yylsp
[1-yylen
];
2640 /* Do not reclaim the symbols of the rule which action triggered
2644 YY_STACK_PRINT (yyss
, yyssp
);
2649 /*-------------------------------------------------------------.
2650 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2651 `-------------------------------------------------------------*/
2653 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2657 yyn
= yypact
[yystate
];
2658 if (yyn
!= YYPACT_NINF
)
2661 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2669 /* Pop the current state because it cannot handle the error token. */
2673 yyerror_range
[0] = *yylsp
;
2674 yydestruct ("Error: popping",
2675 yystos
[yystate
], yyvsp
, yylsp
);
2678 YY_STACK_PRINT (yyss
, yyssp
);
2683 yyerror_range
[1] = yylloc
;
2684 /* Using YYLLOC is tempting, but would change the location of
2685 the lookahead. YYLOC is available though. */
2686 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2689 /* Shift the error token. */
2690 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2696 /*-------------------------------------.
2697 | yyacceptlab -- YYACCEPT comes here. |
2698 `-------------------------------------*/
2703 /*-----------------------------------.
2704 | yyabortlab -- YYABORT comes here. |
2705 `-----------------------------------*/
2711 /*-------------------------------------------------.
2712 | yyexhaustedlab -- memory exhaustion comes here. |
2713 `-------------------------------------------------*/
2715 yyerror (YY_("memory exhausted"));
2721 if (yychar
!= YYEMPTY
)
2722 yydestruct ("Cleanup: discarding lookahead",
2723 yytoken
, &yylval
, &yylloc
);
2724 /* Do not reclaim the symbols of the rule which action triggered
2725 this YYABORT or YYACCEPT. */
2727 YY_STACK_PRINT (yyss
, yyssp
);
2728 while (yyssp
!= yyss
)
2730 yydestruct ("Cleanup: popping",
2731 yystos
[*yyssp
], yyvsp
, yylsp
);
2736 YYSTACK_FREE (yyss
);
2739 if (yymsg
!= yymsgbuf
)
2740 YYSTACK_FREE (yymsg
);
2742 /* Make sure YYID is used. */
2743 return YYID (yyresult
);
2748 /* Line 1486 of yacc.c */
2749 #line 564 "parse-gram.y"
2753 /* Return the location of the left-hand side of a rule whose
2754 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2755 the right-hand side, and return an empty location equal to the end
2756 boundary of RHS[0] if the right-hand side is empty. */
2759 lloc_default (YYLTYPE
const *rhs
, int n
)
2764 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2765 The bug is fixed in 7.4.2m, but play it safe for now. */
2766 loc
.start
= rhs
[n
].end
;
2767 loc
.end
= rhs
[n
].end
;
2769 /* Ignore empty nonterminals the start of the the right-hand side.
2770 Do not bother to ignore them at the end of the right-hand side,
2771 since empty nonterminals have the same end as their predecessors. */
2772 for (i
= 1; i
<= n
; i
++)
2773 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2775 loc
.start
= rhs
[i
].start
;
2783 /* Add a lex-param or a parse-param (depending on TYPE) with
2784 declaration DECL and location LOC. */
2787 add_param (char const *type
, char *decl
, location loc
)
2789 static char const alphanum
[26 + 26 + 1 + 10] =
2790 "abcdefghijklmnopqrstuvwxyz"
2791 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2794 char const *name_start
= NULL
;
2797 /* Stop on last actual character. */
2798 for (p
= decl
; p
[1]; p
++)
2800 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2801 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2804 /* Strip the surrounding '{' and '}', and any blanks just inside
2806 while (*--p
== ' ' || *p
== '\t')
2809 while (*++decl
== ' ' || *decl
== '\t')
2813 complain_at (loc
, _("missing identifier in parameter declaration"));
2820 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2824 name
= xmalloc (name_len
+ 1);
2825 memcpy (name
, name_start
, name_len
);
2826 name
[name_len
] = '\0';
2827 muscle_pair_list_grow (type
, decl
, name
);
2831 gram_scanner_last_string_free ();
2836 version_check (location
const *loc
, char const *version
)
2838 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2840 complain_at (*loc
, "require bison %s, but have %s",
2841 version
, PACKAGE_VERSION
);
2847 gram_error (location
const *loc
, char const *msg
)
2849 complain_at (*loc
, "%s", msg
);
2853 token_name (int type
)
2855 return yytname
[YYTRANSLATE (type
)];
2866 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2867 return quotearg_style (escape_quoting_style
, buf
);