1 /* A Bison parser, made by GNU Bison 2.4.1.61-f1ce. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
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 3 of the License, or
11 (at your option) any later version.
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, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.1.61-f1ce"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 1
65 /* Substitute the variable and function names. */
66 #define yyparse gram_parse
67 #define yylex gram_lex
68 #define yyerror gram_error
69 #define yylval gram_lval
70 #define yychar gram_char
71 #define yydebug gram_debug
72 #define yynerrs gram_nerrs
73 #define yylloc gram_lloc
75 /* Copy the first part of user declarations. */
77 /* Line 189 of yacc.c */
78 #line 1 "parse-gram.y"
79 /* Bison Grammar Parser -*- C -*-
81 Copyright (C) 2002-2010 Free Software Foundation, Inc.
83 This file is part of Bison, the GNU Compiler Compiler.
85 This program is free software: you can redistribute it and/or modify
86 it under the terms of the GNU General Public License as published by
87 the Free Software Foundation, either version 3 of the License, or
88 (at your option) any later version.
90 This program is distributed in the hope that it will be useful,
91 but WITHOUT ANY WARRANTY; without even the implied warranty of
92 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93 GNU General Public License for more details.
95 You should have received a copy of the GNU General Public License
96 along with this program. If not, see <http://www.gnu.org/licenses/>. */
101 #include "complain.h"
102 #include "conflicts.h"
106 #include "muscle_tab.h"
107 #include "quotearg.h"
110 #include "scan-gram.h"
111 #include "scan-code.h"
113 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
114 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
116 #define YY_LOCATION_PRINT(File, Loc) \
117 location_print (File, Loc)
119 static void version_check (location
const *loc
, char const *version
);
121 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
122 FIXME: depends on the undocumented availability of YYLLOC. */
124 #define yyerror(Msg) \
125 gram_error (&yylloc, Msg)
126 static void gram_error (location
const *, char const *);
128 static char const *char_name (char);
130 /** Add a lex-param or a parse-param.
132 * \param type \a lex_param or \a parse_param
133 * \param decl the formal argument
134 * \param loc the location in the source.
136 static void add_param (char const *type
, char *decl
, location loc
);
139 static symbol_class current_class
= unknown_sym
;
140 static uniqstr current_type
= NULL
;
141 static symbol
*current_lhs
;
142 static location current_lhs_location
;
143 static int current_prec
= 0;
145 #define YYTYPE_INT16 int_fast16_t
146 #define YYTYPE_INT8 int_fast8_t
147 #define YYTYPE_UINT16 uint_fast16_t
148 #define YYTYPE_UINT8 uint_fast8_t
151 /* Line 189 of yacc.c */
152 #line 153 "parse-gram.c"
154 /* Enabling traces. */
159 /* Enabling verbose error messages. */
160 #ifdef YYERROR_VERBOSE
161 # undef YYERROR_VERBOSE
162 # define YYERROR_VERBOSE 1
164 # define YYERROR_VERBOSE 1
167 /* Enabling the token table. */
168 #ifndef YYTOKEN_TABLE
169 # define YYTOKEN_TABLE 0
176 /* Put the tokens into the symbol table, so that GDB and other debuggers
185 PERCENT_DESTRUCTOR
= 263,
186 PERCENT_PRINTER
= 264,
189 PERCENT_NONASSOC
= 267,
195 PERCENT_DEFAULT_PREC
= 273,
196 PERCENT_DEFINE
= 274,
197 PERCENT_DEFINES
= 275,
198 PERCENT_ERROR_VERBOSE
= 276,
199 PERCENT_EXPECT
= 277,
200 PERCENT_EXPECT_RR
= 278,
201 PERCENT_FILE_PREFIX
= 279,
202 PERCENT_GLR_PARSER
= 280,
203 PERCENT_INITIAL_ACTION
= 281,
204 PERCENT_LANGUAGE
= 282,
205 PERCENT_LEX_PARAM
= 283,
206 PERCENT_LOCATIONS
= 284,
207 PERCENT_NAME_PREFIX
= 285,
208 PERCENT_NO_DEFAULT_PREC
= 286,
209 PERCENT_NO_LINES
= 287,
210 PERCENT_NONDETERMINISTIC_PARSER
= 288,
211 PERCENT_OUTPUT
= 289,
212 PERCENT_PARSE_PARAM
= 290,
213 PERCENT_PURE_PARSER
= 291,
214 PERCENT_REQUIRE
= 292,
215 PERCENT_SKELETON
= 293,
217 PERCENT_TOKEN_TABLE
= 295,
218 PERCENT_VERBOSE
= 296,
226 PERCENT_PERCENT
= 304,
240 #define PERCENT_TOKEN 260
241 #define PERCENT_NTERM 261
242 #define PERCENT_TYPE 262
243 #define PERCENT_DESTRUCTOR 263
244 #define PERCENT_PRINTER 264
245 #define PERCENT_LEFT 265
246 #define PERCENT_RIGHT 266
247 #define PERCENT_NONASSOC 267
248 #define PERCENT_PREC 268
249 #define PERCENT_DPREC 269
250 #define PERCENT_MERGE 270
251 #define PERCENT_CODE 271
252 #define PERCENT_DEBUG 272
253 #define PERCENT_DEFAULT_PREC 273
254 #define PERCENT_DEFINE 274
255 #define PERCENT_DEFINES 275
256 #define PERCENT_ERROR_VERBOSE 276
257 #define PERCENT_EXPECT 277
258 #define PERCENT_EXPECT_RR 278
259 #define PERCENT_FILE_PREFIX 279
260 #define PERCENT_GLR_PARSER 280
261 #define PERCENT_INITIAL_ACTION 281
262 #define PERCENT_LANGUAGE 282
263 #define PERCENT_LEX_PARAM 283
264 #define PERCENT_LOCATIONS 284
265 #define PERCENT_NAME_PREFIX 285
266 #define PERCENT_NO_DEFAULT_PREC 286
267 #define PERCENT_NO_LINES 287
268 #define PERCENT_NONDETERMINISTIC_PARSER 288
269 #define PERCENT_OUTPUT 289
270 #define PERCENT_PARSE_PARAM 290
271 #define PERCENT_PURE_PARSER 291
272 #define PERCENT_REQUIRE 292
273 #define PERCENT_SKELETON 293
274 #define PERCENT_START 294
275 #define PERCENT_TOKEN_TABLE 295
276 #define PERCENT_VERBOSE 296
277 #define PERCENT_YACC 297
278 #define BRACED_CODE 298
284 #define PERCENT_PERCENT 304
287 #define SEMICOLON 307
289 #define TYPE_TAG_ANY 309
290 #define TYPE_TAG_NONE 310
291 #define PERCENT_UNION 311
296 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
297 typedef union YYSTYPE
300 /* Line 214 of yacc.c */
301 #line 91 "parse-gram.y"
310 unsigned char character
;
314 /* Line 214 of yacc.c */
315 #line 316 "parse-gram.c"
317 # define YYSTYPE_IS_TRIVIAL 1
318 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
319 # define YYSTYPE_IS_DECLARED 1
322 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
323 typedef struct YYLTYPE
330 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
331 # define YYLTYPE_IS_DECLARED 1
332 # define YYLTYPE_IS_TRIVIAL 1
336 /* Copy the second part of user declarations. */
339 /* Line 264 of yacc.c */
340 #line 341 "parse-gram.c"
347 typedef YYTYPE_UINT8 yytype_uint8
;
349 typedef unsigned char yytype_uint8
;
353 typedef YYTYPE_INT8 yytype_int8
;
354 #elif (defined __STDC__ || defined __C99__FUNC__ \
355 || defined __cplusplus || defined _MSC_VER)
356 typedef signed char yytype_int8
;
358 typedef short int yytype_int8
;
362 typedef YYTYPE_UINT16 yytype_uint16
;
364 typedef unsigned short int yytype_uint16
;
368 typedef YYTYPE_INT16 yytype_int16
;
370 typedef short int yytype_int16
;
374 # ifdef __SIZE_TYPE__
375 # define YYSIZE_T __SIZE_TYPE__
376 # elif defined size_t
377 # define YYSIZE_T size_t
378 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
379 || defined __cplusplus || defined _MSC_VER)
380 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
381 # define YYSIZE_T size_t
383 # define YYSIZE_T unsigned int
387 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
390 # if defined YYENABLE_NLS && YYENABLE_NLS
392 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
393 # define YY_(msgid) dgettext ("bison-runtime", msgid)
397 # define YY_(msgid) msgid
401 /* Suppress unused-variable warnings by "using" E. */
402 #if ! defined lint || defined __GNUC__
403 # define YYUSE(e) ((void) (e))
405 # define YYUSE(e) /* empty */
408 /* Identity function, used to suppress warnings about constant conditions. */
412 #if (defined __STDC__ || defined __C99__FUNC__ \
413 || defined __cplusplus || defined _MSC_VER)
426 #if ! defined yyoverflow || YYERROR_VERBOSE
428 /* The parser invokes alloca or malloc; define the necessary symbols. */
430 # ifdef YYSTACK_USE_ALLOCA
431 # if YYSTACK_USE_ALLOCA
433 # define YYSTACK_ALLOC __builtin_alloca
434 # elif defined __BUILTIN_VA_ARG_INCR
435 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
437 # define YYSTACK_ALLOC __alloca
438 # elif defined _MSC_VER
439 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
440 # define alloca _alloca
442 # define YYSTACK_ALLOC alloca
443 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
444 || defined __cplusplus || defined _MSC_VER)
445 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
454 # ifdef YYSTACK_ALLOC
455 /* Pacify GCC's `empty if-body' warning. */
456 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
457 # ifndef YYSTACK_ALLOC_MAXIMUM
458 /* The OS might guarantee only one guard page at the bottom of the stack,
459 and a page size can be as small as 4096 bytes. So we cannot safely
460 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
461 to allow for a few compiler-allocated temporary stack slots. */
462 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
465 # define YYSTACK_ALLOC YYMALLOC
466 # define YYSTACK_FREE YYFREE
467 # ifndef YYSTACK_ALLOC_MAXIMUM
468 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
470 # if (defined __cplusplus && ! defined _STDLIB_H \
471 && ! ((defined YYMALLOC || defined malloc) \
472 && (defined YYFREE || defined free)))
473 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
479 # define YYMALLOC malloc
480 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
481 || defined __cplusplus || defined _MSC_VER)
482 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
487 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
488 || defined __cplusplus || defined _MSC_VER)
489 void free (void *); /* INFRINGES ON USER NAME SPACE */
493 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
496 #if (! defined yyoverflow \
497 && (! defined __cplusplus \
498 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
499 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
501 /* A type that is properly aligned for any stack member. */
504 yytype_int16 yyss_alloc
;
509 /* The size of the maximum gap between one aligned stack and the next. */
510 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
512 /* The size of an array large to enough to hold all stacks, each with
514 # define YYSTACK_BYTES(N) \
515 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
516 + 2 * YYSTACK_GAP_MAXIMUM)
518 /* Copy COUNT objects from FROM to TO. The source and destination do
521 # if defined __GNUC__ && 1 < __GNUC__
522 # define YYCOPY(To, From, Count) \
523 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
525 # define YYCOPY(To, From, Count) \
529 for (yyi = 0; yyi < (Count); yyi++) \
530 (To)[yyi] = (From)[yyi]; \
536 /* Relocate STACK from its old location to the new one. The
537 local variables YYSIZE and YYSTACKSIZE give the old and new number of
538 elements in the stack, and YYPTR gives the new location of the
539 stack. Advance YYPTR to a properly aligned location for the next
541 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
544 YYSIZE_T yynewbytes; \
545 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
546 Stack = &yyptr->Stack_alloc; \
547 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
548 yyptr += yynewbytes / sizeof (*yyptr); \
554 /* YYFINAL -- State number of the termination state. */
556 /* YYLAST -- Last index in YYTABLE. */
559 /* YYNTOKENS -- Number of terminals. */
561 /* YYNNTS -- Number of nonterminals. */
563 /* YYNRULES -- Number of rules. */
565 /* YYNRULES -- Number of states. */
566 #define YYNSTATES 143
568 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
570 #define YYMAXUTOK 311
572 #define YYTRANSLATE(YYX) \
573 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
575 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
576 static const yytype_uint8 yytranslate
[] =
578 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
604 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
605 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
606 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
607 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
608 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
613 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
615 static const yytype_uint16 yyprhs
[] =
617 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
618 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
619 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
620 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
621 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
622 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
623 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
624 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
625 206, 209, 212, 213, 217, 219, 223, 226, 227, 230,
626 233, 237, 241, 245, 247, 249, 250, 252, 254, 256,
627 258, 260, 262, 264, 266, 267
630 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
631 static const yytype_int8 yyrhs
[] =
633 58, 0, -1, 59, 49, 76, 89, -1, -1, 59,
634 60, -1, 61, -1, 51, -1, 17, -1, 19, 82,
635 83, -1, 20, -1, 20, 3, -1, 21, -1, 22,
636 4, -1, 23, 4, -1, 24, 3, -1, 24, 46,
637 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
638 28, 43, -1, 29, -1, 30, 3, -1, 30, 46,
639 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
640 46, 3, -1, 35, 43, -1, 36, -1, 37, 3,
641 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
642 52, -1, 66, -1, 63, -1, 39, 87, -1, 8,
643 43, 72, -1, 9, 43, 72, -1, 18, -1, 31,
644 -1, 16, 84, -1, 16, 47, 84, -1, -1, 47,
645 -1, 56, 62, 84, -1, -1, 6, 64, 75, -1,
646 -1, 5, 65, 75, -1, 7, 53, 71, -1, 67,
647 68, 69, -1, 10, -1, 11, -1, 12, -1, -1,
648 53, -1, 70, -1, 69, 70, -1, 87, -1, 87,
649 4, -1, 87, -1, 71, 87, -1, 73, -1, 72,
650 73, -1, 87, -1, 53, -1, 54, -1, 55, -1,
651 53, -1, 85, -1, 85, 4, -1, 85, 88, -1,
652 85, 4, 88, -1, 74, -1, 75, 74, -1, 77,
653 -1, 76, 77, -1, 78, -1, 61, 52, -1, 1,
654 52, -1, -1, 86, 79, 80, -1, 81, -1, 80,
655 50, 81, -1, 80, 52, -1, -1, 81, 87, -1,
656 81, 43, -1, 81, 13, 87, -1, 81, 14, 4,
657 -1, 81, 15, 53, -1, 47, -1, 3, -1, -1,
658 3, -1, 43, -1, 47, -1, 44, -1, 48, -1,
659 85, -1, 88, -1, 3, -1, -1, 49, 45, -1
662 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
663 static const yytype_uint16 yyrline
[] =
665 0, 201, 201, 209, 211, 215, 216, 226, 227, 231,
666 232, 237, 238, 239, 240, 241, 242, 247, 256, 257,
667 258, 259, 260, 261, 262, 263, 264, 265, 266, 279,
668 280, 304, 305, 306, 307, 311, 312, 313, 317, 324,
669 331, 335, 339, 346, 361, 362, 366, 378, 378, 383,
670 383, 388, 399, 414, 415, 416, 420, 421, 426, 428,
671 433, 434, 439, 441, 446, 447, 451, 452, 453, 454,
672 459, 464, 469, 475, 481, 492, 493, 502, 503, 509,
673 510, 511, 518, 518, 522, 523, 524, 529, 530, 532,
674 534, 536, 538, 548, 549, 555, 558, 567, 587, 589,
675 598, 603, 604, 609, 616, 618
679 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
680 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
681 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
682 static const char *const yytname
[] =
684 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
685 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
686 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
687 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
688 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
689 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
690 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
691 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
692 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
693 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
694 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
695 "\"{...}\"", "\"char\"", "\"epilogue\"", "\"=\"", "\"identifier\"",
696 "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"",
697 "\"<*>\"", "\"<>\"", "\"%union\"", "$accept", "input",
698 "prologue_declarations", "prologue_declaration", "grammar_declaration",
699 "union_name", "symbol_declaration", "$@1", "$@2",
700 "precedence_declaration", "precedence_declarator", "type.opt",
701 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
702 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
703 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
704 "variable", "content.opt", "braceless", "id", "id_colon", "symbol",
705 "string_as_id", "epilogue.opt", 0
710 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
712 static const yytype_uint16 yytoknum
[] =
714 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
715 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
716 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
717 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
718 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
719 305, 306, 307, 308, 309, 310, 311
723 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
724 static const yytype_uint8 yyr1
[] =
726 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
727 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
728 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
729 60, 60, 60, 60, 60, 61, 61, 61, 61, 61,
730 61, 61, 61, 61, 62, 62, 61, 64, 63, 65,
731 63, 63, 66, 67, 67, 67, 68, 68, 69, 69,
732 70, 70, 71, 71, 72, 72, 73, 73, 73, 73,
733 74, 74, 74, 74, 74, 75, 75, 76, 76, 77,
734 77, 77, 79, 78, 80, 80, 80, 81, 81, 81,
735 81, 81, 81, 82, 82, 83, 83, 84, 85, 85,
736 86, 87, 87, 88, 89, 89
739 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
740 static const yytype_uint8 yyr2
[] =
742 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
743 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
744 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
745 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
746 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
747 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
748 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
749 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
750 2, 2, 0, 3, 1, 3, 2, 0, 2, 2,
751 3, 3, 3, 1, 1, 0, 1, 1, 1, 1,
755 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
756 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
757 means the default is an error. */
758 static const yytype_uint8 yydefact
[] =
760 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
761 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
762 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
763 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
764 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
765 0, 0, 0, 97, 0, 42, 94, 93, 95, 10,
766 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
767 0, 27, 29, 30, 103, 99, 98, 101, 37, 102,
768 0, 100, 0, 0, 77, 79, 82, 45, 0, 57,
769 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
770 69, 38, 64, 66, 39, 43, 96, 8, 15, 22,
771 26, 81, 80, 0, 78, 2, 87, 46, 52, 58,
772 60, 76, 72, 73, 63, 65, 105, 83, 84, 59,
773 61, 74, 87, 86, 0, 0, 0, 89, 88, 85,
777 /* YYDEFGOTO[NTERM-NUM]. */
778 static const yytype_int16 yydefgoto
[] =
780 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
781 47, 90, 118, 119, 96, 101, 102, 92, 93, 83,
782 84, 85, 116, 127, 128, 58, 107, 55, 77, 86,
786 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
788 #define YYPACT_NINF -60
789 static const yytype_int16 yypact
[] =
791 -60, 18, 100, -60, -60, -60, -16, 24, 27, -60,
792 -60, -60, -8, -60, -60, 11, 70, -60, 71, 80,
793 2, -60, 46, 87, 48, -60, 31, -60, -60, -60,
794 40, 49, -60, 91, 92, 0, -60, -60, -60, 15,
795 -60, -60, 50, -60, -60, -60, -60, 43, 12, 12,
796 0, 25, 25, -60, 55, -60, -60, -60, 97, -60,
797 -60, -60, -60, 98, -60, -60, -60, -60, 99, -60,
798 110, -60, -60, -60, -60, -60, -60, -60, -60, -60,
799 51, -60, 62, 1, -60, -60, -60, -60, 55, -60,
800 0, -60, -60, 12, 84, 12, 0, -60, -60, -60,
801 -60, 25, -60, -60, 25, -60, -60, -60, -60, -60,
802 -60, -60, -60, 101, -60, -60, -60, -60, 0, -60,
803 111, -60, 140, -60, -60, -60, -60, 10, 38, -60,
804 -60, -60, -60, -60, 0, 141, 94, -60, -60, 38,
808 /* YYPGOTO[NTERM-NUM]. */
809 static const yytype_int16 yypgoto
[] =
811 -60, -60, -60, -60, 142, -60, -60, -60, -60, -60,
812 -60, -60, -60, 30, -60, 102, -59, -27, 104, -60,
813 67, -60, -60, -60, 23, -60, -60, -50, -19, -60,
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 -105
822 static const yytype_int16 yytable
[] =
824 78, -104, 80, 74, 105, 62, 4, 5, 6, 7,
825 8, 9, 10, 11, 56, 97, 80, 12, 3, 14,
826 4, 5, 6, 7, 8, 9, 10, 11, 74, 94,
827 94, 12, 27, 14, 67, 53, 123, 50, 117, 54,
828 35, 74, 125, 69, 75, 125, 27, 76, 63, 81,
829 113, 134, 135, 136, 35, 120, 75, 42, 57, 76,
830 132, 124, 133, 81, 131, 91, 121, 51, 121, 75,
831 52, 42, 76, 59, 94, 60, 94, 68, 98, 99,
832 100, 137, 75, 120, 61, 76, 70, 74, 122, 64,
833 65, 66, 71, 138, 72, 73, 89, 87, 53, 140,
834 106, 108, 109, 111, 138, 4, 5, 6, 7, 8,
835 9, 10, 11, 110, 112, 130, 12, 13, 14, 15,
836 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
837 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
838 36, 37, 38, 74, 44, 141, 126, 142, 129, 39,
839 114, 40, 41, 95, 104, 139, 42
842 static const yytype_uint8 yycheck
[] =
844 35, 0, 1, 3, 54, 3, 5, 6, 7, 8,
845 9, 10, 11, 12, 3, 50, 1, 16, 0, 18,
846 5, 6, 7, 8, 9, 10, 11, 12, 3, 48,
847 49, 16, 31, 18, 3, 43, 94, 53, 88, 47,
848 39, 3, 101, 3, 44, 104, 31, 47, 46, 48,
849 49, 13, 14, 15, 39, 90, 44, 56, 47, 47,
850 50, 96, 52, 48, 122, 53, 93, 43, 95, 44,
851 43, 56, 47, 3, 93, 4, 95, 46, 53, 54,
852 55, 43, 44, 118, 4, 47, 46, 3, 4, 43,
853 3, 43, 43, 128, 3, 3, 53, 47, 43, 134,
854 3, 3, 3, 52, 139, 5, 6, 7, 8, 9,
855 10, 11, 12, 3, 52, 4, 16, 17, 18, 19,
856 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
857 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
858 40, 41, 42, 3, 2, 4, 45, 53, 118, 49,
859 83, 51, 52, 49, 52, 132, 56
862 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
863 symbol of state STATE-NUM. */
864 static const yytype_uint8 yystos
[] =
866 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
867 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
868 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
869 34, 35, 36, 37, 38, 39, 40, 41, 42, 49,
870 51, 52, 56, 60, 61, 63, 66, 67, 65, 64,
871 53, 43, 43, 43, 47, 84, 3, 47, 82, 3,
872 4, 4, 3, 46, 43, 3, 43, 3, 46, 3,
873 46, 43, 3, 3, 3, 44, 47, 85, 87, 88,
874 1, 48, 61, 76, 77, 78, 86, 47, 62, 53,
875 68, 53, 74, 75, 85, 75, 71, 87, 53, 54,
876 55, 72, 73, 87, 72, 84, 3, 83, 3, 3,
877 3, 52, 52, 49, 77, 89, 79, 84, 69, 70,
878 87, 74, 4, 88, 87, 73, 45, 80, 81, 70,
879 4, 88, 50, 52, 13, 14, 15, 43, 87, 81,
883 #define yyerrok (yyerrstatus = 0)
884 #define yyclearin (yychar = YYEMPTY)
888 #define YYACCEPT goto yyacceptlab
889 #define YYABORT goto yyabortlab
890 #define YYERROR goto yyerrorlab
893 /* Like YYERROR except do call yyerror. This remains here temporarily
894 to ease the transition to the new meaning of YYERROR, for GCC.
895 Once GCC version 2 has supplanted version 1, this can go. However,
896 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
897 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
900 #define YYFAIL goto yyerrlab
902 /* This is here to suppress warnings from the GCC cpp's
903 -Wunused-macros. Normally we don't worry about that warning, but
904 some users do, and we want to make it easy for users to remove
905 YYFAIL uses, which will produce warnings from Bison 2.5. */
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 defined YYLTYPE_IS_TRIVIAL && 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 724 of yacc.c */
1040 #line 179 "parse-gram.y"
1041 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1043 /* Line 724 of yacc.c */
1044 #line 1045 "parse-gram.c"
1046 case 4: /* "\"integer\"" */
1048 /* Line 724 of yacc.c */
1049 #line 190 "parse-gram.y"
1050 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1052 /* Line 724 of yacc.c */
1053 #line 1054 "parse-gram.c"
1055 case 43: /* "\"{...}\"" */
1057 /* Line 724 of yacc.c */
1058 #line 181 "parse-gram.y"
1059 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1061 /* Line 724 of yacc.c */
1062 #line 1063 "parse-gram.c"
1064 case 44: /* "\"char\"" */
1066 /* Line 724 of yacc.c */
1067 #line 173 "parse-gram.y"
1068 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1070 /* Line 724 of yacc.c */
1071 #line 1072 "parse-gram.c"
1073 case 45: /* "\"epilogue\"" */
1075 /* Line 724 of yacc.c */
1076 #line 181 "parse-gram.y"
1077 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1079 /* Line 724 of yacc.c */
1080 #line 1081 "parse-gram.c"
1082 case 47: /* "\"identifier\"" */
1084 /* Line 724 of yacc.c */
1085 #line 186 "parse-gram.y"
1086 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1088 /* Line 724 of yacc.c */
1089 #line 1090 "parse-gram.c"
1091 case 48: /* "\"identifier:\"" */
1093 /* Line 724 of yacc.c */
1094 #line 187 "parse-gram.y"
1095 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1097 /* Line 724 of yacc.c */
1098 #line 1099 "parse-gram.c"
1100 case 51: /* "\"%{...%}\"" */
1102 /* Line 724 of yacc.c */
1103 #line 181 "parse-gram.y"
1104 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1106 /* Line 724 of yacc.c */
1107 #line 1108 "parse-gram.c"
1109 case 53: /* "\"type\"" */
1111 /* Line 724 of yacc.c */
1112 #line 185 "parse-gram.y"
1113 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1115 /* Line 724 of yacc.c */
1116 #line 1117 "parse-gram.c"
1118 case 82: /* "variable" */
1120 /* Line 724 of yacc.c */
1121 #line 186 "parse-gram.y"
1122 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1124 /* Line 724 of yacc.c */
1125 #line 1126 "parse-gram.c"
1127 case 83: /* "content.opt" */
1129 /* Line 724 of yacc.c */
1130 #line 181 "parse-gram.y"
1131 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1133 /* Line 724 of yacc.c */
1134 #line 1135 "parse-gram.c"
1136 case 84: /* "braceless" */
1138 /* Line 724 of yacc.c */
1139 #line 181 "parse-gram.y"
1140 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1142 /* Line 724 of yacc.c */
1143 #line 1144 "parse-gram.c"
1147 /* Line 724 of yacc.c */
1148 #line 193 "parse-gram.y"
1149 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1151 /* Line 724 of yacc.c */
1152 #line 1153 "parse-gram.c"
1154 case 86: /* "id_colon" */
1156 /* Line 724 of yacc.c */
1157 #line 194 "parse-gram.y"
1158 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1160 /* Line 724 of yacc.c */
1161 #line 1162 "parse-gram.c"
1163 case 87: /* "symbol" */
1165 /* Line 724 of yacc.c */
1166 #line 193 "parse-gram.y"
1167 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1169 /* Line 724 of yacc.c */
1170 #line 1171 "parse-gram.c"
1172 case 88: /* "string_as_id" */
1174 /* Line 724 of yacc.c */
1175 #line 193 "parse-gram.y"
1176 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1178 /* Line 724 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 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1272 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1273 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1274 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1275 YYFPRINTF (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
);
1558 /* Prevent warnings from -Wmissing-prototypes. */
1559 #ifdef YYPARSE_PARAM
1560 #if defined __STDC__ || defined __cplusplus
1561 int yyparse (void *YYPARSE_PARAM
);
1565 #else /* ! YYPARSE_PARAM */
1566 #if defined __STDC__ || defined __cplusplus
1571 #endif /* ! YYPARSE_PARAM */
1577 /*-------------------------.
1578 | yyparse or yypush_parse. |
1579 `-------------------------*/
1581 #ifdef YYPARSE_PARAM
1582 #if (defined __STDC__ || defined __C99__FUNC__ \
1583 || defined __cplusplus || defined _MSC_VER)
1585 yyparse (void *YYPARSE_PARAM
)
1588 yyparse (YYPARSE_PARAM
)
1589 void *YYPARSE_PARAM
;
1591 #else /* ! YYPARSE_PARAM */
1592 #if (defined __STDC__ || defined __C99__FUNC__ \
1593 || defined __cplusplus || defined _MSC_VER)
1603 /* The lookahead symbol. */
1606 /* The semantic value of the lookahead symbol. */
1609 /* Location data for the lookahead symbol. */
1612 /* Number of syntax errors so far. */
1616 /* Number of tokens to shift before error messages enabled. */
1619 /* The stacks and their tools:
1620 `yyss': related to states.
1621 `yyvs': related to semantic values.
1622 `yyls': related to locations.
1624 Refer to the stacks thru separate pointers, to allow yyoverflow
1625 to reallocate them elsewhere. */
1627 /* The state stack. */
1628 yytype_int16 yyssa
[YYINITDEPTH
];
1630 yytype_int16
*yyssp
;
1632 /* The semantic value stack. */
1633 YYSTYPE yyvsa
[YYINITDEPTH
];
1637 /* The location stack. */
1638 YYLTYPE yylsa
[YYINITDEPTH
];
1642 /* The locations where the error started and ended. */
1643 YYLTYPE yyerror_range
[2];
1645 YYSIZE_T yystacksize
;
1649 /* Lookahead token as an internal (translated) token number. */
1651 /* The variables used to return semantic value and location from the
1657 /* Buffer for error messages, and its allocated size. */
1659 char *yymsg
= yymsgbuf
;
1660 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1663 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1665 /* The number of symbols on the RHS of the reduced rule.
1666 Keep to zero when no symbol should be popped. */
1673 yystacksize
= YYINITDEPTH
;
1675 YYDPRINTF ((stderr
, "Starting parse\n"));
1680 yychar
= YYEMPTY
; /* Cause a token to be read. */
1682 /* Initialize stack pointers.
1683 Waste one element of value and location stack
1684 so that they stay on the same level as the state stack.
1685 The wasted elements are never initialized. */
1690 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1691 /* Initialize the default location before parsing starts. */
1692 yylloc
.first_line
= yylloc
.last_line
= 1;
1693 yylloc
.first_column
= yylloc
.last_column
= 1;
1696 /* User initialization code. */
1698 /* Line 1251 of yacc.c */
1699 #line 83 "parse-gram.y"
1701 /* Bison's grammar can initial empty locations, hence a default
1702 location is needed. */
1703 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1704 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1707 /* Line 1251 of yacc.c */
1708 #line 1709 "parse-gram.c"
1713 /*------------------------------------------------------------.
1714 | yynewstate -- Push a new state, which is found in yystate. |
1715 `------------------------------------------------------------*/
1717 /* In all cases, when you get here, the value and location stacks
1718 have just been pushed. So pushing a state here evens the stacks. */
1724 if (yyss
+ yystacksize
- 1 <= yyssp
)
1726 /* Get the current used size of the three stacks, in elements. */
1727 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1731 /* Give user a chance to reallocate the stack. Use copies of
1732 these so that the &'s don't force the real ones into
1734 YYSTYPE
*yyvs1
= yyvs
;
1735 yytype_int16
*yyss1
= yyss
;
1736 YYLTYPE
*yyls1
= yyls
;
1738 /* Each stack pointer address is followed by the size of the
1739 data in use in that stack, in bytes. This used to be a
1740 conditional around just the two extra args, but that might
1741 be undefined if yyoverflow is a macro. */
1742 yyoverflow (YY_("memory exhausted"),
1743 &yyss1
, yysize
* sizeof (*yyssp
),
1744 &yyvs1
, yysize
* sizeof (*yyvsp
),
1745 &yyls1
, yysize
* sizeof (*yylsp
),
1752 #else /* no yyoverflow */
1753 # ifndef YYSTACK_RELOCATE
1754 goto yyexhaustedlab
;
1756 /* Extend the stack our own way. */
1757 if (YYMAXDEPTH
<= yystacksize
)
1758 goto yyexhaustedlab
;
1760 if (YYMAXDEPTH
< yystacksize
)
1761 yystacksize
= YYMAXDEPTH
;
1764 yytype_int16
*yyss1
= yyss
;
1765 union yyalloc
*yyptr
=
1766 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1768 goto yyexhaustedlab
;
1769 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1770 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1771 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1772 # undef YYSTACK_RELOCATE
1774 YYSTACK_FREE (yyss1
);
1777 #endif /* no yyoverflow */
1779 yyssp
= yyss
+ yysize
- 1;
1780 yyvsp
= yyvs
+ yysize
- 1;
1781 yylsp
= yyls
+ yysize
- 1;
1783 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1784 (unsigned long int) yystacksize
));
1786 if (yyss
+ yystacksize
- 1 <= yyssp
)
1790 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1792 if (yystate
== YYFINAL
)
1802 /* Do appropriate processing given the current state. Read a
1803 lookahead token if we need one and don't already have one. */
1805 /* First try to decide what to do without reference to lookahead token. */
1806 yyn
= yypact
[yystate
];
1807 if (yyn
== YYPACT_NINF
)
1810 /* Not known => get a lookahead token if don't already have one. */
1812 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1813 if (yychar
== YYEMPTY
)
1815 YYDPRINTF ((stderr
, "Reading a token: "));
1819 if (yychar
<= YYEOF
)
1821 yychar
= yytoken
= YYEOF
;
1822 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1826 yytoken
= YYTRANSLATE (yychar
);
1827 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1830 /* If the proper action on seeing token YYTOKEN is to reduce or to
1831 detect an error, take that action. */
1833 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1838 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1844 /* Count tokens shifted since error; after three, turn off error
1849 /* Shift the lookahead token. */
1850 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1852 /* Discard the shifted token. */
1861 /*-----------------------------------------------------------.
1862 | yydefault -- do the default action for the current state. |
1863 `-----------------------------------------------------------*/
1865 yyn
= yydefact
[yystate
];
1871 /*-----------------------------.
1872 | yyreduce -- Do a reduction. |
1873 `-----------------------------*/
1875 /* yyn is the number of a rule to reduce with. */
1878 /* If YYLEN is nonzero, implement the default value of the action:
1881 Otherwise, the following line sets YYVAL to garbage.
1882 This behavior is undocumented and Bison
1883 users should not rely upon it. Assigning to YYVAL
1884 unconditionally makes the parser a bit smaller, and it avoids a
1885 GCC warning that YYVAL may be used uninitialized. */
1886 yyval
= yyvsp
[1-yylen
];
1888 /* Default location. */
1889 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1890 YY_REDUCE_PRINT (yyn
);
1895 /* Line 1464 of yacc.c */
1896 #line 217 "parse-gram.y"
1898 code_props plain_code
;
1899 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1900 code_props_translate_code (&plain_code
);
1901 gram_scanner_last_string_free ();
1902 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1903 plain_code
.code
, (yylsp
[(1) - (1)]));
1904 code_scanner_last_string_free ();
1910 /* Line 1464 of yacc.c */
1911 #line 226 "parse-gram.y"
1912 { debug_flag
= true; }
1917 /* Line 1464 of yacc.c */
1918 #line 228 "parse-gram.y"
1920 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
));
1926 /* Line 1464 of yacc.c */
1927 #line 231 "parse-gram.y"
1928 { defines_flag
= true; }
1933 /* Line 1464 of yacc.c */
1934 #line 233 "parse-gram.y"
1936 defines_flag
= true;
1937 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1943 /* Line 1464 of yacc.c */
1944 #line 237 "parse-gram.y"
1945 { error_verbose
= true; }
1950 /* Line 1464 of yacc.c */
1951 #line 238 "parse-gram.y"
1952 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1957 /* Line 1464 of yacc.c */
1958 #line 239 "parse-gram.y"
1959 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1964 /* Line 1464 of yacc.c */
1965 #line 240 "parse-gram.y"
1966 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1971 /* Line 1464 of yacc.c */
1972 #line 241 "parse-gram.y"
1973 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1978 /* Line 1464 of yacc.c */
1979 #line 243 "parse-gram.y"
1981 nondeterministic_parser
= true;
1988 /* Line 1464 of yacc.c */
1989 #line 248 "parse-gram.y"
1992 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
1993 code_props_translate_code (&action
);
1994 gram_scanner_last_string_free ();
1995 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
1996 code_scanner_last_string_free ();
2002 /* Line 1464 of yacc.c */
2003 #line 256 "parse-gram.y"
2004 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, &(yylsp
[(1) - (2)])); }
2009 /* Line 1464 of yacc.c */
2010 #line 257 "parse-gram.y"
2011 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2016 /* Line 1464 of yacc.c */
2017 #line 258 "parse-gram.y"
2018 { locations_flag
= true; }
2023 /* Line 1464 of yacc.c */
2024 #line 259 "parse-gram.y"
2025 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2030 /* Line 1464 of yacc.c */
2031 #line 260 "parse-gram.y"
2032 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2037 /* Line 1464 of yacc.c */
2038 #line 261 "parse-gram.y"
2039 { no_lines_flag
= true; }
2044 /* Line 1464 of yacc.c */
2045 #line 262 "parse-gram.y"
2046 { nondeterministic_parser
= true; }
2051 /* Line 1464 of yacc.c */
2052 #line 263 "parse-gram.y"
2053 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2058 /* Line 1464 of yacc.c */
2059 #line 264 "parse-gram.y"
2060 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2065 /* Line 1464 of yacc.c */
2066 #line 265 "parse-gram.y"
2067 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2072 /* Line 1464 of yacc.c */
2073 #line 267 "parse-gram.y"
2075 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2076 `%define api.pure' in a backward-compatible manner here. First, don't
2077 complain if %pure-parser is specified multiple times. */
2078 if (!muscle_find_const ("percent_define(api.pure)"))
2079 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "");
2080 /* In all cases, use api.pure now so that the backend doesn't complain if
2081 the skeleton ignores api.pure, but do warn now if there's a previous
2082 conflicting definition from an actual %define. */
2083 if (!muscle_percent_define_flag_if ("api.pure"))
2084 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "");
2090 /* Line 1464 of yacc.c */
2091 #line 279 "parse-gram.y"
2092 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2097 /* Line 1464 of yacc.c */
2098 #line 281 "parse-gram.y"
2100 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2101 if (strchr (skeleton_user
, '/'))
2103 size_t dir_length
= strlen (current_file
);
2104 char *skeleton_build
;
2105 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2107 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2110 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2113 strncpy (skeleton_build
, current_file
, dir_length
);
2114 skeleton_build
[dir_length
++] = '/';
2116 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2117 skeleton_user
= uniqstr_new (skeleton_build
);
2118 free (skeleton_build
);
2120 skeleton_arg (skeleton_user
, grammar_prio
, &(yylsp
[(1) - (2)]));
2126 /* Line 1464 of yacc.c */
2127 #line 304 "parse-gram.y"
2128 { token_table_flag
= true; }
2133 /* Line 1464 of yacc.c */
2134 #line 305 "parse-gram.y"
2135 { report_flag
|= report_states
; }
2140 /* Line 1464 of yacc.c */
2141 #line 306 "parse-gram.y"
2142 { yacc_flag
= true; }
2147 /* Line 1464 of yacc.c */
2148 #line 314 "parse-gram.y"
2150 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2156 /* Line 1464 of yacc.c */
2157 #line 318 "parse-gram.y"
2160 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2161 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2162 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2168 /* Line 1464 of yacc.c */
2169 #line 325 "parse-gram.y"
2172 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2173 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2174 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2180 /* Line 1464 of yacc.c */
2181 #line 332 "parse-gram.y"
2183 default_prec
= true;
2189 /* Line 1464 of yacc.c */
2190 #line 336 "parse-gram.y"
2192 default_prec
= false;
2198 /* Line 1464 of yacc.c */
2199 #line 340 "parse-gram.y"
2201 /* Do not invoke muscle_percent_code_grow here since it invokes
2202 muscle_user_name_list_grow. */
2203 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2204 code_scanner_last_string_free ();
2210 /* Line 1464 of yacc.c */
2211 #line 347 "parse-gram.y"
2213 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2214 code_scanner_last_string_free ();
2220 /* Line 1464 of yacc.c */
2221 #line 361 "parse-gram.y"
2227 /* Line 1464 of yacc.c */
2228 #line 362 "parse-gram.y"
2229 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2234 /* Line 1464 of yacc.c */
2235 #line 367 "parse-gram.y"
2238 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2239 code_scanner_last_string_free ();
2245 /* Line 1464 of yacc.c */
2246 #line 378 "parse-gram.y"
2247 { current_class
= nterm_sym
; }
2252 /* Line 1464 of yacc.c */
2253 #line 379 "parse-gram.y"
2255 current_class
= unknown_sym
;
2256 current_type
= NULL
;
2262 /* Line 1464 of yacc.c */
2263 #line 383 "parse-gram.y"
2264 { current_class
= token_sym
; }
2269 /* Line 1464 of yacc.c */
2270 #line 384 "parse-gram.y"
2272 current_class
= unknown_sym
;
2273 current_type
= NULL
;
2279 /* Line 1464 of yacc.c */
2280 #line 389 "parse-gram.y"
2284 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2285 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2286 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2292 /* Line 1464 of yacc.c */
2293 #line 400 "parse-gram.y"
2297 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2299 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2300 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2302 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2303 current_type
= NULL
;
2309 /* Line 1464 of yacc.c */
2310 #line 414 "parse-gram.y"
2311 { (yyval
.assoc
) = left_assoc
; }
2316 /* Line 1464 of yacc.c */
2317 #line 415 "parse-gram.y"
2318 { (yyval
.assoc
) = right_assoc
; }
2323 /* Line 1464 of yacc.c */
2324 #line 416 "parse-gram.y"
2325 { (yyval
.assoc
) = non_assoc
; }
2330 /* Line 1464 of yacc.c */
2331 #line 420 "parse-gram.y"
2332 { current_type
= NULL
; }
2337 /* Line 1464 of yacc.c */
2338 #line 421 "parse-gram.y"
2339 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2344 /* Line 1464 of yacc.c */
2345 #line 427 "parse-gram.y"
2346 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2351 /* Line 1464 of yacc.c */
2352 #line 429 "parse-gram.y"
2353 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2358 /* Line 1464 of yacc.c */
2359 #line 433 "parse-gram.y"
2360 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2365 /* Line 1464 of yacc.c */
2366 #line 434 "parse-gram.y"
2367 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2372 /* Line 1464 of yacc.c */
2373 #line 440 "parse-gram.y"
2374 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2379 /* Line 1464 of yacc.c */
2380 #line 442 "parse-gram.y"
2381 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2386 /* Line 1464 of yacc.c */
2387 #line 446 "parse-gram.y"
2388 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2393 /* Line 1464 of yacc.c */
2394 #line 447 "parse-gram.y"
2395 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2400 /* Line 1464 of yacc.c */
2401 #line 451 "parse-gram.y"
2402 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2407 /* Line 1464 of yacc.c */
2408 #line 452 "parse-gram.y"
2409 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2414 /* Line 1464 of yacc.c */
2415 #line 453 "parse-gram.y"
2416 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2421 /* Line 1464 of yacc.c */
2422 #line 454 "parse-gram.y"
2423 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2428 /* Line 1464 of yacc.c */
2429 #line 460 "parse-gram.y"
2431 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2438 /* Line 1464 of yacc.c */
2439 #line 465 "parse-gram.y"
2441 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2442 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2448 /* Line 1464 of yacc.c */
2449 #line 470 "parse-gram.y"
2451 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2452 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2453 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2459 /* Line 1464 of yacc.c */
2460 #line 476 "parse-gram.y"
2462 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2463 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2464 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2470 /* Line 1464 of yacc.c */
2471 #line 482 "parse-gram.y"
2473 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2474 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2475 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2476 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2482 /* Line 1464 of yacc.c */
2483 #line 512 "parse-gram.y"
2491 /* Line 1464 of yacc.c */
2492 #line 518 "parse-gram.y"
2493 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2498 /* Line 1464 of yacc.c */
2499 #line 522 "parse-gram.y"
2500 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2505 /* Line 1464 of yacc.c */
2506 #line 523 "parse-gram.y"
2507 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2512 /* Line 1464 of yacc.c */
2513 #line 529 "parse-gram.y"
2514 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2519 /* Line 1464 of yacc.c */
2520 #line 531 "parse-gram.y"
2521 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2526 /* Line 1464 of yacc.c */
2527 #line 533 "parse-gram.y"
2528 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2533 /* Line 1464 of yacc.c */
2534 #line 535 "parse-gram.y"
2535 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2540 /* Line 1464 of yacc.c */
2541 #line 537 "parse-gram.y"
2542 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2547 /* Line 1464 of yacc.c */
2548 #line 539 "parse-gram.y"
2549 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2554 /* Line 1464 of yacc.c */
2555 #line 549 "parse-gram.y"
2556 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2561 /* Line 1464 of yacc.c */
2562 #line 555 "parse-gram.y"
2570 /* Line 1464 of yacc.c */
2571 #line 568 "parse-gram.y"
2573 code_props plain_code
;
2574 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2575 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2576 code_props_translate_code (&plain_code
);
2577 gram_scanner_last_string_free ();
2578 (yyval
.chars
) = plain_code
.code
;
2584 /* Line 1464 of yacc.c */
2585 #line 588 "parse-gram.y"
2586 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2591 /* Line 1464 of yacc.c */
2592 #line 590 "parse-gram.y"
2594 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2595 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2596 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2602 /* Line 1464 of yacc.c */
2603 #line 598 "parse-gram.y"
2604 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2609 /* Line 1464 of yacc.c */
2610 #line 610 "parse-gram.y"
2612 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2613 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2619 /* Line 1464 of yacc.c */
2620 #line 619 "parse-gram.y"
2622 code_props plain_code
;
2623 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2624 code_props_translate_code (&plain_code
);
2625 gram_scanner_last_string_free ();
2626 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2627 code_scanner_last_string_free ();
2633 /* Line 1464 of yacc.c */
2634 #line 2635 "parse-gram.c"
2637 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2641 YY_STACK_PRINT (yyss
, yyssp
);
2646 /* Now `shift' the result of the reduction. Determine what state
2647 that goes to, based on the state we popped back to and the rule
2648 number reduced by. */
2652 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2653 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2654 yystate
= yytable
[yystate
];
2656 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2661 /*------------------------------------.
2662 | yyerrlab -- here on detecting error |
2663 `------------------------------------*/
2665 /* If not already recovering from an error, report this error. */
2669 #if ! YYERROR_VERBOSE
2670 yyerror (YY_("syntax error"));
2673 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2674 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2676 YYSIZE_T yyalloc
= 2 * yysize
;
2677 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2678 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2679 if (yymsg
!= yymsgbuf
)
2680 YYSTACK_FREE (yymsg
);
2681 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2683 yymsg_alloc
= yyalloc
;
2687 yymsg_alloc
= sizeof yymsgbuf
;
2691 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2693 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2698 yyerror (YY_("syntax error"));
2700 goto yyexhaustedlab
;
2706 yyerror_range
[0] = yylloc
;
2708 if (yyerrstatus
== 3)
2710 /* If just tried and failed to reuse lookahead token after an
2711 error, discard it. */
2713 if (yychar
<= YYEOF
)
2715 /* Return failure if at end of input. */
2716 if (yychar
== YYEOF
)
2721 yydestruct ("Error: discarding",
2722 yytoken
, &yylval
, &yylloc
);
2727 /* Else will try to reuse lookahead token after shifting the error
2732 /*---------------------------------------------------.
2733 | yyerrorlab -- error raised explicitly by YYERROR. |
2734 `---------------------------------------------------*/
2737 /* Pacify compilers like GCC when the user code never invokes
2738 YYERROR and the label yyerrorlab therefore never appears in user
2740 if (/*CONSTCOND*/ 0)
2743 yyerror_range
[0] = yylsp
[1-yylen
];
2744 /* Do not reclaim the symbols of the rule which action triggered
2748 YY_STACK_PRINT (yyss
, yyssp
);
2753 /*-------------------------------------------------------------.
2754 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2755 `-------------------------------------------------------------*/
2757 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2761 yyn
= yypact
[yystate
];
2762 if (yyn
!= YYPACT_NINF
)
2765 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2773 /* Pop the current state because it cannot handle the error token. */
2777 yyerror_range
[0] = *yylsp
;
2778 yydestruct ("Error: popping",
2779 yystos
[yystate
], yyvsp
, yylsp
);
2782 YY_STACK_PRINT (yyss
, yyssp
);
2787 yyerror_range
[1] = yylloc
;
2788 /* Using YYLLOC is tempting, but would change the location of
2789 the lookahead. YYLOC is available though. */
2790 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2793 /* Shift the error token. */
2794 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2800 /*-------------------------------------.
2801 | yyacceptlab -- YYACCEPT comes here. |
2802 `-------------------------------------*/
2807 /*-----------------------------------.
2808 | yyabortlab -- YYABORT comes here. |
2809 `-----------------------------------*/
2814 #if !defined(yyoverflow) || YYERROR_VERBOSE
2815 /*-------------------------------------------------.
2816 | yyexhaustedlab -- memory exhaustion comes here. |
2817 `-------------------------------------------------*/
2819 yyerror (YY_("memory exhausted"));
2825 if (yychar
!= YYEMPTY
)
2826 yydestruct ("Cleanup: discarding lookahead",
2827 yytoken
, &yylval
, &yylloc
);
2828 /* Do not reclaim the symbols of the rule which action triggered
2829 this YYABORT or YYACCEPT. */
2831 YY_STACK_PRINT (yyss
, yyssp
);
2832 while (yyssp
!= yyss
)
2834 yydestruct ("Cleanup: popping",
2835 yystos
[*yyssp
], yyvsp
, yylsp
);
2840 YYSTACK_FREE (yyss
);
2843 if (yymsg
!= yymsgbuf
)
2844 YYSTACK_FREE (yymsg
);
2846 /* Make sure YYID is used. */
2847 return YYID (yyresult
);
2852 /* Line 1684 of yacc.c */
2853 #line 629 "parse-gram.y"
2857 /* Return the location of the left-hand side of a rule whose
2858 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2859 the right-hand side, and return an empty location equal to the end
2860 boundary of RHS[0] if the right-hand side is empty. */
2863 lloc_default (YYLTYPE
const *rhs
, int n
)
2868 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2869 The bug is fixed in 7.4.2m, but play it safe for now. */
2870 loc
.start
= rhs
[n
].end
;
2871 loc
.end
= rhs
[n
].end
;
2873 /* Ignore empty nonterminals the start of the the right-hand side.
2874 Do not bother to ignore them at the end of the right-hand side,
2875 since empty nonterminals have the same end as their predecessors. */
2876 for (i
= 1; i
<= n
; i
++)
2877 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2879 loc
.start
= rhs
[i
].start
;
2887 /* Add a lex-param or a parse-param (depending on TYPE) with
2888 declaration DECL and location LOC. */
2891 add_param (char const *type
, char *decl
, location loc
)
2893 static char const alphanum
[26 + 26 + 1 + 10] =
2894 "abcdefghijklmnopqrstuvwxyz"
2895 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2898 char const *name_start
= NULL
;
2901 /* Stop on last actual character. */
2902 for (p
= decl
; p
[1]; p
++)
2904 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2905 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2908 /* Strip the surrounding '{' and '}', and any blanks just inside
2910 while (*--p
== ' ' || *p
== '\t')
2913 while (*++decl
== ' ' || *decl
== '\t')
2917 complain_at (loc
, _("missing identifier in parameter declaration"));
2924 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2928 name
= xmalloc (name_len
+ 1);
2929 memcpy (name
, name_start
, name_len
);
2930 name
[name_len
] = '\0';
2931 muscle_pair_list_grow (type
, decl
, name
);
2935 gram_scanner_last_string_free ();
2940 version_check (location
const *loc
, char const *version
)
2942 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2944 complain_at (*loc
, "require bison %s, but have %s",
2945 version
, PACKAGE_VERSION
);
2951 gram_error (location
const *loc
, char const *msg
)
2953 complain_at (*loc
, "%s", msg
);
2957 token_name (int type
)
2959 return yytname
[YYTRANSLATE (type
)];
2970 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2971 return quotearg_style (escape_quoting_style
, buf
);