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 "../../src/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 "../../src/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,
191 PERCENT_SYMBOL_DEFAULT
= 265,
194 PERCENT_NONASSOC
= 268,
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_LEX_PARAM
= 283,
210 PERCENT_LOCATIONS
= 284,
211 PERCENT_NAME_PREFIX
= 285,
212 PERCENT_NO_DEFAULT_PREC
= 286,
213 PERCENT_NO_LINES
= 287,
214 PERCENT_NONDETERMINISTIC_PARSER
= 288,
215 PERCENT_OUTPUT
= 289,
216 PERCENT_PARSE_PARAM
= 290,
217 PERCENT_PROVIDES
= 291,
218 PERCENT_PURE_PARSER
= 292,
219 PERCENT_PUSH_PARSER
= 293,
220 PERCENT_REQUIRE
= 294,
221 PERCENT_REQUIRES
= 295,
222 PERCENT_SKELETON
= 296,
224 PERCENT_TOKEN_TABLE
= 298,
225 PERCENT_VERBOSE
= 299,
233 PERCENT_PERCENT
= 307,
245 #define PERCENT_TOKEN 260
246 #define PERCENT_NTERM 261
247 #define PERCENT_TYPE 262
248 #define PERCENT_DESTRUCTOR 263
249 #define PERCENT_PRINTER 264
250 #define PERCENT_SYMBOL_DEFAULT 265
251 #define PERCENT_LEFT 266
252 #define PERCENT_RIGHT 267
253 #define PERCENT_NONASSOC 268
254 #define PERCENT_PREC 269
255 #define PERCENT_DPREC 270
256 #define PERCENT_MERGE 271
257 #define PERCENT_CODE 272
258 #define PERCENT_DEBUG 273
259 #define PERCENT_DEFAULT_PREC 274
260 #define PERCENT_DEFINE 275
261 #define PERCENT_DEFINES 276
262 #define PERCENT_ERROR_VERBOSE 277
263 #define PERCENT_EXPECT 278
264 #define PERCENT_EXPECT_RR 279
265 #define PERCENT_FILE_PREFIX 280
266 #define PERCENT_GLR_PARSER 281
267 #define PERCENT_INITIAL_ACTION 282
268 #define PERCENT_LEX_PARAM 283
269 #define PERCENT_LOCATIONS 284
270 #define PERCENT_NAME_PREFIX 285
271 #define PERCENT_NO_DEFAULT_PREC 286
272 #define PERCENT_NO_LINES 287
273 #define PERCENT_NONDETERMINISTIC_PARSER 288
274 #define PERCENT_OUTPUT 289
275 #define PERCENT_PARSE_PARAM 290
276 #define PERCENT_PROVIDES 291
277 #define PERCENT_PURE_PARSER 292
278 #define PERCENT_PUSH_PARSER 293
279 #define PERCENT_REQUIRE 294
280 #define PERCENT_REQUIRES 295
281 #define PERCENT_SKELETON 296
282 #define PERCENT_START 297
283 #define PERCENT_TOKEN_TABLE 298
284 #define PERCENT_VERBOSE 299
285 #define PERCENT_YACC 300
286 #define BRACED_CODE 301
292 #define PERCENT_PERCENT 307
295 #define SEMICOLON 310
297 #define PERCENT_UNION 312
302 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
303 typedef union YYSTYPE
305 /* Line 198 of yacc.c */
306 #line 98 "../../src/parse-gram.y"
314 unsigned char character
;
317 /* Line 198 of yacc.c */
318 #line 319 "../../src/parse-gram.c"
320 # define YYSTYPE_IS_TRIVIAL 1
321 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
322 # define YYSTYPE_IS_DECLARED 1
325 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
326 typedef struct YYLTYPE
333 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
334 # define YYLTYPE_IS_DECLARED 1
335 # define YYLTYPE_IS_TRIVIAL 1
339 /* Copy the second part of user declarations. */
342 /* Line 221 of yacc.c */
343 #line 344 "../../src/parse-gram.c"
350 typedef YYTYPE_UINT8 yytype_uint8
;
352 typedef unsigned char yytype_uint8
;
356 typedef YYTYPE_INT8 yytype_int8
;
357 #elif (defined __STDC__ || defined __C99__FUNC__ \
358 || defined __cplusplus || defined _MSC_VER)
359 typedef signed char yytype_int8
;
361 typedef short int yytype_int8
;
365 typedef YYTYPE_UINT16 yytype_uint16
;
367 typedef unsigned short int yytype_uint16
;
371 typedef YYTYPE_INT16 yytype_int16
;
373 typedef short int yytype_int16
;
377 # ifdef __SIZE_TYPE__
378 # define YYSIZE_T __SIZE_TYPE__
379 # elif defined size_t
380 # define YYSIZE_T size_t
381 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
382 || defined __cplusplus || defined _MSC_VER)
383 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
384 # define YYSIZE_T size_t
386 # define YYSIZE_T unsigned int
390 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
395 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
396 # define YY_(msgid) dgettext ("bison-runtime", msgid)
400 # define YY_(msgid) msgid
404 /* Suppress unused-variable warnings by "using" E. */
405 #if ! defined lint || defined __GNUC__
406 # define YYUSE(e) ((void) (e))
408 # define YYUSE(e) /* empty */
411 /* Identity function, used to suppress warnings about constant conditions. */
415 #if (defined __STDC__ || defined __C99__FUNC__ \
416 || defined __cplusplus || defined _MSC_VER)
429 #if ! defined yyoverflow || YYERROR_VERBOSE
431 /* The parser invokes alloca or malloc; define the necessary symbols. */
433 # ifdef YYSTACK_USE_ALLOCA
434 # if YYSTACK_USE_ALLOCA
436 # define YYSTACK_ALLOC __builtin_alloca
437 # elif defined __BUILTIN_VA_ARG_INCR
438 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
440 # define YYSTACK_ALLOC __alloca
441 # elif defined _MSC_VER
442 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
443 # define alloca _alloca
445 # define YYSTACK_ALLOC alloca
446 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
447 || defined __cplusplus || defined _MSC_VER)
448 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
457 # ifdef YYSTACK_ALLOC
458 /* Pacify GCC's `empty if-body' warning. */
459 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
460 # ifndef YYSTACK_ALLOC_MAXIMUM
461 /* The OS might guarantee only one guard page at the bottom of the stack,
462 and a page size can be as small as 4096 bytes. So we cannot safely
463 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
464 to allow for a few compiler-allocated temporary stack slots. */
465 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
468 # define YYSTACK_ALLOC YYMALLOC
469 # define YYSTACK_FREE YYFREE
470 # ifndef YYSTACK_ALLOC_MAXIMUM
471 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
473 # if (defined __cplusplus && ! defined _STDLIB_H \
474 && ! ((defined YYMALLOC || defined malloc) \
475 && (defined YYFREE || defined free)))
476 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
482 # define YYMALLOC malloc
483 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
484 || defined __cplusplus || defined _MSC_VER)
485 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
490 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
491 || defined __cplusplus || defined _MSC_VER)
492 void free (void *); /* INFRINGES ON USER NAME SPACE */
496 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
499 #if (! defined yyoverflow \
500 && (! defined __cplusplus \
501 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
502 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
504 /* A type that is properly aligned for any stack member. */
512 /* The size of the maximum gap between one aligned stack and the next. */
513 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
515 /* The size of an array large to enough to hold all stacks, each with
517 # define YYSTACK_BYTES(N) \
518 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
519 + 2 * YYSTACK_GAP_MAXIMUM)
521 /* Copy COUNT objects from FROM to TO. The source and destination do
524 # if defined __GNUC__ && 1 < __GNUC__
525 # define YYCOPY(To, From, Count) \
526 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
528 # define YYCOPY(To, From, Count) \
532 for (yyi = 0; yyi < (Count); yyi++) \
533 (To)[yyi] = (From)[yyi]; \
539 /* Relocate STACK from its old location to the new one. The
540 local variables YYSIZE and YYSTACKSIZE give the old and new number of
541 elements in the stack, and YYPTR gives the new location of the
542 stack. Advance YYPTR to a properly aligned location for the next
544 # define YYSTACK_RELOCATE(Stack) \
547 YYSIZE_T yynewbytes; \
548 YYCOPY (&yyptr->Stack, Stack, yysize); \
549 Stack = &yyptr->Stack; \
550 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
551 yyptr += yynewbytes / sizeof (*yyptr); \
557 /* YYFINAL -- State number of the termination state. */
559 /* YYLAST -- Last index in YYTABLE. */
562 /* YYNTOKENS -- Number of terminals. */
564 /* YYNNTS -- Number of nonterminals. */
566 /* YYNRULES -- Number of rules. */
568 /* YYNRULES -- Number of states. */
569 #define YYNSTATES 135
571 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
573 #define YYMAXUTOK 312
575 #define YYTRANSLATE(YYX) \
576 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
578 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
579 static const yytype_uint8 yytranslate
[] =
581 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
607 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
608 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
609 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
610 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
611 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
616 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
618 static const yytype_uint8 yyprhs
[] =
620 0, 0, 3, 8, 9, 12, 14, 16, 19, 21,
621 25, 27, 29, 32, 35, 39, 41, 44, 47, 49,
622 53, 55, 57, 61, 64, 67, 69, 71, 74, 77,
623 80, 82, 84, 86, 88, 90, 92, 95, 99, 103,
624 105, 107, 108, 110, 114, 115, 119, 120, 124, 128,
625 132, 134, 136, 138, 139, 141, 143, 146, 148, 151,
626 153, 155, 157, 159, 161, 164, 167, 171, 173, 176,
627 178, 181, 183, 186, 189, 190, 194, 196, 200, 203,
628 204, 207, 210, 214, 218, 222, 224, 226, 227, 229,
629 231, 233, 235, 237, 239, 241, 243, 244
632 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
633 static const yytype_int8 yyrhs
[] =
635 59, 0, -1, 60, 52, 75, 88, -1, -1, 60,
636 61, -1, 62, -1, 54, -1, 17, 83, -1, 18,
637 -1, 20, 3, 82, -1, 21, -1, 22, -1, 23,
638 4, -1, 24, 4, -1, 25, 49, 3, -1, 26,
639 -1, 27, 46, -1, 28, 46, -1, 29, -1, 30,
640 49, 3, -1, 32, -1, 33, -1, 34, 49, 3,
641 -1, 35, 46, -1, 36, 83, -1, 37, -1, 38,
642 -1, 39, 3, -1, 40, 83, -1, 41, 3, -1,
643 43, -1, 44, -1, 45, -1, 55, -1, 67, -1,
644 64, -1, 42, 86, -1, 8, 46, 71, -1, 9,
645 46, 71, -1, 19, -1, 31, -1, -1, 50, -1,
646 57, 63, 46, -1, -1, 6, 65, 74, -1, -1,
647 5, 66, 74, -1, 7, 56, 70, -1, 68, 69,
648 70, -1, 11, -1, 12, -1, 13, -1, -1, 56,
649 -1, 86, -1, 70, 86, -1, 72, -1, 71, 72,
650 -1, 86, -1, 56, -1, 10, -1, 56, -1, 84,
651 -1, 84, 4, -1, 84, 87, -1, 84, 4, 87,
652 -1, 73, -1, 74, 73, -1, 76, -1, 75, 76,
653 -1, 77, -1, 62, 55, -1, 1, 55, -1, -1,
654 85, 78, 79, -1, 80, -1, 79, 53, 80, -1,
655 79, 55, -1, -1, 80, 86, -1, 80, 46, -1,
656 80, 14, 86, -1, 80, 15, 4, -1, 80, 16,
657 56, -1, 3, -1, 83, -1, -1, 81, -1, 46,
658 -1, 50, -1, 47, -1, 51, -1, 84, -1, 87,
659 -1, 3, -1, -1, 52, 48, -1
662 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
663 static const yytype_uint16 yyrline
[] =
665 0, 208, 208, 216, 218, 222, 223, 224, 225, 226,
666 227, 228, 229, 230, 231, 232, 237, 241, 242, 243,
667 244, 245, 246, 247, 248, 249, 250, 251, 252, 253,
668 254, 255, 256, 257, 261, 262, 263, 267, 275, 283,
669 287, 301, 302, 306, 334, 334, 339, 339, 344, 355,
670 370, 371, 372, 376, 377, 382, 384, 389, 390, 394,
671 395, 396, 401, 406, 411, 417, 423, 434, 435, 444,
672 445, 451, 452, 453, 460, 460, 464, 465, 466, 471,
673 472, 474, 476, 478, 480, 490, 491, 497, 501, 506,
674 522, 524, 533, 538, 539, 544, 551, 553
678 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
679 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
680 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
681 static const char *const yytname
[] =
683 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
684 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
685 "\"%printer\"", "\"%symbol-default\"", "\"%left\"", "\"%right\"",
686 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
687 "\"%debug\"", "\"%default-prec\"", "\"%define\"", "\"%defines\"",
688 "\"%error-verbose\"", "\"%expect\"", "\"%expect-rr\"",
689 "\"%file-prefix\"", "\"%glr-parser\"", "\"%initial-action\"",
690 "\"%lex-param\"", "\"%locations\"", "\"%name-prefix\"",
691 "\"%no-default-prec\"", "\"%no-lines\"", "\"%nondeterministic-parser\"",
692 "\"%output\"", "\"%parse-param\"", "\"%provides\"", "\"%pure-parser\"",
693 "\"%push-parser\"", "\"%require\"", "\"%requires\"", "\"%skeleton\"",
694 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
695 "\"{...}\"", "\"char\"", "\"epilogue\"", "\"=\"", "\"identifier\"",
696 "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"",
697 "\"%union\"", "$accept", "input", "prologue_declarations",
698 "prologue_declaration", "grammar_declaration", "union_name",
699 "symbol_declaration", "@1", "@2", "precedence_declaration",
700 "precedence_declarator", "type.opt", "symbols.1", "generic_symlist",
701 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
702 "rules_or_grammar_declaration", "rules", "@3", "rhses.1", "rhs",
703 "content", "content.opt", "braceless", "id", "id_colon", "symbol",
704 "string_as_id", "epilogue.opt", 0
709 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
711 static const yytype_uint16 yytoknum
[] =
713 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
714 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
715 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
716 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
717 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
718 305, 306, 307, 308, 309, 310, 311, 312
722 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
723 static const yytype_uint8 yyr1
[] =
725 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
726 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
727 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
728 61, 61, 61, 61, 62, 62, 62, 62, 62, 62,
729 62, 63, 63, 62, 65, 64, 66, 64, 64, 67,
730 68, 68, 68, 69, 69, 70, 70, 71, 71, 72,
731 72, 72, 73, 73, 73, 73, 73, 74, 74, 75,
732 75, 76, 76, 76, 78, 77, 79, 79, 79, 80,
733 80, 80, 80, 80, 80, 81, 81, 82, 82, 83,
734 84, 84, 85, 86, 86, 87, 88, 88
737 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
738 static const yytype_uint8 yyr2
[] =
740 0, 2, 4, 0, 2, 1, 1, 2, 1, 3,
741 1, 1, 2, 2, 3, 1, 2, 2, 1, 3,
742 1, 1, 3, 2, 2, 1, 1, 2, 2, 2,
743 1, 1, 1, 1, 1, 1, 2, 3, 3, 1,
744 1, 0, 1, 3, 0, 3, 0, 3, 3, 3,
745 1, 1, 1, 0, 1, 1, 2, 1, 2, 1,
746 1, 1, 1, 1, 2, 2, 3, 1, 2, 1,
747 2, 1, 2, 2, 0, 3, 1, 3, 2, 0,
748 2, 2, 3, 3, 3, 1, 1, 0, 1, 1,
749 1, 1, 1, 1, 1, 1, 0, 2
752 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
753 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
754 means the default is an error. */
755 static const yytype_uint8 yydefact
[] =
757 3, 0, 0, 1, 46, 44, 0, 0, 0, 50,
758 51, 52, 0, 8, 39, 0, 10, 11, 0, 0,
759 0, 15, 0, 0, 18, 0, 40, 20, 21, 0,
760 0, 0, 25, 26, 0, 0, 0, 0, 30, 31,
761 32, 0, 6, 33, 41, 4, 5, 35, 34, 53,
762 0, 0, 0, 0, 0, 89, 7, 87, 12, 13,
763 0, 16, 17, 0, 0, 23, 24, 27, 28, 29,
764 95, 91, 90, 93, 36, 94, 0, 92, 0, 0,
765 69, 71, 74, 42, 0, 54, 0, 62, 67, 47,
766 63, 45, 48, 55, 61, 60, 37, 57, 59, 38,
767 85, 88, 9, 86, 14, 19, 22, 73, 72, 0,
768 70, 2, 79, 43, 49, 68, 64, 65, 56, 58,
769 97, 75, 76, 66, 79, 78, 0, 0, 0, 81,
773 /* YYDEFGOTO[NTERM-NUM]. */
774 static const yytype_int8 yydefgoto
[] =
776 -1, 1, 2, 45, 78, 84, 47, 51, 50, 48,
777 49, 86, 92, 96, 97, 88, 89, 79, 80, 81,
778 112, 121, 122, 101, 102, 56, 73, 82, 98, 75,
782 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
784 #define YYPACT_NINF -75
785 static const yytype_int16 yypact
[] =
787 -75, 5, 90, -75, -75, -75, -52, -25, -19, -75,
788 -75, -75, -13, -75, -75, 42, -75, -75, 47, 52,
789 15, -75, 19, 21, -75, 20, -75, -75, -75, 22,
790 24, -13, -75, -75, 69, -13, 70, 0, -75, -75,
791 -75, 17, -75, -75, 26, -75, -75, -75, -75, 27,
792 10, 10, 0, 28, 28, -75, -75, 8, -75, -75,
793 77, -75, -75, 79, 83, -75, -75, -75, -75, -75,
794 -75, -75, -75, -75, -75, -75, 32, -75, 33, 1,
795 -75, -75, -75, -75, 44, -75, 0, -75, -75, 10,
796 59, 10, 0, -75, -75, -75, 28, -75, -75, 28,
797 -75, -75, -75, -75, -75, -75, -75, -75, -75, 43,
798 -75, -75, -75, -75, 0, -75, 89, -75, -75, -75,
799 -75, -36, 134, -75, -75, -75, 0, 96, 37, -75,
800 -75, 134, -75, -75, -75
803 /* YYPGOTO[NTERM-NUM]. */
804 static const yytype_int8 yypgoto
[] =
806 -75, -75, -75, -75, 102, -75, -75, -75, -75, -75,
807 -75, -75, 50, 51, -62, -45, 55, -75, 60, -75,
808 -75, -75, 14, -75, -75, 4, -10, -75, -37, -74,
812 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
813 positive, shift that token. If negative, reduce the rule which
814 number is the opposite. If zero, do what YYDEFACT says.
815 If YYTABLE_NINF, syntax error. */
816 #define YYTABLE_NINF -97
817 static const yytype_int16 yytable
[] =
819 74, -96, 76, 70, 52, 3, 4, 5, 6, 7,
820 8, 100, 9, 10, 11, 93, 117, 124, 76, 125,
821 14, 53, 4, 5, 6, 7, 8, 54, 9, 10,
822 11, 70, 26, 55, 119, 66, 14, 119, 94, 68,
823 90, 90, 123, 37, 115, 57, 115, 71, 26, 93,
824 72, 58, 77, 109, 55, 118, 59, 71, 44, 37,
825 72, 103, 70, 116, 60, 61, 87, 62, 77, 63,
826 65, 64, 67, 69, 44, 71, 83, 118, 72, 90,
827 104, 90, 105, 85, 95, 130, 106, 107, 108, 132,
828 113, 120, 70, 134, 130, 4, 5, 6, 7, 8,
829 133, 9, 10, 11, 46, 99, 91, 12, 13, 14,
830 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
831 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
832 35, 36, 37, 38, 39, 40, 114, 70, 131, 110,
833 0, 0, 41, 0, 42, 43, 0, 44, 126, 127,
834 128, 0, 0, 0, 0, 0, 0, 0, 0, 0,
835 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
836 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
840 static const yytype_int16 yycheck
[] =
842 37, 0, 1, 3, 56, 0, 5, 6, 7, 8,
843 9, 3, 11, 12, 13, 52, 90, 53, 1, 55,
844 19, 46, 5, 6, 7, 8, 9, 46, 11, 12,
845 13, 3, 31, 46, 96, 31, 19, 99, 10, 35,
846 50, 51, 116, 42, 89, 3, 91, 47, 31, 86,
847 50, 4, 51, 52, 46, 92, 4, 47, 57, 42,
848 50, 57, 3, 4, 49, 46, 56, 46, 51, 49,
849 46, 49, 3, 3, 57, 47, 50, 114, 50, 89,
850 3, 91, 3, 56, 56, 122, 3, 55, 55, 126,
851 46, 48, 3, 56, 131, 5, 6, 7, 8, 9,
852 4, 11, 12, 13, 2, 54, 51, 17, 18, 19,
853 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
854 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
855 40, 41, 42, 43, 44, 45, 86, 3, 124, 79,
856 -1, -1, 52, -1, 54, 55, -1, 57, 14, 15,
857 16, -1, -1, -1, -1, -1, -1, -1, -1, -1,
858 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
859 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
863 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
864 symbol of state STATE-NUM. */
865 static const yytype_uint8 yystos
[] =
867 0, 59, 60, 0, 5, 6, 7, 8, 9, 11,
868 12, 13, 17, 18, 19, 20, 21, 22, 23, 24,
869 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
870 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
871 45, 52, 54, 55, 57, 61, 62, 64, 67, 68,
872 66, 65, 56, 46, 46, 46, 83, 3, 4, 4,
873 49, 46, 46, 49, 49, 46, 83, 3, 83, 3,
874 3, 47, 50, 84, 86, 87, 1, 51, 62, 75,
875 76, 77, 85, 50, 63, 56, 69, 56, 73, 74,
876 84, 74, 70, 86, 10, 56, 71, 72, 86, 71,
877 3, 81, 82, 83, 3, 3, 3, 55, 55, 52,
878 76, 88, 78, 46, 70, 73, 4, 87, 86, 72,
879 48, 79, 80, 87, 53, 55, 14, 15, 16, 46,
883 #define yyerrok (yyerrstatus = 0)
884 #define yyclearin (yychar = YYEMPTY)
888 #define YYACCEPT goto yyacceptlab
889 #define YYABORT goto yyabortlab
890 #define YYERROR goto yyerrorlab
893 /* Like YYERROR except do call yyerror. This remains here temporarily
894 to ease the transition to the new meaning of YYERROR, for GCC.
895 Once GCC version 2 has supplanted version 1, this can go. */
897 #define YYFAIL goto yyerrlab
899 #define YYRECOVERING() (!!yyerrstatus)
901 #define YYBACKUP(Token, Value) \
903 if (yychar == YYEMPTY && yylen == 1) \
907 yytoken = YYTRANSLATE (yychar); \
913 yyerror (YY_("syntax error: cannot back up")); \
920 #define YYERRCODE 256
923 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
924 If N is 0, then set CURRENT to the empty location which ends
925 the previous symbol: RHS[0] (always defined). */
927 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
928 #ifndef YYLLOC_DEFAULT
929 # define YYLLOC_DEFAULT(Current, Rhs, N) \
933 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
934 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
935 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
936 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
940 (Current).first_line = (Current).last_line = \
941 YYRHSLOC (Rhs, 0).last_line; \
942 (Current).first_column = (Current).last_column = \
943 YYRHSLOC (Rhs, 0).last_column; \
949 /* YY_LOCATION_PRINT -- Print the location on the stream.
950 This macro was not mandated originally: define only if we know
951 we won't break user code: when these are the locations we know. */
953 #ifndef YY_LOCATION_PRINT
954 # if YYLTYPE_IS_TRIVIAL
955 # define YY_LOCATION_PRINT(File, Loc) \
956 fprintf (File, "%d.%d-%d.%d", \
957 (Loc).first_line, (Loc).first_column, \
958 (Loc).last_line, (Loc).last_column)
960 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
965 /* YYLEX -- calling `yylex' with the right arguments. */
968 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
970 # define YYLEX yylex (&yylval, &yylloc)
973 /* Enable debugging if requested. */
977 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
978 # define YYFPRINTF fprintf
981 # define YYDPRINTF(Args) \
987 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
991 YYFPRINTF (stderr, "%s ", Title); \
992 yy_symbol_print (stderr, \
993 Type, Value, Location); \
994 YYFPRINTF (stderr, "\n"); \
999 /*--------------------------------.
1000 | Print this symbol on YYOUTPUT. |
1001 `--------------------------------*/
1004 #if (defined __STDC__ || defined __C99__FUNC__ \
1005 || defined __cplusplus || defined _MSC_VER)
1007 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1010 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1013 YYSTYPE
const * const yyvaluep
;
1014 YYLTYPE
const * const yylocationp
;
1019 YYUSE (yylocationp
);
1021 if (yytype
< YYNTOKENS
)
1022 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1028 case 3: /* "\"string\"" */
1030 /* Line 670 of yacc.c */
1031 #line 186 "../../src/parse-gram.y"
1032 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1034 /* Line 670 of yacc.c */
1035 #line 1036 "../../src/parse-gram.c"
1037 case 4: /* "\"integer\"" */
1039 /* Line 670 of yacc.c */
1040 #line 197 "../../src/parse-gram.y"
1041 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1043 /* Line 670 of yacc.c */
1044 #line 1045 "../../src/parse-gram.c"
1046 case 46: /* "\"{...}\"" */
1048 /* Line 670 of yacc.c */
1049 #line 188 "../../src/parse-gram.y"
1050 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1052 /* Line 670 of yacc.c */
1053 #line 1054 "../../src/parse-gram.c"
1055 case 47: /* "\"char\"" */
1057 /* Line 670 of yacc.c */
1058 #line 181 "../../src/parse-gram.y"
1059 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1061 /* Line 670 of yacc.c */
1062 #line 1063 "../../src/parse-gram.c"
1064 case 48: /* "\"epilogue\"" */
1066 /* Line 670 of yacc.c */
1067 #line 188 "../../src/parse-gram.y"
1068 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1070 /* Line 670 of yacc.c */
1071 #line 1072 "../../src/parse-gram.c"
1073 case 50: /* "\"identifier\"" */
1075 /* Line 670 of yacc.c */
1076 #line 193 "../../src/parse-gram.y"
1077 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1079 /* Line 670 of yacc.c */
1080 #line 1081 "../../src/parse-gram.c"
1082 case 51: /* "\"identifier:\"" */
1084 /* Line 670 of yacc.c */
1085 #line 194 "../../src/parse-gram.y"
1086 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1088 /* Line 670 of yacc.c */
1089 #line 1090 "../../src/parse-gram.c"
1091 case 54: /* "\"%{...%}\"" */
1093 /* Line 670 of yacc.c */
1094 #line 188 "../../src/parse-gram.y"
1095 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1097 /* Line 670 of yacc.c */
1098 #line 1099 "../../src/parse-gram.c"
1100 case 56: /* "\"type\"" */
1102 /* Line 670 of yacc.c */
1103 #line 192 "../../src/parse-gram.y"
1104 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1106 /* Line 670 of yacc.c */
1107 #line 1108 "../../src/parse-gram.c"
1109 case 81: /* "content" */
1111 /* Line 670 of yacc.c */
1112 #line 188 "../../src/parse-gram.y"
1113 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1115 /* Line 670 of yacc.c */
1116 #line 1117 "../../src/parse-gram.c"
1118 case 82: /* "content.opt" */
1120 /* Line 670 of yacc.c */
1121 #line 188 "../../src/parse-gram.y"
1122 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1124 /* Line 670 of yacc.c */
1125 #line 1126 "../../src/parse-gram.c"
1127 case 83: /* "braceless" */
1129 /* Line 670 of yacc.c */
1130 #line 188 "../../src/parse-gram.y"
1131 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1133 /* Line 670 of yacc.c */
1134 #line 1135 "../../src/parse-gram.c"
1138 /* Line 670 of yacc.c */
1139 #line 200 "../../src/parse-gram.y"
1140 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1142 /* Line 670 of yacc.c */
1143 #line 1144 "../../src/parse-gram.c"
1145 case 85: /* "id_colon" */
1147 /* Line 670 of yacc.c */
1148 #line 201 "../../src/parse-gram.y"
1149 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1151 /* Line 670 of yacc.c */
1152 #line 1153 "../../src/parse-gram.c"
1154 case 86: /* "symbol" */
1156 /* Line 670 of yacc.c */
1157 #line 200 "../../src/parse-gram.y"
1158 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1160 /* Line 670 of yacc.c */
1161 #line 1162 "../../src/parse-gram.c"
1163 case 87: /* "string_as_id" */
1165 /* Line 670 of yacc.c */
1166 #line 200 "../../src/parse-gram.y"
1167 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1169 /* Line 670 of yacc.c */
1170 #line 1171 "../../src/parse-gram.c"
1178 /*--------------------------------.
1179 | Print this symbol on YYOUTPUT. |
1180 `--------------------------------*/
1182 #if (defined __STDC__ || defined __C99__FUNC__ \
1183 || defined __cplusplus || defined _MSC_VER)
1185 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1188 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1191 YYSTYPE
const * const yyvaluep
;
1192 YYLTYPE
const * const yylocationp
;
1195 if (yytype
< YYNTOKENS
)
1196 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1198 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1200 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1201 YYFPRINTF (yyoutput
, ": ");
1202 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1203 YYFPRINTF (yyoutput
, ")");
1206 /*------------------------------------------------------------------.
1207 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1209 `------------------------------------------------------------------*/
1211 #if (defined __STDC__ || defined __C99__FUNC__ \
1212 || defined __cplusplus || defined _MSC_VER)
1214 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1217 yy_stack_print (yybottom
, yytop
)
1218 yytype_int16
*yybottom
;
1219 yytype_int16
*yytop
;
1222 YYFPRINTF (stderr
, "Stack now");
1223 for (; yybottom
<= yytop
; yybottom
++)
1225 int yybot
= *yybottom
;
1226 YYFPRINTF (stderr
, " %d", yybot
);
1228 YYFPRINTF (stderr
, "\n");
1231 # define YY_STACK_PRINT(Bottom, Top) \
1234 yy_stack_print ((Bottom), (Top)); \
1238 /*------------------------------------------------.
1239 | Report that the YYRULE is going to be reduced. |
1240 `------------------------------------------------*/
1242 #if (defined __STDC__ || defined __C99__FUNC__ \
1243 || defined __cplusplus || defined _MSC_VER)
1245 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1248 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1254 int yynrhs
= yyr2
[yyrule
];
1256 unsigned long int yylno
= yyrline
[yyrule
];
1257 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1259 /* The symbols being reduced. */
1260 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1262 fprintf (stderr
, " $%d = ", yyi
+ 1);
1263 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1264 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1265 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1266 fprintf (stderr
, "\n");
1270 # define YY_REDUCE_PRINT(Rule) \
1273 yy_reduce_print (yyvsp, yylsp, Rule); \
1276 /* Nonzero means print parse trace. It is left uninitialized so that
1277 multiple parsers can coexist. */
1279 #else /* !YYDEBUG */
1280 # define YYDPRINTF(Args)
1281 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1282 # define YY_STACK_PRINT(Bottom, Top)
1283 # define YY_REDUCE_PRINT(Rule)
1284 #endif /* !YYDEBUG */
1287 /* YYINITDEPTH -- initial size of the parser's stacks. */
1289 # define YYINITDEPTH 200
1292 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1293 if the built-in stack extension method is used).
1295 Do not make this value too large; the results are undefined if
1296 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1297 evaluated with infinite-precision integer arithmetic. */
1300 # define YYMAXDEPTH 10000
1308 # if defined __GLIBC__ && defined _STRING_H
1309 # define yystrlen strlen
1311 /* Return the length of YYSTR. */
1312 #if (defined __STDC__ || defined __C99__FUNC__ \
1313 || defined __cplusplus || defined _MSC_VER)
1315 yystrlen (const char *yystr
)
1323 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1331 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1332 # define yystpcpy stpcpy
1334 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1336 #if (defined __STDC__ || defined __C99__FUNC__ \
1337 || defined __cplusplus || defined _MSC_VER)
1339 yystpcpy (char *yydest
, const char *yysrc
)
1342 yystpcpy (yydest
, yysrc
)
1348 const char *yys
= yysrc
;
1350 while ((*yyd
++ = *yys
++) != '\0')
1359 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1360 quotes and backslashes, so that it's suitable for yyerror. The
1361 heuristic is that double-quoting is unnecessary unless the string
1362 contains an apostrophe, a comma, or backslash (other than
1363 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1364 null, do not copy; instead, return the length of what the result
1367 yytnamerr (char *yyres
, const char *yystr
)
1372 char const *yyp
= yystr
;
1379 goto do_not_strip_quotes
;
1383 goto do_not_strip_quotes
;
1396 do_not_strip_quotes
: ;
1400 return yystrlen (yystr
);
1402 return yystpcpy (yyres
, yystr
) - yyres
;
1406 /* Copy into YYRESULT an error message about the unexpected token
1407 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1408 including the terminating null byte. If YYRESULT is null, do not
1409 copy anything; just return the number of bytes that would be
1410 copied. As a special case, return 0 if an ordinary "syntax error"
1411 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1412 size calculation. */
1414 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1416 int yyn
= yypact
[yystate
];
1418 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1422 int yytype
= YYTRANSLATE (yychar
);
1423 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1424 YYSIZE_T yysize
= yysize0
;
1426 int yysize_overflow
= 0;
1427 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1428 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1432 /* This is so xgettext sees the translatable formats that are
1433 constructed on the fly. */
1434 YY_("syntax error, unexpected %s");
1435 YY_("syntax error, unexpected %s, expecting %s");
1436 YY_("syntax error, unexpected %s, expecting %s or %s");
1437 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1438 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1442 static char const yyunexpected
[] = "syntax error, unexpected %s";
1443 static char const yyexpecting
[] = ", expecting %s";
1444 static char const yyor
[] = " or %s";
1445 char yyformat
[sizeof yyunexpected
1446 + sizeof yyexpecting
- 1
1447 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1448 * (sizeof yyor
- 1))];
1449 char const *yyprefix
= yyexpecting
;
1451 /* Start YYX at -YYN if negative to avoid negative indexes in
1453 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1455 /* Stay within bounds of both yycheck and yytname. */
1456 int yychecklim
= YYLAST
- yyn
+ 1;
1457 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1460 yyarg
[0] = yytname
[yytype
];
1461 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1463 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1464 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1466 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1470 yyformat
[sizeof yyunexpected
- 1] = '\0';
1473 yyarg
[yycount
++] = yytname
[yyx
];
1474 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1475 yysize_overflow
|= (yysize1
< yysize
);
1477 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1481 yyf
= YY_(yyformat
);
1482 yysize1
= yysize
+ yystrlen (yyf
);
1483 yysize_overflow
|= (yysize1
< yysize
);
1486 if (yysize_overflow
)
1487 return YYSIZE_MAXIMUM
;
1491 /* Avoid sprintf, as that infringes on the user's name space.
1492 Don't have undefined behavior even if the translation
1493 produced a string with the wrong number of "%s"s. */
1494 char *yyp
= yyresult
;
1496 while ((*yyp
= *yyf
) != '\0')
1498 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1500 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1513 #endif /* YYERROR_VERBOSE */
1516 /*-----------------------------------------------.
1517 | Release the memory associated to this symbol. |
1518 `-----------------------------------------------*/
1521 #if (defined __STDC__ || defined __C99__FUNC__ \
1522 || defined __cplusplus || defined _MSC_VER)
1524 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1527 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1531 YYLTYPE
*yylocationp
;
1535 YYUSE (yylocationp
);
1539 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1550 /* Prevent warnings from -Wmissing-prototypes. */
1552 #ifdef YYPARSE_PARAM
1553 #if defined __STDC__ || defined __cplusplus
1554 int yyparse (void *YYPARSE_PARAM
);
1558 #else /* ! YYPARSE_PARAM */
1559 #if defined __STDC__ || defined __cplusplus
1564 #endif /* ! YYPARSE_PARAM */
1575 #ifdef YYPARSE_PARAM
1576 #if (defined __STDC__ || defined __C99__FUNC__ \
1577 || defined __cplusplus || defined _MSC_VER)
1579 yyparse (void *YYPARSE_PARAM
)
1582 yyparse (YYPARSE_PARAM
)
1583 void *YYPARSE_PARAM
;
1585 #else /* ! YYPARSE_PARAM */
1586 #if (defined __STDC__ || defined __C99__FUNC__ \
1587 || defined __cplusplus || defined _MSC_VER)
1597 /* The lookahead symbol. */
1600 /* The semantic value of the lookahead symbol. */
1603 /* Number of syntax errors so far. */
1605 /* Location data for the lookahead symbol. */
1611 /* Number of tokens to shift before error messages enabled. */
1613 /* Lookahead token as an internal (translated) token number. */
1616 /* Buffer for error messages, and its allocated size. */
1618 char *yymsg
= yymsgbuf
;
1619 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1622 /* Three stacks and their tools:
1623 `yyss': related to states,
1624 `yyvs': related to semantic values,
1625 `yyls': related to locations.
1627 Refer to the stacks thru separate pointers, to allow yyoverflow
1628 to reallocate them elsewhere. */
1630 /* The state stack. */
1631 yytype_int16 yyssa
[YYINITDEPTH
];
1632 yytype_int16
*yyss
= yyssa
;
1633 yytype_int16
*yyssp
;
1635 /* The semantic value stack. */
1636 YYSTYPE yyvsa
[YYINITDEPTH
];
1637 YYSTYPE
*yyvs
= yyvsa
;
1640 /* The location stack. */
1641 YYLTYPE yylsa
[YYINITDEPTH
];
1642 YYLTYPE
*yyls
= yylsa
;
1644 /* The locations where the error started and ended. */
1645 YYLTYPE yyerror_range
[2];
1647 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1649 YYSIZE_T yystacksize
= YYINITDEPTH
;
1651 /* The variables used to return semantic value and location from the
1656 /* The number of symbols on the RHS of the reduced rule.
1657 Keep to zero when no symbol should be popped. */
1660 YYDPRINTF ((stderr
, "Starting parse\n"));
1665 yychar
= YYEMPTY
; /* Cause a token to be read. */
1667 /* Initialize stack pointers.
1668 Waste one element of value and location stack
1669 so that they stay on the same level as the state stack.
1670 The wasted elements are never initialized. */
1675 #if YYLTYPE_IS_TRIVIAL
1676 /* Initialize the default location before parsing starts. */
1677 yylloc
.first_line
= yylloc
.last_line
= 1;
1678 yylloc
.first_column
= yylloc
.last_column
= 1;
1682 /* User initialization code. */
1684 /* Line 1082 of yacc.c */
1685 #line 89 "../../src/parse-gram.y"
1687 /* Bison's grammar can initial empty locations, hence a default
1688 location is needed. */
1689 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1690 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1693 /* Line 1082 of yacc.c */
1694 #line 1695 "../../src/parse-gram.c"
1698 /*------------------------------------------------------------.
1699 | yynewstate -- Push a new state, which is found in yystate. |
1700 `------------------------------------------------------------*/
1702 /* In all cases, when you get here, the value and location stacks
1703 have just been pushed. So pushing a state here evens the stacks. */
1709 if (yyss
+ yystacksize
- 1 <= yyssp
)
1711 /* Get the current used size of the three stacks, in elements. */
1712 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1716 /* Give user a chance to reallocate the stack. Use copies of
1717 these so that the &'s don't force the real ones into
1719 YYSTYPE
*yyvs1
= yyvs
;
1720 yytype_int16
*yyss1
= yyss
;
1721 YYLTYPE
*yyls1
= yyls
;
1723 /* Each stack pointer address is followed by the size of the
1724 data in use in that stack, in bytes. This used to be a
1725 conditional around just the two extra args, but that might
1726 be undefined if yyoverflow is a macro. */
1727 yyoverflow (YY_("memory exhausted"),
1728 &yyss1
, yysize
* sizeof (*yyssp
),
1729 &yyvs1
, yysize
* sizeof (*yyvsp
),
1730 &yyls1
, yysize
* sizeof (*yylsp
),
1736 #else /* no yyoverflow */
1737 # ifndef YYSTACK_RELOCATE
1738 goto yyexhaustedlab
;
1740 /* Extend the stack our own way. */
1741 if (YYMAXDEPTH
<= yystacksize
)
1742 goto yyexhaustedlab
;
1744 if (YYMAXDEPTH
< yystacksize
)
1745 yystacksize
= YYMAXDEPTH
;
1748 yytype_int16
*yyss1
= yyss
;
1749 union yyalloc
*yyptr
=
1750 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1752 goto yyexhaustedlab
;
1753 YYSTACK_RELOCATE (yyss
);
1754 YYSTACK_RELOCATE (yyvs
);
1755 YYSTACK_RELOCATE (yyls
);
1756 # undef YYSTACK_RELOCATE
1758 YYSTACK_FREE (yyss1
);
1761 #endif /* no yyoverflow */
1763 yyssp
= yyss
+ yysize
- 1;
1764 yyvsp
= yyvs
+ yysize
- 1;
1765 yylsp
= yyls
+ yysize
- 1;
1767 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1768 (unsigned long int) yystacksize
));
1770 if (yyss
+ yystacksize
- 1 <= yyssp
)
1774 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1776 if (yystate
== YYFINAL
)
1786 /* Do appropriate processing given the current state. Read a
1787 lookahead token if we need one and don't already have one. */
1789 /* First try to decide what to do without reference to lookahead token. */
1790 yyn
= yypact
[yystate
];
1791 if (yyn
== YYPACT_NINF
)
1794 /* Not known => get a lookahead token if don't already have one. */
1796 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1797 if (yychar
== YYEMPTY
)
1799 YYDPRINTF ((stderr
, "Reading a token: "));
1803 if (yychar
<= YYEOF
)
1805 yychar
= yytoken
= YYEOF
;
1806 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1810 yytoken
= YYTRANSLATE (yychar
);
1811 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1814 /* If the proper action on seeing token YYTOKEN is to reduce or to
1815 detect an error, take that action. */
1817 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1822 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1828 /* Count tokens shifted since error; after three, turn off error
1833 /* Shift the lookahead token. */
1834 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1836 /* Discard the shifted token. */
1845 /*-----------------------------------------------------------.
1846 | yydefault -- do the default action for the current state. |
1847 `-----------------------------------------------------------*/
1849 yyn
= yydefact
[yystate
];
1855 /*-----------------------------.
1856 | yyreduce -- Do a reduction. |
1857 `-----------------------------*/
1859 /* yyn is the number of a rule to reduce with. */
1862 /* If YYLEN is nonzero, implement the default value of the action:
1865 Otherwise, the following line sets YYVAL to garbage.
1866 This behavior is undocumented and Bison
1867 users should not rely upon it. Assigning to YYVAL
1868 unconditionally makes the parser a bit smaller, and it avoids a
1869 GCC warning that YYVAL may be used uninitialized. */
1870 yyval
= yyvsp
[1-yylen
];
1872 /* Default location. */
1873 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1874 YY_REDUCE_PRINT (yyn
);
1879 /* Line 1269 of yacc.c */
1880 #line 223 "../../src/parse-gram.y"
1881 { prologue_augment (translate_code ((yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)])), (yylsp
[(1) - (1)]), union_seen
); }
1886 /* Line 1269 of yacc.c */
1887 #line 224 "../../src/parse-gram.y"
1888 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), true); }
1893 /* Line 1269 of yacc.c */
1894 #line 225 "../../src/parse-gram.y"
1895 { debug_flag
= true; }
1900 /* Line 1269 of yacc.c */
1901 #line 226 "../../src/parse-gram.y"
1902 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1907 /* Line 1269 of yacc.c */
1908 #line 227 "../../src/parse-gram.y"
1909 { defines_flag
= true; }
1914 /* Line 1269 of yacc.c */
1915 #line 228 "../../src/parse-gram.y"
1916 { error_verbose
= true; }
1921 /* Line 1269 of yacc.c */
1922 #line 229 "../../src/parse-gram.y"
1923 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1928 /* Line 1269 of yacc.c */
1929 #line 230 "../../src/parse-gram.y"
1930 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1935 /* Line 1269 of yacc.c */
1936 #line 231 "../../src/parse-gram.y"
1937 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1942 /* Line 1269 of yacc.c */
1943 #line 233 "../../src/parse-gram.y"
1945 nondeterministic_parser
= true;
1952 /* Line 1269 of yacc.c */
1953 #line 238 "../../src/parse-gram.y"
1955 muscle_code_grow ("initial_action", translate_symbol_action ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1961 /* Line 1269 of yacc.c */
1962 #line 241 "../../src/parse-gram.y"
1963 { add_param ("lex_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1968 /* Line 1269 of yacc.c */
1969 #line 242 "../../src/parse-gram.y"
1970 { locations_flag
= true; }
1975 /* Line 1269 of yacc.c */
1976 #line 243 "../../src/parse-gram.y"
1977 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
1982 /* Line 1269 of yacc.c */
1983 #line 244 "../../src/parse-gram.y"
1984 { no_lines_flag
= true; }
1989 /* Line 1269 of yacc.c */
1990 #line 245 "../../src/parse-gram.y"
1991 { nondeterministic_parser
= true; }
1996 /* Line 1269 of yacc.c */
1997 #line 246 "../../src/parse-gram.y"
1998 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2003 /* Line 1269 of yacc.c */
2004 #line 247 "../../src/parse-gram.y"
2005 { add_param ("parse_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2010 /* Line 1269 of yacc.c */
2011 #line 248 "../../src/parse-gram.y"
2012 { muscle_code_grow ("provides", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2017 /* Line 1269 of yacc.c */
2018 #line 249 "../../src/parse-gram.y"
2019 { pure_parser
= true; }
2024 /* Line 1269 of yacc.c */
2025 #line 250 "../../src/parse-gram.y"
2026 { push_parser
= true; }
2031 /* Line 1269 of yacc.c */
2032 #line 251 "../../src/parse-gram.y"
2033 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2038 /* Line 1269 of yacc.c */
2039 #line 252 "../../src/parse-gram.y"
2040 { muscle_code_grow ("requires", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2045 /* Line 1269 of yacc.c */
2046 #line 253 "../../src/parse-gram.y"
2047 { skeleton
= (yyvsp
[(2) - (2)].chars
); }
2052 /* Line 1269 of yacc.c */
2053 #line 254 "../../src/parse-gram.y"
2054 { token_table_flag
= true; }
2059 /* Line 1269 of yacc.c */
2060 #line 255 "../../src/parse-gram.y"
2061 { report_flag
= report_states
; }
2066 /* Line 1269 of yacc.c */
2067 #line 256 "../../src/parse-gram.y"
2068 { yacc_flag
= true; }
2073 /* Line 1269 of yacc.c */
2074 #line 264 "../../src/parse-gram.y"
2076 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2082 /* Line 1269 of yacc.c */
2083 #line 268 "../../src/parse-gram.y"
2086 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2087 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2088 symbol_list_destructor_set (list
, action
, (yylsp
[(2) - (3)]));
2089 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2095 /* Line 1269 of yacc.c */
2096 #line 276 "../../src/parse-gram.y"
2099 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2100 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2101 symbol_list_printer_set (list
, action
, (yylsp
[(2) - (3)]));
2102 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2108 /* Line 1269 of yacc.c */
2109 #line 284 "../../src/parse-gram.y"
2111 default_prec
= true;
2117 /* Line 1269 of yacc.c */
2118 #line 288 "../../src/parse-gram.y"
2120 default_prec
= false;
2126 /* Line 1269 of yacc.c */
2127 #line 301 "../../src/parse-gram.y"
2133 /* Line 1269 of yacc.c */
2134 #line 302 "../../src/parse-gram.y"
2135 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2140 /* Line 1269 of yacc.c */
2141 #line 307 "../../src/parse-gram.y"
2143 char const *body
= (yyvsp
[(3) - (3)].chars
);
2145 /* Concatenate the %union bodies. If this is the first %union, make sure
2146 the synchronization line appears after the opening '{' so as not to
2147 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2148 into '\n', and omit the new %union's leading '{'. */
2151 muscle_grow ("stype", "{", "");
2155 char *code
= muscle_find ("stype");
2156 code
[strlen (code
) - 1] = '\n';
2161 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2167 /* Line 1269 of yacc.c */
2168 #line 334 "../../src/parse-gram.y"
2169 { current_class
= nterm_sym
; }
2174 /* Line 1269 of yacc.c */
2175 #line 335 "../../src/parse-gram.y"
2177 current_class
= unknown_sym
;
2178 current_type
= NULL
;
2184 /* Line 1269 of yacc.c */
2185 #line 339 "../../src/parse-gram.y"
2186 { current_class
= token_sym
; }
2191 /* Line 1269 of yacc.c */
2192 #line 340 "../../src/parse-gram.y"
2194 current_class
= unknown_sym
;
2195 current_type
= NULL
;
2201 /* Line 1269 of yacc.c */
2202 #line 345 "../../src/parse-gram.y"
2206 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2207 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2208 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2214 /* Line 1269 of yacc.c */
2215 #line 356 "../../src/parse-gram.y"
2219 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2221 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2222 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2224 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2225 current_type
= NULL
;
2231 /* Line 1269 of yacc.c */
2232 #line 370 "../../src/parse-gram.y"
2233 { (yyval
.assoc
) = left_assoc
; }
2238 /* Line 1269 of yacc.c */
2239 #line 371 "../../src/parse-gram.y"
2240 { (yyval
.assoc
) = right_assoc
; }
2245 /* Line 1269 of yacc.c */
2246 #line 372 "../../src/parse-gram.y"
2247 { (yyval
.assoc
) = non_assoc
; }
2252 /* Line 1269 of yacc.c */
2253 #line 376 "../../src/parse-gram.y"
2254 { current_type
= NULL
; }
2259 /* Line 1269 of yacc.c */
2260 #line 377 "../../src/parse-gram.y"
2261 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2266 /* Line 1269 of yacc.c */
2267 #line 383 "../../src/parse-gram.y"
2268 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2273 /* Line 1269 of yacc.c */
2274 #line 385 "../../src/parse-gram.y"
2275 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2280 /* Line 1269 of yacc.c */
2281 #line 389 "../../src/parse-gram.y"
2282 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2287 /* Line 1269 of yacc.c */
2288 #line 390 "../../src/parse-gram.y"
2289 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2294 /* Line 1269 of yacc.c */
2295 #line 394 "../../src/parse-gram.y"
2296 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2301 /* Line 1269 of yacc.c */
2302 #line 395 "../../src/parse-gram.y"
2303 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2308 /* Line 1269 of yacc.c */
2309 #line 396 "../../src/parse-gram.y"
2310 { (yyval
.list
) = symbol_list_default_new ((yylsp
[(1) - (1)])); }
2315 /* Line 1269 of yacc.c */
2316 #line 402 "../../src/parse-gram.y"
2318 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2325 /* Line 1269 of yacc.c */
2326 #line 407 "../../src/parse-gram.y"
2328 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2329 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2335 /* Line 1269 of yacc.c */
2336 #line 412 "../../src/parse-gram.y"
2338 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2339 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2340 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2346 /* Line 1269 of yacc.c */
2347 #line 418 "../../src/parse-gram.y"
2349 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2350 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2351 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2357 /* Line 1269 of yacc.c */
2358 #line 424 "../../src/parse-gram.y"
2360 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2361 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2362 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2363 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2369 /* Line 1269 of yacc.c */
2370 #line 454 "../../src/parse-gram.y"
2378 /* Line 1269 of yacc.c */
2379 #line 460 "../../src/parse-gram.y"
2380 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2385 /* Line 1269 of yacc.c */
2386 #line 464 "../../src/parse-gram.y"
2387 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2392 /* Line 1269 of yacc.c */
2393 #line 465 "../../src/parse-gram.y"
2394 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2399 /* Line 1269 of yacc.c */
2400 #line 471 "../../src/parse-gram.y"
2401 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2406 /* Line 1269 of yacc.c */
2407 #line 473 "../../src/parse-gram.y"
2408 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2413 /* Line 1269 of yacc.c */
2414 #line 475 "../../src/parse-gram.y"
2415 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2420 /* Line 1269 of yacc.c */
2421 #line 477 "../../src/parse-gram.y"
2422 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2427 /* Line 1269 of yacc.c */
2428 #line 479 "../../src/parse-gram.y"
2429 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2434 /* Line 1269 of yacc.c */
2435 #line 481 "../../src/parse-gram.y"
2436 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2441 /* Line 1269 of yacc.c */
2442 #line 497 "../../src/parse-gram.y"
2444 static char one
[] = "1";
2445 (yyval
.chars
) = one
;
2451 /* Line 1269 of yacc.c */
2452 #line 507 "../../src/parse-gram.y"
2454 (yyvsp
[(1) - (1)].chars
)[strlen ((yyvsp
[(1) - (1)].chars
)) - 1] = '\n';
2455 (yyval
.chars
) = translate_code ((yyvsp
[(1) - (1)].chars
) + 1, (yylsp
[(1) - (1)]));
2461 /* Line 1269 of yacc.c */
2462 #line 523 "../../src/parse-gram.y"
2463 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2468 /* Line 1269 of yacc.c */
2469 #line 525 "../../src/parse-gram.y"
2471 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2472 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2473 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2479 /* Line 1269 of yacc.c */
2480 #line 533 "../../src/parse-gram.y"
2481 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2486 /* Line 1269 of yacc.c */
2487 #line 545 "../../src/parse-gram.y"
2489 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2490 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2496 /* Line 1269 of yacc.c */
2497 #line 554 "../../src/parse-gram.y"
2499 muscle_code_grow ("epilogue", translate_code ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
2500 gram_scanner_last_string_free ();
2506 /* Line 1269 of yacc.c */
2507 #line 2508 "../../src/parse-gram.c"
2510 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2514 YY_STACK_PRINT (yyss
, yyssp
);
2519 /* Now `shift' the result of the reduction. Determine what state
2520 that goes to, based on the state we popped back to and the rule
2521 number reduced by. */
2525 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2526 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2527 yystate
= yytable
[yystate
];
2529 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2534 /*------------------------------------.
2535 | yyerrlab -- here on detecting error |
2536 `------------------------------------*/
2538 /* If not already recovering from an error, report this error. */
2542 #if ! YYERROR_VERBOSE
2543 yyerror (YY_("syntax error"));
2546 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2547 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2549 YYSIZE_T yyalloc
= 2 * yysize
;
2550 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2551 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2552 if (yymsg
!= yymsgbuf
)
2553 YYSTACK_FREE (yymsg
);
2554 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2556 yymsg_alloc
= yyalloc
;
2560 yymsg_alloc
= sizeof yymsgbuf
;
2564 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2566 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2571 yyerror (YY_("syntax error"));
2573 goto yyexhaustedlab
;
2579 yyerror_range
[0] = yylloc
;
2581 if (yyerrstatus
== 3)
2583 /* If just tried and failed to reuse lookahead token after an
2584 error, discard it. */
2586 if (yychar
<= YYEOF
)
2588 /* Return failure if at end of input. */
2589 if (yychar
== YYEOF
)
2594 yydestruct ("Error: discarding",
2595 yytoken
, &yylval
, &yylloc
);
2600 /* Else will try to reuse lookahead token after shifting the error
2605 /*---------------------------------------------------.
2606 | yyerrorlab -- error raised explicitly by YYERROR. |
2607 `---------------------------------------------------*/
2610 /* Pacify compilers like GCC when the user code never invokes
2611 YYERROR and the label yyerrorlab therefore never appears in user
2613 if (/*CONSTCOND*/ 0)
2616 yyerror_range
[0] = yylsp
[1-yylen
];
2617 /* Do not reclaim the symbols of the rule which action triggered
2621 YY_STACK_PRINT (yyss
, yyssp
);
2626 /*-------------------------------------------------------------.
2627 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2628 `-------------------------------------------------------------*/
2630 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2634 yyn
= yypact
[yystate
];
2635 if (yyn
!= YYPACT_NINF
)
2638 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2646 /* Pop the current state because it cannot handle the error token. */
2650 yyerror_range
[0] = *yylsp
;
2651 yydestruct ("Error: popping",
2652 yystos
[yystate
], yyvsp
, yylsp
);
2655 YY_STACK_PRINT (yyss
, yyssp
);
2660 yyerror_range
[1] = yylloc
;
2661 /* Using YYLLOC is tempting, but would change the location of
2662 the lookahead. YYLOC is available though. */
2663 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2666 /* Shift the error token. */
2667 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2673 /*-------------------------------------.
2674 | yyacceptlab -- YYACCEPT comes here. |
2675 `-------------------------------------*/
2680 /*-----------------------------------.
2681 | yyabortlab -- YYABORT comes here. |
2682 `-----------------------------------*/
2688 /*-------------------------------------------------.
2689 | yyexhaustedlab -- memory exhaustion comes here. |
2690 `-------------------------------------------------*/
2692 yyerror (YY_("memory exhausted"));
2698 if (yychar
!= YYEMPTY
)
2699 yydestruct ("Cleanup: discarding lookahead",
2700 yytoken
, &yylval
, &yylloc
);
2701 /* Do not reclaim the symbols of the rule which action triggered
2702 this YYABORT or YYACCEPT. */
2704 YY_STACK_PRINT (yyss
, yyssp
);
2705 while (yyssp
!= yyss
)
2707 yydestruct ("Cleanup: popping",
2708 yystos
[*yyssp
], yyvsp
, yylsp
);
2713 YYSTACK_FREE (yyss
);
2716 if (yymsg
!= yymsgbuf
)
2717 YYSTACK_FREE (yymsg
);
2719 /* Make sure YYID is used. */
2720 return YYID (yyresult
);
2725 /* Line 1486 of yacc.c */
2726 #line 560 "../../src/parse-gram.y"
2730 /* Return the location of the left-hand side of a rule whose
2731 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2732 the right-hand side, and return an empty location equal to the end
2733 boundary of RHS[0] if the right-hand side is empty. */
2736 lloc_default (YYLTYPE
const *rhs
, int n
)
2741 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2742 The bug is fixed in 7.4.2m, but play it safe for now. */
2743 loc
.start
= rhs
[n
].end
;
2744 loc
.end
= rhs
[n
].end
;
2746 /* Ignore empty nonterminals the start of the the right-hand side.
2747 Do not bother to ignore them at the end of the right-hand side,
2748 since empty nonterminals have the same end as their predecessors. */
2749 for (i
= 1; i
<= n
; i
++)
2750 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2752 loc
.start
= rhs
[i
].start
;
2760 /* Add a lex-param or a parse-param (depending on TYPE) with
2761 declaration DECL and location LOC. */
2764 add_param (char const *type
, char *decl
, location loc
)
2766 static char const alphanum
[26 + 26 + 1 + 10] =
2767 "abcdefghijklmnopqrstuvwxyz"
2768 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2771 char const *name_start
= NULL
;
2774 /* Stop on last actual character. */
2775 for (p
= decl
; p
[1]; p
++)
2777 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2778 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2781 /* Strip the surrounding '{' and '}', and any blanks just inside
2783 while (*--p
== ' ' || *p
== '\t')
2786 while (*++decl
== ' ' || *decl
== '\t')
2790 complain_at (loc
, _("missing identifier in parameter declaration"));
2797 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2801 name
= xmalloc (name_len
+ 1);
2802 memcpy (name
, name_start
, name_len
);
2803 name
[name_len
] = '\0';
2804 muscle_pair_list_grow (type
, decl
, name
);
2808 gram_scanner_last_string_free ();
2813 version_check (location
const *loc
, char const *version
)
2815 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2817 complain_at (*loc
, "require bison %s, but have %s",
2818 version
, PACKAGE_VERSION
);
2824 gram_error (location
const *loc
, char const *msg
)
2826 complain_at (*loc
, "%s", msg
);
2830 token_name (int type
)
2832 return yytname
[YYTRANSLATE (type
)];
2843 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2844 return quotearg_style (escape_quoting_style
, buf
);