1 /* A Bison parser, made by GNU Bison 2.3+. */
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.3+"
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
71 /* Copy the first part of user declarations. */
72 #line 1 "parse-gram.y"
73 /* Bison Grammar Parser -*- C -*-
75 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
77 This file is part of Bison, the GNU Compiler Compiler.
79 This program is free software; you can redistribute it and/or modify
80 it under the terms of the GNU General Public License as published by
81 the Free Software Foundation; either version 2 of the License, or
82 (at your option) any later version.
84 This program is distributed in the hope that it will be useful,
85 but WITHOUT ANY WARRANTY; without even the implied warranty of
86 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
87 GNU General Public License for more details.
89 You should have received a copy of the GNU General Public License
90 along with this program; if not, write to the Free Software
91 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
99 #include "conflicts.h"
103 #include "muscle_tab.h"
104 #include "quotearg.h"
107 #include "scan-gram.h"
108 #include "scan-code.h"
109 #include "strverscmp.h"
111 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
112 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
114 #define YY_LOCATION_PRINT(File, Loc) \
115 location_print (File, Loc)
117 static void version_check (location
const *loc
, char const *version
);
119 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
120 FIXME: depends on the undocumented availability of YYLLOC. */
122 #define yyerror(Msg) \
123 gram_error (&yylloc, Msg)
124 static void gram_error (location
const *, char const *);
126 static char const *char_name (char);
128 static void add_param (char const *, char *, location
);
130 static symbol_class current_class
= unknown_sym
;
131 static uniqstr current_type
= 0;
132 static symbol
*current_lhs
;
133 static location current_lhs_location
;
134 static int current_prec
= 0;
136 #ifdef UINT_FAST8_MAX
137 # define YYTYPE_UINT8 uint_fast8_t
140 # define YYTYPE_INT8 int_fast8_t
142 #ifdef UINT_FAST16_MAX
143 # define YYTYPE_UINT16 uint_fast16_t
145 #ifdef INT_FAST16_MAX
146 # define YYTYPE_INT16 int_fast16_t
150 /* Enabling traces. */
155 /* Enabling verbose error messages. */
156 #ifdef YYERROR_VERBOSE
157 # undef YYERROR_VERBOSE
158 # define YYERROR_VERBOSE 1
160 # define YYERROR_VERBOSE 1
163 /* Enabling the token table. */
164 #ifndef YYTOKEN_TABLE
165 # define YYTOKEN_TABLE 0
172 /* Put the tokens into the symbol table, so that GDB and other debuggers
181 PERCENT_DESTRUCTOR
= 263,
182 PERCENT_PRINTER
= 264,
185 PERCENT_NONASSOC
= 267,
189 PERCENT_AFTER_HEADER
= 271,
190 PERCENT_BEFORE_HEADER
= 272,
192 PERCENT_DEFAULT_PREC
= 274,
193 PERCENT_DEFINE
= 275,
194 PERCENT_DEFINES
= 276,
195 PERCENT_END_HEADER
= 277,
196 PERCENT_ERROR_VERBOSE
= 278,
197 PERCENT_EXPECT
= 279,
198 PERCENT_EXPECT_RR
= 280,
199 PERCENT_FILE_PREFIX
= 281,
200 PERCENT_GLR_PARSER
= 282,
201 PERCENT_INITIAL_ACTION
= 283,
202 PERCENT_LEX_PARAM
= 284,
203 PERCENT_LOCATIONS
= 285,
204 PERCENT_NAME_PREFIX
= 286,
205 PERCENT_NO_DEFAULT_PREC
= 287,
206 PERCENT_NO_LINES
= 288,
207 PERCENT_NONDETERMINISTIC_PARSER
= 289,
208 PERCENT_OUTPUT
= 290,
209 PERCENT_PARSE_PARAM
= 291,
210 PERCENT_PURE_PARSER
= 292,
211 PERCENT_REQUIRE
= 293,
212 PERCENT_SKELETON
= 294,
214 PERCENT_START_HEADER
= 296,
215 PERCENT_TOKEN_TABLE
= 297,
216 PERCENT_VERBOSE
= 298,
224 PERCENT_PERCENT
= 306,
236 #define PERCENT_TOKEN 260
237 #define PERCENT_NTERM 261
238 #define PERCENT_TYPE 262
239 #define PERCENT_DESTRUCTOR 263
240 #define PERCENT_PRINTER 264
241 #define PERCENT_LEFT 265
242 #define PERCENT_RIGHT 266
243 #define PERCENT_NONASSOC 267
244 #define PERCENT_PREC 268
245 #define PERCENT_DPREC 269
246 #define PERCENT_MERGE 270
247 #define PERCENT_AFTER_HEADER 271
248 #define PERCENT_BEFORE_HEADER 272
249 #define PERCENT_DEBUG 273
250 #define PERCENT_DEFAULT_PREC 274
251 #define PERCENT_DEFINE 275
252 #define PERCENT_DEFINES 276
253 #define PERCENT_END_HEADER 277
254 #define PERCENT_ERROR_VERBOSE 278
255 #define PERCENT_EXPECT 279
256 #define PERCENT_EXPECT_RR 280
257 #define PERCENT_FILE_PREFIX 281
258 #define PERCENT_GLR_PARSER 282
259 #define PERCENT_INITIAL_ACTION 283
260 #define PERCENT_LEX_PARAM 284
261 #define PERCENT_LOCATIONS 285
262 #define PERCENT_NAME_PREFIX 286
263 #define PERCENT_NO_DEFAULT_PREC 287
264 #define PERCENT_NO_LINES 288
265 #define PERCENT_NONDETERMINISTIC_PARSER 289
266 #define PERCENT_OUTPUT 290
267 #define PERCENT_PARSE_PARAM 291
268 #define PERCENT_PURE_PARSER 292
269 #define PERCENT_REQUIRE 293
270 #define PERCENT_SKELETON 294
271 #define PERCENT_START 295
272 #define PERCENT_START_HEADER 296
273 #define PERCENT_TOKEN_TABLE 297
274 #define PERCENT_VERBOSE 298
275 #define PERCENT_YACC 299
276 #define BRACED_CODE 300
282 #define PERCENT_PERCENT 306
285 #define SEMICOLON 309
287 #define PERCENT_UNION 311
292 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
293 typedef union YYSTYPE
294 #line 97 "parse-gram.y"
302 unsigned char character
;
304 /* Line 197 of yacc.c. */
305 #line 306 "parse-gram.c"
307 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
308 # define YYSTYPE_IS_DECLARED 1
309 # define YYSTYPE_IS_TRIVIAL 1
312 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
313 typedef struct YYLTYPE
320 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
321 # define YYLTYPE_IS_DECLARED 1
322 # define YYLTYPE_IS_TRIVIAL 1
326 /* Copy the second part of user declarations. */
329 /* Line __line__ of yacc.c. */
330 #line 331 "parse-gram.c"
337 typedef YYTYPE_UINT8 yytype_uint8
;
339 typedef unsigned char yytype_uint8
;
343 typedef YYTYPE_INT8 yytype_int8
;
344 #elif (defined __STDC__ || defined __C99__FUNC__ \
345 || defined __cplusplus || defined _MSC_VER)
346 typedef signed char yytype_int8
;
348 typedef short int yytype_int8
;
352 typedef YYTYPE_UINT16 yytype_uint16
;
354 typedef unsigned short int yytype_uint16
;
358 typedef YYTYPE_INT16 yytype_int16
;
360 typedef short int yytype_int16
;
364 # ifdef __SIZE_TYPE__
365 # define YYSIZE_T __SIZE_TYPE__
366 # elif defined size_t
367 # define YYSIZE_T size_t
368 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
369 || defined __cplusplus || defined _MSC_VER)
370 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
371 # define YYSIZE_T size_t
373 # define YYSIZE_T unsigned int
377 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
382 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
383 # define YY_(msgid) dgettext ("bison-runtime", msgid)
387 # define YY_(msgid) msgid
391 /* Suppress unused-variable warnings by "using" E. */
392 #if ! defined lint || defined __GNUC__
393 # define YYUSE(e) ((void) (e))
395 # define YYUSE(e) /* empty */
398 /* Identity function, used to suppress warnings about constant conditions. */
402 #if (defined __STDC__ || defined __C99__FUNC__ \
403 || defined __cplusplus || defined _MSC_VER)
416 #if ! defined yyoverflow || YYERROR_VERBOSE
418 /* The parser invokes alloca or malloc; define the necessary symbols. */
420 # ifdef YYSTACK_USE_ALLOCA
421 # if YYSTACK_USE_ALLOCA
423 # define YYSTACK_ALLOC __builtin_alloca
424 # elif defined __BUILTIN_VA_ARG_INCR
425 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
427 # define YYSTACK_ALLOC __alloca
428 # elif defined _MSC_VER
429 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
430 # define alloca _alloca
432 # define YYSTACK_ALLOC alloca
433 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
434 || defined __cplusplus || defined _MSC_VER)
435 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
444 # ifdef YYSTACK_ALLOC
445 /* Pacify GCC's `empty if-body' warning. */
446 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
447 # ifndef YYSTACK_ALLOC_MAXIMUM
448 /* The OS might guarantee only one guard page at the bottom of the stack,
449 and a page size can be as small as 4096 bytes. So we cannot safely
450 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
451 to allow for a few compiler-allocated temporary stack slots. */
452 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
455 # define YYSTACK_ALLOC YYMALLOC
456 # define YYSTACK_FREE YYFREE
457 # ifndef YYSTACK_ALLOC_MAXIMUM
458 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
460 # if (defined __cplusplus && ! defined _STDLIB_H \
461 && ! ((defined YYMALLOC || defined malloc) \
462 && (defined YYFREE || defined free)))
463 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
469 # define YYMALLOC malloc
470 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
471 || defined __cplusplus || defined _MSC_VER)
472 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
477 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
478 || defined __cplusplus || defined _MSC_VER)
479 void free (void *); /* INFRINGES ON USER NAME SPACE */
483 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
486 #if (! defined yyoverflow \
487 && (! defined __cplusplus \
488 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
489 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
491 /* A type that is properly aligned for any stack member. */
499 /* The size of the maximum gap between one aligned stack and the next. */
500 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
502 /* The size of an array large to enough to hold all stacks, each with
504 # define YYSTACK_BYTES(N) \
505 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
506 + 2 * YYSTACK_GAP_MAXIMUM)
508 /* Copy COUNT objects from FROM to TO. The source and destination do
511 # if defined __GNUC__ && 1 < __GNUC__
512 # define YYCOPY(To, From, Count) \
513 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
515 # define YYCOPY(To, From, Count) \
519 for (yyi = 0; yyi < (Count); yyi++) \
520 (To)[yyi] = (From)[yyi]; \
526 /* Relocate STACK from its old location to the new one. The
527 local variables YYSIZE and YYSTACKSIZE give the old and new number of
528 elements in the stack, and YYPTR gives the new location of the
529 stack. Advance YYPTR to a properly aligned location for the next
531 # define YYSTACK_RELOCATE(Stack) \
534 YYSIZE_T yynewbytes; \
535 YYCOPY (&yyptr->Stack, Stack, yysize); \
536 Stack = &yyptr->Stack; \
537 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
538 yyptr += yynewbytes / sizeof (*yyptr); \
544 /* YYFINAL -- State number of the termination state. */
546 /* YYLAST -- Last index in YYTABLE. */
549 /* YYNTOKENS -- Number of terminals. */
551 /* YYNNTS -- Number of nonterminals. */
553 /* YYNRULES -- Number of rules. */
555 /* YYNRULES -- Number of states. */
556 #define YYNSTATES 128
558 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
560 #define YYMAXUTOK 311
562 #define YYTRANSLATE(YYX) \
563 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
565 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
566 static const yytype_uint8 yytranslate
[] =
568 0, 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, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 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, 1, 2, 3, 4,
594 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
595 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
596 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
597 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
598 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
603 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
605 static const yytype_uint8 yyprhs
[] =
607 0, 0, 3, 8, 9, 12, 14, 16, 19, 22,
608 24, 27, 31, 33, 36, 38, 41, 44, 48, 50,
609 53, 56, 58, 62, 64, 66, 70, 73, 75, 78,
610 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
611 107, 109, 111, 112, 114, 118, 119, 123, 124, 128,
612 132, 136, 138, 140, 142, 143, 145, 147, 150, 152,
613 154, 157, 160, 164, 166, 169, 171, 174, 176, 179,
614 182, 183, 187, 189, 193, 196, 197, 200, 203, 207,
615 211, 215, 217, 219, 221, 223, 225, 227, 229, 230
618 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
619 static const yytype_int8 yyrhs
[] =
621 58, 0, -1, 59, 51, 72, 83, -1, -1, 59,
622 60, -1, 61, -1, 53, -1, 16, 45, -1, 17,
623 45, -1, 18, -1, 20, 82, -1, 20, 82, 82,
624 -1, 21, -1, 22, 45, -1, 23, -1, 24, 4,
625 -1, 25, 4, -1, 26, 48, 82, -1, 27, -1,
626 28, 45, -1, 29, 45, -1, 30, -1, 31, 48,
627 82, -1, 33, -1, 34, -1, 35, 48, 82, -1,
628 36, 45, -1, 37, -1, 38, 82, -1, 39, 82,
629 -1, 41, 45, -1, 42, -1, 43, -1, 44, -1,
630 54, -1, 66, -1, 63, -1, 40, 80, -1, 8,
631 45, 69, -1, 9, 45, 69, -1, 19, -1, 32,
632 -1, -1, 49, -1, 56, 62, 45, -1, -1, 6,
633 64, 71, -1, -1, 5, 65, 71, -1, 7, 55,
634 69, -1, 67, 68, 69, -1, 10, -1, 11, -1,
635 12, -1, -1, 55, -1, 80, -1, 69, 80, -1,
636 55, -1, 78, -1, 78, 4, -1, 78, 81, -1,
637 78, 4, 81, -1, 70, -1, 71, 70, -1, 73,
638 -1, 72, 73, -1, 74, -1, 61, 54, -1, 1,
639 54, -1, -1, 79, 75, 76, -1, 77, -1, 76,
640 52, 77, -1, 76, 54, -1, -1, 77, 80, -1,
641 77, 45, -1, 77, 13, 80, -1, 77, 14, 4,
642 -1, 77, 15, 55, -1, 49, -1, 46, -1, 50,
643 -1, 78, -1, 81, -1, 3, -1, 3, -1, -1,
647 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
648 static const yytype_uint16 yyrline
[] =
650 0, 202, 202, 210, 212, 216, 217, 221, 227, 233,
651 234, 239, 240, 241, 247, 248, 249, 250, 251, 256,
652 260, 261, 262, 263, 264, 265, 266, 267, 268, 269,
653 270, 276, 277, 278, 279, 283, 284, 285, 289, 297,
654 305, 309, 323, 324, 328, 350, 350, 355, 355, 360,
655 370, 385, 386, 387, 391, 392, 397, 398, 403, 407,
656 412, 418, 424, 435, 436, 445, 446, 452, 453, 454,
657 461, 461, 465, 466, 467, 472, 473, 475, 477, 479,
658 481, 494, 496, 505, 510, 511, 516, 525, 530, 532
662 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
663 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
664 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
665 static const char *const yytname
[] =
667 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
668 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
669 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
670 "\"%dprec\"", "\"%merge\"", "\"%after-header\"", "\"%before-header\"",
671 "\"%debug\"", "\"%default-prec\"", "\"%define\"", "\"%defines\"",
672 "\"%end-header\"", "\"%error-verbose\"", "\"%expect\"", "\"%expect-rr\"",
673 "\"%file-prefix\"", "\"%glr-parser\"", "\"%initial-action\"",
674 "\"%lex-param\"", "\"%locations\"", "\"%name-prefix\"",
675 "\"%no-default-prec\"", "\"%no-lines\"", "\"%nondeterministic-parser\"",
676 "\"%output\"", "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"",
677 "\"%skeleton\"", "\"%start\"", "\"%start-header\"", "\"%token-table\"",
678 "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"",
679 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
680 "\"%{...%}\"", "\";\"", "\"type\"", "\"%union\"", "$accept", "input",
681 "declarations", "declaration", "grammar_declaration", "union_name",
682 "symbol_declaration", "@1", "@2", "precedence_declaration",
683 "precedence_declarator", "type.opt", "symbols.1", "symbol_def",
684 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
685 "@3", "rhses.1", "rhs", "id", "id_colon", "symbol", "string_as_id",
686 "string_content", "epilogue.opt", 0
691 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
693 static const yytype_uint16 yytoknum
[] =
695 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
696 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
697 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
698 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
699 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
700 305, 306, 307, 308, 309, 310, 311
704 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
705 static const yytype_uint8 yyr1
[] =
707 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
708 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
709 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
710 60, 60, 60, 60, 60, 61, 61, 61, 61, 61,
711 61, 61, 62, 62, 61, 64, 63, 65, 63, 63,
712 66, 67, 67, 67, 68, 68, 69, 69, 70, 70,
713 70, 70, 70, 71, 71, 72, 72, 73, 73, 73,
714 75, 74, 76, 76, 76, 77, 77, 77, 77, 77,
715 77, 78, 78, 79, 80, 80, 81, 82, 83, 83
718 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
719 static const yytype_uint8 yyr2
[] =
721 0, 2, 4, 0, 2, 1, 1, 2, 2, 1,
722 2, 3, 1, 2, 1, 2, 2, 3, 1, 2,
723 2, 1, 3, 1, 1, 3, 2, 1, 2, 2,
724 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
725 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
726 3, 1, 1, 1, 0, 1, 1, 2, 1, 1,
727 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
728 0, 3, 1, 3, 2, 0, 2, 2, 3, 3,
729 3, 1, 1, 1, 1, 1, 1, 1, 0, 2
732 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
733 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
734 means the default is an error. */
735 static const yytype_uint8 yydefact
[] =
737 3, 0, 0, 1, 47, 45, 0, 0, 0, 51,
738 52, 53, 0, 0, 9, 40, 0, 12, 0, 14,
739 0, 0, 0, 18, 0, 0, 21, 0, 41, 23,
740 24, 0, 0, 27, 0, 0, 0, 0, 31, 32,
741 33, 0, 6, 34, 42, 4, 5, 36, 35, 54,
742 0, 0, 0, 0, 0, 7, 8, 87, 10, 13,
743 15, 16, 0, 19, 20, 0, 0, 26, 28, 29,
744 86, 82, 81, 84, 37, 85, 30, 0, 83, 0,
745 0, 65, 67, 70, 43, 0, 55, 0, 58, 63,
746 48, 59, 46, 49, 56, 38, 39, 11, 17, 22,
747 25, 69, 68, 0, 66, 2, 75, 44, 50, 64,
748 60, 61, 57, 89, 71, 72, 62, 75, 74, 0,
749 0, 0, 77, 76, 73, 78, 79, 80
752 /* YYDEFGOTO[NTERM-NUM]. */
753 static const yytype_int8 yydefgoto
[] =
755 -1, 1, 2, 45, 79, 85, 47, 51, 50, 48,
756 49, 87, 93, 89, 90, 80, 81, 82, 106, 114,
757 115, 73, 83, 94, 75, 58, 105
760 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
762 #define YYPACT_NINF -76
763 static const yytype_int16 yypact
[] =
765 -76, 6, 136, -76, -76, -76, -40, -12, -9, -76,
766 -76, -76, -5, 1, -76, -76, 40, -76, 5, -76,
767 47, 50, 7, -76, 11, 18, -76, 19, -76, -76,
768 -76, 20, 25, -76, 40, 40, -2, 26, -76, -76,
769 -76, 84, -76, -76, 27, -76, -76, -76, -76, 14,
770 -23, -23, -2, -2, -2, -76, -76, -76, 40, -76,
771 -76, -76, 40, -76, -76, 40, 40, -76, -76, -76,
772 -76, -76, -76, -76, -76, -76, -76, 21, -76, 23,
773 2, -76, -76, -76, -76, 28, -76, -2, -76, -76,
774 -23, 24, -23, -2, -76, -2, -2, -76, -76, -76,
775 -76, -76, -76, 31, -76, -76, -76, -76, -2, -76,
776 71, -76, -76, -76, -32, 16, -76, -76, -76, -2,
777 76, 29, -76, -76, 16, -76, -76, -76
780 /* YYPGOTO[NTERM-NUM]. */
781 static const yytype_int8 yypgoto
[] =
783 -76, -76, -76, -76, 79, -76, -76, -76, -76, -76,
784 -76, -76, -49, -53, 35, -76, 17, -76, -76, -76,
785 -35, -26, -76, -36, -75, -17, -76
788 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
789 positive, shift that token. If negative, reduce the rule which
790 number is the opposite. If zero, do what YYDEFACT says.
791 If YYTABLE_NINF, syntax error. */
792 #define YYTABLE_NINF -89
793 static const yytype_int8 yytable
[] =
795 74, 70, -88, 77, 95, 96, 3, 4, 5, 6,
796 7, 8, 9, 10, 11, 52, 111, 68, 69, 70,
797 117, 15, 118, 71, 91, 91, 72, 70, 110, 119,
798 120, 121, 88, 53, 28, 116, 54, 109, 108, 109,
799 55, 97, 36, 57, 71, 98, 56, 72, 99, 100,
800 59, 60, 78, 103, 61, 62, 63, 112, 44, 112,
801 112, 122, 71, 64, 91, 72, 91, 65, 66, 86,
802 67, 76, 112, 107, 70, 101, 84, 102, 113, 123,
803 126, 46, 124, 125, 127, 77, 92, 0, 123, 4,
804 5, 6, 7, 8, 9, 10, 11, 104, 0, 0,
805 0, 0, 0, 15, 0, 0, 0, 0, 0, 0,
806 0, 0, 0, 0, 0, 0, 28, 0, 0, 0,
807 0, 0, 0, 0, 36, 0, 0, 0, 0, 0,
808 0, 0, 0, 0, 78, 0, 0, 0, 0, 0,
809 44, 4, 5, 6, 7, 8, 9, 10, 11, 0,
810 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
811 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
812 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
813 40, 0, 0, 0, 0, 0, 0, 41, 0, 42,
817 static const yytype_int8 yycheck
[] =
819 36, 3, 0, 1, 53, 54, 0, 5, 6, 7,
820 8, 9, 10, 11, 12, 55, 91, 34, 35, 3,
821 52, 19, 54, 46, 50, 51, 49, 3, 4, 13,
822 14, 15, 55, 45, 32, 110, 45, 90, 87, 92,
823 45, 58, 40, 3, 46, 62, 45, 49, 65, 66,
824 45, 4, 50, 51, 4, 48, 45, 93, 56, 95,
825 96, 45, 46, 45, 90, 49, 92, 48, 48, 55,
826 45, 45, 108, 45, 3, 54, 49, 54, 47, 115,
827 4, 2, 117, 119, 55, 1, 51, -1, 124, 5,
828 6, 7, 8, 9, 10, 11, 12, 80, -1, -1,
829 -1, -1, -1, 19, -1, -1, -1, -1, -1, -1,
830 -1, -1, -1, -1, -1, -1, 32, -1, -1, -1,
831 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
832 -1, -1, -1, -1, 50, -1, -1, -1, -1, -1,
833 56, 5, 6, 7, 8, 9, 10, 11, 12, -1,
834 -1, -1, 16, 17, 18, 19, 20, 21, 22, 23,
835 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
836 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
837 44, -1, -1, -1, -1, -1, -1, 51, -1, 53,
841 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
842 symbol of state STATE-NUM. */
843 static const yytype_uint8 yystos
[] =
845 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
846 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
847 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
848 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
849 44, 51, 53, 54, 56, 60, 61, 63, 66, 67,
850 65, 64, 55, 45, 45, 45, 45, 3, 82, 45,
851 4, 4, 48, 45, 45, 48, 48, 45, 82, 82,
852 3, 46, 49, 78, 80, 81, 45, 1, 50, 61,
853 72, 73, 74, 79, 49, 62, 55, 68, 55, 70,
854 71, 78, 71, 69, 80, 69, 69, 82, 82, 82,
855 82, 54, 54, 51, 73, 83, 75, 45, 69, 70,
856 4, 81, 80, 47, 76, 77, 81, 52, 54, 13,
857 14, 15, 45, 80, 77, 80, 4, 55
860 #define yyerrok (yyerrstatus = 0)
861 #define yyclearin (yychar = YYEMPTY)
865 #define YYACCEPT goto yyacceptlab
866 #define YYABORT goto yyabortlab
867 #define YYERROR goto yyerrorlab
870 /* Like YYERROR except do call yyerror. This remains here temporarily
871 to ease the transition to the new meaning of YYERROR, for GCC.
872 Once GCC version 2 has supplanted version 1, this can go. */
874 #define YYFAIL goto yyerrlab
876 #define YYRECOVERING() (!!yyerrstatus)
878 #define YYBACKUP(Token, Value) \
880 if (yychar == YYEMPTY && yylen == 1) \
884 yytoken = YYTRANSLATE (yychar); \
890 yyerror (YY_("syntax error: cannot back up")); \
897 #define YYERRCODE 256
900 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
901 If N is 0, then set CURRENT to the empty location which ends
902 the previous symbol: RHS[0] (always defined). */
904 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
905 #ifndef YYLLOC_DEFAULT
906 # define YYLLOC_DEFAULT(Current, Rhs, N) \
910 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
911 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
912 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
913 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
917 (Current).first_line = (Current).last_line = \
918 YYRHSLOC (Rhs, 0).last_line; \
919 (Current).first_column = (Current).last_column = \
920 YYRHSLOC (Rhs, 0).last_column; \
926 /* YY_LOCATION_PRINT -- Print the location on the stream.
927 This macro was not mandated originally: define only if we know
928 we won't break user code: when these are the locations we know. */
930 #ifndef YY_LOCATION_PRINT
931 # if YYLTYPE_IS_TRIVIAL
932 # define YY_LOCATION_PRINT(File, Loc) \
933 fprintf (File, "%d.%d-%d.%d", \
934 (Loc).first_line, (Loc).first_column, \
935 (Loc).last_line, (Loc).last_column)
937 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
942 /* YYLEX -- calling `yylex' with the right arguments. */
945 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
947 # define YYLEX yylex (&yylval, &yylloc)
950 /* Enable debugging if requested. */
954 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
955 # define YYFPRINTF fprintf
958 # define YYDPRINTF(Args) \
964 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
968 YYFPRINTF (stderr, "%s ", Title); \
969 yy_symbol_print (stderr, \
970 Type, Value, Location); \
971 YYFPRINTF (stderr, "\n"); \
976 /*--------------------------------.
977 | Print this symbol on YYOUTPUT. |
978 `--------------------------------*/
981 #if (defined __STDC__ || defined __C99__FUNC__ \
982 || defined __cplusplus || defined _MSC_VER)
984 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
987 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
990 YYSTYPE
const * const yyvaluep
;
991 YYLTYPE
const * const yylocationp
;
998 if (yytype
< YYNTOKENS
)
999 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1005 case 3: /* "\"string\"" */
1006 #line 181 "parse-gram.y"
1007 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1008 #line 1009 "parse-gram.c"
1010 case 4: /* "\"integer\"" */
1011 #line 191 "parse-gram.y"
1012 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1013 #line 1014 "parse-gram.c"
1015 case 45: /* "\"{...}\"" */
1016 #line 183 "parse-gram.y"
1017 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1018 #line 1019 "parse-gram.c"
1020 case 46: /* "\"char\"" */
1021 #line 178 "parse-gram.y"
1022 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1023 #line 1024 "parse-gram.c"
1025 case 47: /* "\"epilogue\"" */
1026 #line 183 "parse-gram.y"
1027 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1028 #line 1029 "parse-gram.c"
1030 case 49: /* "\"identifier\"" */
1031 #line 187 "parse-gram.y"
1032 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1033 #line 1034 "parse-gram.c"
1035 case 50: /* "\"identifier:\"" */
1036 #line 188 "parse-gram.y"
1037 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1038 #line 1039 "parse-gram.c"
1040 case 53: /* "\"%{...%}\"" */
1041 #line 183 "parse-gram.y"
1042 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1043 #line 1044 "parse-gram.c"
1045 case 55: /* "\"type\"" */
1046 #line 186 "parse-gram.y"
1047 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1048 #line 1049 "parse-gram.c"
1051 #line 194 "parse-gram.y"
1052 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1053 #line 1054 "parse-gram.c"
1055 case 79: /* "id_colon" */
1056 #line 195 "parse-gram.y"
1057 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1058 #line 1059 "parse-gram.c"
1060 case 80: /* "symbol" */
1061 #line 194 "parse-gram.y"
1062 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1063 #line 1064 "parse-gram.c"
1065 case 81: /* "string_as_id" */
1066 #line 194 "parse-gram.y"
1067 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1068 #line 1069 "parse-gram.c"
1070 case 82: /* "string_content" */
1071 #line 181 "parse-gram.y"
1072 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1073 #line 1074 "parse-gram.c"
1081 /*--------------------------------.
1082 | Print this symbol on YYOUTPUT. |
1083 `--------------------------------*/
1085 #if (defined __STDC__ || defined __C99__FUNC__ \
1086 || defined __cplusplus || defined _MSC_VER)
1088 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1091 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1094 YYSTYPE
const * const yyvaluep
;
1095 YYLTYPE
const * const yylocationp
;
1098 if (yytype
< YYNTOKENS
)
1099 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1101 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1103 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1104 YYFPRINTF (yyoutput
, ": ");
1105 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1106 YYFPRINTF (yyoutput
, ")");
1109 /*------------------------------------------------------------------.
1110 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1112 `------------------------------------------------------------------*/
1114 #if (defined __STDC__ || defined __C99__FUNC__ \
1115 || defined __cplusplus || defined _MSC_VER)
1117 yy_stack_print (yytype_int16
*bottom
, yytype_int16
*top
)
1120 yy_stack_print (bottom
, top
)
1121 yytype_int16
*bottom
;
1125 YYFPRINTF (stderr
, "Stack now");
1126 for (; bottom
<= top
; ++bottom
)
1127 YYFPRINTF (stderr
, " %d", *bottom
);
1128 YYFPRINTF (stderr
, "\n");
1131 # define YY_STACK_PRINT(Bottom, Top) \
1134 yy_stack_print ((Bottom), (Top)); \
1138 /*------------------------------------------------.
1139 | Report that the YYRULE is going to be reduced. |
1140 `------------------------------------------------*/
1142 #if (defined __STDC__ || defined __C99__FUNC__ \
1143 || defined __cplusplus || defined _MSC_VER)
1145 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1148 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1154 int yynrhs
= yyr2
[yyrule
];
1156 unsigned long int yylno
= yyrline
[yyrule
];
1157 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1159 /* The symbols being reduced. */
1160 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1162 fprintf (stderr
, " $%d = ", yyi
+ 1);
1163 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1164 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1165 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1166 fprintf (stderr
, "\n");
1170 # define YY_REDUCE_PRINT(Rule) \
1173 yy_reduce_print (yyvsp, yylsp, Rule); \
1176 /* Nonzero means print parse trace. It is left uninitialized so that
1177 multiple parsers can coexist. */
1179 #else /* !YYDEBUG */
1180 # define YYDPRINTF(Args)
1181 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1182 # define YY_STACK_PRINT(Bottom, Top)
1183 # define YY_REDUCE_PRINT(Rule)
1184 #endif /* !YYDEBUG */
1187 /* YYINITDEPTH -- initial size of the parser's stacks. */
1189 # define YYINITDEPTH 200
1192 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1193 if the built-in stack extension method is used).
1195 Do not make this value too large; the results are undefined if
1196 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1197 evaluated with infinite-precision integer arithmetic. */
1200 # define YYMAXDEPTH 10000
1208 # if defined __GLIBC__ && defined _STRING_H
1209 # define yystrlen strlen
1211 /* Return the length of YYSTR. */
1212 #if (defined __STDC__ || defined __C99__FUNC__ \
1213 || defined __cplusplus || defined _MSC_VER)
1215 yystrlen (const char *yystr
)
1223 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1231 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1232 # define yystpcpy stpcpy
1234 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1236 #if (defined __STDC__ || defined __C99__FUNC__ \
1237 || defined __cplusplus || defined _MSC_VER)
1239 yystpcpy (char *yydest
, const char *yysrc
)
1242 yystpcpy (yydest
, yysrc
)
1248 const char *yys
= yysrc
;
1250 while ((*yyd
++ = *yys
++) != '\0')
1259 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1260 quotes and backslashes, so that it's suitable for yyerror. The
1261 heuristic is that double-quoting is unnecessary unless the string
1262 contains an apostrophe, a comma, or backslash (other than
1263 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1264 null, do not copy; instead, return the length of what the result
1267 yytnamerr (char *yyres
, const char *yystr
)
1272 char const *yyp
= yystr
;
1279 goto do_not_strip_quotes
;
1283 goto do_not_strip_quotes
;
1296 do_not_strip_quotes
: ;
1300 return yystrlen (yystr
);
1302 return yystpcpy (yyres
, yystr
) - yyres
;
1306 /* Copy into YYRESULT an error message about the unexpected token
1307 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1308 including the terminating null byte. If YYRESULT is null, do not
1309 copy anything; just return the number of bytes that would be
1310 copied. As a special case, return 0 if an ordinary "syntax error"
1311 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1312 size calculation. */
1314 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1316 int yyn
= yypact
[yystate
];
1318 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1322 int yytype
= YYTRANSLATE (yychar
);
1323 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1324 YYSIZE_T yysize
= yysize0
;
1326 int yysize_overflow
= 0;
1327 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1328 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1332 /* This is so xgettext sees the translatable formats that are
1333 constructed on the fly. */
1334 YY_("syntax error, unexpected %s");
1335 YY_("syntax error, unexpected %s, expecting %s");
1336 YY_("syntax error, unexpected %s, expecting %s or %s");
1337 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1338 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1342 static char const yyunexpected
[] = "syntax error, unexpected %s";
1343 static char const yyexpecting
[] = ", expecting %s";
1344 static char const yyor
[] = " or %s";
1345 char yyformat
[sizeof yyunexpected
1346 + sizeof yyexpecting
- 1
1347 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1348 * (sizeof yyor
- 1))];
1349 char const *yyprefix
= yyexpecting
;
1351 /* Start YYX at -YYN if negative to avoid negative indexes in
1353 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1355 /* Stay within bounds of both yycheck and yytname. */
1356 int yychecklim
= YYLAST
- yyn
+ 1;
1357 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1360 yyarg
[0] = yytname
[yytype
];
1361 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1363 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1364 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1366 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1370 yyformat
[sizeof yyunexpected
- 1] = '\0';
1373 yyarg
[yycount
++] = yytname
[yyx
];
1374 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1375 yysize_overflow
|= (yysize1
< yysize
);
1377 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1381 yyf
= YY_(yyformat
);
1382 yysize1
= yysize
+ yystrlen (yyf
);
1383 yysize_overflow
|= (yysize1
< yysize
);
1386 if (yysize_overflow
)
1387 return YYSIZE_MAXIMUM
;
1391 /* Avoid sprintf, as that infringes on the user's name space.
1392 Don't have undefined behavior even if the translation
1393 produced a string with the wrong number of "%s"s. */
1394 char *yyp
= yyresult
;
1396 while ((*yyp
= *yyf
) != '\0')
1398 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1400 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1413 #endif /* YYERROR_VERBOSE */
1416 /*-----------------------------------------------.
1417 | Release the memory associated to this symbol. |
1418 `-----------------------------------------------*/
1421 #if (defined __STDC__ || defined __C99__FUNC__ \
1422 || defined __cplusplus || defined _MSC_VER)
1424 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1427 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1431 YYLTYPE
*yylocationp
;
1435 YYUSE (yylocationp
);
1439 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1450 /* Prevent warnings from -Wmissing-prototypes. */
1452 #ifdef YYPARSE_PARAM
1453 #if defined __STDC__ || defined __cplusplus
1454 int yyparse (void *YYPARSE_PARAM
);
1458 #else /* ! YYPARSE_PARAM */
1459 #if defined __STDC__ || defined __cplusplus
1464 #endif /* ! YYPARSE_PARAM */
1475 #ifdef YYPARSE_PARAM
1476 #if (defined __STDC__ || defined __C99__FUNC__ \
1477 || defined __cplusplus || defined _MSC_VER)
1479 yyparse (void *YYPARSE_PARAM
)
1482 yyparse (YYPARSE_PARAM
)
1483 void *YYPARSE_PARAM
;
1485 #else /* ! YYPARSE_PARAM */
1486 #if (defined __STDC__ || defined __C99__FUNC__ \
1487 || defined __cplusplus || defined _MSC_VER)
1497 /* The lookahead symbol. */
1500 /* The semantic value of the lookahead symbol. */
1503 /* Number of syntax errors so far. */
1505 /* Location data for the lookahead symbol. */
1511 /* Number of tokens to shift before error messages enabled. */
1513 /* Lookahead token as an internal (translated) token number. */
1516 /* Buffer for error messages, and its allocated size. */
1518 char *yymsg
= yymsgbuf
;
1519 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1522 /* Three stacks and their tools:
1523 `yyss': related to states,
1524 `yyvs': related to semantic values,
1525 `yyls': related to locations.
1527 Refer to the stacks thru separate pointers, to allow yyoverflow
1528 to reallocate them elsewhere. */
1530 /* The state stack. */
1531 yytype_int16 yyssa
[YYINITDEPTH
];
1532 yytype_int16
*yyss
= yyssa
;
1533 yytype_int16
*yyssp
;
1535 /* The semantic value stack. */
1536 YYSTYPE yyvsa
[YYINITDEPTH
];
1537 YYSTYPE
*yyvs
= yyvsa
;
1540 /* The location stack. */
1541 YYLTYPE yylsa
[YYINITDEPTH
];
1542 YYLTYPE
*yyls
= yylsa
;
1544 /* The locations where the error started and ended. */
1545 YYLTYPE yyerror_range
[2];
1547 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1549 YYSIZE_T yystacksize
= YYINITDEPTH
;
1551 /* The variables used to return semantic value and location from the
1556 /* The number of symbols on the RHS of the reduced rule.
1557 Keep to zero when no symbol should be popped. */
1560 YYDPRINTF ((stderr
, "Starting parse\n"));
1565 yychar
= YYEMPTY
; /* Cause a token to be read. */
1567 /* Initialize stack pointers.
1568 Waste one element of value and location stack
1569 so that they stay on the same level as the state stack.
1570 The wasted elements are never initialized. */
1575 #if YYLTYPE_IS_TRIVIAL
1576 /* Initialize the default location before parsing starts. */
1577 yylloc
.first_line
= yylloc
.last_line
= 1;
1578 yylloc
.first_column
= yylloc
.last_column
= 0;
1582 /* User initialization code. */
1583 #line 88 "parse-gram.y"
1585 /* Bison's grammar can initial empty locations, hence a default
1586 location is needed. */
1587 boundary_set (&yylloc
.start
, current_file
, 1, 0);
1588 boundary_set (&yylloc
.end
, current_file
, 1, 0);
1590 /* Line 1085 of yacc.c. */
1591 #line 1592 "parse-gram.c"
1595 /*------------------------------------------------------------.
1596 | yynewstate -- Push a new state, which is found in yystate. |
1597 `------------------------------------------------------------*/
1599 /* In all cases, when you get here, the value and location stacks
1600 have just been pushed. So pushing a state here evens the stacks. */
1606 if (yyss
+ yystacksize
- 1 <= yyssp
)
1608 /* Get the current used size of the three stacks, in elements. */
1609 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1613 /* Give user a chance to reallocate the stack. Use copies of
1614 these so that the &'s don't force the real ones into
1616 YYSTYPE
*yyvs1
= yyvs
;
1617 yytype_int16
*yyss1
= yyss
;
1618 YYLTYPE
*yyls1
= yyls
;
1620 /* Each stack pointer address is followed by the size of the
1621 data in use in that stack, in bytes. This used to be a
1622 conditional around just the two extra args, but that might
1623 be undefined if yyoverflow is a macro. */
1624 yyoverflow (YY_("memory exhausted"),
1625 &yyss1
, yysize
* sizeof (*yyssp
),
1626 &yyvs1
, yysize
* sizeof (*yyvsp
),
1627 &yyls1
, yysize
* sizeof (*yylsp
),
1633 #else /* no yyoverflow */
1634 # ifndef YYSTACK_RELOCATE
1635 goto yyexhaustedlab
;
1637 /* Extend the stack our own way. */
1638 if (YYMAXDEPTH
<= yystacksize
)
1639 goto yyexhaustedlab
;
1641 if (YYMAXDEPTH
< yystacksize
)
1642 yystacksize
= YYMAXDEPTH
;
1645 yytype_int16
*yyss1
= yyss
;
1646 union yyalloc
*yyptr
=
1647 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1649 goto yyexhaustedlab
;
1650 YYSTACK_RELOCATE (yyss
);
1651 YYSTACK_RELOCATE (yyvs
);
1652 YYSTACK_RELOCATE (yyls
);
1653 # undef YYSTACK_RELOCATE
1655 YYSTACK_FREE (yyss1
);
1658 #endif /* no yyoverflow */
1660 yyssp
= yyss
+ yysize
- 1;
1661 yyvsp
= yyvs
+ yysize
- 1;
1662 yylsp
= yyls
+ yysize
- 1;
1664 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1665 (unsigned long int) yystacksize
));
1667 if (yyss
+ yystacksize
- 1 <= yyssp
)
1671 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1680 /* Do appropriate processing given the current state. Read a
1681 lookahead token if we need one and don't already have one. */
1683 /* First try to decide what to do without reference to lookahead token. */
1684 yyn
= yypact
[yystate
];
1685 if (yyn
== YYPACT_NINF
)
1688 /* Not known => get a lookahead token if don't already have one. */
1690 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1691 if (yychar
== YYEMPTY
)
1693 YYDPRINTF ((stderr
, "Reading a token: "));
1697 if (yychar
<= YYEOF
)
1699 yychar
= yytoken
= YYEOF
;
1700 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1704 yytoken
= YYTRANSLATE (yychar
);
1705 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1708 /* If the proper action on seeing token YYTOKEN is to reduce or to
1709 detect an error, take that action. */
1711 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1716 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1725 /* Count tokens shifted since error; after three, turn off error
1730 /* Shift the lookahead token. */
1731 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1733 /* Discard the shifted token unless it is eof. */
1734 if (yychar
!= YYEOF
)
1743 /*-----------------------------------------------------------.
1744 | yydefault -- do the default action for the current state. |
1745 `-----------------------------------------------------------*/
1747 yyn
= yydefact
[yystate
];
1753 /*-----------------------------.
1754 | yyreduce -- Do a reduction. |
1755 `-----------------------------*/
1757 /* yyn is the number of a rule to reduce with. */
1760 /* If YYLEN is nonzero, implement the default value of the action:
1763 Otherwise, the following line sets YYVAL to garbage.
1764 This behavior is undocumented and Bison
1765 users should not rely upon it. Assigning to YYVAL
1766 unconditionally makes the parser a bit smaller, and it avoids a
1767 GCC warning that YYVAL may be used uninitialized. */
1768 yyval
= yyvsp
[1-yylen
];
1770 /* Default location. */
1771 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1772 YY_REDUCE_PRINT (yyn
);
1776 #line 218 "parse-gram.y"
1778 prologue_augment (translate_code ((yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)])), (yylsp
[(1) - (1)]), typed
);
1783 #line 222 "parse-gram.y"
1785 /* Remove the '{', and replace the '}' with '\n'. */
1786 (yyvsp
[(2) - (2)].chars
)[strlen ((yyvsp
[(2) - (2)].chars
)) - 1] = '\n';
1787 prologue_augment (translate_code ((yyvsp
[(2) - (2)].chars
)+1, (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]), true);
1792 #line 228 "parse-gram.y"
1794 /* Remove the '{', and replace the '}' with '\n'. */
1795 (yyvsp
[(2) - (2)].chars
)[strlen ((yyvsp
[(2) - (2)].chars
)) - 1] = '\n';
1796 prologue_augment (translate_code ((yyvsp
[(2) - (2)].chars
)+1, (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]), false);
1801 #line 233 "parse-gram.y"
1802 { debug_flag
= true; }
1806 #line 235 "parse-gram.y"
1808 static char one
[] = "1";
1809 muscle_insert ((yyvsp
[(2) - (2)].chars
), one
);
1814 #line 239 "parse-gram.y"
1815 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1819 #line 240 "parse-gram.y"
1820 { defines_flag
= true; }
1824 #line 242 "parse-gram.y"
1826 /* Remove the '{', and replace the '}' with '\n'. */
1827 (yyvsp
[(2) - (2)].chars
)[strlen ((yyvsp
[(2) - (2)].chars
)) - 1] = '\n';
1828 muscle_code_grow ("end_header", translate_code ((yyvsp
[(2) - (2)].chars
)+1, (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1833 #line 247 "parse-gram.y"
1834 { error_verbose
= true; }
1838 #line 248 "parse-gram.y"
1839 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1843 #line 249 "parse-gram.y"
1844 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1848 #line 250 "parse-gram.y"
1849 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1853 #line 252 "parse-gram.y"
1855 nondeterministic_parser
= true;
1861 #line 257 "parse-gram.y"
1863 muscle_code_grow ("initial_action", translate_symbol_action ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1868 #line 260 "parse-gram.y"
1869 { add_param ("lex_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1873 #line 261 "parse-gram.y"
1874 { locations_flag
= true; }
1878 #line 262 "parse-gram.y"
1879 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
1883 #line 263 "parse-gram.y"
1884 { no_lines_flag
= true; }
1888 #line 264 "parse-gram.y"
1889 { nondeterministic_parser
= true; }
1893 #line 265 "parse-gram.y"
1894 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
1898 #line 266 "parse-gram.y"
1899 { add_param ("parse_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1903 #line 267 "parse-gram.y"
1904 { pure_parser
= true; }
1908 #line 268 "parse-gram.y"
1909 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
1913 #line 269 "parse-gram.y"
1914 { skeleton
= (yyvsp
[(2) - (2)].chars
); }
1918 #line 271 "parse-gram.y"
1920 /* Remove the '{', and replace the '}' with '\n'. */
1921 (yyvsp
[(2) - (2)].chars
)[strlen ((yyvsp
[(2) - (2)].chars
)) - 1] = '\n';
1922 muscle_code_grow ("start_header", translate_code ((yyvsp
[(2) - (2)].chars
)+1, (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1927 #line 276 "parse-gram.y"
1928 { token_table_flag
= true; }
1932 #line 277 "parse-gram.y"
1933 { report_flag
= report_states
; }
1937 #line 278 "parse-gram.y"
1938 { yacc_flag
= true; }
1942 #line 286 "parse-gram.y"
1944 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
1949 #line 290 "parse-gram.y"
1952 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
1953 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
1954 symbol_destructor_set (list
->sym
, action
, (yylsp
[(2) - (3)]));
1955 symbol_list_free ((yyvsp
[(3) - (3)].list
));
1960 #line 298 "parse-gram.y"
1963 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
1964 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
1965 symbol_printer_set (list
->sym
, action
, (yylsp
[(2) - (3)]));
1966 symbol_list_free ((yyvsp
[(3) - (3)].list
));
1971 #line 306 "parse-gram.y"
1973 default_prec
= true;
1978 #line 310 "parse-gram.y"
1980 default_prec
= false;
1985 #line 323 "parse-gram.y"
1990 #line 324 "parse-gram.y"
1991 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
1995 #line 329 "parse-gram.y"
1997 char const *body
= (yyvsp
[(3) - (3)].chars
);
2001 /* Concatenate the union bodies, turning the first one's
2002 trailing '}' into '\n', and omitting the second one's '{'. */
2003 char *code
= muscle_find ("stype");
2004 code
[strlen (code
) - 1] = '\n';
2009 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2014 #line 350 "parse-gram.y"
2015 { current_class
= nterm_sym
; }
2019 #line 351 "parse-gram.y"
2021 current_class
= unknown_sym
;
2022 current_type
= NULL
;
2027 #line 355 "parse-gram.y"
2028 { current_class
= token_sym
; }
2032 #line 356 "parse-gram.y"
2034 current_class
= unknown_sym
;
2035 current_type
= NULL
;
2040 #line 361 "parse-gram.y"
2043 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2044 symbol_type_set (list
->sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2045 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2050 #line 371 "parse-gram.y"
2054 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2056 symbol_type_set (list
->sym
, current_type
, (yylsp
[(2) - (3)]));
2057 symbol_precedence_set (list
->sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2059 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2060 current_type
= NULL
;
2065 #line 385 "parse-gram.y"
2066 { (yyval
.assoc
) = left_assoc
; }
2070 #line 386 "parse-gram.y"
2071 { (yyval
.assoc
) = right_assoc
; }
2075 #line 387 "parse-gram.y"
2076 { (yyval
.assoc
) = non_assoc
; }
2080 #line 391 "parse-gram.y"
2081 { current_type
= NULL
; }
2085 #line 392 "parse-gram.y"
2086 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); }
2090 #line 397 "parse-gram.y"
2091 { (yyval
.list
) = symbol_list_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2095 #line 398 "parse-gram.y"
2096 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2100 #line 404 "parse-gram.y"
2102 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2107 #line 408 "parse-gram.y"
2109 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2110 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2115 #line 413 "parse-gram.y"
2117 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2118 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2119 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2124 #line 419 "parse-gram.y"
2126 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2127 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2128 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2133 #line 425 "parse-gram.y"
2135 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2136 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2137 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2138 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2143 #line 455 "parse-gram.y"
2150 #line 461 "parse-gram.y"
2151 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2155 #line 465 "parse-gram.y"
2156 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2160 #line 466 "parse-gram.y"
2161 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2165 #line 472 "parse-gram.y"
2166 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2170 #line 474 "parse-gram.y"
2171 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2175 #line 476 "parse-gram.y"
2176 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2180 #line 478 "parse-gram.y"
2181 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2185 #line 480 "parse-gram.y"
2186 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2190 #line 482 "parse-gram.y"
2191 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2195 #line 495 "parse-gram.y"
2196 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2200 #line 497 "parse-gram.y"
2202 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2203 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2204 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2209 #line 505 "parse-gram.y"
2210 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2214 #line 517 "parse-gram.y"
2216 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2217 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2222 #line 526 "parse-gram.y"
2223 { (yyval
.chars
) = (yyvsp
[(1) - (1)].chars
); }
2227 #line 533 "parse-gram.y"
2229 muscle_code_grow ("epilogue", translate_code ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
2230 gram_scanner_last_string_free ();
2235 /* Line 1274 of yacc.c. */
2236 #line 2237 "parse-gram.c"
2239 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2243 YY_STACK_PRINT (yyss
, yyssp
);
2248 /* Now `shift' the result of the reduction. Determine what state
2249 that goes to, based on the state we popped back to and the rule
2250 number reduced by. */
2254 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2255 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2256 yystate
= yytable
[yystate
];
2258 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2263 /*------------------------------------.
2264 | yyerrlab -- here on detecting error |
2265 `------------------------------------*/
2267 /* If not already recovering from an error, report this error. */
2271 #if ! YYERROR_VERBOSE
2272 yyerror (YY_("syntax error"));
2275 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2276 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2278 YYSIZE_T yyalloc
= 2 * yysize
;
2279 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2280 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2281 if (yymsg
!= yymsgbuf
)
2282 YYSTACK_FREE (yymsg
);
2283 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2285 yymsg_alloc
= yyalloc
;
2289 yymsg_alloc
= sizeof yymsgbuf
;
2293 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2295 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2300 yyerror (YY_("syntax error"));
2302 goto yyexhaustedlab
;
2308 yyerror_range
[0] = yylloc
;
2310 if (yyerrstatus
== 3)
2312 /* If just tried and failed to reuse lookahead token after an
2313 error, discard it. */
2315 if (yychar
<= YYEOF
)
2317 /* Return failure if at end of input. */
2318 if (yychar
== YYEOF
)
2323 yydestruct ("Error: discarding",
2324 yytoken
, &yylval
, &yylloc
);
2329 /* Else will try to reuse lookahead token after shifting the error
2334 /*---------------------------------------------------.
2335 | yyerrorlab -- error raised explicitly by YYERROR. |
2336 `---------------------------------------------------*/
2339 /* Pacify compilers like GCC when the user code never invokes
2340 YYERROR and the label yyerrorlab therefore never appears in user
2342 if (/*CONSTCOND*/ 0)
2345 yyerror_range
[0] = yylsp
[1-yylen
];
2346 /* Do not reclaim the symbols of the rule which action triggered
2350 YY_STACK_PRINT (yyss
, yyssp
);
2355 /*-------------------------------------------------------------.
2356 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2357 `-------------------------------------------------------------*/
2359 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2363 yyn
= yypact
[yystate
];
2364 if (yyn
!= YYPACT_NINF
)
2367 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2375 /* Pop the current state because it cannot handle the error token. */
2379 yyerror_range
[0] = *yylsp
;
2380 yydestruct ("Error: popping",
2381 yystos
[yystate
], yyvsp
, yylsp
);
2384 YY_STACK_PRINT (yyss
, yyssp
);
2392 yyerror_range
[1] = yylloc
;
2393 /* Using YYLLOC is tempting, but would change the location of
2394 the lookahead. YYLOC is available though. */
2395 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2398 /* Shift the error token. */
2399 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2405 /*-------------------------------------.
2406 | yyacceptlab -- YYACCEPT comes here. |
2407 `-------------------------------------*/
2412 /*-----------------------------------.
2413 | yyabortlab -- YYABORT comes here. |
2414 `-----------------------------------*/
2420 /*-------------------------------------------------.
2421 | yyexhaustedlab -- memory exhaustion comes here. |
2422 `-------------------------------------------------*/
2424 yyerror (YY_("memory exhausted"));
2430 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
2431 yydestruct ("Cleanup: discarding lookahead",
2432 yytoken
, &yylval
, &yylloc
);
2433 /* Do not reclaim the symbols of the rule which action triggered
2434 this YYABORT or YYACCEPT. */
2436 YY_STACK_PRINT (yyss
, yyssp
);
2437 while (yyssp
!= yyss
)
2439 yydestruct ("Cleanup: popping",
2440 yystos
[*yyssp
], yyvsp
, yylsp
);
2445 YYSTACK_FREE (yyss
);
2448 if (yymsg
!= yymsgbuf
)
2449 YYSTACK_FREE (yymsg
);
2451 /* Make sure YYID is used. */
2452 return YYID (yyresult
);
2456 #line 539 "parse-gram.y"
2460 /* Return the location of the left-hand side of a rule whose
2461 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2462 the right-hand side, and return an empty location equal to the end
2463 boundary of RHS[0] if the right-hand side is empty. */
2466 lloc_default (YYLTYPE
const *rhs
, int n
)
2471 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2472 The bug is fixed in 7.4.2m, but play it safe for now. */
2473 loc
.start
= rhs
[n
].end
;
2474 loc
.end
= rhs
[n
].end
;
2476 /* Ignore empty nonterminals the start of the the right-hand side.
2477 Do not bother to ignore them at the end of the right-hand side,
2478 since empty nonterminals have the same end as their predecessors. */
2479 for (i
= 1; i
<= n
; i
++)
2480 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2482 loc
.start
= rhs
[i
].start
;
2490 /* Add a lex-param or a parse-param (depending on TYPE) with
2491 declaration DECL and location LOC. */
2494 add_param (char const *type
, char *decl
, location loc
)
2496 static char const alphanum
[26 + 26 + 1 + 10] =
2497 "abcdefghijklmnopqrstuvwxyz"
2498 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2501 char const *name_start
= NULL
;
2504 /* Stop on last actual character. */
2505 for (p
= decl
; p
[1]; p
++)
2507 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2508 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2511 /* Strip the surrounding '{' and '}', and any blanks just inside
2513 while (*--p
== ' ' || *p
== '\t')
2516 while (*++decl
== ' ' || *decl
== '\t')
2520 complain_at (loc
, _("missing identifier in parameter declaration"));
2527 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2531 name
= xmalloc (name_len
+ 1);
2532 memcpy (name
, name_start
, name_len
);
2533 name
[name_len
] = '\0';
2534 muscle_pair_list_grow (type
, decl
, name
);
2538 gram_scanner_last_string_free ();
2542 version_check (location
const *loc
, char const *version
)
2544 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2546 complain_at (*loc
, "require bison %s, but have %s",
2547 version
, PACKAGE_VERSION
);
2553 gram_error (location
const *loc
, char const *msg
)
2555 complain_at (*loc
, "%s", msg
);
2559 token_name (int type
)
2561 return yytname
[YYTRANSLATE (type
)];
2572 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2573 return quotearg_style (escape_quoting_style
, buf
);