1 /* A Bison parser, made by GNU Bison 2.3a+. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3a+"
53 #define YYSKELETON_NAME "yacc.c"
64 /* Using locations. */
65 #define YYLSP_NEEDED 1
67 /* Substitute the variable and function names. */
68 #define yyparse gram_parse
69 #define yylex gram_lex
70 #define yyerror gram_error
71 #define yylval gram_lval
72 #define yychar gram_char
73 #define yydebug gram_debug
74 #define yynerrs gram_nerrs
75 #define yylloc gram_lloc
77 /* Copy the first part of user declarations. */
79 /* Line 167 of yacc.c */
80 #line 1 "parse-gram.y"
81 /* Bison Grammar Parser -*- C -*-
83 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
86 This file is part of Bison, the GNU Compiler Compiler.
88 This program is free software; you can redistribute it and/or modify
89 it under the terms of the GNU General Public License as published by
90 the Free Software Foundation; either version 2 of the License, or
91 (at your option) any later version.
93 This program is distributed in the hope that it will be useful,
94 but WITHOUT ANY WARRANTY; without even the implied warranty of
95 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96 GNU General Public License for more details.
98 You should have received a copy of the GNU General Public License
99 along with this program; if not, write to the Free Software
100 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
107 #include <strverscmp.h>
109 #include "complain.h"
110 #include "conflicts.h"
114 #include "muscle_tab.h"
115 #include "quotearg.h"
118 #include "scan-gram.h"
119 #include "scan-code.h"
121 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
122 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
124 #define YY_LOCATION_PRINT(File, Loc) \
125 location_print (File, Loc)
127 static void version_check (location
const *loc
, char const *version
);
129 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
130 FIXME: depends on the undocumented availability of YYLLOC. */
132 #define yyerror(Msg) \
133 gram_error (&yylloc, Msg)
134 static void gram_error (location
const *, char const *);
136 static char const *char_name (char);
138 /** Add a lex-param or a parse-param.
140 * \param type \a lex_param or \a parse_param
141 * \param decl the formal argument
142 * \param loc the location in the source.
144 static void add_param (char const *type
, char *decl
, location loc
);
147 static symbol_class current_class
= unknown_sym
;
148 static uniqstr current_type
= NULL
;
149 static symbol
*current_lhs
;
150 static location current_lhs_location
;
151 static int current_prec
= 0;
153 #define YYTYPE_INT16 int_fast16_t
154 #define YYTYPE_INT8 int_fast8_t
155 #define YYTYPE_UINT16 uint_fast16_t
156 #define YYTYPE_UINT8 uint_fast8_t
159 /* Line 167 of yacc.c */
160 #line 161 "parse-gram.c"
162 /* Enabling traces. */
167 /* Enabling verbose error messages. */
168 #ifdef YYERROR_VERBOSE
169 # undef YYERROR_VERBOSE
170 # define YYERROR_VERBOSE 1
172 # define YYERROR_VERBOSE 1
175 /* Enabling the token table. */
176 #ifndef YYTOKEN_TABLE
177 # define YYTOKEN_TABLE 0
184 /* Put the tokens into the symbol table, so that GDB and other debuggers
193 PERCENT_DESTRUCTOR
= 263,
194 PERCENT_PRINTER
= 264,
197 PERCENT_NONASSOC
= 267,
202 PERCENT_CODE_TOP
= 272,
204 PERCENT_DEFAULT_PREC
= 274,
205 PERCENT_DEFINE
= 275,
206 PERCENT_DEFINES
= 276,
207 PERCENT_ERROR_VERBOSE
= 277,
208 PERCENT_EXPECT
= 278,
209 PERCENT_EXPECT_RR
= 279,
210 PERCENT_FILE_PREFIX
= 280,
211 PERCENT_GLR_PARSER
= 281,
212 PERCENT_INITIAL_ACTION
= 282,
213 PERCENT_LANGUAGE
= 283,
214 PERCENT_LEX_PARAM
= 284,
215 PERCENT_LOCATIONS
= 285,
216 PERCENT_NAME_PREFIX
= 286,
217 PERCENT_NO_DEFAULT_PREC
= 287,
218 PERCENT_NO_LINES
= 288,
219 PERCENT_NONDETERMINISTIC_PARSER
= 289,
220 PERCENT_OUTPUT
= 290,
221 PERCENT_PARSE_PARAM
= 291,
222 PERCENT_PROVIDES
= 292,
223 PERCENT_PURE_PARSER
= 293,
224 PERCENT_PUSH_PARSER
= 294,
225 PERCENT_PUSH_PULL_PARSER
= 295,
226 PERCENT_REQUIRE
= 296,
227 PERCENT_REQUIRES
= 297,
228 PERCENT_SKELETON
= 298,
230 PERCENT_TOKEN_TABLE
= 300,
231 PERCENT_VERBOSE
= 301,
239 PERCENT_PERCENT
= 309,
253 #define PERCENT_TOKEN 260
254 #define PERCENT_NTERM 261
255 #define PERCENT_TYPE 262
256 #define PERCENT_DESTRUCTOR 263
257 #define PERCENT_PRINTER 264
258 #define PERCENT_LEFT 265
259 #define PERCENT_RIGHT 266
260 #define PERCENT_NONASSOC 267
261 #define PERCENT_PREC 268
262 #define PERCENT_DPREC 269
263 #define PERCENT_MERGE 270
264 #define PERCENT_CODE 271
265 #define PERCENT_CODE_TOP 272
266 #define PERCENT_DEBUG 273
267 #define PERCENT_DEFAULT_PREC 274
268 #define PERCENT_DEFINE 275
269 #define PERCENT_DEFINES 276
270 #define PERCENT_ERROR_VERBOSE 277
271 #define PERCENT_EXPECT 278
272 #define PERCENT_EXPECT_RR 279
273 #define PERCENT_FILE_PREFIX 280
274 #define PERCENT_GLR_PARSER 281
275 #define PERCENT_INITIAL_ACTION 282
276 #define PERCENT_LANGUAGE 283
277 #define PERCENT_LEX_PARAM 284
278 #define PERCENT_LOCATIONS 285
279 #define PERCENT_NAME_PREFIX 286
280 #define PERCENT_NO_DEFAULT_PREC 287
281 #define PERCENT_NO_LINES 288
282 #define PERCENT_NONDETERMINISTIC_PARSER 289
283 #define PERCENT_OUTPUT 290
284 #define PERCENT_PARSE_PARAM 291
285 #define PERCENT_PROVIDES 292
286 #define PERCENT_PURE_PARSER 293
287 #define PERCENT_PUSH_PARSER 294
288 #define PERCENT_PUSH_PULL_PARSER 295
289 #define PERCENT_REQUIRE 296
290 #define PERCENT_REQUIRES 297
291 #define PERCENT_SKELETON 298
292 #define PERCENT_START 299
293 #define PERCENT_TOKEN_TABLE 300
294 #define PERCENT_VERBOSE 301
295 #define PERCENT_YACC 302
296 #define BRACED_CODE 303
302 #define PERCENT_PERCENT 309
305 #define SEMICOLON 312
307 #define TYPE_TAG_ANY 314
308 #define TYPE_TAG_NONE 315
309 #define PERCENT_UNION 316
314 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
315 typedef union YYSTYPE
317 /* Line 201 of yacc.c */
318 #line 98 "parse-gram.y"
327 unsigned char character
;
330 /* Line 201 of yacc.c */
331 #line 332 "parse-gram.c"
333 # define YYSTYPE_IS_TRIVIAL 1
334 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
335 # define YYSTYPE_IS_DECLARED 1
338 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
339 typedef struct YYLTYPE
346 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
347 # define YYLTYPE_IS_DECLARED 1
348 # define YYLTYPE_IS_TRIVIAL 1
352 /* Copy the second part of user declarations. */
355 /* Line 224 of yacc.c */
356 #line 357 "parse-gram.c"
363 typedef YYTYPE_UINT8 yytype_uint8
;
365 typedef unsigned char yytype_uint8
;
369 typedef YYTYPE_INT8 yytype_int8
;
370 #elif (defined __STDC__ || defined __C99__FUNC__ \
371 || defined __cplusplus || defined _MSC_VER)
372 typedef signed char yytype_int8
;
374 typedef short int yytype_int8
;
378 typedef YYTYPE_UINT16 yytype_uint16
;
380 typedef unsigned short int yytype_uint16
;
384 typedef YYTYPE_INT16 yytype_int16
;
386 typedef short int yytype_int16
;
390 # ifdef __SIZE_TYPE__
391 # define YYSIZE_T __SIZE_TYPE__
392 # elif defined size_t
393 # define YYSIZE_T size_t
394 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
395 || defined __cplusplus || defined _MSC_VER)
396 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
397 # define YYSIZE_T size_t
399 # define YYSIZE_T unsigned int
403 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
408 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
409 # define YY_(msgid) dgettext ("bison-runtime", msgid)
413 # define YY_(msgid) msgid
417 /* Suppress unused-variable warnings by "using" E. */
418 #if ! defined lint || defined __GNUC__
419 # define YYUSE(e) ((void) (e))
421 # define YYUSE(e) /* empty */
424 /* Identity function, used to suppress warnings about constant conditions. */
428 #if (defined __STDC__ || defined __C99__FUNC__ \
429 || defined __cplusplus || defined _MSC_VER)
442 #if ! defined yyoverflow || YYERROR_VERBOSE
444 /* The parser invokes alloca or malloc; define the necessary symbols. */
446 # ifdef YYSTACK_USE_ALLOCA
447 # if YYSTACK_USE_ALLOCA
449 # define YYSTACK_ALLOC __builtin_alloca
450 # elif defined __BUILTIN_VA_ARG_INCR
451 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
453 # define YYSTACK_ALLOC __alloca
454 # elif defined _MSC_VER
455 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
456 # define alloca _alloca
458 # define YYSTACK_ALLOC alloca
459 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
460 || defined __cplusplus || defined _MSC_VER)
461 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
470 # ifdef YYSTACK_ALLOC
471 /* Pacify GCC's `empty if-body' warning. */
472 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
473 # ifndef YYSTACK_ALLOC_MAXIMUM
474 /* The OS might guarantee only one guard page at the bottom of the stack,
475 and a page size can be as small as 4096 bytes. So we cannot safely
476 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
477 to allow for a few compiler-allocated temporary stack slots. */
478 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
481 # define YYSTACK_ALLOC YYMALLOC
482 # define YYSTACK_FREE YYFREE
483 # ifndef YYSTACK_ALLOC_MAXIMUM
484 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
486 # if (defined __cplusplus && ! defined _STDLIB_H \
487 && ! ((defined YYMALLOC || defined malloc) \
488 && (defined YYFREE || defined free)))
489 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
495 # define YYMALLOC malloc
496 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
497 || defined __cplusplus || defined _MSC_VER)
498 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
503 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
504 || defined __cplusplus || defined _MSC_VER)
505 void free (void *); /* INFRINGES ON USER NAME SPACE */
509 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
512 #if (! defined yyoverflow \
513 && (! defined __cplusplus \
514 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
515 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
517 /* A type that is properly aligned for any stack member. */
525 /* The size of the maximum gap between one aligned stack and the next. */
526 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
528 /* The size of an array large to enough to hold all stacks, each with
530 # define YYSTACK_BYTES(N) \
531 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
532 + 2 * YYSTACK_GAP_MAXIMUM)
534 /* Copy COUNT objects from FROM to TO. The source and destination do
537 # if defined __GNUC__ && 1 < __GNUC__
538 # define YYCOPY(To, From, Count) \
539 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
541 # define YYCOPY(To, From, Count) \
545 for (yyi = 0; yyi < (Count); yyi++) \
546 (To)[yyi] = (From)[yyi]; \
552 /* Relocate STACK from its old location to the new one. The
553 local variables YYSIZE and YYSTACKSIZE give the old and new number of
554 elements in the stack, and YYPTR gives the new location of the
555 stack. Advance YYPTR to a properly aligned location for the next
557 # define YYSTACK_RELOCATE(Stack) \
560 YYSIZE_T yynewbytes; \
561 YYCOPY (&yyptr->Stack, Stack, yysize); \
562 Stack = &yyptr->Stack; \
563 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
564 yyptr += yynewbytes / sizeof (*yyptr); \
570 /* YYFINAL -- State number of the termination state. */
572 /* YYLAST -- Last index in YYTABLE. */
575 /* YYNTOKENS -- Number of terminals. */
577 /* YYNNTS -- Number of nonterminals. */
579 /* YYNRULES -- Number of rules. */
581 /* YYNRULES -- Number of states. */
582 #define YYNSTATES 145
584 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
586 #define YYMAXUTOK 316
588 #define YYTRANSLATE(YYX) \
589 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
591 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
592 static const yytype_uint8 yytranslate
[] =
594 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
620 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
621 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
622 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
623 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
624 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
625 55, 56, 57, 58, 59, 60, 61
629 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
631 static const yytype_uint16 yyprhs
[] =
633 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
634 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
635 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
636 80, 82, 85, 88, 90, 92, 94, 96, 98, 100,
637 103, 107, 111, 113, 115, 118, 121, 124, 127, 128,
638 130, 134, 135, 139, 140, 144, 148, 152, 154, 156,
639 158, 159, 161, 163, 166, 168, 171, 173, 175, 177,
640 179, 181, 183, 186, 189, 193, 195, 198, 200, 203,
641 205, 208, 211, 212, 216, 218, 222, 225, 226, 229,
642 232, 236, 240, 244, 246, 248, 249, 251, 253, 255,
643 257, 259, 261, 263, 265, 266
646 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
647 static const yytype_int8 yyrhs
[] =
649 63, 0, -1, 64, 54, 79, 92, -1, -1, 64,
650 65, -1, 66, -1, 56, -1, 18, -1, 20, 3,
651 86, -1, 21, -1, 21, 3, -1, 22, -1, 23,
652 4, -1, 24, 4, -1, 25, 3, -1, 25, 51,
653 3, -1, 26, -1, 27, 48, -1, 28, 3, -1,
654 29, 48, -1, 30, -1, 31, 3, -1, 31, 51,
655 3, -1, 33, -1, 34, -1, 35, 3, -1, 35,
656 51, 3, -1, 36, 48, -1, 38, -1, 39, -1,
657 40, -1, 41, 3, -1, 43, 3, -1, 45, -1,
658 46, -1, 47, -1, 57, -1, 71, -1, 68, -1,
659 44, 90, -1, 8, 48, 75, -1, 9, 48, 75,
660 -1, 19, -1, 32, -1, 16, 87, -1, 17, 87,
661 -1, 37, 87, -1, 42, 87, -1, -1, 52, -1,
662 61, 67, 48, -1, -1, 6, 69, 78, -1, -1,
663 5, 70, 78, -1, 7, 58, 74, -1, 72, 73,
664 74, -1, 10, -1, 11, -1, 12, -1, -1, 58,
665 -1, 90, -1, 74, 90, -1, 76, -1, 75, 76,
666 -1, 90, -1, 58, -1, 59, -1, 60, -1, 58,
667 -1, 88, -1, 88, 4, -1, 88, 91, -1, 88,
668 4, 91, -1, 77, -1, 78, 77, -1, 80, -1,
669 79, 80, -1, 81, -1, 66, 57, -1, 1, 57,
670 -1, -1, 89, 82, 83, -1, 84, -1, 83, 55,
671 84, -1, 83, 57, -1, -1, 84, 90, -1, 84,
672 48, -1, 84, 13, 90, -1, 84, 14, 4, -1,
673 84, 15, 58, -1, 3, -1, 87, -1, -1, 85,
674 -1, 48, -1, 52, -1, 49, -1, 53, -1, 88,
675 -1, 91, -1, 3, -1, -1, 54, 50, -1
678 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
679 static const yytype_uint16 yyrline
[] =
681 0, 214, 214, 222, 224, 228, 229, 238, 239, 240,
682 241, 246, 247, 248, 249, 250, 251, 256, 265, 266,
683 267, 268, 269, 270, 271, 272, 273, 274, 275, 276,
684 277, 278, 279, 280, 281, 282, 283, 287, 288, 289,
685 293, 300, 307, 311, 315, 316, 317, 318, 329, 330,
686 334, 363, 363, 368, 368, 373, 384, 399, 400, 401,
687 405, 406, 411, 413, 418, 419, 423, 424, 425, 426,
688 431, 436, 441, 447, 453, 464, 465, 474, 475, 481,
689 482, 483, 490, 490, 494, 495, 496, 501, 502, 504,
690 506, 508, 510, 520, 521, 527, 531, 536, 556, 558,
691 567, 572, 573, 578, 585, 587
695 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
696 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
697 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
698 static const char *const yytname
[] =
700 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
701 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
702 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
703 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%code-top\"", "\"%debug\"",
704 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
705 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
706 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
707 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
708 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
709 "\"%parse-param\"", "\"%provides\"", "\"%pure-parser\"",
710 "\"%push-parser\"", "\"%push-pull-parser\"", "\"%require\"",
711 "\"%requires\"", "\"%skeleton\"", "\"%start\"", "\"%token-table\"",
712 "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"",
713 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
714 "\"%{...%}\"", "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"",
715 "$accept", "input", "prologue_declarations", "prologue_declaration",
716 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
717 "precedence_declaration", "precedence_declarator", "type.opt",
718 "symbols.1", "generic_symlist", "generic_symlist_item", "symbol_def",
719 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
720 "$@3", "rhses.1", "rhs", "content", "content.opt", "braceless", "id",
721 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
726 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
728 static const yytype_uint16 yytoknum
[] =
730 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
731 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
732 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
733 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
734 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
735 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
740 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
741 static const yytype_uint8 yyr1
[] =
743 0, 62, 63, 64, 64, 65, 65, 65, 65, 65,
744 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
745 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
746 65, 65, 65, 65, 65, 65, 65, 66, 66, 66,
747 66, 66, 66, 66, 66, 66, 66, 66, 67, 67,
748 66, 69, 68, 70, 68, 68, 71, 72, 72, 72,
749 73, 73, 74, 74, 75, 75, 76, 76, 76, 76,
750 77, 77, 77, 77, 77, 78, 78, 79, 79, 80,
751 80, 80, 82, 81, 83, 83, 83, 84, 84, 84,
752 84, 84, 84, 85, 85, 86, 86, 87, 88, 88,
753 89, 90, 90, 91, 92, 92
756 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
757 static const yytype_uint8 yyr2
[] =
759 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
760 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
761 1, 2, 3, 1, 1, 2, 3, 2, 1, 1,
762 1, 2, 2, 1, 1, 1, 1, 1, 1, 2,
763 3, 3, 1, 1, 2, 2, 2, 2, 0, 1,
764 3, 0, 3, 0, 3, 3, 3, 1, 1, 1,
765 0, 1, 1, 2, 1, 2, 1, 1, 1, 1,
766 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
767 2, 2, 0, 3, 1, 3, 2, 0, 2, 2,
768 3, 3, 3, 1, 1, 0, 1, 1, 1, 1,
772 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
773 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
774 means the default is an error. */
775 static const yytype_uint8 yydefact
[] =
777 3, 0, 0, 1, 53, 51, 0, 0, 0, 57,
778 58, 59, 0, 0, 7, 42, 0, 9, 11, 0,
779 0, 0, 16, 0, 0, 0, 20, 0, 43, 23,
780 24, 0, 0, 0, 28, 29, 30, 0, 0, 0,
781 0, 33, 34, 35, 0, 6, 36, 48, 4, 5,
782 38, 37, 60, 0, 0, 0, 0, 0, 97, 44,
783 45, 95, 10, 12, 13, 14, 0, 17, 18, 19,
784 21, 0, 25, 0, 27, 46, 31, 47, 32, 103,
785 99, 98, 101, 39, 102, 0, 100, 0, 0, 77,
786 79, 82, 49, 0, 61, 0, 70, 75, 54, 71,
787 52, 55, 62, 67, 68, 69, 40, 64, 66, 41,
788 93, 96, 8, 94, 15, 22, 26, 81, 80, 0,
789 78, 2, 87, 50, 56, 76, 72, 73, 63, 65,
790 105, 83, 84, 74, 87, 86, 0, 0, 0, 89,
794 /* YYDEFGOTO[NTERM-NUM]. */
795 static const yytype_int16 yydefgoto
[] =
797 -1, 1, 2, 48, 87, 93, 50, 54, 53, 51,
798 52, 95, 101, 106, 107, 97, 98, 88, 89, 90,
799 122, 131, 132, 111, 112, 59, 82, 91, 108, 84,
803 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
805 #define YYPACT_NINF -100
806 static const yytype_int16 yypact
[] =
808 -100, 3, 127, -100, -100, -100, -50, -22, -11, -100,
809 -100, -100, -3, -3, -100, -100, 37, 43, -100, 56,
810 59, 1, -100, 19, 65, 21, -100, 11, -100, -100,
811 -100, 13, 22, -3, -100, -100, -100, 71, -3, 85,
812 -2, -100, -100, -100, 70, -100, -100, 38, -100, -100,
813 -100, -100, 33, -17, -17, -2, -1, -1, -100, -100,
814 -100, 24, -100, -100, -100, -100, 90, -100, -100, -100,
815 -100, 91, -100, 92, -100, -100, -100, -100, -100, -100,
816 -100, -100, -100, -100, -100, 40, -100, 41, 12, -100,
817 -100, -100, -100, 51, -100, -2, -100, -100, -17, 39,
818 -17, -2, -100, -100, -100, -100, -1, -100, -100, -1,
819 -100, -100, -100, -100, -100, -100, -100, -100, -100, 50,
820 -100, -100, -100, -100, -2, -100, 100, -100, -100, -100,
821 -100, -46, 172, -100, -100, -100, -2, 101, 46, -100,
822 -100, 172, -100, -100, -100
825 /* YYPGOTO[NTERM-NUM]. */
826 static const yytype_int8 yypgoto
[] =
828 -100, -100, -100, -100, 104, -100, -100, -100, -100, -100,
829 -100, -100, 14, 53, -99, -64, 54, -100, 23, -100,
830 -100, -100, -21, -100, -100, -8, -15, -100, -40, -93,
834 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
835 positive, shift that token. If negative, reduce the rule which
836 number is the opposite. If zero, do what YYDEFACT says.
837 If YYTABLE_NINF, syntax error. */
838 #define YYTABLE_NINF -105
839 static const yytype_int16 yytable
[] =
841 83, 79, 79, 3, 65, 60, 127, 129, 55, 134,
842 129, 135, -104, 85, 70, 102, 72, 4, 5, 6,
843 7, 8, 9, 10, 11, 75, 56, 110, 12, 13,
844 77, 15, 80, 133, 125, 81, 125, 57, 99, 99,
845 61, 96, 79, 126, 28, 58, 62, 80, 80, 33,
846 81, 81, 66, 113, 38, 102, 40, 103, 104, 105,
847 63, 128, 71, 64, 73, 86, 119, 67, 68, 69,
848 74, 85, 58, 47, 76, 4, 5, 6, 7, 8,
849 9, 10, 11, 99, 128, 99, 12, 13, 78, 15,
850 92, 94, 140, 114, 115, 116, 142, 117, 118, 123,
851 130, 140, 28, 79, 144, 143, 49, 33, 100, 124,
852 109, 120, 38, 141, 40, 0, 0, 0, 0, 0,
853 0, 0, 0, 86, 0, 0, 0, 0, 0, 0,
854 0, 47, 4, 5, 6, 7, 8, 9, 10, 11,
855 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
856 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
857 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
858 39, 40, 41, 42, 43, 79, 0, 0, 0, 0,
859 0, 44, 0, 45, 46, 136, 137, 138, 47, 0,
860 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
861 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
862 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
866 static const yytype_int16 yycheck
[] =
868 40, 3, 3, 0, 3, 13, 99, 106, 58, 55,
869 109, 57, 0, 1, 3, 55, 3, 5, 6, 7,
870 8, 9, 10, 11, 12, 33, 48, 3, 16, 17,
871 38, 19, 49, 126, 98, 52, 100, 48, 53, 54,
872 3, 58, 3, 4, 32, 48, 3, 49, 49, 37,
873 52, 52, 51, 61, 42, 95, 44, 58, 59, 60,
874 4, 101, 51, 4, 51, 53, 54, 48, 3, 48,
875 48, 1, 48, 61, 3, 5, 6, 7, 8, 9,
876 10, 11, 12, 98, 124, 100, 16, 17, 3, 19,
877 52, 58, 132, 3, 3, 3, 136, 57, 57, 48,
878 50, 141, 32, 3, 58, 4, 2, 37, 54, 95,
879 57, 88, 42, 134, 44, -1, -1, -1, -1, -1,
880 -1, -1, -1, 53, -1, -1, -1, -1, -1, -1,
881 -1, 61, 5, 6, 7, 8, 9, 10, 11, 12,
882 -1, -1, -1, 16, 17, 18, 19, 20, 21, 22,
883 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
884 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
885 43, 44, 45, 46, 47, 3, -1, -1, -1, -1,
886 -1, 54, -1, 56, 57, 13, 14, 15, 61, -1,
887 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
888 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
889 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
893 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
894 symbol of state STATE-NUM. */
895 static const yytype_uint8 yystos
[] =
897 0, 63, 64, 0, 5, 6, 7, 8, 9, 10,
898 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
899 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
900 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
901 44, 45, 46, 47, 54, 56, 57, 61, 65, 66,
902 68, 71, 72, 70, 69, 58, 48, 48, 48, 87,
903 87, 3, 3, 4, 4, 3, 51, 48, 3, 48,
904 3, 51, 3, 51, 48, 87, 3, 87, 3, 3,
905 49, 52, 88, 90, 91, 1, 53, 66, 79, 80,
906 81, 89, 52, 67, 58, 73, 58, 77, 78, 88,
907 78, 74, 90, 58, 59, 60, 75, 76, 90, 75,
908 3, 85, 86, 87, 3, 3, 3, 57, 57, 54,
909 80, 92, 82, 48, 74, 77, 4, 91, 90, 76,
910 50, 83, 84, 91, 55, 57, 13, 14, 15, 48,
914 #define yyerrok (yyerrstatus = 0)
915 #define yyclearin (yychar = YYEMPTY)
919 #define YYACCEPT goto yyacceptlab
920 #define YYABORT goto yyabortlab
921 #define YYERROR goto yyerrorlab
924 /* Like YYERROR except do call yyerror. This remains here temporarily
925 to ease the transition to the new meaning of YYERROR, for GCC.
926 Once GCC version 2 has supplanted version 1, this can go. */
928 #define YYFAIL goto yyerrlab
930 #define YYRECOVERING() (!!yyerrstatus)
932 #define YYBACKUP(Token, Value) \
934 if (yychar == YYEMPTY && yylen == 1) \
938 yytoken = YYTRANSLATE (yychar); \
944 yyerror (YY_("syntax error: cannot back up")); \
951 #define YYERRCODE 256
954 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
955 If N is 0, then set CURRENT to the empty location which ends
956 the previous symbol: RHS[0] (always defined). */
958 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
959 #ifndef YYLLOC_DEFAULT
960 # define YYLLOC_DEFAULT(Current, Rhs, N) \
964 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
965 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
966 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
967 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
971 (Current).first_line = (Current).last_line = \
972 YYRHSLOC (Rhs, 0).last_line; \
973 (Current).first_column = (Current).last_column = \
974 YYRHSLOC (Rhs, 0).last_column; \
980 /* YY_LOCATION_PRINT -- Print the location on the stream.
981 This macro was not mandated originally: define only if we know
982 we won't break user code: when these are the locations we know. */
984 #ifndef YY_LOCATION_PRINT
985 # if YYLTYPE_IS_TRIVIAL
986 # define YY_LOCATION_PRINT(File, Loc) \
987 fprintf (File, "%d.%d-%d.%d", \
988 (Loc).first_line, (Loc).first_column, \
989 (Loc).last_line, (Loc).last_column)
991 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
996 /* YYLEX -- calling `yylex' with the right arguments. */
999 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1001 # define YYLEX yylex (&yylval, &yylloc)
1004 /* Enable debugging if requested. */
1008 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1009 # define YYFPRINTF fprintf
1012 # define YYDPRINTF(Args) \
1018 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1022 YYFPRINTF (stderr, "%s ", Title); \
1023 yy_symbol_print (stderr, \
1024 Type, Value, Location); \
1025 YYFPRINTF (stderr, "\n"); \
1030 /*--------------------------------.
1031 | Print this symbol on YYOUTPUT. |
1032 `--------------------------------*/
1035 #if (defined __STDC__ || defined __C99__FUNC__ \
1036 || defined __cplusplus || defined _MSC_VER)
1038 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1041 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1044 YYSTYPE
const * const yyvaluep
;
1045 YYLTYPE
const * const yylocationp
;
1050 YYUSE (yylocationp
);
1052 if (yytype
< YYNTOKENS
)
1053 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1059 case 3: /* "\"string\"" */
1061 /* Line 673 of yacc.c */
1062 #line 192 "parse-gram.y"
1063 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1065 /* Line 673 of yacc.c */
1066 #line 1067 "parse-gram.c"
1068 case 4: /* "\"integer\"" */
1070 /* Line 673 of yacc.c */
1071 #line 203 "parse-gram.y"
1072 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1074 /* Line 673 of yacc.c */
1075 #line 1076 "parse-gram.c"
1077 case 48: /* "\"{...}\"" */
1079 /* Line 673 of yacc.c */
1080 #line 194 "parse-gram.y"
1081 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1083 /* Line 673 of yacc.c */
1084 #line 1085 "parse-gram.c"
1086 case 49: /* "\"char\"" */
1088 /* Line 673 of yacc.c */
1089 #line 186 "parse-gram.y"
1090 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1092 /* Line 673 of yacc.c */
1093 #line 1094 "parse-gram.c"
1095 case 50: /* "\"epilogue\"" */
1097 /* Line 673 of yacc.c */
1098 #line 194 "parse-gram.y"
1099 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1101 /* Line 673 of yacc.c */
1102 #line 1103 "parse-gram.c"
1104 case 52: /* "\"identifier\"" */
1106 /* Line 673 of yacc.c */
1107 #line 199 "parse-gram.y"
1108 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1110 /* Line 673 of yacc.c */
1111 #line 1112 "parse-gram.c"
1113 case 53: /* "\"identifier:\"" */
1115 /* Line 673 of yacc.c */
1116 #line 200 "parse-gram.y"
1117 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1119 /* Line 673 of yacc.c */
1120 #line 1121 "parse-gram.c"
1122 case 56: /* "\"%{...%}\"" */
1124 /* Line 673 of yacc.c */
1125 #line 194 "parse-gram.y"
1126 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1128 /* Line 673 of yacc.c */
1129 #line 1130 "parse-gram.c"
1131 case 58: /* "\"type\"" */
1133 /* Line 673 of yacc.c */
1134 #line 198 "parse-gram.y"
1135 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1137 /* Line 673 of yacc.c */
1138 #line 1139 "parse-gram.c"
1140 case 85: /* "content" */
1142 /* Line 673 of yacc.c */
1143 #line 194 "parse-gram.y"
1144 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1146 /* Line 673 of yacc.c */
1147 #line 1148 "parse-gram.c"
1149 case 86: /* "content.opt" */
1151 /* Line 673 of yacc.c */
1152 #line 194 "parse-gram.y"
1153 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1155 /* Line 673 of yacc.c */
1156 #line 1157 "parse-gram.c"
1158 case 87: /* "braceless" */
1160 /* Line 673 of yacc.c */
1161 #line 194 "parse-gram.y"
1162 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1164 /* Line 673 of yacc.c */
1165 #line 1166 "parse-gram.c"
1169 /* Line 673 of yacc.c */
1170 #line 206 "parse-gram.y"
1171 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1173 /* Line 673 of yacc.c */
1174 #line 1175 "parse-gram.c"
1176 case 89: /* "id_colon" */
1178 /* Line 673 of yacc.c */
1179 #line 207 "parse-gram.y"
1180 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1182 /* Line 673 of yacc.c */
1183 #line 1184 "parse-gram.c"
1185 case 90: /* "symbol" */
1187 /* Line 673 of yacc.c */
1188 #line 206 "parse-gram.y"
1189 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1191 /* Line 673 of yacc.c */
1192 #line 1193 "parse-gram.c"
1194 case 91: /* "string_as_id" */
1196 /* Line 673 of yacc.c */
1197 #line 206 "parse-gram.y"
1198 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1200 /* Line 673 of yacc.c */
1201 #line 1202 "parse-gram.c"
1209 /*--------------------------------.
1210 | Print this symbol on YYOUTPUT. |
1211 `--------------------------------*/
1213 #if (defined __STDC__ || defined __C99__FUNC__ \
1214 || defined __cplusplus || defined _MSC_VER)
1216 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1219 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1222 YYSTYPE
const * const yyvaluep
;
1223 YYLTYPE
const * const yylocationp
;
1226 if (yytype
< YYNTOKENS
)
1227 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1229 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1231 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1232 YYFPRINTF (yyoutput
, ": ");
1233 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1234 YYFPRINTF (yyoutput
, ")");
1237 /*------------------------------------------------------------------.
1238 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1240 `------------------------------------------------------------------*/
1242 #if (defined __STDC__ || defined __C99__FUNC__ \
1243 || defined __cplusplus || defined _MSC_VER)
1245 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1248 yy_stack_print (yybottom
, yytop
)
1249 yytype_int16
*yybottom
;
1250 yytype_int16
*yytop
;
1253 YYFPRINTF (stderr
, "Stack now");
1254 for (; yybottom
<= yytop
; yybottom
++)
1256 int yybot
= *yybottom
;
1257 YYFPRINTF (stderr
, " %d", yybot
);
1259 YYFPRINTF (stderr
, "\n");
1262 # define YY_STACK_PRINT(Bottom, Top) \
1265 yy_stack_print ((Bottom), (Top)); \
1269 /*------------------------------------------------.
1270 | Report that the YYRULE is going to be reduced. |
1271 `------------------------------------------------*/
1273 #if (defined __STDC__ || defined __C99__FUNC__ \
1274 || defined __cplusplus || defined _MSC_VER)
1276 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1279 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1285 int yynrhs
= yyr2
[yyrule
];
1287 unsigned long int yylno
= yyrline
[yyrule
];
1288 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1290 /* The symbols being reduced. */
1291 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1293 fprintf (stderr
, " $%d = ", yyi
+ 1);
1294 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1295 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1296 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1297 fprintf (stderr
, "\n");
1301 # define YY_REDUCE_PRINT(Rule) \
1304 yy_reduce_print (yyvsp, yylsp, Rule); \
1307 /* Nonzero means print parse trace. It is left uninitialized so that
1308 multiple parsers can coexist. */
1310 #else /* !YYDEBUG */
1311 # define YYDPRINTF(Args)
1312 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1313 # define YY_STACK_PRINT(Bottom, Top)
1314 # define YY_REDUCE_PRINT(Rule)
1315 #endif /* !YYDEBUG */
1318 /* YYINITDEPTH -- initial size of the parser's stacks. */
1320 # define YYINITDEPTH 200
1323 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1324 if the built-in stack extension method is used).
1326 Do not make this value too large; the results are undefined if
1327 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1328 evaluated with infinite-precision integer arithmetic. */
1331 # define YYMAXDEPTH 10000
1339 # if defined __GLIBC__ && defined _STRING_H
1340 # define yystrlen strlen
1342 /* Return the length of YYSTR. */
1343 #if (defined __STDC__ || defined __C99__FUNC__ \
1344 || defined __cplusplus || defined _MSC_VER)
1346 yystrlen (const char *yystr
)
1354 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1362 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1363 # define yystpcpy stpcpy
1365 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1367 #if (defined __STDC__ || defined __C99__FUNC__ \
1368 || defined __cplusplus || defined _MSC_VER)
1370 yystpcpy (char *yydest
, const char *yysrc
)
1373 yystpcpy (yydest
, yysrc
)
1379 const char *yys
= yysrc
;
1381 while ((*yyd
++ = *yys
++) != '\0')
1390 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1391 quotes and backslashes, so that it's suitable for yyerror. The
1392 heuristic is that double-quoting is unnecessary unless the string
1393 contains an apostrophe, a comma, or backslash (other than
1394 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1395 null, do not copy; instead, return the length of what the result
1398 yytnamerr (char *yyres
, const char *yystr
)
1403 char const *yyp
= yystr
;
1410 goto do_not_strip_quotes
;
1414 goto do_not_strip_quotes
;
1427 do_not_strip_quotes
: ;
1431 return yystrlen (yystr
);
1433 return yystpcpy (yyres
, yystr
) - yyres
;
1437 /* Copy into YYRESULT an error message about the unexpected token
1438 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1439 including the terminating null byte. If YYRESULT is null, do not
1440 copy anything; just return the number of bytes that would be
1441 copied. As a special case, return 0 if an ordinary "syntax error"
1442 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1443 size calculation. */
1445 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1447 int yyn
= yypact
[yystate
];
1449 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1453 int yytype
= YYTRANSLATE (yychar
);
1454 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1455 YYSIZE_T yysize
= yysize0
;
1457 int yysize_overflow
= 0;
1458 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1459 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1463 /* This is so xgettext sees the translatable formats that are
1464 constructed on the fly. */
1465 YY_("syntax error, unexpected %s");
1466 YY_("syntax error, unexpected %s, expecting %s");
1467 YY_("syntax error, unexpected %s, expecting %s or %s");
1468 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1469 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1473 static char const yyunexpected
[] = "syntax error, unexpected %s";
1474 static char const yyexpecting
[] = ", expecting %s";
1475 static char const yyor
[] = " or %s";
1476 char yyformat
[sizeof yyunexpected
1477 + sizeof yyexpecting
- 1
1478 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1479 * (sizeof yyor
- 1))];
1480 char const *yyprefix
= yyexpecting
;
1482 /* Start YYX at -YYN if negative to avoid negative indexes in
1484 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1486 /* Stay within bounds of both yycheck and yytname. */
1487 int yychecklim
= YYLAST
- yyn
+ 1;
1488 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1491 yyarg
[0] = yytname
[yytype
];
1492 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1494 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1495 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1497 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1501 yyformat
[sizeof yyunexpected
- 1] = '\0';
1504 yyarg
[yycount
++] = yytname
[yyx
];
1505 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1506 yysize_overflow
|= (yysize1
< yysize
);
1508 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1512 yyf
= YY_(yyformat
);
1513 yysize1
= yysize
+ yystrlen (yyf
);
1514 yysize_overflow
|= (yysize1
< yysize
);
1517 if (yysize_overflow
)
1518 return YYSIZE_MAXIMUM
;
1522 /* Avoid sprintf, as that infringes on the user's name space.
1523 Don't have undefined behavior even if the translation
1524 produced a string with the wrong number of "%s"s. */
1525 char *yyp
= yyresult
;
1527 while ((*yyp
= *yyf
) != '\0')
1529 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1531 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1544 #endif /* YYERROR_VERBOSE */
1547 /*-----------------------------------------------.
1548 | Release the memory associated to this symbol. |
1549 `-----------------------------------------------*/
1552 #if (defined __STDC__ || defined __C99__FUNC__ \
1553 || defined __cplusplus || defined _MSC_VER)
1555 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1558 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1562 YYLTYPE
*yylocationp
;
1566 YYUSE (yylocationp
);
1570 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1581 /* Prevent warnings from -Wmissing-prototypes. */
1583 #ifdef YYPARSE_PARAM
1584 #if defined __STDC__ || defined __cplusplus
1585 int yyparse (void *YYPARSE_PARAM
);
1589 #else /* ! YYPARSE_PARAM */
1590 #if defined __STDC__ || defined __cplusplus
1595 #endif /* ! YYPARSE_PARAM */
1606 #ifdef YYPARSE_PARAM
1607 #if (defined __STDC__ || defined __C99__FUNC__ \
1608 || defined __cplusplus || defined _MSC_VER)
1610 yyparse (void *YYPARSE_PARAM
)
1613 yyparse (YYPARSE_PARAM
)
1614 void *YYPARSE_PARAM
;
1616 #else /* ! YYPARSE_PARAM */
1617 #if (defined __STDC__ || defined __C99__FUNC__ \
1618 || defined __cplusplus || defined _MSC_VER)
1628 /* The lookahead symbol. */
1631 /* The semantic value of the lookahead symbol. */
1634 /* Number of syntax errors so far. */
1636 /* Location data for the lookahead symbol. */
1642 /* Number of tokens to shift before error messages enabled. */
1644 /* Lookahead token as an internal (translated) token number. */
1647 /* Buffer for error messages, and its allocated size. */
1649 char *yymsg
= yymsgbuf
;
1650 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1653 /* Three stacks and their tools:
1654 `yyss': related to states,
1655 `yyvs': related to semantic values,
1656 `yyls': related to locations.
1658 Refer to the stacks thru separate pointers, to allow yyoverflow
1659 to reallocate them elsewhere. */
1661 /* The state stack. */
1662 yytype_int16 yyssa
[YYINITDEPTH
];
1663 yytype_int16
*yyss
= yyssa
;
1664 yytype_int16
*yyssp
;
1666 /* The semantic value stack. */
1667 YYSTYPE yyvsa
[YYINITDEPTH
];
1668 YYSTYPE
*yyvs
= yyvsa
;
1671 /* The location stack. */
1672 YYLTYPE yylsa
[YYINITDEPTH
];
1673 YYLTYPE
*yyls
= yylsa
;
1675 /* The locations where the error started and ended. */
1676 YYLTYPE yyerror_range
[2];
1678 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1680 YYSIZE_T yystacksize
= YYINITDEPTH
;
1682 /* The variables used to return semantic value and location from the
1687 /* The number of symbols on the RHS of the reduced rule.
1688 Keep to zero when no symbol should be popped. */
1691 YYDPRINTF ((stderr
, "Starting parse\n"));
1696 yychar
= YYEMPTY
; /* Cause a token to be read. */
1698 /* Initialize stack pointers.
1699 Waste one element of value and location stack
1700 so that they stay on the same level as the state stack.
1701 The wasted elements are never initialized. */
1706 #if YYLTYPE_IS_TRIVIAL
1707 /* Initialize the default location before parsing starts. */
1708 yylloc
.first_line
= yylloc
.last_line
= 1;
1709 yylloc
.first_column
= yylloc
.last_column
= 1;
1713 /* User initialization code. */
1715 /* Line 1085 of yacc.c */
1716 #line 90 "parse-gram.y"
1718 /* Bison's grammar can initial empty locations, hence a default
1719 location is needed. */
1720 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1721 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1724 /* Line 1085 of yacc.c */
1725 #line 1726 "parse-gram.c"
1729 /*------------------------------------------------------------.
1730 | yynewstate -- Push a new state, which is found in yystate. |
1731 `------------------------------------------------------------*/
1733 /* In all cases, when you get here, the value and location stacks
1734 have just been pushed. So pushing a state here evens the stacks. */
1740 if (yyss
+ yystacksize
- 1 <= yyssp
)
1742 /* Get the current used size of the three stacks, in elements. */
1743 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1747 /* Give user a chance to reallocate the stack. Use copies of
1748 these so that the &'s don't force the real ones into
1750 YYSTYPE
*yyvs1
= yyvs
;
1751 yytype_int16
*yyss1
= yyss
;
1752 YYLTYPE
*yyls1
= yyls
;
1754 /* Each stack pointer address is followed by the size of the
1755 data in use in that stack, in bytes. This used to be a
1756 conditional around just the two extra args, but that might
1757 be undefined if yyoverflow is a macro. */
1758 yyoverflow (YY_("memory exhausted"),
1759 &yyss1
, yysize
* sizeof (*yyssp
),
1760 &yyvs1
, yysize
* sizeof (*yyvsp
),
1761 &yyls1
, yysize
* sizeof (*yylsp
),
1767 #else /* no yyoverflow */
1768 # ifndef YYSTACK_RELOCATE
1769 goto yyexhaustedlab
;
1771 /* Extend the stack our own way. */
1772 if (YYMAXDEPTH
<= yystacksize
)
1773 goto yyexhaustedlab
;
1775 if (YYMAXDEPTH
< yystacksize
)
1776 yystacksize
= YYMAXDEPTH
;
1779 yytype_int16
*yyss1
= yyss
;
1780 union yyalloc
*yyptr
=
1781 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1783 goto yyexhaustedlab
;
1784 YYSTACK_RELOCATE (yyss
);
1785 YYSTACK_RELOCATE (yyvs
);
1786 YYSTACK_RELOCATE (yyls
);
1787 # undef YYSTACK_RELOCATE
1789 YYSTACK_FREE (yyss1
);
1792 #endif /* no yyoverflow */
1794 yyssp
= yyss
+ yysize
- 1;
1795 yyvsp
= yyvs
+ yysize
- 1;
1796 yylsp
= yyls
+ yysize
- 1;
1798 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1799 (unsigned long int) yystacksize
));
1801 if (yyss
+ yystacksize
- 1 <= yyssp
)
1805 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1807 if (yystate
== YYFINAL
)
1817 /* Do appropriate processing given the current state. Read a
1818 lookahead token if we need one and don't already have one. */
1820 /* First try to decide what to do without reference to lookahead token. */
1821 yyn
= yypact
[yystate
];
1822 if (yyn
== YYPACT_NINF
)
1825 /* Not known => get a lookahead token if don't already have one. */
1827 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1828 if (yychar
== YYEMPTY
)
1830 YYDPRINTF ((stderr
, "Reading a token: "));
1834 if (yychar
<= YYEOF
)
1836 yychar
= yytoken
= YYEOF
;
1837 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1841 yytoken
= YYTRANSLATE (yychar
);
1842 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1845 /* If the proper action on seeing token YYTOKEN is to reduce or to
1846 detect an error, take that action. */
1848 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1853 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1859 /* Count tokens shifted since error; after three, turn off error
1864 /* Shift the lookahead token. */
1865 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1867 /* Discard the shifted token. */
1876 /*-----------------------------------------------------------.
1877 | yydefault -- do the default action for the current state. |
1878 `-----------------------------------------------------------*/
1880 yyn
= yydefact
[yystate
];
1886 /*-----------------------------.
1887 | yyreduce -- Do a reduction. |
1888 `-----------------------------*/
1890 /* yyn is the number of a rule to reduce with. */
1893 /* If YYLEN is nonzero, implement the default value of the action:
1896 Otherwise, the following line sets YYVAL to garbage.
1897 This behavior is undocumented and Bison
1898 users should not rely upon it. Assigning to YYVAL
1899 unconditionally makes the parser a bit smaller, and it avoids a
1900 GCC warning that YYVAL may be used uninitialized. */
1901 yyval
= yyvsp
[1-yylen
];
1903 /* Default location. */
1904 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1905 YY_REDUCE_PRINT (yyn
);
1910 /* Line 1272 of yacc.c */
1911 #line 230 "parse-gram.y"
1913 code_props plain_code
;
1914 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1915 code_props_translate_code (&plain_code
);
1916 gram_scanner_last_string_free ();
1917 prologue_augment (plain_code
.code
, (yylsp
[(1) - (1)]), union_seen
);
1918 code_scanner_last_string_free ();
1924 /* Line 1272 of yacc.c */
1925 #line 238 "parse-gram.y"
1926 { debug_flag
= true; }
1931 /* Line 1272 of yacc.c */
1932 #line 239 "parse-gram.y"
1933 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1938 /* Line 1272 of yacc.c */
1939 #line 240 "parse-gram.y"
1940 { defines_flag
= true; }
1945 /* Line 1272 of yacc.c */
1946 #line 242 "parse-gram.y"
1948 defines_flag
= true;
1949 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1955 /* Line 1272 of yacc.c */
1956 #line 246 "parse-gram.y"
1957 { error_verbose
= true; }
1962 /* Line 1272 of yacc.c */
1963 #line 247 "parse-gram.y"
1964 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1969 /* Line 1272 of yacc.c */
1970 #line 248 "parse-gram.y"
1971 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1976 /* Line 1272 of yacc.c */
1977 #line 249 "parse-gram.y"
1978 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1983 /* Line 1272 of yacc.c */
1984 #line 250 "parse-gram.y"
1985 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1990 /* Line 1272 of yacc.c */
1991 #line 252 "parse-gram.y"
1993 nondeterministic_parser
= true;
2000 /* Line 1272 of yacc.c */
2001 #line 257 "parse-gram.y"
2004 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
2005 code_props_translate_code (&action
);
2006 gram_scanner_last_string_free ();
2007 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2008 code_scanner_last_string_free ();
2014 /* Line 1272 of yacc.c */
2015 #line 265 "parse-gram.y"
2016 { language_argmatch ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2021 /* Line 1272 of yacc.c */
2022 #line 266 "parse-gram.y"
2023 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2028 /* Line 1272 of yacc.c */
2029 #line 267 "parse-gram.y"
2030 { locations_flag
= true; }
2035 /* Line 1272 of yacc.c */
2036 #line 268 "parse-gram.y"
2037 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2042 /* Line 1272 of yacc.c */
2043 #line 269 "parse-gram.y"
2044 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2049 /* Line 1272 of yacc.c */
2050 #line 270 "parse-gram.y"
2051 { no_lines_flag
= true; }
2056 /* Line 1272 of yacc.c */
2057 #line 271 "parse-gram.y"
2058 { nondeterministic_parser
= true; }
2063 /* Line 1272 of yacc.c */
2064 #line 272 "parse-gram.y"
2065 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2070 /* Line 1272 of yacc.c */
2071 #line 273 "parse-gram.y"
2072 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2077 /* Line 1272 of yacc.c */
2078 #line 274 "parse-gram.y"
2079 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2084 /* Line 1272 of yacc.c */
2085 #line 275 "parse-gram.y"
2086 { pure_parser
= true; }
2091 /* Line 1272 of yacc.c */
2092 #line 276 "parse-gram.y"
2093 { push_parser
= true; pull_parser
= false; }
2098 /* Line 1272 of yacc.c */
2099 #line 277 "parse-gram.y"
2100 { push_parser
= true; pull_parser
= true; }
2105 /* Line 1272 of yacc.c */
2106 #line 278 "parse-gram.y"
2107 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2112 /* Line 1272 of yacc.c */
2113 #line 279 "parse-gram.y"
2114 { skeleton_arg ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2119 /* Line 1272 of yacc.c */
2120 #line 280 "parse-gram.y"
2121 { token_table_flag
= true; }
2126 /* Line 1272 of yacc.c */
2127 #line 281 "parse-gram.y"
2128 { report_flag
= report_states
; }
2133 /* Line 1272 of yacc.c */
2134 #line 282 "parse-gram.y"
2135 { yacc_flag
= true; }
2140 /* Line 1272 of yacc.c */
2141 #line 290 "parse-gram.y"
2143 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2149 /* Line 1272 of yacc.c */
2150 #line 294 "parse-gram.y"
2153 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2154 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2155 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2161 /* Line 1272 of yacc.c */
2162 #line 301 "parse-gram.y"
2165 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2166 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2167 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2173 /* Line 1272 of yacc.c */
2174 #line 308 "parse-gram.y"
2176 default_prec
= true;
2182 /* Line 1272 of yacc.c */
2183 #line 312 "parse-gram.y"
2185 default_prec
= false;
2191 /* Line 1272 of yacc.c */
2192 #line 315 "parse-gram.y"
2193 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), true); }
2198 /* Line 1272 of yacc.c */
2199 #line 316 "parse-gram.y"
2200 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), false); }
2205 /* Line 1272 of yacc.c */
2206 #line 317 "parse-gram.y"
2207 { muscle_code_grow ("provides", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2212 /* Line 1272 of yacc.c */
2213 #line 318 "parse-gram.y"
2214 { muscle_code_grow ("requires", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2219 /* Line 1272 of yacc.c */
2220 #line 329 "parse-gram.y"
2226 /* Line 1272 of yacc.c */
2227 #line 330 "parse-gram.y"
2228 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2233 /* Line 1272 of yacc.c */
2234 #line 335 "parse-gram.y"
2236 char const *body
= (yyvsp
[(3) - (3)].code
);
2238 /* Concatenate the %union bodies. If this is the first %union, make sure
2239 the synchronization line appears after the opening '{' so as not to
2240 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2241 into '\n', and omit the new %union's leading '{'. */
2244 muscle_grow ("stype", "{", "");
2248 char *code
= muscle_find ("stype");
2249 code
[strlen (code
) - 1] = '\n';
2254 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2255 gram_scanner_last_string_free ();
2261 /* Line 1272 of yacc.c */
2262 #line 363 "parse-gram.y"
2263 { current_class
= nterm_sym
; }
2268 /* Line 1272 of yacc.c */
2269 #line 364 "parse-gram.y"
2271 current_class
= unknown_sym
;
2272 current_type
= NULL
;
2278 /* Line 1272 of yacc.c */
2279 #line 368 "parse-gram.y"
2280 { current_class
= token_sym
; }
2285 /* Line 1272 of yacc.c */
2286 #line 369 "parse-gram.y"
2288 current_class
= unknown_sym
;
2289 current_type
= NULL
;
2295 /* Line 1272 of yacc.c */
2296 #line 374 "parse-gram.y"
2300 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2301 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2302 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2308 /* Line 1272 of yacc.c */
2309 #line 385 "parse-gram.y"
2313 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2315 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2316 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2318 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2319 current_type
= NULL
;
2325 /* Line 1272 of yacc.c */
2326 #line 399 "parse-gram.y"
2327 { (yyval
.assoc
) = left_assoc
; }
2332 /* Line 1272 of yacc.c */
2333 #line 400 "parse-gram.y"
2334 { (yyval
.assoc
) = right_assoc
; }
2339 /* Line 1272 of yacc.c */
2340 #line 401 "parse-gram.y"
2341 { (yyval
.assoc
) = non_assoc
; }
2346 /* Line 1272 of yacc.c */
2347 #line 405 "parse-gram.y"
2348 { current_type
= NULL
; }
2353 /* Line 1272 of yacc.c */
2354 #line 406 "parse-gram.y"
2355 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2360 /* Line 1272 of yacc.c */
2361 #line 412 "parse-gram.y"
2362 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2367 /* Line 1272 of yacc.c */
2368 #line 414 "parse-gram.y"
2369 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2374 /* Line 1272 of yacc.c */
2375 #line 418 "parse-gram.y"
2376 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2381 /* Line 1272 of yacc.c */
2382 #line 419 "parse-gram.y"
2383 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2388 /* Line 1272 of yacc.c */
2389 #line 423 "parse-gram.y"
2390 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2395 /* Line 1272 of yacc.c */
2396 #line 424 "parse-gram.y"
2397 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2402 /* Line 1272 of yacc.c */
2403 #line 425 "parse-gram.y"
2404 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2409 /* Line 1272 of yacc.c */
2410 #line 426 "parse-gram.y"
2411 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2416 /* Line 1272 of yacc.c */
2417 #line 432 "parse-gram.y"
2419 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2426 /* Line 1272 of yacc.c */
2427 #line 437 "parse-gram.y"
2429 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2430 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2436 /* Line 1272 of yacc.c */
2437 #line 442 "parse-gram.y"
2439 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2440 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2441 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2447 /* Line 1272 of yacc.c */
2448 #line 448 "parse-gram.y"
2450 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2451 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2452 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2458 /* Line 1272 of yacc.c */
2459 #line 454 "parse-gram.y"
2461 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2462 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2463 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2464 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2470 /* Line 1272 of yacc.c */
2471 #line 484 "parse-gram.y"
2479 /* Line 1272 of yacc.c */
2480 #line 490 "parse-gram.y"
2481 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2486 /* Line 1272 of yacc.c */
2487 #line 494 "parse-gram.y"
2488 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2493 /* Line 1272 of yacc.c */
2494 #line 495 "parse-gram.y"
2495 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2500 /* Line 1272 of yacc.c */
2501 #line 501 "parse-gram.y"
2502 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2507 /* Line 1272 of yacc.c */
2508 #line 503 "parse-gram.y"
2509 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2514 /* Line 1272 of yacc.c */
2515 #line 505 "parse-gram.y"
2516 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2521 /* Line 1272 of yacc.c */
2522 #line 507 "parse-gram.y"
2523 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2528 /* Line 1272 of yacc.c */
2529 #line 509 "parse-gram.y"
2530 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2535 /* Line 1272 of yacc.c */
2536 #line 511 "parse-gram.y"
2537 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2542 /* Line 1272 of yacc.c */
2543 #line 527 "parse-gram.y"
2545 static char one
[] = "1";
2546 (yyval
.chars
) = one
;
2552 /* Line 1272 of yacc.c */
2553 #line 537 "parse-gram.y"
2555 code_props plain_code
;
2556 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2557 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2558 code_props_translate_code (&plain_code
);
2559 gram_scanner_last_string_free ();
2560 (yyval
.chars
) = plain_code
.code
;
2566 /* Line 1272 of yacc.c */
2567 #line 557 "parse-gram.y"
2568 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2573 /* Line 1272 of yacc.c */
2574 #line 559 "parse-gram.y"
2576 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2577 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2578 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2584 /* Line 1272 of yacc.c */
2585 #line 567 "parse-gram.y"
2586 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2591 /* Line 1272 of yacc.c */
2592 #line 579 "parse-gram.y"
2594 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2595 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2601 /* Line 1272 of yacc.c */
2602 #line 588 "parse-gram.y"
2604 code_props plain_code
;
2605 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2606 code_props_translate_code (&plain_code
);
2607 gram_scanner_last_string_free ();
2608 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2609 code_scanner_last_string_free ();
2615 /* Line 1272 of yacc.c */
2616 #line 2617 "parse-gram.c"
2619 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2623 YY_STACK_PRINT (yyss
, yyssp
);
2628 /* Now `shift' the result of the reduction. Determine what state
2629 that goes to, based on the state we popped back to and the rule
2630 number reduced by. */
2634 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2635 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2636 yystate
= yytable
[yystate
];
2638 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2643 /*------------------------------------.
2644 | yyerrlab -- here on detecting error |
2645 `------------------------------------*/
2647 /* If not already recovering from an error, report this error. */
2651 #if ! YYERROR_VERBOSE
2652 yyerror (YY_("syntax error"));
2655 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2656 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2658 YYSIZE_T yyalloc
= 2 * yysize
;
2659 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2660 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2661 if (yymsg
!= yymsgbuf
)
2662 YYSTACK_FREE (yymsg
);
2663 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2665 yymsg_alloc
= yyalloc
;
2669 yymsg_alloc
= sizeof yymsgbuf
;
2673 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2675 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2680 yyerror (YY_("syntax error"));
2682 goto yyexhaustedlab
;
2688 yyerror_range
[0] = yylloc
;
2690 if (yyerrstatus
== 3)
2692 /* If just tried and failed to reuse lookahead token after an
2693 error, discard it. */
2695 if (yychar
<= YYEOF
)
2697 /* Return failure if at end of input. */
2698 if (yychar
== YYEOF
)
2703 yydestruct ("Error: discarding",
2704 yytoken
, &yylval
, &yylloc
);
2709 /* Else will try to reuse lookahead token after shifting the error
2714 /*---------------------------------------------------.
2715 | yyerrorlab -- error raised explicitly by YYERROR. |
2716 `---------------------------------------------------*/
2719 /* Pacify compilers like GCC when the user code never invokes
2720 YYERROR and the label yyerrorlab therefore never appears in user
2722 if (/*CONSTCOND*/ 0)
2725 yyerror_range
[0] = yylsp
[1-yylen
];
2726 /* Do not reclaim the symbols of the rule which action triggered
2730 YY_STACK_PRINT (yyss
, yyssp
);
2735 /*-------------------------------------------------------------.
2736 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2737 `-------------------------------------------------------------*/
2739 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2743 yyn
= yypact
[yystate
];
2744 if (yyn
!= YYPACT_NINF
)
2747 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2755 /* Pop the current state because it cannot handle the error token. */
2759 yyerror_range
[0] = *yylsp
;
2760 yydestruct ("Error: popping",
2761 yystos
[yystate
], yyvsp
, yylsp
);
2764 YY_STACK_PRINT (yyss
, yyssp
);
2769 yyerror_range
[1] = yylloc
;
2770 /* Using YYLLOC is tempting, but would change the location of
2771 the lookahead. YYLOC is available though. */
2772 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2775 /* Shift the error token. */
2776 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2782 /*-------------------------------------.
2783 | yyacceptlab -- YYACCEPT comes here. |
2784 `-------------------------------------*/
2789 /*-----------------------------------.
2790 | yyabortlab -- YYABORT comes here. |
2791 `-----------------------------------*/
2797 /*-------------------------------------------------.
2798 | yyexhaustedlab -- memory exhaustion comes here. |
2799 `-------------------------------------------------*/
2801 yyerror (YY_("memory exhausted"));
2807 if (yychar
!= YYEMPTY
)
2808 yydestruct ("Cleanup: discarding lookahead",
2809 yytoken
, &yylval
, &yylloc
);
2810 /* Do not reclaim the symbols of the rule which action triggered
2811 this YYABORT or YYACCEPT. */
2813 YY_STACK_PRINT (yyss
, yyssp
);
2814 while (yyssp
!= yyss
)
2816 yydestruct ("Cleanup: popping",
2817 yystos
[*yyssp
], yyvsp
, yylsp
);
2822 YYSTACK_FREE (yyss
);
2825 if (yymsg
!= yymsgbuf
)
2826 YYSTACK_FREE (yymsg
);
2828 /* Make sure YYID is used. */
2829 return YYID (yyresult
);
2834 /* Line 1489 of yacc.c */
2835 #line 598 "parse-gram.y"
2839 /* Return the location of the left-hand side of a rule whose
2840 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2841 the right-hand side, and return an empty location equal to the end
2842 boundary of RHS[0] if the right-hand side is empty. */
2845 lloc_default (YYLTYPE
const *rhs
, int n
)
2850 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2851 The bug is fixed in 7.4.2m, but play it safe for now. */
2852 loc
.start
= rhs
[n
].end
;
2853 loc
.end
= rhs
[n
].end
;
2855 /* Ignore empty nonterminals the start of the the right-hand side.
2856 Do not bother to ignore them at the end of the right-hand side,
2857 since empty nonterminals have the same end as their predecessors. */
2858 for (i
= 1; i
<= n
; i
++)
2859 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2861 loc
.start
= rhs
[i
].start
;
2869 /* Add a lex-param or a parse-param (depending on TYPE) with
2870 declaration DECL and location LOC. */
2873 add_param (char const *type
, char *decl
, location loc
)
2875 static char const alphanum
[26 + 26 + 1 + 10] =
2876 "abcdefghijklmnopqrstuvwxyz"
2877 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2880 char const *name_start
= NULL
;
2883 /* Stop on last actual character. */
2884 for (p
= decl
; p
[1]; p
++)
2886 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2887 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2890 /* Strip the surrounding '{' and '}', and any blanks just inside
2892 while (*--p
== ' ' || *p
== '\t')
2895 while (*++decl
== ' ' || *decl
== '\t')
2899 complain_at (loc
, _("missing identifier in parameter declaration"));
2906 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2910 name
= xmalloc (name_len
+ 1);
2911 memcpy (name
, name_start
, name_len
);
2912 name
[name_len
] = '\0';
2913 muscle_pair_list_grow (type
, decl
, name
);
2917 gram_scanner_last_string_free ();
2922 version_check (location
const *loc
, char const *version
)
2924 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2926 complain_at (*loc
, "require bison %s, but have %s",
2927 version
, PACKAGE_VERSION
);
2933 gram_error (location
const *loc
, char const *msg
)
2935 complain_at (*loc
, "%s", msg
);
2939 token_name (int type
)
2941 return yytname
[YYTRANSLATE (type
)];
2952 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2953 return quotearg_style (escape_quoting_style
, buf
);