1 /* A Bison parser, made by GNU Bison 2.5.1.19-ced26-dirty. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2012 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.5.1.19-ced26-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. */
76 /* Line 323 of yacc.c */
77 #line 1 "parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
80 Copyright (C) 2002-2012 Free Software Foundation, Inc.
82 This file is part of Bison, the GNU Compiler Compiler.
84 This program is free software: you can redistribute it and/or modify
85 it under the terms of the GNU General Public License as published by
86 the Free Software Foundation, either version 3 of the License, or
87 (at your option) any later version.
89 This program is distributed in the hope that it will be useful,
90 but WITHOUT ANY WARRANTY; without even the implied warranty of
91 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92 GNU General Public License for more details.
94 You should have received a copy of the GNU General Public License
95 along with this program. If not, see <http://www.gnu.org/licenses/>. */
100 #include "complain.h"
101 #include "conflicts.h"
105 #include "muscle-tab.h"
106 #include "named-ref.h"
107 #include "quotearg.h"
110 #include "scan-gram.h"
111 #include "scan-code.h"
112 #include "xmemdup0.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 /** Add a lex-param or a parse-param.
133 * \param type \a lex_param or \a parse_param
134 * \param decl the formal argument
135 * \param loc the location in the source.
137 static void add_param (char const *type
, char *decl
, location loc
);
140 static symbol_class current_class
= unknown_sym
;
141 static uniqstr current_type
= NULL
;
142 static symbol
*current_lhs_symbol
;
143 static location current_lhs_location
;
144 static named_ref
*current_lhs_named_ref
;
145 static int current_prec
= 0;
147 /** Set the new current left-hand side symbol, possibly common
148 * to several right-hand side parts of rule.
152 current_lhs(symbol
*sym
, location loc
, named_ref
*ref
)
154 current_lhs_symbol
= sym
;
155 current_lhs_location
= loc
;
156 /* In order to simplify memory management, named references for lhs
157 are always assigned by deep copy into the current symbol_list
158 node. This is because a single named-ref in the grammar may
159 result in several uses when the user factors lhs between several
160 rules using "|". Therefore free the parser's original copy. */
161 free (current_lhs_named_ref
);
162 current_lhs_named_ref
= ref
;
166 #define YYTYPE_INT16 int_fast16_t
167 #define YYTYPE_INT8 int_fast8_t
168 #define YYTYPE_UINT16 uint_fast16_t
169 #define YYTYPE_UINT8 uint_fast8_t
172 /* Line 323 of yacc.c */
173 #line 174 "parse-gram.c"
176 # if defined __cplusplus && 201103L <= __cplusplus
177 # define YY_NULL nullptr
183 /* Enabling verbose error messages. */
184 #ifdef YYERROR_VERBOSE
185 # undef YYERROR_VERBOSE
186 # define YYERROR_VERBOSE 1
188 # define YYERROR_VERBOSE 1
191 /* Enabling the token table. */
192 #ifndef YYTOKEN_TABLE
193 # define YYTOKEN_TABLE 0
196 #include "parse-gram.h"
198 /* Copy the second part of user declarations. */
201 /* Line 344 of yacc.c */
202 #line 203 "parse-gram.c"
209 typedef YYTYPE_UINT8 yytype_uint8
;
211 typedef unsigned char yytype_uint8
;
215 typedef YYTYPE_INT8 yytype_int8
;
216 #elif (defined __STDC__ || defined __C99__FUNC__ \
217 || defined __cplusplus || defined _MSC_VER)
218 typedef signed char yytype_int8
;
220 typedef short int yytype_int8
;
224 typedef YYTYPE_UINT16 yytype_uint16
;
226 typedef unsigned short int yytype_uint16
;
230 typedef YYTYPE_INT16 yytype_int16
;
232 typedef short int yytype_int16
;
236 # ifdef __SIZE_TYPE__
237 # define YYSIZE_T __SIZE_TYPE__
238 # elif defined size_t
239 # define YYSIZE_T size_t
240 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
241 || defined __cplusplus || defined _MSC_VER)
242 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
243 # define YYSIZE_T size_t
245 # define YYSIZE_T unsigned int
249 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
252 # if defined YYENABLE_NLS && YYENABLE_NLS
254 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
255 # define YY_(msgid) dgettext ("bison-runtime", msgid)
259 # define YY_(msgid) msgid
263 /* Suppress unused-variable warnings by "using" E. */
264 #if ! defined lint || defined __GNUC__
265 # define YYUSE(e) ((void) (e))
267 # define YYUSE(e) /* empty */
270 /* Identity function, used to suppress warnings about constant conditions. */
274 #if (defined __STDC__ || defined __C99__FUNC__ \
275 || defined __cplusplus || defined _MSC_VER)
290 /* The parser invokes alloca or malloc; define the necessary symbols. */
292 # ifdef YYSTACK_ALLOC
293 /* Pacify GCC's `empty if-body' warning. */
294 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
295 # ifndef YYSTACK_ALLOC_MAXIMUM
296 /* The OS might guarantee only one guard page at the bottom of the stack,
297 and a page size can be as small as 4096 bytes. So we cannot safely
298 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
299 to allow for a few compiler-allocated temporary stack slots. */
300 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
303 # define YYSTACK_ALLOC YYMALLOC
304 # define YYSTACK_FREE YYFREE
305 # ifndef YYSTACK_ALLOC_MAXIMUM
306 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
308 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
309 && ! ((defined YYMALLOC || defined malloc) \
310 && (defined YYFREE || defined free)))
311 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
312 # ifndef EXIT_SUCCESS
313 # define EXIT_SUCCESS 0
317 # define YYMALLOC malloc
318 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
319 || defined __cplusplus || defined _MSC_VER)
320 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
325 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
326 || defined __cplusplus || defined _MSC_VER)
327 void free (void *); /* INFRINGES ON USER NAME SPACE */
331 # define YYCOPY_NEEDED 1
335 #if (! defined yyoverflow \
336 && (! defined __cplusplus \
337 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
338 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
340 /* A type that is properly aligned for any stack member. */
343 yytype_int16 yyss_alloc
;
348 /* The size of the maximum gap between one aligned stack and the next. */
349 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
351 /* The size of an array large to enough to hold all stacks, each with
353 # define YYSTACK_BYTES(N) \
354 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
355 + 2 * YYSTACK_GAP_MAXIMUM)
357 # define YYCOPY_NEEDED 1
359 /* Relocate STACK from its old location to the new one. The
360 local variables YYSIZE and YYSTACKSIZE give the old and new number of
361 elements in the stack, and YYPTR gives the new location of the
362 stack. Advance YYPTR to a properly aligned location for the next
364 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
367 YYSIZE_T yynewbytes; \
368 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
369 Stack = &yyptr->Stack_alloc; \
370 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
371 yyptr += yynewbytes / sizeof (*yyptr); \
377 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
378 /* Copy COUNT objects from SRC to DST. The source and destination do
381 # if defined __GNUC__ && 1 < __GNUC__
382 # define YYCOPY(Dst, Src, Count) \
383 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
385 # define YYCOPY(Dst, Src, Count) \
389 for (yyi = 0; yyi < (Count); yyi++) \
390 (Dst)[yyi] = (Src)[yyi]; \
395 #endif /* !YYCOPY_NEEDED */
397 /* YYFINAL -- State number of the termination state. */
399 /* YYLAST -- Last index in YYTABLE. */
402 /* YYNTOKENS -- Number of terminals. */
404 /* YYNNTS -- Number of nonterminals. */
406 /* YYNRULES -- Number of rules. */
408 /* YYNRULES -- Number of states. */
409 #define YYNSTATES 148
411 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
413 #define YYMAXUTOK 312
415 #define YYTRANSLATE(YYX) \
416 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
418 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
419 static const yytype_uint8 yytranslate
[] =
421 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
447 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
448 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
449 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
450 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
451 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
456 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
458 static const yytype_uint16 yyprhs
[] =
460 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
461 24, 27, 29, 32, 35, 38, 42, 44, 47, 50,
462 53, 55, 58, 62, 64, 66, 69, 73, 76, 78,
463 81, 84, 86, 88, 90, 92, 94, 96, 99, 103,
464 107, 109, 111, 114, 118, 119, 121, 125, 126, 130,
465 131, 135, 139, 143, 145, 147, 149, 150, 152, 154,
466 157, 159, 162, 164, 167, 169, 172, 174, 176, 178,
467 180, 182, 184, 187, 190, 194, 196, 199, 201, 204,
468 206, 209, 212, 213, 218, 220, 224, 227, 228, 232,
469 236, 240, 244, 248, 249, 251, 253, 255, 256, 258,
470 260, 262, 264, 266, 268, 270, 272, 274, 275
473 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
474 static const yytype_int8 yyrhs
[] =
476 59, 0, -1, 60, 50, 77, 91, -1, -1, 60,
477 61, -1, 62, -1, 52, -1, 17, -1, 19, 84,
478 85, -1, 20, -1, 20, 3, -1, 21, -1, 22,
479 4, -1, 23, 4, -1, 24, 3, -1, 24, 47,
480 3, -1, 25, -1, 26, 43, -1, 27, 3, -1,
481 28, 43, -1, 29, -1, 30, 3, -1, 30, 47,
482 3, -1, 32, -1, 33, -1, 34, 3, -1, 34,
483 47, 3, -1, 35, 43, -1, 36, -1, 37, 3,
484 -1, 38, 3, -1, 40, -1, 41, -1, 42, -1,
485 53, -1, 67, -1, 64, -1, 39, 89, -1, 8,
486 43, 73, -1, 9, 43, 73, -1, 18, -1, 31,
487 -1, 16, 86, -1, 16, 48, 86, -1, -1, 48,
488 -1, 57, 63, 86, -1, -1, 6, 65, 76, -1,
489 -1, 5, 66, 76, -1, 7, 54, 72, -1, 68,
490 69, 70, -1, 10, -1, 11, -1, 12, -1, -1,
491 54, -1, 71, -1, 70, 71, -1, 89, -1, 89,
492 4, -1, 89, -1, 72, 89, -1, 74, -1, 73,
493 74, -1, 89, -1, 54, -1, 55, -1, 56, -1,
494 54, -1, 87, -1, 87, 4, -1, 87, 90, -1,
495 87, 4, 90, -1, 75, -1, 76, 75, -1, 78,
496 -1, 77, 78, -1, 79, -1, 62, 53, -1, 1,
497 53, -1, -1, 88, 83, 80, 81, -1, 82, -1,
498 81, 51, 82, -1, 81, 53, -1, -1, 82, 89,
499 83, -1, 82, 43, 83, -1, 82, 13, 89, -1,
500 82, 14, 4, -1, 82, 15, 54, -1, -1, 44,
501 -1, 48, -1, 3, -1, -1, 48, -1, 3, -1,
502 43, -1, 48, -1, 45, -1, 49, -1, 87, -1,
503 90, -1, 3, -1, -1, 50, 46, -1
506 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
507 static const yytype_uint16 yyrline
[] =
509 0, 229, 229, 237, 239, 243, 244, 254, 255, 260,
510 261, 266, 267, 268, 269, 270, 271, 276, 285, 286,
511 287, 288, 289, 290, 291, 292, 293, 294, 295, 310,
512 311, 335, 336, 337, 338, 342, 343, 344, 348, 355,
513 362, 366, 370, 377, 392, 393, 397, 409, 409, 414,
514 414, 419, 430, 445, 446, 447, 451, 452, 457, 459,
515 464, 465, 470, 472, 477, 478, 482, 483, 484, 485,
516 490, 495, 500, 506, 512, 523, 524, 533, 534, 540,
517 541, 542, 549, 549, 557, 558, 559, 564, 566, 568,
518 570, 572, 574, 579, 581, 592, 593, 598, 599, 600,
519 609, 629, 631, 640, 645, 646, 651, 658, 660
523 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
524 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
525 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
526 static const char *const yytname
[] =
528 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
529 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
530 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"",
531 "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"",
532 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
533 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
534 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
535 "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"",
536 "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"",
537 "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"",
538 "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
539 "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"", "\"=\"",
540 "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"",
541 "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept",
542 "input", "prologue_declarations", "prologue_declaration",
543 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
544 "precedence_declaration", "precedence_declarator", "type.opt",
545 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
546 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
547 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
548 "named_ref.opt", "variable", "content.opt", "braceless", "id",
549 "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
554 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
556 static const yytype_uint16 yytoknum
[] =
558 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
559 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
560 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
561 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
562 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
563 305, 306, 307, 308, 309, 310, 311, 312
567 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
568 static const yytype_uint8 yyr1
[] =
570 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
571 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
572 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
573 61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
574 62, 62, 62, 62, 63, 63, 62, 65, 64, 66,
575 64, 64, 67, 68, 68, 68, 69, 69, 70, 70,
576 71, 71, 72, 72, 73, 73, 74, 74, 74, 74,
577 75, 75, 75, 75, 75, 76, 76, 77, 77, 78,
578 78, 78, 80, 79, 81, 81, 81, 82, 82, 82,
579 82, 82, 82, 83, 83, 84, 84, 85, 85, 85,
580 86, 87, 87, 88, 89, 89, 90, 91, 91
583 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
584 static const yytype_uint8 yyr2
[] =
586 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
587 2, 1, 2, 2, 2, 3, 1, 2, 2, 2,
588 1, 2, 3, 1, 1, 2, 3, 2, 1, 2,
589 2, 1, 1, 1, 1, 1, 1, 2, 3, 3,
590 1, 1, 2, 3, 0, 1, 3, 0, 3, 0,
591 3, 3, 3, 1, 1, 1, 0, 1, 1, 2,
592 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
593 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
594 2, 2, 0, 4, 1, 3, 2, 0, 3, 3,
595 3, 3, 3, 0, 1, 1, 1, 0, 1, 1,
596 1, 1, 1, 1, 1, 1, 1, 0, 2
599 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
600 Performed when YYTABLE doesn't specify something else to do. Zero
601 means the default is an error. */
602 static const yytype_uint8 yydefact
[] =
604 3, 0, 0, 1, 49, 47, 0, 0, 0, 53,
605 54, 55, 0, 7, 40, 0, 9, 11, 0, 0,
606 0, 16, 0, 0, 0, 20, 0, 41, 23, 24,
607 0, 0, 28, 0, 0, 0, 31, 32, 33, 0,
608 6, 34, 44, 4, 5, 36, 35, 56, 0, 0,
609 0, 0, 0, 100, 0, 42, 96, 95, 97, 10,
610 12, 13, 14, 0, 17, 18, 19, 21, 0, 25,
611 0, 27, 29, 30, 106, 102, 101, 104, 37, 105,
612 0, 103, 0, 0, 77, 79, 93, 45, 0, 57,
613 0, 70, 75, 50, 71, 48, 51, 62, 67, 68,
614 69, 38, 64, 66, 39, 43, 99, 98, 8, 15,
615 22, 26, 81, 80, 0, 78, 2, 94, 82, 46,
616 52, 58, 60, 76, 72, 73, 63, 65, 108, 87,
617 59, 61, 74, 83, 84, 87, 86, 0, 0, 0,
618 93, 93, 85, 90, 91, 92, 89, 88
621 /* YYDEFGOTO[NTERM-NUM]. */
622 static const yytype_int16 yydefgoto
[] =
624 -1, 1, 2, 43, 82, 88, 45, 49, 48, 46,
625 47, 90, 120, 121, 96, 101, 102, 92, 93, 83,
626 84, 85, 129, 133, 134, 118, 58, 108, 55, 77,
630 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
632 #define YYPACT_NINF -91
633 static const yytype_int16 yypact
[] =
635 -91, 3, 103, -91, -91, -91, -36, 2, 10, -91,
636 -91, -91, 9, -91, -91, 32, 60, -91, 65, 67,
637 27, -91, 41, 73, 51, -91, 39, -91, -91, -91,
638 40, 52, -91, 93, 95, 33, -91, -91, -91, 15,
639 -91, -91, 53, -91, -91, -91, -91, 46, 43, 43,
640 33, 11, 11, -91, 61, -91, -91, -91, 35, -91,
641 -91, -91, -91, 100, -91, -91, -91, -91, 102, -91,
642 113, -91, -91, -91, -91, -91, -91, -91, -91, -91,
643 64, -91, 94, 1, -91, -91, 62, -91, 61, -91,
644 33, -91, -91, 43, 86, 43, 33, -91, -91, -91,
645 -91, 11, -91, -91, 11, -91, -91, -91, -91, -91,
646 -91, -91, -91, -91, 72, -91, -91, -91, -91, -91,
647 33, -91, 142, -91, 145, -91, -91, -91, -91, -91,
648 -91, -91, -91, 17, 34, -91, -91, 33, 146, 97,
649 62, 62, 34, -91, -91, -91, -91, -91
652 /* YYPGOTO[NTERM-NUM]. */
653 static const yytype_int16 yypgoto
[] =
655 -91, -91, -91, -91, 147, -91, -91, -91, -91, -91,
656 -91, -91, -91, 37, -91, 106, -60, -33, 105, -91,
657 69, -91, -91, -91, 24, -48, -91, -91, -49, -20,
661 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
662 positive, shift that token. If negative, reduce the rule which
663 number is the opposite. If YYTABLE_NINF, syntax error. */
664 #define YYTABLE_NINF -108
665 static const yytype_int16 yytable
[] =
667 78, -107, 80, 3, 125, 105, 4, 5, 6, 7,
668 8, 9, 10, 11, 74, 97, 80, 12, 50, 14,
669 4, 5, 6, 7, 8, 9, 10, 11, 94, 94,
670 62, 12, 27, 14, 132, 56, 74, 74, 106, 119,
671 35, 127, 67, 69, 127, 51, 27, 137, 138, 139,
672 81, 114, 53, 52, 35, 122, 75, 54, 42, 76,
673 123, 126, 123, 59, 81, 98, 99, 100, 135, 60,
674 136, 61, 42, 94, 63, 94, 65, 140, 75, 75,
675 57, 76, 76, 107, 64, 122, 68, 70, 75, 74,
676 124, 76, 146, 147, 66, 71, 72, 91, 73, 141,
677 89, 87, 143, 109, 53, 110, 117, 141, 4, 5,
678 6, 7, 8, 9, 10, 11, 111, 112, 128, 12,
679 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
680 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
681 33, 34, 35, 36, 37, 38, 131, 113, 74, 44,
682 144, 145, 115, 39, 95, 40, 41, 130, 104, 142,
686 #define yypact_value_is_default(yystate) \
689 #define yytable_value_is_error(yytable_value) \
692 static const yytype_uint8 yycheck
[] =
694 35, 0, 1, 0, 94, 54, 5, 6, 7, 8,
695 9, 10, 11, 12, 3, 50, 1, 16, 54, 18,
696 5, 6, 7, 8, 9, 10, 11, 12, 48, 49,
697 3, 16, 31, 18, 124, 3, 3, 3, 3, 88,
698 39, 101, 3, 3, 104, 43, 31, 13, 14, 15,
699 49, 50, 43, 43, 39, 90, 45, 48, 57, 48,
700 93, 96, 95, 3, 49, 54, 55, 56, 51, 4,
701 53, 4, 57, 93, 47, 95, 3, 43, 45, 45,
702 48, 48, 48, 48, 43, 120, 47, 47, 45, 3,
703 4, 48, 140, 141, 43, 43, 3, 54, 3, 134,
704 54, 48, 137, 3, 43, 3, 44, 142, 5, 6,
705 7, 8, 9, 10, 11, 12, 3, 53, 46, 16,
706 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
707 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
708 37, 38, 39, 40, 41, 42, 4, 53, 3, 2,
709 4, 54, 83, 50, 49, 52, 53, 120, 52, 135,
713 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
714 symbol of state STATE-NUM. */
715 static const yytype_uint8 yystos
[] =
717 0, 59, 60, 0, 5, 6, 7, 8, 9, 10,
718 11, 12, 16, 17, 18, 19, 20, 21, 22, 23,
719 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
720 34, 35, 36, 37, 38, 39, 40, 41, 42, 50,
721 52, 53, 57, 61, 62, 64, 67, 68, 66, 65,
722 54, 43, 43, 43, 48, 86, 3, 48, 84, 3,
723 4, 4, 3, 47, 43, 3, 43, 3, 47, 3,
724 47, 43, 3, 3, 3, 45, 48, 87, 89, 90,
725 1, 49, 62, 77, 78, 79, 88, 48, 63, 54,
726 69, 54, 75, 76, 87, 76, 72, 89, 54, 55,
727 56, 73, 74, 89, 73, 86, 3, 48, 85, 3,
728 3, 3, 53, 53, 50, 78, 91, 44, 83, 86,
729 70, 71, 89, 75, 4, 90, 89, 74, 46, 80,
730 71, 4, 90, 81, 82, 51, 53, 13, 14, 15,
731 43, 89, 82, 89, 4, 54, 83, 83
734 #define yyerrok (yyerrstatus = 0)
735 #define yyclearin (yychar = YYEMPTY)
739 #define YYACCEPT goto yyacceptlab
740 #define YYABORT goto yyabortlab
741 #define YYERROR goto yyerrorlab
744 /* Like YYERROR except do call yyerror. This remains here temporarily
745 to ease the transition to the new meaning of YYERROR, for GCC.
746 Once GCC version 2 has supplanted version 1, this can go. However,
747 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
748 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
751 #define YYFAIL goto yyerrlab
753 /* This is here to suppress warnings from the GCC cpp's
754 -Wunused-macros. Normally we don't worry about that warning, but
755 some users do, and we want to make it easy for users to remove
756 YYFAIL uses, which will produce warnings from Bison 2.5. */
759 #define YYRECOVERING() (!!yyerrstatus)
761 #define YYBACKUP(Token, Value) \
763 if (yychar == YYEMPTY) \
767 YYPOPSTACK (yylen); \
769 YY_LAC_DISCARD ("YYBACKUP"); \
774 yyerror (YY_("syntax error: cannot back up")); \
781 #define YYERRCODE 256
784 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
785 If N is 0, then set CURRENT to the empty location which ends
786 the previous symbol: RHS[0] (always defined). */
788 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
789 #ifndef YYLLOC_DEFAULT
790 # define YYLLOC_DEFAULT(Current, Rhs, N) \
794 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
795 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
796 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
797 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
801 (Current).first_line = (Current).last_line = \
802 YYRHSLOC (Rhs, 0).last_line; \
803 (Current).first_column = (Current).last_column = \
804 YYRHSLOC (Rhs, 0).last_column; \
810 /* YY_LOCATION_PRINT -- Print the location on the stream.
811 This macro was not mandated originally: define only if we know
812 we won't break user code: when these are the locations we know. */
814 #ifndef YY_LOCATION_PRINT
815 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
816 # define YY_LOCATION_PRINT(File, Loc) \
817 fprintf (File, "%d.%d-%d.%d", \
818 (Loc).first_line, (Loc).first_column, \
819 (Loc).last_line, (Loc).last_column)
821 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
826 /* YYLEX -- calling `yylex' with the right arguments. */
829 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
831 # define YYLEX yylex (&yylval, &yylloc)
834 /* Enable debugging if requested. */
838 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
839 # define YYFPRINTF fprintf
842 # define YYDPRINTF(Args) \
848 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
852 YYFPRINTF (stderr, "%s ", Title); \
853 yy_symbol_print (stderr, \
854 Type, Value, Location); \
855 YYFPRINTF (stderr, "\n"); \
860 /*--------------------------------.
861 | Print this symbol on YYOUTPUT. |
862 `--------------------------------*/
865 #if (defined __STDC__ || defined __C99__FUNC__ \
866 || defined __cplusplus || defined _MSC_VER)
868 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
871 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
874 YYSTYPE
const * const yyvaluep
;
875 YYLTYPE
const * const yylocationp
;
878 FILE *yyo
= yyoutput
;
884 if (yytype
< YYNTOKENS
)
885 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
891 case 3: /* "\"string\"" */
893 /* Line 822 of yacc.c */
894 #line 204 "parse-gram.y"
895 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
897 /* Line 822 of yacc.c */
898 #line 899 "parse-gram.c"
900 case 4: /* "\"integer\"" */
902 /* Line 822 of yacc.c */
903 #line 216 "parse-gram.y"
904 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
906 /* Line 822 of yacc.c */
907 #line 908 "parse-gram.c"
909 case 43: /* "\"{...}\"" */
911 /* Line 822 of yacc.c */
912 #line 206 "parse-gram.y"
913 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->code
)); };
915 /* Line 822 of yacc.c */
916 #line 917 "parse-gram.c"
918 case 44: /* "\"[identifier]\"" */
920 /* Line 822 of yacc.c */
921 #line 211 "parse-gram.y"
922 { fprintf (stderr
, "[%s]", (yyvaluep
->uniqstr
)); };
924 /* Line 822 of yacc.c */
925 #line 926 "parse-gram.c"
927 case 45: /* "\"char\"" */
929 /* Line 822 of yacc.c */
930 #line 198 "parse-gram.y"
931 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
933 /* Line 822 of yacc.c */
934 #line 935 "parse-gram.c"
936 case 46: /* "\"epilogue\"" */
938 /* Line 822 of yacc.c */
939 #line 206 "parse-gram.y"
940 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
942 /* Line 822 of yacc.c */
943 #line 944 "parse-gram.c"
945 case 48: /* "\"identifier\"" */
947 /* Line 822 of yacc.c */
948 #line 210 "parse-gram.y"
949 { fputs ((yyvaluep
->uniqstr
), stderr
); };
951 /* Line 822 of yacc.c */
952 #line 953 "parse-gram.c"
954 case 49: /* "\"identifier:\"" */
956 /* Line 822 of yacc.c */
957 #line 212 "parse-gram.y"
958 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
960 /* Line 822 of yacc.c */
961 #line 962 "parse-gram.c"
963 case 52: /* "\"%{...%}\"" */
965 /* Line 822 of yacc.c */
966 #line 206 "parse-gram.y"
967 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
969 /* Line 822 of yacc.c */
970 #line 971 "parse-gram.c"
972 case 54: /* "\"type\"" */
974 /* Line 822 of yacc.c */
975 #line 213 "parse-gram.y"
976 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
978 /* Line 822 of yacc.c */
979 #line 980 "parse-gram.c"
981 case 71: /* "symbol.prec" */
983 /* Line 822 of yacc.c */
984 #line 219 "parse-gram.y"
985 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
987 /* Line 822 of yacc.c */
988 #line 989 "parse-gram.c"
990 case 84: /* "variable" */
992 /* Line 822 of yacc.c */
993 #line 210 "parse-gram.y"
994 { fputs ((yyvaluep
->uniqstr
), stderr
); };
996 /* Line 822 of yacc.c */
997 #line 998 "parse-gram.c"
999 case 85: /* "content.opt" */
1001 /* Line 822 of yacc.c */
1002 #line 206 "parse-gram.y"
1003 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1005 /* Line 822 of yacc.c */
1006 #line 1007 "parse-gram.c"
1008 case 86: /* "braceless" */
1010 /* Line 822 of yacc.c */
1011 #line 206 "parse-gram.y"
1012 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1014 /* Line 822 of yacc.c */
1015 #line 1016 "parse-gram.c"
1019 /* Line 822 of yacc.c */
1020 #line 219 "parse-gram.y"
1021 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1023 /* Line 822 of yacc.c */
1024 #line 1025 "parse-gram.c"
1026 case 88: /* "id_colon" */
1028 /* Line 822 of yacc.c */
1029 #line 220 "parse-gram.y"
1030 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1032 /* Line 822 of yacc.c */
1033 #line 1034 "parse-gram.c"
1035 case 89: /* "symbol" */
1037 /* Line 822 of yacc.c */
1038 #line 219 "parse-gram.y"
1039 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1041 /* Line 822 of yacc.c */
1042 #line 1043 "parse-gram.c"
1044 case 90: /* "string_as_id" */
1046 /* Line 822 of yacc.c */
1047 #line 219 "parse-gram.y"
1048 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1050 /* Line 822 of yacc.c */
1051 #line 1052 "parse-gram.c"
1059 /*--------------------------------.
1060 | Print this symbol on YYOUTPUT. |
1061 `--------------------------------*/
1063 #if (defined __STDC__ || defined __C99__FUNC__ \
1064 || defined __cplusplus || defined _MSC_VER)
1066 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1069 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1072 YYSTYPE
const * const yyvaluep
;
1073 YYLTYPE
const * const yylocationp
;
1076 if (yytype
< YYNTOKENS
)
1077 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1079 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1081 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1082 YYFPRINTF (yyoutput
, ": ");
1083 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1084 YYFPRINTF (yyoutput
, ")");
1087 /*------------------------------------------------------------------.
1088 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1090 `------------------------------------------------------------------*/
1092 #if (defined __STDC__ || defined __C99__FUNC__ \
1093 || defined __cplusplus || defined _MSC_VER)
1095 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1098 yy_stack_print (yybottom
, yytop
)
1099 yytype_int16
*yybottom
;
1100 yytype_int16
*yytop
;
1103 YYFPRINTF (stderr
, "Stack now");
1104 for (; yybottom
<= yytop
; yybottom
++)
1106 int yybot
= *yybottom
;
1107 YYFPRINTF (stderr
, " %d", yybot
);
1109 YYFPRINTF (stderr
, "\n");
1112 # define YY_STACK_PRINT(Bottom, Top) \
1115 yy_stack_print ((Bottom), (Top)); \
1119 /*------------------------------------------------.
1120 | Report that the YYRULE is going to be reduced. |
1121 `------------------------------------------------*/
1123 #if (defined __STDC__ || defined __C99__FUNC__ \
1124 || defined __cplusplus || defined _MSC_VER)
1126 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1129 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1135 int yynrhs
= yyr2
[yyrule
];
1137 unsigned long int yylno
= yyrline
[yyrule
];
1138 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1140 /* The symbols being reduced. */
1141 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1143 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1144 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1145 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1146 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1147 YYFPRINTF (stderr
, "\n");
1151 # define YY_REDUCE_PRINT(Rule) \
1154 yy_reduce_print (yyvsp, yylsp, Rule); \
1157 /* Nonzero means print parse trace. It is left uninitialized so that
1158 multiple parsers can coexist. */
1160 #else /* !YYDEBUG */
1161 # define YYDPRINTF(Args)
1162 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1163 # define YY_STACK_PRINT(Bottom, Top)
1164 # define YY_REDUCE_PRINT(Rule)
1165 #endif /* !YYDEBUG */
1168 /* YYINITDEPTH -- initial size of the parser's stacks. */
1170 # define YYINITDEPTH 200
1173 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1174 if the built-in stack extension method is used).
1176 Do not make this value too large; the results are undefined if
1177 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1178 evaluated with infinite-precision integer arithmetic. */
1181 # define YYMAXDEPTH 10000
1184 /* Given a state stack such that *YYBOTTOM is its bottom, such that
1185 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1186 stack, and such that *YYCAPACITY is the maximum number of elements it
1187 can hold without a reallocation, make sure there is enough room to
1188 store YYADD more elements. If not, allocate a new stack using
1189 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1190 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1191 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1192 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1193 required. Return 1 if memory is exhausted. */
1195 yy_lac_stack_realloc (YYSIZE_T
*yycapacity
, YYSIZE_T yyadd
,
1197 char const *yydebug_prefix
,
1198 char const *yydebug_suffix
,
1200 yytype_int16
**yybottom
,
1201 yytype_int16
*yybottom_no_free
,
1202 yytype_int16
**yytop
, yytype_int16
*yytop_empty
)
1204 YYSIZE_T yysize_old
=
1205 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1206 YYSIZE_T yysize_new
= yysize_old
+ yyadd
;
1207 if (*yycapacity
< yysize_new
)
1209 YYSIZE_T yyalloc
= 2 * yysize_new
;
1210 yytype_int16
*yybottom_new
;
1211 /* Use YYMAXDEPTH for maximum stack size given that the stack
1212 should never need to grow larger than the main state stack
1213 needs to grow without LAC. */
1214 if (YYMAXDEPTH
< yysize_new
)
1216 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1220 if (YYMAXDEPTH
< yyalloc
)
1221 yyalloc
= YYMAXDEPTH
;
1223 (yytype_int16
*) YYSTACK_ALLOC (yyalloc
* sizeof *yybottom_new
);
1226 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1230 if (*yytop
!= yytop_empty
)
1232 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1233 *yytop
= yybottom_new
+ (yysize_old
- 1);
1235 if (*yybottom
!= yybottom_no_free
)
1236 YYSTACK_FREE (*yybottom
);
1237 *yybottom
= yybottom_new
;
1238 *yycapacity
= yyalloc
;
1243 /* Establish the initial context for the current lookahead if no initial
1244 context is currently established.
1246 We define a context as a snapshot of the parser stacks. We define
1247 the initial context for a lookahead as the context in which the
1248 parser initially examines that lookahead in order to select a
1249 syntactic action. Thus, if the lookahead eventually proves
1250 syntactically unacceptable (possibly in a later context reached via a
1251 series of reductions), the initial context can be used to determine
1252 the exact set of tokens that would be syntactically acceptable in the
1253 lookahead's place. Moreover, it is the context after which any
1254 further semantic actions would be erroneous because they would be
1255 determined by a syntactically unacceptable token.
1257 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1258 performed in an inconsistent state (which, for the purposes of LAC,
1259 includes consistent states that don't know they're consistent because
1260 their default reductions have been disabled). Iff there is a
1261 lookahead token, it should also be invoked before reporting a syntax
1262 error. This latter case is for the sake of the debugging output.
1264 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1265 follows. If no initial context is currently established for the
1266 current lookahead, then check if that lookahead can eventually be
1267 shifted if syntactic actions continue from the current context.
1268 Report a syntax error if it cannot. */
1269 #define YY_LAC_ESTABLISH \
1271 if (!yy_lac_established) \
1273 YYDPRINTF ((stderr, \
1274 "LAC: initial context established for %s\n", \
1275 yytname[yytoken])); \
1276 yy_lac_established = 1; \
1278 int yy_lac_status = \
1279 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1280 if (yy_lac_status == 2) \
1281 goto yyexhaustedlab; \
1282 if (yy_lac_status == 1) \
1288 /* Discard any previous initial lookahead context because of Event,
1289 which may be a lookahead change or an invalidation of the currently
1290 established initial context for the current lookahead.
1292 The most common example of a lookahead change is a shift. An example
1293 of both cases is syntax error recovery. That is, a syntax error
1294 occurs when the lookahead is syntactically erroneous for the
1295 currently established initial context, so error recovery manipulates
1296 the parser stacks to try to find a new initial context in which the
1297 current lookahead is syntactically acceptable. If it fails to find
1298 such a context, it discards the lookahead. */
1300 # define YY_LAC_DISCARD(Event) \
1302 if (yy_lac_established) \
1305 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1307 yy_lac_established = 0; \
1311 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1314 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1315 eventually (after perhaps some reductions) be shifted, return 1 if
1316 not, or return 2 if memory is exhausted. As preconditions and
1317 postconditions: *YYES_CAPACITY is the allocated size of the array to
1318 which *YYES points, and either *YYES = YYESA or *YYES points to an
1319 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1320 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1321 any old *YYES other than YYESA. */
1323 yy_lac (yytype_int16
*yyesa
, yytype_int16
**yyes
,
1324 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1326 yytype_int16
*yyes_prev
= yyssp
;
1327 yytype_int16
*yyesp
= yyes_prev
;
1328 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yytname
[yytoken
]));
1329 if (yytoken
== YYUNDEFTOK
)
1331 YYDPRINTF ((stderr
, " Always Err\n"));
1336 int yyrule
= yypact
[*yyesp
];
1337 if (yypact_value_is_default (yyrule
)
1338 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1339 || yycheck
[yyrule
] != yytoken
)
1341 yyrule
= yydefact
[*yyesp
];
1344 YYDPRINTF ((stderr
, " Err\n"));
1350 yyrule
= yytable
[yyrule
];
1351 if (yytable_value_is_error (yyrule
))
1353 YYDPRINTF ((stderr
, " Err\n"));
1358 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1364 YYSIZE_T yylen
= yyr2
[yyrule
];
1365 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1366 if (yyesp
!= yyes_prev
)
1368 YYSIZE_T yysize
= yyesp
- *yyes
+ 1;
1381 yyesp
= yyes_prev
-= yylen
;
1386 int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1387 yystate
= yypgoto
[yylhs
] + *yyesp
;
1388 if (yystate
< 0 || YYLAST
< yystate
1389 || yycheck
[yystate
] != *yyesp
)
1390 yystate
= yydefgoto
[yylhs
];
1392 yystate
= yytable
[yystate
];
1394 if (yyesp
== yyes_prev
)
1401 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1405 yyes
, yyesa
, &yyesp
, yyes_prev
))
1407 YYDPRINTF ((stderr
, "\n"));
1412 YYDPRINTF ((stderr
, " G%d", yystate
));
1421 # if defined __GLIBC__ && defined _STRING_H
1422 # define yystrlen strlen
1424 /* Return the length of YYSTR. */
1425 #if (defined __STDC__ || defined __C99__FUNC__ \
1426 || defined __cplusplus || defined _MSC_VER)
1428 yystrlen (const char *yystr
)
1436 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1444 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1445 # define yystpcpy stpcpy
1447 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1449 #if (defined __STDC__ || defined __C99__FUNC__ \
1450 || defined __cplusplus || defined _MSC_VER)
1452 yystpcpy (char *yydest
, const char *yysrc
)
1455 yystpcpy (yydest
, yysrc
)
1461 const char *yys
= yysrc
;
1463 while ((*yyd
++ = *yys
++) != '\0')
1472 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1473 quotes and backslashes, so that it's suitable for yyerror. The
1474 heuristic is that double-quoting is unnecessary unless the string
1475 contains an apostrophe, a comma, or backslash (other than
1476 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1477 null, do not copy; instead, return the length of what the result
1480 yytnamerr (char *yyres
, const char *yystr
)
1485 char const *yyp
= yystr
;
1492 goto do_not_strip_quotes
;
1496 goto do_not_strip_quotes
;
1509 do_not_strip_quotes
: ;
1513 return yystrlen (yystr
);
1515 return yystpcpy (yyres
, yystr
) - yyres
;
1519 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1520 about the unexpected token YYTOKEN for the state stack whose top is
1521 YYSSP. In order to see if a particular token T is a
1522 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
1524 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1525 not large enough to hold the message. In that case, also set
1526 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1527 required number of bytes is too large to store or if
1528 yy_lac returned 2. */
1530 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1531 yytype_int16
*yyesa
, yytype_int16
**yyes
,
1532 YYSIZE_T
*yyes_capacity
, yytype_int16
*yyssp
, int yytoken
)
1534 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1535 YYSIZE_T yysize
= yysize0
;
1537 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1538 /* Internationalized format string. */
1539 const char *yyformat
= YY_NULL
;
1540 /* Arguments of yyformat. */
1541 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1542 /* Number of reported tokens (one for the "unexpected", one per
1546 /* There are many possibilities here to consider:
1547 - Assume YYFAIL is not used. It's too flawed to consider. See
1548 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1549 for details. YYERROR is fine as it does not invoke this
1551 - If this state is a consistent state with a default action, then
1552 the only way this function was invoked is if the default action
1553 is an error action. In that case, don't check for expected
1554 tokens because there are none.
1555 - The only way there can be no lookahead present (in yychar) is if
1556 this state is a consistent state with a default action. Thus,
1557 detecting the absence of a lookahead is sufficient to determine
1558 that there is no unexpected or expected token to report. In that
1559 case, just report a simple "syntax error".
1560 - Don't assume there isn't a lookahead just because this state is a
1561 consistent state with a default action. There might have been a
1562 previous inconsistent state, consistent state with a non-default
1563 action, or user semantic action that manipulated yychar.
1564 In the first two cases, it might appear that the current syntax
1565 error should have been detected in the previous state when yy_lac
1566 was invoked. However, at that time, there might have been a
1567 different syntax error that discarded a different initial context
1568 during error recovery, leaving behind the current lookahead.
1570 if (yytoken
!= YYEMPTY
)
1572 int yyn
= yypact
[*yyssp
];
1573 YYDPRINTF ((stderr
, "Constructing syntax error message\n"));
1574 yyarg
[yycount
++] = yytname
[yytoken
];
1575 if (!yypact_value_is_default (yyn
))
1579 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1580 if (yyx
!= YYTERROR
&& yyx
!= YYUNDEFTOK
)
1583 int yy_lac_status
= yy_lac (yyesa
, yyes
, yyes_capacity
,
1585 if (yy_lac_status
== 2)
1587 if (yy_lac_status
== 1)
1590 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1596 yyarg
[yycount
++] = yytname
[yyx
];
1597 yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1598 if (! (yysize
<= yysize1
1599 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1606 YYFPRINTF (stderr
, "No expected tokens.\n");
1612 # define YYCASE_(N, S) \
1616 YYCASE_(0, YY_("syntax error"));
1617 YYCASE_(1, YY_("syntax error, unexpected %s"));
1618 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1619 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1620 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1621 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1625 yysize1
= yysize
+ yystrlen (yyformat
);
1626 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1630 if (*yymsg_alloc
< yysize
)
1632 *yymsg_alloc
= 2 * yysize
;
1633 if (! (yysize
<= *yymsg_alloc
1634 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1635 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1639 /* Avoid sprintf, as that infringes on the user's name space.
1640 Don't have undefined behavior even if the translation
1641 produced a string with the wrong number of "%s"s. */
1645 while ((*yyp
= *yyformat
) != '\0')
1646 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1648 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1659 #endif /* YYERROR_VERBOSE */
1661 /*-----------------------------------------------.
1662 | Release the memory associated to this symbol. |
1663 `-----------------------------------------------*/
1666 #if (defined __STDC__ || defined __C99__FUNC__ \
1667 || defined __cplusplus || defined _MSC_VER)
1669 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1672 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1676 YYLTYPE
*yylocationp
;
1680 YYUSE (yylocationp
);
1684 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1701 #ifdef YYPARSE_PARAM
1702 #if (defined __STDC__ || defined __C99__FUNC__ \
1703 || defined __cplusplus || defined _MSC_VER)
1705 yyparse (void *YYPARSE_PARAM
)
1708 yyparse (YYPARSE_PARAM
)
1709 void *YYPARSE_PARAM
;
1711 #else /* ! YYPARSE_PARAM */
1712 #if (defined __STDC__ || defined __C99__FUNC__ \
1713 || defined __cplusplus || defined _MSC_VER)
1723 /* The lookahead symbol. */
1726 /* The semantic value of the lookahead symbol. */
1729 /* Location data for the lookahead symbol. */
1732 /* Number of syntax errors so far. */
1736 /* Number of tokens to shift before error messages enabled. */
1739 /* The stacks and their tools:
1740 `yyss': related to states.
1741 `yyvs': related to semantic values.
1742 `yyls': related to locations.
1744 Refer to the stacks through separate pointers, to allow yyoverflow
1745 to reallocate them elsewhere. */
1747 /* The state stack. */
1748 yytype_int16 yyssa
[YYINITDEPTH
];
1750 yytype_int16
*yyssp
;
1752 /* The semantic value stack. */
1753 YYSTYPE yyvsa
[YYINITDEPTH
];
1757 /* The location stack. */
1758 YYLTYPE yylsa
[YYINITDEPTH
];
1762 /* The locations where the error started and ended. */
1763 YYLTYPE yyerror_range
[3];
1765 YYSIZE_T yystacksize
;
1767 yytype_int16 yyesa
[20];
1769 YYSIZE_T yyes_capacity
;
1771 int yy_lac_established
= 0;
1774 /* Lookahead token as an internal (translated) token number. */
1776 /* The variables used to return semantic value and location from the
1782 /* Buffer for error messages, and its allocated size. */
1784 char *yymsg
= yymsgbuf
;
1785 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1788 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1790 /* The number of symbols on the RHS of the reduced rule.
1791 Keep to zero when no symbol should be popped. */
1798 yystacksize
= YYINITDEPTH
;
1801 yyes_capacity
= sizeof yyesa
/ sizeof *yyes
;
1802 if (YYMAXDEPTH
< yyes_capacity
)
1803 yyes_capacity
= YYMAXDEPTH
;
1805 YYDPRINTF ((stderr
, "Starting parse\n"));
1810 yychar
= YYEMPTY
; /* Cause a token to be read. */
1812 /* Initialize stack pointers.
1813 Waste one element of value and location stack
1814 so that they stay on the same level as the state stack.
1815 The wasted elements are never initialized. */
1820 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1821 /* Initialize the default location before parsing starts. */
1822 yylloc
.first_line
= yylloc
.last_line
= 1;
1823 yylloc
.first_column
= yylloc
.last_column
= 1;
1826 /* User initialization code. */
1828 /* Line 1585 of yacc.c */
1829 #line 106 "parse-gram.y"
1831 /* Bison's grammar can initial empty locations, hence a default
1832 location is needed. */
1833 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1834 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1837 /* Line 1585 of yacc.c */
1838 #line 1839 "parse-gram.c"
1843 /*------------------------------------------------------------.
1844 | yynewstate -- Push a new state, which is found in yystate. |
1845 `------------------------------------------------------------*/
1847 /* In all cases, when you get here, the value and location stacks
1848 have just been pushed. So pushing a state here evens the stacks. */
1854 if (yyss
+ yystacksize
- 1 <= yyssp
)
1856 /* Get the current used size of the three stacks, in elements. */
1857 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1861 /* Give user a chance to reallocate the stack. Use copies of
1862 these so that the &'s don't force the real ones into
1864 YYSTYPE
*yyvs1
= yyvs
;
1865 yytype_int16
*yyss1
= yyss
;
1866 YYLTYPE
*yyls1
= yyls
;
1868 /* Each stack pointer address is followed by the size of the
1869 data in use in that stack, in bytes. This used to be a
1870 conditional around just the two extra args, but that might
1871 be undefined if yyoverflow is a macro. */
1872 yyoverflow (YY_("memory exhausted"),
1873 &yyss1
, yysize
* sizeof (*yyssp
),
1874 &yyvs1
, yysize
* sizeof (*yyvsp
),
1875 &yyls1
, yysize
* sizeof (*yylsp
),
1882 #else /* no yyoverflow */
1883 # ifndef YYSTACK_RELOCATE
1884 goto yyexhaustedlab
;
1886 /* Extend the stack our own way. */
1887 if (YYMAXDEPTH
<= yystacksize
)
1888 goto yyexhaustedlab
;
1890 if (YYMAXDEPTH
< yystacksize
)
1891 yystacksize
= YYMAXDEPTH
;
1894 yytype_int16
*yyss1
= yyss
;
1895 union yyalloc
*yyptr
=
1896 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1898 goto yyexhaustedlab
;
1899 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1900 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1901 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1902 # undef YYSTACK_RELOCATE
1904 YYSTACK_FREE (yyss1
);
1907 #endif /* no yyoverflow */
1909 yyssp
= yyss
+ yysize
- 1;
1910 yyvsp
= yyvs
+ yysize
- 1;
1911 yylsp
= yyls
+ yysize
- 1;
1913 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1914 (unsigned long int) yystacksize
));
1916 if (yyss
+ yystacksize
- 1 <= yyssp
)
1920 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1922 if (yystate
== YYFINAL
)
1932 /* Do appropriate processing given the current state. Read a
1933 lookahead token if we need one and don't already have one. */
1935 /* First try to decide what to do without reference to lookahead token. */
1936 yyn
= yypact
[yystate
];
1937 if (yypact_value_is_default (yyn
))
1940 /* Not known => get a lookahead token if don't already have one. */
1942 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1943 if (yychar
== YYEMPTY
)
1945 YYDPRINTF ((stderr
, "Reading a token: "));
1949 if (yychar
<= YYEOF
)
1951 yychar
= yytoken
= YYEOF
;
1952 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1956 yytoken
= YYTRANSLATE (yychar
);
1957 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1960 /* If the proper action on seeing token YYTOKEN is to reduce or to
1961 detect an error, take that action. */
1963 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1971 if (yytable_value_is_error (yyn
))
1978 /* Count tokens shifted since error; after three, turn off error
1983 /* Shift the lookahead token. */
1984 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1986 /* Discard the shifted token. */
1988 YY_LAC_DISCARD ("shift");
1996 /*-----------------------------------------------------------.
1997 | yydefault -- do the default action for the current state. |
1998 `-----------------------------------------------------------*/
2000 yyn
= yydefact
[yystate
];
2006 /*-----------------------------.
2007 | yyreduce -- Do a reduction. |
2008 `-----------------------------*/
2010 /* yyn is the number of a rule to reduce with. */
2013 /* If YYLEN is nonzero, implement the default value of the action:
2016 Otherwise, the following line sets YYVAL to garbage.
2017 This behavior is undocumented and Bison
2018 users should not rely upon it. Assigning to YYVAL
2019 unconditionally makes the parser a bit smaller, and it avoids a
2020 GCC warning that YYVAL may be used uninitialized. */
2021 yyval
= yyvsp
[1-yylen
];
2023 /* Default location. */
2024 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2025 YY_REDUCE_PRINT (yyn
);
2027 int yychar_backup
= yychar
;
2032 /* Line 1801 of yacc.c */
2033 #line 245 "parse-gram.y"
2035 code_props plain_code
;
2036 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)]));
2037 code_props_translate_code (&plain_code
);
2038 gram_scanner_last_string_free ();
2039 muscle_code_grow (union_seen
? "post_prologue" : "pre_prologue",
2040 plain_code
.code
, (yylsp
[(1) - (1)]));
2041 code_scanner_last_string_free ();
2047 /* Line 1801 of yacc.c */
2048 #line 254 "parse-gram.y"
2049 { debug_flag
= true; }
2054 /* Line 1801 of yacc.c */
2055 #line 256 "parse-gram.y"
2057 muscle_percent_define_insert ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
),
2058 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2064 /* Line 1801 of yacc.c */
2065 #line 260 "parse-gram.y"
2066 { defines_flag
= true; }
2071 /* Line 1801 of yacc.c */
2072 #line 262 "parse-gram.y"
2074 defines_flag
= true;
2075 spec_defines_file
= xstrdup ((yyvsp
[(2) - (2)].chars
));
2081 /* Line 1801 of yacc.c */
2082 #line 266 "parse-gram.y"
2083 { error_verbose
= true; }
2088 /* Line 1801 of yacc.c */
2089 #line 267 "parse-gram.y"
2090 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2095 /* Line 1801 of yacc.c */
2096 #line 268 "parse-gram.y"
2097 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
2102 /* Line 1801 of yacc.c */
2103 #line 269 "parse-gram.y"
2104 { spec_file_prefix
= (yyvsp
[(2) - (2)].chars
); }
2109 /* Line 1801 of yacc.c */
2110 #line 270 "parse-gram.y"
2111 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
2116 /* Line 1801 of yacc.c */
2117 #line 272 "parse-gram.y"
2119 nondeterministic_parser
= true;
2126 /* Line 1801 of yacc.c */
2127 #line 277 "parse-gram.y"
2130 code_props_symbol_action_init (&action
, (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)]));
2131 code_props_translate_code (&action
);
2132 gram_scanner_last_string_free ();
2133 muscle_code_grow ("initial_action", action
.code
, (yylsp
[(2) - (2)]));
2134 code_scanner_last_string_free ();
2140 /* Line 1801 of yacc.c */
2141 #line 285 "parse-gram.y"
2142 { language_argmatch ((yyvsp
[(2) - (2)].chars
), grammar_prio
, (yylsp
[(1) - (2)])); }
2147 /* Line 1801 of yacc.c */
2148 #line 286 "parse-gram.y"
2149 { add_param ("lex_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2154 /* Line 1801 of yacc.c */
2155 #line 287 "parse-gram.y"
2156 { locations_flag
= true; }
2161 /* Line 1801 of yacc.c */
2162 #line 288 "parse-gram.y"
2163 { spec_name_prefix
= (yyvsp
[(2) - (2)].chars
); }
2168 /* Line 1801 of yacc.c */
2169 #line 289 "parse-gram.y"
2170 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
2175 /* Line 1801 of yacc.c */
2176 #line 290 "parse-gram.y"
2177 { no_lines_flag
= true; }
2182 /* Line 1801 of yacc.c */
2183 #line 291 "parse-gram.y"
2184 { nondeterministic_parser
= true; }
2189 /* Line 1801 of yacc.c */
2190 #line 292 "parse-gram.y"
2191 { spec_outfile
= (yyvsp
[(2) - (2)].chars
); }
2196 /* Line 1801 of yacc.c */
2197 #line 293 "parse-gram.y"
2198 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
2203 /* Line 1801 of yacc.c */
2204 #line 294 "parse-gram.y"
2205 { add_param ("parse_param", (yyvsp
[(2) - (2)].code
), (yylsp
[(2) - (2)])); }
2210 /* Line 1801 of yacc.c */
2211 #line 296 "parse-gram.y"
2213 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2214 `%define api.pure' in a backward-compatible manner here. First, don't
2215 complain if %pure-parser is specified multiple times. */
2216 if (!muscle_find_const ("percent_define(api.pure)"))
2217 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2218 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2219 /* In all cases, use api.pure now so that the backend doesn't complain if
2220 the skeleton ignores api.pure, but do warn now if there's a previous
2221 conflicting definition from an actual %define. */
2222 if (!muscle_percent_define_flag_if ("api.pure"))
2223 muscle_percent_define_insert ("api.pure", (yylsp
[(1) - (1)]), "",
2224 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
);
2230 /* Line 1801 of yacc.c */
2231 #line 310 "parse-gram.y"
2232 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
2237 /* Line 1801 of yacc.c */
2238 #line 312 "parse-gram.y"
2240 char const *skeleton_user
= (yyvsp
[(2) - (2)].chars
);
2241 if (mbschr (skeleton_user
, '/'))
2243 size_t dir_length
= strlen (current_file
);
2244 char *skeleton_build
;
2245 while (dir_length
&& current_file
[dir_length
- 1] != '/')
2247 while (dir_length
&& current_file
[dir_length
- 1] == '/')
2250 xmalloc (dir_length
+ 1 + strlen (skeleton_user
) + 1);
2253 memcpy (skeleton_build
, current_file
, dir_length
);
2254 skeleton_build
[dir_length
++] = '/';
2256 strcpy (skeleton_build
+ dir_length
, skeleton_user
);
2257 skeleton_user
= uniqstr_new (skeleton_build
);
2258 free (skeleton_build
);
2260 skeleton_arg (skeleton_user
, grammar_prio
, (yylsp
[(1) - (2)]));
2266 /* Line 1801 of yacc.c */
2267 #line 335 "parse-gram.y"
2268 { token_table_flag
= true; }
2273 /* Line 1801 of yacc.c */
2274 #line 336 "parse-gram.y"
2275 { report_flag
|= report_states
; }
2280 /* Line 1801 of yacc.c */
2281 #line 337 "parse-gram.y"
2282 { yacc_flag
= true; }
2287 /* Line 1801 of yacc.c */
2288 #line 345 "parse-gram.y"
2290 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2296 /* Line 1801 of yacc.c */
2297 #line 349 "parse-gram.y"
2300 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2301 symbol_list_destructor_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2302 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2308 /* Line 1801 of yacc.c */
2309 #line 356 "parse-gram.y"
2312 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2313 symbol_list_printer_set (list
, (yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]));
2314 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2320 /* Line 1801 of yacc.c */
2321 #line 363 "parse-gram.y"
2323 default_prec
= true;
2329 /* Line 1801 of yacc.c */
2330 #line 367 "parse-gram.y"
2332 default_prec
= false;
2338 /* Line 1801 of yacc.c */
2339 #line 371 "parse-gram.y"
2341 /* Do not invoke muscle_percent_code_grow here since it invokes
2342 muscle_user_name_list_grow. */
2343 muscle_code_grow ("percent_code()", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2344 code_scanner_last_string_free ();
2350 /* Line 1801 of yacc.c */
2351 #line 378 "parse-gram.y"
2353 muscle_percent_code_grow ((yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2354 code_scanner_last_string_free ();
2360 /* Line 1801 of yacc.c */
2361 #line 392 "parse-gram.y"
2367 /* Line 1801 of yacc.c */
2368 #line 393 "parse-gram.y"
2369 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2374 /* Line 1801 of yacc.c */
2375 #line 398 "parse-gram.y"
2378 muscle_code_grow ("stype", (yyvsp
[(3) - (3)].chars
), (yylsp
[(3) - (3)]));
2379 code_scanner_last_string_free ();
2385 /* Line 1801 of yacc.c */
2386 #line 409 "parse-gram.y"
2387 { current_class
= nterm_sym
; }
2392 /* Line 1801 of yacc.c */
2393 #line 410 "parse-gram.y"
2395 current_class
= unknown_sym
;
2396 current_type
= NULL
;
2402 /* Line 1801 of yacc.c */
2403 #line 414 "parse-gram.y"
2404 { current_class
= token_sym
; }
2409 /* Line 1801 of yacc.c */
2410 #line 415 "parse-gram.y"
2412 current_class
= unknown_sym
;
2413 current_type
= NULL
;
2419 /* Line 1801 of yacc.c */
2420 #line 420 "parse-gram.y"
2424 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2425 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2426 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2432 /* Line 1801 of yacc.c */
2433 #line 431 "parse-gram.y"
2437 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2439 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2440 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2442 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2443 current_type
= NULL
;
2449 /* Line 1801 of yacc.c */
2450 #line 445 "parse-gram.y"
2451 { (yyval
.assoc
) = left_assoc
; }
2456 /* Line 1801 of yacc.c */
2457 #line 446 "parse-gram.y"
2458 { (yyval
.assoc
) = right_assoc
; }
2463 /* Line 1801 of yacc.c */
2464 #line 447 "parse-gram.y"
2465 { (yyval
.assoc
) = non_assoc
; }
2470 /* Line 1801 of yacc.c */
2471 #line 451 "parse-gram.y"
2472 { current_type
= NULL
; }
2477 /* Line 1801 of yacc.c */
2478 #line 452 "parse-gram.y"
2479 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2484 /* Line 1801 of yacc.c */
2485 #line 458 "parse-gram.y"
2486 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2491 /* Line 1801 of yacc.c */
2492 #line 460 "parse-gram.y"
2493 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2498 /* Line 1801 of yacc.c */
2499 #line 464 "parse-gram.y"
2500 { (yyval
.symbol
) = (yyvsp
[(1) - (1)].symbol
); }
2505 /* Line 1801 of yacc.c */
2506 #line 465 "parse-gram.y"
2507 { (yyval
.symbol
) = (yyvsp
[(1) - (2)].symbol
); symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)])); }
2512 /* Line 1801 of yacc.c */
2513 #line 471 "parse-gram.y"
2514 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2519 /* Line 1801 of yacc.c */
2520 #line 473 "parse-gram.y"
2521 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2526 /* Line 1801 of yacc.c */
2527 #line 477 "parse-gram.y"
2528 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2533 /* Line 1801 of yacc.c */
2534 #line 478 "parse-gram.y"
2535 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2540 /* Line 1801 of yacc.c */
2541 #line 482 "parse-gram.y"
2542 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2547 /* Line 1801 of yacc.c */
2548 #line 483 "parse-gram.y"
2549 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2554 /* Line 1801 of yacc.c */
2555 #line 484 "parse-gram.y"
2556 { (yyval
.list
) = symbol_list_default_tagged_new ((yylsp
[(1) - (1)])); }
2561 /* Line 1801 of yacc.c */
2562 #line 485 "parse-gram.y"
2563 { (yyval
.list
) = symbol_list_default_tagless_new ((yylsp
[(1) - (1)])); }
2568 /* Line 1801 of yacc.c */
2569 #line 491 "parse-gram.y"
2571 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2578 /* Line 1801 of yacc.c */
2579 #line 496 "parse-gram.y"
2581 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2582 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2588 /* Line 1801 of yacc.c */
2589 #line 501 "parse-gram.y"
2591 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2592 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2593 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2599 /* Line 1801 of yacc.c */
2600 #line 507 "parse-gram.y"
2602 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2603 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2604 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2610 /* Line 1801 of yacc.c */
2611 #line 513 "parse-gram.y"
2613 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2614 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2615 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2616 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2622 /* Line 1801 of yacc.c */
2623 #line 543 "parse-gram.y"
2631 /* Line 1801 of yacc.c */
2632 #line 549 "parse-gram.y"
2633 { current_lhs ((yyvsp
[(1) - (2)].symbol
), (yylsp
[(1) - (2)]), (yyvsp
[(2) - (2)].named_ref
)); }
2638 /* Line 1801 of yacc.c */
2639 #line 550 "parse-gram.y"
2641 /* Free the current lhs. */
2642 current_lhs (0, (yylsp
[(1) - (4)]), 0);
2648 /* Line 1801 of yacc.c */
2649 #line 557 "parse-gram.y"
2650 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2655 /* Line 1801 of yacc.c */
2656 #line 558 "parse-gram.y"
2657 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2662 /* Line 1801 of yacc.c */
2663 #line 564 "parse-gram.y"
2664 { grammar_current_rule_begin (current_lhs_symbol
, current_lhs_location
,
2665 current_lhs_named_ref
); }
2670 /* Line 1801 of yacc.c */
2671 #line 567 "parse-gram.y"
2672 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (3)].symbol
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2677 /* Line 1801 of yacc.c */
2678 #line 569 "parse-gram.y"
2679 { grammar_current_rule_action_append ((yyvsp
[(2) - (3)].code
), (yylsp
[(2) - (3)]), (yyvsp
[(3) - (3)].named_ref
)); }
2684 /* Line 1801 of yacc.c */
2685 #line 571 "parse-gram.y"
2686 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2691 /* Line 1801 of yacc.c */
2692 #line 573 "parse-gram.y"
2693 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2698 /* Line 1801 of yacc.c */
2699 #line 575 "parse-gram.y"
2700 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2705 /* Line 1801 of yacc.c */
2706 #line 579 "parse-gram.y"
2707 { (yyval
.named_ref
) = 0; }
2712 /* Line 1801 of yacc.c */
2713 #line 581 "parse-gram.y"
2714 { (yyval
.named_ref
) = named_ref_new((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2719 /* Line 1801 of yacc.c */
2720 #line 593 "parse-gram.y"
2721 { (yyval
.uniqstr
) = uniqstr_new ((yyvsp
[(1) - (1)].chars
)); }
2726 /* Line 1801 of yacc.c */
2727 #line 598 "parse-gram.y"
2728 { (yyval
.chars
) = ""; }
2733 /* Line 1801 of yacc.c */
2734 #line 599 "parse-gram.y"
2735 { (yyval
.chars
) = (yyvsp
[(1) - (1)].uniqstr
); }
2740 /* Line 1801 of yacc.c */
2741 #line 610 "parse-gram.y"
2743 code_props plain_code
;
2744 (yyvsp
[(1) - (1)].code
)[strlen ((yyvsp
[(1) - (1)].code
)) - 1] = '\n';
2745 code_props_plain_init (&plain_code
, (yyvsp
[(1) - (1)].code
)+1, (yylsp
[(1) - (1)]));
2746 code_props_translate_code (&plain_code
);
2747 gram_scanner_last_string_free ();
2748 (yyval
.chars
) = plain_code
.code
;
2754 /* Line 1801 of yacc.c */
2755 #line 630 "parse-gram.y"
2756 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2761 /* Line 1801 of yacc.c */
2762 #line 632 "parse-gram.y"
2764 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2765 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2766 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2772 /* Line 1801 of yacc.c */
2773 #line 640 "parse-gram.y"
2774 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2779 /* Line 1801 of yacc.c */
2780 #line 652 "parse-gram.y"
2782 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2783 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2789 /* Line 1801 of yacc.c */
2790 #line 661 "parse-gram.y"
2792 code_props plain_code
;
2793 code_props_plain_init (&plain_code
, (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]));
2794 code_props_translate_code (&plain_code
);
2795 gram_scanner_last_string_free ();
2796 muscle_code_grow ("epilogue", plain_code
.code
, (yylsp
[(2) - (2)]));
2797 code_scanner_last_string_free ();
2803 /* Line 1801 of yacc.c */
2804 #line 2805 "parse-gram.c"
2807 if (yychar_backup
!= yychar
)
2808 YY_LAC_DISCARD ("yychar change");
2810 /* User semantic actions sometimes alter yychar, and that requires
2811 that yytoken be updated with the new translation. We take the
2812 approach of translating immediately before every use of yytoken.
2813 One alternative is translating here after every semantic action,
2814 but that translation would be missed if the semantic action invokes
2815 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2816 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2817 incorrect destructor might then be invoked immediately. In the
2818 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2819 to an incorrect destructor call or verbose syntax error message
2820 before the lookahead is translated. */
2821 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2825 YY_STACK_PRINT (yyss
, yyssp
);
2830 /* Now `shift' the result of the reduction. Determine what state
2831 that goes to, based on the state we popped back to and the rule
2832 number reduced by. */
2836 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2837 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2838 yystate
= yytable
[yystate
];
2840 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2845 /*------------------------------------.
2846 | yyerrlab -- here on detecting error |
2847 `------------------------------------*/
2849 /* Make sure we have latest lookahead translation. See comments at
2850 user semantic actions for why this is necessary. */
2851 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2853 /* If not already recovering from an error, report this error. */
2857 #if ! YYERROR_VERBOSE
2858 yyerror (YY_("syntax error"));
2860 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2861 yyesa, &yyes, &yyes_capacity, \
2864 char const *yymsgp
= YY_("syntax error");
2865 int yysyntax_error_status
;
2866 if (yychar
!= YYEMPTY
)
2868 yysyntax_error_status
= YYSYNTAX_ERROR
;
2869 if (yysyntax_error_status
== 0)
2871 else if (yysyntax_error_status
== 1)
2873 if (yymsg
!= yymsgbuf
)
2874 YYSTACK_FREE (yymsg
);
2875 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2879 yymsg_alloc
= sizeof yymsgbuf
;
2880 yysyntax_error_status
= 2;
2884 yysyntax_error_status
= YYSYNTAX_ERROR
;
2889 if (yysyntax_error_status
== 2)
2890 goto yyexhaustedlab
;
2892 # undef YYSYNTAX_ERROR
2896 yyerror_range
[1] = yylloc
;
2898 if (yyerrstatus
== 3)
2900 /* If just tried and failed to reuse lookahead token after an
2901 error, discard it. */
2903 if (yychar
<= YYEOF
)
2905 /* Return failure if at end of input. */
2906 if (yychar
== YYEOF
)
2911 yydestruct ("Error: discarding",
2912 yytoken
, &yylval
, &yylloc
);
2917 /* Else will try to reuse lookahead token after shifting the error
2922 /*---------------------------------------------------.
2923 | yyerrorlab -- error raised explicitly by YYERROR. |
2924 `---------------------------------------------------*/
2927 /* Pacify compilers like GCC when the user code never invokes
2928 YYERROR and the label yyerrorlab therefore never appears in user
2930 if (/*CONSTCOND*/ 0)
2933 yyerror_range
[1] = yylsp
[1-yylen
];
2934 /* Do not reclaim the symbols of the rule which action triggered
2938 YY_STACK_PRINT (yyss
, yyssp
);
2943 /*-------------------------------------------------------------.
2944 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2945 `-------------------------------------------------------------*/
2947 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2951 yyn
= yypact
[yystate
];
2952 if (!yypact_value_is_default (yyn
))
2955 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2963 /* Pop the current state because it cannot handle the error token. */
2967 yyerror_range
[1] = *yylsp
;
2968 yydestruct ("Error: popping",
2969 yystos
[yystate
], yyvsp
, yylsp
);
2972 YY_STACK_PRINT (yyss
, yyssp
);
2975 /* If the stack popping above didn't lose the initial context for the
2976 current lookahead token, the shift below will for sure. */
2977 YY_LAC_DISCARD ("error recovery");
2981 yyerror_range
[2] = yylloc
;
2982 /* Using YYLLOC is tempting, but would change the location of
2983 the lookahead. YYLOC is available though. */
2984 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2987 /* Shift the error token. */
2988 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2994 /*-------------------------------------.
2995 | yyacceptlab -- YYACCEPT comes here. |
2996 `-------------------------------------*/
3001 /*-----------------------------------.
3002 | yyabortlab -- YYABORT comes here. |
3003 `-----------------------------------*/
3009 /*-------------------------------------------------.
3010 | yyexhaustedlab -- memory exhaustion comes here. |
3011 `-------------------------------------------------*/
3013 yyerror (YY_("memory exhausted"));
3019 if (yychar
!= YYEMPTY
)
3021 /* Make sure we have latest lookahead translation. See comments at
3022 user semantic actions for why this is necessary. */
3023 yytoken
= YYTRANSLATE (yychar
);
3024 yydestruct ("Cleanup: discarding lookahead",
3025 yytoken
, &yylval
, &yylloc
);
3027 /* Do not reclaim the symbols of the rule which action triggered
3028 this YYABORT or YYACCEPT. */
3030 YY_STACK_PRINT (yyss
, yyssp
);
3031 while (yyssp
!= yyss
)
3033 yydestruct ("Cleanup: popping",
3034 yystos
[*yyssp
], yyvsp
, yylsp
);
3039 YYSTACK_FREE (yyss
);
3042 YYSTACK_FREE (yyes
);
3044 if (yymsg
!= yymsgbuf
)
3045 YYSTACK_FREE (yymsg
);
3047 /* Make sure YYID is used. */
3048 return YYID (yyresult
);
3053 /* Line 2062 of yacc.c */
3054 #line 671 "parse-gram.y"
3058 /* Return the location of the left-hand side of a rule whose
3059 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3060 the right-hand side, and return an empty location equal to the end
3061 boundary of RHS[0] if the right-hand side is empty. */
3064 lloc_default (YYLTYPE
const *rhs
, int n
)
3069 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3070 The bug is fixed in 7.4.2m, but play it safe for now. */
3071 loc
.start
= rhs
[n
].end
;
3072 loc
.end
= rhs
[n
].end
;
3074 /* Ignore empty nonterminals the start of the right-hand side.
3075 Do not bother to ignore them at the end of the right-hand side,
3076 since empty nonterminals have the same end as their predecessors. */
3077 for (i
= 1; i
<= n
; i
++)
3078 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
3080 loc
.start
= rhs
[i
].start
;
3088 /* Add a lex-param or a parse-param (depending on TYPE) with
3089 declaration DECL and location LOC. */
3092 add_param (char const *type
, char *decl
, location loc
)
3094 static char const alphanum
[26 + 26 + 1 + 10] =
3095 "abcdefghijklmnopqrstuvwxyz"
3096 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3099 char const *name_start
= NULL
;
3102 /* Stop on last actual character. */
3103 for (p
= decl
; p
[1]; p
++)
3105 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
3106 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
3109 /* Strip the surrounding '{' and '}', and any blanks just inside
3111 while (*--p
== ' ' || *p
== '\t')
3114 while (*++decl
== ' ' || *decl
== '\t')
3118 complain_at (loc
, _("missing identifier in parameter declaration"));
3121 char *name
= xmemdup0 (name_start
, strspn (name_start
, alphanum
));
3122 muscle_pair_list_grow (type
, decl
, name
);
3126 gram_scanner_last_string_free ();
3131 version_check (location
const *loc
, char const *version
)
3133 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
3135 complain_at (*loc
, "require bison %s, but have %s",
3136 version
, PACKAGE_VERSION
);
3142 gram_error (location
const *loc
, char const *msg
)
3144 complain_at (*loc
, "%s", msg
);
3148 token_name (int type
)
3150 return yytname
[YYTRANSLATE (type
)];
3161 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
3162 return quotearg_style (escape_quoting_style
, buf
);