1 /* A Bison parser, made by GNU Bison 2.1b. */
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.1b"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 1
61 /* Substitute the variable and function names. */
62 #define yyparse gram_parse
63 #define yylex gram_lex
64 #define yyerror gram_error
65 #define yylval gram_lval
66 #define yychar gram_char
67 #define yydebug gram_debug
68 #define yynerrs gram_nerrs
69 #define yylloc gram_lloc
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
83 PERCENT_DESTRUCTOR
= 263,
84 PERCENT_PRINTER
= 264,
88 PERCENT_NONASSOC
= 268,
93 PERCENT_DEFAULT_PREC
= 273,
95 PERCENT_DEFINES
= 275,
96 PERCENT_ERROR_VERBOSE
= 276,
98 PERCENT_EXPECT_RR
= 278,
99 PERCENT_FILE_PREFIX
= 279,
100 PERCENT_GLR_PARSER
= 280,
101 PERCENT_INITIAL_ACTION
= 281,
102 PERCENT_LEX_PARAM
= 282,
103 PERCENT_LOCATIONS
= 283,
104 PERCENT_NAME_PREFIX
= 284,
105 PERCENT_NO_DEFAULT_PREC
= 285,
106 PERCENT_NO_LINES
= 286,
107 PERCENT_NONDETERMINISTIC_PARSER
= 287,
108 PERCENT_OUTPUT
= 288,
109 PERCENT_PARSE_PARAM
= 289,
110 PERCENT_PURE_PARSER
= 290,
111 PERCENT_REQUIRE
= 291,
112 PERCENT_SKELETON
= 292,
114 PERCENT_TOKEN_TABLE
= 294,
115 PERCENT_VERBOSE
= 295,
123 PERCENT_PERCENT
= 303,
133 #define PERCENT_TOKEN 260
134 #define PERCENT_NTERM 261
135 #define PERCENT_TYPE 262
136 #define PERCENT_DESTRUCTOR 263
137 #define PERCENT_PRINTER 264
138 #define PERCENT_UNION 265
139 #define PERCENT_LEFT 266
140 #define PERCENT_RIGHT 267
141 #define PERCENT_NONASSOC 268
142 #define PERCENT_PREC 269
143 #define PERCENT_DPREC 270
144 #define PERCENT_MERGE 271
145 #define PERCENT_DEBUG 272
146 #define PERCENT_DEFAULT_PREC 273
147 #define PERCENT_DEFINE 274
148 #define PERCENT_DEFINES 275
149 #define PERCENT_ERROR_VERBOSE 276
150 #define PERCENT_EXPECT 277
151 #define PERCENT_EXPECT_RR 278
152 #define PERCENT_FILE_PREFIX 279
153 #define PERCENT_GLR_PARSER 280
154 #define PERCENT_INITIAL_ACTION 281
155 #define PERCENT_LEX_PARAM 282
156 #define PERCENT_LOCATIONS 283
157 #define PERCENT_NAME_PREFIX 284
158 #define PERCENT_NO_DEFAULT_PREC 285
159 #define PERCENT_NO_LINES 286
160 #define PERCENT_NONDETERMINISTIC_PARSER 287
161 #define PERCENT_OUTPUT 288
162 #define PERCENT_PARSE_PARAM 289
163 #define PERCENT_PURE_PARSER 290
164 #define PERCENT_REQUIRE 291
165 #define PERCENT_SKELETON 292
166 #define PERCENT_START 293
167 #define PERCENT_TOKEN_TABLE 294
168 #define PERCENT_VERBOSE 295
169 #define PERCENT_YACC 296
172 #define SEMICOLON 299
176 #define PERCENT_PERCENT 303
179 #define BRACED_CODE 306
184 /* Copy the first part of user declarations. */
185 #line 1 "../../src/parse-gram.y"
186 /* Bison Grammar Parser -*- C -*-
188 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
190 This file is part of Bison, the GNU Compiler Compiler.
192 This program is free software; you can redistribute it and/or modify
193 it under the terms of the GNU General Public License as published by
194 the Free Software Foundation; either version 2 of the License, or
195 (at your option) any later version.
197 This program is distributed in the hope that it will be useful,
198 but WITHOUT ANY WARRANTY; without even the implied warranty of
199 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
200 GNU General Public License for more details.
202 You should have received a copy of the GNU General Public License
203 along with this program; if not, write to the Free Software
204 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
211 #include "complain.h"
212 #include "conflicts.h"
216 #include "muscle_tab.h"
217 #include "quotearg.h"
220 #include "scan-gram.h"
221 #include "scan-code.h"
222 #include "strverscmp.h"
224 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
225 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
227 #define YY_LOCATION_PRINT(File, Loc) \
228 location_print (File, Loc)
230 static void version_check (location
const *loc
, char const *version
);
232 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
233 FIXME: depends on the undocumented availability of YYLLOC. */
235 #define yyerror(Msg) \
236 gram_error (&yylloc, Msg)
237 static void gram_error (location
const *, char const *);
239 static void add_param (char const *, char *, location
);
241 static symbol_class current_class
= unknown_sym
;
242 static uniqstr current_type
= 0;
243 static symbol
*current_lhs
;
244 static location current_lhs_location
;
245 static int current_prec
= 0;
247 #ifdef UINT_FAST8_MAX
248 # define YYTYPE_UINT8 uint_fast8_t
251 # define YYTYPE_INT8 int_fast8_t
253 #ifdef UINT_FAST16_MAX
254 # define YYTYPE_UINT16 uint_fast16_t
256 #ifdef INT_FAST16_MAX
257 # define YYTYPE_INT16 int_fast16_t
261 /* Enabling traces. */
266 /* Enabling verbose error messages. */
267 #ifdef YYERROR_VERBOSE
268 # undef YYERROR_VERBOSE
269 # define YYERROR_VERBOSE 1
271 # define YYERROR_VERBOSE 1
274 /* Enabling the token table. */
275 #ifndef YYTOKEN_TABLE
276 # define YYTOKEN_TABLE 0
279 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
280 typedef union YYSTYPE
281 #line 95 "../../src/parse-gram.y"
290 /* Line 193 of yacc.c. */
291 #line 292 "../../src/parse-gram.c"
293 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
294 # define YYSTYPE_IS_DECLARED 1
295 # define YYSTYPE_IS_TRIVIAL 1
298 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
299 typedef struct YYLTYPE
306 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
307 # define YYLTYPE_IS_DECLARED 1
308 # define YYLTYPE_IS_TRIVIAL 1
312 /* Copy the second part of user declarations. */
315 /* Line 216 of yacc.c. */
316 #line 317 "../../src/parse-gram.c"
323 typedef YYTYPE_UINT8 yytype_uint8
;
325 typedef unsigned char yytype_uint8
;
329 typedef YYTYPE_INT8 yytype_int8
;
330 #elif (defined __STDC__ || defined __C99__FUNC__ \
331 || defined __cplusplus || defined _MSC_VER)
332 typedef signed char yytype_int8
;
334 typedef short int yytype_int8
;
338 typedef YYTYPE_UINT16 yytype_uint16
;
340 typedef unsigned short int yytype_uint16
;
344 typedef YYTYPE_INT16 yytype_int16
;
346 typedef short int yytype_int16
;
350 # ifdef __SIZE_TYPE__
351 # define YYSIZE_T __SIZE_TYPE__
352 # elif defined size_t
353 # define YYSIZE_T size_t
354 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
355 || defined __cplusplus || defined _MSC_VER)
356 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
357 # define YYSIZE_T size_t
359 # define YYSIZE_T unsigned int
363 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
368 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
369 # define YY_(msgid) dgettext ("bison-runtime", msgid)
373 # define YY_(msgid) msgid
377 /* Suppress unused-variable warnings by "using" E. */
378 #if ! defined lint || defined __GNUC__
379 # define YYUSE(e) ((void) (e))
381 # define YYUSE(e) /* empty */
384 /* Identity function, used to suppress warnings about constant conditions. */
388 #if (defined __STDC__ || defined __C99__FUNC__ \
389 || defined __cplusplus || defined _MSC_VER)
402 #if ! defined yyoverflow || YYERROR_VERBOSE
404 /* The parser invokes alloca or malloc; define the necessary symbols. */
406 # ifdef YYSTACK_USE_ALLOCA
407 # if YYSTACK_USE_ALLOCA
409 # define YYSTACK_ALLOC __builtin_alloca
410 # elif defined __BUILTIN_VA_ARG_INCR
411 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
413 # define YYSTACK_ALLOC __alloca
414 # elif defined _MSC_VER
415 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
416 # define alloca _alloca
418 # define YYSTACK_ALLOC alloca
419 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
420 || defined __cplusplus || defined _MSC_VER)
421 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
430 # ifdef YYSTACK_ALLOC
431 /* Pacify GCC's `empty if-body' warning. */
432 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
433 # ifndef YYSTACK_ALLOC_MAXIMUM
434 /* The OS might guarantee only one guard page at the bottom of the stack,
435 and a page size can be as small as 4096 bytes. So we cannot safely
436 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
437 to allow for a few compiler-allocated temporary stack slots. */
438 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
441 # define YYSTACK_ALLOC YYMALLOC
442 # define YYSTACK_FREE YYFREE
443 # ifndef YYSTACK_ALLOC_MAXIMUM
444 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
446 # if (defined __cplusplus && ! defined _STDLIB_H \
447 && ! ((defined YYMALLOC || defined malloc) \
448 && (defined YYFREE || defined free)))
449 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
455 # define YYMALLOC malloc
456 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
457 || defined __cplusplus || defined _MSC_VER)
458 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
463 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
464 || defined __cplusplus || defined _MSC_VER)
465 void free (void *); /* INFRINGES ON USER NAME SPACE */
469 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
472 #if (! defined yyoverflow \
473 && (! defined __cplusplus \
474 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
475 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
477 /* A type that is properly aligned for any stack member. */
485 /* The size of the maximum gap between one aligned stack and the next. */
486 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
488 /* The size of an array large to enough to hold all stacks, each with
490 # define YYSTACK_BYTES(N) \
491 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
492 + 2 * YYSTACK_GAP_MAXIMUM)
494 /* Copy COUNT objects from FROM to TO. The source and destination do
497 # if defined __GNUC__ && 1 < __GNUC__
498 # define YYCOPY(To, From, Count) \
499 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
501 # define YYCOPY(To, From, Count) \
505 for (yyi = 0; yyi < (Count); yyi++) \
506 (To)[yyi] = (From)[yyi]; \
512 /* Relocate STACK from its old location to the new one. The
513 local variables YYSIZE and YYSTACKSIZE give the old and new number of
514 elements in the stack, and YYPTR gives the new location of the
515 stack. Advance YYPTR to a properly aligned location for the next
517 # define YYSTACK_RELOCATE(Stack) \
520 YYSIZE_T yynewbytes; \
521 YYCOPY (&yyptr->Stack, Stack, yysize); \
522 Stack = &yyptr->Stack; \
523 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
524 yyptr += yynewbytes / sizeof (*yyptr); \
530 /* YYFINAL -- State number of the termination state. */
532 /* YYLAST -- Last index in YYTABLE. */
535 /* YYNTOKENS -- Number of terminals. */
537 /* YYNNTS -- Number of nonterminals. */
539 /* YYNRULES -- Number of rules. */
541 /* YYNRULES -- Number of states. */
542 #define YYNSTATES 114
544 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
546 #define YYMAXUTOK 306
548 #define YYTRANSLATE(YYX) \
549 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
551 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
552 static const yytype_uint8 yytranslate
[] =
554 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
580 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
581 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
582 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
583 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
584 45, 46, 47, 48, 49, 50, 51
588 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
590 static const yytype_uint8 yyprhs
[] =
592 0, 0, 3, 8, 9, 12, 14, 16, 18, 21,
593 25, 27, 29, 32, 35, 39, 41, 44, 47, 49,
594 53, 55, 57, 61, 64, 66, 69, 72, 74, 76,
595 78, 80, 82, 84, 87, 89, 93, 97, 99, 101,
596 102, 106, 107, 111, 115, 119, 121, 123, 125, 126,
597 128, 130, 133, 135, 137, 140, 143, 147, 149, 152,
598 154, 157, 159, 162, 165, 166, 170, 172, 176, 179,
599 180, 183, 186, 190, 194, 198, 200, 202, 204, 206,
603 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
604 static const yytype_int8 yyrhs
[] =
606 53, 0, -1, 54, 48, 66, 75, -1, -1, 54,
607 55, -1, 56, -1, 49, -1, 17, -1, 19, 74,
608 -1, 19, 74, 74, -1, 20, -1, 21, -1, 22,
609 4, -1, 23, 4, -1, 24, 43, 74, -1, 25,
610 -1, 26, 51, -1, 27, 51, -1, 28, -1, 29,
611 43, 74, -1, 31, -1, 32, -1, 33, 43, 74,
612 -1, 34, 51, -1, 35, -1, 36, 74, -1, 37,
613 74, -1, 39, -1, 40, -1, 41, -1, 44, -1,
614 60, -1, 57, -1, 38, 72, -1, 10, -1, 8,
615 51, 63, -1, 9, 51, 63, -1, 18, -1, 30,
616 -1, -1, 6, 58, 65, -1, -1, 5, 59, 65,
617 -1, 7, 42, 63, -1, 61, 62, 63, -1, 11,
618 -1, 12, -1, 13, -1, -1, 42, -1, 72, -1,
619 63, 72, -1, 42, -1, 46, -1, 46, 4, -1,
620 46, 73, -1, 46, 4, 73, -1, 64, -1, 65,
621 64, -1, 67, -1, 66, 67, -1, 68, -1, 56,
622 44, -1, 1, 44, -1, -1, 47, 69, 70, -1,
623 71, -1, 70, 45, 71, -1, 70, 44, -1, -1,
624 71, 72, -1, 71, 51, -1, 71, 14, 72, -1,
625 71, 15, 4, -1, 71, 16, 42, -1, 46, -1,
626 73, -1, 3, -1, 3, -1, -1, 48, 50, -1
629 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
630 static const yytype_uint16 yyrline
[] =
632 0, 194, 194, 202, 204, 208, 209, 211, 212, 217,
633 218, 219, 220, 221, 222, 223, 228, 232, 233, 234,
634 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
635 245, 249, 250, 251, 255, 271, 279, 287, 291, 298,
636 298, 303, 303, 308, 318, 333, 334, 335, 339, 340,
637 345, 346, 351, 355, 360, 366, 372, 383, 384, 393,
638 394, 400, 401, 402, 409, 409, 413, 414, 415, 420,
639 421, 423, 426, 428, 430, 435, 436, 441, 450, 455,
644 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
645 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
646 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
647 static const char *const yytname
[] =
649 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
650 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
651 "\"%printer\"", "\"%union {...}\"", "\"%left\"", "\"%right\"",
652 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%debug\"",
653 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
654 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
655 "\"%initial-action\"", "\"%lex-param\"", "\"%locations\"",
656 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
657 "\"%nondeterministic-parser\"", "\"%output\"", "\"%parse-param\"",
658 "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"", "\"%start\"",
659 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"type\"", "\"=\"",
660 "\";\"", "\"|\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
661 "\"%{...%}\"", "\"epilogue\"", "\"{...}\"", "$accept", "input",
662 "declarations", "declaration", "grammar_declaration",
663 "symbol_declaration", "@1", "@2", "precedence_declaration",
664 "precedence_declarator", "type.opt", "symbols.1", "symbol_def",
665 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
666 "@3", "rhses.1", "rhs", "symbol", "string_as_id", "string_content",
672 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
674 static const yytype_uint16 yytoknum
[] =
676 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
677 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
678 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
679 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
680 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
685 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
686 static const yytype_uint8 yyr1
[] =
688 0, 52, 53, 54, 54, 55, 55, 55, 55, 55,
689 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
690 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
691 55, 56, 56, 56, 56, 56, 56, 56, 56, 58,
692 57, 59, 57, 57, 60, 61, 61, 61, 62, 62,
693 63, 63, 64, 64, 64, 64, 64, 65, 65, 66,
694 66, 67, 67, 67, 69, 68, 70, 70, 70, 71,
695 71, 71, 71, 71, 71, 72, 72, 73, 74, 75,
699 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
700 static const yytype_uint8 yyr2
[] =
702 0, 2, 4, 0, 2, 1, 1, 1, 2, 3,
703 1, 1, 2, 2, 3, 1, 2, 2, 1, 3,
704 1, 1, 3, 2, 1, 2, 2, 1, 1, 1,
705 1, 1, 1, 2, 1, 3, 3, 1, 1, 0,
706 3, 0, 3, 3, 3, 1, 1, 1, 0, 1,
707 1, 2, 1, 1, 2, 2, 3, 1, 2, 1,
708 2, 1, 2, 2, 0, 3, 1, 3, 2, 0,
709 2, 2, 3, 3, 3, 1, 1, 1, 1, 0,
713 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
714 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
715 means the default is an error. */
716 static const yytype_uint8 yydefact
[] =
718 3, 0, 0, 1, 41, 39, 0, 0, 0, 34,
719 45, 46, 47, 7, 37, 0, 10, 11, 0, 0,
720 0, 15, 0, 0, 18, 0, 38, 20, 21, 0,
721 0, 24, 0, 0, 0, 27, 28, 29, 30, 0,
722 6, 4, 5, 32, 31, 48, 0, 0, 0, 0,
723 0, 78, 8, 12, 13, 0, 16, 17, 0, 0,
724 23, 25, 26, 77, 75, 33, 76, 0, 64, 0,
725 0, 59, 61, 49, 0, 52, 53, 57, 42, 40,
726 43, 50, 35, 36, 9, 14, 19, 22, 63, 69,
727 62, 0, 60, 2, 44, 54, 55, 58, 51, 65,
728 66, 80, 56, 68, 69, 0, 0, 0, 71, 70,
732 /* YYDEFGOTO[NTERM-NUM]. */
733 static const yytype_int8 yydefgoto
[] =
735 -1, 1, 2, 41, 69, 43, 47, 46, 44, 45,
736 74, 80, 77, 78, 70, 71, 72, 89, 99, 100,
740 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
742 #define YYPACT_NINF -72
743 static const yytype_int8 yypact
[] =
745 -72, 7, 115, -72, -72, -72, -22, -17, -16, -72,
746 -72, -72, -72, -72, -72, 26, -72, -72, 32, 33,
747 -3, -72, -8, -6, -72, 4, -72, -72, -72, 9,
748 2, -72, 26, 26, -2, -72, -72, -72, -72, 72,
749 -72, -72, -72, -72, -72, 12, -40, -40, -2, -2,
750 -2, -72, 26, -72, -72, 26, -72, -72, 26, 26,
751 -72, -72, -72, -72, -72, -72, -72, 11, -72, 13,
752 3, -72, -72, -72, -2, -72, 19, -72, -40, -40,
753 -2, -72, -2, -2, -72, -72, -72, -72, -72, -72,
754 -72, 18, -72, -72, -2, 53, -72, -72, -72, -19,
755 16, -72, -72, -72, -72, -2, 55, 21, -72, -72,
759 /* YYPGOTO[NTERM-NUM]. */
760 static const yytype_int8 yypgoto
[] =
762 -72, -72, -72, -72, 67, -72, -72, -72, -72, -72,
763 -72, -32, -51, 23, -72, 5, -72, -72, -72, -30,
767 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
768 positive, shift that token. If negative, reduce the rule which
769 number is the opposite. If zero, do what YYDEFACT says.
770 If YYTABLE_NINF, syntax error. */
771 #define YYTABLE_NINF -80
772 static const yytype_int8 yytable
[] =
774 65, 63, 75, -79, 67, 96, 76, 3, 4, 5,
775 6, 7, 8, 9, 10, 11, 12, 82, 83, 63,
776 48, 14, 63, 95, 102, 103, 104, 97, 97, 51,
777 105, 106, 107, 26, 49, 50, 53, 54, 61, 62,
778 55, 34, 94, 56, 64, 57, 98, 58, 98, 98,
779 68, 91, 59, 60, 73, 88, 63, 90, 84, 112,
780 98, 85, 64, 113, 86, 87, 109, 108, 101, 42,
781 79, 111, 0, 67, 110, 92, 109, 4, 5, 6,
782 7, 8, 9, 10, 11, 12, 0, 0, 0, 0,
783 14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
784 0, 0, 26, 0, 0, 0, 0, 0, 0, 0,
785 34, 0, 0, 0, 0, 0, 0, 0, 0, 68,
786 4, 5, 6, 7, 8, 9, 10, 11, 12, 0,
787 0, 0, 13, 14, 15, 16, 17, 18, 19, 20,
788 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
789 31, 32, 33, 34, 35, 36, 37, 0, 0, 38,
793 static const yytype_int8 yycheck
[] =
795 34, 3, 42, 0, 1, 76, 46, 0, 5, 6,
796 7, 8, 9, 10, 11, 12, 13, 49, 50, 3,
797 42, 18, 3, 4, 95, 44, 45, 78, 79, 3,
798 14, 15, 16, 30, 51, 51, 4, 4, 32, 33,
799 43, 38, 74, 51, 46, 51, 80, 43, 82, 83,
800 47, 48, 43, 51, 42, 44, 3, 44, 52, 4,
801 94, 55, 46, 42, 58, 59, 100, 51, 50, 2,
802 47, 105, -1, 1, 104, 70, 110, 5, 6, 7,
803 8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
804 18, -1, -1, -1, -1, -1, -1, -1, -1, -1,
805 -1, -1, 30, -1, -1, -1, -1, -1, -1, -1,
806 38, -1, -1, -1, -1, -1, -1, -1, -1, 47,
807 5, 6, 7, 8, 9, 10, 11, 12, 13, -1,
808 -1, -1, 17, 18, 19, 20, 21, 22, 23, 24,
809 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
810 35, 36, 37, 38, 39, 40, 41, -1, -1, 44,
814 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
815 symbol of state STATE-NUM. */
816 static const yytype_uint8 yystos
[] =
818 0, 53, 54, 0, 5, 6, 7, 8, 9, 10,
819 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
820 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
821 34, 35, 36, 37, 38, 39, 40, 41, 44, 48,
822 49, 55, 56, 57, 60, 61, 59, 58, 42, 51,
823 51, 3, 74, 4, 4, 43, 51, 51, 43, 43,
824 51, 74, 74, 3, 46, 72, 73, 1, 47, 56,
825 66, 67, 68, 42, 62, 42, 46, 64, 65, 65,
826 63, 72, 63, 63, 74, 74, 74, 74, 44, 69,
827 44, 48, 67, 75, 63, 4, 73, 64, 72, 70,
828 71, 50, 73, 44, 45, 14, 15, 16, 51, 72,
832 #define yyerrok (yyerrstatus = 0)
833 #define yyclearin (yychar = YYEMPTY)
837 #define YYACCEPT goto yyacceptlab
838 #define YYABORT goto yyabortlab
839 #define YYERROR goto yyerrorlab
842 /* Like YYERROR except do call yyerror. This remains here temporarily
843 to ease the transition to the new meaning of YYERROR, for GCC.
844 Once GCC version 2 has supplanted version 1, this can go. */
846 #define YYFAIL goto yyerrlab
848 #define YYRECOVERING() (!!yyerrstatus)
850 #define YYBACKUP(Token, Value) \
852 if (yychar == YYEMPTY && yylen == 1) \
856 yytoken = YYTRANSLATE (yychar); \
862 yyerror (YY_("syntax error: cannot back up")); \
869 #define YYERRCODE 256
872 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
873 If N is 0, then set CURRENT to the empty location which ends
874 the previous symbol: RHS[0] (always defined). */
876 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
877 #ifndef YYLLOC_DEFAULT
878 # define YYLLOC_DEFAULT(Current, Rhs, N) \
882 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
883 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
884 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
885 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
889 (Current).first_line = (Current).last_line = \
890 YYRHSLOC (Rhs, 0).last_line; \
891 (Current).first_column = (Current).last_column = \
892 YYRHSLOC (Rhs, 0).last_column; \
898 /* YY_LOCATION_PRINT -- Print the location on the stream.
899 This macro was not mandated originally: define only if we know
900 we won't break user code: when these are the locations we know. */
902 #ifndef YY_LOCATION_PRINT
903 # if YYLTYPE_IS_TRIVIAL
904 # define YY_LOCATION_PRINT(File, Loc) \
905 fprintf (File, "%d.%d-%d.%d", \
906 (Loc).first_line, (Loc).first_column, \
907 (Loc).last_line, (Loc).last_column)
909 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
914 /* YYLEX -- calling `yylex' with the right arguments. */
917 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
919 # define YYLEX yylex (&yylval, &yylloc)
922 /* Enable debugging if requested. */
926 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
927 # define YYFPRINTF fprintf
930 # define YYDPRINTF(Args) \
936 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
940 YYFPRINTF (stderr, "%s ", Title); \
941 yy_symbol_print (stderr, \
942 Type, Value, Location); \
943 YYFPRINTF (stderr, "\n"); \
948 /*--------------------------------.
949 | Print this symbol on YYOUTPUT. |
950 `--------------------------------*/
953 #if (defined __STDC__ || defined __C99__FUNC__ \
954 || defined __cplusplus || defined _MSC_VER)
956 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
959 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
962 YYSTYPE
const * const yyvaluep
;
963 YYLTYPE
const * const yylocationp
;
970 if (yytype
< YYNTOKENS
)
971 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
977 case 3: /* "\"string\"" */
978 #line 175 "../../src/parse-gram.y"
979 { fprintf (stderr
, "\"%s\"", (yyvaluep
->chars
)); };
980 #line 981 "../../src/parse-gram.c"
982 case 4: /* "\"integer\"" */
983 #line 184 "../../src/parse-gram.y"
984 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
985 #line 986 "../../src/parse-gram.c"
987 case 10: /* "\"%union {...}\"" */
988 #line 177 "../../src/parse-gram.y"
989 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
990 #line 991 "../../src/parse-gram.c"
992 case 42: /* "\"type\"" */
993 #line 182 "../../src/parse-gram.y"
994 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
995 #line 996 "../../src/parse-gram.c"
997 case 46: /* "\"identifier\"" */
998 #line 186 "../../src/parse-gram.y"
999 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1000 #line 1001 "../../src/parse-gram.c"
1002 case 47: /* "\"identifier:\"" */
1003 #line 188 "../../src/parse-gram.y"
1004 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1005 #line 1006 "../../src/parse-gram.c"
1007 case 49: /* "\"%{...%}\"" */
1008 #line 177 "../../src/parse-gram.y"
1009 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1010 #line 1011 "../../src/parse-gram.c"
1012 case 50: /* "\"epilogue\"" */
1013 #line 177 "../../src/parse-gram.y"
1014 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1015 #line 1016 "../../src/parse-gram.c"
1017 case 51: /* "\"{...}\"" */
1018 #line 177 "../../src/parse-gram.y"
1019 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1020 #line 1021 "../../src/parse-gram.c"
1022 case 72: /* "symbol" */
1023 #line 186 "../../src/parse-gram.y"
1024 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1025 #line 1026 "../../src/parse-gram.c"
1027 case 73: /* "string_as_id" */
1028 #line 186 "../../src/parse-gram.y"
1029 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1030 #line 1031 "../../src/parse-gram.c"
1032 case 74: /* "string_content" */
1033 #line 175 "../../src/parse-gram.y"
1034 { fprintf (stderr
, "\"%s\"", (yyvaluep
->chars
)); };
1035 #line 1036 "../../src/parse-gram.c"
1043 /*--------------------------------.
1044 | Print this symbol on YYOUTPUT. |
1045 `--------------------------------*/
1047 #if (defined __STDC__ || defined __C99__FUNC__ \
1048 || defined __cplusplus || defined _MSC_VER)
1050 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1053 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1056 YYSTYPE
const * const yyvaluep
;
1057 YYLTYPE
const * const yylocationp
;
1060 if (yytype
< YYNTOKENS
)
1061 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1063 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1065 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1066 YYFPRINTF (yyoutput
, ": ");
1067 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1068 YYFPRINTF (yyoutput
, ")");
1071 /*------------------------------------------------------------------.
1072 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1074 `------------------------------------------------------------------*/
1076 #if (defined __STDC__ || defined __C99__FUNC__ \
1077 || defined __cplusplus || defined _MSC_VER)
1079 yy_stack_print (yytype_int16
*bottom
, yytype_int16
*top
)
1082 yy_stack_print (bottom
, top
)
1083 yytype_int16
*bottom
;
1087 YYFPRINTF (stderr
, "Stack now");
1088 for (; bottom
<= top
; ++bottom
)
1089 YYFPRINTF (stderr
, " %d", *bottom
);
1090 YYFPRINTF (stderr
, "\n");
1093 # define YY_STACK_PRINT(Bottom, Top) \
1096 yy_stack_print ((Bottom), (Top)); \
1100 /*------------------------------------------------.
1101 | Report that the YYRULE is going to be reduced. |
1102 `------------------------------------------------*/
1104 #if (defined __STDC__ || defined __C99__FUNC__ \
1105 || defined __cplusplus || defined _MSC_VER)
1107 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1110 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1116 int yynrhs
= yyr2
[yyrule
];
1118 unsigned long int yylno
= yyrline
[yyrule
];
1119 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1121 /* The symbols being reduced. */
1122 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1124 fprintf (stderr
, " $%d = ", yyi
+ 1);
1125 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1126 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1127 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1128 fprintf (stderr
, "\n");
1132 # define YY_REDUCE_PRINT(Rule) \
1135 yy_reduce_print (yyvsp, yylsp, Rule); \
1138 /* Nonzero means print parse trace. It is left uninitialized so that
1139 multiple parsers can coexist. */
1141 #else /* !YYDEBUG */
1142 # define YYDPRINTF(Args)
1143 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1144 # define YY_STACK_PRINT(Bottom, Top)
1145 # define YY_REDUCE_PRINT(Rule)
1146 #endif /* !YYDEBUG */
1149 /* YYINITDEPTH -- initial size of the parser's stacks. */
1151 # define YYINITDEPTH 200
1154 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1155 if the built-in stack extension method is used).
1157 Do not make this value too large; the results are undefined if
1158 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1159 evaluated with infinite-precision integer arithmetic. */
1162 # define YYMAXDEPTH 10000
1170 # if defined __GLIBC__ && defined _STRING_H
1171 # define yystrlen strlen
1173 /* Return the length of YYSTR. */
1174 #if (defined __STDC__ || defined __C99__FUNC__ \
1175 || defined __cplusplus || defined _MSC_VER)
1177 yystrlen (const char *yystr
)
1185 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1193 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1194 # define yystpcpy stpcpy
1196 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1198 #if (defined __STDC__ || defined __C99__FUNC__ \
1199 || defined __cplusplus || defined _MSC_VER)
1201 yystpcpy (char *yydest
, const char *yysrc
)
1204 yystpcpy (yydest
, yysrc
)
1210 const char *yys
= yysrc
;
1212 while ((*yyd
++ = *yys
++) != '\0')
1221 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1222 quotes and backslashes, so that it's suitable for yyerror. The
1223 heuristic is that double-quoting is unnecessary unless the string
1224 contains an apostrophe, a comma, or backslash (other than
1225 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1226 null, do not copy; instead, return the length of what the result
1229 yytnamerr (char *yyres
, const char *yystr
)
1234 char const *yyp
= yystr
;
1241 goto do_not_strip_quotes
;
1245 goto do_not_strip_quotes
;
1258 do_not_strip_quotes
: ;
1262 return yystrlen (yystr
);
1264 return yystpcpy (yyres
, yystr
) - yyres
;
1268 /* Copy into YYRESULT an error message about the unexpected token
1269 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1270 including the terminating null byte. If YYRESULT is null, do not
1271 copy anything; just return the number of bytes that would be
1272 copied. As a special case, return 0 if an ordinary "syntax error"
1273 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1274 size calculation. */
1276 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1278 int yyn
= yypact
[yystate
];
1280 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1284 int yytype
= YYTRANSLATE (yychar
);
1285 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1286 YYSIZE_T yysize
= yysize0
;
1288 int yysize_overflow
= 0;
1289 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1290 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1294 /* This is so xgettext sees the translatable formats that are
1295 constructed on the fly. */
1296 YY_("syntax error, unexpected %s");
1297 YY_("syntax error, unexpected %s, expecting %s");
1298 YY_("syntax error, unexpected %s, expecting %s or %s");
1299 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1300 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1304 static char const yyunexpected
[] = "syntax error, unexpected %s";
1305 static char const yyexpecting
[] = ", expecting %s";
1306 static char const yyor
[] = " or %s";
1307 char yyformat
[sizeof yyunexpected
1308 + sizeof yyexpecting
- 1
1309 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1310 * (sizeof yyor
- 1))];
1311 char const *yyprefix
= yyexpecting
;
1313 /* Start YYX at -YYN if negative to avoid negative indexes in
1315 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1317 /* Stay within bounds of both yycheck and yytname. */
1318 int yychecklim
= YYLAST
- yyn
+ 1;
1319 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1322 yyarg
[0] = yytname
[yytype
];
1323 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1325 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1326 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1328 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1332 yyformat
[sizeof yyunexpected
- 1] = '\0';
1335 yyarg
[yycount
++] = yytname
[yyx
];
1336 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1337 yysize_overflow
|= (yysize1
< yysize
);
1339 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1343 yyf
= YY_(yyformat
);
1344 yysize1
= yysize
+ yystrlen (yyf
);
1345 yysize_overflow
|= (yysize1
< yysize
);
1348 if (yysize_overflow
)
1349 return YYSIZE_MAXIMUM
;
1353 /* Avoid sprintf, as that infringes on the user's name space.
1354 Don't have undefined behavior even if the translation
1355 produced a string with the wrong number of "%s"s. */
1356 char *yyp
= yyresult
;
1358 while ((*yyp
= *yyf
) != '\0')
1360 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1362 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1375 #endif /* YYERROR_VERBOSE */
1378 /*-----------------------------------------------.
1379 | Release the memory associated to this symbol. |
1380 `-----------------------------------------------*/
1383 #if (defined __STDC__ || defined __C99__FUNC__ \
1384 || defined __cplusplus || defined _MSC_VER)
1386 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1389 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1393 YYLTYPE
*yylocationp
;
1397 YYUSE (yylocationp
);
1401 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1412 /* Prevent warnings from -Wmissing-prototypes. */
1414 #ifdef YYPARSE_PARAM
1415 #if defined __STDC__ || defined __cplusplus
1416 int yyparse (void *YYPARSE_PARAM
);
1420 #else /* ! YYPARSE_PARAM */
1421 #if defined __STDC__ || defined __cplusplus
1426 #endif /* ! YYPARSE_PARAM */
1437 #ifdef YYPARSE_PARAM
1438 #if (defined __STDC__ || defined __C99__FUNC__ \
1439 || defined __cplusplus || defined _MSC_VER)
1441 yyparse (void *YYPARSE_PARAM
)
1444 yyparse (YYPARSE_PARAM
)
1445 void *YYPARSE_PARAM
;
1447 #else /* ! YYPARSE_PARAM */
1448 #if (defined __STDC__ || defined __C99__FUNC__ \
1449 || defined __cplusplus || defined _MSC_VER)
1459 /* The look-ahead symbol. */
1462 /* The semantic value of the look-ahead symbol. */
1465 /* Number of syntax errors so far. */
1467 /* Location data for the look-ahead symbol. */
1473 /* Number of tokens to shift before error messages enabled. */
1475 /* Look-ahead token as an internal (translated) token number. */
1478 /* Buffer for error messages, and its allocated size. */
1480 char *yymsg
= yymsgbuf
;
1481 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1484 /* Three stacks and their tools:
1485 `yyss': related to states,
1486 `yyvs': related to semantic values,
1487 `yyls': related to locations.
1489 Refer to the stacks thru separate pointers, to allow yyoverflow
1490 to reallocate them elsewhere. */
1492 /* The state stack. */
1493 yytype_int16 yyssa
[YYINITDEPTH
];
1494 yytype_int16
*yyss
= yyssa
;
1495 yytype_int16
*yyssp
;
1497 /* The semantic value stack. */
1498 YYSTYPE yyvsa
[YYINITDEPTH
];
1499 YYSTYPE
*yyvs
= yyvsa
;
1502 /* The location stack. */
1503 YYLTYPE yylsa
[YYINITDEPTH
];
1504 YYLTYPE
*yyls
= yylsa
;
1506 /* The locations where the error started and ended. */
1507 YYLTYPE yyerror_range
[2];
1509 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1511 YYSIZE_T yystacksize
= YYINITDEPTH
;
1513 /* The variables used to return semantic value and location from the
1518 /* The number of symbols on the RHS of the reduced rule.
1519 Keep to zero when no symbol should be popped. */
1522 YYDPRINTF ((stderr
, "Starting parse\n"));
1527 yychar
= YYEMPTY
; /* Cause a token to be read. */
1529 /* Initialize stack pointers.
1530 Waste one element of value and location stack
1531 so that they stay on the same level as the state stack.
1532 The wasted elements are never initialized. */
1537 #if YYLTYPE_IS_TRIVIAL
1538 /* Initialize the default location before parsing starts. */
1539 yylloc
.first_line
= yylloc
.last_line
= 1;
1540 yylloc
.first_column
= yylloc
.last_column
= 0;
1544 /* User initialization code. */
1545 #line 86 "../../src/parse-gram.y"
1547 /* Bison's grammar can initial empty locations, hence a default
1548 location is needed. */
1549 boundary_set (&yylloc
.start
, current_file
, 1, 0);
1550 boundary_set (&yylloc
.end
, current_file
, 1, 0);
1552 /* Line 1078 of yacc.c. */
1553 #line 1554 "../../src/parse-gram.c"
1557 /*------------------------------------------------------------.
1558 | yynewstate -- Push a new state, which is found in yystate. |
1559 `------------------------------------------------------------*/
1561 /* In all cases, when you get here, the value and location stacks
1562 have just been pushed. So pushing a state here evens the stacks. */
1568 if (yyss
+ yystacksize
- 1 <= yyssp
)
1570 /* Get the current used size of the three stacks, in elements. */
1571 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1575 /* Give user a chance to reallocate the stack. Use copies of
1576 these so that the &'s don't force the real ones into
1578 YYSTYPE
*yyvs1
= yyvs
;
1579 yytype_int16
*yyss1
= yyss
;
1580 YYLTYPE
*yyls1
= yyls
;
1582 /* Each stack pointer address is followed by the size of the
1583 data in use in that stack, in bytes. This used to be a
1584 conditional around just the two extra args, but that might
1585 be undefined if yyoverflow is a macro. */
1586 yyoverflow (YY_("memory exhausted"),
1587 &yyss1
, yysize
* sizeof (*yyssp
),
1588 &yyvs1
, yysize
* sizeof (*yyvsp
),
1589 &yyls1
, yysize
* sizeof (*yylsp
),
1595 #else /* no yyoverflow */
1596 # ifndef YYSTACK_RELOCATE
1597 goto yyexhaustedlab
;
1599 /* Extend the stack our own way. */
1600 if (YYMAXDEPTH
<= yystacksize
)
1601 goto yyexhaustedlab
;
1603 if (YYMAXDEPTH
< yystacksize
)
1604 yystacksize
= YYMAXDEPTH
;
1607 yytype_int16
*yyss1
= yyss
;
1608 union yyalloc
*yyptr
=
1609 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1611 goto yyexhaustedlab
;
1612 YYSTACK_RELOCATE (yyss
);
1613 YYSTACK_RELOCATE (yyvs
);
1614 YYSTACK_RELOCATE (yyls
);
1615 # undef YYSTACK_RELOCATE
1617 YYSTACK_FREE (yyss1
);
1620 #endif /* no yyoverflow */
1622 yyssp
= yyss
+ yysize
- 1;
1623 yyvsp
= yyvs
+ yysize
- 1;
1624 yylsp
= yyls
+ yysize
- 1;
1626 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1627 (unsigned long int) yystacksize
));
1629 if (yyss
+ yystacksize
- 1 <= yyssp
)
1633 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1642 /* Do appropriate processing given the current state. Read a
1643 look-ahead token if we need one and don't already have one. */
1645 /* First try to decide what to do without reference to look-ahead token. */
1646 yyn
= yypact
[yystate
];
1647 if (yyn
== YYPACT_NINF
)
1650 /* Not known => get a look-ahead token if don't already have one. */
1652 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1653 if (yychar
== YYEMPTY
)
1655 YYDPRINTF ((stderr
, "Reading a token: "));
1659 if (yychar
<= YYEOF
)
1661 yychar
= yytoken
= YYEOF
;
1662 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1666 yytoken
= YYTRANSLATE (yychar
);
1667 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1670 /* If the proper action on seeing token YYTOKEN is to reduce or to
1671 detect an error, take that action. */
1673 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1678 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1687 /* Count tokens shifted since error; after three, turn off error
1692 /* Shift the look-ahead token. */
1693 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1695 /* Discard the shifted token unless it is eof. */
1696 if (yychar
!= YYEOF
)
1705 /*-----------------------------------------------------------.
1706 | yydefault -- do the default action for the current state. |
1707 `-----------------------------------------------------------*/
1709 yyn
= yydefact
[yystate
];
1715 /*-----------------------------.
1716 | yyreduce -- Do a reduction. |
1717 `-----------------------------*/
1719 /* yyn is the number of a rule to reduce with. */
1722 /* If YYLEN is nonzero, implement the default value of the action:
1725 Otherwise, the following line sets YYVAL to garbage.
1726 This behavior is undocumented and Bison
1727 users should not rely upon it. Assigning to YYVAL
1728 unconditionally makes the parser a bit smaller, and it avoids a
1729 GCC warning that YYVAL may be used uninitialized. */
1730 yyval
= yyvsp
[1-yylen
];
1732 /* Default location. */
1733 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1734 YY_REDUCE_PRINT (yyn
);
1738 #line 209 "../../src/parse-gram.y"
1739 { prologue_augment (translate_code ((yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)])),
1740 (yylsp
[(1) - (1)])); }
1744 #line 211 "../../src/parse-gram.y"
1745 { debug_flag
= true; }
1749 #line 213 "../../src/parse-gram.y"
1751 static char one
[] = "1";
1752 muscle_insert ((yyvsp
[(2) - (2)].chars
), one
);
1757 #line 217 "../../src/parse-gram.y"
1758 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1762 #line 218 "../../src/parse-gram.y"
1763 { defines_flag
= true; }
1767 #line 219 "../../src/parse-gram.y"
1768 { error_verbose
= true; }
1772 #line 220 "../../src/parse-gram.y"
1773 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1777 #line 221 "../../src/parse-gram.y"
1778 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1782 #line 222 "../../src/parse-gram.y"
1783 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1787 #line 224 "../../src/parse-gram.y"
1789 nondeterministic_parser
= true;
1795 #line 229 "../../src/parse-gram.y"
1797 muscle_code_grow ("initial_action", translate_symbol_action ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1802 #line 232 "../../src/parse-gram.y"
1803 { add_param ("lex_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1807 #line 233 "../../src/parse-gram.y"
1808 { locations_flag
= true; }
1812 #line 234 "../../src/parse-gram.y"
1813 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
1817 #line 235 "../../src/parse-gram.y"
1818 { no_lines_flag
= true; }
1822 #line 236 "../../src/parse-gram.y"
1823 { nondeterministic_parser
= true; }
1827 #line 237 "../../src/parse-gram.y"
1828 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
1832 #line 238 "../../src/parse-gram.y"
1833 { add_param ("parse_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1837 #line 239 "../../src/parse-gram.y"
1838 { pure_parser
= true; }
1842 #line 240 "../../src/parse-gram.y"
1843 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
1847 #line 241 "../../src/parse-gram.y"
1848 { skeleton
= (yyvsp
[(2) - (2)].chars
); }
1852 #line 242 "../../src/parse-gram.y"
1853 { token_table_flag
= true; }
1857 #line 243 "../../src/parse-gram.y"
1858 { report_flag
= report_states
; }
1862 #line 244 "../../src/parse-gram.y"
1863 { yacc_flag
= true; }
1867 #line 252 "../../src/parse-gram.y"
1869 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
1874 #line 256 "../../src/parse-gram.y"
1876 char const *body
= (yyvsp
[(1) - (1)].chars
);
1880 /* Concatenate the union bodies, turning the first one's
1881 trailing '}' into '\n', and omitting the second one's '{'. */
1882 char *code
= muscle_find ("stype");
1883 code
[strlen (code
) - 1] = '\n';
1888 muscle_code_grow ("stype", body
, (yylsp
[(1) - (1)]));
1893 #line 272 "../../src/parse-gram.y"
1896 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
1897 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
1898 symbol_destructor_set (list
->sym
, action
, (yylsp
[(2) - (3)]));
1899 symbol_list_free ((yyvsp
[(3) - (3)].list
));
1904 #line 280 "../../src/parse-gram.y"
1907 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
1908 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
1909 symbol_printer_set (list
->sym
, action
, (yylsp
[(2) - (3)]));
1910 symbol_list_free ((yyvsp
[(3) - (3)].list
));
1915 #line 288 "../../src/parse-gram.y"
1917 default_prec
= true;
1922 #line 292 "../../src/parse-gram.y"
1924 default_prec
= false;
1929 #line 298 "../../src/parse-gram.y"
1930 { current_class
= nterm_sym
; }
1934 #line 299 "../../src/parse-gram.y"
1936 current_class
= unknown_sym
;
1937 current_type
= NULL
;
1942 #line 303 "../../src/parse-gram.y"
1943 { current_class
= token_sym
; }
1947 #line 304 "../../src/parse-gram.y"
1949 current_class
= unknown_sym
;
1950 current_type
= NULL
;
1955 #line 309 "../../src/parse-gram.y"
1958 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
1959 symbol_type_set (list
->sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
1960 symbol_list_free ((yyvsp
[(3) - (3)].list
));
1965 #line 319 "../../src/parse-gram.y"
1969 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
1971 symbol_type_set (list
->sym
, current_type
, (yylsp
[(2) - (3)]));
1972 symbol_precedence_set (list
->sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
1974 symbol_list_free ((yyvsp
[(3) - (3)].list
));
1975 current_type
= NULL
;
1980 #line 333 "../../src/parse-gram.y"
1981 { (yyval
.assoc
) = left_assoc
; }
1985 #line 334 "../../src/parse-gram.y"
1986 { (yyval
.assoc
) = right_assoc
; }
1990 #line 335 "../../src/parse-gram.y"
1991 { (yyval
.assoc
) = non_assoc
; }
1995 #line 339 "../../src/parse-gram.y"
1996 { current_type
= NULL
; }
2000 #line 340 "../../src/parse-gram.y"
2001 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); }
2005 #line 345 "../../src/parse-gram.y"
2006 { (yyval
.list
) = symbol_list_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2010 #line 346 "../../src/parse-gram.y"
2011 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2015 #line 352 "../../src/parse-gram.y"
2017 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2022 #line 356 "../../src/parse-gram.y"
2024 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2025 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2030 #line 361 "../../src/parse-gram.y"
2032 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2033 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2034 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2039 #line 367 "../../src/parse-gram.y"
2041 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2042 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2043 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2048 #line 373 "../../src/parse-gram.y"
2050 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2051 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2052 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2053 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2058 #line 403 "../../src/parse-gram.y"
2065 #line 409 "../../src/parse-gram.y"
2066 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2070 #line 413 "../../src/parse-gram.y"
2071 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2075 #line 414 "../../src/parse-gram.y"
2076 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2080 #line 420 "../../src/parse-gram.y"
2081 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2085 #line 422 "../../src/parse-gram.y"
2086 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2090 #line 424 "../../src/parse-gram.y"
2091 { grammar_current_rule_action_append (gram_last_string
,
2092 gram_last_braced_code_loc
); }
2096 #line 427 "../../src/parse-gram.y"
2097 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2101 #line 429 "../../src/parse-gram.y"
2102 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2106 #line 431 "../../src/parse-gram.y"
2107 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2111 #line 435 "../../src/parse-gram.y"
2112 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2116 #line 436 "../../src/parse-gram.y"
2117 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2121 #line 442 "../../src/parse-gram.y"
2123 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2124 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2129 #line 451 "../../src/parse-gram.y"
2130 { (yyval
.chars
) = (yyvsp
[(1) - (1)].chars
); }
2134 #line 458 "../../src/parse-gram.y"
2136 muscle_code_grow ("epilogue", translate_code ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
2137 gram_scanner_last_string_free ();
2142 /* Line 1267 of yacc.c. */
2143 #line 2144 "../../src/parse-gram.c"
2146 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2150 YY_STACK_PRINT (yyss
, yyssp
);
2155 /* Now `shift' the result of the reduction. Determine what state
2156 that goes to, based on the state we popped back to and the rule
2157 number reduced by. */
2161 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2162 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2163 yystate
= yytable
[yystate
];
2165 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2170 /*------------------------------------.
2171 | yyerrlab -- here on detecting error |
2172 `------------------------------------*/
2174 /* If not already recovering from an error, report this error. */
2178 #if ! YYERROR_VERBOSE
2179 yyerror (YY_("syntax error"));
2182 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2183 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2185 YYSIZE_T yyalloc
= 2 * yysize
;
2186 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2187 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2188 if (yymsg
!= yymsgbuf
)
2189 YYSTACK_FREE (yymsg
);
2190 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2192 yymsg_alloc
= yyalloc
;
2196 yymsg_alloc
= sizeof yymsgbuf
;
2200 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2202 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2207 yyerror (YY_("syntax error"));
2209 goto yyexhaustedlab
;
2215 yyerror_range
[0] = yylloc
;
2217 if (yyerrstatus
== 3)
2219 /* If just tried and failed to reuse look-ahead token after an
2220 error, discard it. */
2222 if (yychar
<= YYEOF
)
2224 /* Return failure if at end of input. */
2225 if (yychar
== YYEOF
)
2230 yydestruct ("Error: discarding",
2231 yytoken
, &yylval
, &yylloc
);
2236 /* Else will try to reuse look-ahead token after shifting the error
2241 /*---------------------------------------------------.
2242 | yyerrorlab -- error raised explicitly by YYERROR. |
2243 `---------------------------------------------------*/
2246 /* Pacify compilers like GCC when the user code never invokes
2247 YYERROR and the label yyerrorlab therefore never appears in user
2249 if (/*CONSTCOND*/ 0)
2252 yyerror_range
[0] = yylsp
[1-yylen
];
2253 /* Do not reclaim the symbols of the rule which action triggered
2257 YY_STACK_PRINT (yyss
, yyssp
);
2262 /*-------------------------------------------------------------.
2263 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2264 `-------------------------------------------------------------*/
2266 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2270 yyn
= yypact
[yystate
];
2271 if (yyn
!= YYPACT_NINF
)
2274 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2282 /* Pop the current state because it cannot handle the error token. */
2286 yyerror_range
[0] = *yylsp
;
2287 yydestruct ("Error: popping",
2288 yystos
[yystate
], yyvsp
, yylsp
);
2291 YY_STACK_PRINT (yyss
, yyssp
);
2299 yyerror_range
[1] = yylloc
;
2300 /* Using YYLLOC is tempting, but would change the location of
2301 the look-ahead. YYLOC is available though. */
2302 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2305 /* Shift the error token. */
2306 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2312 /*-------------------------------------.
2313 | yyacceptlab -- YYACCEPT comes here. |
2314 `-------------------------------------*/
2319 /*-----------------------------------.
2320 | yyabortlab -- YYABORT comes here. |
2321 `-----------------------------------*/
2327 /*-------------------------------------------------.
2328 | yyexhaustedlab -- memory exhaustion comes here. |
2329 `-------------------------------------------------*/
2331 yyerror (YY_("memory exhausted"));
2337 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
2338 yydestruct ("Cleanup: discarding lookahead",
2339 yytoken
, &yylval
, &yylloc
);
2340 /* Do not reclaim the symbols of the rule which action triggered
2341 this YYABORT or YYACCEPT. */
2343 YY_STACK_PRINT (yyss
, yyssp
);
2344 while (yyssp
!= yyss
)
2346 yydestruct ("Cleanup: popping",
2347 yystos
[*yyssp
], yyvsp
, yylsp
);
2352 YYSTACK_FREE (yyss
);
2355 if (yymsg
!= yymsgbuf
)
2356 YYSTACK_FREE (yymsg
);
2358 /* Make sure YYID is used. */
2359 return YYID (yyresult
);
2363 #line 464 "../../src/parse-gram.y"
2367 /* Return the location of the left-hand side of a rule whose
2368 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2369 the right-hand side, and return an empty location equal to the end
2370 boundary of RHS[0] if the right-hand side is empty. */
2373 lloc_default (YYLTYPE
const *rhs
, int n
)
2378 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2379 The bug is fixed in 7.4.2m, but play it safe for now. */
2380 loc
.start
= rhs
[n
].end
;
2381 loc
.end
= rhs
[n
].end
;
2383 /* Ignore empty nonterminals the start of the the right-hand side.
2384 Do not bother to ignore them at the end of the right-hand side,
2385 since empty nonterminals have the same end as their predecessors. */
2386 for (i
= 1; i
<= n
; i
++)
2387 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2389 loc
.start
= rhs
[i
].start
;
2397 /* Add a lex-param or a parse-param (depending on TYPE) with
2398 declaration DECL and location LOC. */
2401 add_param (char const *type
, char *decl
, location loc
)
2403 static char const alphanum
[26 + 26 + 1 + 10] =
2404 "abcdefghijklmnopqrstuvwxyz"
2405 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2408 char const *name_start
= NULL
;
2411 /* Stop on last actual character. */
2412 for (p
= decl
; p
[1]; p
++)
2414 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2415 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2418 /* Strip the surrounding '{' and '}', and any blanks just inside
2420 while (*--p
== ' ' || *p
== '\t')
2423 while (*++decl
== ' ' || *decl
== '\t')
2427 complain_at (loc
, _("missing identifier in parameter declaration"));
2434 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2438 name
= xmalloc (name_len
+ 1);
2439 memcpy (name
, name_start
, name_len
);
2440 name
[name_len
] = '\0';
2441 muscle_pair_list_grow (type
, decl
, name
);
2445 gram_scanner_last_string_free ();
2449 version_check (location
const *loc
, char const *version
)
2451 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2453 complain_at (*loc
, "require bison %s, but have %s",
2454 version
, PACKAGE_VERSION
);
2460 gram_error (location
const *loc
, char const *msg
)
2462 complain_at (*loc
, "%s", msg
);
2466 token_name (int type
)
2468 return yytname
[YYTRANSLATE (type
)];