2 /* A Bison parser, made by GNU Bison 2.3a+. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.3a+"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 1
66 /* Substitute the variable and function names. */
67 #define yyparse gram_parse
68 #define yylex gram_lex
69 #define yyerror gram_error
70 #define yylval gram_lval
71 #define yychar gram_char
72 #define yydebug gram_debug
73 #define yynerrs gram_nerrs
74 #define yylloc gram_lloc
76 /* Copy the first part of user declarations. */
78 /* Line 1535 of yacc.c */
79 #line 1 "parse-gram.y"
80 /* Bison Grammar Parser -*- C -*-
82 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
85 This file is part of Bison, the GNU Compiler Compiler.
87 This program is free software: you can redistribute it and/or modify
88 it under the terms of the GNU General Public License as published by
89 the Free Software Foundation, either version 3 of the License, or
90 (at your option) any later version.
92 This program is distributed in the hope that it will be useful,
93 but WITHOUT ANY WARRANTY; without even the implied warranty of
94 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
95 GNU General Public License for more details.
97 You should have received a copy of the GNU General Public License
98 along with this program. If not, see <http://www.gnu.org/licenses/>. */
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 1535 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,
199 PERCENT_DEFAULT_PREC
= 273,
200 PERCENT_DEFINE
= 274,
201 PERCENT_DEFINES
= 275,
202 PERCENT_ERROR_VERBOSE
= 276,
203 PERCENT_EXPECT
= 277,
204 PERCENT_EXPECT_RR
= 278,
205 PERCENT_FILE_PREFIX
= 279,
206 PERCENT_GLR_PARSER
= 280,
207 PERCENT_INITIAL_ACTION
= 281,
208 PERCENT_LANGUAGE
= 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_PURE_PARSER
= 291,
218 PERCENT_PUSH_PARSER
= 292,
219 PERCENT_PUSH_PULL_PARSER
= 293,
220 PERCENT_REQUIRE
= 294,
221 PERCENT_SKELETON
= 295,
223 PERCENT_TOKEN_TABLE
= 297,
224 PERCENT_VERBOSE
= 298,
232 PERCENT_PERCENT
= 306,
246 #define PERCENT_TOKEN 260
247 #define PERCENT_NTERM 261
248 #define PERCENT_TYPE 262
249 #define PERCENT_DESTRUCTOR 263
250 #define PERCENT_PRINTER 264
251 #define PERCENT_LEFT 265
252 #define PERCENT_RIGHT 266
253 #define PERCENT_NONASSOC 267
254 #define PERCENT_PREC 268
255 #define PERCENT_DPREC 269
256 #define PERCENT_MERGE 270
257 #define PERCENT_CODE 271
258 #define PERCENT_DEBUG 272
259 #define PERCENT_DEFAULT_PREC 273
260 #define PERCENT_DEFINE 274
261 #define PERCENT_DEFINES 275
262 #define PERCENT_ERROR_VERBOSE 276
263 #define PERCENT_EXPECT 277
264 #define PERCENT_EXPECT_RR 278
265 #define PERCENT_FILE_PREFIX 279
266 #define PERCENT_GLR_PARSER 280
267 #define PERCENT_INITIAL_ACTION 281
268 #define PERCENT_LANGUAGE 282
269 #define PERCENT_LEX_PARAM 283
270 #define PERCENT_LOCATIONS 284
271 #define PERCENT_NAME_PREFIX 285
272 #define PERCENT_NO_DEFAULT_PREC 286
273 #define PERCENT_NO_LINES 287
274 #define PERCENT_NONDETERMINISTIC_PARSER 288
275 #define PERCENT_OUTPUT 289
276 #define PERCENT_PARSE_PARAM 290
277 #define PERCENT_PURE_PARSER 291
278 #define PERCENT_PUSH_PARSER 292
279 #define PERCENT_PUSH_PULL_PARSER 293
280 #define PERCENT_REQUIRE 294
281 #define PERCENT_SKELETON 295
282 #define PERCENT_START 296
283 #define PERCENT_TOKEN_TABLE 297
284 #define PERCENT_VERBOSE 298
285 #define PERCENT_YACC 299
286 #define BRACED_CODE 300
292 #define PERCENT_PERCENT 306
295 #define SEMICOLON 309
297 #define TYPE_TAG_ANY 311
298 #define TYPE_TAG_NONE 312
299 #define PERCENT_UNION 313
304 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
305 typedef union YYSTYPE
308 /* Line 1535 of yacc.c */
309 #line 94 "parse-gram.y"
318 unsigned char character
;
322 /* Line 1535 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 1535 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 141
576 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
578 #define YYMAXUTOK 313
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_uint16 yyprhs
[] =
625 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
626 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
627 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
628 80, 82, 85, 88, 90, 92, 94, 96, 98, 100,
629 103, 107, 111, 113, 115, 118, 122, 123, 125, 129,
630 130, 134, 135, 139, 143, 147, 149, 151, 153, 154,
631 156, 158, 161, 163, 166, 168, 170, 172, 174, 176,
632 178, 181, 184, 188, 190, 193, 195, 198, 200, 203,
633 206, 207, 211, 213, 217, 220, 221, 224, 227, 231,
634 235, 239, 241, 243, 244, 246, 248, 250, 252, 254,
638 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
639 static const yytype_int8 yyrhs
[] =
641 60, 0, -1, 61, 51, 76, 89, -1, -1, 61,
642 62, -1, 63, -1, 53, -1, 17, -1, 19, 82,
643 83, -1, 20, -1, 20, 3, -1, 21, -1, 22,
644 4, -1, 23, 4, -1, 24, 3, -1, 24, 48,
645 3, -1, 25, -1, 26, 45, -1, 27, 3, -1,
646 28, 45, -1, 29, -1, 30, 3, -1, 30, 48,
647 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
648 48, 3, -1, 35, 45, -1, 36, -1, 37, -1,
649 38, -1, 39, 3, -1, 40, 3, -1, 42, -1,
650 43, -1, 44, -1, 54, -1, 68, -1, 65, -1,
651 41, 87, -1, 8, 45, 72, -1, 9, 45, 72,
652 -1, 18, -1, 31, -1, 16, 84, -1, 16, 49,
653 84, -1, -1, 49, -1, 58, 64, 84, -1, -1,
654 6, 66, 75, -1, -1, 5, 67, 75, -1, 7,
655 55, 71, -1, 69, 70, 71, -1, 10, -1, 11,
656 -1, 12, -1, -1, 55, -1, 87, -1, 71, 87,
657 -1, 73, -1, 72, 73, -1, 87, -1, 55, -1,
658 56, -1, 57, -1, 55, -1, 85, -1, 85, 4,
659 -1, 85, 88, -1, 85, 4, 88, -1, 74, -1,
660 75, 74, -1, 77, -1, 76, 77, -1, 78, -1,
661 63, 54, -1, 1, 54, -1, -1, 86, 79, 80,
662 -1, 81, -1, 80, 52, 81, -1, 80, 54, -1,
663 -1, 81, 87, -1, 81, 45, -1, 81, 13, 87,
664 -1, 81, 14, 4, -1, 81, 15, 55, -1, 49,
665 -1, 3, -1, -1, 3, -1, 45, -1, 49, -1,
666 46, -1, 50, -1, 85, -1, 88, -1, 3, -1,
670 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
671 static const yytype_uint16 yyrline
[] =
673 0, 207, 207, 215, 217, 221, 222, 232, 233, 237,
674 238, 243, 244, 245, 246, 247, 248, 253, 262, 263,
675 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
676 274, 275, 276, 300, 301, 302, 303, 307, 308, 309,
677 313, 320, 327, 331, 335, 342, 357, 358, 362, 374,
678 374, 379, 379, 384, 395, 410, 411, 412, 416, 417,
679 422, 424, 429, 430, 434, 435, 436, 437, 442, 447,
680 452, 458, 464, 475, 476, 485, 486, 492, 493, 494,
681 501, 501, 505, 506, 507, 512, 513, 515, 517, 519,
682 521, 531, 532, 538, 541, 550, 570, 572, 581, 586,
687 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
688 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
689 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
690 static const char *const yytname
[] =
692 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
693 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
694 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
695 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
696 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
697 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
698 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
699 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
700 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
701 "\"%parse-param\"", "\"%pure-parser\"", "\"%push-parser\"",
702 "\"%push-pull-parser\"", "\"%require\"", "\"%skeleton\"", "\"%start\"",
703 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"",
704 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
705 "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"", "\"<*>\"", "\"<>\"",
706 "\"%union\"", "$accept", "input", "prologue_declarations",
707 "prologue_declaration", "grammar_declaration", "union_name",
708 "symbol_declaration", "$@1", "$@2", "precedence_declaration",
709 "precedence_declarator", "type.opt", "symbols.1", "generic_symlist",
710 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
711 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
712 "variable", "content.opt", "braceless", "id", "id_colon", "symbol",
713 "string_as_id", "epilogue.opt", 0
718 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
720 static const yytype_uint16 yytoknum
[] =
722 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
723 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
724 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
725 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
726 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
727 305, 306, 307, 308, 309, 310, 311, 312, 313
731 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
732 static const yytype_uint8 yyr1
[] =
734 0, 59, 60, 61, 61, 62, 62, 62, 62, 62,
735 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
736 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
737 62, 62, 62, 62, 62, 62, 62, 63, 63, 63,
738 63, 63, 63, 63, 63, 63, 64, 64, 63, 66,
739 65, 67, 65, 65, 68, 69, 69, 69, 70, 70,
740 71, 71, 72, 72, 73, 73, 73, 73, 74, 74,
741 74, 74, 74, 75, 75, 76, 76, 77, 77, 77,
742 79, 78, 80, 80, 80, 81, 81, 81, 81, 81,
743 81, 82, 82, 83, 83, 84, 85, 85, 86, 87,
747 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
748 static const yytype_uint8 yyr2
[] =
750 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
751 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
752 1, 2, 3, 1, 1, 2, 3, 2, 1, 1,
753 1, 2, 2, 1, 1, 1, 1, 1, 1, 2,
754 3, 3, 1, 1, 2, 3, 0, 1, 3, 0,
755 3, 0, 3, 3, 3, 1, 1, 1, 0, 1,
756 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
757 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
758 0, 3, 1, 3, 2, 0, 2, 2, 3, 3,
759 3, 1, 1, 0, 1, 1, 1, 1, 1, 1,
763 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
764 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
765 means the default is an error. */
766 static const yytype_uint8 yydefact
[] =
768 3, 0, 0, 1, 51, 49, 0, 0, 0, 55,
769 56, 57, 0, 7, 42, 0, 9, 11, 0, 0,
770 0, 16, 0, 0, 0, 20, 0, 43, 23, 24,
771 0, 0, 28, 29, 30, 0, 0, 0, 33, 34,
772 35, 0, 6, 36, 46, 4, 5, 38, 37, 58,
773 0, 0, 0, 0, 0, 95, 0, 44, 92, 91,
774 93, 10, 12, 13, 14, 0, 17, 18, 19, 21,
775 0, 25, 0, 27, 31, 32, 101, 97, 96, 99,
776 39, 100, 0, 98, 0, 0, 75, 77, 80, 47,
777 0, 59, 0, 68, 73, 52, 69, 50, 53, 60,
778 65, 66, 67, 40, 62, 64, 41, 45, 94, 8,
779 15, 22, 26, 79, 78, 0, 76, 2, 85, 48,
780 54, 74, 70, 71, 61, 63, 103, 81, 82, 72,
781 85, 84, 0, 0, 0, 87, 86, 83, 88, 89,
785 /* YYDEFGOTO[NTERM-NUM]. */
786 static const yytype_int16 yydefgoto
[] =
788 -1, 1, 2, 45, 84, 90, 47, 51, 50, 48,
789 49, 92, 98, 103, 104, 94, 95, 85, 86, 87,
790 118, 127, 128, 60, 109, 57, 79, 88, 105, 81,
794 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
796 #define YYPACT_NINF -79
797 static const yytype_int16 yypact
[] =
799 -79, 5, 96, -79, -79, -79, -6, 13, 18, -79,
800 -79, -79, -8, -79, -79, 27, 66, -79, 74, 82,
801 31, -79, 43, 86, 45, -79, 32, -79, -79, -79,
802 33, 47, -79, -79, -79, 91, 93, 26, -79, -79,
803 -79, 15, -79, -79, 48, -79, -79, -79, -79, 44,
804 38, 38, 26, 11, 11, -79, 53, -79, -79, -79,
805 106, -79, -79, -79, -79, 107, -79, -79, -79, -79,
806 108, -79, 138, -79, -79, -79, -79, -79, -79, -79,
807 -79, -79, 88, -79, 89, 1, -79, -79, -79, -79,
808 53, -79, 26, -79, -79, 38, 50, 38, 26, -79,
809 -79, -79, -79, 11, -79, -79, 11, -79, -79, -79,
810 -79, -79, -79, -79, -79, 97, -79, -79, -79, -79,
811 26, -79, 142, -79, -79, -79, -79, -7, 25, -79,
812 -79, -79, 26, 144, 98, -79, -79, 25, -79, -79,
816 /* YYPGOTO[NTERM-NUM]. */
817 static const yytype_int16 yypgoto
[] =
819 -79, -79, -79, -79, 149, -79, -79, -79, -79, -79,
820 -79, -79, 54, 101, -21, -33, 105, -79, 67, -79,
821 -79, -79, 28, -79, -79, -13, -47, -79, -37, -78,
825 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
826 positive, shift that token. If negative, reduce the rule which
827 number is the opposite. If zero, do what YYDEFACT says.
828 If YYTABLE_NINF, syntax error. */
829 #define YYTABLE_NINF -103
830 static const yytype_int16 yytable
[] =
832 80, -102, 82, 96, 96, 3, 4, 5, 6, 7,
833 8, 9, 10, 11, 76, 99, 82, 12, 123, 14,
834 4, 5, 6, 7, 8, 9, 10, 11, 76, 76,
835 58, 12, 27, 14, 64, 69, 71, 55, 132, 133,
836 134, 56, 37, 107, 129, 130, 27, 131, 96, 52,
837 96, 83, 115, 76, 122, 99, 37, 77, 53, 44,
838 78, 124, 121, 54, 121, 83, 100, 101, 102, 61,
839 135, 77, 77, 44, 78, 78, 59, 119, 62, 65,
840 70, 72, 125, 124, 77, 125, 63, 78, 66, 67,
841 68, 136, 73, 93, 74, 138, 75, 89, 55, 91,
842 136, 4, 5, 6, 7, 8, 9, 10, 11, 108,
843 110, 111, 12, 13, 14, 15, 16, 17, 18, 19,
844 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
845 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
846 40, 112, 113, 114, 126, 76, 120, 41, 139, 42,
847 43, 46, 116, 140, 44, 106, 97, 0, 137
850 static const yytype_int16 yycheck
[] =
852 37, 0, 1, 50, 51, 0, 5, 6, 7, 8,
853 9, 10, 11, 12, 3, 52, 1, 16, 96, 18,
854 5, 6, 7, 8, 9, 10, 11, 12, 3, 3,
855 3, 16, 31, 18, 3, 3, 3, 45, 13, 14,
856 15, 49, 41, 56, 122, 52, 31, 54, 95, 55,
857 97, 50, 51, 3, 4, 92, 41, 46, 45, 58,
858 49, 98, 95, 45, 97, 50, 55, 56, 57, 3,
859 45, 46, 46, 58, 49, 49, 49, 90, 4, 48,
860 48, 48, 103, 120, 46, 106, 4, 49, 45, 3,
861 45, 128, 45, 55, 3, 132, 3, 49, 45, 55,
862 137, 5, 6, 7, 8, 9, 10, 11, 12, 3,
863 3, 3, 16, 17, 18, 19, 20, 21, 22, 23,
864 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
865 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
866 44, 3, 54, 54, 47, 3, 92, 51, 4, 53,
867 54, 2, 85, 55, 58, 54, 51, -1, 130
870 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
871 symbol of state STATE-NUM. */
872 static const yytype_uint8 yystos
[] =
874 0, 60, 61, 0, 5, 6, 7, 8, 9, 10,
875 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
876 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
877 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
878 44, 51, 53, 54, 58, 62, 63, 65, 68, 69,
879 67, 66, 55, 45, 45, 45, 49, 84, 3, 49,
880 82, 3, 4, 4, 3, 48, 45, 3, 45, 3,
881 48, 3, 48, 45, 3, 3, 3, 46, 49, 85,
882 87, 88, 1, 50, 63, 76, 77, 78, 86, 49,
883 64, 55, 70, 55, 74, 75, 85, 75, 71, 87,
884 55, 56, 57, 72, 73, 87, 72, 84, 3, 83,
885 3, 3, 3, 54, 54, 51, 77, 89, 79, 84,
886 71, 74, 4, 88, 87, 73, 47, 80, 81, 88,
887 52, 54, 13, 14, 15, 45, 87, 81, 87, 4,
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 1535 of yacc.c */
1039 #line 185 "parse-gram.y"
1040 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1042 /* Line 1535 of yacc.c */
1043 #line 1044 "parse-gram.c"
1045 case 4: /* "\"integer\"" */
1047 /* Line 1535 of yacc.c */
1048 #line 196 "parse-gram.y"
1049 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1051 /* Line 1535 of yacc.c */
1052 #line 1053 "parse-gram.c"
1054 case 45: /* "\"{...}\"" */
1056 /* Line 1535 of yacc.c */
1057 #line 187 "parse-gram.y"
1058 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1060 /* Line 1535 of yacc.c */
1061 #line 1062 "parse-gram.c"
1063 case 46: /* "\"char\"" */
1065 /* Line 1535 of yacc.c */
1066 #line 179 "parse-gram.y"
1067 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1069 /* Line 1535 of yacc.c */
1070 #line 1071 "parse-gram.c"
1072 case 47: /* "\"epilogue\"" */
1074 /* Line 1535 of yacc.c */
1075 #line 187 "parse-gram.y"
1076 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1078 /* Line 1535 of yacc.c */
1079 #line 1080 "parse-gram.c"
1081 case 49: /* "\"identifier\"" */
1083 /* Line 1535 of yacc.c */
1084 #line 192 "parse-gram.y"
1085 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1087 /* Line 1535 of yacc.c */
1088 #line 1089 "parse-gram.c"
1090 case 50: /* "\"identifier:\"" */
1092 /* Line 1535 of yacc.c */
1093 #line 193 "parse-gram.y"
1094 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1096 /* Line 1535 of yacc.c */
1097 #line 1098 "parse-gram.c"
1099 case 53: /* "\"%{...%}\"" */
1101 /* Line 1535 of yacc.c */
1102 #line 187 "parse-gram.y"
1103 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1105 /* Line 1535 of yacc.c */
1106 #line 1107 "parse-gram.c"
1108 case 55: /* "\"type\"" */
1110 /* Line 1535 of yacc.c */
1111 #line 191 "parse-gram.y"
1112 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1114 /* Line 1535 of yacc.c */
1115 #line 1116 "parse-gram.c"
1117 case 82: /* "variable" */
1119 /* Line 1535 of yacc.c */
1120 #line 192 "parse-gram.y"
1121 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1123 /* Line 1535 of yacc.c */
1124 #line 1125 "parse-gram.c"
1126 case 83: /* "content.opt" */
1128 /* Line 1535 of yacc.c */
1129 #line 187 "parse-gram.y"
1130 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1132 /* Line 1535 of yacc.c */
1133 #line 1134 "parse-gram.c"
1135 case 84: /* "braceless" */
1137 /* Line 1535 of yacc.c */
1138 #line 187 "parse-gram.y"
1139 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1141 /* Line 1535 of yacc.c */
1142 #line 1143 "parse-gram.c"
1146 /* Line 1535 of yacc.c */
1147 #line 199 "parse-gram.y"
1148 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1150 /* Line 1535 of yacc.c */
1151 #line 1152 "parse-gram.c"
1153 case 86: /* "id_colon" */
1155 /* Line 1535 of yacc.c */
1156 #line 200 "parse-gram.y"
1157 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1159 /* Line 1535 of yacc.c */
1160 #line 1161 "parse-gram.c"
1162 case 87: /* "symbol" */
1164 /* Line 1535 of yacc.c */
1165 #line 199 "parse-gram.y"
1166 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1168 /* Line 1535 of yacc.c */
1169 #line 1170 "parse-gram.c"
1171 case 88: /* "string_as_id" */
1173 /* Line 1535 of yacc.c */
1174 #line 199 "parse-gram.y"
1175 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1177 /* Line 1535 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 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1271 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1272 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1273 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1274 YYFPRINTF (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 1535 of yacc.c */
1693 #line 86 "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 1535 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 1535 of yacc.c */
1888 #line 223 "parse-gram.y"
1890 code_props plain_code
;
1891 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1892 code_props_translate_code (&plain_code
);
1893 gram_scanner_last_string_free ();
1894 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1895 plain_code
.code
, (yylsp
[(1) - (1)]));
1896 code_scanner_last_string_free ();
1902 /* Line 1535 of yacc.c */
1903 #line 232 "parse-gram.y"
1904 { debug_flag
= true; }
1909 /* Line 1535 of yacc.c */
1910 #line 234 "parse-gram.y"
1912 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
));
1918 /* Line 1535 of yacc.c */
1919 #line 237 "parse-gram.y"
1920 { defines_flag
= true; }
1925 /* Line 1535 of yacc.c */
1926 #line 239 "parse-gram.y"
1928 defines_flag
= true;
1929 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1935 /* Line 1535 of yacc.c */
1936 #line 243 "parse-gram.y"
1937 { error_verbose
= true; }
1942 /* Line 1535 of yacc.c */
1943 #line 244 "parse-gram.y"
1944 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1949 /* Line 1535 of yacc.c */
1950 #line 245 "parse-gram.y"
1951 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1956 /* Line 1535 of yacc.c */
1957 #line 246 "parse-gram.y"
1958 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1963 /* Line 1535 of yacc.c */
1964 #line 247 "parse-gram.y"
1965 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1970 /* Line 1535 of yacc.c */
1971 #line 249 "parse-gram.y"
1973 nondeterministic_parser
= true;
1980 /* Line 1535 of yacc.c */
1981 #line 254 "parse-gram.y"
1984 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
1985 code_props_translate_code (&action
);
1986 gram_scanner_last_string_free ();
1987 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
1988 code_scanner_last_string_free ();
1994 /* Line 1535 of yacc.c */
1995 #line 262 "parse-gram.y"
1996 { language_argmatch ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2001 /* Line 1535 of yacc.c */
2002 #line 263 "parse-gram.y"
2003 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2008 /* Line 1535 of yacc.c */
2009 #line 264 "parse-gram.y"
2010 { locations_flag
= true; }
2015 /* Line 1535 of yacc.c */
2016 #line 265 "parse-gram.y"
2017 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2022 /* Line 1535 of yacc.c */
2023 #line 266 "parse-gram.y"
2024 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2029 /* Line 1535 of yacc.c */
2030 #line 267 "parse-gram.y"
2031 { no_lines_flag
= true; }
2036 /* Line 1535 of yacc.c */
2037 #line 268 "parse-gram.y"
2038 { nondeterministic_parser
= true; }
2043 /* Line 1535 of yacc.c */
2044 #line 269 "parse-gram.y"
2045 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2050 /* Line 1535 of yacc.c */
2051 #line 270 "parse-gram.y"
2052 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2057 /* Line 1535 of yacc.c */
2058 #line 271 "parse-gram.y"
2059 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2064 /* Line 1535 of yacc.c */
2065 #line 272 "parse-gram.y"
2066 { pure_parser
= true; }
2071 /* Line 1535 of yacc.c */
2072 #line 273 "parse-gram.y"
2073 { push_parser
= true; pull_parser
= false; }
2078 /* Line 1535 of yacc.c */
2079 #line 274 "parse-gram.y"
2080 { push_parser
= true; pull_parser
= true; }
2085 /* Line 1535 of yacc.c */
2086 #line 275 "parse-gram.y"
2087 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2092 /* Line 1535 of yacc.c */
2093 #line 277 "parse-gram.y"
2095 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2096 if (strchr (skeleton_user
, '/'))
2098 size_t dir_length
= strlen (current_file
);
2099 char *skeleton_build
;
2100 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2102 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2105 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2108 strncpy (skeleton_build
, current_file
, dir_length
);
2109 skeleton_build
[dir_length
++] = '/';
2111 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2112 skeleton_user
= uniqstr_new (skeleton_build
);
2113 free (skeleton_build
);
2115 skeleton_arg (skeleton_user
, 1, &(yylsp
[(1) - (2)]));
2121 /* Line 1535 of yacc.c */
2122 #line 300 "parse-gram.y"
2123 { token_table_flag
= true; }
2128 /* Line 1535 of yacc.c */
2129 #line 301 "parse-gram.y"
2130 { report_flag
= report_states
; }
2135 /* Line 1535 of yacc.c */
2136 #line 302 "parse-gram.y"
2137 { yacc_flag
= true; }
2142 /* Line 1535 of yacc.c */
2143 #line 310 "parse-gram.y"
2145 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2151 /* Line 1535 of yacc.c */
2152 #line 314 "parse-gram.y"
2155 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2156 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2157 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2163 /* Line 1535 of yacc.c */
2164 #line 321 "parse-gram.y"
2167 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2168 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2169 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2175 /* Line 1535 of yacc.c */
2176 #line 328 "parse-gram.y"
2178 default_prec
= true;
2184 /* Line 1535 of yacc.c */
2185 #line 332 "parse-gram.y"
2187 default_prec
= false;
2193 /* Line 1535 of yacc.c */
2194 #line 336 "parse-gram.y"
2196 /* Do not invoke muscle_percent_code_grow here since it invokes
2197 muscle_user_name_list_grow. */
2198 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2199 code_scanner_last_string_free ();
2205 /* Line 1535 of yacc.c */
2206 #line 343 "parse-gram.y"
2208 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2209 code_scanner_last_string_free ();
2215 /* Line 1535 of yacc.c */
2216 #line 357 "parse-gram.y"
2222 /* Line 1535 of yacc.c */
2223 #line 358 "parse-gram.y"
2224 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2229 /* Line 1535 of yacc.c */
2230 #line 363 "parse-gram.y"
2233 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2234 code_scanner_last_string_free ();
2240 /* Line 1535 of yacc.c */
2241 #line 374 "parse-gram.y"
2242 { current_class
= nterm_sym
; }
2247 /* Line 1535 of yacc.c */
2248 #line 375 "parse-gram.y"
2250 current_class
= unknown_sym
;
2251 current_type
= NULL
;
2257 /* Line 1535 of yacc.c */
2258 #line 379 "parse-gram.y"
2259 { current_class
= token_sym
; }
2264 /* Line 1535 of yacc.c */
2265 #line 380 "parse-gram.y"
2267 current_class
= unknown_sym
;
2268 current_type
= NULL
;
2274 /* Line 1535 of yacc.c */
2275 #line 385 "parse-gram.y"
2279 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2280 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2281 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2287 /* Line 1535 of yacc.c */
2288 #line 396 "parse-gram.y"
2292 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2294 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2295 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2297 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2298 current_type
= NULL
;
2304 /* Line 1535 of yacc.c */
2305 #line 410 "parse-gram.y"
2306 { (yyval
.assoc
) = left_assoc
; }
2311 /* Line 1535 of yacc.c */
2312 #line 411 "parse-gram.y"
2313 { (yyval
.assoc
) = right_assoc
; }
2318 /* Line 1535 of yacc.c */
2319 #line 412 "parse-gram.y"
2320 { (yyval
.assoc
) = non_assoc
; }
2325 /* Line 1535 of yacc.c */
2326 #line 416 "parse-gram.y"
2327 { current_type
= NULL
; }
2332 /* Line 1535 of yacc.c */
2333 #line 417 "parse-gram.y"
2334 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2339 /* Line 1535 of yacc.c */
2340 #line 423 "parse-gram.y"
2341 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2346 /* Line 1535 of yacc.c */
2347 #line 425 "parse-gram.y"
2348 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2353 /* Line 1535 of yacc.c */
2354 #line 429 "parse-gram.y"
2355 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2360 /* Line 1535 of yacc.c */
2361 #line 430 "parse-gram.y"
2362 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2367 /* Line 1535 of yacc.c */
2368 #line 434 "parse-gram.y"
2369 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2374 /* Line 1535 of yacc.c */
2375 #line 435 "parse-gram.y"
2376 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2381 /* Line 1535 of yacc.c */
2382 #line 436 "parse-gram.y"
2383 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2388 /* Line 1535 of yacc.c */
2389 #line 437 "parse-gram.y"
2390 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2395 /* Line 1535 of yacc.c */
2396 #line 443 "parse-gram.y"
2398 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2405 /* Line 1535 of yacc.c */
2406 #line 448 "parse-gram.y"
2408 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2409 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2415 /* Line 1535 of yacc.c */
2416 #line 453 "parse-gram.y"
2418 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2419 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2420 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2426 /* Line 1535 of yacc.c */
2427 #line 459 "parse-gram.y"
2429 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2430 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2431 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2437 /* Line 1535 of yacc.c */
2438 #line 465 "parse-gram.y"
2440 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2441 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2442 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2443 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2449 /* Line 1535 of yacc.c */
2450 #line 495 "parse-gram.y"
2458 /* Line 1535 of yacc.c */
2459 #line 501 "parse-gram.y"
2460 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2465 /* Line 1535 of yacc.c */
2466 #line 505 "parse-gram.y"
2467 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2472 /* Line 1535 of yacc.c */
2473 #line 506 "parse-gram.y"
2474 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2479 /* Line 1535 of yacc.c */
2480 #line 512 "parse-gram.y"
2481 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2486 /* Line 1535 of yacc.c */
2487 #line 514 "parse-gram.y"
2488 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2493 /* Line 1535 of yacc.c */
2494 #line 516 "parse-gram.y"
2495 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2500 /* Line 1535 of yacc.c */
2501 #line 518 "parse-gram.y"
2502 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2507 /* Line 1535 of yacc.c */
2508 #line 520 "parse-gram.y"
2509 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2514 /* Line 1535 of yacc.c */
2515 #line 522 "parse-gram.y"
2516 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2521 /* Line 1535 of yacc.c */
2522 #line 532 "parse-gram.y"
2523 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2528 /* Line 1535 of yacc.c */
2529 #line 538 "parse-gram.y"
2537 /* Line 1535 of yacc.c */
2538 #line 551 "parse-gram.y"
2540 code_props plain_code
;
2541 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2542 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2543 code_props_translate_code (&plain_code
);
2544 gram_scanner_last_string_free ();
2545 (yyval
.chars
) = plain_code
.code
;
2551 /* Line 1535 of yacc.c */
2552 #line 571 "parse-gram.y"
2553 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2558 /* Line 1535 of yacc.c */
2559 #line 573 "parse-gram.y"
2561 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2562 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2563 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2569 /* Line 1535 of yacc.c */
2570 #line 581 "parse-gram.y"
2571 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2576 /* Line 1535 of yacc.c */
2577 #line 593 "parse-gram.y"
2579 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2580 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2586 /* Line 1535 of yacc.c */
2587 #line 602 "parse-gram.y"
2589 code_props plain_code
;
2590 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2591 code_props_translate_code (&plain_code
);
2592 gram_scanner_last_string_free ();
2593 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2594 code_scanner_last_string_free ();
2600 /* Line 1535 of yacc.c */
2601 #line 2602 "parse-gram.c"
2604 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2608 YY_STACK_PRINT (yyss
, yyssp
);
2613 /* Now `shift' the result of the reduction. Determine what state
2614 that goes to, based on the state we popped back to and the rule
2615 number reduced by. */
2619 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2620 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2621 yystate
= yytable
[yystate
];
2623 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2628 /*------------------------------------.
2629 | yyerrlab -- here on detecting error |
2630 `------------------------------------*/
2632 /* If not already recovering from an error, report this error. */
2636 #if ! YYERROR_VERBOSE
2637 yyerror (YY_("syntax error"));
2640 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2641 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2643 YYSIZE_T yyalloc
= 2 * yysize
;
2644 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2645 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2646 if (yymsg
!= yymsgbuf
)
2647 YYSTACK_FREE (yymsg
);
2648 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2650 yymsg_alloc
= yyalloc
;
2654 yymsg_alloc
= sizeof yymsgbuf
;
2658 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2660 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2665 yyerror (YY_("syntax error"));
2667 goto yyexhaustedlab
;
2673 yyerror_range
[0] = yylloc
;
2675 if (yyerrstatus
== 3)
2677 /* If just tried and failed to reuse lookahead token after an
2678 error, discard it. */
2680 if (yychar
<= YYEOF
)
2682 /* Return failure if at end of input. */
2683 if (yychar
== YYEOF
)
2688 yydestruct ("Error: discarding",
2689 yytoken
, &yylval
, &yylloc
);
2694 /* Else will try to reuse lookahead token after shifting the error
2699 /*---------------------------------------------------.
2700 | yyerrorlab -- error raised explicitly by YYERROR. |
2701 `---------------------------------------------------*/
2704 /* Pacify compilers like GCC when the user code never invokes
2705 YYERROR and the label yyerrorlab therefore never appears in user
2707 if (/*CONSTCOND*/ 0)
2710 yyerror_range
[0] = yylsp
[1-yylen
];
2711 /* Do not reclaim the symbols of the rule which action triggered
2715 YY_STACK_PRINT (yyss
, yyssp
);
2720 /*-------------------------------------------------------------.
2721 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2722 `-------------------------------------------------------------*/
2724 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2728 yyn
= yypact
[yystate
];
2729 if (yyn
!= YYPACT_NINF
)
2732 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2740 /* Pop the current state because it cannot handle the error token. */
2744 yyerror_range
[0] = *yylsp
;
2745 yydestruct ("Error: popping",
2746 yystos
[yystate
], yyvsp
, yylsp
);
2749 YY_STACK_PRINT (yyss
, yyssp
);
2754 yyerror_range
[1] = yylloc
;
2755 /* Using YYLLOC is tempting, but would change the location of
2756 the lookahead. YYLOC is available though. */
2757 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2760 /* Shift the error token. */
2761 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2767 /*-------------------------------------.
2768 | yyacceptlab -- YYACCEPT comes here. |
2769 `-------------------------------------*/
2774 /*-----------------------------------.
2775 | yyabortlab -- YYABORT comes here. |
2776 `-----------------------------------*/
2781 #if !defined(yyoverflow) || YYERROR_VERBOSE
2782 /*-------------------------------------------------.
2783 | yyexhaustedlab -- memory exhaustion comes here. |
2784 `-------------------------------------------------*/
2786 yyerror (YY_("memory exhausted"));
2792 if (yychar
!= YYEMPTY
)
2793 yydestruct ("Cleanup: discarding lookahead",
2794 yytoken
, &yylval
, &yylloc
);
2795 /* Do not reclaim the symbols of the rule which action triggered
2796 this YYABORT or YYACCEPT. */
2798 YY_STACK_PRINT (yyss
, yyssp
);
2799 while (yyssp
!= yyss
)
2801 yydestruct ("Cleanup: popping",
2802 yystos
[*yyssp
], yyvsp
, yylsp
);
2807 YYSTACK_FREE (yyss
);
2810 if (yymsg
!= yymsgbuf
)
2811 YYSTACK_FREE (yymsg
);
2813 /* Make sure YYID is used. */
2814 return YYID (yyresult
);
2819 /* Line 1535 of yacc.c */
2820 #line 612 "parse-gram.y"
2824 /* Return the location of the left-hand side of a rule whose
2825 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2826 the right-hand side, and return an empty location equal to the end
2827 boundary of RHS[0] if the right-hand side is empty. */
2830 lloc_default (YYLTYPE
const *rhs
, int n
)
2835 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2836 The bug is fixed in 7.4.2m, but play it safe for now. */
2837 loc
.start
= rhs
[n
].end
;
2838 loc
.end
= rhs
[n
].end
;
2840 /* Ignore empty nonterminals the start of the the right-hand side.
2841 Do not bother to ignore them at the end of the right-hand side,
2842 since empty nonterminals have the same end as their predecessors. */
2843 for (i
= 1; i
<= n
; i
++)
2844 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2846 loc
.start
= rhs
[i
].start
;
2854 /* Add a lex-param or a parse-param (depending on TYPE) with
2855 declaration DECL and location LOC. */
2858 add_param (char const *type
, char *decl
, location loc
)
2860 static char const alphanum
[26 + 26 + 1 + 10] =
2861 "abcdefghijklmnopqrstuvwxyz"
2862 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2865 char const *name_start
= NULL
;
2868 /* Stop on last actual character. */
2869 for (p
= decl
; p
[1]; p
++)
2871 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2872 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2875 /* Strip the surrounding '{' and '}', and any blanks just inside
2877 while (*--p
== ' ' || *p
== '\t')
2880 while (*++decl
== ' ' || *decl
== '\t')
2884 complain_at (loc
, _("missing identifier in parameter declaration"));
2891 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2895 name
= xmalloc (name_len
+ 1);
2896 memcpy (name
, name_start
, name_len
);
2897 name
[name_len
] = '\0';
2898 muscle_pair_list_grow (type
, decl
, name
);
2902 gram_scanner_last_string_free ();
2907 version_check (location
const *loc
, char const *version
)
2909 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2911 complain_at (*loc
, "require bison %s, but have %s",
2912 version
, PACKAGE_VERSION
);
2918 gram_error (location
const *loc
, char const *msg
)
2920 complain_at (*loc
, "%s", msg
);
2924 token_name (int type
)
2926 return yytname
[YYTRANSLATE (type
)];
2937 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2938 return quotearg_style (escape_quoting_style
, buf
);