2 /* A Bison parser, made by GNU Bison 2.3a+. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA. */
24 /* As a special exception, you may create a larger work that contains
25 part or all of the Bison parser skeleton and distribute that work
26 under terms of your choice, so long as that work isn't itself a
27 parser generator using the skeleton or a modified version thereof
28 as a parser skeleton. Alternatively, if you modify or redistribute
29 the parser skeleton itself, you may (at your option) remove this
30 special exception, which will cause the skeleton and the resulting
31 Bison output files to be licensed under the GNU General Public
32 License without this special exception.
34 This special exception was added by the Free Software Foundation in
35 version 2.2 of Bison. */
37 /* C LALR(1) parser skeleton written by Richard Stallman, by
38 simplifying the original so-called "semantic" parser. */
40 /* All symbols defined below should begin with yy or YY, to avoid
41 infringing on user name space. This should be done even for local
42 variables, as they might otherwise be expanded by user macros.
43 There are some unavoidable exceptions within include files to
44 define necessary library symbols; they are noted "INFRINGES ON
45 USER NAME SPACE" below. */
47 /* Identify Bison output. */
51 #define YYBISON_VERSION "2.3a+"
54 #define YYSKELETON_NAME "yacc.c"
65 /* Using locations. */
66 #define YYLSP_NEEDED 1
68 /* Substitute the variable and function names. */
69 #define yyparse gram_parse
70 #define yylex gram_lex
71 #define yyerror gram_error
72 #define yylval gram_lval
73 #define yychar gram_char
74 #define yydebug gram_debug
75 #define yynerrs gram_nerrs
76 #define yylloc gram_lloc
78 /* Copy the first part of user declarations. */
80 /* Line 1537 of yacc.c */
81 #line 1 "parse-gram.y"
82 /* Bison Grammar Parser -*- C -*-
84 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
87 This file is part of Bison, the GNU Compiler Compiler.
89 This program is free software; you can redistribute it and/or modify
90 it under the terms of the GNU General Public License as published by
91 the Free Software Foundation; either version 2 of the License, or
92 (at your option) any later version.
94 This program is distributed in the hope that it will be useful,
95 but WITHOUT ANY WARRANTY; without even the implied warranty of
96 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
97 GNU General Public License for more details.
99 You should have received a copy of the GNU General Public License
100 along with this program; if not, write to the Free Software
101 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
108 #include <strverscmp.h>
110 #include "complain.h"
111 #include "conflicts.h"
115 #include "muscle_tab.h"
116 #include "quotearg.h"
119 #include "scan-gram.h"
120 #include "scan-code.h"
122 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
123 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
125 #define YY_LOCATION_PRINT(File, Loc) \
126 location_print (File, Loc)
128 static void version_check (location
const *loc
, char const *version
);
130 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
131 FIXME: depends on the undocumented availability of YYLLOC. */
133 #define yyerror(Msg) \
134 gram_error (&yylloc, Msg)
135 static void gram_error (location
const *, char const *);
137 static char const *char_name (char);
139 /** Add a lex-param or a parse-param.
141 * \param type \a lex_param or \a parse_param
142 * \param decl the formal argument
143 * \param loc the location in the source.
145 static void add_param (char const *type
, char *decl
, location loc
);
148 static symbol_class current_class
= unknown_sym
;
149 static uniqstr current_type
= NULL
;
150 static symbol
*current_lhs
;
151 static location current_lhs_location
;
152 static int current_prec
= 0;
154 #define YYTYPE_INT16 int_fast16_t
155 #define YYTYPE_INT8 int_fast8_t
156 #define YYTYPE_UINT16 uint_fast16_t
157 #define YYTYPE_UINT8 uint_fast8_t
160 /* Line 1537 of yacc.c */
161 #line 162 "parse-gram.c"
163 /* Enabling traces. */
168 /* Enabling verbose error messages. */
169 #ifdef YYERROR_VERBOSE
170 # undef YYERROR_VERBOSE
171 # define YYERROR_VERBOSE 1
173 # define YYERROR_VERBOSE 1
176 /* Enabling the token table. */
177 #ifndef YYTOKEN_TABLE
178 # define YYTOKEN_TABLE 0
185 /* Put the tokens into the symbol table, so that GDB and other debuggers
194 PERCENT_DESTRUCTOR
= 263,
195 PERCENT_PRINTER
= 264,
198 PERCENT_NONASSOC
= 267,
204 PERCENT_DEFAULT_PREC
= 273,
205 PERCENT_DEFINE
= 274,
206 PERCENT_DEFINES
= 275,
207 PERCENT_ERROR_VERBOSE
= 276,
208 PERCENT_EXPECT
= 277,
209 PERCENT_EXPECT_RR
= 278,
210 PERCENT_FILE_PREFIX
= 279,
211 PERCENT_GLR_PARSER
= 280,
212 PERCENT_INITIAL_ACTION
= 281,
213 PERCENT_LANGUAGE
= 282,
214 PERCENT_LEX_PARAM
= 283,
215 PERCENT_LOCATIONS
= 284,
216 PERCENT_NAME_PREFIX
= 285,
217 PERCENT_NO_DEFAULT_PREC
= 286,
218 PERCENT_NO_LINES
= 287,
219 PERCENT_NONDETERMINISTIC_PARSER
= 288,
220 PERCENT_OUTPUT
= 289,
221 PERCENT_PARSE_PARAM
= 290,
222 PERCENT_PURE_PARSER
= 291,
223 PERCENT_PUSH_PARSER
= 292,
224 PERCENT_PUSH_PULL_PARSER
= 293,
225 PERCENT_REQUIRE
= 294,
226 PERCENT_SKELETON
= 295,
228 PERCENT_TOKEN_TABLE
= 297,
229 PERCENT_VERBOSE
= 298,
237 PERCENT_PERCENT
= 306,
250 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
251 typedef union YYSTYPE
254 /* Line 1537 of yacc.c */
255 #line 97 "parse-gram.y"
264 unsigned char character
;
268 /* Line 1537 of yacc.c */
269 #line 270 "parse-gram.c"
271 # define YYSTYPE_IS_TRIVIAL 1
272 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
273 # define YYSTYPE_IS_DECLARED 1
276 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
277 typedef struct YYLTYPE
284 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
285 # define YYLTYPE_IS_DECLARED 1
286 # define YYLTYPE_IS_TRIVIAL 1
290 /* Copy the second part of user declarations. */
293 /* Line 1537 of yacc.c */
294 #line 295 "parse-gram.c"
301 typedef YYTYPE_UINT8 yytype_uint8
;
303 typedef unsigned char yytype_uint8
;
307 typedef YYTYPE_INT8 yytype_int8
;
308 #elif (defined __STDC__ || defined __C99__FUNC__ \
309 || defined __cplusplus || defined _MSC_VER)
310 typedef signed char yytype_int8
;
312 typedef short int yytype_int8
;
316 typedef YYTYPE_UINT16 yytype_uint16
;
318 typedef unsigned short int yytype_uint16
;
322 typedef YYTYPE_INT16 yytype_int16
;
324 typedef short int yytype_int16
;
328 # ifdef __SIZE_TYPE__
329 # define YYSIZE_T __SIZE_TYPE__
330 # elif defined size_t
331 # define YYSIZE_T size_t
332 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
333 || defined __cplusplus || defined _MSC_VER)
334 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
335 # define YYSIZE_T size_t
337 # define YYSIZE_T unsigned int
341 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
346 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
347 # define YY_(msgid) dgettext ("bison-runtime", msgid)
351 # define YY_(msgid) msgid
355 /* Suppress unused-variable warnings by "using" E. */
356 #if ! defined lint || defined __GNUC__
357 # define YYUSE(e) ((void) (e))
359 # define YYUSE(e) /* empty */
362 /* Identity function, used to suppress warnings about constant conditions. */
366 #if (defined __STDC__ || defined __C99__FUNC__ \
367 || defined __cplusplus || defined _MSC_VER)
380 #if ! defined yyoverflow || YYERROR_VERBOSE
382 /* The parser invokes alloca or malloc; define the necessary symbols. */
384 # ifdef YYSTACK_USE_ALLOCA
385 # if YYSTACK_USE_ALLOCA
387 # define YYSTACK_ALLOC __builtin_alloca
388 # elif defined __BUILTIN_VA_ARG_INCR
389 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
391 # define YYSTACK_ALLOC __alloca
392 # elif defined _MSC_VER
393 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
394 # define alloca _alloca
396 # define YYSTACK_ALLOC alloca
397 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
398 || defined __cplusplus || defined _MSC_VER)
399 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
408 # ifdef YYSTACK_ALLOC
409 /* Pacify GCC's `empty if-body' warning. */
410 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
411 # ifndef YYSTACK_ALLOC_MAXIMUM
412 /* The OS might guarantee only one guard page at the bottom of the stack,
413 and a page size can be as small as 4096 bytes. So we cannot safely
414 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
415 to allow for a few compiler-allocated temporary stack slots. */
416 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
419 # define YYSTACK_ALLOC YYMALLOC
420 # define YYSTACK_FREE YYFREE
421 # ifndef YYSTACK_ALLOC_MAXIMUM
422 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
424 # if (defined __cplusplus && ! defined _STDLIB_H \
425 && ! ((defined YYMALLOC || defined malloc) \
426 && (defined YYFREE || defined free)))
427 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
433 # define YYMALLOC malloc
434 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
435 || defined __cplusplus || defined _MSC_VER)
436 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
441 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
442 || defined __cplusplus || defined _MSC_VER)
443 void free (void *); /* INFRINGES ON USER NAME SPACE */
447 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
450 #if (! defined yyoverflow \
451 && (! defined __cplusplus \
452 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
453 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
455 /* A type that is properly aligned for any stack member. */
463 /* The size of the maximum gap between one aligned stack and the next. */
464 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
466 /* The size of an array large to enough to hold all stacks, each with
468 # define YYSTACK_BYTES(N) \
469 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
470 + 2 * YYSTACK_GAP_MAXIMUM)
472 /* Copy COUNT objects from FROM to TO. The source and destination do
475 # if defined __GNUC__ && 1 < __GNUC__
476 # define YYCOPY(To, From, Count) \
477 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
479 # define YYCOPY(To, From, Count) \
483 for (yyi = 0; yyi < (Count); yyi++) \
484 (To)[yyi] = (From)[yyi]; \
490 /* Relocate STACK from its old location to the new one. The
491 local variables YYSIZE and YYSTACKSIZE give the old and new number of
492 elements in the stack, and YYPTR gives the new location of the
493 stack. Advance YYPTR to a properly aligned location for the next
495 # define YYSTACK_RELOCATE(Stack) \
498 YYSIZE_T yynewbytes; \
499 YYCOPY (&yyptr->Stack, Stack, yysize); \
500 Stack = &yyptr->Stack; \
501 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
502 yyptr += yynewbytes / sizeof (*yyptr); \
508 /* YYFINAL -- State number of the termination state. */
510 /* YYLAST -- Last index in YYTABLE. */
513 /* YYNTOKENS -- Number of terminals. */
515 /* YYNNTS -- Number of nonterminals. */
517 /* YYNRULES -- Number of rules. */
519 /* YYNRULES -- Number of states. */
520 #define YYNSTATES 141
522 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
524 #define YYMAXUTOK 313
526 #define YYTRANSLATE(YYX) \
527 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
529 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
530 static const yytype_uint8 yytranslate
[] =
532 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 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, 1, 2, 3, 4,
558 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
559 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
560 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
561 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
562 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
567 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
569 static const yytype_uint16 yyprhs
[] =
571 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
572 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
573 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
574 80, 82, 85, 88, 90, 92, 94, 96, 98, 100,
575 103, 107, 111, 113, 115, 118, 122, 123, 125, 129,
576 130, 134, 135, 139, 143, 147, 149, 151, 153, 154,
577 156, 158, 161, 163, 166, 168, 170, 172, 174, 176,
578 178, 181, 184, 188, 190, 193, 195, 198, 200, 203,
579 206, 207, 211, 213, 217, 220, 221, 224, 227, 231,
580 235, 239, 241, 243, 244, 246, 248, 250, 252, 254,
584 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
585 static const yytype_int8 yyrhs
[] =
587 60, 0, -1, 61, 51, 76, 89, -1, -1, 61,
588 62, -1, 63, -1, 53, -1, 17, -1, 19, 82,
589 83, -1, 20, -1, 20, 3, -1, 21, -1, 22,
590 4, -1, 23, 4, -1, 24, 3, -1, 24, 48,
591 3, -1, 25, -1, 26, 45, -1, 27, 3, -1,
592 28, 45, -1, 29, -1, 30, 3, -1, 30, 48,
593 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
594 48, 3, -1, 35, 45, -1, 36, -1, 37, -1,
595 38, -1, 39, 3, -1, 40, 3, -1, 42, -1,
596 43, -1, 44, -1, 54, -1, 68, -1, 65, -1,
597 41, 87, -1, 8, 45, 72, -1, 9, 45, 72,
598 -1, 18, -1, 31, -1, 16, 84, -1, 16, 49,
599 84, -1, -1, 49, -1, 58, 64, 84, -1, -1,
600 6, 66, 75, -1, -1, 5, 67, 75, -1, 7,
601 55, 71, -1, 69, 70, 71, -1, 10, -1, 11,
602 -1, 12, -1, -1, 55, -1, 87, -1, 71, 87,
603 -1, 73, -1, 72, 73, -1, 87, -1, 55, -1,
604 56, -1, 57, -1, 55, -1, 85, -1, 85, 4,
605 -1, 85, 88, -1, 85, 4, 88, -1, 74, -1,
606 75, 74, -1, 77, -1, 76, 77, -1, 78, -1,
607 63, 54, -1, 1, 54, -1, -1, 86, 79, 80,
608 -1, 81, -1, 80, 52, 81, -1, 80, 54, -1,
609 -1, 81, 87, -1, 81, 45, -1, 81, 13, 87,
610 -1, 81, 14, 4, -1, 81, 15, 55, -1, 49,
611 -1, 3, -1, -1, 3, -1, 45, -1, 49, -1,
612 46, -1, 50, -1, 85, -1, 88, -1, 3, -1,
616 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
617 static const yytype_uint16 yyrline
[] =
619 0, 210, 210, 218, 220, 224, 225, 235, 236, 248,
620 249, 254, 255, 256, 257, 258, 259, 264, 273, 274,
621 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
622 285, 286, 287, 288, 289, 290, 291, 295, 296, 297,
623 301, 308, 315, 319, 323, 328, 349, 350, 354, 366,
624 366, 371, 371, 376, 387, 402, 403, 404, 408, 409,
625 414, 416, 421, 422, 426, 427, 428, 429, 434, 439,
626 444, 450, 456, 467, 468, 477, 478, 484, 485, 486,
627 493, 493, 497, 498, 499, 504, 505, 507, 509, 511,
628 513, 523, 524, 530, 534, 543, 563, 565, 574, 579,
633 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
634 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
635 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
636 static const char *const yytname
[] =
638 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
639 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
640 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
641 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
642 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
643 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
644 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
645 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
646 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
647 "\"%parse-param\"", "\"%pure-parser\"", "\"%push-parser\"",
648 "\"%push-pull-parser\"", "\"%require\"", "\"%skeleton\"", "\"%start\"",
649 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"",
650 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
651 "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"", "\"<*>\"", "\"<>\"",
652 "\"%union\"", "$accept", "input", "prologue_declarations",
653 "prologue_declaration", "grammar_declaration", "union_name",
654 "symbol_declaration", "$@1", "$@2", "precedence_declaration",
655 "precedence_declarator", "type.opt", "symbols.1", "generic_symlist",
656 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
657 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
658 "variable", "content.opt", "braceless", "id", "id_colon", "symbol",
659 "string_as_id", "epilogue.opt", 0
664 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
666 static const yytype_uint16 yytoknum
[] =
668 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
669 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
670 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
671 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
672 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
673 305, 306, 307, 308, 309, 310, 311, 312, 313
677 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
678 static const yytype_uint8 yyr1
[] =
680 0, 59, 60, 61, 61, 62, 62, 62, 62, 62,
681 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
682 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
683 62, 62, 62, 62, 62, 62, 62, 63, 63, 63,
684 63, 63, 63, 63, 63, 63, 64, 64, 63, 66,
685 65, 67, 65, 65, 68, 69, 69, 69, 70, 70,
686 71, 71, 72, 72, 73, 73, 73, 73, 74, 74,
687 74, 74, 74, 75, 75, 76, 76, 77, 77, 77,
688 79, 78, 80, 80, 80, 81, 81, 81, 81, 81,
689 81, 82, 82, 83, 83, 84, 85, 85, 86, 87,
693 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
694 static const yytype_uint8 yyr2
[] =
696 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
697 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
698 1, 2, 3, 1, 1, 2, 3, 2, 1, 1,
699 1, 2, 2, 1, 1, 1, 1, 1, 1, 2,
700 3, 3, 1, 1, 2, 3, 0, 1, 3, 0,
701 3, 0, 3, 3, 3, 1, 1, 1, 0, 1,
702 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
703 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
704 0, 3, 1, 3, 2, 0, 2, 2, 3, 3,
705 3, 1, 1, 0, 1, 1, 1, 1, 1, 1,
709 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
710 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
711 means the default is an error. */
712 static const yytype_uint8 yydefact
[] =
714 3, 0, 0, 1, 51, 49, 0, 0, 0, 55,
715 56, 57, 0, 7, 42, 0, 9, 11, 0, 0,
716 0, 16, 0, 0, 0, 20, 0, 43, 23, 24,
717 0, 0, 28, 29, 30, 0, 0, 0, 33, 34,
718 35, 0, 6, 36, 46, 4, 5, 38, 37, 58,
719 0, 0, 0, 0, 0, 95, 0, 44, 92, 91,
720 93, 10, 12, 13, 14, 0, 17, 18, 19, 21,
721 0, 25, 0, 27, 31, 32, 101, 97, 96, 99,
722 39, 100, 0, 98, 0, 0, 75, 77, 80, 47,
723 0, 59, 0, 68, 73, 52, 69, 50, 53, 60,
724 65, 66, 67, 40, 62, 64, 41, 45, 94, 8,
725 15, 22, 26, 79, 78, 0, 76, 2, 85, 48,
726 54, 74, 70, 71, 61, 63, 103, 81, 82, 72,
727 85, 84, 0, 0, 0, 87, 86, 83, 88, 89,
731 /* YYDEFGOTO[NTERM-NUM]. */
732 static const yytype_int16 yydefgoto
[] =
734 -1, 1, 2, 45, 84, 90, 47, 51, 50, 48,
735 49, 92, 98, 103, 104, 94, 95, 85, 86, 87,
736 118, 127, 128, 60, 109, 57, 79, 88, 105, 81,
740 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
742 #define YYPACT_NINF -79
743 static const yytype_int16 yypact
[] =
745 -79, 5, 96, -79, -79, -79, -6, 13, 18, -79,
746 -79, -79, -8, -79, -79, 27, 66, -79, 74, 82,
747 31, -79, 43, 86, 45, -79, 32, -79, -79, -79,
748 33, 47, -79, -79, -79, 91, 93, 26, -79, -79,
749 -79, 15, -79, -79, 48, -79, -79, -79, -79, 44,
750 38, 38, 26, 11, 11, -79, 53, -79, -79, -79,
751 106, -79, -79, -79, -79, 107, -79, -79, -79, -79,
752 108, -79, 138, -79, -79, -79, -79, -79, -79, -79,
753 -79, -79, 88, -79, 89, 1, -79, -79, -79, -79,
754 53, -79, 26, -79, -79, 38, 50, 38, 26, -79,
755 -79, -79, -79, 11, -79, -79, 11, -79, -79, -79,
756 -79, -79, -79, -79, -79, 97, -79, -79, -79, -79,
757 26, -79, 142, -79, -79, -79, -79, -7, 25, -79,
758 -79, -79, 26, 144, 98, -79, -79, 25, -79, -79,
762 /* YYPGOTO[NTERM-NUM]. */
763 static const yytype_int16 yypgoto
[] =
765 -79, -79, -79, -79, 149, -79, -79, -79, -79, -79,
766 -79, -79, 54, 101, -21, -33, 105, -79, 67, -79,
767 -79, -79, 28, -79, -79, -13, -47, -79, -37, -78,
771 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
772 positive, shift that token. If negative, reduce the rule which
773 number is the opposite. If zero, do what YYDEFACT says.
774 If YYTABLE_NINF, syntax error. */
775 #define YYTABLE_NINF -103
776 static const yytype_int16 yytable
[] =
778 80, -102, 82, 96, 96, 3, 4, 5, 6, 7,
779 8, 9, 10, 11, 76, 99, 82, 12, 123, 14,
780 4, 5, 6, 7, 8, 9, 10, 11, 76, 76,
781 58, 12, 27, 14, 64, 69, 71, 55, 132, 133,
782 134, 56, 37, 107, 129, 130, 27, 131, 96, 52,
783 96, 83, 115, 76, 122, 99, 37, 77, 53, 44,
784 78, 124, 121, 54, 121, 83, 100, 101, 102, 61,
785 135, 77, 77, 44, 78, 78, 59, 119, 62, 65,
786 70, 72, 125, 124, 77, 125, 63, 78, 66, 67,
787 68, 136, 73, 93, 74, 138, 75, 89, 55, 91,
788 136, 4, 5, 6, 7, 8, 9, 10, 11, 108,
789 110, 111, 12, 13, 14, 15, 16, 17, 18, 19,
790 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
791 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
792 40, 112, 113, 114, 126, 76, 120, 41, 139, 42,
793 43, 46, 116, 140, 44, 106, 97, 0, 137
796 static const yytype_int16 yycheck
[] =
798 37, 0, 1, 50, 51, 0, 5, 6, 7, 8,
799 9, 10, 11, 12, 3, 52, 1, 16, 96, 18,
800 5, 6, 7, 8, 9, 10, 11, 12, 3, 3,
801 3, 16, 31, 18, 3, 3, 3, 45, 13, 14,
802 15, 49, 41, 56, 122, 52, 31, 54, 95, 55,
803 97, 50, 51, 3, 4, 92, 41, 46, 45, 58,
804 49, 98, 95, 45, 97, 50, 55, 56, 57, 3,
805 45, 46, 46, 58, 49, 49, 49, 90, 4, 48,
806 48, 48, 103, 120, 46, 106, 4, 49, 45, 3,
807 45, 128, 45, 55, 3, 132, 3, 49, 45, 55,
808 137, 5, 6, 7, 8, 9, 10, 11, 12, 3,
809 3, 3, 16, 17, 18, 19, 20, 21, 22, 23,
810 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
811 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
812 44, 3, 54, 54, 47, 3, 92, 51, 4, 53,
813 54, 2, 85, 55, 58, 54, 51, -1, 130
816 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
817 symbol of state STATE-NUM. */
818 static const yytype_uint8 yystos
[] =
820 0, 60, 61, 0, 5, 6, 7, 8, 9, 10,
821 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
822 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
823 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
824 44, 51, 53, 54, 58, 62, 63, 65, 68, 69,
825 67, 66, 55, 45, 45, 45, 49, 84, 3, 49,
826 82, 3, 4, 4, 3, 48, 45, 3, 45, 3,
827 48, 3, 48, 45, 3, 3, 3, 46, 49, 85,
828 87, 88, 1, 50, 63, 76, 77, 78, 86, 49,
829 64, 55, 70, 55, 74, 75, 85, 75, 71, 87,
830 55, 56, 57, 72, 73, 87, 72, 84, 3, 83,
831 3, 3, 3, 54, 54, 51, 77, 89, 79, 84,
832 71, 74, 4, 88, 87, 73, 47, 80, 81, 88,
833 52, 54, 13, 14, 15, 45, 87, 81, 87, 4,
837 #define yyerrok (yyerrstatus = 0)
838 #define yyclearin (yychar = YYEMPTY)
842 #define YYACCEPT goto yyacceptlab
843 #define YYABORT goto yyabortlab
844 #define YYERROR goto yyerrorlab
847 /* Like YYERROR except do call yyerror. This remains here temporarily
848 to ease the transition to the new meaning of YYERROR, for GCC.
849 Once GCC version 2 has supplanted version 1, this can go. */
851 #define YYFAIL goto yyerrlab
853 #define YYRECOVERING() (!!yyerrstatus)
855 #define YYBACKUP(Token, Value) \
857 if (yychar == YYEMPTY && yylen == 1) \
861 yytoken = YYTRANSLATE (yychar); \
867 yyerror (YY_("syntax error: cannot back up")); \
874 #define YYERRCODE 256
877 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
878 If N is 0, then set CURRENT to the empty location which ends
879 the previous symbol: RHS[0] (always defined). */
881 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
882 #ifndef YYLLOC_DEFAULT
883 # define YYLLOC_DEFAULT(Current, Rhs, N) \
887 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
888 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
889 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
890 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
894 (Current).first_line = (Current).last_line = \
895 YYRHSLOC (Rhs, 0).last_line; \
896 (Current).first_column = (Current).last_column = \
897 YYRHSLOC (Rhs, 0).last_column; \
903 /* YY_LOCATION_PRINT -- Print the location on the stream.
904 This macro was not mandated originally: define only if we know
905 we won't break user code: when these are the locations we know. */
907 #ifndef YY_LOCATION_PRINT
908 # if YYLTYPE_IS_TRIVIAL
909 # define YY_LOCATION_PRINT(File, Loc) \
910 fprintf (File, "%d.%d-%d.%d", \
911 (Loc).first_line, (Loc).first_column, \
912 (Loc).last_line, (Loc).last_column)
914 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
919 /* YYLEX -- calling `yylex' with the right arguments. */
922 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
924 # define YYLEX yylex (&yylval, &yylloc)
927 /* Enable debugging if requested. */
931 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
932 # define YYFPRINTF fprintf
935 # define YYDPRINTF(Args) \
941 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
945 YYFPRINTF (stderr, "%s ", Title); \
946 yy_symbol_print (stderr, \
947 Type, Value, Location); \
948 YYFPRINTF (stderr, "\n"); \
953 /*--------------------------------.
954 | Print this symbol on YYOUTPUT. |
955 `--------------------------------*/
958 #if (defined __STDC__ || defined __C99__FUNC__ \
959 || defined __cplusplus || defined _MSC_VER)
961 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
964 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
967 YYSTYPE
const * const yyvaluep
;
968 YYLTYPE
const * const yylocationp
;
975 if (yytype
< YYNTOKENS
)
976 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
982 case 3: /* "\"string\"" */
984 /* Line 1537 of yacc.c */
985 #line 188 "parse-gram.y"
986 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
988 /* Line 1537 of yacc.c */
989 #line 990 "parse-gram.c"
991 case 4: /* "\"integer\"" */
993 /* Line 1537 of yacc.c */
994 #line 199 "parse-gram.y"
995 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
997 /* Line 1537 of yacc.c */
998 #line 999 "parse-gram.c"
1000 case 45: /* "\"{...}\"" */
1002 /* Line 1537 of yacc.c */
1003 #line 190 "parse-gram.y"
1004 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
1006 /* Line 1537 of yacc.c */
1007 #line 1008 "parse-gram.c"
1009 case 46: /* "\"char\"" */
1011 /* Line 1537 of yacc.c */
1012 #line 182 "parse-gram.y"
1013 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1015 /* Line 1537 of yacc.c */
1016 #line 1017 "parse-gram.c"
1018 case 47: /* "\"epilogue\"" */
1020 /* Line 1537 of yacc.c */
1021 #line 190 "parse-gram.y"
1022 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1024 /* Line 1537 of yacc.c */
1025 #line 1026 "parse-gram.c"
1027 case 49: /* "\"identifier\"" */
1029 /* Line 1537 of yacc.c */
1030 #line 195 "parse-gram.y"
1031 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1033 /* Line 1537 of yacc.c */
1034 #line 1035 "parse-gram.c"
1036 case 50: /* "\"identifier:\"" */
1038 /* Line 1537 of yacc.c */
1039 #line 196 "parse-gram.y"
1040 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1042 /* Line 1537 of yacc.c */
1043 #line 1044 "parse-gram.c"
1045 case 53: /* "\"%{...%}\"" */
1047 /* Line 1537 of yacc.c */
1048 #line 190 "parse-gram.y"
1049 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1051 /* Line 1537 of yacc.c */
1052 #line 1053 "parse-gram.c"
1054 case 55: /* "\"type\"" */
1056 /* Line 1537 of yacc.c */
1057 #line 194 "parse-gram.y"
1058 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1060 /* Line 1537 of yacc.c */
1061 #line 1062 "parse-gram.c"
1063 case 82: /* "variable" */
1065 /* Line 1537 of yacc.c */
1066 #line 195 "parse-gram.y"
1067 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1069 /* Line 1537 of yacc.c */
1070 #line 1071 "parse-gram.c"
1072 case 83: /* "content.opt" */
1074 /* Line 1537 of yacc.c */
1075 #line 190 "parse-gram.y"
1076 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1078 /* Line 1537 of yacc.c */
1079 #line 1080 "parse-gram.c"
1081 case 84: /* "braceless" */
1083 /* Line 1537 of yacc.c */
1084 #line 190 "parse-gram.y"
1085 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1087 /* Line 1537 of yacc.c */
1088 #line 1089 "parse-gram.c"
1092 /* Line 1537 of yacc.c */
1093 #line 202 "parse-gram.y"
1094 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1096 /* Line 1537 of yacc.c */
1097 #line 1098 "parse-gram.c"
1099 case 86: /* "id_colon" */
1101 /* Line 1537 of yacc.c */
1102 #line 203 "parse-gram.y"
1103 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1105 /* Line 1537 of yacc.c */
1106 #line 1107 "parse-gram.c"
1108 case 87: /* "symbol" */
1110 /* Line 1537 of yacc.c */
1111 #line 202 "parse-gram.y"
1112 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1114 /* Line 1537 of yacc.c */
1115 #line 1116 "parse-gram.c"
1117 case 88: /* "string_as_id" */
1119 /* Line 1537 of yacc.c */
1120 #line 202 "parse-gram.y"
1121 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1123 /* Line 1537 of yacc.c */
1124 #line 1125 "parse-gram.c"
1132 /*--------------------------------.
1133 | Print this symbol on YYOUTPUT. |
1134 `--------------------------------*/
1136 #if (defined __STDC__ || defined __C99__FUNC__ \
1137 || defined __cplusplus || defined _MSC_VER)
1139 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1142 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1145 YYSTYPE
const * const yyvaluep
;
1146 YYLTYPE
const * const yylocationp
;
1149 if (yytype
< YYNTOKENS
)
1150 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1152 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1154 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1155 YYFPRINTF (yyoutput
, ": ");
1156 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1157 YYFPRINTF (yyoutput
, ")");
1160 /*------------------------------------------------------------------.
1161 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1163 `------------------------------------------------------------------*/
1165 #if (defined __STDC__ || defined __C99__FUNC__ \
1166 || defined __cplusplus || defined _MSC_VER)
1168 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1171 yy_stack_print (yybottom
, yytop
)
1172 yytype_int16
*yybottom
;
1173 yytype_int16
*yytop
;
1176 YYFPRINTF (stderr
, "Stack now");
1177 for (; yybottom
<= yytop
; yybottom
++)
1179 int yybot
= *yybottom
;
1180 YYFPRINTF (stderr
, " %d", yybot
);
1182 YYFPRINTF (stderr
, "\n");
1185 # define YY_STACK_PRINT(Bottom, Top) \
1188 yy_stack_print ((Bottom), (Top)); \
1192 /*------------------------------------------------.
1193 | Report that the YYRULE is going to be reduced. |
1194 `------------------------------------------------*/
1196 #if (defined __STDC__ || defined __C99__FUNC__ \
1197 || defined __cplusplus || defined _MSC_VER)
1199 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1202 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1208 int yynrhs
= yyr2
[yyrule
];
1210 unsigned long int yylno
= yyrline
[yyrule
];
1211 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1213 /* The symbols being reduced. */
1214 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1216 fprintf (stderr
, " $%d = ", yyi
+ 1);
1217 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1218 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1219 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1220 fprintf (stderr
, "\n");
1224 # define YY_REDUCE_PRINT(Rule) \
1227 yy_reduce_print (yyvsp, yylsp, Rule); \
1230 /* Nonzero means print parse trace. It is left uninitialized so that
1231 multiple parsers can coexist. */
1233 #else /* !YYDEBUG */
1234 # define YYDPRINTF(Args)
1235 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1236 # define YY_STACK_PRINT(Bottom, Top)
1237 # define YY_REDUCE_PRINT(Rule)
1238 #endif /* !YYDEBUG */
1241 /* YYINITDEPTH -- initial size of the parser's stacks. */
1243 # define YYINITDEPTH 200
1246 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1247 if the built-in stack extension method is used).
1249 Do not make this value too large; the results are undefined if
1250 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1251 evaluated with infinite-precision integer arithmetic. */
1254 # define YYMAXDEPTH 10000
1262 # if defined __GLIBC__ && defined _STRING_H
1263 # define yystrlen strlen
1265 /* Return the length of YYSTR. */
1266 #if (defined __STDC__ || defined __C99__FUNC__ \
1267 || defined __cplusplus || defined _MSC_VER)
1269 yystrlen (const char *yystr
)
1277 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1285 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1286 # define yystpcpy stpcpy
1288 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1290 #if (defined __STDC__ || defined __C99__FUNC__ \
1291 || defined __cplusplus || defined _MSC_VER)
1293 yystpcpy (char *yydest
, const char *yysrc
)
1296 yystpcpy (yydest
, yysrc
)
1302 const char *yys
= yysrc
;
1304 while ((*yyd
++ = *yys
++) != '\0')
1313 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1314 quotes and backslashes, so that it's suitable for yyerror. The
1315 heuristic is that double-quoting is unnecessary unless the string
1316 contains an apostrophe, a comma, or backslash (other than
1317 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1318 null, do not copy; instead, return the length of what the result
1321 yytnamerr (char *yyres
, const char *yystr
)
1326 char const *yyp
= yystr
;
1333 goto do_not_strip_quotes
;
1337 goto do_not_strip_quotes
;
1350 do_not_strip_quotes
: ;
1354 return yystrlen (yystr
);
1356 return yystpcpy (yyres
, yystr
) - yyres
;
1360 /* Copy into YYRESULT an error message about the unexpected token
1361 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1362 including the terminating null byte. If YYRESULT is null, do not
1363 copy anything; just return the number of bytes that would be
1364 copied. As a special case, return 0 if an ordinary "syntax error"
1365 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1366 size calculation. */
1368 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1370 int yyn
= yypact
[yystate
];
1372 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1376 int yytype
= YYTRANSLATE (yychar
);
1377 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1378 YYSIZE_T yysize
= yysize0
;
1380 int yysize_overflow
= 0;
1381 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1382 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1386 /* This is so xgettext sees the translatable formats that are
1387 constructed on the fly. */
1388 YY_("syntax error, unexpected %s");
1389 YY_("syntax error, unexpected %s, expecting %s");
1390 YY_("syntax error, unexpected %s, expecting %s or %s");
1391 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1392 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1396 static char const yyunexpected
[] = "syntax error, unexpected %s";
1397 static char const yyexpecting
[] = ", expecting %s";
1398 static char const yyor
[] = " or %s";
1399 char yyformat
[sizeof yyunexpected
1400 + sizeof yyexpecting
- 1
1401 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1402 * (sizeof yyor
- 1))];
1403 char const *yyprefix
= yyexpecting
;
1405 /* Start YYX at -YYN if negative to avoid negative indexes in
1407 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1409 /* Stay within bounds of both yycheck and yytname. */
1410 int yychecklim
= YYLAST
- yyn
+ 1;
1411 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1414 yyarg
[0] = yytname
[yytype
];
1415 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1417 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1418 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1420 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1424 yyformat
[sizeof yyunexpected
- 1] = '\0';
1427 yyarg
[yycount
++] = yytname
[yyx
];
1428 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1429 yysize_overflow
|= (yysize1
< yysize
);
1431 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1435 yyf
= YY_(yyformat
);
1436 yysize1
= yysize
+ yystrlen (yyf
);
1437 yysize_overflow
|= (yysize1
< yysize
);
1440 if (yysize_overflow
)
1441 return YYSIZE_MAXIMUM
;
1445 /* Avoid sprintf, as that infringes on the user's name space.
1446 Don't have undefined behavior even if the translation
1447 produced a string with the wrong number of "%s"s. */
1448 char *yyp
= yyresult
;
1450 while ((*yyp
= *yyf
) != '\0')
1452 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1454 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1467 #endif /* YYERROR_VERBOSE */
1470 /*-----------------------------------------------.
1471 | Release the memory associated to this symbol. |
1472 `-----------------------------------------------*/
1475 #if (defined __STDC__ || defined __C99__FUNC__ \
1476 || defined __cplusplus || defined _MSC_VER)
1478 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1481 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1485 YYLTYPE
*yylocationp
;
1489 YYUSE (yylocationp
);
1493 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1504 /* Prevent warnings from -Wmissing-prototypes. */
1506 #ifdef YYPARSE_PARAM
1507 #if defined __STDC__ || defined __cplusplus
1508 int yyparse (void *YYPARSE_PARAM
);
1512 #else /* ! YYPARSE_PARAM */
1513 #if defined __STDC__ || defined __cplusplus
1518 #endif /* ! YYPARSE_PARAM */
1529 #ifdef YYPARSE_PARAM
1530 #if (defined __STDC__ || defined __C99__FUNC__ \
1531 || defined __cplusplus || defined _MSC_VER)
1533 yyparse (void *YYPARSE_PARAM
)
1536 yyparse (YYPARSE_PARAM
)
1537 void *YYPARSE_PARAM
;
1539 #else /* ! YYPARSE_PARAM */
1540 #if (defined __STDC__ || defined __C99__FUNC__ \
1541 || defined __cplusplus || defined _MSC_VER)
1551 /* The lookahead symbol. */
1554 /* The semantic value of the lookahead symbol. */
1557 /* Number of syntax errors so far. */
1559 /* Location data for the lookahead symbol. */
1565 /* Number of tokens to shift before error messages enabled. */
1567 /* Lookahead token as an internal (translated) token number. */
1570 /* Buffer for error messages, and its allocated size. */
1572 char *yymsg
= yymsgbuf
;
1573 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1576 /* Three stacks and their tools:
1577 `yyss': related to states,
1578 `yyvs': related to semantic values,
1579 `yyls': related to locations.
1581 Refer to the stacks thru separate pointers, to allow yyoverflow
1582 to reallocate them elsewhere. */
1584 /* The state stack. */
1585 yytype_int16 yyssa
[YYINITDEPTH
];
1586 yytype_int16
*yyss
= yyssa
;
1587 yytype_int16
*yyssp
;
1589 /* The semantic value stack. */
1590 YYSTYPE yyvsa
[YYINITDEPTH
];
1591 YYSTYPE
*yyvs
= yyvsa
;
1594 /* The location stack. */
1595 YYLTYPE yylsa
[YYINITDEPTH
];
1596 YYLTYPE
*yyls
= yylsa
;
1598 /* The locations where the error started and ended. */
1599 YYLTYPE yyerror_range
[2];
1601 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1603 YYSIZE_T yystacksize
= YYINITDEPTH
;
1605 /* The variables used to return semantic value and location from the
1610 /* The number of symbols on the RHS of the reduced rule.
1611 Keep to zero when no symbol should be popped. */
1614 YYDPRINTF ((stderr
, "Starting parse\n"));
1619 yychar
= YYEMPTY
; /* Cause a token to be read. */
1621 /* Initialize stack pointers.
1622 Waste one element of value and location stack
1623 so that they stay on the same level as the state stack.
1624 The wasted elements are never initialized. */
1629 #if YYLTYPE_IS_TRIVIAL
1630 /* Initialize the default location before parsing starts. */
1631 yylloc
.first_line
= yylloc
.last_line
= 1;
1632 yylloc
.first_column
= yylloc
.last_column
= 1;
1636 /* User initialization code. */
1638 /* Line 1537 of yacc.c */
1639 #line 89 "parse-gram.y"
1641 /* Bison's grammar can initial empty locations, hence a default
1642 location is needed. */
1643 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1644 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1647 /* Line 1537 of yacc.c */
1648 #line 1649 "parse-gram.c"
1652 /*------------------------------------------------------------.
1653 | yynewstate -- Push a new state, which is found in yystate. |
1654 `------------------------------------------------------------*/
1656 /* In all cases, when you get here, the value and location stacks
1657 have just been pushed. So pushing a state here evens the stacks. */
1663 if (yyss
+ yystacksize
- 1 <= yyssp
)
1665 /* Get the current used size of the three stacks, in elements. */
1666 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1670 /* Give user a chance to reallocate the stack. Use copies of
1671 these so that the &'s don't force the real ones into
1673 YYSTYPE
*yyvs1
= yyvs
;
1674 yytype_int16
*yyss1
= yyss
;
1675 YYLTYPE
*yyls1
= yyls
;
1677 /* Each stack pointer address is followed by the size of the
1678 data in use in that stack, in bytes. This used to be a
1679 conditional around just the two extra args, but that might
1680 be undefined if yyoverflow is a macro. */
1681 yyoverflow (YY_("memory exhausted"),
1682 &yyss1
, yysize
* sizeof (*yyssp
),
1683 &yyvs1
, yysize
* sizeof (*yyvsp
),
1684 &yyls1
, yysize
* sizeof (*yylsp
),
1690 #else /* no yyoverflow */
1691 # ifndef YYSTACK_RELOCATE
1692 goto yyexhaustedlab
;
1694 /* Extend the stack our own way. */
1695 if (YYMAXDEPTH
<= yystacksize
)
1696 goto yyexhaustedlab
;
1698 if (YYMAXDEPTH
< yystacksize
)
1699 yystacksize
= YYMAXDEPTH
;
1702 yytype_int16
*yyss1
= yyss
;
1703 union yyalloc
*yyptr
=
1704 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1706 goto yyexhaustedlab
;
1707 YYSTACK_RELOCATE (yyss
);
1708 YYSTACK_RELOCATE (yyvs
);
1709 YYSTACK_RELOCATE (yyls
);
1710 # undef YYSTACK_RELOCATE
1712 YYSTACK_FREE (yyss1
);
1715 #endif /* no yyoverflow */
1717 yyssp
= yyss
+ yysize
- 1;
1718 yyvsp
= yyvs
+ yysize
- 1;
1719 yylsp
= yyls
+ yysize
- 1;
1721 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1722 (unsigned long int) yystacksize
));
1724 if (yyss
+ yystacksize
- 1 <= yyssp
)
1728 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1730 if (yystate
== YYFINAL
)
1740 /* Do appropriate processing given the current state. Read a
1741 lookahead token if we need one and don't already have one. */
1743 /* First try to decide what to do without reference to lookahead token. */
1744 yyn
= yypact
[yystate
];
1745 if (yyn
== YYPACT_NINF
)
1748 /* Not known => get a lookahead token if don't already have one. */
1750 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1751 if (yychar
== YYEMPTY
)
1753 YYDPRINTF ((stderr
, "Reading a token: "));
1757 if (yychar
<= YYEOF
)
1759 yychar
= yytoken
= YYEOF
;
1760 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1764 yytoken
= YYTRANSLATE (yychar
);
1765 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1768 /* If the proper action on seeing token YYTOKEN is to reduce or to
1769 detect an error, take that action. */
1771 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1776 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1782 /* Count tokens shifted since error; after three, turn off error
1787 /* Shift the lookahead token. */
1788 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1790 /* Discard the shifted token. */
1799 /*-----------------------------------------------------------.
1800 | yydefault -- do the default action for the current state. |
1801 `-----------------------------------------------------------*/
1803 yyn
= yydefact
[yystate
];
1809 /*-----------------------------.
1810 | yyreduce -- Do a reduction. |
1811 `-----------------------------*/
1813 /* yyn is the number of a rule to reduce with. */
1816 /* If YYLEN is nonzero, implement the default value of the action:
1819 Otherwise, the following line sets YYVAL to garbage.
1820 This behavior is undocumented and Bison
1821 users should not rely upon it. Assigning to YYVAL
1822 unconditionally makes the parser a bit smaller, and it avoids a
1823 GCC warning that YYVAL may be used uninitialized. */
1824 yyval
= yyvsp
[1-yylen
];
1826 /* Default location. */
1827 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1828 YY_REDUCE_PRINT (yyn
);
1833 /* Line 1537 of yacc.c */
1834 #line 226 "parse-gram.y"
1836 code_props plain_code
;
1837 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
1838 code_props_translate_code (&plain_code
);
1839 gram_scanner_last_string_free ();
1840 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1841 plain_code
.code
, (yylsp
[(1) - (1)]));
1842 code_scanner_last_string_free ();
1848 /* Line 1537 of yacc.c */
1849 #line 235 "parse-gram.y"
1850 { debug_flag
= true; }
1855 /* Line 1537 of yacc.c */
1856 #line 237 "parse-gram.y"
1858 char const name_prefix
[] = "percent_define_";
1859 char *name
= xmalloc (sizeof name_prefix
+ strlen ((yyvsp
[(2) - (3)].uniqstr
)));
1860 strcpy (name
, name_prefix
);
1861 strcpy (name
+ sizeof name_prefix
- 1, (yyvsp
[(2) - (3)].uniqstr
));
1862 if (muscle_find_const (name
))
1863 warn_at ((yylsp
[(2) - (3)]), _("%s `%s' redefined"), "%define variable", (yyvsp
[(2) - (3)].uniqstr
));
1864 MUSCLE_INSERT_STRING (uniqstr_new (name
), (yyvsp
[(3) - (3)].chars
));
1866 muscle_grow_user_name_list ("user_percent_define_variables", (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
1872 /* Line 1537 of yacc.c */
1873 #line 248 "parse-gram.y"
1874 { defines_flag
= true; }
1879 /* Line 1537 of yacc.c */
1880 #line 250 "parse-gram.y"
1882 defines_flag
= true;
1883 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
1889 /* Line 1537 of yacc.c */
1890 #line 254 "parse-gram.y"
1891 { error_verbose
= true; }
1896 /* Line 1537 of yacc.c */
1897 #line 255 "parse-gram.y"
1898 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1903 /* Line 1537 of yacc.c */
1904 #line 256 "parse-gram.y"
1905 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1910 /* Line 1537 of yacc.c */
1911 #line 257 "parse-gram.y"
1912 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
1917 /* Line 1537 of yacc.c */
1918 #line 258 "parse-gram.y"
1919 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1924 /* Line 1537 of yacc.c */
1925 #line 260 "parse-gram.y"
1927 nondeterministic_parser
= true;
1934 /* Line 1537 of yacc.c */
1935 #line 265 "parse-gram.y"
1938 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
1939 code_props_translate_code (&action
);
1940 gram_scanner_last_string_free ();
1941 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
1942 code_scanner_last_string_free ();
1948 /* Line 1537 of yacc.c */
1949 #line 273 "parse-gram.y"
1950 { language_argmatch ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
1955 /* Line 1537 of yacc.c */
1956 #line 274 "parse-gram.y"
1957 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
1962 /* Line 1537 of yacc.c */
1963 #line 275 "parse-gram.y"
1964 { locations_flag
= true; }
1969 /* Line 1537 of yacc.c */
1970 #line 276 "parse-gram.y"
1971 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
1976 /* Line 1537 of yacc.c */
1977 #line 277 "parse-gram.y"
1978 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
1983 /* Line 1537 of yacc.c */
1984 #line 278 "parse-gram.y"
1985 { no_lines_flag
= true; }
1990 /* Line 1537 of yacc.c */
1991 #line 279 "parse-gram.y"
1992 { nondeterministic_parser
= true; }
1997 /* Line 1537 of yacc.c */
1998 #line 280 "parse-gram.y"
1999 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2004 /* Line 1537 of yacc.c */
2005 #line 281 "parse-gram.y"
2006 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2011 /* Line 1537 of yacc.c */
2012 #line 282 "parse-gram.y"
2013 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2018 /* Line 1537 of yacc.c */
2019 #line 283 "parse-gram.y"
2020 { pure_parser
= true; }
2025 /* Line 1537 of yacc.c */
2026 #line 284 "parse-gram.y"
2027 { push_parser
= true; pull_parser
= false; }
2032 /* Line 1537 of yacc.c */
2033 #line 285 "parse-gram.y"
2034 { push_parser
= true; pull_parser
= true; }
2039 /* Line 1537 of yacc.c */
2040 #line 286 "parse-gram.y"
2041 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2046 /* Line 1537 of yacc.c */
2047 #line 287 "parse-gram.y"
2048 { skeleton_arg ((yyvsp
[(2) - (2)].chars
), 1, &(yylsp
[(1) - (2)])); }
2053 /* Line 1537 of yacc.c */
2054 #line 288 "parse-gram.y"
2055 { token_table_flag
= true; }
2060 /* Line 1537 of yacc.c */
2061 #line 289 "parse-gram.y"
2062 { report_flag
= report_states
; }
2067 /* Line 1537 of yacc.c */
2068 #line 290 "parse-gram.y"
2069 { yacc_flag
= true; }
2074 /* Line 1537 of yacc.c */
2075 #line 298 "parse-gram.y"
2077 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2083 /* Line 1537 of yacc.c */
2084 #line 302 "parse-gram.y"
2087 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2088 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2089 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2095 /* Line 1537 of yacc.c */
2096 #line 309 "parse-gram.y"
2099 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2100 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2101 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2107 /* Line 1537 of yacc.c */
2108 #line 316 "parse-gram.y"
2110 default_prec
= true;
2116 /* Line 1537 of yacc.c */
2117 #line 320 "parse-gram.y"
2119 default_prec
= false;
2125 /* Line 1537 of yacc.c */
2126 #line 324 "parse-gram.y"
2128 muscle_code_grow ("percent_code", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2129 code_scanner_last_string_free ();
2135 /* Line 1537 of yacc.c */
2136 #line 329 "parse-gram.y"
2138 char const name_prefix
[] = "percent_code_";
2139 char *name
= xmalloc (sizeof name_prefix
+ strlen ((yyvsp
[(2) - (3)].uniqstr
)));
2140 strcpy (name
, name_prefix
);
2141 strcpy (name
+ sizeof name_prefix
- 1, (yyvsp
[(2) - (3)].uniqstr
));
2142 muscle_code_grow (uniqstr_new (name
), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2144 code_scanner_last_string_free ();
2145 muscle_grow_user_name_list ("user_percent_code_qualifiers", (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2151 /* Line 1537 of yacc.c */
2152 #line 349 "parse-gram.y"
2158 /* Line 1537 of yacc.c */
2159 #line 350 "parse-gram.y"
2160 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2165 /* Line 1537 of yacc.c */
2166 #line 355 "parse-gram.y"
2169 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2170 code_scanner_last_string_free ();
2176 /* Line 1537 of yacc.c */
2177 #line 366 "parse-gram.y"
2178 { current_class
= nterm_sym
; }
2183 /* Line 1537 of yacc.c */
2184 #line 367 "parse-gram.y"
2186 current_class
= unknown_sym
;
2187 current_type
= NULL
;
2193 /* Line 1537 of yacc.c */
2194 #line 371 "parse-gram.y"
2195 { current_class
= token_sym
; }
2200 /* Line 1537 of yacc.c */
2201 #line 372 "parse-gram.y"
2203 current_class
= unknown_sym
;
2204 current_type
= NULL
;
2210 /* Line 1537 of yacc.c */
2211 #line 377 "parse-gram.y"
2215 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2216 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2217 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2223 /* Line 1537 of yacc.c */
2224 #line 388 "parse-gram.y"
2228 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2230 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2231 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2233 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2234 current_type
= NULL
;
2240 /* Line 1537 of yacc.c */
2241 #line 402 "parse-gram.y"
2242 { (yyval
.assoc
) = left_assoc
; }
2247 /* Line 1537 of yacc.c */
2248 #line 403 "parse-gram.y"
2249 { (yyval
.assoc
) = right_assoc
; }
2254 /* Line 1537 of yacc.c */
2255 #line 404 "parse-gram.y"
2256 { (yyval
.assoc
) = non_assoc
; }
2261 /* Line 1537 of yacc.c */
2262 #line 408 "parse-gram.y"
2263 { current_type
= NULL
; }
2268 /* Line 1537 of yacc.c */
2269 #line 409 "parse-gram.y"
2270 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2275 /* Line 1537 of yacc.c */
2276 #line 415 "parse-gram.y"
2277 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2282 /* Line 1537 of yacc.c */
2283 #line 417 "parse-gram.y"
2284 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2289 /* Line 1537 of yacc.c */
2290 #line 421 "parse-gram.y"
2291 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2296 /* Line 1537 of yacc.c */
2297 #line 422 "parse-gram.y"
2298 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2303 /* Line 1537 of yacc.c */
2304 #line 426 "parse-gram.y"
2305 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2310 /* Line 1537 of yacc.c */
2311 #line 427 "parse-gram.y"
2312 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2317 /* Line 1537 of yacc.c */
2318 #line 428 "parse-gram.y"
2319 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2324 /* Line 1537 of yacc.c */
2325 #line 429 "parse-gram.y"
2326 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2331 /* Line 1537 of yacc.c */
2332 #line 435 "parse-gram.y"
2334 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2341 /* Line 1537 of yacc.c */
2342 #line 440 "parse-gram.y"
2344 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2345 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2351 /* Line 1537 of yacc.c */
2352 #line 445 "parse-gram.y"
2354 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2355 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2356 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2362 /* Line 1537 of yacc.c */
2363 #line 451 "parse-gram.y"
2365 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2366 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2367 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2373 /* Line 1537 of yacc.c */
2374 #line 457 "parse-gram.y"
2376 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2377 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2378 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2379 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2385 /* Line 1537 of yacc.c */
2386 #line 487 "parse-gram.y"
2394 /* Line 1537 of yacc.c */
2395 #line 493 "parse-gram.y"
2396 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2401 /* Line 1537 of yacc.c */
2402 #line 497 "parse-gram.y"
2403 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2408 /* Line 1537 of yacc.c */
2409 #line 498 "parse-gram.y"
2410 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2415 /* Line 1537 of yacc.c */
2416 #line 504 "parse-gram.y"
2417 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2422 /* Line 1537 of yacc.c */
2423 #line 506 "parse-gram.y"
2424 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2429 /* Line 1537 of yacc.c */
2430 #line 508 "parse-gram.y"
2431 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2436 /* Line 1537 of yacc.c */
2437 #line 510 "parse-gram.y"
2438 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2443 /* Line 1537 of yacc.c */
2444 #line 512 "parse-gram.y"
2445 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2450 /* Line 1537 of yacc.c */
2451 #line 514 "parse-gram.y"
2452 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2457 /* Line 1537 of yacc.c */
2458 #line 524 "parse-gram.y"
2459 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2464 /* Line 1537 of yacc.c */
2465 #line 530 "parse-gram.y"
2467 static char one
[] = "1";
2468 (yyval
.chars
) = one
;
2474 /* Line 1537 of yacc.c */
2475 #line 544 "parse-gram.y"
2477 code_props plain_code
;
2478 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2479 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2480 code_props_translate_code (&plain_code
);
2481 gram_scanner_last_string_free ();
2482 (yyval
.chars
) = plain_code
.code
;
2488 /* Line 1537 of yacc.c */
2489 #line 564 "parse-gram.y"
2490 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2495 /* Line 1537 of yacc.c */
2496 #line 566 "parse-gram.y"
2498 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2499 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2500 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2506 /* Line 1537 of yacc.c */
2507 #line 574 "parse-gram.y"
2508 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2513 /* Line 1537 of yacc.c */
2514 #line 586 "parse-gram.y"
2516 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2517 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2523 /* Line 1537 of yacc.c */
2524 #line 595 "parse-gram.y"
2526 code_props plain_code
;
2527 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2528 code_props_translate_code (&plain_code
);
2529 gram_scanner_last_string_free ();
2530 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2531 code_scanner_last_string_free ();
2537 /* Line 1537 of yacc.c */
2538 #line 2539 "parse-gram.c"
2541 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2545 YY_STACK_PRINT (yyss
, yyssp
);
2550 /* Now `shift' the result of the reduction. Determine what state
2551 that goes to, based on the state we popped back to and the rule
2552 number reduced by. */
2556 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2557 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2558 yystate
= yytable
[yystate
];
2560 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2565 /*------------------------------------.
2566 | yyerrlab -- here on detecting error |
2567 `------------------------------------*/
2569 /* If not already recovering from an error, report this error. */
2573 #if ! YYERROR_VERBOSE
2574 yyerror (YY_("syntax error"));
2577 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2578 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2580 YYSIZE_T yyalloc
= 2 * yysize
;
2581 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2582 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2583 if (yymsg
!= yymsgbuf
)
2584 YYSTACK_FREE (yymsg
);
2585 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2587 yymsg_alloc
= yyalloc
;
2591 yymsg_alloc
= sizeof yymsgbuf
;
2595 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2597 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2602 yyerror (YY_("syntax error"));
2604 goto yyexhaustedlab
;
2610 yyerror_range
[0] = yylloc
;
2612 if (yyerrstatus
== 3)
2614 /* If just tried and failed to reuse lookahead token after an
2615 error, discard it. */
2617 if (yychar
<= YYEOF
)
2619 /* Return failure if at end of input. */
2620 if (yychar
== YYEOF
)
2625 yydestruct ("Error: discarding",
2626 yytoken
, &yylval
, &yylloc
);
2631 /* Else will try to reuse lookahead token after shifting the error
2636 /*---------------------------------------------------.
2637 | yyerrorlab -- error raised explicitly by YYERROR. |
2638 `---------------------------------------------------*/
2641 /* Pacify compilers like GCC when the user code never invokes
2642 YYERROR and the label yyerrorlab therefore never appears in user
2644 if (/*CONSTCOND*/ 0)
2647 yyerror_range
[0] = yylsp
[1-yylen
];
2648 /* Do not reclaim the symbols of the rule which action triggered
2652 YY_STACK_PRINT (yyss
, yyssp
);
2657 /*-------------------------------------------------------------.
2658 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2659 `-------------------------------------------------------------*/
2661 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2665 yyn
= yypact
[yystate
];
2666 if (yyn
!= YYPACT_NINF
)
2669 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2677 /* Pop the current state because it cannot handle the error token. */
2681 yyerror_range
[0] = *yylsp
;
2682 yydestruct ("Error: popping",
2683 yystos
[yystate
], yyvsp
, yylsp
);
2686 YY_STACK_PRINT (yyss
, yyssp
);
2691 yyerror_range
[1] = yylloc
;
2692 /* Using YYLLOC is tempting, but would change the location of
2693 the lookahead. YYLOC is available though. */
2694 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2697 /* Shift the error token. */
2698 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2704 /*-------------------------------------.
2705 | yyacceptlab -- YYACCEPT comes here. |
2706 `-------------------------------------*/
2711 /*-----------------------------------.
2712 | yyabortlab -- YYABORT comes here. |
2713 `-----------------------------------*/
2719 /*-------------------------------------------------.
2720 | yyexhaustedlab -- memory exhaustion comes here. |
2721 `-------------------------------------------------*/
2723 yyerror (YY_("memory exhausted"));
2729 if (yychar
!= YYEMPTY
)
2730 yydestruct ("Cleanup: discarding lookahead",
2731 yytoken
, &yylval
, &yylloc
);
2732 /* Do not reclaim the symbols of the rule which action triggered
2733 this YYABORT or YYACCEPT. */
2735 YY_STACK_PRINT (yyss
, yyssp
);
2736 while (yyssp
!= yyss
)
2738 yydestruct ("Cleanup: popping",
2739 yystos
[*yyssp
], yyvsp
, yylsp
);
2744 YYSTACK_FREE (yyss
);
2747 if (yymsg
!= yymsgbuf
)
2748 YYSTACK_FREE (yymsg
);
2750 /* Make sure YYID is used. */
2751 return YYID (yyresult
);
2756 /* Line 1537 of yacc.c */
2757 #line 605 "parse-gram.y"
2761 /* Return the location of the left-hand side of a rule whose
2762 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2763 the right-hand side, and return an empty location equal to the end
2764 boundary of RHS[0] if the right-hand side is empty. */
2767 lloc_default (YYLTYPE
const *rhs
, int n
)
2772 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2773 The bug is fixed in 7.4.2m, but play it safe for now. */
2774 loc
.start
= rhs
[n
].end
;
2775 loc
.end
= rhs
[n
].end
;
2777 /* Ignore empty nonterminals the start of the the right-hand side.
2778 Do not bother to ignore them at the end of the right-hand side,
2779 since empty nonterminals have the same end as their predecessors. */
2780 for (i
= 1; i
<= n
; i
++)
2781 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2783 loc
.start
= rhs
[i
].start
;
2791 /* Add a lex-param or a parse-param (depending on TYPE) with
2792 declaration DECL and location LOC. */
2795 add_param (char const *type
, char *decl
, location loc
)
2797 static char const alphanum
[26 + 26 + 1 + 10] =
2798 "abcdefghijklmnopqrstuvwxyz"
2799 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2802 char const *name_start
= NULL
;
2805 /* Stop on last actual character. */
2806 for (p
= decl
; p
[1]; p
++)
2808 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2809 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2812 /* Strip the surrounding '{' and '}', and any blanks just inside
2814 while (*--p
== ' ' || *p
== '\t')
2817 while (*++decl
== ' ' || *decl
== '\t')
2821 complain_at (loc
, _("missing identifier in parameter declaration"));
2828 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2832 name
= xmalloc (name_len
+ 1);
2833 memcpy (name
, name_start
, name_len
);
2834 name
[name_len
] = '\0';
2835 muscle_pair_list_grow (type
, decl
, name
);
2839 gram_scanner_last_string_free ();
2844 version_check (location
const *loc
, char const *version
)
2846 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2848 complain_at (*loc
, "require bison %s, but have %s",
2849 version
, PACKAGE_VERSION
);
2855 gram_error (location
const *loc
, char const *msg
)
2857 complain_at (*loc
, "%s", msg
);
2861 token_name (int type
)
2863 return yytname
[YYTRANSLATE (type
)];
2874 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2875 return quotearg_style (escape_quoting_style
, buf
);