1 /* A Bison parser, made by GNU Bison 2.4.483-4ad39-dirty. */
3 /* Implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2010 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.4.483-4ad39-dirty"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 1
64 /* Substitute the variable and function names. */
65 #define yyparse gram_parse
66 #define yylex gram_lex
67 #define yyerror gram_error
68 #define yylval gram_lval
69 #define yychar gram_char
70 #define yydebug gram_debug
71 #define yynerrs gram_nerrs
72 #define yylloc gram_lloc
74 /* Copy the first part of user declarations. */
75 /* Line 252 of yacc.c */
76 #line 1 "src/parse-gram.y"
77 /* Bison Grammar Parser -*- C -*-
79 Copyright (C) 2002-2010 Free Software Foundation, Inc.
81 This file is part of Bison, the GNU Compiler Compiler.
83 This program is free software: you can redistribute it and/or modify
84 it under the terms of the GNU General Public License as published by
85 the Free Software Foundation, either version 3 of the License, or
86 (at your option) any later version.
88 This program is distributed in the hope that it will be useful,
89 but WITHOUT ANY WARRANTY; without even the implied warranty of
90 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91 GNU General Public License for more details.
93 You should have received a copy of the GNU General Public License
94 along with this program. If not, see <http://www.gnu.org/licenses/>. */
100 #include "conflicts.h"
104 #include "muscle-tab.h"
105 #include "named-ref.h"
106 #include "quotearg.h"
109 #include "scan-gram.h"
110 #include "scan-code.h"
112 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
113 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
115 #define YY_LOCATION_PRINT(File, Loc) \
116 location_print (File, Loc)
118 static void version_check (location
const *loc
, char const *version
);
120 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
121 FIXME: depends on the undocumented availability of YYLLOC. */
123 #define yyerror(Msg) \
124 gram_error (&yylloc, Msg)
125 static void gram_error (location
const *, char const *);
127 static char const *char_name (char);
129 /* Line 252 of yacc.c */
130 #line 131 "src/parse-gram.c"
132 /* Enabling traces. */
137 /* Enabling verbose error messages. */
138 #ifdef YYERROR_VERBOSE
139 # undef YYERROR_VERBOSE
140 # define YYERROR_VERBOSE 1
142 # define YYERROR_VERBOSE 1
145 /* Enabling the token table. */
146 #ifndef YYTOKEN_TABLE
147 # define YYTOKEN_TABLE 0
150 /* "%code requires" blocks. */
151 /* Line 272 of yacc.c */
152 #line 201 "src/parse-gram.y"
160 param_parse
= 1 << 1,
161 param_both
= param_lex
| param_parse
166 /* Line 272 of yacc.c */
167 #line 168 "src/parse-gram.c"
172 /* Put the tokens into the symbol table, so that GDB and other debuggers
181 PERCENT_DESTRUCTOR
= 263,
182 PERCENT_PRINTER
= 264,
185 PERCENT_NONASSOC
= 267,
186 PERCENT_PRECEDENCE
= 268,
191 PERCENT_DEFAULT_PREC
= 273,
192 PERCENT_DEFINE
= 274,
193 PERCENT_DEFINES
= 275,
194 PERCENT_ERROR_VERBOSE
= 276,
195 PERCENT_EXPECT
= 277,
196 PERCENT_EXPECT_RR
= 278,
198 PERCENT_FILE_PREFIX
= 280,
199 PERCENT_GLR_PARSER
= 281,
200 PERCENT_INITIAL_ACTION
= 282,
201 PERCENT_LANGUAGE
= 283,
202 PERCENT_NAME_PREFIX
= 284,
203 PERCENT_NO_DEFAULT_PREC
= 285,
204 PERCENT_NO_LINES
= 286,
205 PERCENT_NONDETERMINISTIC_PARSER
= 287,
206 PERCENT_OUTPUT
= 288,
207 PERCENT_REQUIRE
= 289,
208 PERCENT_SKELETON
= 290,
210 PERCENT_TOKEN_TABLE
= 292,
211 PERCENT_VERBOSE
= 293,
220 PERCENT_PERCENT
= 302,
235 #define PERCENT_TOKEN 260
236 #define PERCENT_NTERM 261
237 #define PERCENT_TYPE 262
238 #define PERCENT_DESTRUCTOR 263
239 #define PERCENT_PRINTER 264
240 #define PERCENT_LEFT 265
241 #define PERCENT_RIGHT 266
242 #define PERCENT_NONASSOC 267
243 #define PERCENT_PRECEDENCE 268
244 #define PERCENT_PREC 269
245 #define PERCENT_DPREC 270
246 #define PERCENT_MERGE 271
247 #define PERCENT_CODE 272
248 #define PERCENT_DEFAULT_PREC 273
249 #define PERCENT_DEFINE 274
250 #define PERCENT_DEFINES 275
251 #define PERCENT_ERROR_VERBOSE 276
252 #define PERCENT_EXPECT 277
253 #define PERCENT_EXPECT_RR 278
254 #define PERCENT_FLAG 279
255 #define PERCENT_FILE_PREFIX 280
256 #define PERCENT_GLR_PARSER 281
257 #define PERCENT_INITIAL_ACTION 282
258 #define PERCENT_LANGUAGE 283
259 #define PERCENT_NAME_PREFIX 284
260 #define PERCENT_NO_DEFAULT_PREC 285
261 #define PERCENT_NO_LINES 286
262 #define PERCENT_NONDETERMINISTIC_PARSER 287
263 #define PERCENT_OUTPUT 288
264 #define PERCENT_REQUIRE 289
265 #define PERCENT_SKELETON 290
266 #define PERCENT_START 291
267 #define PERCENT_TOKEN_TABLE 292
268 #define PERCENT_VERBOSE 293
269 #define PERCENT_YACC 294
270 #define BRACED_CODE 295
271 #define BRACKETED_ID 296
277 #define PERCENT_PERCENT 302
280 #define SEMICOLON 305
284 #define PERCENT_PARAM 309
285 #define PERCENT_UNION 310
290 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
291 typedef union YYSTYPE
293 /* Line 277 of yacc.c */
294 #line 87 "src/parse-gram.y"
300 named_ref
*named_ref
;
304 unsigned char character
;
306 /* Line 277 of yacc.c */
307 #line 225 "src/parse-gram.y"
312 /* Line 277 of yacc.c */
313 #line 314 "src/parse-gram.c"
315 # define YYSTYPE_IS_TRIVIAL 1
316 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
317 # define YYSTYPE_IS_DECLARED 1
320 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
321 typedef struct YYLTYPE
328 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
329 # define YYLTYPE_IS_DECLARED 1
330 # define YYLTYPE_IS_TRIVIAL 1
334 /* Copy the second part of user declarations. */
336 /* Line 327 of yacc.c */
337 #line 338 "src/parse-gram.c"
338 /* Unqualified %code blocks. */
339 /* Line 328 of yacc.c */
340 #line 55 "src/parse-gram.y"
342 static int current_prec
= 0;
343 static location current_lhs_location
;
344 static named_ref
*current_lhs_named_ref
;
345 static symbol
*current_lhs
;
346 static symbol_class current_class
= unknown_sym
;
347 static uniqstr current_type
= NULL
;
349 #define YYTYPE_INT16 int_fast16_t
350 #define YYTYPE_INT8 int_fast8_t
351 #define YYTYPE_UINT16 uint_fast16_t
352 #define YYTYPE_UINT8 uint_fast8_t
354 /* Line 328 of yacc.c */
355 #line 214 "src/parse-gram.y"
357 /** Add a lex-param and/or a parse-param.
359 * \param type where to push this formal argument.
360 * \param decl the formal argument. Destroyed.
361 * \param loc the location in the source.
363 static void add_param (param_type type
, char *decl
, location loc
);
364 static param_type current_param
= param_none
;
367 /* Line 328 of yacc.c */
368 #line 369 "src/parse-gram.c"
375 typedef YYTYPE_UINT8 yytype_uint8
;
377 typedef unsigned char yytype_uint8
;
381 typedef YYTYPE_INT8 yytype_int8
;
382 #elif (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384 typedef signed char yytype_int8
;
386 typedef short int yytype_int8
;
390 typedef YYTYPE_UINT16 yytype_uint16
;
392 typedef unsigned short int yytype_uint16
;
396 typedef YYTYPE_INT16 yytype_int16
;
398 typedef short int yytype_int16
;
402 # ifdef __SIZE_TYPE__
403 # define YYSIZE_T __SIZE_TYPE__
404 # elif defined size_t
405 # define YYSIZE_T size_t
406 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
407 || defined __cplusplus || defined _MSC_VER)
408 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
409 # define YYSIZE_T size_t
411 # define YYSIZE_T unsigned int
415 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
418 # if defined YYENABLE_NLS && YYENABLE_NLS
420 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
421 # define YY_(msgid) dgettext ("bison-runtime", msgid)
425 # define YY_(msgid) msgid
429 /* Suppress unused-variable warnings by "using" E. */
430 #if ! defined lint || defined __GNUC__
431 # define YYUSE(e) ((void) (e))
433 # define YYUSE(e) /* empty */
436 /* Identity function, used to suppress warnings about constant conditions. */
440 #if (defined __STDC__ || defined __C99__FUNC__ \
441 || defined __cplusplus || defined _MSC_VER)
454 #if ! defined yyoverflow || YYERROR_VERBOSE
456 /* The parser invokes alloca or malloc; define the necessary symbols. */
458 # ifdef YYSTACK_USE_ALLOCA
459 # if YYSTACK_USE_ALLOCA
461 # define YYSTACK_ALLOC __builtin_alloca
462 # elif defined __BUILTIN_VA_ARG_INCR
463 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
465 # define YYSTACK_ALLOC __alloca
466 # elif defined _MSC_VER
467 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
468 # define alloca _alloca
470 # define YYSTACK_ALLOC alloca
471 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
472 || defined __cplusplus || defined _MSC_VER)
473 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
482 # ifdef YYSTACK_ALLOC
483 /* Pacify GCC's `empty if-body' warning. */
484 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
485 # ifndef YYSTACK_ALLOC_MAXIMUM
486 /* The OS might guarantee only one guard page at the bottom of the stack,
487 and a page size can be as small as 4096 bytes. So we cannot safely
488 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
489 to allow for a few compiler-allocated temporary stack slots. */
490 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
493 # define YYSTACK_ALLOC YYMALLOC
494 # define YYSTACK_FREE YYFREE
495 # ifndef YYSTACK_ALLOC_MAXIMUM
496 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
498 # if (defined __cplusplus && ! defined _STDLIB_H \
499 && ! ((defined YYMALLOC || defined malloc) \
500 && (defined YYFREE || defined free)))
501 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
507 # define YYMALLOC malloc
508 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
509 || defined __cplusplus || defined _MSC_VER)
510 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
515 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
516 || defined __cplusplus || defined _MSC_VER)
517 void free (void *); /* INFRINGES ON USER NAME SPACE */
521 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
524 #if (! defined yyoverflow \
525 && (! defined __cplusplus \
526 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
527 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
529 /* A type that is properly aligned for any stack member. */
532 yytype_int16 yyss_alloc
;
537 /* The size of the maximum gap between one aligned stack and the next. */
538 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
540 /* The size of an array large to enough to hold all stacks, each with
542 # define YYSTACK_BYTES(N) \
543 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
544 + 2 * YYSTACK_GAP_MAXIMUM)
546 /* Copy COUNT objects from FROM to TO. The source and destination do
549 # if defined __GNUC__ && 1 < __GNUC__
550 # define YYCOPY(To, From, Count) \
551 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
553 # define YYCOPY(To, From, Count) \
557 for (yyi = 0; yyi < (Count); yyi++) \
558 (To)[yyi] = (From)[yyi]; \
564 /* Relocate STACK from its old location to the new one. The
565 local variables YYSIZE and YYSTACKSIZE give the old and new number of
566 elements in the stack, and YYPTR gives the new location of the
567 stack. Advance YYPTR to a properly aligned location for the next
569 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
572 YYSIZE_T yynewbytes; \
573 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
574 Stack = &yyptr->Stack_alloc; \
575 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
576 yyptr += yynewbytes / sizeof (*yyptr); \
582 /* YYFINAL -- State number of the termination state. */
584 /* YYLAST -- Last index in YYTABLE. */
587 /* YYNTOKENS -- Number of terminals. */
589 /* YYNNTS -- Number of nonterminals. */
591 /* YYNRULES -- Number of rules. */
593 /* YYNSTATES -- Number of states. */
594 #define YYNSTATES 148
596 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
597 by yylex, with out-of-bounds checking. */
599 #define YYMAXUTOK 310
601 #define YYTRANSLATE(YYX) \
602 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
604 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
605 as returned by yylex, without out-of-bounds checking. */
606 static const yytype_uint8 yytranslate
[] =
608 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 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, 1, 2, 3, 4,
634 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
635 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
636 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
637 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
638 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
643 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
644 static const yytype_uint16 yyrline
[] =
646 0, 250, 250, 258, 260, 264, 265, 275, 279, 284,
647 285, 290, 295, 296, 297, 298, 299, 304, 313, 314,
648 315, 316, 317, 318, 319, 320, 320, 321, 322, 346,
649 347, 348, 349, 353, 354, 363, 364, 365, 369, 376,
650 383, 387, 391, 398, 413, 414, 418, 430, 430, 435,
651 435, 440, 451, 466, 467, 468, 469, 473, 474, 479,
652 481, 486, 487, 492, 494, 499, 500, 504, 505, 506,
653 507, 512, 517, 522, 528, 534, 545, 546, 555, 556,
654 562, 563, 564, 571, 571, 576, 577, 578, 583, 585,
655 587, 589, 591, 593, 598, 600, 611, 612, 617, 618,
656 619, 628, 648, 650, 659, 664, 665, 670, 677, 679
660 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
661 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
662 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
663 static const char *const yytname
[] =
665 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
666 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
667 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
668 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
669 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
670 "\"%expect\"", "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"",
671 "\"%glr-parser\"", "\"%initial-action\"", "\"%language\"",
672 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
673 "\"%nondeterministic-parser\"", "\"%output\"", "\"%require\"",
674 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
675 "\"%yacc\"", "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"",
676 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
677 "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"", "\"%param\"",
678 "\"%union\"", "$accept", "input", "prologue_declarations",
679 "prologue_declaration", "$@1", "params", "grammar_declaration",
680 "union_name", "symbol_declaration", "$@2", "$@3",
681 "precedence_declaration", "precedence_declarator", "tag.opt",
682 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
683 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
684 "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
685 "named_ref.opt", "variable", "content.opt", "braceless", "id",
686 "id_colon", "symbol", "string_as_id", "epilogue.opt", 0
691 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
692 (internal) symbol number NUM (which must be that of a token). */
693 static const yytype_uint16 yytoknum
[] =
695 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
696 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
697 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
698 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
699 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
700 305, 306, 307, 308, 309, 310
704 #define YYPACT_NINF -137
706 #define yypact_value_is_default(yystate) \
707 ((yystate) == (-137))
709 #define YYTABLE_NINF -109
711 #define yytable_value_is_error(yytable_value) \
714 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
716 static const yytype_int16 yypact
[] =
718 -137, 20, 106, -137, -137, -137, 19, -1, 36, -137,
719 -137, -137, -137, 13, -137, 0, 79, -137, 89, 90,
720 -137, 41, -137, 55, 93, 46, -137, -137, -137, 47,
721 94, 95, 35, -137, -137, -137, 16, -137, -137, -137,
722 54, -137, -137, -137, -137, 49, 33, 33, 35, 12,
723 12, -137, 61, -137, -137, -137, 29, -137, -137, -137,
724 -137, 100, -137, -137, -137, 101, -137, 103, -137, -137,
725 -137, -137, -137, -137, -137, -137, 57, -137, 58, 1,
726 -137, -137, 68, 80, -137, 61, -137, 35, -137, -137,
727 33, 56, 33, 35, -137, -137, -137, -137, 12, -137,
728 -137, 12, -137, -137, -137, -137, -137, -137, -137, -137,
729 -137, 78, -137, -137, -137, -137, -137, 82, -137, 35,
730 -137, 142, -137, 144, -137, -137, -137, -137, -137, -137,
731 -137, -137, -137, 18, 27, -137, -137, 35, 145, 97,
732 68, 68, 27, -137, -137, -137, -137, -137
735 /* YYDEFACT[S] -- default reduction number in state S. Performed when
736 YYTABLE does not specify something else to do. Zero means the default
738 static const yytype_uint8 yydefact
[] =
740 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
741 54, 55, 56, 0, 40, 0, 9, 11, 0, 0,
742 7, 0, 16, 0, 0, 0, 41, 21, 22, 0,
743 0, 0, 0, 29, 30, 31, 0, 6, 32, 25,
744 44, 4, 5, 36, 35, 57, 0, 0, 0, 0,
745 0, 101, 0, 42, 97, 96, 98, 10, 12, 13,
746 14, 0, 17, 18, 19, 0, 23, 0, 27, 28,
747 107, 103, 102, 105, 37, 106, 0, 104, 0, 0,
748 78, 80, 94, 0, 45, 0, 58, 0, 71, 76,
749 50, 72, 48, 51, 63, 68, 69, 70, 38, 65,
750 67, 39, 43, 100, 99, 8, 15, 20, 24, 82,
751 81, 0, 79, 2, 95, 83, 34, 26, 46, 52,
752 59, 61, 77, 73, 74, 64, 66, 109, 88, 33,
753 60, 62, 75, 84, 85, 88, 87, 0, 0, 0,
754 94, 94, 86, 91, 92, 93, 90, 89
757 /* YYPGOTO[NTERM-NUM]. */
758 static const yytype_int16 yypgoto
[] =
760 -137, -137, -137, -137, -137, -137, 148, -137, -137, -137,
761 -137, -137, -137, -137, -137, 32, -137, 102, -9, -4,
762 107, -137, 83, -137, -137, -137, 22, -136, -137, -137,
763 -12, -11, -137, -32, -40, -137
766 /* YYDEFGOTO[NTERM-NUM]. */
767 static const yytype_int16 yydefgoto
[] =
769 -1, 1, 2, 41, 83, 117, 78, 85, 43, 47,
770 46, 44, 45, 87, 119, 120, 93, 98, 99, 89,
771 90, 79, 80, 81, 128, 133, 134, 115, 56, 105,
772 53, 73, 82, 100, 75, 113
775 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
776 positive, shift that token. If negative, reduce the rule which
777 number is the opposite. If YYTABLE_NINF, syntax error. */
778 static const yytype_int16 yytable
[] =
780 74, -108, 76, 54, 146, 147, 4, 5, 6, 7,
781 8, 9, 10, 11, 12, 70, 94, 76, 13, 14,
782 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
783 70, 26, 103, 13, 14, 91, 91, 32, 70, 49,
784 102, 137, 138, 139, 60, 55, 26, 77, 111, 64,
785 66, 124, 32, 51, 71, 121, 40, 72, 52, 70,
786 123, 125, 77, 95, 96, 97, 135, 140, 136, 71,
787 48, 40, 72, 118, 104, 71, 50, 71, 72, 91,
788 72, 91, 57, 132, 88, 61, 122, 121, 122, 126,
789 65, 67, 126, 58, 59, 62, 63, 68, 69, 84,
790 86, 51, 141, 106, 107, 143, 108, 109, 110, 114,
791 141, 4, 5, 6, 7, 8, 9, 10, 11, 12,
792 116, 127, 129, 13, 14, 15, 16, 17, 18, 19,
793 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
794 30, 31, 32, 33, 34, 35, 131, 70, 145, 144,
795 42, 130, 101, 36, 92, 37, 38, 142, 0, 0,
799 static const yytype_int16 yycheck
[] =
801 32, 0, 1, 3, 140, 141, 5, 6, 7, 8,
802 9, 10, 11, 12, 13, 3, 48, 1, 17, 18,
803 0, 5, 6, 7, 8, 9, 10, 11, 12, 13,
804 3, 30, 3, 17, 18, 46, 47, 36, 3, 40,
805 52, 14, 15, 16, 3, 45, 30, 46, 47, 3,
806 3, 91, 36, 40, 42, 87, 55, 45, 45, 3,
807 4, 93, 46, 51, 52, 53, 48, 40, 50, 42,
808 51, 55, 45, 85, 45, 42, 40, 42, 45, 90,
809 45, 92, 3, 123, 51, 44, 90, 119, 92, 98,
810 44, 44, 101, 4, 4, 40, 3, 3, 3, 45,
811 51, 40, 134, 3, 3, 137, 3, 50, 50, 41,
812 142, 5, 6, 7, 8, 9, 10, 11, 12, 13,
813 40, 43, 40, 17, 18, 19, 20, 21, 22, 23,
814 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
815 34, 35, 36, 37, 38, 39, 4, 3, 51, 4,
816 2, 119, 50, 47, 47, 49, 50, 135, -1, -1,
820 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
821 symbol of state STATE-NUM. */
822 static const yytype_uint8 yystos
[] =
824 0, 57, 58, 0, 5, 6, 7, 8, 9, 10,
825 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
826 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
827 34, 35, 36, 37, 38, 39, 47, 49, 50, 54,
828 55, 59, 62, 64, 67, 68, 66, 65, 51, 40,
829 40, 40, 45, 86, 3, 45, 84, 3, 4, 4,
830 3, 44, 40, 3, 3, 44, 3, 44, 3, 3,
831 3, 42, 45, 87, 89, 90, 1, 46, 62, 77,
832 78, 79, 88, 60, 45, 63, 51, 69, 51, 75,
833 76, 87, 76, 72, 89, 51, 52, 53, 73, 74,
834 89, 73, 86, 3, 45, 85, 3, 3, 3, 50,
835 50, 47, 78, 91, 41, 83, 40, 61, 86, 70,
836 71, 89, 75, 4, 90, 89, 74, 43, 80, 40,
837 71, 4, 90, 81, 82, 48, 50, 14, 15, 16,
838 40, 89, 82, 89, 4, 51, 83, 83
841 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
842 static const yytype_uint8 yyr1
[] =
844 0, 56, 57, 58, 58, 59, 59, 59, 59, 59,
845 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
846 59, 59, 59, 59, 59, 60, 59, 59, 59, 59,
847 59, 59, 59, 61, 61, 62, 62, 62, 62, 62,
848 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
849 64, 64, 67, 68, 68, 68, 68, 69, 69, 70,
850 70, 71, 71, 72, 72, 73, 73, 74, 74, 74,
851 74, 75, 75, 75, 75, 75, 76, 76, 77, 77,
852 78, 78, 78, 80, 79, 81, 81, 81, 82, 82,
853 82, 82, 82, 82, 83, 83, 84, 84, 85, 85,
854 85, 86, 87, 87, 88, 89, 89, 90, 91, 91
857 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
858 static const yytype_uint8 yyr2
[] =
860 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
861 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
862 3, 1, 1, 2, 3, 0, 3, 2, 2, 1,
863 1, 1, 1, 2, 1, 1, 1, 2, 3, 3,
864 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
865 3, 3, 3, 1, 1, 1, 1, 0, 1, 1,
866 2, 1, 2, 1, 2, 1, 2, 1, 1, 1,
867 1, 1, 1, 2, 2, 3, 1, 2, 1, 2,
868 1, 2, 2, 0, 4, 1, 3, 2, 0, 3,
869 3, 3, 3, 3, 0, 1, 1, 1, 0, 1,
870 1, 1, 1, 1, 1, 1, 1, 1, 0, 2
874 #define yyerrok (yyerrstatus = 0)
875 #define yyclearin (yychar = YYEMPTY)
879 #define YYACCEPT goto yyacceptlab
880 #define YYABORT goto yyabortlab
881 #define YYERROR goto yyerrorlab
884 /* Like YYERROR except do call yyerror. This remains here temporarily
885 to ease the transition to the new meaning of YYERROR, for GCC.
886 Once GCC version 2 has supplanted version 1, this can go. However,
887 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
888 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
891 #define YYFAIL goto yyerrlab
893 /* This is here to suppress warnings from the GCC cpp's
894 -Wunused-macros. Normally we don't worry about that warning, but
895 some users do, and we want to make it easy for users to remove
896 YYFAIL uses, which will produce warnings from Bison 2.5. */
899 #define YYRECOVERING() (!!yyerrstatus)
901 #define YYBACKUP(Token, Value) \
903 if (yychar == YYEMPTY && yylen == 1) \
912 yyerror (YY_("syntax error: cannot back up")); \
919 #define YYERRCODE 256
922 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
923 If N is 0, then set CURRENT to the empty location which ends
924 the previous symbol: RHS[0] (always defined). */
926 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
927 #ifndef YYLLOC_DEFAULT
928 # define YYLLOC_DEFAULT(Current, Rhs, N) \
932 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
933 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
934 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
935 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
939 (Current).first_line = (Current).last_line = \
940 YYRHSLOC (Rhs, 0).last_line; \
941 (Current).first_column = (Current).last_column = \
942 YYRHSLOC (Rhs, 0).last_column; \
948 /* YY_LOCATION_PRINT -- Print the location on the stream.
949 This macro was not mandated originally: define only if we know
950 we won't break user code: when these are the locations we know. */
952 #ifndef YY_LOCATION_PRINT
953 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
954 # define YY_LOCATION_PRINT(File, Loc) \
955 fprintf (File, "%d.%d-%d.%d", \
956 (Loc).first_line, (Loc).first_column, \
957 (Loc).last_line, (Loc).last_column)
959 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
964 /* YYLEX -- calling `yylex' with the right arguments. */
967 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
969 # define YYLEX yylex (&yylval, &yylloc)
972 /* Enable debugging if requested. */
976 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
977 # define YYFPRINTF fprintf
980 # define YYDPRINTF(Args) \
986 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
990 YYFPRINTF (stderr, "%s ", Title); \
991 yy_symbol_print (stderr, \
992 Type, Value, Location); \
993 YYFPRINTF (stderr, "\n"); \
998 /*--------------------------------.
999 | Print this symbol on YYOUTPUT. |
1000 `--------------------------------*/
1003 #if (defined __STDC__ || defined __C99__FUNC__ \
1004 || defined __cplusplus || defined _MSC_VER)
1006 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1009 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1012 YYSTYPE
const * const yyvaluep
;
1013 YYLTYPE
const * const yylocationp
;
1018 YYUSE (yylocationp
);
1020 if (yytype
< YYNTOKENS
)
1021 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1029 /* Line 729 of yacc.c */
1030 #line 174 "src/parse-gram.y"
1031 { fputs (quotearg_style (c_quoting_style
, ((*yyvaluep
).chars
)), stderr
); }
1032 /* Line 729 of yacc.c */
1033 #line 1034 "src/parse-gram.c"
1036 case 4: // "integer"
1038 /* Line 729 of yacc.c */
1039 #line 187 "src/parse-gram.y"
1040 { fprintf (stderr
, "%d", ((*yyvaluep
).integer
)); }
1041 /* Line 729 of yacc.c */
1042 #line 1043 "src/parse-gram.c"
1045 case 24: // "%<flag>"
1047 /* Line 729 of yacc.c */
1048 #line 183 "src/parse-gram.y"
1049 { fprintf (stderr
, "%%%s", ((*yyvaluep
).uniqstr
)); }
1050 /* Line 729 of yacc.c */
1051 #line 1052 "src/parse-gram.c"
1056 /* Line 729 of yacc.c */
1057 #line 176 "src/parse-gram.y"
1058 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).code
)); }
1059 /* Line 729 of yacc.c */
1060 #line 1061 "src/parse-gram.c"
1063 case 41: // "[identifier]"
1065 /* Line 729 of yacc.c */
1066 #line 181 "src/parse-gram.y"
1067 { fprintf (stderr
, "[%s]", ((*yyvaluep
).uniqstr
)); }
1068 /* Line 729 of yacc.c */
1069 #line 1070 "src/parse-gram.c"
1074 /* Line 729 of yacc.c */
1075 #line 168 "src/parse-gram.y"
1076 { fputs (char_name (((*yyvaluep
).character
)), stderr
); }
1077 /* Line 729 of yacc.c */
1078 #line 1079 "src/parse-gram.c"
1081 case 43: // "epilogue"
1083 /* Line 729 of yacc.c */
1084 #line 176 "src/parse-gram.y"
1085 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1086 /* Line 729 of yacc.c */
1087 #line 1088 "src/parse-gram.c"
1090 case 45: // "identifier"
1092 /* Line 729 of yacc.c */
1093 #line 180 "src/parse-gram.y"
1094 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1095 /* Line 729 of yacc.c */
1096 #line 1097 "src/parse-gram.c"
1099 case 46: // "identifier:"
1101 /* Line 729 of yacc.c */
1102 #line 182 "src/parse-gram.y"
1103 { fprintf (stderr
, "%s:", ((*yyvaluep
).uniqstr
)); }
1104 /* Line 729 of yacc.c */
1105 #line 1106 "src/parse-gram.c"
1108 case 49: // "%{...%}"
1110 /* Line 729 of yacc.c */
1111 #line 176 "src/parse-gram.y"
1112 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1113 /* Line 729 of yacc.c */
1114 #line 1115 "src/parse-gram.c"
1119 /* Line 729 of yacc.c */
1120 #line 184 "src/parse-gram.y"
1121 { fprintf (stderr
, "<%s>", ((*yyvaluep
).uniqstr
)); }
1122 /* Line 729 of yacc.c */
1123 #line 1124 "src/parse-gram.c"
1126 case 54: // "%param"
1128 /* Line 729 of yacc.c */
1129 #line 230 "src/parse-gram.y"
1131 switch (((*yyvaluep
).param
))
1133 #define CASE(In, Out) \
1134 case param_ ## In: fputs ("%" #Out, stderr); break
1135 CASE(lex
, lex
-param
);
1136 CASE(parse
, parse
-param
);
1139 case param_none
: aver (false); break;
1142 /* Line 729 of yacc.c */
1143 #line 1144 "src/parse-gram.c"
1146 case 71: // symbol.prec
1148 /* Line 729 of yacc.c */
1149 #line 190 "src/parse-gram.y"
1150 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1151 /* Line 729 of yacc.c */
1152 #line 1153 "src/parse-gram.c"
1155 case 84: // variable
1157 /* Line 729 of yacc.c */
1158 #line 180 "src/parse-gram.y"
1159 { fputs (((*yyvaluep
).uniqstr
), stderr
); }
1160 /* Line 729 of yacc.c */
1161 #line 1162 "src/parse-gram.c"
1164 case 85: // content.opt
1166 /* Line 729 of yacc.c */
1167 #line 176 "src/parse-gram.y"
1168 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1169 /* Line 729 of yacc.c */
1170 #line 1171 "src/parse-gram.c"
1173 case 86: // braceless
1175 /* Line 729 of yacc.c */
1176 #line 176 "src/parse-gram.y"
1177 { fprintf (stderr
, "{\n%s\n}", ((*yyvaluep
).chars
)); }
1178 /* Line 729 of yacc.c */
1179 #line 1180 "src/parse-gram.c"
1184 /* Line 729 of yacc.c */
1185 #line 190 "src/parse-gram.y"
1186 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1187 /* Line 729 of yacc.c */
1188 #line 1189 "src/parse-gram.c"
1191 case 88: // id_colon
1193 /* Line 729 of yacc.c */
1194 #line 191 "src/parse-gram.y"
1195 { fprintf (stderr
, "%s:", ((*yyvaluep
).symbol
)->tag
); }
1196 /* Line 729 of yacc.c */
1197 #line 1198 "src/parse-gram.c"
1202 /* Line 729 of yacc.c */
1203 #line 190 "src/parse-gram.y"
1204 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1205 /* Line 729 of yacc.c */
1206 #line 1207 "src/parse-gram.c"
1209 case 90: // string_as_id
1211 /* Line 729 of yacc.c */
1212 #line 190 "src/parse-gram.y"
1213 { fprintf (stderr
, "%s", ((*yyvaluep
).symbol
)->tag
); }
1214 /* Line 729 of yacc.c */
1215 #line 1216 "src/parse-gram.c"
1224 /*--------------------------------.
1225 | Print this symbol on YYOUTPUT. |
1226 `--------------------------------*/
1228 #if (defined __STDC__ || defined __C99__FUNC__ \
1229 || defined __cplusplus || defined _MSC_VER)
1231 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1234 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1237 YYSTYPE
const * const yyvaluep
;
1238 YYLTYPE
const * const yylocationp
;
1241 if (yytype
< YYNTOKENS
)
1242 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1244 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1246 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1247 YYFPRINTF (yyoutput
, ": ");
1248 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1249 YYFPRINTF (yyoutput
, ")");
1252 /*------------------------------------------------------------------.
1253 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1255 `------------------------------------------------------------------*/
1257 #if (defined __STDC__ || defined __C99__FUNC__ \
1258 || defined __cplusplus || defined _MSC_VER)
1260 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1263 yy_stack_print (yybottom
, yytop
)
1264 yytype_int16
*yybottom
;
1265 yytype_int16
*yytop
;
1268 YYFPRINTF (stderr
, "Stack now");
1269 for (; yybottom
<= yytop
; yybottom
++)
1271 int yybot
= *yybottom
;
1272 YYFPRINTF (stderr
, " %d", yybot
);
1274 YYFPRINTF (stderr
, "\n");
1277 # define YY_STACK_PRINT(Bottom, Top) \
1280 yy_stack_print ((Bottom), (Top)); \
1284 /*------------------------------------------------.
1285 | Report that the YYRULE is going to be reduced. |
1286 `------------------------------------------------*/
1288 #if (defined __STDC__ || defined __C99__FUNC__ \
1289 || defined __cplusplus || defined _MSC_VER)
1291 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1294 yy_reduce_print (yyssp
, yyvsp
, yylsp
, yyrule
)
1295 yytype_int16
*yyssp
;
1301 unsigned long int yylno
= yyrline
[yyrule
];
1302 int yynrhs
= yyr2
[yyrule
];
1304 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1306 /* The symbols being reduced. */
1307 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1309 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1310 yy_symbol_print (stderr
,
1311 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1312 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1313 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1314 YYFPRINTF (stderr
, "\n");
1318 # define YY_REDUCE_PRINT(Rule) \
1321 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1324 /* Nonzero means print parse trace. It is left uninitialized so that
1325 multiple parsers can coexist. */
1327 #else /* !YYDEBUG */
1328 # define YYDPRINTF(Args)
1329 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1330 # define YY_STACK_PRINT(Bottom, Top)
1331 # define YY_REDUCE_PRINT(Rule)
1332 #endif /* !YYDEBUG */
1335 /* YYINITDEPTH -- initial size of the parser's stacks. */
1337 # define YYINITDEPTH 200
1340 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1341 if the built-in stack extension method is used).
1343 Do not make this value too large; the results are undefined if
1344 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1345 evaluated with infinite-precision integer arithmetic. */
1348 # define YYMAXDEPTH 10000
1356 # if defined __GLIBC__ && defined _STRING_H
1357 # define yystrlen strlen
1359 /* Return the length of YYSTR. */
1360 #if (defined __STDC__ || defined __C99__FUNC__ \
1361 || defined __cplusplus || defined _MSC_VER)
1363 yystrlen (const char *yystr
)
1371 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1379 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1380 # define yystpcpy stpcpy
1382 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1384 #if (defined __STDC__ || defined __C99__FUNC__ \
1385 || defined __cplusplus || defined _MSC_VER)
1387 yystpcpy (char *yydest
, const char *yysrc
)
1390 yystpcpy (yydest
, yysrc
)
1396 const char *yys
= yysrc
;
1398 while ((*yyd
++ = *yys
++) != '\0')
1407 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1408 quotes and backslashes, so that it's suitable for yyerror. The
1409 heuristic is that double-quoting is unnecessary unless the string
1410 contains an apostrophe, a comma, or backslash (other than
1411 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1412 null, do not copy; instead, return the length of what the result
1415 yytnamerr (char *yyres
, const char *yystr
)
1420 char const *yyp
= yystr
;
1427 goto do_not_strip_quotes
;
1431 goto do_not_strip_quotes
;
1444 do_not_strip_quotes
: ;
1448 return yystrlen (yystr
);
1450 return yystpcpy (yyres
, yystr
) - yyres
;
1454 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1455 about the unexpected token YYTOKEN while in state YYSTATE.
1457 Return 0 if *YYMSG was successfully written. Return 1 if an ordinary
1458 "syntax error" message will suffice instead. Return 2 if *YYMSG is
1459 not large enough to hold the message. In the last case, also set
1460 *YYMSG_ALLOC to either (a) the required number of bytes or (b) zero
1461 if the required number of bytes is too large to store. */
1463 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1464 int yystate
, int yytoken
)
1466 int yyn
= yypact
[yystate
];
1468 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1472 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1473 YYSIZE_T yysize
= yysize0
;
1475 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1476 /* Internationalized format string. */
1477 const char *yyformat
= 0;
1478 /* Arguments of yyformat. */
1479 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1481 /* Start YYX at -YYN if negative to avoid negative indexes in
1482 YYCHECK. In other words, skip the first -YYN actions for this
1483 state because they are default actions. */
1484 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1486 /* Stay within bounds of both yycheck and yytname. */
1487 int yychecklim
= YYLAST
- yyn
+ 1;
1488 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1489 /* Number of reported tokens (one for the "unexpected", one per
1494 yyarg
[yycount
++] = yytname
[yytoken
];
1496 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1497 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1498 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1500 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1506 yyarg
[yycount
++] = yytname
[yyx
];
1507 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1508 if (! (yysize
<= yysize1
1509 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1520 #define YYCASE_(N, S) \
1524 YYCASE_(1, YY_("syntax error, unexpected %s"));
1525 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1526 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1527 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1528 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1532 yysize1
= yysize
+ yystrlen (yyformat
);
1533 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1541 if (*yymsg_alloc
< yysize
)
1543 *yymsg_alloc
= 2 * yysize
;
1544 if (! (yysize
<= *yymsg_alloc
1545 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1546 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1550 /* Avoid sprintf, as that infringes on the user's name space.
1551 Don't have undefined behavior even if the translation
1552 produced a string with the wrong number of "%s"s. */
1556 while ((*yyp
= *yyformat
) != '\0')
1557 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1559 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1571 #endif /* YYERROR_VERBOSE */
1574 /*-----------------------------------------------.
1575 | Release the memory associated to this symbol. |
1576 `-----------------------------------------------*/
1579 #if (defined __STDC__ || defined __C99__FUNC__ \
1580 || defined __cplusplus || defined _MSC_VER)
1582 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1585 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1589 YYLTYPE
*yylocationp
;
1593 YYUSE (yylocationp
);
1597 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1607 /* Prevent warnings from -Wmissing-prototypes. */
1608 #ifdef YYPARSE_PARAM
1609 #if (defined __STDC__ || defined __C99__FUNC__ \
1610 || defined __cplusplus || defined _MSC_VER)
1611 int yyparse (void *YYPARSE_PARAM
);
1615 #else /* ! YYPARSE_PARAM */
1616 #if (defined __STDC__ || defined __C99__FUNC__ \
1617 || defined __cplusplus || defined _MSC_VER)
1622 #endif /* ! YYPARSE_PARAM */
1629 #ifdef YYPARSE_PARAM
1630 #if (defined __STDC__ || defined __C99__FUNC__ \
1631 || defined __cplusplus || defined _MSC_VER)
1633 yyparse (void *YYPARSE_PARAM
)
1636 yyparse (YYPARSE_PARAM
)
1637 void *YYPARSE_PARAM
;
1639 #else /* ! YYPARSE_PARAM */
1640 #if (defined __STDC__ || defined __C99__FUNC__ \
1641 || defined __cplusplus || defined _MSC_VER)
1651 /* The lookahead symbol. */
1654 /* The semantic value of the lookahead symbol. */
1657 /* Location data for the lookahead symbol. */
1660 /* Number of syntax errors so far. */
1664 /* Number of tokens to shift before error messages enabled. */
1667 /* The stacks and their tools:
1668 `yyss': related to states.
1669 `yyvs': related to semantic values.
1670 `yyls': related to locations.
1672 Refer to the stacks thru separate pointers, to allow yyoverflow
1673 to reallocate them elsewhere. */
1675 /* The state stack. */
1676 yytype_int16 yyssa
[YYINITDEPTH
];
1678 yytype_int16
*yyssp
;
1680 /* The semantic value stack. */
1681 YYSTYPE yyvsa
[YYINITDEPTH
];
1685 /* The location stack. */
1686 YYLTYPE yylsa
[YYINITDEPTH
];
1690 /* The locations where the error started and ended. */
1691 YYLTYPE yyerror_range
[3];
1693 YYSIZE_T yystacksize
;
1697 /* Lookahead token as an internal (translated) token number. */
1699 /* The variables used to return semantic value and location from the
1705 /* Buffer for error messages, and its allocated size. */
1707 char *yymsg
= yymsgbuf
;
1708 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1711 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1713 /* The number of symbols on the RHS of the reduced rule.
1714 Keep to zero when no symbol should be popped. */
1721 yystacksize
= YYINITDEPTH
;
1723 YYDPRINTF ((stderr
, "Starting parse\n"));
1728 yychar
= YYEMPTY
; /* Cause a token to be read. */
1730 /* Initialize stack pointers.
1731 Waste one element of value and location stack
1732 so that they stay on the same level as the state stack.
1733 The wasted elements are never initialized. */
1738 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1739 /* Initialize the default location before parsing starts. */
1740 yylloc
.first_line
= yylloc
.last_line
= 1;
1741 yylloc
.first_column
= yylloc
.last_column
= 1;
1744 /* User initialization code. */
1745 /* Line 1214 of yacc.c */
1746 #line 79 "src/parse-gram.y"
1748 /* Bison's grammar can initial empty locations, hence a default
1749 location is needed. */
1750 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1751 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1753 /* Line 1214 of yacc.c */
1754 #line 1755 "src/parse-gram.c"
1759 /*------------------------------------------------------------.
1760 | yynewstate -- Push a new state, which is found in yystate. |
1761 `------------------------------------------------------------*/
1763 /* In all cases, when you get here, the value and location stacks
1764 have just been pushed. So pushing a state here evens the stacks. */
1770 if (yyss
+ yystacksize
- 1 <= yyssp
)
1772 /* Get the current used size of the three stacks, in elements. */
1773 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1777 /* Give user a chance to reallocate the stack. Use copies of
1778 these so that the &'s don't force the real ones into
1780 YYSTYPE
*yyvs1
= yyvs
;
1781 yytype_int16
*yyss1
= yyss
;
1782 YYLTYPE
*yyls1
= yyls
;
1784 /* Each stack pointer address is followed by the size of the
1785 data in use in that stack, in bytes. This used to be a
1786 conditional around just the two extra args, but that might
1787 be undefined if yyoverflow is a macro. */
1788 yyoverflow (YY_("memory exhausted"),
1789 &yyss1
, yysize
* sizeof (*yyssp
),
1790 &yyvs1
, yysize
* sizeof (*yyvsp
),
1791 &yyls1
, yysize
* sizeof (*yylsp
),
1798 #else /* no yyoverflow */
1799 # ifndef YYSTACK_RELOCATE
1800 goto yyexhaustedlab
;
1802 /* Extend the stack our own way. */
1803 if (YYMAXDEPTH
<= yystacksize
)
1804 goto yyexhaustedlab
;
1806 if (YYMAXDEPTH
< yystacksize
)
1807 yystacksize
= YYMAXDEPTH
;
1810 yytype_int16
*yyss1
= yyss
;
1811 union yyalloc
*yyptr
=
1812 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1814 goto yyexhaustedlab
;
1815 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1816 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1817 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1818 # undef YYSTACK_RELOCATE
1820 YYSTACK_FREE (yyss1
);
1823 #endif /* no yyoverflow */
1825 yyssp
= yyss
+ yysize
- 1;
1826 yyvsp
= yyvs
+ yysize
- 1;
1827 yylsp
= yyls
+ yysize
- 1;
1829 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1830 (unsigned long int) yystacksize
));
1832 if (yyss
+ yystacksize
- 1 <= yyssp
)
1836 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1838 if (yystate
== YYFINAL
)
1848 /* Do appropriate processing given the current state. Read a
1849 lookahead token if we need one and don't already have one. */
1851 /* First try to decide what to do without reference to lookahead token. */
1852 yyn
= yypact
[yystate
];
1853 if (yypact_value_is_default (yyn
))
1856 /* Not known => get a lookahead token if don't already have one. */
1858 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1859 if (yychar
== YYEMPTY
)
1861 YYDPRINTF ((stderr
, "Reading a token: "));
1865 if (yychar
<= YYEOF
)
1867 yychar
= yytoken
= YYEOF
;
1868 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1872 yytoken
= YYTRANSLATE (yychar
);
1873 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1876 /* If the proper action on seeing token YYTOKEN is to reduce or to
1877 detect an error, take that action. */
1879 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1884 if (yytable_value_is_error (yyn
))
1890 /* Count tokens shifted since error; after three, turn off error
1895 /* Shift the lookahead token. */
1896 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1898 /* Discard the shifted token. */
1907 /*-----------------------------------------------------------.
1908 | yydefault -- do the default action for the current state. |
1909 `-----------------------------------------------------------*/
1911 yyn
= yydefact
[yystate
];
1917 /*-----------------------------.
1918 | yyreduce -- Do a reduction. |
1919 `-----------------------------*/
1921 /* yyn is the number of a rule to reduce with. */
1924 /* If YYLEN is nonzero, implement the default value of the action:
1927 Otherwise, the following line sets YYVAL to garbage.
1928 This behavior is undocumented and Bison
1929 users should not rely upon it. Assigning to YYVAL
1930 unconditionally makes the parser a bit smaller, and it avoids a
1931 GCC warning that YYVAL may be used uninitialized. */
1932 yyval
= yyvsp
[1-yylen
];
1934 /* Default location. */
1935 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1936 YY_REDUCE_PRINT (yyn
);
1940 /* Line 1427 of yacc.c */
1941 #line 266 "src/parse-gram.y"
1943 code_props plain_code
;
1944 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
1945 code_props_translate_code (&plain_code
);
1946 gram_scanner_last_string_free ();
1947 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
1948 plain_code
.code
, (yylsp
[0]));
1949 code_scanner_last_string_free ();
1951 /* Line 1427 of yacc.c */
1952 #line 1953 "src/parse-gram.c"
1956 /* Line 1427 of yacc.c */
1957 #line 276 "src/parse-gram.y"
1959 muscle_percent_define_ensure ((yyvsp
[0].uniqstr
), (yylsp
[0]), true);
1961 /* Line 1427 of yacc.c */
1962 #line 1963 "src/parse-gram.c"
1966 /* Line 1427 of yacc.c */
1967 #line 280 "src/parse-gram.y"
1969 muscle_percent_define_insert ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
),
1970 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
1972 /* Line 1427 of yacc.c */
1973 #line 1974 "src/parse-gram.c"
1977 /* Line 1427 of yacc.c */
1978 #line 284 "src/parse-gram.y"
1979 { defines_flag
= true; }
1980 /* Line 1427 of yacc.c */
1981 #line 1982 "src/parse-gram.c"
1985 /* Line 1427 of yacc.c */
1986 #line 286 "src/parse-gram.y"
1988 defines_flag
= true;
1989 spec_defines_file
= xstrdup ((yyvsp
[0].chars
));
1991 /* Line 1427 of yacc.c */
1992 #line 1993 "src/parse-gram.c"
1996 /* Line 1427 of yacc.c */
1997 #line 291 "src/parse-gram.y"
1999 muscle_percent_define_insert ("parse.error", (yylsp
[0]), "verbose",
2000 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2002 /* Line 1427 of yacc.c */
2003 #line 2004 "src/parse-gram.c"
2007 /* Line 1427 of yacc.c */
2008 #line 295 "src/parse-gram.y"
2009 { expected_sr_conflicts
= (yyvsp
[0].integer
); }
2010 /* Line 1427 of yacc.c */
2011 #line 2012 "src/parse-gram.c"
2015 /* Line 1427 of yacc.c */
2016 #line 296 "src/parse-gram.y"
2017 { expected_rr_conflicts
= (yyvsp
[0].integer
); }
2018 /* Line 1427 of yacc.c */
2019 #line 2020 "src/parse-gram.c"
2023 /* Line 1427 of yacc.c */
2024 #line 297 "src/parse-gram.y"
2025 { spec_file_prefix
= (yyvsp
[0].chars
); }
2026 /* Line 1427 of yacc.c */
2027 #line 2028 "src/parse-gram.c"
2031 /* Line 1427 of yacc.c */
2032 #line 298 "src/parse-gram.y"
2033 { spec_file_prefix
= (yyvsp
[0].chars
); }
2034 /* Line 1427 of yacc.c */
2035 #line 2036 "src/parse-gram.c"
2039 /* Line 1427 of yacc.c */
2040 #line 300 "src/parse-gram.y"
2042 nondeterministic_parser
= true;
2045 /* Line 1427 of yacc.c */
2046 #line 2047 "src/parse-gram.c"
2050 /* Line 1427 of yacc.c */
2051 #line 305 "src/parse-gram.y"
2054 code_props_symbol_action_init (&action
, (yyvsp
[0].code
), (yylsp
[0]));
2055 code_props_translate_code (&action
);
2056 gram_scanner_last_string_free ();
2057 muscle_code_grow ("initial_action", action
.code
, (yylsp
[0]));
2058 code_scanner_last_string_free ();
2060 /* Line 1427 of yacc.c */
2061 #line 2062 "src/parse-gram.c"
2065 /* Line 1427 of yacc.c */
2066 #line 313 "src/parse-gram.y"
2067 { language_argmatch ((yyvsp
[0].chars
), grammar_prio
, (yylsp
[-1])); }
2068 /* Line 1427 of yacc.c */
2069 #line 2070 "src/parse-gram.c"
2073 /* Line 1427 of yacc.c */
2074 #line 314 "src/parse-gram.y"
2075 { spec_name_prefix
= (yyvsp
[0].chars
); }
2076 /* Line 1427 of yacc.c */
2077 #line 2078 "src/parse-gram.c"
2081 /* Line 1427 of yacc.c */
2082 #line 315 "src/parse-gram.y"
2083 { spec_name_prefix
= (yyvsp
[0].chars
); }
2084 /* Line 1427 of yacc.c */
2085 #line 2086 "src/parse-gram.c"
2089 /* Line 1427 of yacc.c */
2090 #line 316 "src/parse-gram.y"
2091 { no_lines_flag
= true; }
2092 /* Line 1427 of yacc.c */
2093 #line 2094 "src/parse-gram.c"
2097 /* Line 1427 of yacc.c */
2098 #line 317 "src/parse-gram.y"
2099 { nondeterministic_parser
= true; }
2100 /* Line 1427 of yacc.c */
2101 #line 2102 "src/parse-gram.c"
2105 /* Line 1427 of yacc.c */
2106 #line 318 "src/parse-gram.y"
2107 { spec_outfile
= (yyvsp
[0].chars
); }
2108 /* Line 1427 of yacc.c */
2109 #line 2110 "src/parse-gram.c"
2113 /* Line 1427 of yacc.c */
2114 #line 319 "src/parse-gram.y"
2115 { spec_outfile
= (yyvsp
[0].chars
); }
2116 /* Line 1427 of yacc.c */
2117 #line 2118 "src/parse-gram.c"
2121 /* Line 1427 of yacc.c */
2122 #line 320 "src/parse-gram.y"
2123 { current_param
= (yyvsp
[0].param
); }
2124 /* Line 1427 of yacc.c */
2125 #line 2126 "src/parse-gram.c"
2129 /* Line 1427 of yacc.c */
2130 #line 320 "src/parse-gram.y"
2131 { current_param
= param_none
; }
2132 /* Line 1427 of yacc.c */
2133 #line 2134 "src/parse-gram.c"
2137 /* Line 1427 of yacc.c */
2138 #line 321 "src/parse-gram.y"
2139 { version_check (&(yylsp
[0]), (yyvsp
[0].chars
)); }
2140 /* Line 1427 of yacc.c */
2141 #line 2142 "src/parse-gram.c"
2145 /* Line 1427 of yacc.c */
2146 #line 323 "src/parse-gram.y"
2148 char const *skeleton_user
= (yyvsp
[0].chars
);
2149 if (strchr (skeleton_user
, '/'))
2151 size_t dir_length
= strlen (current_file
);
2152 char *skeleton_build
;
2153 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2155 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2158 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2161 strncpy (skeleton_build
, current_file
, dir_length
);
2162 skeleton_build
[dir_length
++] = '/';
2164 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2165 skeleton_user
= uniqstr_new (skeleton_build
);
2166 free (skeleton_build
);
2168 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[-1]));
2170 /* Line 1427 of yacc.c */
2171 #line 2172 "src/parse-gram.c"
2175 /* Line 1427 of yacc.c */
2176 #line 346 "src/parse-gram.y"
2177 { token_table_flag
= true; }
2178 /* Line 1427 of yacc.c */
2179 #line 2180 "src/parse-gram.c"
2183 /* Line 1427 of yacc.c */
2184 #line 347 "src/parse-gram.y"
2185 { report_flag
|= report_states
; }
2186 /* Line 1427 of yacc.c */
2187 #line 2188 "src/parse-gram.c"
2191 /* Line 1427 of yacc.c */
2192 #line 348 "src/parse-gram.y"
2193 { yacc_flag
= true; }
2194 /* Line 1427 of yacc.c */
2195 #line 2196 "src/parse-gram.c"
2199 /* Line 1427 of yacc.c */
2200 #line 353 "src/parse-gram.y"
2201 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2202 /* Line 1427 of yacc.c */
2203 #line 2204 "src/parse-gram.c"
2207 /* Line 1427 of yacc.c */
2208 #line 354 "src/parse-gram.y"
2209 { add_param (current_param
, (yyvsp
[0].code
), (yylsp
[0])); }
2210 /* Line 1427 of yacc.c */
2211 #line 2212 "src/parse-gram.c"
2215 /* Line 1427 of yacc.c */
2216 #line 366 "src/parse-gram.y"
2218 grammar_start_symbol_set ((yyvsp
[0].symbol
), (yylsp
[0]));
2220 /* Line 1427 of yacc.c */
2221 #line 2222 "src/parse-gram.c"
2225 /* Line 1427 of yacc.c */
2226 #line 370 "src/parse-gram.y"
2229 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2230 symbol_list_destructor_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2231 symbol_list_free ((yyvsp
[0].list
));
2233 /* Line 1427 of yacc.c */
2234 #line 2235 "src/parse-gram.c"
2238 /* Line 1427 of yacc.c */
2239 #line 377 "src/parse-gram.y"
2242 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2243 symbol_list_printer_set (list
, (yyvsp
[-1].code
), (yylsp
[-1]));
2244 symbol_list_free ((yyvsp
[0].list
));
2246 /* Line 1427 of yacc.c */
2247 #line 2248 "src/parse-gram.c"
2251 /* Line 1427 of yacc.c */
2252 #line 384 "src/parse-gram.y"
2254 default_prec
= true;
2256 /* Line 1427 of yacc.c */
2257 #line 2258 "src/parse-gram.c"
2261 /* Line 1427 of yacc.c */
2262 #line 388 "src/parse-gram.y"
2264 default_prec
= false;
2266 /* Line 1427 of yacc.c */
2267 #line 2268 "src/parse-gram.c"
2271 /* Line 1427 of yacc.c */
2272 #line 392 "src/parse-gram.y"
2274 /* Do not invoke muscle_percent_code_grow here since it invokes
2275 muscle_user_name_list_grow. */
2276 muscle_code_grow ("percent_code()", (yyvsp
[0].chars
), (yylsp
[0]));
2277 code_scanner_last_string_free ();
2279 /* Line 1427 of yacc.c */
2280 #line 2281 "src/parse-gram.c"
2284 /* Line 1427 of yacc.c */
2285 #line 399 "src/parse-gram.y"
2287 muscle_percent_code_grow ((yyvsp
[-1].uniqstr
), (yylsp
[-1]), (yyvsp
[0].chars
), (yylsp
[0]));
2288 code_scanner_last_string_free ();
2290 /* Line 1427 of yacc.c */
2291 #line 2292 "src/parse-gram.c"
2295 /* Line 1427 of yacc.c */
2296 #line 413 "src/parse-gram.y"
2298 /* Line 1427 of yacc.c */
2299 #line 2300 "src/parse-gram.c"
2303 /* Line 1427 of yacc.c */
2304 #line 414 "src/parse-gram.y"
2305 { muscle_code_grow ("union_name", (yyvsp
[0].uniqstr
), (yylsp
[0])); }
2306 /* Line 1427 of yacc.c */
2307 #line 2308 "src/parse-gram.c"
2311 /* Line 1427 of yacc.c */
2312 #line 419 "src/parse-gram.y"
2315 muscle_code_grow ("stype", (yyvsp
[0].chars
), (yylsp
[0]));
2316 code_scanner_last_string_free ();
2318 /* Line 1427 of yacc.c */
2319 #line 2320 "src/parse-gram.c"
2323 /* Line 1427 of yacc.c */
2324 #line 430 "src/parse-gram.y"
2325 { current_class
= nterm_sym
; }
2326 /* Line 1427 of yacc.c */
2327 #line 2328 "src/parse-gram.c"
2331 /* Line 1427 of yacc.c */
2332 #line 431 "src/parse-gram.y"
2334 current_class
= unknown_sym
;
2335 current_type
= NULL
;
2337 /* Line 1427 of yacc.c */
2338 #line 2339 "src/parse-gram.c"
2342 /* Line 1427 of yacc.c */
2343 #line 435 "src/parse-gram.y"
2344 { current_class
= token_sym
; }
2345 /* Line 1427 of yacc.c */
2346 #line 2347 "src/parse-gram.c"
2350 /* Line 1427 of yacc.c */
2351 #line 436 "src/parse-gram.y"
2353 current_class
= unknown_sym
;
2354 current_type
= NULL
;
2356 /* Line 1427 of yacc.c */
2357 #line 2358 "src/parse-gram.c"
2361 /* Line 1427 of yacc.c */
2362 #line 441 "src/parse-gram.y"
2366 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2367 symbol_type_set (list
->content
.sym
, (yyvsp
[-1].uniqstr
), (yylsp
[-1]));
2368 symbol_list_free ((yyvsp
[0].list
));
2370 /* Line 1427 of yacc.c */
2371 #line 2372 "src/parse-gram.c"
2375 /* Line 1427 of yacc.c */
2376 #line 452 "src/parse-gram.y"
2380 for (list
= (yyvsp
[0].list
); list
; list
= list
->next
)
2382 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[-1]));
2383 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[-2].assoc
), (yylsp
[-2]));
2385 symbol_list_free ((yyvsp
[0].list
));
2386 current_type
= NULL
;
2388 /* Line 1427 of yacc.c */
2389 #line 2390 "src/parse-gram.c"
2393 /* Line 1427 of yacc.c */
2394 #line 466 "src/parse-gram.y"
2395 { (yyval
.assoc
) = left_assoc
; }
2396 /* Line 1427 of yacc.c */
2397 #line 2398 "src/parse-gram.c"
2401 /* Line 1427 of yacc.c */
2402 #line 467 "src/parse-gram.y"
2403 { (yyval
.assoc
) = right_assoc
; }
2404 /* Line 1427 of yacc.c */
2405 #line 2406 "src/parse-gram.c"
2409 /* Line 1427 of yacc.c */
2410 #line 468 "src/parse-gram.y"
2411 { (yyval
.assoc
) = non_assoc
; }
2412 /* Line 1427 of yacc.c */
2413 #line 2414 "src/parse-gram.c"
2417 /* Line 1427 of yacc.c */
2418 #line 469 "src/parse-gram.y"
2419 { (yyval
.assoc
) = precedence_assoc
; }
2420 /* Line 1427 of yacc.c */
2421 #line 2422 "src/parse-gram.c"
2425 /* Line 1427 of yacc.c */
2426 #line 473 "src/parse-gram.y"
2427 { current_type
= NULL
; }
2428 /* Line 1427 of yacc.c */
2429 #line 2430 "src/parse-gram.c"
2433 /* Line 1427 of yacc.c */
2434 #line 474 "src/parse-gram.y"
2435 { current_type
= (yyvsp
[0].uniqstr
); tag_seen
= true; }
2436 /* Line 1427 of yacc.c */
2437 #line 2438 "src/parse-gram.c"
2441 /* Line 1427 of yacc.c */
2442 #line 480 "src/parse-gram.y"
2443 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2444 /* Line 1427 of yacc.c */
2445 #line 2446 "src/parse-gram.c"
2449 /* Line 1427 of yacc.c */
2450 #line 482 "src/parse-gram.y"
2451 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2452 /* Line 1427 of yacc.c */
2453 #line 2454 "src/parse-gram.c"
2457 /* Line 1427 of yacc.c */
2458 #line 486 "src/parse-gram.y"
2459 { (yyval
.symbol
) = (yyvsp
[0].symbol
); }
2460 /* Line 1427 of yacc.c */
2461 #line 2462 "src/parse-gram.c"
2465 /* Line 1427 of yacc.c */
2466 #line 487 "src/parse-gram.y"
2467 { (yyval
.symbol
) = (yyvsp
[-1].symbol
); symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0])); }
2468 /* Line 1427 of yacc.c */
2469 #line 2470 "src/parse-gram.c"
2473 /* Line 1427 of yacc.c */
2474 #line 493 "src/parse-gram.y"
2475 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2476 /* Line 1427 of yacc.c */
2477 #line 2478 "src/parse-gram.c"
2481 /* Line 1427 of yacc.c */
2482 #line 495 "src/parse-gram.y"
2483 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0]))); }
2484 /* Line 1427 of yacc.c */
2485 #line 2486 "src/parse-gram.c"
2489 /* Line 1427 of yacc.c */
2490 #line 499 "src/parse-gram.y"
2491 { (yyval
.list
) = (yyvsp
[0].list
); }
2492 /* Line 1427 of yacc.c */
2493 #line 2494 "src/parse-gram.c"
2497 /* Line 1427 of yacc.c */
2498 #line 500 "src/parse-gram.y"
2499 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[-1].list
), (yyvsp
[0].list
)); }
2500 /* Line 1427 of yacc.c */
2501 #line 2502 "src/parse-gram.c"
2505 /* Line 1427 of yacc.c */
2506 #line 504 "src/parse-gram.y"
2507 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[0].symbol
), (yylsp
[0])); }
2508 /* Line 1427 of yacc.c */
2509 #line 2510 "src/parse-gram.c"
2513 /* Line 1427 of yacc.c */
2514 #line 505 "src/parse-gram.y"
2515 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2516 /* Line 1427 of yacc.c */
2517 #line 2518 "src/parse-gram.c"
2521 /* Line 1427 of yacc.c */
2522 #line 506 "src/parse-gram.y"
2523 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[0])); }
2524 /* Line 1427 of yacc.c */
2525 #line 2526 "src/parse-gram.c"
2529 /* Line 1427 of yacc.c */
2530 #line 507 "src/parse-gram.y"
2531 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[0])); }
2532 /* Line 1427 of yacc.c */
2533 #line 2534 "src/parse-gram.c"
2537 /* Line 1427 of yacc.c */
2538 #line 513 "src/parse-gram.y"
2540 current_type
= (yyvsp
[0].uniqstr
);
2543 /* Line 1427 of yacc.c */
2544 #line 2545 "src/parse-gram.c"
2548 /* Line 1427 of yacc.c */
2549 #line 518 "src/parse-gram.y"
2551 symbol_class_set ((yyvsp
[0].symbol
), current_class
, (yylsp
[0]), true);
2552 symbol_type_set ((yyvsp
[0].symbol
), current_type
, (yylsp
[0]));
2554 /* Line 1427 of yacc.c */
2555 #line 2556 "src/parse-gram.c"
2559 /* Line 1427 of yacc.c */
2560 #line 523 "src/parse-gram.y"
2562 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2563 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2564 symbol_user_token_number_set ((yyvsp
[-1].symbol
), (yyvsp
[0].integer
), (yylsp
[0]));
2566 /* Line 1427 of yacc.c */
2567 #line 2568 "src/parse-gram.c"
2571 /* Line 1427 of yacc.c */
2572 #line 529 "src/parse-gram.y"
2574 symbol_class_set ((yyvsp
[-1].symbol
), current_class
, (yylsp
[-1]), true);
2575 symbol_type_set ((yyvsp
[-1].symbol
), current_type
, (yylsp
[-1]));
2576 symbol_make_alias ((yyvsp
[-1].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2578 /* Line 1427 of yacc.c */
2579 #line 2580 "src/parse-gram.c"
2583 /* Line 1427 of yacc.c */
2584 #line 535 "src/parse-gram.y"
2586 symbol_class_set ((yyvsp
[-2].symbol
), current_class
, (yylsp
[-2]), true);
2587 symbol_type_set ((yyvsp
[-2].symbol
), current_type
, (yylsp
[-2]));
2588 symbol_user_token_number_set ((yyvsp
[-2].symbol
), (yyvsp
[-1].integer
), (yylsp
[-1]));
2589 symbol_make_alias ((yyvsp
[-2].symbol
), (yyvsp
[0].symbol
), (yyloc
));
2591 /* Line 1427 of yacc.c */
2592 #line 2593 "src/parse-gram.c"
2596 /* Line 1427 of yacc.c */
2597 #line 565 "src/parse-gram.y"
2601 /* Line 1427 of yacc.c */
2602 #line 2603 "src/parse-gram.c"
2606 /* Line 1427 of yacc.c */
2607 #line 571 "src/parse-gram.y"
2608 { current_lhs
= (yyvsp
[-1].symbol
); current_lhs_location
= (yylsp
[-1]);
2609 current_lhs_named_ref
= (yyvsp
[0].named_ref
); }
2610 /* Line 1427 of yacc.c */
2611 #line 2612 "src/parse-gram.c"
2615 /* Line 1427 of yacc.c */
2616 #line 576 "src/parse-gram.y"
2617 { grammar_current_rule_end ((yylsp
[0])); }
2618 /* Line 1427 of yacc.c */
2619 #line 2620 "src/parse-gram.c"
2623 /* Line 1427 of yacc.c */
2624 #line 577 "src/parse-gram.y"
2625 { grammar_current_rule_end ((yylsp
[0])); }
2626 /* Line 1427 of yacc.c */
2627 #line 2628 "src/parse-gram.c"
2631 /* Line 1427 of yacc.c */
2632 #line 583 "src/parse-gram.y"
2633 { grammar_current_rule_begin (current_lhs
, current_lhs_location
,
2634 current_lhs_named_ref
); }
2635 /* Line 1427 of yacc.c */
2636 #line 2637 "src/parse-gram.c"
2640 /* Line 1427 of yacc.c */
2641 #line 586 "src/parse-gram.y"
2642 { grammar_current_rule_symbol_append ((yyvsp
[-1].symbol
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2643 /* Line 1427 of yacc.c */
2644 #line 2645 "src/parse-gram.c"
2648 /* Line 1427 of yacc.c */
2649 #line 588 "src/parse-gram.y"
2650 { grammar_current_rule_action_append ((yyvsp
[-1].code
), (yylsp
[-1]), (yyvsp
[0].named_ref
)); }
2651 /* Line 1427 of yacc.c */
2652 #line 2653 "src/parse-gram.c"
2656 /* Line 1427 of yacc.c */
2657 #line 590 "src/parse-gram.y"
2658 { grammar_current_rule_prec_set ((yyvsp
[0].symbol
), (yylsp
[0])); }
2659 /* Line 1427 of yacc.c */
2660 #line 2661 "src/parse-gram.c"
2664 /* Line 1427 of yacc.c */
2665 #line 592 "src/parse-gram.y"
2666 { grammar_current_rule_dprec_set ((yyvsp
[0].integer
), (yylsp
[0])); }
2667 /* Line 1427 of yacc.c */
2668 #line 2669 "src/parse-gram.c"
2672 /* Line 1427 of yacc.c */
2673 #line 594 "src/parse-gram.y"
2674 { grammar_current_rule_merge_set ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2675 /* Line 1427 of yacc.c */
2676 #line 2677 "src/parse-gram.c"
2680 /* Line 1427 of yacc.c */
2681 #line 598 "src/parse-gram.y"
2682 { (yyval
.named_ref
) = 0; }
2683 /* Line 1427 of yacc.c */
2684 #line 2685 "src/parse-gram.c"
2688 /* Line 1427 of yacc.c */
2689 #line 600 "src/parse-gram.y"
2690 { (yyval
.named_ref
) = named_ref_new((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2691 /* Line 1427 of yacc.c */
2692 #line 2693 "src/parse-gram.c"
2696 /* Line 1427 of yacc.c */
2697 #line 612 "src/parse-gram.y"
2698 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[0].chars
)); }
2699 /* Line 1427 of yacc.c */
2700 #line 2701 "src/parse-gram.c"
2704 /* Line 1427 of yacc.c */
2705 #line 617 "src/parse-gram.y"
2706 { (yyval
.chars
) = ""; }
2707 /* Line 1427 of yacc.c */
2708 #line 2709 "src/parse-gram.c"
2712 /* Line 1427 of yacc.c */
2713 #line 618 "src/parse-gram.y"
2714 { (yyval
.chars
) = (yyvsp
[0].uniqstr
); }
2715 /* Line 1427 of yacc.c */
2716 #line 2717 "src/parse-gram.c"
2720 /* Line 1427 of yacc.c */
2721 #line 629 "src/parse-gram.y"
2723 code_props plain_code
;
2724 (yyvsp
[0].code
)[strlen ((yyvsp
[0].code
)) - 1] = '\n';
2725 code_props_plain_init (&plain_code
, (yyvsp
[0].code
)+1, (yylsp
[0]));
2726 code_props_translate_code (&plain_code
);
2727 gram_scanner_last_string_free ();
2728 (yyval
.chars
) = plain_code
.code
;
2730 /* Line 1427 of yacc.c */
2731 #line 2732 "src/parse-gram.c"
2735 /* Line 1427 of yacc.c */
2736 #line 649 "src/parse-gram.y"
2737 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2738 /* Line 1427 of yacc.c */
2739 #line 2740 "src/parse-gram.c"
2743 /* Line 1427 of yacc.c */
2744 #line 651 "src/parse-gram.y"
2746 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[0].character
)), (yylsp
[0]));
2747 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2748 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[0].character
), (yylsp
[0]));
2750 /* Line 1427 of yacc.c */
2751 #line 2752 "src/parse-gram.c"
2755 /* Line 1427 of yacc.c */
2756 #line 659 "src/parse-gram.y"
2757 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[0].uniqstr
), (yylsp
[0])); }
2758 /* Line 1427 of yacc.c */
2759 #line 2760 "src/parse-gram.c"
2763 /* Line 1427 of yacc.c */
2764 #line 671 "src/parse-gram.y"
2766 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[0].chars
)), (yylsp
[0]));
2767 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[0]), false);
2769 /* Line 1427 of yacc.c */
2770 #line 2771 "src/parse-gram.c"
2774 /* Line 1427 of yacc.c */
2775 #line 680 "src/parse-gram.y"
2777 code_props plain_code
;
2778 code_props_plain_init (&plain_code
, (yyvsp
[0].chars
), (yylsp
[0]));
2779 code_props_translate_code (&plain_code
);
2780 gram_scanner_last_string_free ();
2781 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[0]));
2782 code_scanner_last_string_free ();
2784 /* Line 1427 of yacc.c */
2785 #line 2786 "src/parse-gram.c"
2789 /* Line 1427 of yacc.c */
2790 #line 2791 "src/parse-gram.c"
2793 /* User semantic actions sometimes alter yychar, and that requires
2794 that yytoken be updated with the new translation. We take the
2795 approach of translating immediately before every use of yytoken.
2796 One alternative is translating here after every semantic action,
2797 but that translation would be missed if the semantic action invokes
2798 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2799 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2800 incorrect destructor might then be invoked immediately. In the
2801 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2802 to an incorrect destructor call or verbose syntax error message
2803 before the lookahead is translated. */
2804 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2808 YY_STACK_PRINT (yyss
, yyssp
);
2813 /* Now `shift' the result of the reduction. Determine what state
2814 that goes to, based on the state we popped back to and the rule
2815 number reduced by. */
2819 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2820 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2821 yystate
= yytable
[yystate
];
2823 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2828 /*------------------------------------.
2829 | yyerrlab -- here on detecting error |
2830 `------------------------------------*/
2832 /* Make sure we have latest lookahead translation. See comments at
2833 user semantic actions for why this is necessary. */
2834 yytoken
= YYTRANSLATE (yychar
);
2836 /* If not already recovering from an error, report this error. */
2840 #if ! YYERROR_VERBOSE
2841 yyerror (YY_("syntax error"));
2845 int yysyntax_error_status
=
2846 yysyntax_error (&yymsg_alloc
, &yymsg
, yystate
, yytoken
);
2847 if (yysyntax_error_status
== 2 && 0 < yymsg_alloc
)
2849 if (yymsg
!= yymsgbuf
)
2850 YYSTACK_FREE (yymsg
);
2851 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2855 yymsg_alloc
= sizeof yymsgbuf
;
2857 if (yysyntax_error_status
== 0)
2860 yyerror (YY_("syntax error"));
2861 if (yysyntax_error_status
== 2)
2862 goto yyexhaustedlab
;
2868 yyerror_range
[1] = yylloc
;
2870 if (yyerrstatus
== 3)
2872 /* If just tried and failed to reuse lookahead token after an
2873 error, discard it. */
2875 if (yychar
<= YYEOF
)
2877 /* Return failure if at end of input. */
2878 if (yychar
== YYEOF
)
2883 yydestruct ("Error: discarding",
2884 yytoken
, &yylval
, &yylloc
);
2889 /* Else will try to reuse lookahead token after shifting the error
2894 /*---------------------------------------------------.
2895 | yyerrorlab -- error raised explicitly by YYERROR. |
2896 `---------------------------------------------------*/
2899 /* Pacify compilers like GCC when the user code never invokes
2900 YYERROR and the label yyerrorlab therefore never appears in user
2902 if (/*CONSTCOND*/ 0)
2905 yyerror_range
[1] = yylsp
[1-yylen
];
2906 /* Do not reclaim the symbols of the rule which action triggered
2910 YY_STACK_PRINT (yyss
, yyssp
);
2915 /*-------------------------------------------------------------.
2916 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2917 `-------------------------------------------------------------*/
2919 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2923 yyn
= yypact
[yystate
];
2924 if (!yypact_value_is_default (yyn
))
2927 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2935 /* Pop the current state because it cannot handle the error token. */
2939 yyerror_range
[1] = *yylsp
;
2940 yydestruct ("Error: popping",
2941 yystos
[yystate
], yyvsp
, yylsp
);
2944 YY_STACK_PRINT (yyss
, yyssp
);
2949 yyerror_range
[2] = yylloc
;
2950 /* Using YYLLOC is tempting, but would change the location of
2951 the lookahead. YYLOC is available though. */
2952 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2955 /* Shift the error token. */
2956 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2962 /*-------------------------------------.
2963 | yyacceptlab -- YYACCEPT comes here. |
2964 `-------------------------------------*/
2969 /*-----------------------------------.
2970 | yyabortlab -- YYABORT comes here. |
2971 `-----------------------------------*/
2976 #if !defined(yyoverflow) || YYERROR_VERBOSE
2977 /*-------------------------------------------------.
2978 | yyexhaustedlab -- memory exhaustion comes here. |
2979 `-------------------------------------------------*/
2981 yyerror (YY_("memory exhausted"));
2987 if (yychar
!= YYEMPTY
)
2989 /* Make sure we have latest lookahead translation. See comments at
2990 user semantic actions for why this is necessary. */
2991 yytoken
= YYTRANSLATE (yychar
);
2992 yydestruct ("Cleanup: discarding lookahead",
2993 yytoken
, &yylval
, &yylloc
);
2995 /* Do not reclaim the symbols of the rule which action triggered
2996 this YYABORT or YYACCEPT. */
2998 YY_STACK_PRINT (yyss
, yyssp
);
2999 while (yyssp
!= yyss
)
3001 yydestruct ("Cleanup: popping",
3002 yystos
[*yyssp
], yyvsp
, yylsp
);
3007 YYSTACK_FREE (yyss
);
3010 if (yymsg
!= yymsgbuf
)
3011 YYSTACK_FREE (yymsg
);
3013 /* Make sure YYID is used. */
3014 return YYID (yyresult
);
3017 /* Line 1657 of yacc.c */
3018 #line 690 "src/parse-gram.y"
3022 /* Return the location of the left-hand side of a rule whose
3023 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3024 the right-hand side, and return an empty location equal to the end
3025 boundary of RHS[0] if the right-hand side is empty. */
3028 lloc_default (YYLTYPE
const *rhs
, int n
)
3033 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3034 The bug is fixed in 7.4.2m, but play it safe for now. */
3035 loc
.start
= rhs
[n
].end
;
3036 loc
.end
= rhs
[n
].end
;
3038 /* Ignore empty nonterminals the start of the the right-hand side.
3039 Do not bother to ignore them at the end of the right-hand side,
3040 since empty nonterminals have the same end as their predecessors. */
3041 for (i
= 1; i
<= n
; i
++)
3042 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3044 loc
.start
= rhs
[i
].start
;
3053 add_param (param_type type
, char *decl
, location loc
)
3055 static char const alphanum
[26 + 26 + 1 + 10] =
3056 "abcdefghijklmnopqrstuvwxyz"
3057 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3061 char const *name_start
= NULL
;
3064 /* Stop on last actual character. */
3065 for (p
= decl
; p
[1]; p
++)
3067 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3068 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3071 /* Strip the surrounding '{' and '}', and any blanks just inside
3073 while (*--p
== ' ' || *p
== '\t')
3076 while (*++decl
== ' ' || *decl
== '\t')
3081 complain_at (loc
, _("missing identifier in parameter declaration"));
3088 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
3092 name
= xmalloc (name_len
+ 1);
3093 memcpy (name
, name_start
, name_len
);
3094 name
[name_len
] = '\0';
3095 if (type
& param_lex
)
3096 muscle_pair_list_grow ("lex_param", decl
, name
);
3097 if (type
& param_parse
)
3098 muscle_pair_list_grow ("parse_param", decl
, name
);
3102 gram_scanner_last_string_free ();
3107 version_check (location
const *loc
, char const *version
)
3109 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3111 complain_at (*loc
, "require bison %s, but have %s",
3112 version
, PACKAGE_VERSION
);
3118 gram_error (location
const *loc
, char const *msg
)
3120 complain_at (*loc
, "%s", msg
);
3124 token_name (int type
)
3126 return yytname
[YYTRANSLATE (type
)];
3137 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3138 return quotearg_style (escape_quoting_style
, buf
);