1 /* A Bison parser, made by GNU Bison 2.4.537-34db. */
3 /* Implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2007, 2008, 2009, 2010 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 3 of the License, or
11 (at your option) any later version.
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, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.537-34db"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 1
65 /* Substitute the variable and function names. */
66 #define yyparse gram_parse
67 #define yylex gram_lex
68 #define yyerror gram_error
69 #define yylval gram_lval
70 #define yychar gram_char
71 #define yydebug gram_debug
72 #define yynerrs gram_nerrs
73 #define yylloc gram_lloc
75 /* Copy the first part of user declarations. */
76 /* Line 252 of yacc.c */
77 #line 1 "src/parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
80 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
81 Free Software Foundation, Inc.
83 This file is part of Bison, the GNU Compiler Compiler.
85 This program is free software: you can redistribute it and/or modify
86 it under the terms of the GNU General Public License as published by
87 the Free Software Foundation, either version 3 of the License, or
88 (at your option) any later version.
90 This program is distributed in the hope that it will be useful,
91 but WITHOUT ANY WARRANTY; without even the implied warranty of
92 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93 GNU General Public License for more details.
95 You should have received a copy of the GNU General Public License
96 along with this program. If not, see <http://www.gnu.org/licenses/>. */
101 #include "complain.h"
102 #include "conflicts.h"
106 #include "muscle-tab.h"
107 #include "named-ref.h"
108 #include "quotearg.h"
111 #include "scan-gram.h"
112 #include "scan-code.h"
114 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
115 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
117 #define YY_LOCATION_PRINT(File, Loc) \
118 location_print (File, Loc)
120 static void version_check (location
const *loc
, char const *version
);
122 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
123 FIXME: depends on the undocumented availability of YYLLOC. */
125 #define yyerror(Msg) \
126 gram_error (&yylloc, Msg)
127 static void gram_error (location
const *, char const *);
129 static char const *char_name (char);
131 /* Line 252 of yacc.c */
132 #line 133 "src/parse-gram.c"
134 /* Enabling traces. */
139 /* Enabling verbose error messages. */
140 #ifdef YYERROR_VERBOSE
141 # undef YYERROR_VERBOSE
142 # define YYERROR_VERBOSE 1
144 # define YYERROR_VERBOSE 1
147 /* Enabling the token table. */
148 #ifndef YYTOKEN_TABLE
149 # define YYTOKEN_TABLE 0
152 /* "%code requires" blocks. */
153 /* Line 272 of yacc.c */
154 #line 202 "src/parse-gram.y"
162 param_parse
= 1 << 1,
163 param_both
= param_lex
| param_parse
168 /* Line 272 of yacc.c */
169 #line 170 "src/parse-gram.c"
174 /* Put the tokens into the symbol table, so that GDB and other debuggers
183 PERCENT_DESTRUCTOR
= 263,
184 PERCENT_PRINTER
= 264,
187 PERCENT_NONASSOC
= 267,
188 PERCENT_PRECEDENCE
= 268,
193 PERCENT_DEFAULT_PREC
= 273,
194 PERCENT_DEFINE
= 274,
195 PERCENT_DEFINES
= 275,
196 PERCENT_ERROR_VERBOSE
= 276,
197 PERCENT_EXPECT
= 277,
198 PERCENT_EXPECT_RR
= 278,
200 PERCENT_FILE_PREFIX
= 280,
201 PERCENT_GLR_PARSER
= 281,
202 PERCENT_INITIAL_ACTION
= 282,
203 PERCENT_LANGUAGE
= 283,
204 PERCENT_NAME_PREFIX
= 284,
205 PERCENT_NO_DEFAULT_PREC
= 285,
206 PERCENT_NO_LINES
= 286,
207 PERCENT_NONDETERMINISTIC_PARSER
= 287,
208 PERCENT_OUTPUT
= 288,
209 PERCENT_REQUIRE
= 289,
210 PERCENT_SKELETON
= 290,
212 PERCENT_TOKEN_TABLE
= 292,
213 PERCENT_VERBOSE
= 293,
216 BRACED_PREDICATE
= 296,
223 PERCENT_PERCENT
= 303,
238 #define PERCENT_TOKEN 260
239 #define PERCENT_NTERM 261
240 #define PERCENT_TYPE 262
241 #define PERCENT_DESTRUCTOR 263
242 #define PERCENT_PRINTER 264
243 #define PERCENT_LEFT 265
244 #define PERCENT_RIGHT 266
245 #define PERCENT_NONASSOC 267
246 #define PERCENT_PRECEDENCE 268
247 #define PERCENT_PREC 269
248 #define PERCENT_DPREC 270
249 #define PERCENT_MERGE 271
250 #define PERCENT_CODE 272
251 #define PERCENT_DEFAULT_PREC 273
252 #define PERCENT_DEFINE 274
253 #define PERCENT_DEFINES 275
254 #define PERCENT_ERROR_VERBOSE 276
255 #define PERCENT_EXPECT 277
256 #define PERCENT_EXPECT_RR 278
257 #define PERCENT_FLAG 279
258 #define PERCENT_FILE_PREFIX 280
259 #define PERCENT_GLR_PARSER 281
260 #define PERCENT_INITIAL_ACTION 282
261 #define PERCENT_LANGUAGE 283
262 #define PERCENT_NAME_PREFIX 284
263 #define PERCENT_NO_DEFAULT_PREC 285
264 #define PERCENT_NO_LINES 286
265 #define PERCENT_NONDETERMINISTIC_PARSER 287
266 #define PERCENT_OUTPUT 288
267 #define PERCENT_REQUIRE 289
268 #define PERCENT_SKELETON 290
269 #define PERCENT_START 291
270 #define PERCENT_TOKEN_TABLE 292
271 #define PERCENT_VERBOSE 293
272 #define PERCENT_YACC 294
273 #define BRACED_CODE 295
274 #define BRACED_PREDICATE 296
275 #define BRACKETED_ID 297
281 #define PERCENT_PERCENT 303
284 #define SEMICOLON 306
288 #define PERCENT_PARAM 310
289 #define PERCENT_UNION 311
294 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
295 typedef union YYSTYPE
297 /* Line 277 of yacc.c */
298 #line 88 "src/parse-gram.y"
304 named_ref
*named_ref
;
308 unsigned char character
;
310 /* Line 277 of yacc.c */
311 #line 226 "src/parse-gram.y"
316 /* Line 277 of yacc.c */
317 #line 318 "src/parse-gram.c"
319 # define YYSTYPE_IS_TRIVIAL 1
320 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
321 # define YYSTYPE_IS_DECLARED 1
324 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
325 typedef struct YYLTYPE
332 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
333 # define YYLTYPE_IS_DECLARED 1
334 # define YYLTYPE_IS_TRIVIAL 1
338 /* Copy the second part of user declarations. */
340 /* Line 327 of yacc.c */
341 #line 342 "src/parse-gram.c"
342 /* Unqualified %code blocks. */
343 /* Line 328 of yacc.c */
344 #line 56 "src/parse-gram.y"
346 static int current_prec
= 0;
347 static location current_lhs_location
;
348 static named_ref
*current_lhs_named_ref
;
349 static symbol
*current_lhs
;
350 static symbol_class current_class
= unknown_sym
;
351 static uniqstr current_type
= NULL
;
353 #define YYTYPE_INT16 int_fast16_t
354 #define YYTYPE_INT8 int_fast8_t
355 #define YYTYPE_UINT16 uint_fast16_t
356 #define YYTYPE_UINT8 uint_fast8_t
358 /* Line 328 of yacc.c */
359 #line 215 "src/parse-gram.y"
361 /** Add a lex-param and/or a parse-param.
363 * \param type where to push this formal argument.
364 * \param decl the formal argument. Destroyed.
365 * \param loc the location in the source.
367 static void add_param (param_type type
, char *decl
, location loc
);
368 static param_type current_param
= param_none
;
371 /* Line 328 of yacc.c */
372 #line 373 "src/parse-gram.c"
379 typedef YYTYPE_UINT8 yytype_uint8
;
381 typedef unsigned char yytype_uint8
;
385 typedef YYTYPE_INT8 yytype_int8
;
386 #elif (defined __STDC__ || defined __C99__FUNC__ \
387 || defined __cplusplus || defined _MSC_VER)
388 typedef signed char yytype_int8
;
390 typedef short int yytype_int8
;
394 typedef YYTYPE_UINT16 yytype_uint16
;
396 typedef unsigned short int yytype_uint16
;
400 typedef YYTYPE_INT16 yytype_int16
;
402 typedef short int yytype_int16
;
406 # ifdef __SIZE_TYPE__
407 # define YYSIZE_T __SIZE_TYPE__
408 # elif defined size_t
409 # define YYSIZE_T size_t
410 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
411 || defined __cplusplus || defined _MSC_VER)
412 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
413 # define YYSIZE_T size_t
415 # define YYSIZE_T unsigned int
419 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
422 # if defined YYENABLE_NLS && YYENABLE_NLS
424 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
425 # define YY_(msgid) dgettext ("bison-runtime", msgid)
429 # define YY_(msgid) msgid
433 /* Suppress unused-variable warnings by "using" E. */
434 #if ! defined lint || defined __GNUC__
435 # define YYUSE(e) ((void) (e))
437 # define YYUSE(e) /* empty */
440 /* Identity function, used to suppress warnings about constant conditions. */
444 #if (defined __STDC__ || defined __C99__FUNC__ \
445 || defined __cplusplus || defined _MSC_VER)
458 #if ! defined yyoverflow || YYERROR_VERBOSE
460 /* The parser invokes alloca or malloc; define the necessary symbols. */
462 # ifdef YYSTACK_USE_ALLOCA
463 # if YYSTACK_USE_ALLOCA
465 # define YYSTACK_ALLOC __builtin_alloca
466 # elif defined __BUILTIN_VA_ARG_INCR
467 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
469 # define YYSTACK_ALLOC __alloca
470 # elif defined _MSC_VER
471 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
472 # define alloca _alloca
474 # define YYSTACK_ALLOC alloca
475 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
476 || defined __cplusplus || defined _MSC_VER)
477 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
478 # ifndef EXIT_SUCCESS
479 # define EXIT_SUCCESS 0
486 # ifdef YYSTACK_ALLOC
487 /* Pacify GCC's `empty if-body' warning. */
488 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
489 # ifndef YYSTACK_ALLOC_MAXIMUM
490 /* The OS might guarantee only one guard page at the bottom of the stack,
491 and a page size can be as small as 4096 bytes. So we cannot safely
492 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
493 to allow for a few compiler-allocated temporary stack slots. */
494 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
497 # define YYSTACK_ALLOC YYMALLOC
498 # define YYSTACK_FREE YYFREE
499 # ifndef YYSTACK_ALLOC_MAXIMUM
500 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
502 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
503 && ! ((defined YYMALLOC || defined malloc) \
504 && (defined YYFREE || defined free)))
505 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
506 # ifndef EXIT_SUCCESS
507 # define EXIT_SUCCESS 0
511 # define YYMALLOC malloc
512 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
513 || defined __cplusplus || defined _MSC_VER)
514 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
519 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
520 || defined __cplusplus || defined _MSC_VER)
521 void free (void *); /* INFRINGES ON USER NAME SPACE */
525 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
528 #if (! defined yyoverflow \
529 && (! defined __cplusplus \
530 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
531 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
533 /* A type that is properly aligned for any stack member. */
536 yytype_int16 yyss_alloc
;
541 /* The size of the maximum gap between one aligned stack and the next. */
542 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
544 /* The size of an array large to enough to hold all stacks, each with
546 # define YYSTACK_BYTES(N) \
547 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
548 + 2 * YYSTACK_GAP_MAXIMUM)
550 /* Copy COUNT objects from FROM to TO. The source and destination do
553 # if defined __GNUC__ && 1 < __GNUC__
554 # define YYCOPY(To, From, Count) \
555 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
557 # define YYCOPY(To, From, Count) \
561 for (yyi = 0; yyi < (Count); yyi++) \
562 (To)[yyi] = (From)[yyi]; \
568 /* Relocate STACK from its old location to the new one. The
569 local variables YYSIZE and YYSTACKSIZE give the old and new number of
570 elements in the stack, and YYPTR gives the new location of the
571 stack. Advance YYPTR to a properly aligned location for the next
573 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
576 YYSIZE_T yynewbytes; \
577 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
578 Stack = &yyptr->Stack_alloc; \
579 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
580 yyptr += yynewbytes / sizeof (*yyptr); \
586 /* YYFINAL -- State number of the termination state. */
588 /* YYLAST -- Last index in YYTABLE. */
591 /* YYNTOKENS -- Number of terminals. */
593 /* YYNNTS -- Number of nonterminals. */
595 /* YYNRULES -- Number of rules. */
597 /* YYNSTATES -- Number of states. */
598 #define YYNSTATES 149
600 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
601 by yylex, with out-of-bounds checking. */
603 #define YYMAXUTOK 311
605 #define YYTRANSLATE(YYX) \
606 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
608 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
609 as returned by yylex, without out-of-bounds checking. */
610 static const yytype_uint8 yytranslate
[] =
612 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
638 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
639 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
640 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
641 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
642 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
647 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
648 static const yytype_uint16 yyrline
[] =
650 0, 251, 251, 259, 261, 265, 266, 276, 280, 285,
651 286, 291, 296, 297, 298, 299, 300, 305, 314, 315,
652 316, 317, 318, 319, 320, 321, 321, 322, 323, 347,
653 348, 349, 350, 354, 355, 364, 365, 366, 370, 377,
654 384, 388, 392, 399, 414, 415, 419, 431, 431, 436,
655 436, 441, 452, 467, 468, 469, 470, 474, 475, 480,
656 482, 487, 488, 493, 495, 500, 501, 505, 506, 507,
657 508, 513, 518, 523, 529, 535, 546, 547, 556, 557,
658 563, 564, 565, 572, 572, 577, 578, 579, 584, 586,
659 588, 590, 592, 594, 596, 601, 603, 613, 614, 619,
660 620, 621, 630, 650, 652, 661, 666, 667, 672, 679,
665 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
666 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
667 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
668 static const char *const yytname
[] =
670 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
671 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
672 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
673 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
674 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
675 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
676 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
677 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
678 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
679 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
680 "\"%yacc\"", "\"{...}\"", "\"%?{...}\"", "\"[identifier]\"", "\"char\"",
681 "\"epilogue\"", "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
682 "\"|\"", "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"",
683 "\"%param\"", "\"%union\"", "$accept", "input", "prologue_declarations",
684 "prologue_declaration", "$@1", "params", "grammar_declaration",
685 "union_name", "symbol_declaration", "$@2", "$@3",
686 "precedence_declaration", "precedence_declarator", "tag.opt",
687 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
688 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
689 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
690 "named_ref.opt", "variable", "content.opt", "braceless", "id",
691 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
696 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
697 (internal) symbol number NUM (which must be that of a token). */
698 static const yytype_uint16 yytoknum
[] =
700 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
701 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
702 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
703 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
704 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
705 305, 306, 307, 308, 309, 310, 311
709 #define YYPACT_NINF -50
711 #define yypact_value_is_default(yystate) \
714 #define YYTABLE_NINF -110
716 #define yytable_value_is_error(yytable_value) \
719 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
721 static const yytype_int16 yypact
[] =
723 -50, 4, 107, -50, -50, -50, -20, 3, 11, -50,
724 -50, -50, -50, 14, -50, 12, 68, -50, 72, 73,
725 -50, 0, -50, 45, 86, 2, -50, -50, -50, 17,
726 95, 96, 32, -50, -50, -50, 16, -50, -50, -50,
727 54, -50, -50, -50, -50, 49, -2, -2, 32, 27,
728 27, -50, 63, -50, -50, -50, 37, -50, -50, -50,
729 -50, 101, -50, -50, -50, 103, -50, 104, -50, -50,
730 -50, -50, -50, -50, -50, -50, 57, -50, 58, 1,
731 -50, -50, 79, 70, -50, 63, -50, 32, -50, -50,
732 -2, 64, -2, 32, -50, -50, -50, -50, 27, -50,
733 -50, 27, -50, -50, -50, -50, -50, -50, -50, -50,
734 -50, 78, -50, -50, -50, -50, -50, 83, -50, 32,
735 -50, 143, -50, 145, -50, -50, -50, -50, -50, -50,
736 -50, -50, -50, 43, 50, -50, -50, 32, 146, 97,
737 79, -50, 79, 50, -50, -50, -50, -50, -50
740 /* YYDEFACT[S] -- default reduction number in state S. Performed when
741 YYTABLE does not specify something else to do. Zero means the default
743 static const yytype_uint8 yydefact
[] =
745 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
746 54, 55, 56, 0, 40, 0, 9, 11, 0, 0,
747 7, 0, 16, 0, 0, 0, 41, 21, 22, 0,
748 0, 0, 0, 29, 30, 31, 0, 6, 32, 25,
749 44, 4, 5, 36, 35, 57, 0, 0, 0, 0,
750 0, 102, 0, 42, 98, 97, 99, 10, 12, 13,
751 14, 0, 17, 18, 19, 0, 23, 0, 27, 28,
752 108, 104, 103, 106, 37, 107, 0, 105, 0, 0,
753 78, 80, 95, 0, 45, 0, 58, 0, 71, 76,
754 50, 72, 48, 51, 63, 68, 69, 70, 38, 65,
755 67, 39, 43, 101, 100, 8, 15, 20, 24, 82,
756 81, 0, 79, 2, 96, 83, 34, 26, 46, 52,
757 59, 61, 77, 73, 74, 64, 66, 110, 88, 33,
758 60, 62, 75, 84, 85, 88, 87, 0, 0, 0,
759 95, 91, 95, 86, 92, 93, 94, 90, 89
762 /* YYPGOTO[NTERM-NUM]. */
763 static const yytype_int16 yypgoto
[] =
765 -50, -50, -50, -50, -50, -50, 149, -50, -50, -50,
766 -50, -50, -50, -50, -50, 33, -50, 106, -42, -4,
767 112, -50, 74, -50, -50, -50, 19, -45, -50, -50,
768 -16, -8, -50, -32, -49, -50
771 /* YYDEFGOTO[NTERM-NUM]. */
772 static const yytype_int16 yydefgoto
[] =
774 -1, 1, 2, 41, 83, 117, 78, 85, 43, 47,
775 46, 44, 45, 87, 119, 120, 93, 98, 99, 89,
776 90, 79, 80, 81, 128, 133, 134, 115, 56, 105,
777 53, 73, 82, 100, 75, 113
780 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
781 positive, shift that token. If negative, reduce the rule which
782 number is the opposite. If YYTABLE_NINF, syntax error. */
783 static const yytype_int16 yytable
[] =
785 74, -109, 76, 60, 3, 64, 4, 5, 6, 7,
786 8, 9, 10, 11, 12, 54, 94, 76, 13, 14,
787 66, 4, 5, 6, 7, 8, 9, 10, 11, 12,
788 70, 26, 48, 13, 14, 70, 102, 32, 91, 91,
789 103, 71, 124, 49, 72, 61, 26, 65, 77, 111,
790 88, 50, 32, 70, 51, 121, 126, 40, 55, 126,
791 52, 125, 67, 77, 137, 138, 139, 70, 123, 118,
792 71, 57, 40, 72, 132, 71, 58, 59, 72, 95,
793 96, 97, 91, 104, 91, 62, 122, 121, 122, 63,
794 140, 141, 135, 71, 136, 147, 72, 148, 68, 69,
795 84, 86, 142, 51, 106, 144, 107, 108, 109, 110,
796 116, 142, 4, 5, 6, 7, 8, 9, 10, 11,
797 12, 114, 127, 129, 13, 14, 15, 16, 17, 18,
798 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
799 29, 30, 31, 32, 33, 34, 35, 131, 70, 146,
800 145, 42, 130, 112, 143, 36, 101, 37, 38, 92,
804 static const yytype_int16 yycheck
[] =
806 32, 0, 1, 3, 0, 3, 5, 6, 7, 8,
807 9, 10, 11, 12, 13, 3, 48, 1, 17, 18,
808 3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
809 3, 30, 52, 17, 18, 3, 52, 36, 46, 47,
810 3, 43, 91, 40, 46, 45, 30, 45, 47, 48,
811 52, 40, 36, 3, 40, 87, 98, 56, 46, 101,
812 46, 93, 45, 47, 14, 15, 16, 3, 4, 85,
813 43, 3, 56, 46, 123, 43, 4, 4, 46, 52,
814 53, 54, 90, 46, 92, 40, 90, 119, 92, 3,
815 40, 41, 49, 43, 51, 140, 46, 142, 3, 3,
816 46, 52, 134, 40, 3, 137, 3, 3, 51, 51,
817 40, 143, 5, 6, 7, 8, 9, 10, 11, 12,
818 13, 42, 44, 40, 17, 18, 19, 20, 21, 22,
819 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
820 33, 34, 35, 36, 37, 38, 39, 4, 3, 52,
821 4, 2, 119, 79, 135, 48, 50, 50, 51, 47,
825 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
826 symbol of state STATE-NUM. */
827 static const yytype_uint8 yystos
[] =
829 0, 58, 59, 0, 5, 6, 7, 8, 9, 10,
830 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
831 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
832 34, 35, 36, 37, 38, 39, 48, 50, 51, 55,
833 56, 60, 63, 65, 68, 69, 67, 66, 52, 40,
834 40, 40, 46, 87, 3, 46, 85, 3, 4, 4,
835 3, 45, 40, 3, 3, 45, 3, 45, 3, 3,
836 3, 43, 46, 88, 90, 91, 1, 47, 63, 78,
837 79, 80, 89, 61, 46, 64, 52, 70, 52, 76,
838 77, 88, 77, 73, 90, 52, 53, 54, 74, 75,
839 90, 74, 87, 3, 46, 86, 3, 3, 3, 51,
840 51, 48, 79, 92, 42, 84, 40, 62, 87, 71,
841 72, 90, 76, 4, 91, 90, 75, 44, 81, 40,
842 72, 4, 91, 82, 83, 49, 51, 14, 15, 16,
843 40, 41, 90, 83, 90, 4, 52, 84, 84
846 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
847 static const yytype_uint8 yyr1
[] =
849 0, 57, 58, 59, 59, 60, 60, 60, 60, 60,
850 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
851 60, 60, 60, 60, 60, 61, 60, 60, 60, 60,
852 60, 60, 60, 62, 62, 63, 63, 63, 63, 63,
853 63, 63, 63, 63, 64, 64, 63, 66, 65, 67,
854 65, 65, 68, 69, 69, 69, 69, 70, 70, 71,
855 71, 72, 72, 73, 73, 74, 74, 75, 75, 75,
856 75, 76, 76, 76, 76, 76, 77, 77, 78, 78,
857 79, 79, 79, 81, 80, 82, 82, 82, 83, 83,
858 83, 83, 83, 83, 83, 84, 84, 85, 85, 86,
859 86, 86, 87, 88, 88, 89, 90, 90, 91, 92,
863 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
864 static const yytype_uint8 yyr2
[] =
866 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
867 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
868 3, 1, 1, 2, 3, 0, 3, 2, 2, 1,
869 1, 1, 1, 2, 1, 1, 1, 2, 3, 3,
870 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
871 3, 3, 3, 1, 1, 1, 1, 0, 1, 1,
872 2, 1, 2, 1, 2, 1, 2, 1, 1, 1,
873 1, 1, 1, 2, 2, 3, 1, 2, 1, 2,
874 1, 2, 2, 0, 4, 1, 3, 2, 0, 3,
875 3, 2, 3, 3, 3, 0, 1, 1, 1, 0,
876 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
881 #define yyerrok (yyerrstatus = 0)
882 #define yyclearin (yychar = YYEMPTY)
886 #define YYACCEPT goto yyacceptlab
887 #define YYABORT goto yyabortlab
888 #define YYERROR goto yyerrorlab
891 /* Like YYERROR except do call yyerror. This remains here temporarily
892 to ease the transition to the new meaning of YYERROR, for GCC.
893 Once GCC version 2 has supplanted version 1, this can go. However,
894 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
895 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
898 #define YYFAIL goto yyerrlab
900 /* This is here to suppress warnings from the GCC cpp's
901 -Wunused-macros. Normally we don't worry about that warning, but
902 some users do, and we want to make it easy for users to remove
903 YYFAIL uses, which will produce warnings from Bison 2.5. */
906 #define YYRECOVERING() (!!yyerrstatus)
908 #define YYBACKUP(Token, Value) \
910 if (yychar == YYEMPTY && yylen == 1) \
919 yyerror (YY_("syntax error: cannot back up")); \
926 #define YYERRCODE 256
929 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
930 If N is 0, then set CURRENT to the empty location which ends
931 the previous symbol: RHS[0] (always defined). */
933 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
934 #ifndef YYLLOC_DEFAULT
935 # define YYLLOC_DEFAULT(Current, Rhs, N) \
939 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
940 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
941 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
942 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
946 (Current).first_line = (Current).last_line = \
947 YYRHSLOC (Rhs, 0).last_line; \
948 (Current).first_column = (Current).last_column = \
949 YYRHSLOC (Rhs, 0).last_column; \
955 /* YY_LOCATION_PRINT -- Print the location on the stream.
956 This macro was not mandated originally: define only if we know
957 we won't break user code: when these are the locations we know. */
959 #ifndef YY_LOCATION_PRINT
960 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
961 # define YY_LOCATION_PRINT(File, Loc) \
962 fprintf (File, "%d.%d-%d.%d", \
963 (Loc).first_line, (Loc).first_column, \
964 (Loc).last_line, (Loc).last_column)
966 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
971 /* YYLEX -- calling `yylex' with the right arguments. */
974 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
976 # define YYLEX yylex (&yylval, &yylloc)
979 /* Enable debugging if requested. */
983 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
984 # define YYFPRINTF fprintf
987 # define YYDPRINTF(Args) \
993 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
997 YYFPRINTF (stderr, "%s ", Title); \
998 yy_symbol_print (stderr, \
999 Type, Value, Location); \
1000 YYFPRINTF (stderr, "\n"); \
1005 /*--------------------------------.
1006 | Print this symbol on YYOUTPUT. |
1007 `--------------------------------*/
1010 #if (defined __STDC__ || defined __C99__FUNC__ \
1011 || defined __cplusplus || defined _MSC_VER)
1013 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1016 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1019 YYSTYPE
const * const yyvaluep
;
1020 YYLTYPE
const * const yylocationp
;
1025 YYUSE (yylocationp
);
1027 if (yytype
< YYNTOKENS
)
1028 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1036 /* Line 729 of yacc.c */
1037 #line 175 "src/parse-gram.y"
1038 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
1039 /* Line 729 of yacc.c */
1040 #line 1041 "src/parse-gram.c"
1043 case 4: // "integer"
1045 /* Line 729 of yacc.c */
1046 #line 188 "src/parse-gram.y"
1047 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
1048 /* Line 729 of yacc.c */
1049 #line 1050 "src/parse-gram.c"
1052 case 24: // "%<flag>"
1054 /* Line 729 of yacc.c */
1055 #line 184 "src/parse-gram.y"
1056 { fprintf (stderr
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1057 /* Line 729 of yacc.c */
1058 #line 1059 "src/parse-gram.c"
1063 /* Line 729 of yacc.c */
1064 #line 177 "src/parse-gram.y"
1065 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1066 /* Line 729 of yacc.c */
1067 #line 1068 "src/parse-gram.c"
1070 case 42: // "[identifier]"
1072 /* Line 729 of yacc.c */
1073 #line 182 "src/parse-gram.y"
1074 { fprintf (stderr
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1075 /* Line 729 of yacc.c */
1076 #line 1077 "src/parse-gram.c"
1081 /* Line 729 of yacc.c */
1082 #line 169 "src/parse-gram.y"
1083 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
1084 /* Line 729 of yacc.c */
1085 #line 1086 "src/parse-gram.c"
1088 case 44: // "epilogue"
1090 /* Line 729 of yacc.c */
1091 #line 177 "src/parse-gram.y"
1092 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1093 /* Line 729 of yacc.c */
1094 #line 1095 "src/parse-gram.c"
1097 case 46: // "identifier"
1099 /* Line 729 of yacc.c */
1100 #line 181 "src/parse-gram.y"
1101 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1102 /* Line 729 of yacc.c */
1103 #line 1104 "src/parse-gram.c"
1106 case 47: // "identifier:"
1108 /* Line 729 of yacc.c */
1109 #line 183 "src/parse-gram.y"
1110 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
1111 /* Line 729 of yacc.c */
1112 #line 1113 "src/parse-gram.c"
1115 case 50: // "%{...%}"
1117 /* Line 729 of yacc.c */
1118 #line 177 "src/parse-gram.y"
1119 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1120 /* Line 729 of yacc.c */
1121 #line 1122 "src/parse-gram.c"
1126 /* Line 729 of yacc.c */
1127 #line 185 "src/parse-gram.y"
1128 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1129 /* Line 729 of yacc.c */
1130 #line 1131 "src/parse-gram.c"
1133 case 55: // "%param"
1135 /* Line 729 of yacc.c */
1136 #line 231 "src/parse-gram.y"
1138 switch (((*yyvaluep
).param
))
1140 #define CASE(In, Out) \
1141 case param_ ## In: fputs ("%" #Out, stderr); break
1142 CASE(lex
, lex
-param
);
1143 CASE(parse
, parse
-param
);
1146 case param_none
: aver (false); break;
1149 /* Line 729 of yacc.c */
1150 #line 1151 "src/parse-gram.c"
1153 case 72: // symbol.prec
1155 /* Line 729 of yacc.c */
1156 #line 191 "src/parse-gram.y"
1157 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1158 /* Line 729 of yacc.c */
1159 #line 1160 "src/parse-gram.c"
1162 case 85: // variable
1164 /* Line 729 of yacc.c */
1165 #line 181 "src/parse-gram.y"
1166 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1167 /* Line 729 of yacc.c */
1168 #line 1169 "src/parse-gram.c"
1171 case 86: // content.opt
1173 /* Line 729 of yacc.c */
1174 #line 177 "src/parse-gram.y"
1175 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1176 /* Line 729 of yacc.c */
1177 #line 1178 "src/parse-gram.c"
1180 case 87: // braceless
1182 /* Line 729 of yacc.c */
1183 #line 177 "src/parse-gram.y"
1184 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1185 /* Line 729 of yacc.c */
1186 #line 1187 "src/parse-gram.c"
1191 /* Line 729 of yacc.c */
1192 #line 191 "src/parse-gram.y"
1193 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1194 /* Line 729 of yacc.c */
1195 #line 1196 "src/parse-gram.c"
1198 case 89: // id_colon
1200 /* Line 729 of yacc.c */
1201 #line 192 "src/parse-gram.y"
1202 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1203 /* Line 729 of yacc.c */
1204 #line 1205 "src/parse-gram.c"
1209 /* Line 729 of yacc.c */
1210 #line 191 "src/parse-gram.y"
1211 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1212 /* Line 729 of yacc.c */
1213 #line 1214 "src/parse-gram.c"
1216 case 91: // string_as_id
1218 /* Line 729 of yacc.c */
1219 #line 191 "src/parse-gram.y"
1220 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1221 /* Line 729 of yacc.c */
1222 #line 1223 "src/parse-gram.c"
1231 /*--------------------------------.
1232 | Print this symbol on YYOUTPUT. |
1233 `--------------------------------*/
1235 #if (defined __STDC__ || defined __C99__FUNC__ \
1236 || defined __cplusplus || defined _MSC_VER)
1238 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1241 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1244 YYSTYPE
const * const yyvaluep
;
1245 YYLTYPE
const * const yylocationp
;
1248 if (yytype
< YYNTOKENS
)
1249 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1251 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1253 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1254 YYFPRINTF (yyoutput
, ": ");
1255 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1256 YYFPRINTF (yyoutput
, ")");
1259 /*------------------------------------------------------------------.
1260 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1262 `------------------------------------------------------------------*/
1264 #if (defined __STDC__ || defined __C99__FUNC__ \
1265 || defined __cplusplus || defined _MSC_VER)
1267 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1270 yy_stack_print (yybottom
, yytop
)
1271 yytype_int16
*yybottom
;
1272 yytype_int16
*yytop
;
1275 YYFPRINTF (stderr
, "Stack now");
1276 for (; yybottom
<= yytop
; yybottom
++)
1278 int yybot
= *yybottom
;
1279 YYFPRINTF (stderr
, " %d", yybot
);
1281 YYFPRINTF (stderr
, "\n");
1284 # define YY_STACK_PRINT(Bottom, Top) \
1287 yy_stack_print ((Bottom), (Top)); \
1291 /*------------------------------------------------.
1292 | Report that the YYRULE is going to be reduced. |
1293 `------------------------------------------------*/
1295 #if (defined __STDC__ || defined __C99__FUNC__ \
1296 || defined __cplusplus || defined _MSC_VER)
1298 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1301 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1302 yytype_int16
*yyssp
;
1308 unsigned long int yylno
= yyrline
[yyrule
];
1309 int yynrhs
= yyr2
[yyrule
];
1311 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1313 /* The symbols being reduced. */
1314 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1316 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1317 yy_symbol_print (stderr
,
1318 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1319 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1320 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1321 YYFPRINTF (stderr
, "\n");
1325 # define YY_REDUCE_PRINT(Rule) \
1328 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1331 /* Nonzero means print parse trace. It is left uninitialized so that
1332 multiple parsers can coexist. */
1334 #else /* !YYDEBUG */
1335 # define YYDPRINTF(Args)
1336 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1337 # define YY_STACK_PRINT(Bottom, Top)
1338 # define YY_REDUCE_PRINT(Rule)
1339 #endif /* !YYDEBUG */
1342 /* YYINITDEPTH -- initial size of the parser's stacks. */
1344 # define YYINITDEPTH 200
1347 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1348 if the built-in stack extension method is used).
1350 Do not make this value too large; the results are undefined if
1351 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1352 evaluated with infinite-precision integer arithmetic. */
1355 # define YYMAXDEPTH 10000
1363 # if defined __GLIBC__ && defined _STRING_H
1364 # define yystrlen strlen
1366 /* Return the length of YYSTR. */
1367 #if (defined __STDC__ || defined __C99__FUNC__ \
1368 || defined __cplusplus || defined _MSC_VER)
1370 yystrlen (const char *yystr
)
1378 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1386 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1387 # define yystpcpy stpcpy
1389 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1391 #if (defined __STDC__ || defined __C99__FUNC__ \
1392 || defined __cplusplus || defined _MSC_VER)
1394 yystpcpy (char *yydest
, const char *yysrc
)
1397 yystpcpy (yydest
, yysrc
)
1403 const char *yys
= yysrc
;
1405 while ((*yyd
++ = *yys
++) != '\0')
1414 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1415 quotes and backslashes, so that it's suitable for yyerror. The
1416 heuristic is that double-quoting is unnecessary unless the string
1417 contains an apostrophe, a comma, or backslash (other than
1418 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1419 null, do not copy; instead, return the length of what the result
1422 yytnamerr (char *yyres
, const char *yystr
)
1427 char const *yyp
= yystr
;
1434 goto do_not_strip_quotes
;
1438 goto do_not_strip_quotes
;
1451 do_not_strip_quotes
: ;
1455 return yystrlen (yystr
);
1457 return yystpcpy (yyres
, yystr
) - yyres
;
1461 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1462 about the unexpected token YYTOKEN while in state YYSTATE.
1464 Return 0 if *YYMSG was successfully written. Return 1 if an ordinary
1465 "syntax error" message will suffice instead. Return 2 if *YYMSG is
1466 not large enough to hold the message. In the last case, also set
1467 *YYMSG_ALLOC to either (a) the required number of bytes or (b) zero
1468 if the required number of bytes is too large to store. */
1470 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1471 int yystate
, int yytoken
)
1473 int yyn
= yypact
[yystate
];
1475 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1479 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1480 YYSIZE_T yysize
= yysize0
;
1482 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1483 /* Internationalized format string. */
1484 const char *yyformat
= 0;
1485 /* Arguments of yyformat. */
1486 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1488 /* Start YYX at -YYN if negative to avoid negative indexes in
1489 YYCHECK. In other words, skip the first -YYN actions for
1490 this state because they are default actions. */
1491 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1493 /* Stay within bounds of both yycheck and yytname. */
1494 int yychecklim
= YYLAST
- yyn
+ 1;
1495 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1496 /* Number of reported tokens (one for the "unexpected", one per
1501 yyarg
[yycount
++] = yytname
[yytoken
];
1503 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1504 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1505 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1507 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1513 yyarg
[yycount
++] = yytname
[yyx
];
1514 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1515 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1526 #define YYCASE_(N, S) \
1530 YYCASE_(1, YY_("syntax error, unexpected %s"));
1531 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1532 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1533 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1534 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1538 yysize1
= yysize
+ yystrlen (yyformat
);
1539 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1547 if (*yymsg_alloc
< yysize
)
1549 *yymsg_alloc
= 2 * yysize
;
1550 if (! (yysize
<= *yymsg_alloc
1551 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1552 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1556 /* Avoid sprintf, as that infringes on the user's name space.
1557 Don't have undefined behavior even if the translation
1558 produced a string with the wrong number of "%s"s. */
1562 while ((*yyp
= *yyformat
) != '\0')
1563 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1565 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1577 #endif /* YYERROR_VERBOSE */
1580 /*-----------------------------------------------.
1581 | Release the memory associated to this symbol. |
1582 `-----------------------------------------------*/
1585 #if (defined __STDC__ || defined __C99__FUNC__ \
1586 || defined __cplusplus || defined _MSC_VER)
1588 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1591 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1595 YYLTYPE
*yylocationp
;
1599 YYUSE (yylocationp
);
1603 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1613 /* Prevent warnings from -Wmissing-prototypes. */
1614 #ifdef YYPARSE_PARAM
1615 #if (defined __STDC__ || defined __C99__FUNC__ \
1616 || defined __cplusplus || defined _MSC_VER)
1617 int yyparse (void *YYPARSE_PARAM
);
1621 #else /* ! YYPARSE_PARAM */
1622 #if (defined __STDC__ || defined __C99__FUNC__ \
1623 || defined __cplusplus || defined _MSC_VER)
1628 #endif /* ! YYPARSE_PARAM */
1635 #ifdef YYPARSE_PARAM
1636 #if (defined __STDC__ || defined __C99__FUNC__ \
1637 || defined __cplusplus || defined _MSC_VER)
1639 yyparse (void *YYPARSE_PARAM
)
1642 yyparse (YYPARSE_PARAM
)
1643 void *YYPARSE_PARAM
;
1645 #else /* ! YYPARSE_PARAM */
1646 #if (defined __STDC__ || defined __C99__FUNC__ \
1647 || defined __cplusplus || defined _MSC_VER)
1657 /* The lookahead symbol. */
1660 /* The semantic value of the lookahead symbol. */
1663 /* Location data for the lookahead symbol. */
1666 /* Number of syntax errors so far. */
1670 /* Number of tokens to shift before error messages enabled. */
1673 /* The stacks and their tools:
1674 `yyss': related to states.
1675 `yyvs': related to semantic values.
1676 `yyls': related to locations.
1678 Refer to the stacks thru separate pointers, to allow yyoverflow
1679 to reallocate them elsewhere. */
1681 /* The state stack. */
1682 yytype_int16 yyssa
[YYINITDEPTH
];
1684 yytype_int16
*yyssp
;
1686 /* The semantic value stack. */
1687 YYSTYPE yyvsa
[YYINITDEPTH
];
1691 /* The location stack. */
1692 YYLTYPE yylsa
[YYINITDEPTH
];
1696 /* The locations where the error started and ended. */
1697 YYLTYPE yyerror_range
[3];
1699 YYSIZE_T yystacksize
;
1703 /* Lookahead token as an internal (translated) token number. */
1705 /* The variables used to return semantic value and location from the
1711 /* Buffer for error messages, and its allocated size. */
1713 char *yymsg
= yymsgbuf
;
1714 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1717 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1719 /* The number of symbols on the RHS of the reduced rule.
1720 Keep to zero when no symbol should be popped. */
1727 yystacksize
= YYINITDEPTH
;
1729 YYDPRINTF ((stderr
, "Starting parse\n"));
1734 yychar
= YYEMPTY
; /* Cause a token to be read. */
1736 /* Initialize stack pointers.
1737 Waste one element of value and location stack
1738 so that they stay on the same level as the state stack.
1739 The wasted elements are never initialized. */
1744 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1745 /* Initialize the default location before parsing starts. */
1746 yylloc
.first_line
= yylloc
.last_line
= 1;
1747 yylloc
.first_column
= yylloc
.last_column
= 1;
1750 /* User initialization code. */
1751 /* Line 1213 of yacc.c */
1752 #line 80 "src/parse-gram.y"
1754 /* Bison's grammar can initial empty locations, hence a default
1755 location is needed. */
1756 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1757 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1759 /* Line 1213 of yacc.c */
1760 #line 1761 "src/parse-gram.c"
1765 /*------------------------------------------------------------.
1766 | yynewstate -- Push a new state, which is found in yystate. |
1767 `------------------------------------------------------------*/
1769 /* In all cases, when you get here, the value and location stacks
1770 have just been pushed. So pushing a state here evens the stacks. */
1776 if (yyss
+ yystacksize
- 1 <= yyssp
)
1778 /* Get the current used size of the three stacks, in elements. */
1779 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1783 /* Give user a chance to reallocate the stack. Use copies of
1784 these so that the &'s don't force the real ones into
1786 YYSTYPE
*yyvs1
= yyvs
;
1787 yytype_int16
*yyss1
= yyss
;
1788 YYLTYPE
*yyls1
= yyls
;
1790 /* Each stack pointer address is followed by the size of the
1791 data in use in that stack, in bytes. This used to be a
1792 conditional around just the two extra args, but that might
1793 be undefined if yyoverflow is a macro. */
1794 yyoverflow (YY_("memory exhausted"),
1795 &yyss1
, yysize
* sizeof (*yyssp
),
1796 &yyvs1
, yysize
* sizeof (*yyvsp
),
1797 &yyls1
, yysize
* sizeof (*yylsp
),
1804 #else /* no yyoverflow */
1805 # ifndef YYSTACK_RELOCATE
1806 goto yyexhaustedlab
;
1808 /* Extend the stack our own way. */
1809 if (YYMAXDEPTH
<= yystacksize
)
1810 goto yyexhaustedlab
;
1812 if (YYMAXDEPTH
< yystacksize
)
1813 yystacksize
= YYMAXDEPTH
;
1816 yytype_int16
*yyss1
= yyss
;
1817 union yyalloc
*yyptr
=
1818 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1820 goto yyexhaustedlab
;
1821 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1822 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1823 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1824 # undef YYSTACK_RELOCATE
1826 YYSTACK_FREE (yyss1
);
1829 #endif /* no yyoverflow */
1831 yyssp
= yyss
+ yysize
- 1;
1832 yyvsp
= yyvs
+ yysize
- 1;
1833 yylsp
= yyls
+ yysize
- 1;
1835 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1836 (unsigned long int) yystacksize
));
1838 if (yyss
+ yystacksize
- 1 <= yyssp
)
1842 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1844 if (yystate
== YYFINAL
)
1854 /* Do appropriate processing given the current state. Read a
1855 lookahead token if we need one and don't already have one. */
1857 /* First try to decide what to do without reference to lookahead token. */
1858 yyn
= yypact
[yystate
];
1859 if (yypact_value_is_default (yyn
))
1862 /* Not known => get a lookahead token if don't already have one. */
1864 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1865 if (yychar
== YYEMPTY
)
1867 YYDPRINTF ((stderr
, "Reading a token: "));
1871 if (yychar
<= YYEOF
)
1873 yychar
= yytoken
= YYEOF
;
1874 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1878 yytoken
= YYTRANSLATE (yychar
);
1879 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1882 /* If the proper action on seeing token YYTOKEN is to reduce or to
1883 detect an error, take that action. */
1885 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1890 if (yytable_value_is_error (yyn
))
1896 /* Count tokens shifted since error; after three, turn off error
1901 /* Shift the lookahead token. */
1902 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1904 /* Discard the shifted token. */
1913 /*-----------------------------------------------------------.
1914 | yydefault -- do the default action for the current state. |
1915 `-----------------------------------------------------------*/
1917 yyn
= yydefact
[yystate
];
1923 /*-----------------------------.
1924 | yyreduce -- Do a reduction. |
1925 `-----------------------------*/
1927 /* yyn is the number of a rule to reduce with. */
1930 /* If YYLEN is nonzero, implement the default value of the action:
1933 Otherwise, the following line sets YYVAL to garbage.
1934 This behavior is undocumented and Bison
1935 users should not rely upon it. Assigning to YYVAL
1936 unconditionally makes the parser a bit smaller, and it avoids a
1937 GCC warning that YYVAL may be used uninitialized. */
1938 yyval
= yyvsp
[1-yylen
];
1940 /* Default location. */
1941 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1942 YY_REDUCE_PRINT (yyn
);
1946 /* Line 1426 of yacc.c */
1947 #line 267 "src/parse-gram.y"
1949 code_props plain_code
;
1950 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
1951 code_props_translate_code (&plain_code
);
1952 gram_scanner_last_string_free ();
1953 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1954 plain_code
.code
, (yylsp
[0]));
1955 code_scanner_last_string_free ();
1957 /* Line 1426 of yacc.c */
1958 #line 1959 "src/parse-gram.c"
1962 /* Line 1426 of yacc.c */
1963 #line 277 "src/parse-gram.y"
1965 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
1967 /* Line 1426 of yacc.c */
1968 #line 1969 "src/parse-gram.c"
1972 /* Line 1426 of yacc.c */
1973 #line 281 "src/parse-gram.y"
1975 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
1976 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
1978 /* Line 1426 of yacc.c */
1979 #line 1980 "src/parse-gram.c"
1983 /* Line 1426 of yacc.c */
1984 #line 285 "src/parse-gram.y"
1985 { defines_flag
= true; }
1986 /* Line 1426 of yacc.c */
1987 #line 1988 "src/parse-gram.c"
1991 /* Line 1426 of yacc.c */
1992 #line 287 "src/parse-gram.y"
1994 defines_flag
= true;
1995 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
1997 /* Line 1426 of yacc.c */
1998 #line 1999 "src/parse-gram.c"
2002 /* Line 1426 of yacc.c */
2003 #line 292 "src/parse-gram.y"
2005 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2006 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2008 /* Line 1426 of yacc.c */
2009 #line 2010 "src/parse-gram.c"
2013 /* Line 1426 of yacc.c */
2014 #line 296 "src/parse-gram.y"
2015 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2016 /* Line 1426 of yacc.c */
2017 #line 2018 "src/parse-gram.c"
2021 /* Line 1426 of yacc.c */
2022 #line 297 "src/parse-gram.y"
2023 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2024 /* Line 1426 of yacc.c */
2025 #line 2026 "src/parse-gram.c"
2029 /* Line 1426 of yacc.c */
2030 #line 298 "src/parse-gram.y"
2031 { spec_file_prefix
= (yyvsp
[0].chars
); }
2032 /* Line 1426 of yacc.c */
2033 #line 2034 "src/parse-gram.c"
2037 /* Line 1426 of yacc.c */
2038 #line 299 "src/parse-gram.y"
2039 { spec_file_prefix
= (yyvsp
[0].chars
); }
2040 /* Line 1426 of yacc.c */
2041 #line 2042 "src/parse-gram.c"
2045 /* Line 1426 of yacc.c */
2046 #line 301 "src/parse-gram.y"
2048 nondeterministic_parser
= true;
2051 /* Line 1426 of yacc.c */
2052 #line 2053 "src/parse-gram.c"
2056 /* Line 1426 of yacc.c */
2057 #line 306 "src/parse-gram.y"
2060 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2061 code_props_translate_code (&action
);
2062 gram_scanner_last_string_free ();
2063 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2064 code_scanner_last_string_free ();
2066 /* Line 1426 of yacc.c */
2067 #line 2068 "src/parse-gram.c"
2071 /* Line 1426 of yacc.c */
2072 #line 314 "src/parse-gram.y"
2073 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2074 /* Line 1426 of yacc.c */
2075 #line 2076 "src/parse-gram.c"
2079 /* Line 1426 of yacc.c */
2080 #line 315 "src/parse-gram.y"
2081 { spec_name_prefix
= (yyvsp
[0].chars
); }
2082 /* Line 1426 of yacc.c */
2083 #line 2084 "src/parse-gram.c"
2087 /* Line 1426 of yacc.c */
2088 #line 316 "src/parse-gram.y"
2089 { spec_name_prefix
= (yyvsp
[0].chars
); }
2090 /* Line 1426 of yacc.c */
2091 #line 2092 "src/parse-gram.c"
2095 /* Line 1426 of yacc.c */
2096 #line 317 "src/parse-gram.y"
2097 { no_lines_flag
= true; }
2098 /* Line 1426 of yacc.c */
2099 #line 2100 "src/parse-gram.c"
2103 /* Line 1426 of yacc.c */
2104 #line 318 "src/parse-gram.y"
2105 { nondeterministic_parser
= true; }
2106 /* Line 1426 of yacc.c */
2107 #line 2108 "src/parse-gram.c"
2111 /* Line 1426 of yacc.c */
2112 #line 319 "src/parse-gram.y"
2113 { spec_outfile
= (yyvsp
[0].chars
); }
2114 /* Line 1426 of yacc.c */
2115 #line 2116 "src/parse-gram.c"
2119 /* Line 1426 of yacc.c */
2120 #line 320 "src/parse-gram.y"
2121 { spec_outfile
= (yyvsp
[0].chars
); }
2122 /* Line 1426 of yacc.c */
2123 #line 2124 "src/parse-gram.c"
2127 /* Line 1426 of yacc.c */
2128 #line 321 "src/parse-gram.y"
2129 { current_param
= (yyvsp
[0].param
); }
2130 /* Line 1426 of yacc.c */
2131 #line 2132 "src/parse-gram.c"
2135 /* Line 1426 of yacc.c */
2136 #line 321 "src/parse-gram.y"
2137 { current_param
= param_none
; }
2138 /* Line 1426 of yacc.c */
2139 #line 2140 "src/parse-gram.c"
2143 /* Line 1426 of yacc.c */
2144 #line 322 "src/parse-gram.y"
2145 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2146 /* Line 1426 of yacc.c */
2147 #line 2148 "src/parse-gram.c"
2151 /* Line 1426 of yacc.c */
2152 #line 324 "src/parse-gram.y"
2154 char const *skeleton_user
= (yyvsp
[0].chars
);
2155 if (strchr (skeleton_user
, '/'))
2157 size_t dir_length
= strlen (current_file
);
2158 char *skeleton_build
;
2159 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2161 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2164 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2167 strncpy (skeleton_build
, current_file
, dir_length
);
2168 skeleton_build
[dir_length
++] = '/';
2170 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2171 skeleton_user
= uniqstr_new (skeleton_build
);
2172 free (skeleton_build
);
2174 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2176 /* Line 1426 of yacc.c */
2177 #line 2178 "src/parse-gram.c"
2181 /* Line 1426 of yacc.c */
2182 #line 347 "src/parse-gram.y"
2183 { token_table_flag
= true; }
2184 /* Line 1426 of yacc.c */
2185 #line 2186 "src/parse-gram.c"
2189 /* Line 1426 of yacc.c */
2190 #line 348 "src/parse-gram.y"
2191 { report_flag
|= report_states
; }
2192 /* Line 1426 of yacc.c */
2193 #line 2194 "src/parse-gram.c"
2197 /* Line 1426 of yacc.c */
2198 #line 349 "src/parse-gram.y"
2199 { yacc_flag
= true; }
2200 /* Line 1426 of yacc.c */
2201 #line 2202 "src/parse-gram.c"
2205 /* Line 1426 of yacc.c */
2206 #line 354 "src/parse-gram.y"
2207 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2208 /* Line 1426 of yacc.c */
2209 #line 2210 "src/parse-gram.c"
2213 /* Line 1426 of yacc.c */
2214 #line 355 "src/parse-gram.y"
2215 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2216 /* Line 1426 of yacc.c */
2217 #line 2218 "src/parse-gram.c"
2221 /* Line 1426 of yacc.c */
2222 #line 367 "src/parse-gram.y"
2224 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2226 /* Line 1426 of yacc.c */
2227 #line 2228 "src/parse-gram.c"
2231 /* Line 1426 of yacc.c */
2232 #line 371 "src/parse-gram.y"
2235 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2236 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2237 symbol_list_free ((yyvsp
[0].list
));
2239 /* Line 1426 of yacc.c */
2240 #line 2241 "src/parse-gram.c"
2244 /* Line 1426 of yacc.c */
2245 #line 378 "src/parse-gram.y"
2248 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2249 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2250 symbol_list_free ((yyvsp
[0].list
));
2252 /* Line 1426 of yacc.c */
2253 #line 2254 "src/parse-gram.c"
2257 /* Line 1426 of yacc.c */
2258 #line 385 "src/parse-gram.y"
2260 default_prec
= true;
2262 /* Line 1426 of yacc.c */
2263 #line 2264 "src/parse-gram.c"
2267 /* Line 1426 of yacc.c */
2268 #line 389 "src/parse-gram.y"
2270 default_prec
= false;
2272 /* Line 1426 of yacc.c */
2273 #line 2274 "src/parse-gram.c"
2277 /* Line 1426 of yacc.c */
2278 #line 393 "src/parse-gram.y"
2280 /* Do not invoke muscle_percent_code_grow here since it invokes
2281 muscle_user_name_list_grow. */
2282 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2283 code_scanner_last_string_free ();
2285 /* Line 1426 of yacc.c */
2286 #line 2287 "src/parse-gram.c"
2290 /* Line 1426 of yacc.c */
2291 #line 400 "src/parse-gram.y"
2293 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2294 code_scanner_last_string_free ();
2296 /* Line 1426 of yacc.c */
2297 #line 2298 "src/parse-gram.c"
2301 /* Line 1426 of yacc.c */
2302 #line 414 "src/parse-gram.y"
2304 /* Line 1426 of yacc.c */
2305 #line 2306 "src/parse-gram.c"
2309 /* Line 1426 of yacc.c */
2310 #line 415 "src/parse-gram.y"
2311 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2312 /* Line 1426 of yacc.c */
2313 #line 2314 "src/parse-gram.c"
2317 /* Line 1426 of yacc.c */
2318 #line 420 "src/parse-gram.y"
2321 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2322 code_scanner_last_string_free ();
2324 /* Line 1426 of yacc.c */
2325 #line 2326 "src/parse-gram.c"
2329 /* Line 1426 of yacc.c */
2330 #line 431 "src/parse-gram.y"
2331 { current_class
= nterm_sym
; }
2332 /* Line 1426 of yacc.c */
2333 #line 2334 "src/parse-gram.c"
2337 /* Line 1426 of yacc.c */
2338 #line 432 "src/parse-gram.y"
2340 current_class
= unknown_sym
;
2341 current_type
= NULL
;
2343 /* Line 1426 of yacc.c */
2344 #line 2345 "src/parse-gram.c"
2348 /* Line 1426 of yacc.c */
2349 #line 436 "src/parse-gram.y"
2350 { current_class
= token_sym
; }
2351 /* Line 1426 of yacc.c */
2352 #line 2353 "src/parse-gram.c"
2356 /* Line 1426 of yacc.c */
2357 #line 437 "src/parse-gram.y"
2359 current_class
= unknown_sym
;
2360 current_type
= NULL
;
2362 /* Line 1426 of yacc.c */
2363 #line 2364 "src/parse-gram.c"
2367 /* Line 1426 of yacc.c */
2368 #line 442 "src/parse-gram.y"
2372 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2373 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2374 symbol_list_free ((yyvsp
[0].list
));
2376 /* Line 1426 of yacc.c */
2377 #line 2378 "src/parse-gram.c"
2381 /* Line 1426 of yacc.c */
2382 #line 453 "src/parse-gram.y"
2386 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2388 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2389 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2391 symbol_list_free ((yyvsp
[0].list
));
2392 current_type
= NULL
;
2394 /* Line 1426 of yacc.c */
2395 #line 2396 "src/parse-gram.c"
2399 /* Line 1426 of yacc.c */
2400 #line 467 "src/parse-gram.y"
2401 { (yyval
.assoc
) = left_assoc
; }
2402 /* Line 1426 of yacc.c */
2403 #line 2404 "src/parse-gram.c"
2407 /* Line 1426 of yacc.c */
2408 #line 468 "src/parse-gram.y"
2409 { (yyval
.assoc
) = right_assoc
; }
2410 /* Line 1426 of yacc.c */
2411 #line 2412 "src/parse-gram.c"
2415 /* Line 1426 of yacc.c */
2416 #line 469 "src/parse-gram.y"
2417 { (yyval
.assoc
) = non_assoc
; }
2418 /* Line 1426 of yacc.c */
2419 #line 2420 "src/parse-gram.c"
2423 /* Line 1426 of yacc.c */
2424 #line 470 "src/parse-gram.y"
2425 { (yyval
.assoc
) = precedence_assoc
; }
2426 /* Line 1426 of yacc.c */
2427 #line 2428 "src/parse-gram.c"
2431 /* Line 1426 of yacc.c */
2432 #line 474 "src/parse-gram.y"
2433 { current_type
= NULL
; }
2434 /* Line 1426 of yacc.c */
2435 #line 2436 "src/parse-gram.c"
2439 /* Line 1426 of yacc.c */
2440 #line 475 "src/parse-gram.y"
2441 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2442 /* Line 1426 of yacc.c */
2443 #line 2444 "src/parse-gram.c"
2447 /* Line 1426 of yacc.c */
2448 #line 481 "src/parse-gram.y"
2449 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2450 /* Line 1426 of yacc.c */
2451 #line 2452 "src/parse-gram.c"
2455 /* Line 1426 of yacc.c */
2456 #line 483 "src/parse-gram.y"
2457 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2458 /* Line 1426 of yacc.c */
2459 #line 2460 "src/parse-gram.c"
2463 /* Line 1426 of yacc.c */
2464 #line 487 "src/parse-gram.y"
2465 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2466 /* Line 1426 of yacc.c */
2467 #line 2468 "src/parse-gram.c"
2471 /* Line 1426 of yacc.c */
2472 #line 488 "src/parse-gram.y"
2473 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2474 /* Line 1426 of yacc.c */
2475 #line 2476 "src/parse-gram.c"
2479 /* Line 1426 of yacc.c */
2480 #line 494 "src/parse-gram.y"
2481 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2482 /* Line 1426 of yacc.c */
2483 #line 2484 "src/parse-gram.c"
2487 /* Line 1426 of yacc.c */
2488 #line 496 "src/parse-gram.y"
2489 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2490 /* Line 1426 of yacc.c */
2491 #line 2492 "src/parse-gram.c"
2495 /* Line 1426 of yacc.c */
2496 #line 500 "src/parse-gram.y"
2497 { (yyval
.list
) = (yyvsp
[0].list
); }
2498 /* Line 1426 of yacc.c */
2499 #line 2500 "src/parse-gram.c"
2503 /* Line 1426 of yacc.c */
2504 #line 501 "src/parse-gram.y"
2505 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2506 /* Line 1426 of yacc.c */
2507 #line 2508 "src/parse-gram.c"
2511 /* Line 1426 of yacc.c */
2512 #line 505 "src/parse-gram.y"
2513 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2514 /* Line 1426 of yacc.c */
2515 #line 2516 "src/parse-gram.c"
2519 /* Line 1426 of yacc.c */
2520 #line 506 "src/parse-gram.y"
2521 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2522 /* Line 1426 of yacc.c */
2523 #line 2524 "src/parse-gram.c"
2527 /* Line 1426 of yacc.c */
2528 #line 507 "src/parse-gram.y"
2529 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2530 /* Line 1426 of yacc.c */
2531 #line 2532 "src/parse-gram.c"
2535 /* Line 1426 of yacc.c */
2536 #line 508 "src/parse-gram.y"
2537 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2538 /* Line 1426 of yacc.c */
2539 #line 2540 "src/parse-gram.c"
2543 /* Line 1426 of yacc.c */
2544 #line 514 "src/parse-gram.y"
2546 current_type
= (yyvsp
[0].uniqstr
);
2549 /* Line 1426 of yacc.c */
2550 #line 2551 "src/parse-gram.c"
2554 /* Line 1426 of yacc.c */
2555 #line 519 "src/parse-gram.y"
2557 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2558 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2560 /* Line 1426 of yacc.c */
2561 #line 2562 "src/parse-gram.c"
2565 /* Line 1426 of yacc.c */
2566 #line 524 "src/parse-gram.y"
2568 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2569 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2570 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2572 /* Line 1426 of yacc.c */
2573 #line 2574 "src/parse-gram.c"
2577 /* Line 1426 of yacc.c */
2578 #line 530 "src/parse-gram.y"
2580 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2581 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2582 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2584 /* Line 1426 of yacc.c */
2585 #line 2586 "src/parse-gram.c"
2589 /* Line 1426 of yacc.c */
2590 #line 536 "src/parse-gram.y"
2592 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2593 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2594 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2595 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2597 /* Line 1426 of yacc.c */
2598 #line 2599 "src/parse-gram.c"
2602 /* Line 1426 of yacc.c */
2603 #line 566 "src/parse-gram.y"
2607 /* Line 1426 of yacc.c */
2608 #line 2609 "src/parse-gram.c"
2612 /* Line 1426 of yacc.c */
2613 #line 572 "src/parse-gram.y"
2614 { current_lhs
= (yyvsp
[-1].symbol
); current_lhs_location
= (yylsp
[-1]);
2615 current_lhs_named_ref
= (yyvsp
[0].named_ref
); }
2616 /* Line 1426 of yacc.c */
2617 #line 2618 "src/parse-gram.c"
2621 /* Line 1426 of yacc.c */
2622 #line 577 "src/parse-gram.y"
2623 { grammar_current_rule_end ((yylsp
[0])); }
2624 /* Line 1426 of yacc.c */
2625 #line 2626 "src/parse-gram.c"
2629 /* Line 1426 of yacc.c */
2630 #line 578 "src/parse-gram.y"
2631 { grammar_current_rule_end ((yylsp
[0])); }
2632 /* Line 1426 of yacc.c */
2633 #line 2634 "src/parse-gram.c"
2637 /* Line 1426 of yacc.c */
2638 #line 584 "src/parse-gram.y"
2639 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2640 current_lhs_named_ref
); }
2641 /* Line 1426 of yacc.c */
2642 #line 2643 "src/parse-gram.c"
2646 /* Line 1426 of yacc.c */
2647 #line 587 "src/parse-gram.y"
2648 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2649 /* Line 1426 of yacc.c */
2650 #line 2651 "src/parse-gram.c"
2654 /* Line 1426 of yacc.c */
2655 #line 589 "src/parse-gram.y"
2656 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
), false); }
2657 /* Line 1426 of yacc.c */
2658 #line 2659 "src/parse-gram.c"
2662 /* Line 1426 of yacc.c */
2663 #line 591 "src/parse-gram.y"
2664 { grammar_current_rule_action_append ((yyvsp
[0].code
), (yylsp
[0]), NULL
, true); }
2665 /* Line 1426 of yacc.c */
2666 #line 2667 "src/parse-gram.c"
2670 /* Line 1426 of yacc.c */
2671 #line 593 "src/parse-gram.y"
2672 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2673 /* Line 1426 of yacc.c */
2674 #line 2675 "src/parse-gram.c"
2678 /* Line 1426 of yacc.c */
2679 #line 595 "src/parse-gram.y"
2680 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2681 /* Line 1426 of yacc.c */
2682 #line 2683 "src/parse-gram.c"
2686 /* Line 1426 of yacc.c */
2687 #line 597 "src/parse-gram.y"
2688 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2689 /* Line 1426 of yacc.c */
2690 #line 2691 "src/parse-gram.c"
2694 /* Line 1426 of yacc.c */
2695 #line 601 "src/parse-gram.y"
2696 { (yyval
.named_ref
) = 0; }
2697 /* Line 1426 of yacc.c */
2698 #line 2699 "src/parse-gram.c"
2702 /* Line 1426 of yacc.c */
2703 #line 603 "src/parse-gram.y"
2704 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2705 /* Line 1426 of yacc.c */
2706 #line 2707 "src/parse-gram.c"
2710 /* Line 1426 of yacc.c */
2711 #line 614 "src/parse-gram.y"
2712 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2713 /* Line 1426 of yacc.c */
2714 #line 2715 "src/parse-gram.c"
2718 /* Line 1426 of yacc.c */
2719 #line 619 "src/parse-gram.y"
2720 { (yyval
.chars
) = ""; }
2721 /* Line 1426 of yacc.c */
2722 #line 2723 "src/parse-gram.c"
2726 /* Line 1426 of yacc.c */
2727 #line 620 "src/parse-gram.y"
2728 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2729 /* Line 1426 of yacc.c */
2730 #line 2731 "src/parse-gram.c"
2734 /* Line 1426 of yacc.c */
2735 #line 631 "src/parse-gram.y"
2737 code_props plain_code
;
2738 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2739 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2740 code_props_translate_code (&plain_code
);
2741 gram_scanner_last_string_free ();
2742 (yyval
.chars
) = plain_code
.code
;
2744 /* Line 1426 of yacc.c */
2745 #line 2746 "src/parse-gram.c"
2749 /* Line 1426 of yacc.c */
2750 #line 651 "src/parse-gram.y"
2751 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2752 /* Line 1426 of yacc.c */
2753 #line 2754 "src/parse-gram.c"
2757 /* Line 1426 of yacc.c */
2758 #line 653 "src/parse-gram.y"
2760 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2761 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2762 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2764 /* Line 1426 of yacc.c */
2765 #line 2766 "src/parse-gram.c"
2769 /* Line 1426 of yacc.c */
2770 #line 661 "src/parse-gram.y"
2771 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2772 /* Line 1426 of yacc.c */
2773 #line 2774 "src/parse-gram.c"
2777 /* Line 1426 of yacc.c */
2778 #line 673 "src/parse-gram.y"
2780 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2781 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2783 /* Line 1426 of yacc.c */
2784 #line 2785 "src/parse-gram.c"
2788 /* Line 1426 of yacc.c */
2789 #line 682 "src/parse-gram.y"
2791 code_props plain_code
;
2792 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2793 code_props_translate_code (&plain_code
);
2794 gram_scanner_last_string_free ();
2795 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2796 code_scanner_last_string_free ();
2798 /* Line 1426 of yacc.c */
2799 #line 2800 "src/parse-gram.c"
2803 /* Line 1426 of yacc.c */
2804 #line 2805 "src/parse-gram.c"
2807 /* User semantic actions sometimes alter yychar, and that requires
2808 that yytoken be updated with the new translation. We take the
2809 approach of translating immediately before every use of yytoken.
2810 One alternative is translating here after every semantic action,
2811 but that translation would be missed if the semantic action invokes
2812 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2813 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2814 incorrect destructor might then be invoked immediately. In the
2815 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2816 to an incorrect destructor call or verbose syntax error message
2817 before the lookahead is translated. */
2818 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2822 YY_STACK_PRINT (yyss
, yyssp
);
2827 /* Now `shift' the result of the reduction. Determine what state
2828 that goes to, based on the state we popped back to and the rule
2829 number reduced by. */
2833 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2834 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2835 yystate
= yytable
[yystate
];
2837 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2842 /*------------------------------------.
2843 | yyerrlab -- here on detecting error |
2844 `------------------------------------*/
2846 /* Make sure we have latest lookahead translation. See comments at
2847 user semantic actions for why this is necessary. */
2848 yytoken
= YYTRANSLATE (yychar
);
2850 /* If not already recovering from an error, report this error. */
2854 #if ! YYERROR_VERBOSE
2855 yyerror (YY_("syntax error"));
2857 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, yystate, \
2860 char const *yymsgp
= YY_("syntax error");
2861 int yysyntax_error_status
= YYSYNTAX_ERROR
;
2862 if (yysyntax_error_status
== 0)
2864 else if (yysyntax_error_status
== 2 && 0 < yymsg_alloc
)
2866 if (yymsg
!= yymsgbuf
)
2867 YYSTACK_FREE (yymsg
);
2868 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2872 yymsg_alloc
= sizeof yymsgbuf
;
2876 yysyntax_error_status
= YYSYNTAX_ERROR
;
2881 if (yysyntax_error_status
== 2)
2882 goto yyexhaustedlab
;
2884 # undef YYSYNTAX_ERROR
2888 yyerror_range
[1] = yylloc
;
2890 if (yyerrstatus
== 3)
2892 /* If just tried and failed to reuse lookahead token after an
2893 error, discard it. */
2895 if (yychar
<= YYEOF
)
2897 /* Return failure if at end of input. */
2898 if (yychar
== YYEOF
)
2903 yydestruct ("Error: discarding",
2904 yytoken
, &yylval
, &yylloc
);
2909 /* Else will try to reuse lookahead token after shifting the error
2914 /*---------------------------------------------------.
2915 | yyerrorlab -- error raised explicitly by YYERROR. |
2916 `---------------------------------------------------*/
2919 /* Pacify compilers like GCC when the user code never invokes
2920 YYERROR and the label yyerrorlab therefore never appears in user
2922 if (/*CONSTCOND*/ 0)
2925 yyerror_range
[1] = yylsp
[1-yylen
];
2926 /* Do not reclaim the symbols of the rule which action triggered
2930 YY_STACK_PRINT (yyss
, yyssp
);
2935 /*-------------------------------------------------------------.
2936 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2937 `-------------------------------------------------------------*/
2939 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2943 yyn
= yypact
[yystate
];
2944 if (!yypact_value_is_default (yyn
))
2947 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2955 /* Pop the current state because it cannot handle the error token. */
2959 yyerror_range
[1] = *yylsp
;
2960 yydestruct ("Error: popping",
2961 yystos
[yystate
], yyvsp
, yylsp
);
2964 YY_STACK_PRINT (yyss
, yyssp
);
2969 yyerror_range
[2] = yylloc
;
2970 /* Using YYLLOC is tempting, but would change the location of
2971 the lookahead. YYLOC is available though. */
2972 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2975 /* Shift the error token. */
2976 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2982 /*-------------------------------------.
2983 | yyacceptlab -- YYACCEPT comes here. |
2984 `-------------------------------------*/
2989 /*-----------------------------------.
2990 | yyabortlab -- YYABORT comes here. |
2991 `-----------------------------------*/
2996 #if !defined(yyoverflow) || YYERROR_VERBOSE
2997 /*-------------------------------------------------.
2998 | yyexhaustedlab -- memory exhaustion comes here. |
2999 `-------------------------------------------------*/
3001 yyerror (YY_("memory exhausted"));
3007 if (yychar
!= YYEMPTY
)
3009 /* Make sure we have latest lookahead translation. See comments at
3010 user semantic actions for why this is necessary. */
3011 yytoken
= YYTRANSLATE (yychar
);
3012 yydestruct ("Cleanup: discarding lookahead",
3013 yytoken
, &yylval
, &yylloc
);
3015 /* Do not reclaim the symbols of the rule which action triggered
3016 this YYABORT or YYACCEPT. */
3018 YY_STACK_PRINT (yyss
, yyssp
);
3019 while (yyssp
!= yyss
)
3021 yydestruct ("Cleanup: popping",
3022 yystos
[*yyssp
], yyvsp
, yylsp
);
3027 YYSTACK_FREE (yyss
);
3030 if (yymsg
!= yymsgbuf
)
3031 YYSTACK_FREE (yymsg
);
3033 /* Make sure YYID is used. */
3034 return YYID (yyresult
);
3037 /* Line 1662 of yacc.c */
3038 #line 692 "src/parse-gram.y"
3042 /* Return the location of the left-hand side of a rule whose
3043 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3044 the right-hand side, and return an empty location equal to the end
3045 boundary of RHS[0] if the right-hand side is empty. */
3048 lloc_default (YYLTYPE
const *rhs
, int n
)
3053 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3054 The bug is fixed in 7.4.2m, but play it safe for now. */
3055 loc
.start
= rhs
[n
].end
;
3056 loc
.end
= rhs
[n
].end
;
3058 /* Ignore empty nonterminals the start of the the right-hand side.
3059 Do not bother to ignore them at the end of the right-hand side,
3060 since empty nonterminals have the same end as their predecessors. */
3061 for (i
= 1; i
<= n
; i
++)
3062 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3064 loc
.start
= rhs
[i
].start
;
3073 add_param (param_type type
, char *decl
, location loc
)
3075 static char const alphanum
[26 + 26 + 1 + 10] =
3076 "abcdefghijklmnopqrstuvwxyz"
3077 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3081 char const *name_start
= NULL
;
3084 /* Stop on last actual character. */
3085 for (p
= decl
; p
[1]; p
++)
3087 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3088 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3091 /* Strip the surrounding '{' and '}', and any blanks just inside
3093 while (*--p
== ' ' || *p
== '\t')
3096 while (*++decl
== ' ' || *decl
== '\t')
3101 complain_at (loc
, _("missing identifier in parameter declaration"));
3108 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3112 name
= xmalloc (name_len
+ 1);
3113 memcpy (name
, name_start
, name_len
);
3114 name
[name_len
] = '\0';
3115 if (type
& param_lex
)
3116 muscle_pair_list_grow ("lex_param", decl
, name
);
3117 if (type
& param_parse
)
3118 muscle_pair_list_grow ("parse_param", decl
, name
);
3122 gram_scanner_last_string_free ();
3127 version_check (location
const *loc
, char const *version
)
3129 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3131 complain_at (*loc
, "require bison %s, but have %s",
3132 version
, PACKAGE_VERSION
);
3138 gram_error (location
const *loc
, char const *msg
)
3140 complain_at (*loc
, "%s", msg
);
3144 token_name (int type
)
3146 return yytname
[YYTRANSLATE (type
)];
3157 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3158 return quotearg_style (escape_quoting_style
, buf
);