1 /* A Bison parser, made by GNU Bison 2.6.26-54c4-dirty. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.6.26-54c4-dirty"
50 #define YYSKELETON_NAME "yacc.c"
62 /* Substitute the variable and function names. */
63 #define yyparse gram_parse
64 #define yylex gram_lex
65 #define yyerror gram_error
66 #define yylval gram_lval
67 #define yychar gram_char
68 #define yydebug gram_debug
69 #define yynerrs gram_nerrs
70 #define yylloc gram_lloc
72 /* Copy the first part of user declarations. */
74 /* Line 336 of yacc.c */
75 #line 1 "parse-gram.y"
76 /* Bison Grammar Parser -*- C -*-
78 Copyright (C) 2002-2012 Free Software Foundation, Inc.
80 This file is part of Bison, the GNU Compiler Compiler.
82 This program is free software: you can redistribute it and/or modify
83 it under the terms of the GNU General Public License as published by
84 the Free Software Foundation, either version 3 of the License, or
85 (at your option) any later version.
87 This program is distributed in the hope that it will be useful,
88 but WITHOUT ANY WARRANTY; without even the implied warranty of
89 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
90 GNU General Public License for more details.
92 You should have received a copy of the GNU General Public License
93 along with this program. If not, see <http://www.gnu.org/licenses/>. */
99 #include "conflicts.h"
103 #include "muscle-tab.h"
104 #include "named-ref.h"
105 #include "quotearg.h"
108 #include "scan-gram.h"
109 #include "scan-code.h"
110 #include "xmemdup0.h"
112 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
113 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
115 #define YY_LOCATION_PRINT(File, Loc) \
116 location_print (File, Loc)
118 static void version_check (location
const *loc
, char const *version
);
120 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
121 FIXME: depends on the undocumented availability of YYLLOC. */
123 #define yyerror(Msg) \
124 gram_error (&yylloc, Msg)
125 static void gram_error (location
const *, char const *);
127 static char const *char_name (char);
129 /** Add a lex-param or a parse-param.
131 * \param type \a lex_param or \a parse_param
132 * \param decl the formal argument
133 * \param loc the location in the source.
135 static void add_param (char const *type
, char *decl
, location loc
);
138 static symbol_class current_class
= unknown_sym
;
139 static uniqstr current_type
= NULL
;
140 static symbol
*current_lhs_symbol
;
141 static location current_lhs_location
;
142 static named_ref
*current_lhs_named_ref
;
143 static int current_prec
= 0;
145 /** Set the new current left-hand side symbol, possibly common
146 * to several right-hand side parts of rule.
150 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
152 current_lhs_symbol
= sym
;
153 current_lhs_location
= loc
;
154 /* In order to simplify memory management, named references for lhs
155 are always assigned by deep copy into the current symbol_list
156 node. This is because a single named-ref in the grammar may
157 result in several uses when the user factors lhs between several
158 rules using "|". Therefore free the parser's original copy. */
159 free (current_lhs_named_ref
);
160 current_lhs_named_ref
= ref
;
164 #define YYTYPE_INT16 int_fast16_t
165 #define YYTYPE_INT8 int_fast8_t
166 #define YYTYPE_UINT16 uint_fast16_t
167 #define YYTYPE_UINT8 uint_fast8_t
170 /* Line 336 of yacc.c */
171 #line 172 "parse-gram.c"
174 # if defined __cplusplus && 201103L <= __cplusplus
175 # define YY_NULL nullptr
181 /* Enabling verbose error messages. */
182 #ifdef YYERROR_VERBOSE
183 # undef YYERROR_VERBOSE
184 # define YYERROR_VERBOSE 1
186 # define YYERROR_VERBOSE 1
189 /* In a future release of Bison, this section will be replaced
190 by #include "parse-gram.h". */
192 # define GRAM_Y_TAB_H
193 /* Enabling traces. */
198 extern int gram_debug
;
204 /* Put the tokens into the symbol table, so that GDB and other debuggers
213 PERCENT_DESTRUCTOR
= 263,
214 PERCENT_PRINTER
= 264,
217 PERCENT_NONASSOC
= 267,
223 PERCENT_DEFAULT_PREC
= 273,
224 PERCENT_DEFINE
= 274,
225 PERCENT_DEFINES
= 275,
226 PERCENT_ERROR_VERBOSE
= 276,
227 PERCENT_EXPECT
= 277,
228 PERCENT_EXPECT_RR
= 278,
229 PERCENT_FILE_PREFIX
= 279,
230 PERCENT_GLR_PARSER
= 280,
231 PERCENT_INITIAL_ACTION
= 281,
232 PERCENT_LANGUAGE
= 282,
233 PERCENT_LEX_PARAM
= 283,
234 PERCENT_LOCATIONS
= 284,
235 PERCENT_NAME_PREFIX
= 285,
236 PERCENT_NO_DEFAULT_PREC
= 286,
237 PERCENT_NO_LINES
= 287,
238 PERCENT_NONDETERMINISTIC_PARSER
= 288,
239 PERCENT_OUTPUT
= 289,
240 PERCENT_PARSE_PARAM
= 290,
241 PERCENT_PURE_PARSER
= 291,
242 PERCENT_REQUIRE
= 292,
243 PERCENT_SKELETON
= 293,
245 PERCENT_TOKEN_TABLE
= 295,
246 PERCENT_VERBOSE
= 296,
255 PERCENT_PERCENT
= 305,
269 #define PERCENT_TOKEN 260
270 #define PERCENT_NTERM 261
271 #define PERCENT_TYPE 262
272 #define PERCENT_DESTRUCTOR 263
273 #define PERCENT_PRINTER 264
274 #define PERCENT_LEFT 265
275 #define PERCENT_RIGHT 266
276 #define PERCENT_NONASSOC 267
277 #define PERCENT_PREC 268
278 #define PERCENT_DPREC 269
279 #define PERCENT_MERGE 270
280 #define PERCENT_CODE 271
281 #define PERCENT_DEBUG 272
282 #define PERCENT_DEFAULT_PREC 273
283 #define PERCENT_DEFINE 274
284 #define PERCENT_DEFINES 275
285 #define PERCENT_ERROR_VERBOSE 276
286 #define PERCENT_EXPECT 277
287 #define PERCENT_EXPECT_RR 278
288 #define PERCENT_FILE_PREFIX 279
289 #define PERCENT_GLR_PARSER 280
290 #define PERCENT_INITIAL_ACTION 281
291 #define PERCENT_LANGUAGE 282
292 #define PERCENT_LEX_PARAM 283
293 #define PERCENT_LOCATIONS 284
294 #define PERCENT_NAME_PREFIX 285
295 #define PERCENT_NO_DEFAULT_PREC 286
296 #define PERCENT_NO_LINES 287
297 #define PERCENT_NONDETERMINISTIC_PARSER 288
298 #define PERCENT_OUTPUT 289
299 #define PERCENT_PARSE_PARAM 290
300 #define PERCENT_PURE_PARSER 291
301 #define PERCENT_REQUIRE 292
302 #define PERCENT_SKELETON 293
303 #define PERCENT_START 294
304 #define PERCENT_TOKEN_TABLE 295
305 #define PERCENT_VERBOSE 296
306 #define PERCENT_YACC 297
307 #define BRACED_CODE 298
308 #define BRACKETED_ID 299
314 #define PERCENT_PERCENT 305
317 #define SEMICOLON 308
319 #define TYPE_TAG_ANY 310
320 #define TYPE_TAG_NONE 311
321 #define PERCENT_UNION 312
325 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
326 typedef union YYSTYPE
329 /* Line 350 of yacc.c */
330 #line 114 "parse-gram.y"
339 unsigned char character
;
340 named_ref
*named_ref
;
344 /* Line 350 of yacc.c */
345 #line 346 "parse-gram.c"
347 # define YYSTYPE_IS_TRIVIAL 1
348 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
349 # define YYSTYPE_IS_DECLARED 1
352 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
353 typedef struct YYLTYPE
360 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
361 # define YYLTYPE_IS_DECLARED 1
362 # define YYLTYPE_IS_TRIVIAL 1
367 #if defined __STDC__ || defined __cplusplus
368 int gram_parse (void *YYPARSE_PARAM
);
372 #else /* ! YYPARSE_PARAM */
373 #if defined __STDC__ || defined __cplusplus
374 int gram_parse (void);
378 #endif /* ! YYPARSE_PARAM */
380 #endif /* !GRAM_Y_TAB_H */
382 /* Copy the second part of user declarations. */
385 /* Line 353 of yacc.c */
386 #line 387 "parse-gram.c"
393 typedef YYTYPE_UINT8 yytype_uint8
;
395 typedef unsigned char yytype_uint8
;
399 typedef YYTYPE_INT8 yytype_int8
;
400 #elif (defined __STDC__ || defined __C99__FUNC__ \
401 || defined __cplusplus || defined _MSC_VER)
402 typedef signed char yytype_int8
;
404 typedef short int yytype_int8
;
408 typedef YYTYPE_UINT16 yytype_uint16
;
410 typedef unsigned short int yytype_uint16
;
414 typedef YYTYPE_INT16 yytype_int16
;
416 typedef short int yytype_int16
;
420 # ifdef __SIZE_TYPE__
421 # define YYSIZE_T __SIZE_TYPE__
422 # elif defined size_t
423 # define YYSIZE_T size_t
424 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
425 || defined __cplusplus || defined _MSC_VER)
426 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
427 # define YYSIZE_T size_t
429 # define YYSIZE_T unsigned int
433 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
436 # if defined YYENABLE_NLS && YYENABLE_NLS
438 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
439 # define YY_(msgid) dgettext ("bison-runtime", msgid)
443 # define YY_(msgid) msgid
447 /* Suppress unused-variable warnings by "using" E. */
448 #if ! defined lint || defined __GNUC__
449 # define YYUSE(e) ((void) (e))
451 # define YYUSE(e) /* empty */
454 /* Identity function, used to suppress warnings about constant conditions. */
458 #if (defined __STDC__ || defined __C99__FUNC__ \
459 || defined __cplusplus || defined _MSC_VER)
474 /* The parser invokes alloca or malloc; define the necessary symbols. */
476 # ifdef YYSTACK_ALLOC
477 /* Pacify GCC's `empty if-body' warning. */
478 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
479 # ifndef YYSTACK_ALLOC_MAXIMUM
480 /* The OS might guarantee only one guard page at the bottom of the stack,
481 and a page size can be as small as 4096 bytes. So we cannot safely
482 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
483 to allow for a few compiler-allocated temporary stack slots. */
484 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
487 # define YYSTACK_ALLOC YYMALLOC
488 # define YYSTACK_FREE YYFREE
489 # ifndef YYSTACK_ALLOC_MAXIMUM
490 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
492 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
493 && ! ((defined YYMALLOC || defined malloc) \
494 && (defined YYFREE || defined free)))
495 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
496 # ifndef EXIT_SUCCESS
497 # define EXIT_SUCCESS 0
501 # define YYMALLOC malloc
502 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
503 || defined __cplusplus || defined _MSC_VER)
504 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
509 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
510 || defined __cplusplus || defined _MSC_VER)
511 void free (void *); /* INFRINGES ON USER NAME SPACE */
515 # define YYCOPY_NEEDED 1
519 #if (! defined yyoverflow \
520 && (! defined __cplusplus \
521 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
522 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
524 /* A type that is properly aligned for any stack member. */
527 yytype_int16 yyss_alloc
;
532 /* The size of the maximum gap between one aligned stack and the next. */
533 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
535 /* The size of an array large to enough to hold all stacks, each with
537 # define YYSTACK_BYTES(N) \
538 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
539 + 2 * YYSTACK_GAP_MAXIMUM)
541 # define YYCOPY_NEEDED 1
543 /* Relocate STACK from its old location to the new one. The
544 local variables YYSIZE and YYSTACKSIZE give the old and new number of
545 elements in the stack, and YYPTR gives the new location of the
546 stack. Advance YYPTR to a properly aligned location for the next
548 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
551 YYSIZE_T yynewbytes; \
552 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
553 Stack = &yyptr->Stack_alloc; \
554 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
555 yyptr += yynewbytes / sizeof (*yyptr); \
561 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
562 /* Copy COUNT objects from SRC to DST. The source and destination do
565 # if defined __GNUC__ && 1 < __GNUC__
566 # define YYCOPY(Dst, Src, Count) \
567 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
569 # define YYCOPY(Dst, Src, Count) \
573 for (yyi = 0; yyi < (Count); yyi++) \
574 (Dst)[yyi] = (Src)[yyi]; \
579 #endif /* !YYCOPY_NEEDED */
581 /* YYFINAL -- State number of the termination state. */
583 /* YYLAST -- Last index in YYTABLE. */
586 /* YYNTOKENS -- Number of terminals. */
588 /* YYNNTS -- Number of nonterminals. */
590 /* YYNRULES -- Number of rules. */
592 /* YYNRULES -- Number of states. */
593 #define YYNSTATES 148
595 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
597 #define YYMAXUTOK 312
599 #define YYTRANSLATE(YYX) \
600 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
602 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
603 static const yytype_uint8 yytranslate
[] =
605 0, 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, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
631 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
632 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
633 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
634 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
635 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
640 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
642 static const yytype_uint16 yyprhs
[] =
644 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
645 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
646 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
647 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
648 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
649 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
650 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
651 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
652 206, 209, 212, 213, 218, 220, 224, 227, 228, 232,
653 236, 240, 244, 248, 249, 251, 253, 255, 256, 258,
654 260, 262, 264, 266, 268, 270, 272, 274, 275
657 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
658 static const yytype_int8 yyrhs
[] =
660 59, 0, -1, 60, 50, 77, 91, -1, -1, 60,
661 61, -1, 62, -1, 52, -1, 17, -1, 19, 84,
662 85, -1, 20, -1, 20, 3, -1, 21, -1, 22,
663 4, -1, 23, 4, -1, 24, 3, -1, 24, 47,
664 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
665 28, 43, -1, 29, -1, 30, 3, -1, 30, 47,
666 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
667 47, 3, -1, 35, 43, -1, 36, -1, 37, 3,
668 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
669 53, -1, 67, -1, 64, -1, 39, 89, -1, 8,
670 43, 73, -1, 9, 43, 73, -1, 18, -1, 31,
671 -1, 16, 86, -1, 16, 48, 86, -1, -1, 48,
672 -1, 57, 63, 86, -1, -1, 6, 65, 76, -1,
673 -1, 5, 66, 76, -1, 7, 54, 72, -1, 68,
674 69, 70, -1, 10, -1, 11, -1, 12, -1, -1,
675 54, -1, 71, -1, 70, 71, -1, 89, -1, 89,
676 4, -1, 89, -1, 72, 89, -1, 74, -1, 73,
677 74, -1, 89, -1, 54, -1, 55, -1, 56, -1,
678 54, -1, 87, -1, 87, 4, -1, 87, 90, -1,
679 87, 4, 90, -1, 75, -1, 76, 75, -1, 78,
680 -1, 77, 78, -1, 79, -1, 62, 53, -1, 1,
681 53, -1, -1, 88, 83, 80, 81, -1, 82, -1,
682 81, 51, 82, -1, 81, 53, -1, -1, 82, 89,
683 83, -1, 82, 43, 83, -1, 82, 13, 89, -1,
684 82, 14, 4, -1, 82, 15, 54, -1, -1, 44,
685 -1, 48, -1, 3, -1, -1, 48, -1, 3, -1,
686 43, -1, 48, -1, 45, -1, 49, -1, 87, -1,
687 90, -1, 3, -1, -1, 50, 46, -1
690 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
691 static const yytype_uint16 yyrline
[] =
693 0, 229, 229, 237, 239, 243, 244, 254, 255, 260,
694 261, 266, 267, 268, 269, 270, 271, 276, 285, 286,
695 287, 288, 289, 290, 291, 292, 293, 294, 295, 310,
696 311, 335, 336, 337, 338, 342, 343, 344, 348, 360,
697 372, 376, 380, 387, 402, 403, 407, 419, 419, 424,
698 424, 429, 440, 455, 456, 457, 461, 462, 467, 469,
699 474, 475, 480, 482, 487, 488, 492, 493, 494, 495,
700 500, 505, 510, 516, 522, 533, 534, 543, 544, 550,
701 551, 552, 559, 559, 567, 568, 569, 574, 576, 578,
702 580, 582, 584, 589, 591, 602, 603, 608, 609, 610,
703 619, 639, 641, 650, 655, 656, 661, 668, 670
707 #if YYDEBUG || YYERROR_VERBOSE || 1
708 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
709 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
710 static const char *const yytname
[] =
712 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
713 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
714 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
715 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
716 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
717 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
718 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
719 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
720 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
721 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
722 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
723 "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"", "\"=\"",
724 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
725 "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
726 "input", "prologue_declarations", "prologue_declaration",
727 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
728 "precedence_declaration", "precedence_declarator", "type.opt",
729 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
730 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
731 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
732 "named_ref.opt", "variable", "content.opt", "braceless", "id",
733 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
738 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
740 static const yytype_uint16 yytoknum
[] =
742 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
743 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
744 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
745 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
746 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
747 305, 306, 307, 308, 309, 310, 311, 312
751 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
752 static const yytype_uint8 yyr1
[] =
754 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
755 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
756 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
757 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
758 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
759 64, 64, 67, 68, 68, 68, 69, 69, 70, 70,
760 71, 71, 72, 72, 73, 73, 74, 74, 74, 74,
761 75, 75, 75, 75, 75, 76, 76, 77, 77, 78,
762 78, 78, 80, 79, 81, 81, 81, 82, 82, 82,
763 82, 82, 82, 83, 83, 84, 84, 85, 85, 85,
764 86, 87, 87, 88, 89, 89, 90, 91, 91
767 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
768 static const yytype_uint8 yyr2
[] =
770 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
771 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
772 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
773 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
774 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
775 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
776 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
777 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
778 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
779 3, 3, 3, 0, 1, 1, 1, 0, 1, 1,
780 1, 1, 1, 1, 1, 1, 1, 0, 2
783 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
784 Performed when YYTABLE doesn't specify something else to do. Zero
785 means the default is an error. */
786 static const yytype_uint8 yydefact
[] =
788 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
789 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
790 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
791 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
792 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
793 0, 0, 0, 100, 0, 42, 96, 95, 97, 10,
794 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
795 0, 27, 29, 30, 106, 102, 101, 104, 37, 105,
796 0, 103, 0, 0, 77, 79, 93, 45, 0, 57,
797 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
798 69, 38, 64, 66, 39, 43, 99, 98, 8, 15,
799 22, 26, 81, 80, 0, 78, 2, 94, 82, 46,
800 52, 58, 60, 76, 72, 73, 63, 65, 108, 87,
801 59, 61, 74, 83, 84, 87, 86, 0, 0, 0,
802 93, 93, 85, 90, 91, 92, 89, 88
805 /* YYDEFGOTO[NTERM-NUM]. */
806 static const yytype_int16 yydefgoto
[] =
808 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
809 47, 90, 120, 121, 96, 101, 102, 92, 93, 83,
810 84, 85, 129, 133, 134, 118, 58, 108, 55, 77,
814 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
816 #define YYPACT_NINF -91
817 static const yytype_int16 yypact
[] =
819 -91, 3, 103, -91, -91, -91, -36, 2, 10, -91,
820 -91, -91, 9, -91, -91, 32, 60, -91, 65, 67,
821 27, -91, 41, 73, 51, -91, 39, -91, -91, -91,
822 40, 52, -91, 93, 95, 33, -91, -91, -91, 15,
823 -91, -91, 53, -91, -91, -91, -91, 46, 43, 43,
824 33, 11, 11, -91, 61, -91, -91, -91, 35, -91,
825 -91, -91, -91, 100, -91, -91, -91, -91, 102, -91,
826 113, -91, -91, -91, -91, -91, -91, -91, -91, -91,
827 64, -91, 94, 1, -91, -91, 62, -91, 61, -91,
828 33, -91, -91, 43, 86, 43, 33, -91, -91, -91,
829 -91, 11, -91, -91, 11, -91, -91, -91, -91, -91,
830 -91, -91, -91, -91, 72, -91, -91, -91, -91, -91,
831 33, -91, 142, -91, 145, -91, -91, -91, -91, -91,
832 -91, -91, -91, 17, 34, -91, -91, 33, 146, 97,
833 62, 62, 34, -91, -91, -91, -91, -91
836 /* YYPGOTO[NTERM-NUM]. */
837 static const yytype_int16 yypgoto
[] =
839 -91, -91, -91, -91, 147, -91, -91, -91, -91, -91,
840 -91, -91, -91, 37, -91, 106, -60, -33, 105, -91,
841 69, -91, -91, -91, 24, -48, -91, -91, -49, -20,
845 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
846 positive, shift that token. If negative, reduce the rule which
847 number is the opposite. If YYTABLE_NINF, syntax error. */
848 #define YYTABLE_NINF -108
849 static const yytype_int16 yytable
[] =
851 78, -107, 80, 3, 125, 105, 4, 5, 6, 7,
852 8, 9, 10, 11, 74, 97, 80, 12, 50, 14,
853 4, 5, 6, 7, 8, 9, 10, 11, 94, 94,
854 62, 12, 27, 14, 132, 56, 74, 74, 106, 119,
855 35, 127, 67, 69, 127, 51, 27, 137, 138, 139,
856 81, 114, 53, 52, 35, 122, 75, 54, 42, 76,
857 123, 126, 123, 59, 81, 98, 99, 100, 135, 60,
858 136, 61, 42, 94, 63, 94, 65, 140, 75, 75,
859 57, 76, 76, 107, 64, 122, 68, 70, 75, 74,
860 124, 76, 146, 147, 66, 71, 72, 91, 73, 141,
861 89, 87, 143, 109, 53, 110, 117, 141, 4, 5,
862 6, 7, 8, 9, 10, 11, 111, 112, 128, 12,
863 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
864 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
865 33, 34, 35, 36, 37, 38, 131, 113, 74, 44,
866 144, 145, 115, 39, 95, 40, 41, 130, 104, 142,
870 #define yypact_value_is_default(yystate) \
873 #define yytable_value_is_error(yytable_value) \
876 static const yytype_uint8 yycheck
[] =
878 35, 0, 1, 0, 94, 54, 5, 6, 7, 8,
879 9, 10, 11, 12, 3, 50, 1, 16, 54, 18,
880 5, 6, 7, 8, 9, 10, 11, 12, 48, 49,
881 3, 16, 31, 18, 124, 3, 3, 3, 3, 88,
882 39, 101, 3, 3, 104, 43, 31, 13, 14, 15,
883 49, 50, 43, 43, 39, 90, 45, 48, 57, 48,
884 93, 96, 95, 3, 49, 54, 55, 56, 51, 4,
885 53, 4, 57, 93, 47, 95, 3, 43, 45, 45,
886 48, 48, 48, 48, 43, 120, 47, 47, 45, 3,
887 4, 48, 140, 141, 43, 43, 3, 54, 3, 134,
888 54, 48, 137, 3, 43, 3, 44, 142, 5, 6,
889 7, 8, 9, 10, 11, 12, 3, 53, 46, 16,
890 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
891 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
892 37, 38, 39, 40, 41, 42, 4, 53, 3, 2,
893 4, 54, 83, 50, 49, 52, 53, 120, 52, 135,
897 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
898 symbol of state STATE-NUM. */
899 static const yytype_uint8 yystos
[] =
901 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
902 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
903 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
904 34, 35, 36, 37, 38, 39, 40, 41, 42, 50,
905 52, 53, 57, 61, 62, 64, 67, 68, 66, 65,
906 54, 43, 43, 43, 48, 86, 3, 48, 84, 3,
907 4, 4, 3, 47, 43, 3, 43, 3, 47, 3,
908 47, 43, 3, 3, 3, 45, 48, 87, 89, 90,
909 1, 49, 62, 77, 78, 79, 88, 48, 63, 54,
910 69, 54, 75, 76, 87, 76, 72, 89, 54, 55,
911 56, 73, 74, 89, 73, 86, 3, 48, 85, 3,
912 3, 3, 53, 53, 50, 78, 91, 44, 83, 86,
913 70, 71, 89, 75, 4, 90, 89, 74, 46, 80,
914 71, 4, 90, 81, 82, 51, 53, 13, 14, 15,
915 43, 89, 82, 89, 4, 54, 83, 83
918 #define yyerrok (yyerrstatus = 0)
919 #define yyclearin (yychar = YYEMPTY)
923 #define YYACCEPT goto yyacceptlab
924 #define YYABORT goto yyabortlab
925 #define YYERROR goto yyerrorlab
928 /* Like YYERROR except do call yyerror. This remains here temporarily
929 to ease the transition to the new meaning of YYERROR, for GCC.
930 Once GCC version 2 has supplanted version 1, this can go. However,
931 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
932 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
935 #define YYFAIL goto yyerrlab
937 /* This is here to suppress warnings from the GCC cpp's
938 -Wunused-macros. Normally we don't worry about that warning, but
939 some users do, and we want to make it easy for users to remove
940 YYFAIL uses, which will produce warnings from Bison 2.5. */
943 #define YYRECOVERING() (!!yyerrstatus)
945 #define YYBACKUP(Token, Value) \
947 if (yychar == YYEMPTY) \
951 YYPOPSTACK (yylen); \
953 YY_LAC_DISCARD ("YYBACKUP"); \
958 yyerror (YY_("syntax error: cannot back up")); \
965 #define YYERRCODE 256
967 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
968 If N is 0, then set CURRENT to the empty location which ends
969 the previous symbol: RHS[0] (always defined). */
971 #ifndef YYLLOC_DEFAULT
972 # define YYLLOC_DEFAULT(Current, Rhs, N) \
976 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
977 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
978 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
979 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
983 (Current).first_line = (Current).last_line = \
984 YYRHSLOC (Rhs, 0).last_line; \
985 (Current).first_column = (Current).last_column = \
986 YYRHSLOC (Rhs, 0).last_column; \
991 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
995 /* YY_LOCATION_PRINT -- Print the location on the stream.
996 This macro was not mandated originally: define only if we know
997 we won't break user code: when these are the locations we know. */
999 #ifndef YY_LOCATION_PRINT
1000 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1001 # define YY_LOCATION_PRINT(File, Loc) \
1002 fprintf (File, "%d.%d-%d.%d", \
1003 (Loc).first_line, (Loc).first_column, \
1004 (Loc).last_line, (Loc).last_column)
1006 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1011 /* YYLEX -- calling `yylex' with the right arguments. */
1014 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1016 # define YYLEX yylex (&yylval, &yylloc)
1019 /* Enable debugging if requested. */
1023 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1024 # define YYFPRINTF fprintf
1027 # define YYDPRINTF(Args) \
1033 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1037 YYFPRINTF (stderr, "%s ", Title); \
1038 yy_symbol_print (stderr, \
1039 Type, Value, Location); \
1040 YYFPRINTF (stderr, "\n"); \
1045 /*--------------------------------.
1046 | Print this symbol on YYOUTPUT. |
1047 `--------------------------------*/
1050 #if (defined __STDC__ || defined __C99__FUNC__ \
1051 || defined __cplusplus || defined _MSC_VER)
1053 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1056 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1059 YYSTYPE
const * const yyvaluep
;
1060 YYLTYPE
const * const yylocationp
;
1063 FILE *yyo
= yyoutput
;
1067 YYUSE (yylocationp
);
1069 if (yytype
< YYNTOKENS
)
1070 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1076 case 3: /* "string" */
1078 /* Line 809 of yacc.c */
1079 #line 204 "parse-gram.y"
1080 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1082 /* Line 809 of yacc.c */
1083 #line 1084 "parse-gram.c"
1085 case 4: /* "integer" */
1087 /* Line 809 of yacc.c */
1088 #line 216 "parse-gram.y"
1089 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1091 /* Line 809 of yacc.c */
1092 #line 1093 "parse-gram.c"
1094 case 43: /* "{...}" */
1096 /* Line 809 of yacc.c */
1097 #line 206 "parse-gram.y"
1098 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1100 /* Line 809 of yacc.c */
1101 #line 1102 "parse-gram.c"
1103 case 44: /* "[identifier]" */
1105 /* Line 809 of yacc.c */
1106 #line 211 "parse-gram.y"
1107 { fprintf (stderr
, "[%s]", (yyvaluep
->uniqstr
)); };
1109 /* Line 809 of yacc.c */
1110 #line 1111 "parse-gram.c"
1112 case 45: /* "char" */
1114 /* Line 809 of yacc.c */
1115 #line 198 "parse-gram.y"
1116 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1118 /* Line 809 of yacc.c */
1119 #line 1120 "parse-gram.c"
1121 case 46: /* "epilogue" */
1123 /* Line 809 of yacc.c */
1124 #line 206 "parse-gram.y"
1125 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1127 /* Line 809 of yacc.c */
1128 #line 1129 "parse-gram.c"
1130 case 48: /* "identifier" */
1132 /* Line 809 of yacc.c */
1133 #line 210 "parse-gram.y"
1134 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1136 /* Line 809 of yacc.c */
1137 #line 1138 "parse-gram.c"
1139 case 49: /* "identifier:" */
1141 /* Line 809 of yacc.c */
1142 #line 212 "parse-gram.y"
1143 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1145 /* Line 809 of yacc.c */
1146 #line 1147 "parse-gram.c"
1148 case 52: /* "%{...%}" */
1150 /* Line 809 of yacc.c */
1151 #line 206 "parse-gram.y"
1152 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1154 /* Line 809 of yacc.c */
1155 #line 1156 "parse-gram.c"
1157 case 54: /* "type" */
1159 /* Line 809 of yacc.c */
1160 #line 213 "parse-gram.y"
1161 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1163 /* Line 809 of yacc.c */
1164 #line 1165 "parse-gram.c"
1166 case 71: /* symbol.prec */
1168 /* Line 809 of yacc.c */
1169 #line 219 "parse-gram.y"
1170 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1172 /* Line 809 of yacc.c */
1173 #line 1174 "parse-gram.c"
1175 case 84: /* variable */
1177 /* Line 809 of yacc.c */
1178 #line 210 "parse-gram.y"
1179 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1181 /* Line 809 of yacc.c */
1182 #line 1183 "parse-gram.c"
1184 case 85: /* content.opt */
1186 /* Line 809 of yacc.c */
1187 #line 206 "parse-gram.y"
1188 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1190 /* Line 809 of yacc.c */
1191 #line 1192 "parse-gram.c"
1193 case 86: /* braceless */
1195 /* Line 809 of yacc.c */
1196 #line 206 "parse-gram.y"
1197 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1199 /* Line 809 of yacc.c */
1200 #line 1201 "parse-gram.c"
1204 /* Line 809 of yacc.c */
1205 #line 219 "parse-gram.y"
1206 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1208 /* Line 809 of yacc.c */
1209 #line 1210 "parse-gram.c"
1211 case 88: /* id_colon */
1213 /* Line 809 of yacc.c */
1214 #line 220 "parse-gram.y"
1215 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1217 /* Line 809 of yacc.c */
1218 #line 1219 "parse-gram.c"
1220 case 89: /* symbol */
1222 /* Line 809 of yacc.c */
1223 #line 219 "parse-gram.y"
1224 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1226 /* Line 809 of yacc.c */
1227 #line 1228 "parse-gram.c"
1229 case 90: /* string_as_id */
1231 /* Line 809 of yacc.c */
1232 #line 219 "parse-gram.y"
1233 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1235 /* Line 809 of yacc.c */
1236 #line 1237 "parse-gram.c"
1244 /*--------------------------------.
1245 | Print this symbol on YYOUTPUT. |
1246 `--------------------------------*/
1248 #if (defined __STDC__ || defined __C99__FUNC__ \
1249 || defined __cplusplus || defined _MSC_VER)
1251 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1254 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1257 YYSTYPE
const * const yyvaluep
;
1258 YYLTYPE
const * const yylocationp
;
1261 if (yytype
< YYNTOKENS
)
1262 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1264 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1266 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1267 YYFPRINTF (yyoutput
, ": ");
1268 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1269 YYFPRINTF (yyoutput
, ")");
1272 /*------------------------------------------------------------------.
1273 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1275 `------------------------------------------------------------------*/
1277 #if (defined __STDC__ || defined __C99__FUNC__ \
1278 || defined __cplusplus || defined _MSC_VER)
1280 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1283 yy_stack_print (yybottom
, yytop
)
1284 yytype_int16
*yybottom
;
1285 yytype_int16
*yytop
;
1288 YYFPRINTF (stderr
, "Stack now");
1289 for (; yybottom
<= yytop
; yybottom
++)
1291 int yybot
= *yybottom
;
1292 YYFPRINTF (stderr
, " %d", yybot
);
1294 YYFPRINTF (stderr
, "\n");
1297 # define YY_STACK_PRINT(Bottom, Top) \
1300 yy_stack_print ((Bottom), (Top)); \
1304 /*------------------------------------------------.
1305 | Report that the YYRULE is going to be reduced. |
1306 `------------------------------------------------*/
1308 #if (defined __STDC__ || defined __C99__FUNC__ \
1309 || defined __cplusplus || defined _MSC_VER)
1311 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1314 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1320 int yynrhs
= yyr2
[yyrule
];
1322 unsigned long int yylno
= yyrline
[yyrule
];
1323 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1325 /* The symbols being reduced. */
1326 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1328 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1329 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1330 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1331 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1332 YYFPRINTF (stderr
, "\n");
1336 # define YY_REDUCE_PRINT(Rule) \
1339 yy_reduce_print (yyvsp, yylsp, Rule); \
1342 /* Nonzero means print parse trace. It is left uninitialized so that
1343 multiple parsers can coexist. */
1345 #else /* !YYDEBUG */
1346 # define YYDPRINTF(Args)
1347 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1348 # define YY_STACK_PRINT(Bottom, Top)
1349 # define YY_REDUCE_PRINT(Rule)
1350 #endif /* !YYDEBUG */
1353 /* YYINITDEPTH -- initial size of the parser's stacks. */
1355 # define YYINITDEPTH 200
1358 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1359 if the built-in stack extension method is used).
1361 Do not make this value too large; the results are undefined if
1362 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1363 evaluated with infinite-precision integer arithmetic. */
1366 # define YYMAXDEPTH 10000
1369 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1370 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1371 stack, and such that *YYCAPACITY is the maximum number of elements it
1372 can hold without a reallocation, make sure there is enough room to
1373 store YYADD more elements. If not, allocate a new stack using
1374 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1375 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1376 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1377 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1378 required. Return 1 if memory is exhausted. */
1380 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1382 char const *yydebug_prefix
,
1383 char const *yydebug_suffix
,
1385 yytype_int16
**yybottom
,
1386 yytype_int16
*yybottom_no_free
,
1387 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1389 YYSIZE_T yysize_old
=
1390 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1391 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1392 if (*yycapacity
< yysize_new
)
1394 YYSIZE_T yyalloc
= 2 * yysize_new
;
1395 yytype_int16
*yybottom_new
;
1396 /* Use YYMAXDEPTH for maximum stack size given that the stack
1397 should never need to grow larger than the main state stack
1398 needs to grow without LAC. */
1399 if (YYMAXDEPTH
< yysize_new
)
1401 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1405 if (YYMAXDEPTH
< yyalloc
)
1406 yyalloc
= YYMAXDEPTH
;
1408 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1411 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1415 if (*yytop
!= yytop_empty
)
1417 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1418 *yytop
= yybottom_new
+ (yysize_old
- 1);
1420 if (*yybottom
!= yybottom_no_free
)
1421 YYSTACK_FREE (*yybottom
);
1422 *yybottom
= yybottom_new
;
1423 *yycapacity
= yyalloc
;
1428 /* Establish the initial context for the current lookahead if no initial
1429 context is currently established.
1431 We define a context as a snapshot of the parser stacks. We define
1432 the initial context for a lookahead as the context in which the
1433 parser initially examines that lookahead in order to select a
1434 syntactic action. Thus, if the lookahead eventually proves
1435 syntactically unacceptable (possibly in a later context reached via a
1436 series of reductions), the initial context can be used to determine
1437 the exact set of tokens that would be syntactically acceptable in the
1438 lookahead's place. Moreover, it is the context after which any
1439 further semantic actions would be erroneous because they would be
1440 determined by a syntactically unacceptable token.
1442 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1443 performed in an inconsistent state (which, for the purposes of LAC,
1444 includes consistent states that don't know they're consistent because
1445 their default reductions have been disabled). Iff there is a
1446 lookahead token, it should also be invoked before reporting a syntax
1447 error. This latter case is for the sake of the debugging output.
1449 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1450 follows. If no initial context is currently established for the
1451 current lookahead, then check if that lookahead can eventually be
1452 shifted if syntactic actions continue from the current context.
1453 Report a syntax error if it cannot. */
1454 #define YY_LAC_ESTABLISH \
1456 if (!yy_lac_established) \
1458 YYDPRINTF ((stderr, \
1459 "LAC: initial context established for %s\n", \
1460 yytname[yytoken])); \
1461 yy_lac_established = 1; \
1463 int yy_lac_status = \
1464 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1465 if (yy_lac_status == 2) \
1466 goto yyexhaustedlab; \
1467 if (yy_lac_status == 1) \
1473 /* Discard any previous initial lookahead context because of Event,
1474 which may be a lookahead change or an invalidation of the currently
1475 established initial context for the current lookahead.
1477 The most common example of a lookahead change is a shift. An example
1478 of both cases is syntax error recovery. That is, a syntax error
1479 occurs when the lookahead is syntactically erroneous for the
1480 currently established initial context, so error recovery manipulates
1481 the parser stacks to try to find a new initial context in which the
1482 current lookahead is syntactically acceptable. If it fails to find
1483 such a context, it discards the lookahead. */
1485 # define YY_LAC_DISCARD(Event) \
1487 if (yy_lac_established) \
1490 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1492 yy_lac_established = 0; \
1496 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1499 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1500 eventually (after perhaps some reductions) be shifted, return 1 if
1501 not, or return 2 if memory is exhausted. As preconditions and
1502 postconditions: *YYES_CAPACITY is the allocated size of the array to
1503 which *YYES points, and either *YYES = YYESA or *YYES points to an
1504 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1505 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1506 any old *YYES other than YYESA. */
1508 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1509 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1511 yytype_int16
*yyes_prev
= yyssp
;
1512 yytype_int16
*yyesp
= yyes_prev
;
1513 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1514 if (yytoken
== YYUNDEFTOK
)
1516 YYDPRINTF ((stderr
, " Always Err\n"));
1521 int yyrule
= yypact
[*yyesp
];
1522 if (yypact_value_is_default (yyrule
)
1523 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1524 || yycheck
[yyrule
] != yytoken
)
1526 yyrule
= yydefact
[*yyesp
];
1529 YYDPRINTF ((stderr
, " Err\n"));
1535 yyrule
= yytable
[yyrule
];
1536 if (yytable_value_is_error (yyrule
))
1538 YYDPRINTF ((stderr
, " Err\n"));
1543 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1549 YYSIZE_T yylen
= yyr2
[yyrule
];
1550 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1551 if (yyesp
!= yyes_prev
)
1553 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1566 yyesp
= yyes_prev
-= yylen
;
1571 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1572 yystate
= yypgoto
[yylhs
] + *yyesp
;
1573 if (yystate
< 0 || YYLAST
< yystate
1574 || yycheck
[yystate
] != *yyesp
)
1575 yystate
= yydefgoto
[yylhs
];
1577 yystate
= yytable
[yystate
];
1579 if (yyesp
== yyes_prev
)
1586 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1590 yyes
, yyesa
, &yyesp
, yyes_prev
))
1592 YYDPRINTF ((stderr
, "\n"));
1597 YYDPRINTF ((stderr
, " G%d", yystate
));
1606 # if defined __GLIBC__ && defined _STRING_H
1607 # define yystrlen strlen
1609 /* Return the length of YYSTR. */
1610 #if (defined __STDC__ || defined __C99__FUNC__ \
1611 || defined __cplusplus || defined _MSC_VER)
1613 yystrlen (const char *yystr
)
1621 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1629 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1630 # define yystpcpy stpcpy
1632 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1634 #if (defined __STDC__ || defined __C99__FUNC__ \
1635 || defined __cplusplus || defined _MSC_VER)
1637 yystpcpy (char *yydest
, const char *yysrc
)
1640 yystpcpy (yydest
, yysrc
)
1646 const char *yys
= yysrc
;
1648 while ((*yyd
++ = *yys
++) != '\0')
1657 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1658 quotes and backslashes, so that it's suitable for yyerror. The
1659 heuristic is that double-quoting is unnecessary unless the string
1660 contains an apostrophe, a comma, or backslash (other than
1661 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1662 null, do not copy; instead, return the length of what the result
1665 yytnamerr (char *yyres
, const char *yystr
)
1670 char const *yyp
= yystr
;
1677 goto do_not_strip_quotes
;
1681 goto do_not_strip_quotes
;
1694 do_not_strip_quotes
: ;
1698 return yystrlen (yystr
);
1700 return yystpcpy (yyres
, yystr
) - yyres
;
1704 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1705 about the unexpected token YYTOKEN for the state stack whose top is
1706 YYSSP. In order to see if a particular token T is a
1707 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1709 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1710 not large enough to hold the message. In that case, also set
1711 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1712 required number of bytes is too large to store or if
1713 yy_lac returned 2. */
1715 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1716 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1717 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1719 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1720 YYSIZE_T yysize
= yysize0
;
1722 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1723 /* Internationalized format string. */
1724 const char *yyformat
= YY_NULL
;
1725 /* Arguments of yyformat. */
1726 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1727 /* Number of reported tokens (one for the "unexpected", one per
1731 /* There are many possibilities here to consider:
1732 - Assume YYFAIL is not used. It's too flawed to consider. See
1733 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1734 for details. YYERROR is fine as it does not invoke this
1736 - If this state is a consistent state with a default action, then
1737 the only way this function was invoked is if the default action
1738 is an error action. In that case, don't check for expected
1739 tokens because there are none.
1740 - The only way there can be no lookahead present (in yychar) is if
1741 this state is a consistent state with a default action. Thus,
1742 detecting the absence of a lookahead is sufficient to determine
1743 that there is no unexpected or expected token to report. In that
1744 case, just report a simple "syntax error".
1745 - Don't assume there isn't a lookahead just because this state is a
1746 consistent state with a default action. There might have been a
1747 previous inconsistent state, consistent state with a non-default
1748 action, or user semantic action that manipulated yychar.
1749 In the first two cases, it might appear that the current syntax
1750 error should have been detected in the previous state when yy_lac
1751 was invoked. However, at that time, there might have been a
1752 different syntax error that discarded a different initial context
1753 during error recovery, leaving behind the current lookahead.
1755 if (yytoken
!= YYEMPTY
)
1757 int yyn
= yypact
[*yyssp
];
1758 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1759 yyarg
[yycount
++] = yytname
[yytoken
];
1760 if (!yypact_value_is_default (yyn
))
1764 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1765 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1768 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1770 if (yy_lac_status
== 2)
1772 if (yy_lac_status
== 1)
1775 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1781 yyarg
[yycount
++] = yytname
[yyx
];
1782 yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1783 if (! (yysize
<= yysize1
1784 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1791 YYFPRINTF (stderr
, "No expected tokens.\n");
1797 # define YYCASE_(N, S) \
1801 YYCASE_(0, YY_("syntax error"));
1802 YYCASE_(1, YY_("syntax error, unexpected %s"));
1803 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1804 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1805 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1806 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1810 yysize1
= yysize
+ yystrlen (yyformat
);
1811 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1815 if (*yymsg_alloc
< yysize
)
1817 *yymsg_alloc
= 2 * yysize
;
1818 if (! (yysize
<= *yymsg_alloc
1819 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1820 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1824 /* Avoid sprintf, as that infringes on the user's name space.
1825 Don't have undefined behavior even if the translation
1826 produced a string with the wrong number of "%s"s. */
1830 while ((*yyp
= *yyformat
) != '\0')
1831 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1833 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1844 #endif /* YYERROR_VERBOSE */
1846 /*-----------------------------------------------.
1847 | Release the memory associated to this symbol. |
1848 `-----------------------------------------------*/
1851 #if (defined __STDC__ || defined __C99__FUNC__ \
1852 || defined __cplusplus || defined _MSC_VER)
1854 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1857 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1861 YYLTYPE
*yylocationp
;
1865 YYUSE (yylocationp
);
1869 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1886 #ifdef YYPARSE_PARAM
1887 #if (defined __STDC__ || defined __C99__FUNC__ \
1888 || defined __cplusplus || defined _MSC_VER)
1890 yyparse (void *YYPARSE_PARAM
)
1893 yyparse (YYPARSE_PARAM
)
1894 void *YYPARSE_PARAM
;
1896 #else /* ! YYPARSE_PARAM */
1897 #if (defined __STDC__ || defined __C99__FUNC__ \
1898 || defined __cplusplus || defined _MSC_VER)
1908 /* The lookahead symbol. */
1911 /* The semantic value of the lookahead symbol. */
1914 /* Location data for the lookahead symbol. */
1917 /* Number of syntax errors so far. */
1921 /* Number of tokens to shift before error messages enabled. */
1924 /* The stacks and their tools:
1925 `yyss': related to states.
1926 `yyvs': related to semantic values.
1927 `yyls': related to locations.
1929 Refer to the stacks through separate pointers, to allow yyoverflow
1930 to reallocate them elsewhere. */
1932 /* The state stack. */
1933 yytype_int16 yyssa
[YYINITDEPTH
];
1935 yytype_int16
*yyssp
;
1937 /* The semantic value stack. */
1938 YYSTYPE yyvsa
[YYINITDEPTH
];
1942 /* The location stack. */
1943 YYLTYPE yylsa
[YYINITDEPTH
];
1947 /* The locations where the error started and ended. */
1948 YYLTYPE yyerror_range
[3];
1950 YYSIZE_T yystacksize
;
1952 yytype_int16 yyesa
[20];
1954 YYSIZE_T yyes_capacity
;
1956 int yy_lac_established
= 0;
1959 /* Lookahead token as an internal (translated) token number. */
1961 /* The variables used to return semantic value and location from the
1967 /* Buffer for error messages, and its allocated size. */
1969 char *yymsg
= yymsgbuf
;
1970 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1973 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1975 /* The number of symbols on the RHS of the reduced rule.
1976 Keep to zero when no symbol should be popped. */
1983 yystacksize
= YYINITDEPTH
;
1986 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1987 if (YYMAXDEPTH
< yyes_capacity
)
1988 yyes_capacity
= YYMAXDEPTH
;
1990 YYDPRINTF ((stderr
, "Starting parse\n"));
1995 yychar
= YYEMPTY
; /* Cause a token to be read. */
1997 /* Initialize stack pointers.
1998 Waste one element of value and location stack
1999 so that they stay on the same level as the state stack.
2000 The wasted elements are never initialized. */
2005 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2006 /* Initialize the default location before parsing starts. */
2007 yylloc
.first_line
= yylloc
.last_line
= 1;
2008 yylloc
.first_column
= yylloc
.last_column
= 1;
2011 /* User initialization code. */
2013 /* Line 1572 of yacc.c */
2014 #line 106 "parse-gram.y"
2016 /* Bison's grammar can initial empty locations, hence a default
2017 location is needed. */
2018 boundary_set (&yylloc
.start
, current_file
, 1, 1);
2019 boundary_set (&yylloc
.end
, current_file
, 1, 1);
2022 /* Line 1572 of yacc.c */
2023 #line 2024 "parse-gram.c"
2028 /*------------------------------------------------------------.
2029 | yynewstate -- Push a new state, which is found in yystate. |
2030 `------------------------------------------------------------*/
2032 /* In all cases, when you get here, the value and location stacks
2033 have just been pushed. So pushing a state here evens the stacks. */
2039 if (yyss
+ yystacksize
- 1 <= yyssp
)
2041 /* Get the current used size of the three stacks, in elements. */
2042 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2046 /* Give user a chance to reallocate the stack. Use copies of
2047 these so that the &'s don't force the real ones into
2049 YYSTYPE
*yyvs1
= yyvs
;
2050 yytype_int16
*yyss1
= yyss
;
2051 YYLTYPE
*yyls1
= yyls
;
2053 /* Each stack pointer address is followed by the size of the
2054 data in use in that stack, in bytes. This used to be a
2055 conditional around just the two extra args, but that might
2056 be undefined if yyoverflow is a macro. */
2057 yyoverflow (YY_("memory exhausted"),
2058 &yyss1
, yysize
* sizeof (*yyssp
),
2059 &yyvs1
, yysize
* sizeof (*yyvsp
),
2060 &yyls1
, yysize
* sizeof (*yylsp
),
2067 #else /* no yyoverflow */
2068 # ifndef YYSTACK_RELOCATE
2069 goto yyexhaustedlab
;
2071 /* Extend the stack our own way. */
2072 if (YYMAXDEPTH
<= yystacksize
)
2073 goto yyexhaustedlab
;
2075 if (YYMAXDEPTH
< yystacksize
)
2076 yystacksize
= YYMAXDEPTH
;
2079 yytype_int16
*yyss1
= yyss
;
2080 union yyalloc
*yyptr
=
2081 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2083 goto yyexhaustedlab
;
2084 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2085 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2086 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2087 # undef YYSTACK_RELOCATE
2089 YYSTACK_FREE (yyss1
);
2092 #endif /* no yyoverflow */
2094 yyssp
= yyss
+ yysize
- 1;
2095 yyvsp
= yyvs
+ yysize
- 1;
2096 yylsp
= yyls
+ yysize
- 1;
2098 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2099 (unsigned long int) yystacksize
));
2101 if (yyss
+ yystacksize
- 1 <= yyssp
)
2105 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2107 if (yystate
== YYFINAL
)
2117 /* Do appropriate processing given the current state. Read a
2118 lookahead token if we need one and don't already have one. */
2120 /* First try to decide what to do without reference to lookahead token. */
2121 yyn
= yypact
[yystate
];
2122 if (yypact_value_is_default (yyn
))
2125 /* Not known => get a lookahead token if don't already have one. */
2127 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2128 if (yychar
== YYEMPTY
)
2130 YYDPRINTF ((stderr
, "Reading a token: "));
2134 if (yychar
<= YYEOF
)
2136 yychar
= yytoken
= YYEOF
;
2137 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2141 yytoken
= YYTRANSLATE (yychar
);
2142 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2145 /* If the proper action on seeing token YYTOKEN is to reduce or to
2146 detect an error, take that action. */
2148 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2156 if (yytable_value_is_error (yyn
))
2163 /* Count tokens shifted since error; after three, turn off error
2168 /* Shift the lookahead token. */
2169 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2171 /* Discard the shifted token. */
2173 YY_LAC_DISCARD ("shift");
2181 /*-----------------------------------------------------------.
2182 | yydefault -- do the default action for the current state. |
2183 `-----------------------------------------------------------*/
2185 yyn
= yydefact
[yystate
];
2191 /*-----------------------------.
2192 | yyreduce -- Do a reduction. |
2193 `-----------------------------*/
2195 /* yyn is the number of a rule to reduce with. */
2198 /* If YYLEN is nonzero, implement the default value of the action:
2201 Otherwise, the following line sets YYVAL to garbage.
2202 This behavior is undocumented and Bison
2203 users should not rely upon it. Assigning to YYVAL
2204 unconditionally makes the parser a bit smaller, and it avoids a
2205 GCC warning that YYVAL may be used uninitialized. */
2206 yyval
= yyvsp
[1-yylen
];
2208 /* Default location. */
2209 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2210 YY_REDUCE_PRINT (yyn
);
2212 int yychar_backup
= yychar
;
2217 /* Line 1788 of yacc.c */
2218 #line 245 "parse-gram.y"
2220 code_props plain_code
;
2221 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
2222 code_props_translate_code (&plain_code
);
2223 gram_scanner_last_string_free ();
2224 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2225 plain_code
.code
, (yylsp
[(1) - (1)]));
2226 code_scanner_last_string_free ();
2232 /* Line 1788 of yacc.c */
2233 #line 254 "parse-gram.y"
2234 { debug_flag
= true; }
2239 /* Line 1788 of yacc.c */
2240 #line 256 "parse-gram.y"
2242 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
),
2243 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2249 /* Line 1788 of yacc.c */
2250 #line 260 "parse-gram.y"
2251 { defines_flag
= true; }
2256 /* Line 1788 of yacc.c */
2257 #line 262 "parse-gram.y"
2259 defines_flag
= true;
2260 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
2266 /* Line 1788 of yacc.c */
2267 #line 266 "parse-gram.y"
2268 { error_verbose
= true; }
2273 /* Line 1788 of yacc.c */
2274 #line 267 "parse-gram.y"
2275 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2280 /* Line 1788 of yacc.c */
2281 #line 268 "parse-gram.y"
2282 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2287 /* Line 1788 of yacc.c */
2288 #line 269 "parse-gram.y"
2289 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
2294 /* Line 1788 of yacc.c */
2295 #line 270 "parse-gram.y"
2296 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
2301 /* Line 1788 of yacc.c */
2302 #line 272 "parse-gram.y"
2304 nondeterministic_parser
= true;
2311 /* Line 1788 of yacc.c */
2312 #line 277 "parse-gram.y"
2315 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
2316 code_props_translate_code (&action
);
2317 gram_scanner_last_string_free ();
2318 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2319 code_scanner_last_string_free ();
2325 /* Line 1788 of yacc.c */
2326 #line 285 "parse-gram.y"
2327 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, (yylsp
[(1) - (2)])); }
2332 /* Line 1788 of yacc.c */
2333 #line 286 "parse-gram.y"
2334 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2339 /* Line 1788 of yacc.c */
2340 #line 287 "parse-gram.y"
2341 { locations_flag
= true; }
2346 /* Line 1788 of yacc.c */
2347 #line 288 "parse-gram.y"
2348 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2353 /* Line 1788 of yacc.c */
2354 #line 289 "parse-gram.y"
2355 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2360 /* Line 1788 of yacc.c */
2361 #line 290 "parse-gram.y"
2362 { no_lines_flag
= true; }
2367 /* Line 1788 of yacc.c */
2368 #line 291 "parse-gram.y"
2369 { nondeterministic_parser
= true; }
2374 /* Line 1788 of yacc.c */
2375 #line 292 "parse-gram.y"
2376 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2381 /* Line 1788 of yacc.c */
2382 #line 293 "parse-gram.y"
2383 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2388 /* Line 1788 of yacc.c */
2389 #line 294 "parse-gram.y"
2390 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2395 /* Line 1788 of yacc.c */
2396 #line 296 "parse-gram.y"
2398 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2399 `%define api.pure' in a backward-compatible manner here. First, don't
2400 complain if %pure-parser is specified multiple times. */
2401 if (!muscle_find_const ("percent_define(api.pure)"))
2402 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2403 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2404 /* In all cases, use api.pure now so that the backend doesn't complain if
2405 the skeleton ignores api.pure, but do warn now if there's a previous
2406 conflicting definition from an actual %define. */
2407 if (!muscle_percent_define_flag_if ("api.pure"))
2408 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2409 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2415 /* Line 1788 of yacc.c */
2416 #line 310 "parse-gram.y"
2417 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2422 /* Line 1788 of yacc.c */
2423 #line 312 "parse-gram.y"
2425 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2426 if (mbschr (skeleton_user
, '/'))
2428 size_t dir_length
= strlen (current_file
);
2429 char *skeleton_build
;
2430 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2432 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2435 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2438 memcpy (skeleton_build
, current_file
, dir_length
);
2439 skeleton_build
[dir_length
++] = '/';
2441 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2442 skeleton_user
= uniqstr_new (skeleton_build
);
2443 free (skeleton_build
);
2445 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[(1) - (2)]));
2451 /* Line 1788 of yacc.c */
2452 #line 335 "parse-gram.y"
2453 { token_table_flag
= true; }
2458 /* Line 1788 of yacc.c */
2459 #line 336 "parse-gram.y"
2460 { report_flag
|= report_states
; }
2465 /* Line 1788 of yacc.c */
2466 #line 337 "parse-gram.y"
2467 { yacc_flag
= true; }
2472 /* Line 1788 of yacc.c */
2473 #line 345 "parse-gram.y"
2475 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2481 /* Line 1788 of yacc.c */
2482 #line 349 "parse-gram.y"
2485 code_props_symbol_action_init (&code
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2486 code_props_translate_code (&code
);
2489 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2490 symbol_list_destructor_set (list
, &code
);
2491 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2498 /* Line 1788 of yacc.c */
2499 #line 361 "parse-gram.y"
2502 code_props_symbol_action_init (&code
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2503 code_props_translate_code (&code
);
2506 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2507 symbol_list_printer_set (list
, &code
);
2508 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2515 /* Line 1788 of yacc.c */
2516 #line 373 "parse-gram.y"
2518 default_prec
= true;
2524 /* Line 1788 of yacc.c */
2525 #line 377 "parse-gram.y"
2527 default_prec
= false;
2533 /* Line 1788 of yacc.c */
2534 #line 381 "parse-gram.y"
2536 /* Do not invoke muscle_percent_code_grow here since it invokes
2537 muscle_user_name_list_grow. */
2538 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2539 code_scanner_last_string_free ();
2545 /* Line 1788 of yacc.c */
2546 #line 388 "parse-gram.y"
2548 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2549 code_scanner_last_string_free ();
2555 /* Line 1788 of yacc.c */
2556 #line 402 "parse-gram.y"
2562 /* Line 1788 of yacc.c */
2563 #line 403 "parse-gram.y"
2564 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2569 /* Line 1788 of yacc.c */
2570 #line 408 "parse-gram.y"
2573 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2574 code_scanner_last_string_free ();
2580 /* Line 1788 of yacc.c */
2581 #line 419 "parse-gram.y"
2582 { current_class
= nterm_sym
; }
2587 /* Line 1788 of yacc.c */
2588 #line 420 "parse-gram.y"
2590 current_class
= unknown_sym
;
2591 current_type
= NULL
;
2597 /* Line 1788 of yacc.c */
2598 #line 424 "parse-gram.y"
2599 { current_class
= token_sym
; }
2604 /* Line 1788 of yacc.c */
2605 #line 425 "parse-gram.y"
2607 current_class
= unknown_sym
;
2608 current_type
= NULL
;
2614 /* Line 1788 of yacc.c */
2615 #line 430 "parse-gram.y"
2619 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2620 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2621 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2627 /* Line 1788 of yacc.c */
2628 #line 441 "parse-gram.y"
2632 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2634 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2635 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2637 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2638 current_type
= NULL
;
2644 /* Line 1788 of yacc.c */
2645 #line 455 "parse-gram.y"
2646 { (yyval
.assoc
) = left_assoc
; }
2651 /* Line 1788 of yacc.c */
2652 #line 456 "parse-gram.y"
2653 { (yyval
.assoc
) = right_assoc
; }
2658 /* Line 1788 of yacc.c */
2659 #line 457 "parse-gram.y"
2660 { (yyval
.assoc
) = non_assoc
; }
2665 /* Line 1788 of yacc.c */
2666 #line 461 "parse-gram.y"
2667 { current_type
= NULL
; }
2672 /* Line 1788 of yacc.c */
2673 #line 462 "parse-gram.y"
2674 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2679 /* Line 1788 of yacc.c */
2680 #line 468 "parse-gram.y"
2681 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2686 /* Line 1788 of yacc.c */
2687 #line 470 "parse-gram.y"
2688 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2693 /* Line 1788 of yacc.c */
2694 #line 474 "parse-gram.y"
2695 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2700 /* Line 1788 of yacc.c */
2701 #line 475 "parse-gram.y"
2702 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2707 /* Line 1788 of yacc.c */
2708 #line 481 "parse-gram.y"
2709 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2714 /* Line 1788 of yacc.c */
2715 #line 483 "parse-gram.y"
2716 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2721 /* Line 1788 of yacc.c */
2722 #line 487 "parse-gram.y"
2723 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2728 /* Line 1788 of yacc.c */
2729 #line 488 "parse-gram.y"
2730 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2735 /* Line 1788 of yacc.c */
2736 #line 492 "parse-gram.y"
2737 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2742 /* Line 1788 of yacc.c */
2743 #line 493 "parse-gram.y"
2744 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2749 /* Line 1788 of yacc.c */
2750 #line 494 "parse-gram.y"
2751 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2756 /* Line 1788 of yacc.c */
2757 #line 495 "parse-gram.y"
2758 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2763 /* Line 1788 of yacc.c */
2764 #line 501 "parse-gram.y"
2766 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2773 /* Line 1788 of yacc.c */
2774 #line 506 "parse-gram.y"
2776 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2777 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2783 /* Line 1788 of yacc.c */
2784 #line 511 "parse-gram.y"
2786 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2787 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2788 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2794 /* Line 1788 of yacc.c */
2795 #line 517 "parse-gram.y"
2797 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2798 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2799 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2805 /* Line 1788 of yacc.c */
2806 #line 523 "parse-gram.y"
2808 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2809 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2810 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2811 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2817 /* Line 1788 of yacc.c */
2818 #line 553 "parse-gram.y"
2826 /* Line 1788 of yacc.c */
2827 #line 559 "parse-gram.y"
2828 { current_lhs ((yyvsp
[(1) - (2)].symbol
), (yylsp
[(1) - (2)]), (yyvsp
[(2) - (2)].named_ref
)); }
2833 /* Line 1788 of yacc.c */
2834 #line 560 "parse-gram.y"
2836 /* Free the current lhs. */
2837 current_lhs (0, (yylsp
[(1) - (4)]), 0);
2843 /* Line 1788 of yacc.c */
2844 #line 567 "parse-gram.y"
2845 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2850 /* Line 1788 of yacc.c */
2851 #line 568 "parse-gram.y"
2852 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2857 /* Line 1788 of yacc.c */
2858 #line 574 "parse-gram.y"
2859 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2860 current_lhs_named_ref
); }
2865 /* Line 1788 of yacc.c */
2866 #line 577 "parse-gram.y"
2867 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (3)].symbol
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2872 /* Line 1788 of yacc.c */
2873 #line 579 "parse-gram.y"
2874 { grammar_current_rule_action_append ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2879 /* Line 1788 of yacc.c */
2880 #line 581 "parse-gram.y"
2881 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2886 /* Line 1788 of yacc.c */
2887 #line 583 "parse-gram.y"
2888 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2893 /* Line 1788 of yacc.c */
2894 #line 585 "parse-gram.y"
2895 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2900 /* Line 1788 of yacc.c */
2901 #line 589 "parse-gram.y"
2902 { (yyval
.named_ref
) = 0; }
2907 /* Line 1788 of yacc.c */
2908 #line 591 "parse-gram.y"
2909 { (yyval
.named_ref
) = named_ref_new((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2914 /* Line 1788 of yacc.c */
2915 #line 603 "parse-gram.y"
2916 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2921 /* Line 1788 of yacc.c */
2922 #line 608 "parse-gram.y"
2923 { (yyval
.chars
) = ""; }
2928 /* Line 1788 of yacc.c */
2929 #line 609 "parse-gram.y"
2930 { (yyval
.chars
) = (yyvsp
[(1) - (1)].uniqstr
); }
2935 /* Line 1788 of yacc.c */
2936 #line 620 "parse-gram.y"
2938 code_props plain_code
;
2939 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2940 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2941 code_props_translate_code (&plain_code
);
2942 gram_scanner_last_string_free ();
2943 (yyval
.chars
) = plain_code
.code
;
2949 /* Line 1788 of yacc.c */
2950 #line 640 "parse-gram.y"
2951 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2956 /* Line 1788 of yacc.c */
2957 #line 642 "parse-gram.y"
2959 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2960 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2961 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2967 /* Line 1788 of yacc.c */
2968 #line 650 "parse-gram.y"
2969 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2974 /* Line 1788 of yacc.c */
2975 #line 662 "parse-gram.y"
2977 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2978 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2984 /* Line 1788 of yacc.c */
2985 #line 671 "parse-gram.y"
2987 code_props plain_code
;
2988 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2989 code_props_translate_code (&plain_code
);
2990 gram_scanner_last_string_free ();
2991 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2992 code_scanner_last_string_free ();
2998 /* Line 1788 of yacc.c */
2999 #line 3000 "parse-gram.c"
3002 if (yychar_backup
!= yychar
)
3003 YY_LAC_DISCARD ("yychar change");
3005 /* User semantic actions sometimes alter yychar, and that requires
3006 that yytoken be updated with the new translation. We take the
3007 approach of translating immediately before every use of yytoken.
3008 One alternative is translating here after every semantic action,
3009 but that translation would be missed if the semantic action invokes
3010 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3011 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3012 incorrect destructor might then be invoked immediately. In the
3013 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3014 to an incorrect destructor call or verbose syntax error message
3015 before the lookahead is translated. */
3016 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3020 YY_STACK_PRINT (yyss
, yyssp
);
3025 /* Now `shift' the result of the reduction. Determine what state
3026 that goes to, based on the state we popped back to and the rule
3027 number reduced by. */
3031 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3032 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3033 yystate
= yytable
[yystate
];
3035 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3040 /*------------------------------------.
3041 | yyerrlab -- here on detecting error |
3042 `------------------------------------*/
3044 /* Make sure we have latest lookahead translation. See comments at
3045 user semantic actions for why this is necessary. */
3046 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3048 /* If not already recovering from an error, report this error. */
3052 #if ! YYERROR_VERBOSE
3053 yyerror (YY_("syntax error"));
3055 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3056 yyesa, &yyes, &yyes_capacity, \
3059 char const *yymsgp
= YY_("syntax error");
3060 int yysyntax_error_status
;
3061 if (yychar
!= YYEMPTY
)
3063 yysyntax_error_status
= YYSYNTAX_ERROR
;
3064 if (yysyntax_error_status
== 0)
3066 else if (yysyntax_error_status
== 1)
3068 if (yymsg
!= yymsgbuf
)
3069 YYSTACK_FREE (yymsg
);
3070 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3074 yymsg_alloc
= sizeof yymsgbuf
;
3075 yysyntax_error_status
= 2;
3079 yysyntax_error_status
= YYSYNTAX_ERROR
;
3084 if (yysyntax_error_status
== 2)
3085 goto yyexhaustedlab
;
3087 # undef YYSYNTAX_ERROR
3091 yyerror_range
[1] = yylloc
;
3093 if (yyerrstatus
== 3)
3095 /* If just tried and failed to reuse lookahead token after an
3096 error, discard it. */
3098 if (yychar
<= YYEOF
)
3100 /* Return failure if at end of input. */
3101 if (yychar
== YYEOF
)
3106 yydestruct ("Error: discarding",
3107 yytoken
, &yylval
, &yylloc
);
3112 /* Else will try to reuse lookahead token after shifting the error
3117 /*---------------------------------------------------.
3118 | yyerrorlab -- error raised explicitly by YYERROR. |
3119 `---------------------------------------------------*/
3122 /* Pacify compilers like GCC when the user code never invokes
3123 YYERROR and the label yyerrorlab therefore never appears in user
3125 if (/*CONSTCOND*/ 0)
3128 yyerror_range
[1] = yylsp
[1-yylen
];
3129 /* Do not reclaim the symbols of the rule which action triggered
3133 YY_STACK_PRINT (yyss
, yyssp
);
3138 /*-------------------------------------------------------------.
3139 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3140 `-------------------------------------------------------------*/
3142 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3146 yyn
= yypact
[yystate
];
3147 if (!yypact_value_is_default (yyn
))
3150 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3158 /* Pop the current state because it cannot handle the error token. */
3162 yyerror_range
[1] = *yylsp
;
3163 yydestruct ("Error: popping",
3164 yystos
[yystate
], yyvsp
, yylsp
);
3167 YY_STACK_PRINT (yyss
, yyssp
);
3170 /* If the stack popping above didn't lose the initial context for the
3171 current lookahead token, the shift below will for sure. */
3172 YY_LAC_DISCARD ("error recovery");
3176 yyerror_range
[2] = yylloc
;
3177 /* Using YYLLOC is tempting, but would change the location of
3178 the lookahead. YYLOC is available though. */
3179 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3182 /* Shift the error token. */
3183 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3189 /*-------------------------------------.
3190 | yyacceptlab -- YYACCEPT comes here. |
3191 `-------------------------------------*/
3196 /*-----------------------------------.
3197 | yyabortlab -- YYABORT comes here. |
3198 `-----------------------------------*/
3204 /*-------------------------------------------------.
3205 | yyexhaustedlab -- memory exhaustion comes here. |
3206 `-------------------------------------------------*/
3208 yyerror (YY_("memory exhausted"));
3214 if (yychar
!= YYEMPTY
)
3216 /* Make sure we have latest lookahead translation. See comments at
3217 user semantic actions for why this is necessary. */
3218 yytoken
= YYTRANSLATE (yychar
);
3219 yydestruct ("Cleanup: discarding lookahead",
3220 yytoken
, &yylval
, &yylloc
);
3222 /* Do not reclaim the symbols of the rule which action triggered
3223 this YYABORT or YYACCEPT. */
3225 YY_STACK_PRINT (yyss
, yyssp
);
3226 while (yyssp
!= yyss
)
3228 yydestruct ("Cleanup: popping",
3229 yystos
[*yyssp
], yyvsp
, yylsp
);
3234 YYSTACK_FREE (yyss
);
3237 YYSTACK_FREE (yyes
);
3239 if (yymsg
!= yymsgbuf
)
3240 YYSTACK_FREE (yymsg
);
3242 /* Make sure YYID is used. */
3243 return YYID (yyresult
);
3248 /* Line 2049 of yacc.c */
3249 #line 681 "parse-gram.y"
3253 /* Return the location of the left-hand side of a rule whose
3254 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3255 the right-hand side, and return an empty location equal to the end
3256 boundary of RHS[0] if the right-hand side is empty. */
3259 lloc_default (YYLTYPE
const *rhs
, int n
)
3264 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3265 The bug is fixed in 7.4.2m, but play it safe for now. */
3266 loc
.start
= rhs
[n
].end
;
3267 loc
.end
= rhs
[n
].end
;
3269 /* Ignore empty nonterminals the start of the right-hand side.
3270 Do not bother to ignore them at the end of the right-hand side,
3271 since empty nonterminals have the same end as their predecessors. */
3272 for (i
= 1; i
<= n
; i
++)
3273 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3275 loc
.start
= rhs
[i
].start
;
3283 /* Add a lex-param or a parse-param (depending on TYPE) with
3284 declaration DECL and location LOC. */
3287 add_param (char const *type
, char *decl
, location loc
)
3289 static char const alphanum
[26 + 26 + 1 + 10] =
3290 "abcdefghijklmnopqrstuvwxyz"
3291 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3294 char const *name_start
= NULL
;
3297 /* Stop on last actual character. */
3298 for (p
= decl
; p
[1]; p
++)
3300 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3301 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3304 /* Strip the surrounding '{' and '}', and any blanks just inside
3306 while (*--p
== ' ' || *p
== '\t')
3309 while (*++decl
== ' ' || *decl
== '\t')
3313 complain_at (loc
, _("missing identifier in parameter declaration"));
3316 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3317 muscle_pair_list_grow (type
, decl
, name
);
3321 gram_scanner_last_string_free ();
3326 version_check (location
const *loc
, char const *version
)
3328 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3330 complain_at (*loc
, "require bison %s, but have %s",
3331 version
, PACKAGE_VERSION
);
3337 gram_error (location
const *loc
, char const *msg
)
3339 complain_at (*loc
, "%s", msg
);
3343 token_name (int type
)
3345 return yytname
[YYTRANSLATE (type
)];
3356 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3357 return quotearg_style (escape_quoting_style
, buf
);