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 171 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 171 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,
203 PERCENT_DEFAULT_PREC
= 273,
204 PERCENT_DEFINE
= 274,
205 PERCENT_DEFINES
= 275,
206 PERCENT_ERROR_VERBOSE
= 276,
207 PERCENT_EXPECT
= 277,
208 PERCENT_EXPECT_RR
= 278,
209 PERCENT_FILE_PREFIX
= 279,
210 PERCENT_GLR_PARSER
= 280,
211 PERCENT_INITIAL_ACTION
= 281,
212 PERCENT_LANGUAGE
= 282,
213 PERCENT_LEX_PARAM
= 283,
214 PERCENT_LOCATIONS
= 284,
215 PERCENT_NAME_PREFIX
= 285,
216 PERCENT_NO_DEFAULT_PREC
= 286,
217 PERCENT_NO_LINES
= 287,
218 PERCENT_NONDETERMINISTIC_PARSER
= 288,
219 PERCENT_OUTPUT
= 289,
220 PERCENT_PARSE_PARAM
= 290,
221 PERCENT_PURE_PARSER
= 291,
222 PERCENT_PUSH_PARSER
= 292,
223 PERCENT_PUSH_PULL_PARSER
= 293,
224 PERCENT_REQUIRE
= 294,
225 PERCENT_SKELETON
= 295,
227 PERCENT_TOKEN_TABLE
= 297,
228 PERCENT_VERBOSE
= 298,
236 PERCENT_PERCENT
= 306,
250 #define PERCENT_TOKEN 260
251 #define PERCENT_NTERM 261
252 #define PERCENT_TYPE 262
253 #define PERCENT_DESTRUCTOR 263
254 #define PERCENT_PRINTER 264
255 #define PERCENT_LEFT 265
256 #define PERCENT_RIGHT 266
257 #define PERCENT_NONASSOC 267
258 #define PERCENT_PREC 268
259 #define PERCENT_DPREC 269
260 #define PERCENT_MERGE 270
261 #define PERCENT_CODE 271
262 #define PERCENT_DEBUG 272
263 #define PERCENT_DEFAULT_PREC 273
264 #define PERCENT_DEFINE 274
265 #define PERCENT_DEFINES 275
266 #define PERCENT_ERROR_VERBOSE 276
267 #define PERCENT_EXPECT 277
268 #define PERCENT_EXPECT_RR 278
269 #define PERCENT_FILE_PREFIX 279
270 #define PERCENT_GLR_PARSER 280
271 #define PERCENT_INITIAL_ACTION 281
272 #define PERCENT_LANGUAGE 282
273 #define PERCENT_LEX_PARAM 283
274 #define PERCENT_LOCATIONS 284
275 #define PERCENT_NAME_PREFIX 285
276 #define PERCENT_NO_DEFAULT_PREC 286
277 #define PERCENT_NO_LINES 287
278 #define PERCENT_NONDETERMINISTIC_PARSER 288
279 #define PERCENT_OUTPUT 289
280 #define PERCENT_PARSE_PARAM 290
281 #define PERCENT_PURE_PARSER 291
282 #define PERCENT_PUSH_PARSER 292
283 #define PERCENT_PUSH_PULL_PARSER 293
284 #define PERCENT_REQUIRE 294
285 #define PERCENT_SKELETON 295
286 #define PERCENT_START 296
287 #define PERCENT_TOKEN_TABLE 297
288 #define PERCENT_VERBOSE 298
289 #define PERCENT_YACC 299
290 #define BRACED_CODE 300
296 #define PERCENT_PERCENT 306
299 #define SEMICOLON 309
301 #define TYPE_TAG_ANY 311
302 #define TYPE_TAG_NONE 312
303 #define PERCENT_UNION 313
308 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
309 typedef union YYSTYPE
311 /* Line 205 of yacc.c */
312 #line 98 "parse-gram.y"
321 unsigned char character
;
324 /* Line 205 of yacc.c */
325 #line 326 "parse-gram.c"
327 # define YYSTYPE_IS_TRIVIAL 1
328 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
329 # define YYSTYPE_IS_DECLARED 1
332 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
333 typedef struct YYLTYPE
340 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
341 # define YYLTYPE_IS_DECLARED 1
342 # define YYLTYPE_IS_TRIVIAL 1
346 /* Copy the second part of user declarations. */
349 /* Line 228 of yacc.c */
350 #line 351 "parse-gram.c"
357 typedef YYTYPE_UINT8 yytype_uint8
;
359 typedef unsigned char yytype_uint8
;
363 typedef YYTYPE_INT8 yytype_int8
;
364 #elif (defined __STDC__ || defined __C99__FUNC__ \
365 || defined __cplusplus || defined _MSC_VER)
366 typedef signed char yytype_int8
;
368 typedef short int yytype_int8
;
372 typedef YYTYPE_UINT16 yytype_uint16
;
374 typedef unsigned short int yytype_uint16
;
378 typedef YYTYPE_INT16 yytype_int16
;
380 typedef short int yytype_int16
;
384 # ifdef __SIZE_TYPE__
385 # define YYSIZE_T __SIZE_TYPE__
386 # elif defined size_t
387 # define YYSIZE_T size_t
388 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
389 || defined __cplusplus || defined _MSC_VER)
390 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
391 # define YYSIZE_T size_t
393 # define YYSIZE_T unsigned int
397 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
402 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
403 # define YY_(msgid) dgettext ("bison-runtime", msgid)
407 # define YY_(msgid) msgid
411 /* Suppress unused-variable warnings by "using" E. */
412 #if ! defined lint || defined __GNUC__
413 # define YYUSE(e) ((void) (e))
415 # define YYUSE(e) /* empty */
418 /* Identity function, used to suppress warnings about constant conditions. */
422 #if (defined __STDC__ || defined __C99__FUNC__ \
423 || defined __cplusplus || defined _MSC_VER)
436 #if ! defined yyoverflow || YYERROR_VERBOSE
438 /* The parser invokes alloca or malloc; define the necessary symbols. */
440 # ifdef YYSTACK_USE_ALLOCA
441 # if YYSTACK_USE_ALLOCA
443 # define YYSTACK_ALLOC __builtin_alloca
444 # elif defined __BUILTIN_VA_ARG_INCR
445 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
447 # define YYSTACK_ALLOC __alloca
448 # elif defined _MSC_VER
449 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
450 # define alloca _alloca
452 # define YYSTACK_ALLOC alloca
453 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
454 || defined __cplusplus || defined _MSC_VER)
455 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
464 # ifdef YYSTACK_ALLOC
465 /* Pacify GCC's `empty if-body' warning. */
466 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
467 # ifndef YYSTACK_ALLOC_MAXIMUM
468 /* The OS might guarantee only one guard page at the bottom of the stack,
469 and a page size can be as small as 4096 bytes. So we cannot safely
470 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
471 to allow for a few compiler-allocated temporary stack slots. */
472 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
475 # define YYSTACK_ALLOC YYMALLOC
476 # define YYSTACK_FREE YYFREE
477 # ifndef YYSTACK_ALLOC_MAXIMUM
478 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
480 # if (defined __cplusplus && ! defined _STDLIB_H \
481 && ! ((defined YYMALLOC || defined malloc) \
482 && (defined YYFREE || defined free)))
483 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
489 # define YYMALLOC malloc
490 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
491 || defined __cplusplus || defined _MSC_VER)
492 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
497 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
498 || defined __cplusplus || defined _MSC_VER)
499 void free (void *); /* INFRINGES ON USER NAME SPACE */
503 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
506 #if (! defined yyoverflow \
507 && (! defined __cplusplus \
508 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
509 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
511 /* A type that is properly aligned for any stack member. */
519 /* The size of the maximum gap between one aligned stack and the next. */
520 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
522 /* The size of an array large to enough to hold all stacks, each with
524 # define YYSTACK_BYTES(N) \
525 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
526 + 2 * YYSTACK_GAP_MAXIMUM)
528 /* Copy COUNT objects from FROM to TO. The source and destination do
531 # if defined __GNUC__ && 1 < __GNUC__
532 # define YYCOPY(To, From, Count) \
533 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
535 # define YYCOPY(To, From, Count) \
539 for (yyi = 0; yyi < (Count); yyi++) \
540 (To)[yyi] = (From)[yyi]; \
546 /* Relocate STACK from its old location to the new one. The
547 local variables YYSIZE and YYSTACKSIZE give the old and new number of
548 elements in the stack, and YYPTR gives the new location of the
549 stack. Advance YYPTR to a properly aligned location for the next
551 # define YYSTACK_RELOCATE(Stack) \
554 YYSIZE_T yynewbytes; \
555 YYCOPY (&yyptr->Stack, Stack, yysize); \
556 Stack = &yyptr->Stack; \
557 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
558 yyptr += yynewbytes / sizeof (*yyptr); \
564 /* YYFINAL -- State number of the termination state. */
566 /* YYLAST -- Last index in YYTABLE. */
569 /* YYNTOKENS -- Number of terminals. */
571 /* YYNNTS -- Number of nonterminals. */
573 /* YYNRULES -- Number of rules. */
575 /* YYNRULES -- Number of states. */
576 #define YYNSTATES 141
578 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
580 #define YYMAXUTOK 313
582 #define YYTRANSLATE(YYX) \
583 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
585 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
586 static const yytype_uint8 yytranslate
[] =
588 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
614 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
615 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
616 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
617 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
618 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
623 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
625 static const yytype_uint16 yyprhs
[] =
627 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
628 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
629 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
630 80, 82, 85, 88, 90, 92, 94, 96, 98, 100,
631 103, 107, 111, 113, 115, 118, 122, 123, 125, 129,
632 130, 134, 135, 139, 143, 147, 149, 151, 153, 154,
633 156, 158, 161, 163, 166, 168, 170, 172, 174, 176,
634 178, 181, 184, 188, 190, 193, 195, 198, 200, 203,
635 206, 207, 211, 213, 217, 220, 221, 224, 227, 231,
636 235, 239, 241, 243, 244, 246, 248, 250, 252, 254,
640 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
641 static const yytype_int8 yyrhs
[] =
643 60, 0, -1, 61, 51, 76, 89, -1, -1, 61,
644 62, -1, 63, -1, 53, -1, 17, -1, 19, 3,
645 83, -1, 20, -1, 20, 3, -1, 21, -1, 22,
646 4, -1, 23, 4, -1, 24, 3, -1, 24, 48,
647 3, -1, 25, -1, 26, 45, -1, 27, 3, -1,
648 28, 45, -1, 29, -1, 30, 3, -1, 30, 48,
649 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
650 48, 3, -1, 35, 45, -1, 36, -1, 37, -1,
651 38, -1, 39, 3, -1, 40, 3, -1, 42, -1,
652 43, -1, 44, -1, 54, -1, 68, -1, 65, -1,
653 41, 87, -1, 8, 45, 72, -1, 9, 45, 72,
654 -1, 18, -1, 31, -1, 16, 84, -1, 16, 3,
655 84, -1, -1, 49, -1, 58, 64, 45, -1, -1,
656 6, 66, 75, -1, -1, 5, 67, 75, -1, 7,
657 55, 71, -1, 69, 70, 71, -1, 10, -1, 11,
658 -1, 12, -1, -1, 55, -1, 87, -1, 71, 87,
659 -1, 73, -1, 72, 73, -1, 87, -1, 55, -1,
660 56, -1, 57, -1, 55, -1, 85, -1, 85, 4,
661 -1, 85, 88, -1, 85, 4, 88, -1, 74, -1,
662 75, 74, -1, 77, -1, 76, 77, -1, 78, -1,
663 63, 54, -1, 1, 54, -1, -1, 86, 79, 80,
664 -1, 81, -1, 80, 52, 81, -1, 80, 54, -1,
665 -1, 81, 87, -1, 81, 45, -1, 81, 13, 87,
666 -1, 81, 14, 4, -1, 81, 15, 55, -1, 3,
667 -1, 84, -1, -1, 82, -1, 45, -1, 49, -1,
668 46, -1, 50, -1, 85, -1, 88, -1, 3, -1,
672 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
673 static const yytype_uint16 yyrline
[] =
675 0, 211, 211, 219, 221, 225, 226, 235, 236, 237,
676 238, 243, 244, 245, 246, 247, 248, 253, 262, 263,
677 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
678 274, 275, 276, 277, 278, 279, 280, 284, 285, 286,
679 290, 297, 304, 308, 312, 317, 338, 339, 343, 372,
680 372, 377, 377, 382, 393, 408, 409, 410, 414, 415,
681 420, 422, 427, 428, 432, 433, 434, 435, 440, 445,
682 450, 456, 462, 473, 474, 483, 484, 490, 491, 492,
683 499, 499, 503, 504, 505, 510, 511, 513, 515, 517,
684 519, 529, 530, 536, 540, 545, 565, 567, 576, 581,
689 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
690 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
691 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
692 static const char *const yytname
[] =
694 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
695 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
696 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
697 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
698 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
699 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
700 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
701 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
702 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
703 "\"%parse-param\"", "\"%pure-parser\"", "\"%push-parser\"",
704 "\"%push-pull-parser\"", "\"%require\"", "\"%skeleton\"", "\"%start\"",
705 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"",
706 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
707 "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"", "\"<*>\"", "\"<>\"",
708 "\"%union\"", "$accept", "input", "prologue_declarations",
709 "prologue_declaration", "grammar_declaration", "union_name",
710 "symbol_declaration", "$@1", "$@2", "precedence_declaration",
711 "precedence_declarator", "type.opt", "symbols.1", "generic_symlist",
712 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
713 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
714 "content", "content.opt", "braceless", "id", "id_colon", "symbol",
715 "string_as_id", "epilogue.opt", 0
720 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
722 static const yytype_uint16 yytoknum
[] =
724 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
725 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
726 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
727 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
728 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
729 305, 306, 307, 308, 309, 310, 311, 312, 313
733 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
734 static const yytype_uint8 yyr1
[] =
736 0, 59, 60, 61, 61, 62, 62, 62, 62, 62,
737 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
738 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
739 62, 62, 62, 62, 62, 62, 62, 63, 63, 63,
740 63, 63, 63, 63, 63, 63, 64, 64, 63, 66,
741 65, 67, 65, 65, 68, 69, 69, 69, 70, 70,
742 71, 71, 72, 72, 73, 73, 73, 73, 74, 74,
743 74, 74, 74, 75, 75, 76, 76, 77, 77, 77,
744 79, 78, 80, 80, 80, 81, 81, 81, 81, 81,
745 81, 82, 82, 83, 83, 84, 85, 85, 86, 87,
749 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
750 static const yytype_uint8 yyr2
[] =
752 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
753 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
754 1, 2, 3, 1, 1, 2, 3, 2, 1, 1,
755 1, 2, 2, 1, 1, 1, 1, 1, 1, 2,
756 3, 3, 1, 1, 2, 3, 0, 1, 3, 0,
757 3, 0, 3, 3, 3, 1, 1, 1, 0, 1,
758 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
759 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
760 0, 3, 1, 3, 2, 0, 2, 2, 3, 3,
761 3, 1, 1, 0, 1, 1, 1, 1, 1, 1,
765 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
766 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
767 means the default is an error. */
768 static const yytype_uint8 yydefact
[] =
770 3, 0, 0, 1, 51, 49, 0, 0, 0, 55,
771 56, 57, 0, 7, 42, 0, 9, 11, 0, 0,
772 0, 16, 0, 0, 0, 20, 0, 43, 23, 24,
773 0, 0, 28, 29, 30, 0, 0, 0, 33, 34,
774 35, 0, 6, 36, 46, 4, 5, 38, 37, 58,
775 0, 0, 0, 0, 0, 0, 95, 44, 93, 10,
776 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
777 0, 27, 31, 32, 101, 97, 96, 99, 39, 100,
778 0, 98, 0, 0, 75, 77, 80, 47, 0, 59,
779 0, 68, 73, 52, 69, 50, 53, 60, 65, 66,
780 67, 40, 62, 64, 41, 45, 91, 94, 8, 92,
781 15, 22, 26, 79, 78, 0, 76, 2, 85, 48,
782 54, 74, 70, 71, 61, 63, 103, 81, 82, 72,
783 85, 84, 0, 0, 0, 87, 86, 83, 88, 89,
787 /* YYDEFGOTO[NTERM-NUM]. */
788 static const yytype_int16 yydefgoto
[] =
790 -1, 1, 2, 45, 82, 88, 47, 51, 50, 48,
791 49, 90, 96, 101, 102, 92, 93, 83, 84, 85,
792 118, 127, 128, 107, 108, 57, 77, 86, 103, 79,
796 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
798 #define YYPACT_NINF -93
799 static const yytype_int16 yypact
[] =
801 -93, 14, 96, -93, -93, -93, -4, 20, 30, -93,
802 -93, -93, 21, -93, -93, 73, 75, -93, 76, 77,
803 6, -93, 34, 79, 39, -93, 22, -93, -93, -93,
804 23, 41, -93, -93, -93, 84, 85, -2, -93, -93,
805 -93, 27, -93, -93, 40, -93, -93, -93, -93, 35,
806 -42, -42, -2, 0, 0, 47, -93, -93, 28, -93,
807 -93, -93, -93, 90, -93, -93, -93, -93, 91, -93,
808 93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
809 43, -93, 44, 11, -93, -93, -93, -93, 54, -93,
810 -2, -93, -93, -42, 37, -42, -2, -93, -93, -93,
811 -93, 0, -93, -93, 0, -93, -93, -93, -93, -93,
812 -93, -93, -93, -93, -93, 62, -93, -93, -93, -93,
813 -2, -93, 107, -93, -93, -93, -93, -44, 138, -93,
814 -93, -93, -2, 139, 56, -93, -93, 138, -93, -93,
818 /* YYPGOTO[NTERM-NUM]. */
819 static const yytype_int16 yypgoto
[] =
821 -93, -93, -93, -93, 140, -93, -93, -93, -93, -93,
822 -93, -93, 55, 92, -41, -21, 97, -93, 61, -93,
823 -93, -93, 25, -93, -93, 9, -45, -93, -37, -92,
827 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
828 positive, shift that token. If negative, reduce the rule which
829 number is the opposite. If zero, do what YYDEFACT says.
830 If YYTABLE_NINF, syntax error. */
831 #define YYTABLE_NINF -103
832 static const yytype_int16 yytable
[] =
834 78, 74, 123, 74, 75, 94, 94, 76, 130, 62,
835 131, -102, 80, 91, 3, 97, 4, 5, 6, 7,
836 8, 9, 10, 11, 55, 67, 69, 12, 80, 14,
837 129, 106, 4, 5, 6, 7, 8, 9, 10, 11,
838 74, 122, 27, 12, 75, 14, 75, 76, 94, 76,
839 94, 52, 37, 97, 63, 98, 99, 100, 27, 124,
840 125, 81, 115, 125, 105, 53, 56, 109, 37, 44,
841 68, 70, 121, 56, 121, 54, 58, 81, 59, 64,
842 60, 61, 65, 124, 66, 44, 71, 72, 73, 87,
843 89, 136, 56, 110, 111, 138, 112, 113, 114, 119,
844 136, 4, 5, 6, 7, 8, 9, 10, 11, 126,
845 74, 140, 12, 13, 14, 15, 16, 17, 18, 19,
846 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
847 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
848 40, 74, 46, 139, 116, 120, 104, 41, 95, 42,
849 43, 132, 133, 134, 44, 137, 0, 0, 0, 0,
850 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
851 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
852 0, 0, 0, 135, 75, 0, 0, 76
855 static const yytype_int16 yycheck
[] =
857 37, 3, 94, 3, 46, 50, 51, 49, 52, 3,
858 54, 0, 1, 55, 0, 52, 5, 6, 7, 8,
859 9, 10, 11, 12, 3, 3, 3, 16, 1, 18,
860 122, 3, 5, 6, 7, 8, 9, 10, 11, 12,
861 3, 4, 31, 16, 46, 18, 46, 49, 93, 49,
862 95, 55, 41, 90, 48, 55, 56, 57, 31, 96,
863 101, 50, 51, 104, 55, 45, 45, 58, 41, 58,
864 48, 48, 93, 45, 95, 45, 3, 50, 3, 45,
865 4, 4, 3, 120, 45, 58, 45, 3, 3, 49,
866 55, 128, 45, 3, 3, 132, 3, 54, 54, 45,
867 137, 5, 6, 7, 8, 9, 10, 11, 12, 47,
868 3, 55, 16, 17, 18, 19, 20, 21, 22, 23,
869 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
870 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
871 44, 3, 2, 4, 83, 90, 54, 51, 51, 53,
872 54, 13, 14, 15, 58, 130, -1, -1, -1, -1,
873 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
874 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
875 -1, -1, -1, 45, 46, -1, -1, 49
878 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
879 symbol of state STATE-NUM. */
880 static const yytype_uint8 yystos
[] =
882 0, 60, 61, 0, 5, 6, 7, 8, 9, 10,
883 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
884 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
885 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
886 44, 51, 53, 54, 58, 62, 63, 65, 68, 69,
887 67, 66, 55, 45, 45, 3, 45, 84, 3, 3,
888 4, 4, 3, 48, 45, 3, 45, 3, 48, 3,
889 48, 45, 3, 3, 3, 46, 49, 85, 87, 88,
890 1, 50, 63, 76, 77, 78, 86, 49, 64, 55,
891 70, 55, 74, 75, 85, 75, 71, 87, 55, 56,
892 57, 72, 73, 87, 72, 84, 3, 82, 83, 84,
893 3, 3, 3, 54, 54, 51, 77, 89, 79, 45,
894 71, 74, 4, 88, 87, 73, 47, 80, 81, 88,
895 52, 54, 13, 14, 15, 45, 87, 81, 87, 4,
899 #define yyerrok (yyerrstatus = 0)
900 #define yyclearin (yychar = YYEMPTY)
904 #define YYACCEPT goto yyacceptlab
905 #define YYABORT goto yyabortlab
906 #define YYERROR goto yyerrorlab
909 /* Like YYERROR except do call yyerror. This remains here temporarily
910 to ease the transition to the new meaning of YYERROR, for GCC.
911 Once GCC version 2 has supplanted version 1, this can go. */
913 #define YYFAIL goto yyerrlab
915 #define YYRECOVERING() (!!yyerrstatus)
917 #define YYBACKUP(Token, Value) \
919 if (yychar == YYEMPTY && yylen == 1) \
923 yytoken = YYTRANSLATE (yychar); \
929 yyerror (YY_("syntax error: cannot back up")); \
936 #define YYERRCODE 256
939 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
940 If N is 0, then set CURRENT to the empty location which ends
941 the previous symbol: RHS[0] (always defined). */
943 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
944 #ifndef YYLLOC_DEFAULT
945 # define YYLLOC_DEFAULT(Current, Rhs, N) \
949 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
950 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
951 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
952 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
956 (Current).first_line = (Current).last_line = \
957 YYRHSLOC (Rhs, 0).last_line; \
958 (Current).first_column = (Current).last_column = \
959 YYRHSLOC (Rhs, 0).last_column; \
965 /* YY_LOCATION_PRINT -- Print the location on the stream.
966 This macro was not mandated originally: define only if we know
967 we won't break user code: when these are the locations we know. */
969 #ifndef YY_LOCATION_PRINT
970 # if YYLTYPE_IS_TRIVIAL
971 # define YY_LOCATION_PRINT(File, Loc) \
972 fprintf (File, "%d.%d-%d.%d", \
973 (Loc).first_line, (Loc).first_column, \
974 (Loc).last_line, (Loc).last_column)
976 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
981 /* YYLEX -- calling `yylex' with the right arguments. */
984 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
986 # define YYLEX yylex (&yylval, &yylloc)
989 /* Enable debugging if requested. */
993 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
994 # define YYFPRINTF fprintf
997 # define YYDPRINTF(Args) \
1003 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1007 YYFPRINTF (stderr, "%s ", Title); \
1008 yy_symbol_print (stderr, \
1009 Type, Value, Location); \
1010 YYFPRINTF (stderr, "\n"); \
1015 /*--------------------------------.
1016 | Print this symbol on YYOUTPUT. |
1017 `--------------------------------*/
1020 #if (defined __STDC__ || defined __C99__FUNC__ \
1021 || defined __cplusplus || defined _MSC_VER)
1023 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1026 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1029 YYSTYPE
const * const yyvaluep
;
1030 YYLTYPE
const * const yylocationp
;
1035 YYUSE (yylocationp
);
1037 if (yytype
< YYNTOKENS
)
1038 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1044 case 3: /* "\"string\"" */
1046 /* Line 681 of yacc.c */
1047 #line 189 "parse-gram.y"
1048 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1050 /* Line 681 of yacc.c */
1051 #line 1052 "parse-gram.c"
1053 case 4: /* "\"integer\"" */
1055 /* Line 681 of yacc.c */
1056 #line 200 "parse-gram.y"
1057 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1059 /* Line 681 of yacc.c */
1060 #line 1061 "parse-gram.c"
1062 case 45: /* "\"{...}\"" */
1064 /* Line 681 of yacc.c */
1065 #line 191 "parse-gram.y"
1066 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1068 /* Line 681 of yacc.c */
1069 #line 1070 "parse-gram.c"
1071 case 46: /* "\"char\"" */
1073 /* Line 681 of yacc.c */
1074 #line 183 "parse-gram.y"
1075 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1077 /* Line 681 of yacc.c */
1078 #line 1079 "parse-gram.c"
1080 case 47: /* "\"epilogue\"" */
1082 /* Line 681 of yacc.c */
1083 #line 191 "parse-gram.y"
1084 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1086 /* Line 681 of yacc.c */
1087 #line 1088 "parse-gram.c"
1089 case 49: /* "\"identifier\"" */
1091 /* Line 681 of yacc.c */
1092 #line 196 "parse-gram.y"
1093 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1095 /* Line 681 of yacc.c */
1096 #line 1097 "parse-gram.c"
1098 case 50: /* "\"identifier:\"" */
1100 /* Line 681 of yacc.c */
1101 #line 197 "parse-gram.y"
1102 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1104 /* Line 681 of yacc.c */
1105 #line 1106 "parse-gram.c"
1107 case 53: /* "\"%{...%}\"" */
1109 /* Line 681 of yacc.c */
1110 #line 191 "parse-gram.y"
1111 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1113 /* Line 681 of yacc.c */
1114 #line 1115 "parse-gram.c"
1116 case 55: /* "\"type\"" */
1118 /* Line 681 of yacc.c */
1119 #line 195 "parse-gram.y"
1120 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1122 /* Line 681 of yacc.c */
1123 #line 1124 "parse-gram.c"
1125 case 82: /* "content" */
1127 /* Line 681 of yacc.c */
1128 #line 191 "parse-gram.y"
1129 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1131 /* Line 681 of yacc.c */
1132 #line 1133 "parse-gram.c"
1134 case 83: /* "content.opt" */
1136 /* Line 681 of yacc.c */
1137 #line 191 "parse-gram.y"
1138 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1140 /* Line 681 of yacc.c */
1141 #line 1142 "parse-gram.c"
1143 case 84: /* "braceless" */
1145 /* Line 681 of yacc.c */
1146 #line 191 "parse-gram.y"
1147 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1149 /* Line 681 of yacc.c */
1150 #line 1151 "parse-gram.c"
1154 /* Line 681 of yacc.c */
1155 #line 203 "parse-gram.y"
1156 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1158 /* Line 681 of yacc.c */
1159 #line 1160 "parse-gram.c"
1161 case 86: /* "id_colon" */
1163 /* Line 681 of yacc.c */
1164 #line 204 "parse-gram.y"
1165 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1167 /* Line 681 of yacc.c */
1168 #line 1169 "parse-gram.c"
1170 case 87: /* "symbol" */
1172 /* Line 681 of yacc.c */
1173 #line 203 "parse-gram.y"
1174 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1176 /* Line 681 of yacc.c */
1177 #line 1178 "parse-gram.c"
1179 case 88: /* "string_as_id" */
1181 /* Line 681 of yacc.c */
1182 #line 203 "parse-gram.y"
1183 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1185 /* Line 681 of yacc.c */
1186 #line 1187 "parse-gram.c"
1194 /*--------------------------------.
1195 | Print this symbol on YYOUTPUT. |
1196 `--------------------------------*/
1198 #if (defined __STDC__ || defined __C99__FUNC__ \
1199 || defined __cplusplus || defined _MSC_VER)
1201 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1204 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1207 YYSTYPE
const * const yyvaluep
;
1208 YYLTYPE
const * const yylocationp
;
1211 if (yytype
< YYNTOKENS
)
1212 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1214 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1216 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1217 YYFPRINTF (yyoutput
, ": ");
1218 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1219 YYFPRINTF (yyoutput
, ")");
1222 /*------------------------------------------------------------------.
1223 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1225 `------------------------------------------------------------------*/
1227 #if (defined __STDC__ || defined __C99__FUNC__ \
1228 || defined __cplusplus || defined _MSC_VER)
1230 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1233 yy_stack_print (yybottom
, yytop
)
1234 yytype_int16
*yybottom
;
1235 yytype_int16
*yytop
;
1238 YYFPRINTF (stderr
, "Stack now");
1239 for (; yybottom
<= yytop
; yybottom
++)
1241 int yybot
= *yybottom
;
1242 YYFPRINTF (stderr
, " %d", yybot
);
1244 YYFPRINTF (stderr
, "\n");
1247 # define YY_STACK_PRINT(Bottom, Top) \
1250 yy_stack_print ((Bottom), (Top)); \
1254 /*------------------------------------------------.
1255 | Report that the YYRULE is going to be reduced. |
1256 `------------------------------------------------*/
1258 #if (defined __STDC__ || defined __C99__FUNC__ \
1259 || defined __cplusplus || defined _MSC_VER)
1261 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1264 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1270 int yynrhs
= yyr2
[yyrule
];
1272 unsigned long int yylno
= yyrline
[yyrule
];
1273 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1275 /* The symbols being reduced. */
1276 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1278 fprintf (stderr
, " $%d = ", yyi
+ 1);
1279 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1280 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1281 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1282 fprintf (stderr
, "\n");
1286 # define YY_REDUCE_PRINT(Rule) \
1289 yy_reduce_print (yyvsp, yylsp, Rule); \
1292 /* Nonzero means print parse trace. It is left uninitialized so that
1293 multiple parsers can coexist. */
1295 #else /* !YYDEBUG */
1296 # define YYDPRINTF(Args)
1297 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1298 # define YY_STACK_PRINT(Bottom, Top)
1299 # define YY_REDUCE_PRINT(Rule)
1300 #endif /* !YYDEBUG */
1303 /* YYINITDEPTH -- initial size of the parser's stacks. */
1305 # define YYINITDEPTH 200
1308 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1309 if the built-in stack extension method is used).
1311 Do not make this value too large; the results are undefined if
1312 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1313 evaluated with infinite-precision integer arithmetic. */
1316 # define YYMAXDEPTH 10000
1324 # if defined __GLIBC__ && defined _STRING_H
1325 # define yystrlen strlen
1327 /* Return the length of YYSTR. */
1328 #if (defined __STDC__ || defined __C99__FUNC__ \
1329 || defined __cplusplus || defined _MSC_VER)
1331 yystrlen (const char *yystr
)
1339 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1347 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1348 # define yystpcpy stpcpy
1350 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1352 #if (defined __STDC__ || defined __C99__FUNC__ \
1353 || defined __cplusplus || defined _MSC_VER)
1355 yystpcpy (char *yydest
, const char *yysrc
)
1358 yystpcpy (yydest
, yysrc
)
1364 const char *yys
= yysrc
;
1366 while ((*yyd
++ = *yys
++) != '\0')
1375 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1376 quotes and backslashes, so that it's suitable for yyerror. The
1377 heuristic is that double-quoting is unnecessary unless the string
1378 contains an apostrophe, a comma, or backslash (other than
1379 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1380 null, do not copy; instead, return the length of what the result
1383 yytnamerr (char *yyres
, const char *yystr
)
1388 char const *yyp
= yystr
;
1395 goto do_not_strip_quotes
;
1399 goto do_not_strip_quotes
;
1412 do_not_strip_quotes
: ;
1416 return yystrlen (yystr
);
1418 return yystpcpy (yyres
, yystr
) - yyres
;
1422 /* Copy into YYRESULT an error message about the unexpected token
1423 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1424 including the terminating null byte. If YYRESULT is null, do not
1425 copy anything; just return the number of bytes that would be
1426 copied. As a special case, return 0 if an ordinary "syntax error"
1427 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1428 size calculation. */
1430 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1432 int yyn
= yypact
[yystate
];
1434 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1438 int yytype
= YYTRANSLATE (yychar
);
1439 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1440 YYSIZE_T yysize
= yysize0
;
1442 int yysize_overflow
= 0;
1443 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1444 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1448 /* This is so xgettext sees the translatable formats that are
1449 constructed on the fly. */
1450 YY_("syntax error, unexpected %s");
1451 YY_("syntax error, unexpected %s, expecting %s");
1452 YY_("syntax error, unexpected %s, expecting %s or %s");
1453 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1454 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1458 static char const yyunexpected
[] = "syntax error, unexpected %s";
1459 static char const yyexpecting
[] = ", expecting %s";
1460 static char const yyor
[] = " or %s";
1461 char yyformat
[sizeof yyunexpected
1462 + sizeof yyexpecting
- 1
1463 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1464 * (sizeof yyor
- 1))];
1465 char const *yyprefix
= yyexpecting
;
1467 /* Start YYX at -YYN if negative to avoid negative indexes in
1469 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1471 /* Stay within bounds of both yycheck and yytname. */
1472 int yychecklim
= YYLAST
- yyn
+ 1;
1473 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1476 yyarg
[0] = yytname
[yytype
];
1477 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1479 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1480 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1482 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1486 yyformat
[sizeof yyunexpected
- 1] = '\0';
1489 yyarg
[yycount
++] = yytname
[yyx
];
1490 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1491 yysize_overflow
|= (yysize1
< yysize
);
1493 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1497 yyf
= YY_(yyformat
);
1498 yysize1
= yysize
+ yystrlen (yyf
);
1499 yysize_overflow
|= (yysize1
< yysize
);
1502 if (yysize_overflow
)
1503 return YYSIZE_MAXIMUM
;
1507 /* Avoid sprintf, as that infringes on the user's name space.
1508 Don't have undefined behavior even if the translation
1509 produced a string with the wrong number of "%s"s. */
1510 char *yyp
= yyresult
;
1512 while ((*yyp
= *yyf
) != '\0')
1514 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1516 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1529 #endif /* YYERROR_VERBOSE */
1532 /*-----------------------------------------------.
1533 | Release the memory associated to this symbol. |
1534 `-----------------------------------------------*/
1537 #if (defined __STDC__ || defined __C99__FUNC__ \
1538 || defined __cplusplus || defined _MSC_VER)
1540 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1543 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1547 YYLTYPE
*yylocationp
;
1551 YYUSE (yylocationp
);
1555 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1566 /* Prevent warnings from -Wmissing-prototypes. */
1568 #ifdef YYPARSE_PARAM
1569 #if defined __STDC__ || defined __cplusplus
1570 int yyparse (void *YYPARSE_PARAM
);
1574 #else /* ! YYPARSE_PARAM */
1575 #if defined __STDC__ || defined __cplusplus
1580 #endif /* ! YYPARSE_PARAM */
1591 #ifdef YYPARSE_PARAM
1592 #if (defined __STDC__ || defined __C99__FUNC__ \
1593 || defined __cplusplus || defined _MSC_VER)
1595 yyparse (void *YYPARSE_PARAM
)
1598 yyparse (YYPARSE_PARAM
)
1599 void *YYPARSE_PARAM
;
1601 #else /* ! YYPARSE_PARAM */
1602 #if (defined __STDC__ || defined __C99__FUNC__ \
1603 || defined __cplusplus || defined _MSC_VER)
1613 /* The lookahead symbol. */
1616 /* The semantic value of the lookahead symbol. */
1619 /* Number of syntax errors so far. */
1621 /* Location data for the lookahead symbol. */
1627 /* Number of tokens to shift before error messages enabled. */
1629 /* Lookahead token as an internal (translated) token number. */
1632 /* Buffer for error messages, and its allocated size. */
1634 char *yymsg
= yymsgbuf
;
1635 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1638 /* Three stacks and their tools:
1639 `yyss': related to states,
1640 `yyvs': related to semantic values,
1641 `yyls': related to locations.
1643 Refer to the stacks thru separate pointers, to allow yyoverflow
1644 to reallocate them elsewhere. */
1646 /* The state stack. */
1647 yytype_int16 yyssa
[YYINITDEPTH
];
1648 yytype_int16
*yyss
= yyssa
;
1649 yytype_int16
*yyssp
;
1651 /* The semantic value stack. */
1652 YYSTYPE yyvsa
[YYINITDEPTH
];
1653 YYSTYPE
*yyvs
= yyvsa
;
1656 /* The location stack. */
1657 YYLTYPE yylsa
[YYINITDEPTH
];
1658 YYLTYPE
*yyls
= yylsa
;
1660 /* The locations where the error started and ended. */
1661 YYLTYPE yyerror_range
[2];
1663 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1665 YYSIZE_T yystacksize
= YYINITDEPTH
;
1667 /* The variables used to return semantic value and location from the
1672 /* The number of symbols on the RHS of the reduced rule.
1673 Keep to zero when no symbol should be popped. */
1676 YYDPRINTF ((stderr
, "Starting parse\n"));
1681 yychar
= YYEMPTY
; /* Cause a token to be read. */
1683 /* Initialize stack pointers.
1684 Waste one element of value and location stack
1685 so that they stay on the same level as the state stack.
1686 The wasted elements are never initialized. */
1691 #if YYLTYPE_IS_TRIVIAL
1692 /* Initialize the default location before parsing starts. */
1693 yylloc
.first_line
= yylloc
.last_line
= 1;
1694 yylloc
.first_column
= yylloc
.last_column
= 1;
1698 /* User initialization code. */
1700 /* Line 1093 of yacc.c */
1701 #line 90 "parse-gram.y"
1703 /* Bison's grammar can initial empty locations, hence a default
1704 location is needed. */
1705 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1706 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1709 /* Line 1093 of yacc.c */
1710 #line 1711 "parse-gram.c"
1714 /*------------------------------------------------------------.
1715 | yynewstate -- Push a new state, which is found in yystate. |
1716 `------------------------------------------------------------*/
1718 /* In all cases, when you get here, the value and location stacks
1719 have just been pushed. So pushing a state here evens the stacks. */
1725 if (yyss
+ yystacksize
- 1 <= yyssp
)
1727 /* Get the current used size of the three stacks, in elements. */
1728 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1732 /* Give user a chance to reallocate the stack. Use copies of
1733 these so that the &'s don't force the real ones into
1735 YYSTYPE
*yyvs1
= yyvs
;
1736 yytype_int16
*yyss1
= yyss
;
1737 YYLTYPE
*yyls1
= yyls
;
1739 /* Each stack pointer address is followed by the size of the
1740 data in use in that stack, in bytes. This used to be a
1741 conditional around just the two extra args, but that might
1742 be undefined if yyoverflow is a macro. */
1743 yyoverflow (YY_("memory exhausted"),
1744 &yyss1
, yysize
* sizeof (*yyssp
),
1745 &yyvs1
, yysize
* sizeof (*yyvsp
),
1746 &yyls1
, yysize
* sizeof (*yylsp
),
1752 #else /* no yyoverflow */
1753 # ifndef YYSTACK_RELOCATE
1754 goto yyexhaustedlab
;
1756 /* Extend the stack our own way. */
1757 if (YYMAXDEPTH
<= yystacksize
)
1758 goto yyexhaustedlab
;
1760 if (YYMAXDEPTH
< yystacksize
)
1761 yystacksize
= YYMAXDEPTH
;
1764 yytype_int16
*yyss1
= yyss
;
1765 union yyalloc
*yyptr
=
1766 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1768 goto yyexhaustedlab
;
1769 YYSTACK_RELOCATE (yyss
);
1770 YYSTACK_RELOCATE (yyvs
);
1771 YYSTACK_RELOCATE (yyls
);
1772 # undef YYSTACK_RELOCATE
1774 YYSTACK_FREE (yyss1
);
1777 #endif /* no yyoverflow */
1779 yyssp
= yyss
+ yysize
- 1;
1780 yyvsp
= yyvs
+ yysize
- 1;
1781 yylsp
= yyls
+ yysize
- 1;
1783 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1784 (unsigned long int) yystacksize
));
1786 if (yyss
+ yystacksize
- 1 <= yyssp
)
1790 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1792 if (yystate
== YYFINAL
)
1802 /* Do appropriate processing given the current state. Read a
1803 lookahead token if we need one and don't already have one. */
1805 /* First try to decide what to do without reference to lookahead token. */
1806 yyn
= yypact
[yystate
];
1807 if (yyn
== YYPACT_NINF
)
1810 /* Not known => get a lookahead token if don't already have one. */
1812 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1813 if (yychar
== YYEMPTY
)
1815 YYDPRINTF ((stderr
, "Reading a token: "));
1819 if (yychar
<= YYEOF
)
1821 yychar
= yytoken
= YYEOF
;
1822 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1826 yytoken
= YYTRANSLATE (yychar
);
1827 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1830 /* If the proper action on seeing token YYTOKEN is to reduce or to
1831 detect an error, take that action. */
1833 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1838 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1844 /* Count tokens shifted since error; after three, turn off error
1849 /* Shift the lookahead token. */
1850 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1852 /* Discard the shifted token. */
1861 /*-----------------------------------------------------------.
1862 | yydefault -- do the default action for the current state. |
1863 `-----------------------------------------------------------*/
1865 yyn
= yydefact
[yystate
];
1871 /*-----------------------------.
1872 | yyreduce -- Do a reduction. |
1873 `-----------------------------*/
1875 /* yyn is the number of a rule to reduce with. */
1878 /* If YYLEN is nonzero, implement the default value of the action:
1881 Otherwise, the following line sets YYVAL to garbage.
1882 This behavior is undocumented and Bison
1883 users should not rely upon it. Assigning to YYVAL
1884 unconditionally makes the parser a bit smaller, and it avoids a
1885 GCC warning that YYVAL may be used uninitialized. */
1886 yyval
= yyvsp
[1-yylen
];
1888 /* Default location. */
1889 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1890 YY_REDUCE_PRINT (yyn
);
1895 /* Line 1280 of yacc.c */
1896 #line 227 "parse-gram.y"
1898 code_props plain_code
;
1899 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1900 code_props_translate_code (&plain_code
);
1901 gram_scanner_last_string_free ();
1902 prologue_augment (plain_code
.code
, (yylsp
[(1) - (1)]), union_seen
);
1903 code_scanner_last_string_free ();
1909 /* Line 1280 of yacc.c */
1910 #line 235 "parse-gram.y"
1911 { debug_flag
= true; }
1916 /* Line 1280 of yacc.c */
1917 #line 236 "parse-gram.y"
1918 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1923 /* Line 1280 of yacc.c */
1924 #line 237 "parse-gram.y"
1925 { defines_flag
= true; }
1930 /* Line 1280 of yacc.c */
1931 #line 239 "parse-gram.y"
1933 defines_flag
= true;
1934 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1940 /* Line 1280 of yacc.c */
1941 #line 243 "parse-gram.y"
1942 { error_verbose
= true; }
1947 /* Line 1280 of yacc.c */
1948 #line 244 "parse-gram.y"
1949 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1954 /* Line 1280 of yacc.c */
1955 #line 245 "parse-gram.y"
1956 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1961 /* Line 1280 of yacc.c */
1962 #line 246 "parse-gram.y"
1963 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1968 /* Line 1280 of yacc.c */
1969 #line 247 "parse-gram.y"
1970 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1975 /* Line 1280 of yacc.c */
1976 #line 249 "parse-gram.y"
1978 nondeterministic_parser
= true;
1985 /* Line 1280 of yacc.c */
1986 #line 254 "parse-gram.y"
1989 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
1990 code_props_translate_code (&action
);
1991 gram_scanner_last_string_free ();
1992 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
1993 code_scanner_last_string_free ();
1999 /* Line 1280 of yacc.c */
2000 #line 262 "parse-gram.y"
2001 { language_argmatch ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2006 /* Line 1280 of yacc.c */
2007 #line 263 "parse-gram.y"
2008 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2013 /* Line 1280 of yacc.c */
2014 #line 264 "parse-gram.y"
2015 { locations_flag
= true; }
2020 /* Line 1280 of yacc.c */
2021 #line 265 "parse-gram.y"
2022 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2027 /* Line 1280 of yacc.c */
2028 #line 266 "parse-gram.y"
2029 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2034 /* Line 1280 of yacc.c */
2035 #line 267 "parse-gram.y"
2036 { no_lines_flag
= true; }
2041 /* Line 1280 of yacc.c */
2042 #line 268 "parse-gram.y"
2043 { nondeterministic_parser
= true; }
2048 /* Line 1280 of yacc.c */
2049 #line 269 "parse-gram.y"
2050 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2055 /* Line 1280 of yacc.c */
2056 #line 270 "parse-gram.y"
2057 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2062 /* Line 1280 of yacc.c */
2063 #line 271 "parse-gram.y"
2064 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2069 /* Line 1280 of yacc.c */
2070 #line 272 "parse-gram.y"
2071 { pure_parser
= true; }
2076 /* Line 1280 of yacc.c */
2077 #line 273 "parse-gram.y"
2078 { push_parser
= true; pull_parser
= false; }
2083 /* Line 1280 of yacc.c */
2084 #line 274 "parse-gram.y"
2085 { push_parser
= true; pull_parser
= true; }
2090 /* Line 1280 of yacc.c */
2091 #line 275 "parse-gram.y"
2092 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2097 /* Line 1280 of yacc.c */
2098 #line 276 "parse-gram.y"
2099 { skeleton_arg ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2104 /* Line 1280 of yacc.c */
2105 #line 277 "parse-gram.y"
2106 { token_table_flag
= true; }
2111 /* Line 1280 of yacc.c */
2112 #line 278 "parse-gram.y"
2113 { report_flag
= report_states
; }
2118 /* Line 1280 of yacc.c */
2119 #line 279 "parse-gram.y"
2120 { yacc_flag
= true; }
2125 /* Line 1280 of yacc.c */
2126 #line 287 "parse-gram.y"
2128 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2134 /* Line 1280 of yacc.c */
2135 #line 291 "parse-gram.y"
2138 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2139 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2140 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2146 /* Line 1280 of yacc.c */
2147 #line 298 "parse-gram.y"
2150 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2151 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2152 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2158 /* Line 1280 of yacc.c */
2159 #line 305 "parse-gram.y"
2161 default_prec
= true;
2167 /* Line 1280 of yacc.c */
2168 #line 309 "parse-gram.y"
2170 default_prec
= false;
2176 /* Line 1280 of yacc.c */
2177 #line 313 "parse-gram.y"
2179 muscle_code_grow ("percent_code", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2180 code_scanner_last_string_free ();
2186 /* Line 1280 of yacc.c */
2187 #line 318 "parse-gram.y"
2189 char const name_prefix
[] = "percent_code_";
2190 char *name
= xmalloc (sizeof name_prefix
+ strlen ((yyvsp
[(2) - (3)].chars
)));
2191 strcpy (name
, name_prefix
);
2192 strcpy (name
+ sizeof name_prefix
- 1, (yyvsp
[(2) - (3)].chars
));
2193 muscle_code_grow (uniqstr_new (name
), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2195 code_scanner_last_string_free ();
2196 muscle_grow ("used_percent_code_qualifiers", (yyvsp
[(2) - (3)].chars
), ",");
2202 /* Line 1280 of yacc.c */
2203 #line 338 "parse-gram.y"
2209 /* Line 1280 of yacc.c */
2210 #line 339 "parse-gram.y"
2211 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2216 /* Line 1280 of yacc.c */
2217 #line 344 "parse-gram.y"
2219 char const *body
= (yyvsp
[(3) - (3)].code
);
2221 /* Concatenate the %union bodies. If this is the first %union, make sure
2222 the synchronization line appears after the opening '{' so as not to
2223 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2224 into '\n', and omit the new %union's leading '{'. */
2227 muscle_grow ("stype", "{", "");
2231 char *code
= muscle_find ("stype");
2232 code
[strlen (code
) - 1] = '\n';
2237 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2238 gram_scanner_last_string_free ();
2244 /* Line 1280 of yacc.c */
2245 #line 372 "parse-gram.y"
2246 { current_class
= nterm_sym
; }
2251 /* Line 1280 of yacc.c */
2252 #line 373 "parse-gram.y"
2254 current_class
= unknown_sym
;
2255 current_type
= NULL
;
2261 /* Line 1280 of yacc.c */
2262 #line 377 "parse-gram.y"
2263 { current_class
= token_sym
; }
2268 /* Line 1280 of yacc.c */
2269 #line 378 "parse-gram.y"
2271 current_class
= unknown_sym
;
2272 current_type
= NULL
;
2278 /* Line 1280 of yacc.c */
2279 #line 383 "parse-gram.y"
2283 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2284 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2285 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2291 /* Line 1280 of yacc.c */
2292 #line 394 "parse-gram.y"
2296 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2298 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2299 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2301 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2302 current_type
= NULL
;
2308 /* Line 1280 of yacc.c */
2309 #line 408 "parse-gram.y"
2310 { (yyval
.assoc
) = left_assoc
; }
2315 /* Line 1280 of yacc.c */
2316 #line 409 "parse-gram.y"
2317 { (yyval
.assoc
) = right_assoc
; }
2322 /* Line 1280 of yacc.c */
2323 #line 410 "parse-gram.y"
2324 { (yyval
.assoc
) = non_assoc
; }
2329 /* Line 1280 of yacc.c */
2330 #line 414 "parse-gram.y"
2331 { current_type
= NULL
; }
2336 /* Line 1280 of yacc.c */
2337 #line 415 "parse-gram.y"
2338 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2343 /* Line 1280 of yacc.c */
2344 #line 421 "parse-gram.y"
2345 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2350 /* Line 1280 of yacc.c */
2351 #line 423 "parse-gram.y"
2352 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2357 /* Line 1280 of yacc.c */
2358 #line 427 "parse-gram.y"
2359 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2364 /* Line 1280 of yacc.c */
2365 #line 428 "parse-gram.y"
2366 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2371 /* Line 1280 of yacc.c */
2372 #line 432 "parse-gram.y"
2373 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2378 /* Line 1280 of yacc.c */
2379 #line 433 "parse-gram.y"
2380 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2385 /* Line 1280 of yacc.c */
2386 #line 434 "parse-gram.y"
2387 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2392 /* Line 1280 of yacc.c */
2393 #line 435 "parse-gram.y"
2394 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2399 /* Line 1280 of yacc.c */
2400 #line 441 "parse-gram.y"
2402 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2409 /* Line 1280 of yacc.c */
2410 #line 446 "parse-gram.y"
2412 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2413 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2419 /* Line 1280 of yacc.c */
2420 #line 451 "parse-gram.y"
2422 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2423 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2424 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2430 /* Line 1280 of yacc.c */
2431 #line 457 "parse-gram.y"
2433 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2434 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2435 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2441 /* Line 1280 of yacc.c */
2442 #line 463 "parse-gram.y"
2444 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2445 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2446 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2447 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2453 /* Line 1280 of yacc.c */
2454 #line 493 "parse-gram.y"
2462 /* Line 1280 of yacc.c */
2463 #line 499 "parse-gram.y"
2464 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2469 /* Line 1280 of yacc.c */
2470 #line 503 "parse-gram.y"
2471 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2476 /* Line 1280 of yacc.c */
2477 #line 504 "parse-gram.y"
2478 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2483 /* Line 1280 of yacc.c */
2484 #line 510 "parse-gram.y"
2485 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2490 /* Line 1280 of yacc.c */
2491 #line 512 "parse-gram.y"
2492 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2497 /* Line 1280 of yacc.c */
2498 #line 514 "parse-gram.y"
2499 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2504 /* Line 1280 of yacc.c */
2505 #line 516 "parse-gram.y"
2506 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2511 /* Line 1280 of yacc.c */
2512 #line 518 "parse-gram.y"
2513 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2518 /* Line 1280 of yacc.c */
2519 #line 520 "parse-gram.y"
2520 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2525 /* Line 1280 of yacc.c */
2526 #line 536 "parse-gram.y"
2528 static char one
[] = "1";
2529 (yyval
.chars
) = one
;
2535 /* Line 1280 of yacc.c */
2536 #line 546 "parse-gram.y"
2538 code_props plain_code
;
2539 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2540 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2541 code_props_translate_code (&plain_code
);
2542 gram_scanner_last_string_free ();
2543 (yyval
.chars
) = plain_code
.code
;
2549 /* Line 1280 of yacc.c */
2550 #line 566 "parse-gram.y"
2551 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2556 /* Line 1280 of yacc.c */
2557 #line 568 "parse-gram.y"
2559 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2560 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2561 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2567 /* Line 1280 of yacc.c */
2568 #line 576 "parse-gram.y"
2569 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2574 /* Line 1280 of yacc.c */
2575 #line 588 "parse-gram.y"
2577 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2578 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2584 /* Line 1280 of yacc.c */
2585 #line 597 "parse-gram.y"
2587 code_props plain_code
;
2588 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2589 code_props_translate_code (&plain_code
);
2590 gram_scanner_last_string_free ();
2591 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2592 code_scanner_last_string_free ();
2598 /* Line 1280 of yacc.c */
2599 #line 2600 "parse-gram.c"
2602 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2606 YY_STACK_PRINT (yyss
, yyssp
);
2611 /* Now `shift' the result of the reduction. Determine what state
2612 that goes to, based on the state we popped back to and the rule
2613 number reduced by. */
2617 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2618 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2619 yystate
= yytable
[yystate
];
2621 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2626 /*------------------------------------.
2627 | yyerrlab -- here on detecting error |
2628 `------------------------------------*/
2630 /* If not already recovering from an error, report this error. */
2634 #if ! YYERROR_VERBOSE
2635 yyerror (YY_("syntax error"));
2638 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2639 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2641 YYSIZE_T yyalloc
= 2 * yysize
;
2642 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2643 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2644 if (yymsg
!= yymsgbuf
)
2645 YYSTACK_FREE (yymsg
);
2646 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2648 yymsg_alloc
= yyalloc
;
2652 yymsg_alloc
= sizeof yymsgbuf
;
2656 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2658 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2663 yyerror (YY_("syntax error"));
2665 goto yyexhaustedlab
;
2671 yyerror_range
[0] = yylloc
;
2673 if (yyerrstatus
== 3)
2675 /* If just tried and failed to reuse lookahead token after an
2676 error, discard it. */
2678 if (yychar
<= YYEOF
)
2680 /* Return failure if at end of input. */
2681 if (yychar
== YYEOF
)
2686 yydestruct ("Error: discarding",
2687 yytoken
, &yylval
, &yylloc
);
2692 /* Else will try to reuse lookahead token after shifting the error
2697 /*---------------------------------------------------.
2698 | yyerrorlab -- error raised explicitly by YYERROR. |
2699 `---------------------------------------------------*/
2702 /* Pacify compilers like GCC when the user code never invokes
2703 YYERROR and the label yyerrorlab therefore never appears in user
2705 if (/*CONSTCOND*/ 0)
2708 yyerror_range
[0] = yylsp
[1-yylen
];
2709 /* Do not reclaim the symbols of the rule which action triggered
2713 YY_STACK_PRINT (yyss
, yyssp
);
2718 /*-------------------------------------------------------------.
2719 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2720 `-------------------------------------------------------------*/
2722 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2726 yyn
= yypact
[yystate
];
2727 if (yyn
!= YYPACT_NINF
)
2730 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2738 /* Pop the current state because it cannot handle the error token. */
2742 yyerror_range
[0] = *yylsp
;
2743 yydestruct ("Error: popping",
2744 yystos
[yystate
], yyvsp
, yylsp
);
2747 YY_STACK_PRINT (yyss
, yyssp
);
2752 yyerror_range
[1] = yylloc
;
2753 /* Using YYLLOC is tempting, but would change the location of
2754 the lookahead. YYLOC is available though. */
2755 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2758 /* Shift the error token. */
2759 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2765 /*-------------------------------------.
2766 | yyacceptlab -- YYACCEPT comes here. |
2767 `-------------------------------------*/
2772 /*-----------------------------------.
2773 | yyabortlab -- YYABORT comes here. |
2774 `-----------------------------------*/
2780 /*-------------------------------------------------.
2781 | yyexhaustedlab -- memory exhaustion comes here. |
2782 `-------------------------------------------------*/
2784 yyerror (YY_("memory exhausted"));
2790 if (yychar
!= YYEMPTY
)
2791 yydestruct ("Cleanup: discarding lookahead",
2792 yytoken
, &yylval
, &yylloc
);
2793 /* Do not reclaim the symbols of the rule which action triggered
2794 this YYABORT or YYACCEPT. */
2796 YY_STACK_PRINT (yyss
, yyssp
);
2797 while (yyssp
!= yyss
)
2799 yydestruct ("Cleanup: popping",
2800 yystos
[*yyssp
], yyvsp
, yylsp
);
2805 YYSTACK_FREE (yyss
);
2808 if (yymsg
!= yymsgbuf
)
2809 YYSTACK_FREE (yymsg
);
2811 /* Make sure YYID is used. */
2812 return YYID (yyresult
);
2817 /* Line 1497 of yacc.c */
2818 #line 607 "parse-gram.y"
2822 /* Return the location of the left-hand side of a rule whose
2823 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2824 the right-hand side, and return an empty location equal to the end
2825 boundary of RHS[0] if the right-hand side is empty. */
2828 lloc_default (YYLTYPE
const *rhs
, int n
)
2833 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2834 The bug is fixed in 7.4.2m, but play it safe for now. */
2835 loc
.start
= rhs
[n
].end
;
2836 loc
.end
= rhs
[n
].end
;
2838 /* Ignore empty nonterminals the start of the the right-hand side.
2839 Do not bother to ignore them at the end of the right-hand side,
2840 since empty nonterminals have the same end as their predecessors. */
2841 for (i
= 1; i
<= n
; i
++)
2842 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2844 loc
.start
= rhs
[i
].start
;
2852 /* Add a lex-param or a parse-param (depending on TYPE) with
2853 declaration DECL and location LOC. */
2856 add_param (char const *type
, char *decl
, location loc
)
2858 static char const alphanum
[26 + 26 + 1 + 10] =
2859 "abcdefghijklmnopqrstuvwxyz"
2860 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2863 char const *name_start
= NULL
;
2866 /* Stop on last actual character. */
2867 for (p
= decl
; p
[1]; p
++)
2869 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2870 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2873 /* Strip the surrounding '{' and '}', and any blanks just inside
2875 while (*--p
== ' ' || *p
== '\t')
2878 while (*++decl
== ' ' || *decl
== '\t')
2882 complain_at (loc
, _("missing identifier in parameter declaration"));
2889 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2893 name
= xmalloc (name_len
+ 1);
2894 memcpy (name
, name_start
, name_len
);
2895 name
[name_len
] = '\0';
2896 muscle_pair_list_grow (type
, decl
, name
);
2900 gram_scanner_last_string_free ();
2905 version_check (location
const *loc
, char const *version
)
2907 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2909 complain_at (*loc
, "require bison %s, but have %s",
2910 version
, PACKAGE_VERSION
);
2916 gram_error (location
const *loc
, char const *msg
)
2918 complain_at (*loc
, "%s", msg
);
2922 token_name (int type
)
2924 return yytname
[YYTRANSLATE (type
)];
2935 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2936 return quotearg_style (escape_quoting_style
, buf
);