1 /* A Bison parser, made by GNU Bison 2.3a+. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3a+"
53 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 1
64 /* Substitute the variable and function names. */
65 #define yyparse gram_parse
66 #define yylex gram_lex
67 #define yyerror gram_error
68 #define yylval gram_lval
69 #define yychar gram_char
70 #define yydebug gram_debug
71 #define yynerrs gram_nerrs
72 #define yylloc gram_lloc
74 /* Copy the first part of user declarations. */
76 /* Line 164 of yacc.c */
77 #line 1 "parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
80 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
82 This file is part of Bison, the GNU Compiler Compiler.
84 This program is free software; you can redistribute it and/or modify
85 it under the terms of the GNU General Public License as published by
86 the Free Software Foundation; either version 2 of the License, or
87 (at your option) any later version.
89 This program is distributed in the hope that it will be useful,
90 but WITHOUT ANY WARRANTY; without even the implied warranty of
91 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92 GNU General Public License for more details.
94 You should have received a copy of the GNU General Public License
95 along with this program; if not, write to the Free Software
96 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
103 #include <strverscmp.h>
105 #include "complain.h"
106 #include "conflicts.h"
110 #include "muscle_tab.h"
111 #include "quotearg.h"
114 #include "scan-gram.h"
115 #include "scan-code.h"
117 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
118 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
120 #define YY_LOCATION_PRINT(File, Loc) \
121 location_print (File, Loc)
123 static void version_check (location
const *loc
, char const *version
);
125 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
126 FIXME: depends on the undocumented availability of YYLLOC. */
128 #define yyerror(Msg) \
129 gram_error (&yylloc, Msg)
130 static void gram_error (location
const *, char const *);
132 static char const *char_name (char);
134 /** Add a lex-param or a parse-param.
136 * \param type \a lex_param or \a parse_param
137 * \param decl the formal argument
138 * \param loc the location in the source.
140 static void add_param (char const *type
, char *decl
, location loc
);
143 static symbol_class current_class
= unknown_sym
;
144 static uniqstr current_type
= NULL
;
145 static symbol
*current_lhs
;
146 static location current_lhs_location
;
147 static int current_prec
= 0;
149 #define YYTYPE_INT16 int_fast16_t
150 #define YYTYPE_INT8 int_fast8_t
151 #define YYTYPE_UINT16 uint_fast16_t
152 #define YYTYPE_UINT8 uint_fast8_t
155 /* Line 164 of yacc.c */
156 #line 157 "parse-gram.c"
158 /* Enabling traces. */
163 /* Enabling verbose error messages. */
164 #ifdef YYERROR_VERBOSE
165 # undef YYERROR_VERBOSE
166 # define YYERROR_VERBOSE 1
168 # define YYERROR_VERBOSE 1
171 /* Enabling the token table. */
172 #ifndef YYTOKEN_TABLE
173 # define YYTOKEN_TABLE 0
180 /* Put the tokens into the symbol table, so that GDB and other debuggers
189 PERCENT_DESTRUCTOR
= 263,
190 PERCENT_PRINTER
= 264,
193 PERCENT_NONASSOC
= 267,
198 PERCENT_CODE_TOP
= 272,
200 PERCENT_DEFAULT_PREC
= 274,
201 PERCENT_DEFINE
= 275,
202 PERCENT_DEFINES
= 276,
203 PERCENT_ERROR_VERBOSE
= 277,
204 PERCENT_EXPECT
= 278,
205 PERCENT_EXPECT_RR
= 279,
206 PERCENT_FILE_PREFIX
= 280,
207 PERCENT_GLR_PARSER
= 281,
208 PERCENT_INITIAL_ACTION
= 282,
209 PERCENT_LANGUAGE
= 283,
210 PERCENT_LEX_PARAM
= 284,
211 PERCENT_LOCATIONS
= 285,
212 PERCENT_NAME_PREFIX
= 286,
213 PERCENT_NO_DEFAULT_PREC
= 287,
214 PERCENT_NO_LINES
= 288,
215 PERCENT_NONDETERMINISTIC_PARSER
= 289,
216 PERCENT_OUTPUT
= 290,
217 PERCENT_PARSE_PARAM
= 291,
218 PERCENT_PROVIDES
= 292,
219 PERCENT_PURE_PARSER
= 293,
220 PERCENT_PUSH_PARSER
= 294,
221 PERCENT_PUSH_PULL_PARSER
= 295,
222 PERCENT_REQUIRE
= 296,
223 PERCENT_REQUIRES
= 297,
224 PERCENT_SKELETON
= 298,
226 PERCENT_TOKEN_TABLE
= 300,
227 PERCENT_VERBOSE
= 301,
235 PERCENT_PERCENT
= 309,
249 #define PERCENT_TOKEN 260
250 #define PERCENT_NTERM 261
251 #define PERCENT_TYPE 262
252 #define PERCENT_DESTRUCTOR 263
253 #define PERCENT_PRINTER 264
254 #define PERCENT_LEFT 265
255 #define PERCENT_RIGHT 266
256 #define PERCENT_NONASSOC 267
257 #define PERCENT_PREC 268
258 #define PERCENT_DPREC 269
259 #define PERCENT_MERGE 270
260 #define PERCENT_CODE 271
261 #define PERCENT_CODE_TOP 272
262 #define PERCENT_DEBUG 273
263 #define PERCENT_DEFAULT_PREC 274
264 #define PERCENT_DEFINE 275
265 #define PERCENT_DEFINES 276
266 #define PERCENT_ERROR_VERBOSE 277
267 #define PERCENT_EXPECT 278
268 #define PERCENT_EXPECT_RR 279
269 #define PERCENT_FILE_PREFIX 280
270 #define PERCENT_GLR_PARSER 281
271 #define PERCENT_INITIAL_ACTION 282
272 #define PERCENT_LANGUAGE 283
273 #define PERCENT_LEX_PARAM 284
274 #define PERCENT_LOCATIONS 285
275 #define PERCENT_NAME_PREFIX 286
276 #define PERCENT_NO_DEFAULT_PREC 287
277 #define PERCENT_NO_LINES 288
278 #define PERCENT_NONDETERMINISTIC_PARSER 289
279 #define PERCENT_OUTPUT 290
280 #define PERCENT_PARSE_PARAM 291
281 #define PERCENT_PROVIDES 292
282 #define PERCENT_PURE_PARSER 293
283 #define PERCENT_PUSH_PARSER 294
284 #define PERCENT_PUSH_PULL_PARSER 295
285 #define PERCENT_REQUIRE 296
286 #define PERCENT_REQUIRES 297
287 #define PERCENT_SKELETON 298
288 #define PERCENT_START 299
289 #define PERCENT_TOKEN_TABLE 300
290 #define PERCENT_VERBOSE 301
291 #define PERCENT_YACC 302
292 #define BRACED_CODE 303
298 #define PERCENT_PERCENT 309
301 #define SEMICOLON 312
303 #define TYPE_TAG_ANY 314
304 #define TYPE_TAG_NONE 315
305 #define PERCENT_UNION 316
310 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
311 typedef union YYSTYPE
313 /* Line 198 of yacc.c */
314 #line 97 "parse-gram.y"
323 unsigned char character
;
326 /* Line 198 of yacc.c */
327 #line 328 "parse-gram.c"
329 # define YYSTYPE_IS_TRIVIAL 1
330 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
331 # define YYSTYPE_IS_DECLARED 1
334 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
335 typedef struct YYLTYPE
342 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
343 # define YYLTYPE_IS_DECLARED 1
344 # define YYLTYPE_IS_TRIVIAL 1
348 /* Copy the second part of user declarations. */
351 /* Line 221 of yacc.c */
352 #line 353 "parse-gram.c"
359 typedef YYTYPE_UINT8 yytype_uint8
;
361 typedef unsigned char yytype_uint8
;
365 typedef YYTYPE_INT8 yytype_int8
;
366 #elif (defined __STDC__ || defined __C99__FUNC__ \
367 || defined __cplusplus || defined _MSC_VER)
368 typedef signed char yytype_int8
;
370 typedef short int yytype_int8
;
374 typedef YYTYPE_UINT16 yytype_uint16
;
376 typedef unsigned short int yytype_uint16
;
380 typedef YYTYPE_INT16 yytype_int16
;
382 typedef short int yytype_int16
;
386 # ifdef __SIZE_TYPE__
387 # define YYSIZE_T __SIZE_TYPE__
388 # elif defined size_t
389 # define YYSIZE_T size_t
390 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
391 || defined __cplusplus || defined _MSC_VER)
392 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
393 # define YYSIZE_T size_t
395 # define YYSIZE_T unsigned int
399 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
404 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
405 # define YY_(msgid) dgettext ("bison-runtime", msgid)
409 # define YY_(msgid) msgid
413 /* Suppress unused-variable warnings by "using" E. */
414 #if ! defined lint || defined __GNUC__
415 # define YYUSE(e) ((void) (e))
417 # define YYUSE(e) /* empty */
420 /* Identity function, used to suppress warnings about constant conditions. */
424 #if (defined __STDC__ || defined __C99__FUNC__ \
425 || defined __cplusplus || defined _MSC_VER)
438 #if ! defined yyoverflow || YYERROR_VERBOSE
440 /* The parser invokes alloca or malloc; define the necessary symbols. */
442 # ifdef YYSTACK_USE_ALLOCA
443 # if YYSTACK_USE_ALLOCA
445 # define YYSTACK_ALLOC __builtin_alloca
446 # elif defined __BUILTIN_VA_ARG_INCR
447 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
449 # define YYSTACK_ALLOC __alloca
450 # elif defined _MSC_VER
451 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
452 # define alloca _alloca
454 # define YYSTACK_ALLOC alloca
455 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
456 || defined __cplusplus || defined _MSC_VER)
457 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
466 # ifdef YYSTACK_ALLOC
467 /* Pacify GCC's `empty if-body' warning. */
468 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
469 # ifndef YYSTACK_ALLOC_MAXIMUM
470 /* The OS might guarantee only one guard page at the bottom of the stack,
471 and a page size can be as small as 4096 bytes. So we cannot safely
472 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
473 to allow for a few compiler-allocated temporary stack slots. */
474 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
477 # define YYSTACK_ALLOC YYMALLOC
478 # define YYSTACK_FREE YYFREE
479 # ifndef YYSTACK_ALLOC_MAXIMUM
480 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
482 # if (defined __cplusplus && ! defined _STDLIB_H \
483 && ! ((defined YYMALLOC || defined malloc) \
484 && (defined YYFREE || defined free)))
485 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
491 # define YYMALLOC malloc
492 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
493 || defined __cplusplus || defined _MSC_VER)
494 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
499 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
500 || defined __cplusplus || defined _MSC_VER)
501 void free (void *); /* INFRINGES ON USER NAME SPACE */
505 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
508 #if (! defined yyoverflow \
509 && (! defined __cplusplus \
510 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
511 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
513 /* A type that is properly aligned for any stack member. */
521 /* The size of the maximum gap between one aligned stack and the next. */
522 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
524 /* The size of an array large to enough to hold all stacks, each with
526 # define YYSTACK_BYTES(N) \
527 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
528 + 2 * YYSTACK_GAP_MAXIMUM)
530 /* Copy COUNT objects from FROM to TO. The source and destination do
533 # if defined __GNUC__ && 1 < __GNUC__
534 # define YYCOPY(To, From, Count) \
535 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
537 # define YYCOPY(To, From, Count) \
541 for (yyi = 0; yyi < (Count); yyi++) \
542 (To)[yyi] = (From)[yyi]; \
548 /* Relocate STACK from its old location to the new one. The
549 local variables YYSIZE and YYSTACKSIZE give the old and new number of
550 elements in the stack, and YYPTR gives the new location of the
551 stack. Advance YYPTR to a properly aligned location for the next
553 # define YYSTACK_RELOCATE(Stack) \
556 YYSIZE_T yynewbytes; \
557 YYCOPY (&yyptr->Stack, Stack, yysize); \
558 Stack = &yyptr->Stack; \
559 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
560 yyptr += yynewbytes / sizeof (*yyptr); \
566 /* YYFINAL -- State number of the termination state. */
568 /* YYLAST -- Last index in YYTABLE. */
571 /* YYNTOKENS -- Number of terminals. */
573 /* YYNNTS -- Number of nonterminals. */
575 /* YYNRULES -- Number of rules. */
577 /* YYNRULES -- Number of states. */
578 #define YYNSTATES 145
580 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
582 #define YYMAXUTOK 316
584 #define YYTRANSLATE(YYX) \
585 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
587 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
588 static const yytype_uint8 yytranslate
[] =
590 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
616 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
617 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
618 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
619 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
620 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
621 55, 56, 57, 58, 59, 60, 61
625 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
627 static const yytype_uint16 yyprhs
[] =
629 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
630 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
631 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
632 80, 82, 85, 88, 90, 92, 94, 96, 98, 100,
633 103, 107, 111, 113, 115, 118, 121, 124, 127, 128,
634 130, 134, 135, 139, 140, 144, 148, 152, 154, 156,
635 158, 159, 161, 163, 166, 168, 171, 173, 175, 177,
636 179, 181, 183, 186, 189, 193, 195, 198, 200, 203,
637 205, 208, 211, 212, 216, 218, 222, 225, 226, 229,
638 232, 236, 240, 244, 246, 248, 249, 251, 253, 255,
639 257, 259, 261, 263, 265, 266
642 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
643 static const yytype_int8 yyrhs
[] =
645 63, 0, -1, 64, 54, 79, 92, -1, -1, 64,
646 65, -1, 66, -1, 56, -1, 18, -1, 20, 3,
647 86, -1, 21, -1, 21, 3, -1, 22, -1, 23,
648 4, -1, 24, 4, -1, 25, 3, -1, 25, 51,
649 3, -1, 26, -1, 27, 48, -1, 28, 3, -1,
650 29, 48, -1, 30, -1, 31, 3, -1, 31, 51,
651 3, -1, 33, -1, 34, -1, 35, 3, -1, 35,
652 51, 3, -1, 36, 48, -1, 38, -1, 39, -1,
653 40, -1, 41, 3, -1, 43, 3, -1, 45, -1,
654 46, -1, 47, -1, 57, -1, 71, -1, 68, -1,
655 44, 90, -1, 8, 48, 75, -1, 9, 48, 75,
656 -1, 19, -1, 32, -1, 16, 87, -1, 17, 87,
657 -1, 37, 87, -1, 42, 87, -1, -1, 52, -1,
658 61, 67, 48, -1, -1, 6, 69, 78, -1, -1,
659 5, 70, 78, -1, 7, 58, 74, -1, 72, 73,
660 74, -1, 10, -1, 11, -1, 12, -1, -1, 58,
661 -1, 90, -1, 74, 90, -1, 76, -1, 75, 76,
662 -1, 90, -1, 58, -1, 59, -1, 60, -1, 58,
663 -1, 88, -1, 88, 4, -1, 88, 91, -1, 88,
664 4, 91, -1, 77, -1, 78, 77, -1, 80, -1,
665 79, 80, -1, 81, -1, 66, 57, -1, 1, 57,
666 -1, -1, 89, 82, 83, -1, 84, -1, 83, 55,
667 84, -1, 83, 57, -1, -1, 84, 90, -1, 84,
668 48, -1, 84, 13, 90, -1, 84, 14, 4, -1,
669 84, 15, 58, -1, 3, -1, 87, -1, -1, 85,
670 -1, 48, -1, 52, -1, 49, -1, 53, -1, 88,
671 -1, 91, -1, 3, -1, -1, 54, 50, -1
674 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
675 static const yytype_uint16 yyrline
[] =
677 0, 213, 213, 221, 223, 227, 228, 229, 230, 231,
678 232, 237, 238, 239, 240, 241, 242, 247, 251, 252,
679 253, 254, 255, 256, 257, 258, 259, 260, 261, 262,
680 263, 264, 265, 266, 267, 268, 269, 273, 274, 275,
681 279, 287, 295, 299, 303, 304, 305, 306, 317, 318,
682 322, 350, 350, 355, 355, 360, 371, 386, 387, 388,
683 392, 393, 398, 400, 405, 406, 410, 411, 412, 413,
684 418, 423, 428, 434, 440, 451, 452, 461, 462, 468,
685 469, 470, 477, 477, 481, 482, 483, 488, 489, 491,
686 493, 495, 497, 507, 508, 514, 518, 523, 539, 541,
687 550, 555, 556, 561, 568, 570
691 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
692 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
693 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
694 static const char *const yytname
[] =
696 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
697 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
698 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
699 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%code-top\"", "\"%debug\"",
700 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
701 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
702 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
703 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
704 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
705 "\"%parse-param\"", "\"%provides\"", "\"%pure-parser\"",
706 "\"%push-parser\"", "\"%push-pull-parser\"", "\"%require\"",
707 "\"%requires\"", "\"%skeleton\"", "\"%start\"", "\"%token-table\"",
708 "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"",
709 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
710 "\"%{...%}\"", "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"",
711 "$accept", "input", "prologue_declarations", "prologue_declaration",
712 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
713 "precedence_declaration", "precedence_declarator", "type.opt",
714 "symbols.1", "generic_symlist", "generic_symlist_item", "symbol_def",
715 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
716 "$@3", "rhses.1", "rhs", "content", "content.opt", "braceless", "id",
717 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
722 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
724 static const yytype_uint16 yytoknum
[] =
726 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
727 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
728 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
729 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
730 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
731 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
736 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
737 static const yytype_uint8 yyr1
[] =
739 0, 62, 63, 64, 64, 65, 65, 65, 65, 65,
740 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
741 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
742 65, 65, 65, 65, 65, 65, 65, 66, 66, 66,
743 66, 66, 66, 66, 66, 66, 66, 66, 67, 67,
744 66, 69, 68, 70, 68, 68, 71, 72, 72, 72,
745 73, 73, 74, 74, 75, 75, 76, 76, 76, 76,
746 77, 77, 77, 77, 77, 78, 78, 79, 79, 80,
747 80, 80, 82, 81, 83, 83, 83, 84, 84, 84,
748 84, 84, 84, 85, 85, 86, 86, 87, 88, 88,
749 89, 90, 90, 91, 92, 92
752 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
753 static const yytype_uint8 yyr2
[] =
755 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
756 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
757 1, 2, 3, 1, 1, 2, 3, 2, 1, 1,
758 1, 2, 2, 1, 1, 1, 1, 1, 1, 2,
759 3, 3, 1, 1, 2, 2, 2, 2, 0, 1,
760 3, 0, 3, 0, 3, 3, 3, 1, 1, 1,
761 0, 1, 1, 2, 1, 2, 1, 1, 1, 1,
762 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
763 2, 2, 0, 3, 1, 3, 2, 0, 2, 2,
764 3, 3, 3, 1, 1, 0, 1, 1, 1, 1,
768 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
769 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
770 means the default is an error. */
771 static const yytype_uint8 yydefact
[] =
773 3, 0, 0, 1, 53, 51, 0, 0, 0, 57,
774 58, 59, 0, 0, 7, 42, 0, 9, 11, 0,
775 0, 0, 16, 0, 0, 0, 20, 0, 43, 23,
776 24, 0, 0, 0, 28, 29, 30, 0, 0, 0,
777 0, 33, 34, 35, 0, 6, 36, 48, 4, 5,
778 38, 37, 60, 0, 0, 0, 0, 0, 97, 44,
779 45, 95, 10, 12, 13, 14, 0, 17, 18, 19,
780 21, 0, 25, 0, 27, 46, 31, 47, 32, 103,
781 99, 98, 101, 39, 102, 0, 100, 0, 0, 77,
782 79, 82, 49, 0, 61, 0, 70, 75, 54, 71,
783 52, 55, 62, 67, 68, 69, 40, 64, 66, 41,
784 93, 96, 8, 94, 15, 22, 26, 81, 80, 0,
785 78, 2, 87, 50, 56, 76, 72, 73, 63, 65,
786 105, 83, 84, 74, 87, 86, 0, 0, 0, 89,
790 /* YYDEFGOTO[NTERM-NUM]. */
791 static const yytype_int16 yydefgoto
[] =
793 -1, 1, 2, 48, 87, 93, 50, 54, 53, 51,
794 52, 95, 101, 106, 107, 97, 98, 88, 89, 90,
795 122, 131, 132, 111, 112, 59, 82, 91, 108, 84,
799 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
801 #define YYPACT_NINF -100
802 static const yytype_int16 yypact
[] =
804 -100, 3, 127, -100, -100, -100, -50, -22, -11, -100,
805 -100, -100, -3, -3, -100, -100, 37, 43, -100, 56,
806 59, 1, -100, 19, 65, 21, -100, 11, -100, -100,
807 -100, 13, 22, -3, -100, -100, -100, 71, -3, 85,
808 -2, -100, -100, -100, 70, -100, -100, 38, -100, -100,
809 -100, -100, 33, -17, -17, -2, -1, -1, -100, -100,
810 -100, 24, -100, -100, -100, -100, 90, -100, -100, -100,
811 -100, 91, -100, 92, -100, -100, -100, -100, -100, -100,
812 -100, -100, -100, -100, -100, 40, -100, 41, 12, -100,
813 -100, -100, -100, 51, -100, -2, -100, -100, -17, 39,
814 -17, -2, -100, -100, -100, -100, -1, -100, -100, -1,
815 -100, -100, -100, -100, -100, -100, -100, -100, -100, 50,
816 -100, -100, -100, -100, -2, -100, 100, -100, -100, -100,
817 -100, -46, 172, -100, -100, -100, -2, 101, 46, -100,
818 -100, 172, -100, -100, -100
821 /* YYPGOTO[NTERM-NUM]. */
822 static const yytype_int8 yypgoto
[] =
824 -100, -100, -100, -100, 104, -100, -100, -100, -100, -100,
825 -100, -100, 14, 53, -99, -64, 54, -100, 23, -100,
826 -100, -100, -21, -100, -100, -8, -15, -100, -40, -93,
830 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
831 positive, shift that token. If negative, reduce the rule which
832 number is the opposite. If zero, do what YYDEFACT says.
833 If YYTABLE_NINF, syntax error. */
834 #define YYTABLE_NINF -105
835 static const yytype_int16 yytable
[] =
837 83, 79, 79, 3, 65, 60, 127, 129, 55, 134,
838 129, 135, -104, 85, 70, 102, 72, 4, 5, 6,
839 7, 8, 9, 10, 11, 75, 56, 110, 12, 13,
840 77, 15, 80, 133, 125, 81, 125, 57, 99, 99,
841 61, 96, 79, 126, 28, 58, 62, 80, 80, 33,
842 81, 81, 66, 113, 38, 102, 40, 103, 104, 105,
843 63, 128, 71, 64, 73, 86, 119, 67, 68, 69,
844 74, 85, 58, 47, 76, 4, 5, 6, 7, 8,
845 9, 10, 11, 99, 128, 99, 12, 13, 78, 15,
846 92, 94, 140, 114, 115, 116, 142, 117, 118, 123,
847 130, 140, 28, 79, 144, 143, 49, 33, 100, 124,
848 109, 120, 38, 141, 40, 0, 0, 0, 0, 0,
849 0, 0, 0, 86, 0, 0, 0, 0, 0, 0,
850 0, 47, 4, 5, 6, 7, 8, 9, 10, 11,
851 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
852 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
853 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
854 39, 40, 41, 42, 43, 79, 0, 0, 0, 0,
855 0, 44, 0, 45, 46, 136, 137, 138, 47, 0,
856 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
857 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
858 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
862 static const yytype_int16 yycheck
[] =
864 40, 3, 3, 0, 3, 13, 99, 106, 58, 55,
865 109, 57, 0, 1, 3, 55, 3, 5, 6, 7,
866 8, 9, 10, 11, 12, 33, 48, 3, 16, 17,
867 38, 19, 49, 126, 98, 52, 100, 48, 53, 54,
868 3, 58, 3, 4, 32, 48, 3, 49, 49, 37,
869 52, 52, 51, 61, 42, 95, 44, 58, 59, 60,
870 4, 101, 51, 4, 51, 53, 54, 48, 3, 48,
871 48, 1, 48, 61, 3, 5, 6, 7, 8, 9,
872 10, 11, 12, 98, 124, 100, 16, 17, 3, 19,
873 52, 58, 132, 3, 3, 3, 136, 57, 57, 48,
874 50, 141, 32, 3, 58, 4, 2, 37, 54, 95,
875 57, 88, 42, 134, 44, -1, -1, -1, -1, -1,
876 -1, -1, -1, 53, -1, -1, -1, -1, -1, -1,
877 -1, 61, 5, 6, 7, 8, 9, 10, 11, 12,
878 -1, -1, -1, 16, 17, 18, 19, 20, 21, 22,
879 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
880 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
881 43, 44, 45, 46, 47, 3, -1, -1, -1, -1,
882 -1, 54, -1, 56, 57, 13, 14, 15, 61, -1,
883 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
884 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
885 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
889 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
890 symbol of state STATE-NUM. */
891 static const yytype_uint8 yystos
[] =
893 0, 63, 64, 0, 5, 6, 7, 8, 9, 10,
894 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
895 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
896 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
897 44, 45, 46, 47, 54, 56, 57, 61, 65, 66,
898 68, 71, 72, 70, 69, 58, 48, 48, 48, 87,
899 87, 3, 3, 4, 4, 3, 51, 48, 3, 48,
900 3, 51, 3, 51, 48, 87, 3, 87, 3, 3,
901 49, 52, 88, 90, 91, 1, 53, 66, 79, 80,
902 81, 89, 52, 67, 58, 73, 58, 77, 78, 88,
903 78, 74, 90, 58, 59, 60, 75, 76, 90, 75,
904 3, 85, 86, 87, 3, 3, 3, 57, 57, 54,
905 80, 92, 82, 48, 74, 77, 4, 91, 90, 76,
906 50, 83, 84, 91, 55, 57, 13, 14, 15, 48,
910 #define yyerrok (yyerrstatus = 0)
911 #define yyclearin (yychar = YYEMPTY)
915 #define YYACCEPT goto yyacceptlab
916 #define YYABORT goto yyabortlab
917 #define YYERROR goto yyerrorlab
920 /* Like YYERROR except do call yyerror. This remains here temporarily
921 to ease the transition to the new meaning of YYERROR, for GCC.
922 Once GCC version 2 has supplanted version 1, this can go. */
924 #define YYFAIL goto yyerrlab
926 #define YYRECOVERING() (!!yyerrstatus)
928 #define YYBACKUP(Token, Value) \
930 if (yychar == YYEMPTY && yylen == 1) \
934 yytoken = YYTRANSLATE (yychar); \
940 yyerror (YY_("syntax error: cannot back up")); \
947 #define YYERRCODE 256
950 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
951 If N is 0, then set CURRENT to the empty location which ends
952 the previous symbol: RHS[0] (always defined). */
954 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
955 #ifndef YYLLOC_DEFAULT
956 # define YYLLOC_DEFAULT(Current, Rhs, N) \
960 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
961 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
962 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
963 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
967 (Current).first_line = (Current).last_line = \
968 YYRHSLOC (Rhs, 0).last_line; \
969 (Current).first_column = (Current).last_column = \
970 YYRHSLOC (Rhs, 0).last_column; \
976 /* YY_LOCATION_PRINT -- Print the location on the stream.
977 This macro was not mandated originally: define only if we know
978 we won't break user code: when these are the locations we know. */
980 #ifndef YY_LOCATION_PRINT
981 # if YYLTYPE_IS_TRIVIAL
982 # define YY_LOCATION_PRINT(File, Loc) \
983 fprintf (File, "%d.%d-%d.%d", \
984 (Loc).first_line, (Loc).first_column, \
985 (Loc).last_line, (Loc).last_column)
987 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
992 /* YYLEX -- calling `yylex' with the right arguments. */
995 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
997 # define YYLEX yylex (&yylval, &yylloc)
1000 /* Enable debugging if requested. */
1004 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1005 # define YYFPRINTF fprintf
1008 # define YYDPRINTF(Args) \
1014 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1018 YYFPRINTF (stderr, "%s ", Title); \
1019 yy_symbol_print (stderr, \
1020 Type, Value, Location); \
1021 YYFPRINTF (stderr, "\n"); \
1026 /*--------------------------------.
1027 | Print this symbol on YYOUTPUT. |
1028 `--------------------------------*/
1031 #if (defined __STDC__ || defined __C99__FUNC__ \
1032 || defined __cplusplus || defined _MSC_VER)
1034 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1037 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1040 YYSTYPE
const * const yyvaluep
;
1041 YYLTYPE
const * const yylocationp
;
1046 YYUSE (yylocationp
);
1048 if (yytype
< YYNTOKENS
)
1049 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1055 case 3: /* "\"string\"" */
1057 /* Line 670 of yacc.c */
1058 #line 191 "parse-gram.y"
1059 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1061 /* Line 670 of yacc.c */
1062 #line 1063 "parse-gram.c"
1064 case 4: /* "\"integer\"" */
1066 /* Line 670 of yacc.c */
1067 #line 202 "parse-gram.y"
1068 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1070 /* Line 670 of yacc.c */
1071 #line 1072 "parse-gram.c"
1073 case 48: /* "\"{...}\"" */
1075 /* Line 670 of yacc.c */
1076 #line 193 "parse-gram.y"
1077 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1079 /* Line 670 of yacc.c */
1080 #line 1081 "parse-gram.c"
1082 case 49: /* "\"char\"" */
1084 /* Line 670 of yacc.c */
1085 #line 185 "parse-gram.y"
1086 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1088 /* Line 670 of yacc.c */
1089 #line 1090 "parse-gram.c"
1091 case 50: /* "\"epilogue\"" */
1093 /* Line 670 of yacc.c */
1094 #line 193 "parse-gram.y"
1095 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1097 /* Line 670 of yacc.c */
1098 #line 1099 "parse-gram.c"
1100 case 52: /* "\"identifier\"" */
1102 /* Line 670 of yacc.c */
1103 #line 198 "parse-gram.y"
1104 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1106 /* Line 670 of yacc.c */
1107 #line 1108 "parse-gram.c"
1109 case 53: /* "\"identifier:\"" */
1111 /* Line 670 of yacc.c */
1112 #line 199 "parse-gram.y"
1113 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1115 /* Line 670 of yacc.c */
1116 #line 1117 "parse-gram.c"
1118 case 56: /* "\"%{...%}\"" */
1120 /* Line 670 of yacc.c */
1121 #line 193 "parse-gram.y"
1122 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1124 /* Line 670 of yacc.c */
1125 #line 1126 "parse-gram.c"
1127 case 58: /* "\"type\"" */
1129 /* Line 670 of yacc.c */
1130 #line 197 "parse-gram.y"
1131 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1133 /* Line 670 of yacc.c */
1134 #line 1135 "parse-gram.c"
1136 case 85: /* "content" */
1138 /* Line 670 of yacc.c */
1139 #line 193 "parse-gram.y"
1140 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1142 /* Line 670 of yacc.c */
1143 #line 1144 "parse-gram.c"
1145 case 86: /* "content.opt" */
1147 /* Line 670 of yacc.c */
1148 #line 193 "parse-gram.y"
1149 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1151 /* Line 670 of yacc.c */
1152 #line 1153 "parse-gram.c"
1154 case 87: /* "braceless" */
1156 /* Line 670 of yacc.c */
1157 #line 193 "parse-gram.y"
1158 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1160 /* Line 670 of yacc.c */
1161 #line 1162 "parse-gram.c"
1165 /* Line 670 of yacc.c */
1166 #line 205 "parse-gram.y"
1167 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1169 /* Line 670 of yacc.c */
1170 #line 1171 "parse-gram.c"
1172 case 89: /* "id_colon" */
1174 /* Line 670 of yacc.c */
1175 #line 206 "parse-gram.y"
1176 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1178 /* Line 670 of yacc.c */
1179 #line 1180 "parse-gram.c"
1181 case 90: /* "symbol" */
1183 /* Line 670 of yacc.c */
1184 #line 205 "parse-gram.y"
1185 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1187 /* Line 670 of yacc.c */
1188 #line 1189 "parse-gram.c"
1190 case 91: /* "string_as_id" */
1192 /* Line 670 of yacc.c */
1193 #line 205 "parse-gram.y"
1194 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1196 /* Line 670 of yacc.c */
1197 #line 1198 "parse-gram.c"
1205 /*--------------------------------.
1206 | Print this symbol on YYOUTPUT. |
1207 `--------------------------------*/
1209 #if (defined __STDC__ || defined __C99__FUNC__ \
1210 || defined __cplusplus || defined _MSC_VER)
1212 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1215 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1218 YYSTYPE
const * const yyvaluep
;
1219 YYLTYPE
const * const yylocationp
;
1222 if (yytype
< YYNTOKENS
)
1223 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1225 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1227 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1228 YYFPRINTF (yyoutput
, ": ");
1229 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1230 YYFPRINTF (yyoutput
, ")");
1233 /*------------------------------------------------------------------.
1234 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1236 `------------------------------------------------------------------*/
1238 #if (defined __STDC__ || defined __C99__FUNC__ \
1239 || defined __cplusplus || defined _MSC_VER)
1241 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1244 yy_stack_print (yybottom
, yytop
)
1245 yytype_int16
*yybottom
;
1246 yytype_int16
*yytop
;
1249 YYFPRINTF (stderr
, "Stack now");
1250 for (; yybottom
<= yytop
; yybottom
++)
1252 int yybot
= *yybottom
;
1253 YYFPRINTF (stderr
, " %d", yybot
);
1255 YYFPRINTF (stderr
, "\n");
1258 # define YY_STACK_PRINT(Bottom, Top) \
1261 yy_stack_print ((Bottom), (Top)); \
1265 /*------------------------------------------------.
1266 | Report that the YYRULE is going to be reduced. |
1267 `------------------------------------------------*/
1269 #if (defined __STDC__ || defined __C99__FUNC__ \
1270 || defined __cplusplus || defined _MSC_VER)
1272 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1275 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1281 int yynrhs
= yyr2
[yyrule
];
1283 unsigned long int yylno
= yyrline
[yyrule
];
1284 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1286 /* The symbols being reduced. */
1287 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1289 fprintf (stderr
, " $%d = ", yyi
+ 1);
1290 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1291 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1292 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1293 fprintf (stderr
, "\n");
1297 # define YY_REDUCE_PRINT(Rule) \
1300 yy_reduce_print (yyvsp, yylsp, Rule); \
1303 /* Nonzero means print parse trace. It is left uninitialized so that
1304 multiple parsers can coexist. */
1306 #else /* !YYDEBUG */
1307 # define YYDPRINTF(Args)
1308 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1309 # define YY_STACK_PRINT(Bottom, Top)
1310 # define YY_REDUCE_PRINT(Rule)
1311 #endif /* !YYDEBUG */
1314 /* YYINITDEPTH -- initial size of the parser's stacks. */
1316 # define YYINITDEPTH 200
1319 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1320 if the built-in stack extension method is used).
1322 Do not make this value too large; the results are undefined if
1323 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1324 evaluated with infinite-precision integer arithmetic. */
1327 # define YYMAXDEPTH 10000
1335 # if defined __GLIBC__ && defined _STRING_H
1336 # define yystrlen strlen
1338 /* Return the length of YYSTR. */
1339 #if (defined __STDC__ || defined __C99__FUNC__ \
1340 || defined __cplusplus || defined _MSC_VER)
1342 yystrlen (const char *yystr
)
1350 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1358 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1359 # define yystpcpy stpcpy
1361 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1363 #if (defined __STDC__ || defined __C99__FUNC__ \
1364 || defined __cplusplus || defined _MSC_VER)
1366 yystpcpy (char *yydest
, const char *yysrc
)
1369 yystpcpy (yydest
, yysrc
)
1375 const char *yys
= yysrc
;
1377 while ((*yyd
++ = *yys
++) != '\0')
1386 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1387 quotes and backslashes, so that it's suitable for yyerror. The
1388 heuristic is that double-quoting is unnecessary unless the string
1389 contains an apostrophe, a comma, or backslash (other than
1390 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1391 null, do not copy; instead, return the length of what the result
1394 yytnamerr (char *yyres
, const char *yystr
)
1399 char const *yyp
= yystr
;
1406 goto do_not_strip_quotes
;
1410 goto do_not_strip_quotes
;
1423 do_not_strip_quotes
: ;
1427 return yystrlen (yystr
);
1429 return yystpcpy (yyres
, yystr
) - yyres
;
1433 /* Copy into YYRESULT an error message about the unexpected token
1434 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1435 including the terminating null byte. If YYRESULT is null, do not
1436 copy anything; just return the number of bytes that would be
1437 copied. As a special case, return 0 if an ordinary "syntax error"
1438 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1439 size calculation. */
1441 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1443 int yyn
= yypact
[yystate
];
1445 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1449 int yytype
= YYTRANSLATE (yychar
);
1450 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1451 YYSIZE_T yysize
= yysize0
;
1453 int yysize_overflow
= 0;
1454 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1455 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1459 /* This is so xgettext sees the translatable formats that are
1460 constructed on the fly. */
1461 YY_("syntax error, unexpected %s");
1462 YY_("syntax error, unexpected %s, expecting %s");
1463 YY_("syntax error, unexpected %s, expecting %s or %s");
1464 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1465 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1469 static char const yyunexpected
[] = "syntax error, unexpected %s";
1470 static char const yyexpecting
[] = ", expecting %s";
1471 static char const yyor
[] = " or %s";
1472 char yyformat
[sizeof yyunexpected
1473 + sizeof yyexpecting
- 1
1474 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1475 * (sizeof yyor
- 1))];
1476 char const *yyprefix
= yyexpecting
;
1478 /* Start YYX at -YYN if negative to avoid negative indexes in
1480 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1482 /* Stay within bounds of both yycheck and yytname. */
1483 int yychecklim
= YYLAST
- yyn
+ 1;
1484 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1487 yyarg
[0] = yytname
[yytype
];
1488 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1490 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1491 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1493 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1497 yyformat
[sizeof yyunexpected
- 1] = '\0';
1500 yyarg
[yycount
++] = yytname
[yyx
];
1501 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1502 yysize_overflow
|= (yysize1
< yysize
);
1504 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1508 yyf
= YY_(yyformat
);
1509 yysize1
= yysize
+ yystrlen (yyf
);
1510 yysize_overflow
|= (yysize1
< yysize
);
1513 if (yysize_overflow
)
1514 return YYSIZE_MAXIMUM
;
1518 /* Avoid sprintf, as that infringes on the user's name space.
1519 Don't have undefined behavior even if the translation
1520 produced a string with the wrong number of "%s"s. */
1521 char *yyp
= yyresult
;
1523 while ((*yyp
= *yyf
) != '\0')
1525 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1527 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1540 #endif /* YYERROR_VERBOSE */
1543 /*-----------------------------------------------.
1544 | Release the memory associated to this symbol. |
1545 `-----------------------------------------------*/
1548 #if (defined __STDC__ || defined __C99__FUNC__ \
1549 || defined __cplusplus || defined _MSC_VER)
1551 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1554 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1558 YYLTYPE
*yylocationp
;
1562 YYUSE (yylocationp
);
1566 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1577 /* Prevent warnings from -Wmissing-prototypes. */
1579 #ifdef YYPARSE_PARAM
1580 #if defined __STDC__ || defined __cplusplus
1581 int yyparse (void *YYPARSE_PARAM
);
1585 #else /* ! YYPARSE_PARAM */
1586 #if defined __STDC__ || defined __cplusplus
1591 #endif /* ! YYPARSE_PARAM */
1602 #ifdef YYPARSE_PARAM
1603 #if (defined __STDC__ || defined __C99__FUNC__ \
1604 || defined __cplusplus || defined _MSC_VER)
1606 yyparse (void *YYPARSE_PARAM
)
1609 yyparse (YYPARSE_PARAM
)
1610 void *YYPARSE_PARAM
;
1612 #else /* ! YYPARSE_PARAM */
1613 #if (defined __STDC__ || defined __C99__FUNC__ \
1614 || defined __cplusplus || defined _MSC_VER)
1624 /* The lookahead symbol. */
1627 /* The semantic value of the lookahead symbol. */
1630 /* Number of syntax errors so far. */
1632 /* Location data for the lookahead symbol. */
1638 /* Number of tokens to shift before error messages enabled. */
1640 /* Lookahead token as an internal (translated) token number. */
1643 /* Buffer for error messages, and its allocated size. */
1645 char *yymsg
= yymsgbuf
;
1646 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1649 /* Three stacks and their tools:
1650 `yyss': related to states,
1651 `yyvs': related to semantic values,
1652 `yyls': related to locations.
1654 Refer to the stacks thru separate pointers, to allow yyoverflow
1655 to reallocate them elsewhere. */
1657 /* The state stack. */
1658 yytype_int16 yyssa
[YYINITDEPTH
];
1659 yytype_int16
*yyss
= yyssa
;
1660 yytype_int16
*yyssp
;
1662 /* The semantic value stack. */
1663 YYSTYPE yyvsa
[YYINITDEPTH
];
1664 YYSTYPE
*yyvs
= yyvsa
;
1667 /* The location stack. */
1668 YYLTYPE yylsa
[YYINITDEPTH
];
1669 YYLTYPE
*yyls
= yylsa
;
1671 /* The locations where the error started and ended. */
1672 YYLTYPE yyerror_range
[2];
1674 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1676 YYSIZE_T yystacksize
= YYINITDEPTH
;
1678 /* The variables used to return semantic value and location from the
1683 /* The number of symbols on the RHS of the reduced rule.
1684 Keep to zero when no symbol should be popped. */
1687 YYDPRINTF ((stderr
, "Starting parse\n"));
1692 yychar
= YYEMPTY
; /* Cause a token to be read. */
1694 /* Initialize stack pointers.
1695 Waste one element of value and location stack
1696 so that they stay on the same level as the state stack.
1697 The wasted elements are never initialized. */
1702 #if YYLTYPE_IS_TRIVIAL
1703 /* Initialize the default location before parsing starts. */
1704 yylloc
.first_line
= yylloc
.last_line
= 1;
1705 yylloc
.first_column
= yylloc
.last_column
= 1;
1709 /* User initialization code. */
1711 /* Line 1082 of yacc.c */
1712 #line 89 "parse-gram.y"
1714 /* Bison's grammar can initial empty locations, hence a default
1715 location is needed. */
1716 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1717 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1720 /* Line 1082 of yacc.c */
1721 #line 1722 "parse-gram.c"
1725 /*------------------------------------------------------------.
1726 | yynewstate -- Push a new state, which is found in yystate. |
1727 `------------------------------------------------------------*/
1729 /* In all cases, when you get here, the value and location stacks
1730 have just been pushed. So pushing a state here evens the stacks. */
1736 if (yyss
+ yystacksize
- 1 <= yyssp
)
1738 /* Get the current used size of the three stacks, in elements. */
1739 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1743 /* Give user a chance to reallocate the stack. Use copies of
1744 these so that the &'s don't force the real ones into
1746 YYSTYPE
*yyvs1
= yyvs
;
1747 yytype_int16
*yyss1
= yyss
;
1748 YYLTYPE
*yyls1
= yyls
;
1750 /* Each stack pointer address is followed by the size of the
1751 data in use in that stack, in bytes. This used to be a
1752 conditional around just the two extra args, but that might
1753 be undefined if yyoverflow is a macro. */
1754 yyoverflow (YY_("memory exhausted"),
1755 &yyss1
, yysize
* sizeof (*yyssp
),
1756 &yyvs1
, yysize
* sizeof (*yyvsp
),
1757 &yyls1
, yysize
* sizeof (*yylsp
),
1763 #else /* no yyoverflow */
1764 # ifndef YYSTACK_RELOCATE
1765 goto yyexhaustedlab
;
1767 /* Extend the stack our own way. */
1768 if (YYMAXDEPTH
<= yystacksize
)
1769 goto yyexhaustedlab
;
1771 if (YYMAXDEPTH
< yystacksize
)
1772 yystacksize
= YYMAXDEPTH
;
1775 yytype_int16
*yyss1
= yyss
;
1776 union yyalloc
*yyptr
=
1777 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1779 goto yyexhaustedlab
;
1780 YYSTACK_RELOCATE (yyss
);
1781 YYSTACK_RELOCATE (yyvs
);
1782 YYSTACK_RELOCATE (yyls
);
1783 # undef YYSTACK_RELOCATE
1785 YYSTACK_FREE (yyss1
);
1788 #endif /* no yyoverflow */
1790 yyssp
= yyss
+ yysize
- 1;
1791 yyvsp
= yyvs
+ yysize
- 1;
1792 yylsp
= yyls
+ yysize
- 1;
1794 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1795 (unsigned long int) yystacksize
));
1797 if (yyss
+ yystacksize
- 1 <= yyssp
)
1801 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1803 if (yystate
== YYFINAL
)
1813 /* Do appropriate processing given the current state. Read a
1814 lookahead token if we need one and don't already have one. */
1816 /* First try to decide what to do without reference to lookahead token. */
1817 yyn
= yypact
[yystate
];
1818 if (yyn
== YYPACT_NINF
)
1821 /* Not known => get a lookahead token if don't already have one. */
1823 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1824 if (yychar
== YYEMPTY
)
1826 YYDPRINTF ((stderr
, "Reading a token: "));
1830 if (yychar
<= YYEOF
)
1832 yychar
= yytoken
= YYEOF
;
1833 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1837 yytoken
= YYTRANSLATE (yychar
);
1838 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1841 /* If the proper action on seeing token YYTOKEN is to reduce or to
1842 detect an error, take that action. */
1844 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1849 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1855 /* Count tokens shifted since error; after three, turn off error
1860 /* Shift the lookahead token. */
1861 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1863 /* Discard the shifted token. */
1872 /*-----------------------------------------------------------.
1873 | yydefault -- do the default action for the current state. |
1874 `-----------------------------------------------------------*/
1876 yyn
= yydefact
[yystate
];
1882 /*-----------------------------.
1883 | yyreduce -- Do a reduction. |
1884 `-----------------------------*/
1886 /* yyn is the number of a rule to reduce with. */
1889 /* If YYLEN is nonzero, implement the default value of the action:
1892 Otherwise, the following line sets YYVAL to garbage.
1893 This behavior is undocumented and Bison
1894 users should not rely upon it. Assigning to YYVAL
1895 unconditionally makes the parser a bit smaller, and it avoids a
1896 GCC warning that YYVAL may be used uninitialized. */
1897 yyval
= yyvsp
[1-yylen
];
1899 /* Default location. */
1900 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1901 YY_REDUCE_PRINT (yyn
);
1906 /* Line 1269 of yacc.c */
1907 #line 228 "parse-gram.y"
1908 { prologue_augment (translate_code ((yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)])), (yylsp
[(1) - (1)]), union_seen
); }
1913 /* Line 1269 of yacc.c */
1914 #line 229 "parse-gram.y"
1915 { debug_flag
= true; }
1920 /* Line 1269 of yacc.c */
1921 #line 230 "parse-gram.y"
1922 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1927 /* Line 1269 of yacc.c */
1928 #line 231 "parse-gram.y"
1929 { defines_flag
= true; }
1934 /* Line 1269 of yacc.c */
1935 #line 233 "parse-gram.y"
1937 defines_flag
= true;
1938 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1944 /* Line 1269 of yacc.c */
1945 #line 237 "parse-gram.y"
1946 { error_verbose
= true; }
1951 /* Line 1269 of yacc.c */
1952 #line 238 "parse-gram.y"
1953 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1958 /* Line 1269 of yacc.c */
1959 #line 239 "parse-gram.y"
1960 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1965 /* Line 1269 of yacc.c */
1966 #line 240 "parse-gram.y"
1967 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1972 /* Line 1269 of yacc.c */
1973 #line 241 "parse-gram.y"
1974 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1979 /* Line 1269 of yacc.c */
1980 #line 243 "parse-gram.y"
1982 nondeterministic_parser
= true;
1989 /* Line 1269 of yacc.c */
1990 #line 248 "parse-gram.y"
1992 muscle_code_grow ("initial_action", translate_symbol_action ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1998 /* Line 1269 of yacc.c */
1999 #line 251 "parse-gram.y"
2000 { language_argmatch ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2005 /* Line 1269 of yacc.c */
2006 #line 252 "parse-gram.y"
2007 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2012 /* Line 1269 of yacc.c */
2013 #line 253 "parse-gram.y"
2014 { locations_flag
= true; }
2019 /* Line 1269 of yacc.c */
2020 #line 254 "parse-gram.y"
2021 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2026 /* Line 1269 of yacc.c */
2027 #line 255 "parse-gram.y"
2028 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2033 /* Line 1269 of yacc.c */
2034 #line 256 "parse-gram.y"
2035 { no_lines_flag
= true; }
2040 /* Line 1269 of yacc.c */
2041 #line 257 "parse-gram.y"
2042 { nondeterministic_parser
= true; }
2047 /* Line 1269 of yacc.c */
2048 #line 258 "parse-gram.y"
2049 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2054 /* Line 1269 of yacc.c */
2055 #line 259 "parse-gram.y"
2056 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2061 /* Line 1269 of yacc.c */
2062 #line 260 "parse-gram.y"
2063 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2068 /* Line 1269 of yacc.c */
2069 #line 261 "parse-gram.y"
2070 { pure_parser
= true; }
2075 /* Line 1269 of yacc.c */
2076 #line 262 "parse-gram.y"
2077 { push_parser
= true; pull_parser
= false; }
2082 /* Line 1269 of yacc.c */
2083 #line 263 "parse-gram.y"
2084 { push_parser
= true; pull_parser
= true; }
2089 /* Line 1269 of yacc.c */
2090 #line 264 "parse-gram.y"
2091 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2096 /* Line 1269 of yacc.c */
2097 #line 265 "parse-gram.y"
2098 { skeleton_arg ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2103 /* Line 1269 of yacc.c */
2104 #line 266 "parse-gram.y"
2105 { token_table_flag
= true; }
2110 /* Line 1269 of yacc.c */
2111 #line 267 "parse-gram.y"
2112 { report_flag
= report_states
; }
2117 /* Line 1269 of yacc.c */
2118 #line 268 "parse-gram.y"
2119 { yacc_flag
= true; }
2124 /* Line 1269 of yacc.c */
2125 #line 276 "parse-gram.y"
2127 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2133 /* Line 1269 of yacc.c */
2134 #line 280 "parse-gram.y"
2137 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2138 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2139 symbol_list_destructor_set (list
, action
, (yylsp
[(2) - (3)]));
2140 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2146 /* Line 1269 of yacc.c */
2147 #line 288 "parse-gram.y"
2150 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2151 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2152 symbol_list_printer_set (list
, action
, (yylsp
[(2) - (3)]));
2153 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2159 /* Line 1269 of yacc.c */
2160 #line 296 "parse-gram.y"
2162 default_prec
= true;
2168 /* Line 1269 of yacc.c */
2169 #line 300 "parse-gram.y"
2171 default_prec
= false;
2177 /* Line 1269 of yacc.c */
2178 #line 303 "parse-gram.y"
2179 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), true); }
2184 /* Line 1269 of yacc.c */
2185 #line 304 "parse-gram.y"
2186 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), false); }
2191 /* Line 1269 of yacc.c */
2192 #line 305 "parse-gram.y"
2193 { muscle_code_grow ("provides", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2198 /* Line 1269 of yacc.c */
2199 #line 306 "parse-gram.y"
2200 { muscle_code_grow ("requires", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2205 /* Line 1269 of yacc.c */
2206 #line 317 "parse-gram.y"
2212 /* Line 1269 of yacc.c */
2213 #line 318 "parse-gram.y"
2214 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2219 /* Line 1269 of yacc.c */
2220 #line 323 "parse-gram.y"
2222 char const *body
= (yyvsp
[(3) - (3)].code
);
2224 /* Concatenate the %union bodies. If this is the first %union, make sure
2225 the synchronization line appears after the opening '{' so as not to
2226 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2227 into '\n', and omit the new %union's leading '{'. */
2230 muscle_grow ("stype", "{", "");
2234 char *code
= muscle_find ("stype");
2235 code
[strlen (code
) - 1] = '\n';
2240 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2246 /* Line 1269 of yacc.c */
2247 #line 350 "parse-gram.y"
2248 { current_class
= nterm_sym
; }
2253 /* Line 1269 of yacc.c */
2254 #line 351 "parse-gram.y"
2256 current_class
= unknown_sym
;
2257 current_type
= NULL
;
2263 /* Line 1269 of yacc.c */
2264 #line 355 "parse-gram.y"
2265 { current_class
= token_sym
; }
2270 /* Line 1269 of yacc.c */
2271 #line 356 "parse-gram.y"
2273 current_class
= unknown_sym
;
2274 current_type
= NULL
;
2280 /* Line 1269 of yacc.c */
2281 #line 361 "parse-gram.y"
2285 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2286 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2287 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2293 /* Line 1269 of yacc.c */
2294 #line 372 "parse-gram.y"
2298 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2300 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2301 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2303 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2304 current_type
= NULL
;
2310 /* Line 1269 of yacc.c */
2311 #line 386 "parse-gram.y"
2312 { (yyval
.assoc
) = left_assoc
; }
2317 /* Line 1269 of yacc.c */
2318 #line 387 "parse-gram.y"
2319 { (yyval
.assoc
) = right_assoc
; }
2324 /* Line 1269 of yacc.c */
2325 #line 388 "parse-gram.y"
2326 { (yyval
.assoc
) = non_assoc
; }
2331 /* Line 1269 of yacc.c */
2332 #line 392 "parse-gram.y"
2333 { current_type
= NULL
; }
2338 /* Line 1269 of yacc.c */
2339 #line 393 "parse-gram.y"
2340 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2345 /* Line 1269 of yacc.c */
2346 #line 399 "parse-gram.y"
2347 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2352 /* Line 1269 of yacc.c */
2353 #line 401 "parse-gram.y"
2354 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2359 /* Line 1269 of yacc.c */
2360 #line 405 "parse-gram.y"
2361 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2366 /* Line 1269 of yacc.c */
2367 #line 406 "parse-gram.y"
2368 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2373 /* Line 1269 of yacc.c */
2374 #line 410 "parse-gram.y"
2375 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2380 /* Line 1269 of yacc.c */
2381 #line 411 "parse-gram.y"
2382 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2387 /* Line 1269 of yacc.c */
2388 #line 412 "parse-gram.y"
2389 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2394 /* Line 1269 of yacc.c */
2395 #line 413 "parse-gram.y"
2396 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2401 /* Line 1269 of yacc.c */
2402 #line 419 "parse-gram.y"
2404 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2411 /* Line 1269 of yacc.c */
2412 #line 424 "parse-gram.y"
2414 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2415 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2421 /* Line 1269 of yacc.c */
2422 #line 429 "parse-gram.y"
2424 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2425 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2426 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2432 /* Line 1269 of yacc.c */
2433 #line 435 "parse-gram.y"
2435 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2436 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2437 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2443 /* Line 1269 of yacc.c */
2444 #line 441 "parse-gram.y"
2446 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2447 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2448 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2449 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2455 /* Line 1269 of yacc.c */
2456 #line 471 "parse-gram.y"
2464 /* Line 1269 of yacc.c */
2465 #line 477 "parse-gram.y"
2466 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2471 /* Line 1269 of yacc.c */
2472 #line 481 "parse-gram.y"
2473 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2478 /* Line 1269 of yacc.c */
2479 #line 482 "parse-gram.y"
2480 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2485 /* Line 1269 of yacc.c */
2486 #line 488 "parse-gram.y"
2487 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2492 /* Line 1269 of yacc.c */
2493 #line 490 "parse-gram.y"
2494 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2499 /* Line 1269 of yacc.c */
2500 #line 492 "parse-gram.y"
2501 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2506 /* Line 1269 of yacc.c */
2507 #line 494 "parse-gram.y"
2508 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2513 /* Line 1269 of yacc.c */
2514 #line 496 "parse-gram.y"
2515 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2520 /* Line 1269 of yacc.c */
2521 #line 498 "parse-gram.y"
2522 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2527 /* Line 1269 of yacc.c */
2528 #line 514 "parse-gram.y"
2530 static char one
[] = "1";
2531 (yyval
.chars
) = one
;
2537 /* Line 1269 of yacc.c */
2538 #line 524 "parse-gram.y"
2540 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2541 (yyval
.chars
) = translate_code ((yyvsp
[(1) - (1)].code
) + 1, (yylsp
[(1) - (1)]));
2547 /* Line 1269 of yacc.c */
2548 #line 540 "parse-gram.y"
2549 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2554 /* Line 1269 of yacc.c */
2555 #line 542 "parse-gram.y"
2557 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2558 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2559 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2565 /* Line 1269 of yacc.c */
2566 #line 550 "parse-gram.y"
2567 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2572 /* Line 1269 of yacc.c */
2573 #line 562 "parse-gram.y"
2575 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2576 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2582 /* Line 1269 of yacc.c */
2583 #line 571 "parse-gram.y"
2585 muscle_code_grow ("epilogue", translate_code ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
2586 gram_scanner_last_string_free ();
2592 /* Line 1269 of yacc.c */
2593 #line 2594 "parse-gram.c"
2596 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2600 YY_STACK_PRINT (yyss
, yyssp
);
2605 /* Now `shift' the result of the reduction. Determine what state
2606 that goes to, based on the state we popped back to and the rule
2607 number reduced by. */
2611 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2612 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2613 yystate
= yytable
[yystate
];
2615 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2620 /*------------------------------------.
2621 | yyerrlab -- here on detecting error |
2622 `------------------------------------*/
2624 /* If not already recovering from an error, report this error. */
2628 #if ! YYERROR_VERBOSE
2629 yyerror (YY_("syntax error"));
2632 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2633 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2635 YYSIZE_T yyalloc
= 2 * yysize
;
2636 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2637 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2638 if (yymsg
!= yymsgbuf
)
2639 YYSTACK_FREE (yymsg
);
2640 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2642 yymsg_alloc
= yyalloc
;
2646 yymsg_alloc
= sizeof yymsgbuf
;
2650 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2652 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2657 yyerror (YY_("syntax error"));
2659 goto yyexhaustedlab
;
2665 yyerror_range
[0] = yylloc
;
2667 if (yyerrstatus
== 3)
2669 /* If just tried and failed to reuse lookahead token after an
2670 error, discard it. */
2672 if (yychar
<= YYEOF
)
2674 /* Return failure if at end of input. */
2675 if (yychar
== YYEOF
)
2680 yydestruct ("Error: discarding",
2681 yytoken
, &yylval
, &yylloc
);
2686 /* Else will try to reuse lookahead token after shifting the error
2691 /*---------------------------------------------------.
2692 | yyerrorlab -- error raised explicitly by YYERROR. |
2693 `---------------------------------------------------*/
2696 /* Pacify compilers like GCC when the user code never invokes
2697 YYERROR and the label yyerrorlab therefore never appears in user
2699 if (/*CONSTCOND*/ 0)
2702 yyerror_range
[0] = yylsp
[1-yylen
];
2703 /* Do not reclaim the symbols of the rule which action triggered
2707 YY_STACK_PRINT (yyss
, yyssp
);
2712 /*-------------------------------------------------------------.
2713 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2714 `-------------------------------------------------------------*/
2716 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2720 yyn
= yypact
[yystate
];
2721 if (yyn
!= YYPACT_NINF
)
2724 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2732 /* Pop the current state because it cannot handle the error token. */
2736 yyerror_range
[0] = *yylsp
;
2737 yydestruct ("Error: popping",
2738 yystos
[yystate
], yyvsp
, yylsp
);
2741 YY_STACK_PRINT (yyss
, yyssp
);
2746 yyerror_range
[1] = yylloc
;
2747 /* Using YYLLOC is tempting, but would change the location of
2748 the lookahead. YYLOC is available though. */
2749 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2752 /* Shift the error token. */
2753 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2759 /*-------------------------------------.
2760 | yyacceptlab -- YYACCEPT comes here. |
2761 `-------------------------------------*/
2766 /*-----------------------------------.
2767 | yyabortlab -- YYABORT comes here. |
2768 `-----------------------------------*/
2774 /*-------------------------------------------------.
2775 | yyexhaustedlab -- memory exhaustion comes here. |
2776 `-------------------------------------------------*/
2778 yyerror (YY_("memory exhausted"));
2784 if (yychar
!= YYEMPTY
)
2785 yydestruct ("Cleanup: discarding lookahead",
2786 yytoken
, &yylval
, &yylloc
);
2787 /* Do not reclaim the symbols of the rule which action triggered
2788 this YYABORT or YYACCEPT. */
2790 YY_STACK_PRINT (yyss
, yyssp
);
2791 while (yyssp
!= yyss
)
2793 yydestruct ("Cleanup: popping",
2794 yystos
[*yyssp
], yyvsp
, yylsp
);
2799 YYSTACK_FREE (yyss
);
2802 if (yymsg
!= yymsgbuf
)
2803 YYSTACK_FREE (yymsg
);
2805 /* Make sure YYID is used. */
2806 return YYID (yyresult
);
2811 /* Line 1486 of yacc.c */
2812 #line 577 "parse-gram.y"
2816 /* Return the location of the left-hand side of a rule whose
2817 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2818 the right-hand side, and return an empty location equal to the end
2819 boundary of RHS[0] if the right-hand side is empty. */
2822 lloc_default (YYLTYPE
const *rhs
, int n
)
2827 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2828 The bug is fixed in 7.4.2m, but play it safe for now. */
2829 loc
.start
= rhs
[n
].end
;
2830 loc
.end
= rhs
[n
].end
;
2832 /* Ignore empty nonterminals the start of the the right-hand side.
2833 Do not bother to ignore them at the end of the right-hand side,
2834 since empty nonterminals have the same end as their predecessors. */
2835 for (i
= 1; i
<= n
; i
++)
2836 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2838 loc
.start
= rhs
[i
].start
;
2846 /* Add a lex-param or a parse-param (depending on TYPE) with
2847 declaration DECL and location LOC. */
2850 add_param (char const *type
, char *decl
, location loc
)
2852 static char const alphanum
[26 + 26 + 1 + 10] =
2853 "abcdefghijklmnopqrstuvwxyz"
2854 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2857 char const *name_start
= NULL
;
2860 /* Stop on last actual character. */
2861 for (p
= decl
; p
[1]; p
++)
2863 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2864 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2867 /* Strip the surrounding '{' and '}', and any blanks just inside
2869 while (*--p
== ' ' || *p
== '\t')
2872 while (*++decl
== ' ' || *decl
== '\t')
2876 complain_at (loc
, _("missing identifier in parameter declaration"));
2883 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2887 name
= xmalloc (name_len
+ 1);
2888 memcpy (name
, name_start
, name_len
);
2889 name
[name_len
] = '\0';
2890 muscle_pair_list_grow (type
, decl
, name
);
2894 gram_scanner_last_string_free ();
2899 version_check (location
const *loc
, char const *version
)
2901 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2903 complain_at (*loc
, "require bison %s, but have %s",
2904 version
, PACKAGE_VERSION
);
2910 gram_error (location
const *loc
, char const *msg
)
2912 complain_at (*loc
, "%s", msg
);
2916 token_name (int type
)
2918 return yytname
[YYTRANSLATE (type
)];
2929 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2930 return quotearg_style (escape_quoting_style
, buf
);