1 /* A Bison parser, made by GNU Bison 2.3+. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3+"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 1
61 /* Substitute the variable and function names. */
62 #define yyparse gram_parse
63 #define yylex gram_lex
64 #define yyerror gram_error
65 #define yylval gram_lval
66 #define yychar gram_char
67 #define yydebug gram_debug
68 #define yynerrs gram_nerrs
69 #define yylloc gram_lloc
71 /* Copy the first part of user declarations. */
72 /* Line 164 of yacc.c. */
73 #line 1 "parse-gram.y"
74 /* Bison Grammar Parser -*- C -*-
76 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
78 This file is part of Bison, the GNU Compiler Compiler.
80 This program is free software; you can redistribute it and/or modify
81 it under the terms of the GNU General Public License as published by
82 the Free Software Foundation; either version 2 of the License, or
83 (at your option) any later version.
85 This program is distributed in the hope that it will be useful,
86 but WITHOUT ANY WARRANTY; without even the implied warranty of
87 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88 GNU General Public License for more details.
90 You should have received a copy of the GNU General Public License
91 along with this program; if not, write to the Free Software
92 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
99 #include <strverscmp.h>
101 #include "complain.h"
102 #include "conflicts.h"
106 #include "muscle_tab.h"
107 #include "quotearg.h"
110 #include "scan-gram.h"
111 #include "scan-code.h"
113 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
114 static YYLTYPE
lloc_default (YYLTYPE
const *, int);
116 #define YY_LOCATION_PRINT(File, Loc) \
117 location_print (File, Loc)
119 static void version_check (location
const *loc
, char const *version
);
121 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
122 FIXME: depends on the undocumented availability of YYLLOC. */
124 #define yyerror(Msg) \
125 gram_error (&yylloc, Msg)
126 static void gram_error (location
const *, char const *);
128 static char const *char_name (char);
130 /** Add a lex-param or a parse-param.
132 * \param type \a lex_param or \a parse_param
133 * \param decl the formal argument
134 * \param loc the location in the source.
136 static void add_param (char const *type
, char *decl
, location loc
);
139 static symbol_class current_class
= unknown_sym
;
140 static uniqstr current_type
= NULL
;
141 static symbol
*current_lhs
;
142 static location current_lhs_location
;
143 static int current_prec
= 0;
145 #define YYTYPE_INT16 int_fast16_t
146 #define YYTYPE_INT8 int_fast8_t
147 #define YYTYPE_UINT16 uint_fast16_t
148 #define YYTYPE_UINT8 uint_fast8_t
151 /* Enabling traces. */
156 /* Enabling verbose error messages. */
157 #ifdef YYERROR_VERBOSE
158 # undef YYERROR_VERBOSE
159 # define YYERROR_VERBOSE 1
161 # define YYERROR_VERBOSE 1
164 /* Enabling the token table. */
165 #ifndef YYTOKEN_TABLE
166 # define YYTOKEN_TABLE 0
173 /* Put the tokens into the symbol table, so that GDB and other debuggers
182 PERCENT_DESTRUCTOR
= 263,
183 PERCENT_PRINTER
= 264,
184 PERCENT_SYMBOL_DEFAULT
= 265,
187 PERCENT_NONASSOC
= 268,
191 PERCENT_AFTER_HEADER
= 272,
192 PERCENT_BEFORE_HEADER
= 273,
194 PERCENT_DEFAULT_PREC
= 275,
195 PERCENT_DEFINE
= 276,
196 PERCENT_DEFINES
= 277,
197 PERCENT_END_HEADER
= 278,
198 PERCENT_ERROR_VERBOSE
= 279,
199 PERCENT_EXPECT
= 280,
200 PERCENT_EXPECT_RR
= 281,
201 PERCENT_FILE_PREFIX
= 282,
202 PERCENT_GLR_PARSER
= 283,
203 PERCENT_INITIAL_ACTION
= 284,
204 PERCENT_LEX_PARAM
= 285,
205 PERCENT_LOCATIONS
= 286,
206 PERCENT_NAME_PREFIX
= 287,
207 PERCENT_NO_DEFAULT_PREC
= 288,
208 PERCENT_NO_LINES
= 289,
209 PERCENT_NONDETERMINISTIC_PARSER
= 290,
210 PERCENT_OUTPUT
= 291,
211 PERCENT_PARSE_PARAM
= 292,
212 PERCENT_PURE_PARSER
= 293,
213 PERCENT_REQUIRE
= 294,
214 PERCENT_SKELETON
= 295,
216 PERCENT_START_HEADER
= 297,
217 PERCENT_TOKEN_TABLE
= 298,
218 PERCENT_VERBOSE
= 299,
226 PERCENT_PERCENT
= 307,
238 #define PERCENT_TOKEN 260
239 #define PERCENT_NTERM 261
240 #define PERCENT_TYPE 262
241 #define PERCENT_DESTRUCTOR 263
242 #define PERCENT_PRINTER 264
243 #define PERCENT_SYMBOL_DEFAULT 265
244 #define PERCENT_LEFT 266
245 #define PERCENT_RIGHT 267
246 #define PERCENT_NONASSOC 268
247 #define PERCENT_PREC 269
248 #define PERCENT_DPREC 270
249 #define PERCENT_MERGE 271
250 #define PERCENT_AFTER_HEADER 272
251 #define PERCENT_BEFORE_HEADER 273
252 #define PERCENT_DEBUG 274
253 #define PERCENT_DEFAULT_PREC 275
254 #define PERCENT_DEFINE 276
255 #define PERCENT_DEFINES 277
256 #define PERCENT_END_HEADER 278
257 #define PERCENT_ERROR_VERBOSE 279
258 #define PERCENT_EXPECT 280
259 #define PERCENT_EXPECT_RR 281
260 #define PERCENT_FILE_PREFIX 282
261 #define PERCENT_GLR_PARSER 283
262 #define PERCENT_INITIAL_ACTION 284
263 #define PERCENT_LEX_PARAM 285
264 #define PERCENT_LOCATIONS 286
265 #define PERCENT_NAME_PREFIX 287
266 #define PERCENT_NO_DEFAULT_PREC 288
267 #define PERCENT_NO_LINES 289
268 #define PERCENT_NONDETERMINISTIC_PARSER 290
269 #define PERCENT_OUTPUT 291
270 #define PERCENT_PARSE_PARAM 292
271 #define PERCENT_PURE_PARSER 293
272 #define PERCENT_REQUIRE 294
273 #define PERCENT_SKELETON 295
274 #define PERCENT_START 296
275 #define PERCENT_START_HEADER 297
276 #define PERCENT_TOKEN_TABLE 298
277 #define PERCENT_VERBOSE 299
278 #define PERCENT_YACC 300
279 #define BRACED_CODE 301
285 #define PERCENT_PERCENT 307
288 #define SEMICOLON 310
290 #define PERCENT_UNION 312
295 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
296 typedef union YYSTYPE
297 {/* Line 198 of yacc.c. */
298 #line 98 "parse-gram.y"
306 unsigned char character
;
308 /* Line 198 of yacc.c. */
309 #line 310 "parse-gram.c"
311 # define YYSTYPE_IS_TRIVIAL 1
312 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
313 # define YYSTYPE_IS_DECLARED 1
316 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
317 typedef struct YYLTYPE
324 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
325 # define YYLTYPE_IS_DECLARED 1
326 # define YYLTYPE_IS_TRIVIAL 1
330 /* Copy the second part of user declarations. */
332 /* Line 221 of yacc.c. */
333 #line 334 "parse-gram.c"
340 typedef YYTYPE_UINT8 yytype_uint8
;
342 typedef unsigned char yytype_uint8
;
346 typedef YYTYPE_INT8 yytype_int8
;
347 #elif (defined __STDC__ || defined __C99__FUNC__ \
348 || defined __cplusplus || defined _MSC_VER)
349 typedef signed char yytype_int8
;
351 typedef short int yytype_int8
;
355 typedef YYTYPE_UINT16 yytype_uint16
;
357 typedef unsigned short int yytype_uint16
;
361 typedef YYTYPE_INT16 yytype_int16
;
363 typedef short int yytype_int16
;
367 # ifdef __SIZE_TYPE__
368 # define YYSIZE_T __SIZE_TYPE__
369 # elif defined size_t
370 # define YYSIZE_T size_t
371 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
372 || defined __cplusplus || defined _MSC_VER)
373 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
374 # define YYSIZE_T size_t
376 # define YYSIZE_T unsigned int
380 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
385 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
386 # define YY_(msgid) dgettext ("bison-runtime", msgid)
390 # define YY_(msgid) msgid
394 /* Suppress unused-variable warnings by "using" E. */
395 #if ! defined lint || defined __GNUC__
396 # define YYUSE(e) ((void) (e))
398 # define YYUSE(e) /* empty */
401 /* Identity function, used to suppress warnings about constant conditions. */
405 #if (defined __STDC__ || defined __C99__FUNC__ \
406 || defined __cplusplus || defined _MSC_VER)
419 #if ! defined yyoverflow || YYERROR_VERBOSE
421 /* The parser invokes alloca or malloc; define the necessary symbols. */
423 # ifdef YYSTACK_USE_ALLOCA
424 # if YYSTACK_USE_ALLOCA
426 # define YYSTACK_ALLOC __builtin_alloca
427 # elif defined __BUILTIN_VA_ARG_INCR
428 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
430 # define YYSTACK_ALLOC __alloca
431 # elif defined _MSC_VER
432 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
433 # define alloca _alloca
435 # define YYSTACK_ALLOC alloca
436 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
437 || defined __cplusplus || defined _MSC_VER)
438 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
447 # ifdef YYSTACK_ALLOC
448 /* Pacify GCC's `empty if-body' warning. */
449 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
450 # ifndef YYSTACK_ALLOC_MAXIMUM
451 /* The OS might guarantee only one guard page at the bottom of the stack,
452 and a page size can be as small as 4096 bytes. So we cannot safely
453 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
454 to allow for a few compiler-allocated temporary stack slots. */
455 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
458 # define YYSTACK_ALLOC YYMALLOC
459 # define YYSTACK_FREE YYFREE
460 # ifndef YYSTACK_ALLOC_MAXIMUM
461 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
463 # if (defined __cplusplus && ! defined _STDLIB_H \
464 && ! ((defined YYMALLOC || defined malloc) \
465 && (defined YYFREE || defined free)))
466 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
472 # define YYMALLOC malloc
473 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
474 || defined __cplusplus || defined _MSC_VER)
475 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
480 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
481 || defined __cplusplus || defined _MSC_VER)
482 void free (void *); /* INFRINGES ON USER NAME SPACE */
486 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
489 #if (! defined yyoverflow \
490 && (! defined __cplusplus \
491 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
492 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
494 /* A type that is properly aligned for any stack member. */
502 /* The size of the maximum gap between one aligned stack and the next. */
503 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
505 /* The size of an array large to enough to hold all stacks, each with
507 # define YYSTACK_BYTES(N) \
508 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
509 + 2 * YYSTACK_GAP_MAXIMUM)
511 /* Copy COUNT objects from FROM to TO. The source and destination do
514 # if defined __GNUC__ && 1 < __GNUC__
515 # define YYCOPY(To, From, Count) \
516 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
518 # define YYCOPY(To, From, Count) \
522 for (yyi = 0; yyi < (Count); yyi++) \
523 (To)[yyi] = (From)[yyi]; \
529 /* Relocate STACK from its old location to the new one. The
530 local variables YYSIZE and YYSTACKSIZE give the old and new number of
531 elements in the stack, and YYPTR gives the new location of the
532 stack. Advance YYPTR to a properly aligned location for the next
534 # define YYSTACK_RELOCATE(Stack) \
537 YYSIZE_T yynewbytes; \
538 YYCOPY (&yyptr->Stack, Stack, yysize); \
539 Stack = &yyptr->Stack; \
540 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
541 yyptr += yynewbytes / sizeof (*yyptr); \
547 /* YYFINAL -- State number of the termination state. */
549 /* YYLAST -- Last index in YYTABLE. */
552 /* YYNTOKENS -- Number of terminals. */
554 /* YYNNTS -- Number of nonterminals. */
556 /* YYNRULES -- Number of rules. */
558 /* YYNRULES -- Number of states. */
559 #define YYNSTATES 136
561 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
563 #define YYMAXUTOK 312
565 #define YYTRANSLATE(YYX) \
566 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
568 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
569 static const yytype_uint8 yytranslate
[] =
571 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
597 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
598 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
599 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
600 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
601 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
606 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
608 static const yytype_uint8 yyprhs
[] =
610 0, 0, 3, 8, 9, 12, 14, 16, 19, 22,
611 24, 28, 30, 33, 35, 38, 41, 45, 47, 50,
612 53, 55, 59, 61, 63, 67, 70, 72, 75, 78,
613 81, 83, 85, 87, 89, 91, 93, 96, 100, 104,
614 106, 108, 109, 111, 115, 116, 120, 121, 125, 129,
615 133, 135, 137, 139, 140, 142, 144, 147, 149, 152,
616 154, 156, 158, 160, 162, 165, 168, 172, 174, 177,
617 179, 182, 184, 187, 190, 191, 195, 197, 201, 204,
618 205, 208, 211, 215, 219, 223, 225, 227, 228, 230,
619 232, 234, 236, 238, 240, 242, 244, 245
622 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
623 static const yytype_int8 yyrhs
[] =
625 59, 0, -1, 60, 52, 75, 88, -1, -1, 60,
626 61, -1, 62, -1, 54, -1, 17, 83, -1, 18,
627 83, -1, 19, -1, 21, 3, 82, -1, 22, -1,
628 23, 83, -1, 24, -1, 25, 4, -1, 26, 4,
629 -1, 27, 49, 3, -1, 28, -1, 29, 46, -1,
630 30, 46, -1, 31, -1, 32, 49, 3, -1, 34,
631 -1, 35, -1, 36, 49, 3, -1, 37, 46, -1,
632 38, -1, 39, 3, -1, 40, 3, -1, 42, 83,
633 -1, 43, -1, 44, -1, 45, -1, 55, -1, 67,
634 -1, 64, -1, 41, 86, -1, 8, 46, 71, -1,
635 9, 46, 71, -1, 20, -1, 33, -1, -1, 50,
636 -1, 57, 63, 46, -1, -1, 6, 65, 74, -1,
637 -1, 5, 66, 74, -1, 7, 56, 70, -1, 68,
638 69, 70, -1, 11, -1, 12, -1, 13, -1, -1,
639 56, -1, 86, -1, 70, 86, -1, 72, -1, 71,
640 72, -1, 86, -1, 56, -1, 10, -1, 56, -1,
641 84, -1, 84, 4, -1, 84, 87, -1, 84, 4,
642 87, -1, 73, -1, 74, 73, -1, 76, -1, 75,
643 76, -1, 77, -1, 62, 55, -1, 1, 55, -1,
644 -1, 85, 78, 79, -1, 80, -1, 79, 53, 80,
645 -1, 79, 55, -1, -1, 80, 86, -1, 80, 46,
646 -1, 80, 14, 86, -1, 80, 15, 4, -1, 80,
647 16, 56, -1, 3, -1, 83, -1, -1, 81, -1,
648 46, -1, 50, -1, 47, -1, 51, -1, 84, -1,
649 87, -1, 3, -1, -1, 52, 48, -1
652 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
653 static const yytype_uint16 yyrline
[] =
655 0, 208, 208, 216, 218, 222, 223, 224, 225, 226,
656 227, 228, 229, 230, 231, 232, 233, 234, 239, 243,
657 244, 245, 246, 247, 248, 249, 250, 251, 252, 253,
658 254, 255, 256, 257, 261, 262, 263, 267, 275, 283,
659 287, 301, 302, 306, 334, 334, 339, 339, 344, 355,
660 370, 371, 372, 376, 377, 382, 384, 389, 390, 394,
661 395, 396, 401, 406, 411, 417, 423, 434, 435, 444,
662 445, 451, 452, 453, 460, 460, 464, 465, 466, 471,
663 472, 474, 476, 478, 480, 490, 491, 497, 501, 506,
664 522, 524, 533, 538, 539, 544, 551, 553
668 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
669 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
670 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
671 static const char *const yytname
[] =
673 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
674 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
675 "\"%printer\"", "\"%symbol-default\"", "\"%left\"", "\"%right\"",
676 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"",
677 "\"%after-header\"", "\"%before-header\"", "\"%debug\"",
678 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%end-header\"",
679 "\"%error-verbose\"", "\"%expect\"", "\"%expect-rr\"",
680 "\"%file-prefix\"", "\"%glr-parser\"", "\"%initial-action\"",
681 "\"%lex-param\"", "\"%locations\"", "\"%name-prefix\"",
682 "\"%no-default-prec\"", "\"%no-lines\"", "\"%nondeterministic-parser\"",
683 "\"%output\"", "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"",
684 "\"%skeleton\"", "\"%start\"", "\"%start-header\"", "\"%token-table\"",
685 "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"",
686 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
687 "\"%{...%}\"", "\";\"", "\"type\"", "\"%union\"", "$accept", "input",
688 "prologue_declarations", "prologue_declaration", "grammar_declaration",
689 "union_name", "symbol_declaration", "@1", "@2", "precedence_declaration",
690 "precedence_declarator", "type.opt", "symbols.1", "generic_symlist",
691 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
692 "rules_or_grammar_declaration", "rules", "@3", "rhses.1", "rhs",
693 "content", "content.opt", "braceless", "id", "id_colon", "symbol",
694 "string_as_id", "epilogue.opt", 0
699 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
701 static const yytype_uint16 yytoknum
[] =
703 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
704 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
705 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
706 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
707 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
708 305, 306, 307, 308, 309, 310, 311, 312
712 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
713 static const yytype_uint8 yyr1
[] =
715 0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
716 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
717 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
718 61, 61, 61, 61, 62, 62, 62, 62, 62, 62,
719 62, 63, 63, 62, 65, 64, 66, 64, 64, 67,
720 68, 68, 68, 69, 69, 70, 70, 71, 71, 72,
721 72, 72, 73, 73, 73, 73, 73, 74, 74, 75,
722 75, 76, 76, 76, 78, 77, 79, 79, 79, 80,
723 80, 80, 80, 80, 80, 81, 81, 82, 82, 83,
724 84, 84, 85, 86, 86, 87, 88, 88
727 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
728 static const yytype_uint8 yyr2
[] =
730 0, 2, 4, 0, 2, 1, 1, 2, 2, 1,
731 3, 1, 2, 1, 2, 2, 3, 1, 2, 2,
732 1, 3, 1, 1, 3, 2, 1, 2, 2, 2,
733 1, 1, 1, 1, 1, 1, 2, 3, 3, 1,
734 1, 0, 1, 3, 0, 3, 0, 3, 3, 3,
735 1, 1, 1, 0, 1, 1, 2, 1, 2, 1,
736 1, 1, 1, 1, 2, 2, 3, 1, 2, 1,
737 2, 1, 2, 2, 0, 3, 1, 3, 2, 0,
738 2, 2, 3, 3, 3, 1, 1, 0, 1, 1,
739 1, 1, 1, 1, 1, 1, 0, 2
742 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
743 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
744 means the default is an error. */
745 static const yytype_uint8 yydefact
[] =
747 3, 0, 0, 1, 46, 44, 0, 0, 0, 50,
748 51, 52, 0, 0, 9, 39, 0, 11, 0, 13,
749 0, 0, 0, 17, 0, 0, 20, 0, 40, 22,
750 23, 0, 0, 26, 0, 0, 0, 0, 30, 31,
751 32, 0, 6, 33, 41, 4, 5, 35, 34, 53,
752 0, 0, 0, 0, 0, 89, 7, 8, 87, 12,
753 14, 15, 0, 18, 19, 0, 0, 25, 27, 28,
754 95, 91, 90, 93, 36, 94, 29, 0, 92, 0,
755 0, 69, 71, 74, 42, 0, 54, 0, 62, 67,
756 47, 63, 45, 48, 55, 61, 60, 37, 57, 59,
757 38, 85, 88, 10, 86, 16, 21, 24, 73, 72,
758 0, 70, 2, 79, 43, 49, 68, 64, 65, 56,
759 58, 97, 75, 76, 66, 79, 78, 0, 0, 0,
760 81, 80, 77, 82, 83, 84
763 /* YYDEFGOTO[NTERM-NUM]. */
764 static const yytype_int8 yydefgoto
[] =
766 -1, 1, 2, 45, 79, 85, 47, 51, 50, 48,
767 49, 87, 93, 97, 98, 89, 90, 80, 81, 82,
768 113, 122, 123, 102, 103, 56, 73, 83, 99, 75,
772 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
774 #define YYPACT_NINF -75
775 static const yytype_int16 yypact
[] =
777 -75, 18, 101, -75, -75, -75, -21, -20, -10, -75,
778 -75, -75, -8, -8, -75, -75, 37, -75, -8, -75,
779 41, 44, 6, -75, -5, 3, -75, 7, -75, -75,
780 -75, 10, 16, -75, 61, 67, 0, -8, -75, -75,
781 -75, 60, -75, -75, 13, -75, -75, -75, -75, 19,
782 -28, -28, 0, 27, 27, -75, -75, -75, 8, -75,
783 -75, -75, 73, -75, -75, 75, 78, -75, -75, -75,
784 -75, -75, -75, -75, -75, -75, -75, 30, -75, 31,
785 1, -75, -75, -75, -75, 36, -75, 0, -75, -75,
786 -28, 29, -28, 0, -75, -75, -75, 27, -75, -75,
787 27, -75, -75, -75, -75, -75, -75, -75, -75, -75,
788 40, -75, -75, -75, -75, 0, -75, 81, -75, -75,
789 -75, -75, -30, 145, -75, -75, -75, 0, 85, 34,
790 -75, -75, 145, -75, -75, -75
793 /* YYPGOTO[NTERM-NUM]. */
794 static const yytype_int8 yypgoto
[] =
796 -75, -75, -75, -75, 90, -75, -75, -75, -75, -75,
797 -75, -75, 11, 43, -73, -61, 48, -75, 14, -75,
798 -75, -75, -25, -75, -75, 2, -46, -75, -36, -74,
802 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
803 positive, shift that token. If negative, reduce the rule which
804 number is the opposite. If zero, do what YYDEFACT says.
805 If YYTABLE_NINF, syntax error. */
806 #define YYTABLE_NINF -97
807 static const yytype_int16 yytable
[] =
809 74, -96, 77, 70, 91, 91, 4, 5, 6, 7,
810 8, 101, 9, 10, 11, 57, 94, 118, 3, 71,
811 59, 15, 72, 125, 120, 126, 53, 120, 88, 116,
812 70, 116, 70, 117, 28, 52, 54, 95, 55, 76,
813 58, 63, 36, 124, 91, 60, 91, 71, 61, 64,
814 72, 94, 78, 110, 55, 62, 65, 119, 44, 66,
815 104, 77, 67, 84, 68, 4, 5, 6, 7, 8,
816 69, 9, 10, 11, 71, 86, 105, 72, 106, 119,
817 15, 107, 114, 96, 70, 108, 109, 131, 121, 134,
818 135, 133, 46, 28, 111, 0, 131, 100, 115, 92,
819 132, 36, 0, 0, 0, 0, 4, 5, 6, 7,
820 8, 78, 9, 10, 11, 0, 0, 44, 12, 13,
821 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
822 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
823 34, 35, 36, 37, 38, 39, 40, 0, 70, 0,
824 0, 0, 0, 41, 0, 42, 43, 0, 44, 127,
825 128, 129, 0, 0, 0, 0, 0, 0, 0, 0,
826 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
827 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
831 static const yytype_int16 yycheck
[] =
833 36, 0, 1, 3, 50, 51, 5, 6, 7, 8,
834 9, 3, 11, 12, 13, 13, 52, 91, 0, 47,
835 18, 20, 50, 53, 97, 55, 46, 100, 56, 90,
836 3, 92, 3, 4, 33, 56, 46, 10, 46, 37,
837 3, 46, 41, 117, 90, 4, 92, 47, 4, 46,
838 50, 87, 51, 52, 46, 49, 49, 93, 57, 49,
839 58, 1, 46, 50, 3, 5, 6, 7, 8, 9,
840 3, 11, 12, 13, 47, 56, 3, 50, 3, 115,
841 20, 3, 46, 56, 3, 55, 55, 123, 48, 4,
842 56, 127, 2, 33, 80, -1, 132, 54, 87, 51,
843 125, 41, -1, -1, -1, -1, 5, 6, 7, 8,
844 9, 51, 11, 12, 13, -1, -1, 57, 17, 18,
845 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
846 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
847 39, 40, 41, 42, 43, 44, 45, -1, 3, -1,
848 -1, -1, -1, 52, -1, 54, 55, -1, 57, 14,
849 15, 16, -1, -1, -1, -1, -1, -1, -1, -1,
850 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
851 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
852 -1, 46, 47, -1, -1, 50
855 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
856 symbol of state STATE-NUM. */
857 static const yytype_uint8 yystos
[] =
859 0, 59, 60, 0, 5, 6, 7, 8, 9, 11,
860 12, 13, 17, 18, 19, 20, 21, 22, 23, 24,
861 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
862 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
863 45, 52, 54, 55, 57, 61, 62, 64, 67, 68,
864 66, 65, 56, 46, 46, 46, 83, 83, 3, 83,
865 4, 4, 49, 46, 46, 49, 49, 46, 3, 3,
866 3, 47, 50, 84, 86, 87, 83, 1, 51, 62,
867 75, 76, 77, 85, 50, 63, 56, 69, 56, 73,
868 74, 84, 74, 70, 86, 10, 56, 71, 72, 86,
869 71, 3, 81, 82, 83, 3, 3, 3, 55, 55,
870 52, 76, 88, 78, 46, 70, 73, 4, 87, 86,
871 72, 48, 79, 80, 87, 53, 55, 14, 15, 16,
872 46, 86, 80, 86, 4, 56
875 #define yyerrok (yyerrstatus = 0)
876 #define yyclearin (yychar = YYEMPTY)
880 #define YYACCEPT goto yyacceptlab
881 #define YYABORT goto yyabortlab
882 #define YYERROR goto yyerrorlab
885 /* Like YYERROR except do call yyerror. This remains here temporarily
886 to ease the transition to the new meaning of YYERROR, for GCC.
887 Once GCC version 2 has supplanted version 1, this can go. */
889 #define YYFAIL goto yyerrlab
891 #define YYRECOVERING() (!!yyerrstatus)
893 #define YYBACKUP(Token, Value) \
895 if (yychar == YYEMPTY && yylen == 1) \
899 yytoken = YYTRANSLATE (yychar); \
905 yyerror (YY_("syntax error: cannot back up")); \
912 #define YYERRCODE 256
915 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
916 If N is 0, then set CURRENT to the empty location which ends
917 the previous symbol: RHS[0] (always defined). */
919 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
920 #ifndef YYLLOC_DEFAULT
921 # define YYLLOC_DEFAULT(Current, Rhs, N) \
925 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
926 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
927 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
928 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
932 (Current).first_line = (Current).last_line = \
933 YYRHSLOC (Rhs, 0).last_line; \
934 (Current).first_column = (Current).last_column = \
935 YYRHSLOC (Rhs, 0).last_column; \
941 /* YY_LOCATION_PRINT -- Print the location on the stream.
942 This macro was not mandated originally: define only if we know
943 we won't break user code: when these are the locations we know. */
945 #ifndef YY_LOCATION_PRINT
946 # if YYLTYPE_IS_TRIVIAL
947 # define YY_LOCATION_PRINT(File, Loc) \
948 fprintf (File, "%d.%d-%d.%d", \
949 (Loc).first_line, (Loc).first_column, \
950 (Loc).last_line, (Loc).last_column)
952 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
957 /* YYLEX -- calling `yylex' with the right arguments. */
960 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
962 # define YYLEX yylex (&yylval, &yylloc)
965 /* Enable debugging if requested. */
969 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
970 # define YYFPRINTF fprintf
973 # define YYDPRINTF(Args) \
979 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
983 YYFPRINTF (stderr, "%s ", Title); \
984 yy_symbol_print (stderr, \
985 Type, Value, Location); \
986 YYFPRINTF (stderr, "\n"); \
991 /*--------------------------------.
992 | Print this symbol on YYOUTPUT. |
993 `--------------------------------*/
996 #if (defined __STDC__ || defined __C99__FUNC__ \
997 || defined __cplusplus || defined _MSC_VER)
999 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1002 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1005 YYSTYPE
const * const yyvaluep
;
1006 YYLTYPE
const * const yylocationp
;
1011 YYUSE (yylocationp
);
1013 if (yytype
< YYNTOKENS
)
1014 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1020 case 3: /* "\"string\"" */
1021 /* Line 670 of yacc.c. */
1022 #line 186 "parse-gram.y"
1023 { fputs (quotearg_style (c_quoting_style
, (yyvaluep
->chars
)), stderr
); };
1024 /* Line 670 of yacc.c. */
1025 #line 1026 "parse-gram.c"
1027 case 4: /* "\"integer\"" */
1028 /* Line 670 of yacc.c. */
1029 #line 197 "parse-gram.y"
1030 { fprintf (stderr
, "%d", (yyvaluep
->integer
)); };
1031 /* Line 670 of yacc.c. */
1032 #line 1033 "parse-gram.c"
1034 case 46: /* "\"{...}\"" */
1035 /* Line 670 of yacc.c. */
1036 #line 188 "parse-gram.y"
1037 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1038 /* Line 670 of yacc.c. */
1039 #line 1040 "parse-gram.c"
1041 case 47: /* "\"char\"" */
1042 /* Line 670 of yacc.c. */
1043 #line 181 "parse-gram.y"
1044 { fputs (char_name ((yyvaluep
->character
)), stderr
); };
1045 /* Line 670 of yacc.c. */
1046 #line 1047 "parse-gram.c"
1048 case 48: /* "\"epilogue\"" */
1049 /* Line 670 of yacc.c. */
1050 #line 188 "parse-gram.y"
1051 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1052 /* Line 670 of yacc.c. */
1053 #line 1054 "parse-gram.c"
1055 case 50: /* "\"identifier\"" */
1056 /* Line 670 of yacc.c. */
1057 #line 193 "parse-gram.y"
1058 { fputs ((yyvaluep
->uniqstr
), stderr
); };
1059 /* Line 670 of yacc.c. */
1060 #line 1061 "parse-gram.c"
1062 case 51: /* "\"identifier:\"" */
1063 /* Line 670 of yacc.c. */
1064 #line 194 "parse-gram.y"
1065 { fprintf (stderr
, "%s:", (yyvaluep
->uniqstr
)); };
1066 /* Line 670 of yacc.c. */
1067 #line 1068 "parse-gram.c"
1069 case 54: /* "\"%{...%}\"" */
1070 /* Line 670 of yacc.c. */
1071 #line 188 "parse-gram.y"
1072 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1073 /* Line 670 of yacc.c. */
1074 #line 1075 "parse-gram.c"
1076 case 56: /* "\"type\"" */
1077 /* Line 670 of yacc.c. */
1078 #line 192 "parse-gram.y"
1079 { fprintf (stderr
, "<%s>", (yyvaluep
->uniqstr
)); };
1080 /* Line 670 of yacc.c. */
1081 #line 1082 "parse-gram.c"
1083 case 81: /* "content" */
1084 /* Line 670 of yacc.c. */
1085 #line 188 "parse-gram.y"
1086 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1087 /* Line 670 of yacc.c. */
1088 #line 1089 "parse-gram.c"
1090 case 82: /* "content.opt" */
1091 /* Line 670 of yacc.c. */
1092 #line 188 "parse-gram.y"
1093 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1094 /* Line 670 of yacc.c. */
1095 #line 1096 "parse-gram.c"
1097 case 83: /* "braceless" */
1098 /* Line 670 of yacc.c. */
1099 #line 188 "parse-gram.y"
1100 { fprintf (stderr
, "{\n%s\n}", (yyvaluep
->chars
)); };
1101 /* Line 670 of yacc.c. */
1102 #line 1103 "parse-gram.c"
1105 /* Line 670 of yacc.c. */
1106 #line 200 "parse-gram.y"
1107 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1108 /* Line 670 of yacc.c. */
1109 #line 1110 "parse-gram.c"
1111 case 85: /* "id_colon" */
1112 /* Line 670 of yacc.c. */
1113 #line 201 "parse-gram.y"
1114 { fprintf (stderr
, "%s:", (yyvaluep
->symbol
)->tag
); };
1115 /* Line 670 of yacc.c. */
1116 #line 1117 "parse-gram.c"
1118 case 86: /* "symbol" */
1119 /* Line 670 of yacc.c. */
1120 #line 200 "parse-gram.y"
1121 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1122 /* Line 670 of yacc.c. */
1123 #line 1124 "parse-gram.c"
1125 case 87: /* "string_as_id" */
1126 /* Line 670 of yacc.c. */
1127 #line 200 "parse-gram.y"
1128 { fprintf (stderr
, "%s", (yyvaluep
->symbol
)->tag
); };
1129 /* Line 670 of yacc.c. */
1130 #line 1131 "parse-gram.c"
1138 /*--------------------------------.
1139 | Print this symbol on YYOUTPUT. |
1140 `--------------------------------*/
1142 #if (defined __STDC__ || defined __C99__FUNC__ \
1143 || defined __cplusplus || defined _MSC_VER)
1145 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1148 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1151 YYSTYPE
const * const yyvaluep
;
1152 YYLTYPE
const * const yylocationp
;
1155 if (yytype
< YYNTOKENS
)
1156 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1158 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1160 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1161 YYFPRINTF (yyoutput
, ": ");
1162 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1163 YYFPRINTF (yyoutput
, ")");
1166 /*------------------------------------------------------------------.
1167 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1169 `------------------------------------------------------------------*/
1171 #if (defined __STDC__ || defined __C99__FUNC__ \
1172 || defined __cplusplus || defined _MSC_VER)
1174 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1177 yy_stack_print (yybottom
, yytop
)
1178 yytype_int16
*yybottom
;
1179 yytype_int16
*yytop
;
1182 YYFPRINTF (stderr
, "Stack now");
1183 for (; yybottom
<= yytop
; yybottom
++)
1185 int yybot
= *yybottom
;
1186 YYFPRINTF (stderr
, " %d", yybot
);
1188 YYFPRINTF (stderr
, "\n");
1191 # define YY_STACK_PRINT(Bottom, Top) \
1194 yy_stack_print ((Bottom), (Top)); \
1198 /*------------------------------------------------.
1199 | Report that the YYRULE is going to be reduced. |
1200 `------------------------------------------------*/
1202 #if (defined __STDC__ || defined __C99__FUNC__ \
1203 || defined __cplusplus || defined _MSC_VER)
1205 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1208 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1214 int yynrhs
= yyr2
[yyrule
];
1216 unsigned long int yylno
= yyrline
[yyrule
];
1217 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1219 /* The symbols being reduced. */
1220 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1222 fprintf (stderr
, " $%d = ", yyi
+ 1);
1223 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1224 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1225 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1226 fprintf (stderr
, "\n");
1230 # define YY_REDUCE_PRINT(Rule) \
1233 yy_reduce_print (yyvsp, yylsp, Rule); \
1236 /* Nonzero means print parse trace. It is left uninitialized so that
1237 multiple parsers can coexist. */
1239 #else /* !YYDEBUG */
1240 # define YYDPRINTF(Args)
1241 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1242 # define YY_STACK_PRINT(Bottom, Top)
1243 # define YY_REDUCE_PRINT(Rule)
1244 #endif /* !YYDEBUG */
1247 /* YYINITDEPTH -- initial size of the parser's stacks. */
1249 # define YYINITDEPTH 200
1252 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1253 if the built-in stack extension method is used).
1255 Do not make this value too large; the results are undefined if
1256 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1257 evaluated with infinite-precision integer arithmetic. */
1260 # define YYMAXDEPTH 10000
1268 # if defined __GLIBC__ && defined _STRING_H
1269 # define yystrlen strlen
1271 /* Return the length of YYSTR. */
1272 #if (defined __STDC__ || defined __C99__FUNC__ \
1273 || defined __cplusplus || defined _MSC_VER)
1275 yystrlen (const char *yystr
)
1283 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1291 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1292 # define yystpcpy stpcpy
1294 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1296 #if (defined __STDC__ || defined __C99__FUNC__ \
1297 || defined __cplusplus || defined _MSC_VER)
1299 yystpcpy (char *yydest
, const char *yysrc
)
1302 yystpcpy (yydest
, yysrc
)
1308 const char *yys
= yysrc
;
1310 while ((*yyd
++ = *yys
++) != '\0')
1319 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1320 quotes and backslashes, so that it's suitable for yyerror. The
1321 heuristic is that double-quoting is unnecessary unless the string
1322 contains an apostrophe, a comma, or backslash (other than
1323 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1324 null, do not copy; instead, return the length of what the result
1327 yytnamerr (char *yyres
, const char *yystr
)
1332 char const *yyp
= yystr
;
1339 goto do_not_strip_quotes
;
1343 goto do_not_strip_quotes
;
1356 do_not_strip_quotes
: ;
1360 return yystrlen (yystr
);
1362 return yystpcpy (yyres
, yystr
) - yyres
;
1366 /* Copy into YYRESULT an error message about the unexpected token
1367 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1368 including the terminating null byte. If YYRESULT is null, do not
1369 copy anything; just return the number of bytes that would be
1370 copied. As a special case, return 0 if an ordinary "syntax error"
1371 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1372 size calculation. */
1374 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1376 int yyn
= yypact
[yystate
];
1378 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1382 int yytype
= YYTRANSLATE (yychar
);
1383 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1384 YYSIZE_T yysize
= yysize0
;
1386 int yysize_overflow
= 0;
1387 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1388 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1392 /* This is so xgettext sees the translatable formats that are
1393 constructed on the fly. */
1394 YY_("syntax error, unexpected %s");
1395 YY_("syntax error, unexpected %s, expecting %s");
1396 YY_("syntax error, unexpected %s, expecting %s or %s");
1397 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1398 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1402 static char const yyunexpected
[] = "syntax error, unexpected %s";
1403 static char const yyexpecting
[] = ", expecting %s";
1404 static char const yyor
[] = " or %s";
1405 char yyformat
[sizeof yyunexpected
1406 + sizeof yyexpecting
- 1
1407 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1408 * (sizeof yyor
- 1))];
1409 char const *yyprefix
= yyexpecting
;
1411 /* Start YYX at -YYN if negative to avoid negative indexes in
1413 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1415 /* Stay within bounds of both yycheck and yytname. */
1416 int yychecklim
= YYLAST
- yyn
+ 1;
1417 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1420 yyarg
[0] = yytname
[yytype
];
1421 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1423 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1424 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1426 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1430 yyformat
[sizeof yyunexpected
- 1] = '\0';
1433 yyarg
[yycount
++] = yytname
[yyx
];
1434 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1435 yysize_overflow
|= (yysize1
< yysize
);
1437 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1441 yyf
= YY_(yyformat
);
1442 yysize1
= yysize
+ yystrlen (yyf
);
1443 yysize_overflow
|= (yysize1
< yysize
);
1446 if (yysize_overflow
)
1447 return YYSIZE_MAXIMUM
;
1451 /* Avoid sprintf, as that infringes on the user's name space.
1452 Don't have undefined behavior even if the translation
1453 produced a string with the wrong number of "%s"s. */
1454 char *yyp
= yyresult
;
1456 while ((*yyp
= *yyf
) != '\0')
1458 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1460 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1473 #endif /* YYERROR_VERBOSE */
1476 /*-----------------------------------------------.
1477 | Release the memory associated to this symbol. |
1478 `-----------------------------------------------*/
1481 #if (defined __STDC__ || defined __C99__FUNC__ \
1482 || defined __cplusplus || defined _MSC_VER)
1484 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1487 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1491 YYLTYPE
*yylocationp
;
1495 YYUSE (yylocationp
);
1499 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1510 /* Prevent warnings from -Wmissing-prototypes. */
1512 #ifdef YYPARSE_PARAM
1513 #if defined __STDC__ || defined __cplusplus
1514 int yyparse (void *YYPARSE_PARAM
);
1518 #else /* ! YYPARSE_PARAM */
1519 #if defined __STDC__ || defined __cplusplus
1524 #endif /* ! YYPARSE_PARAM */
1535 #ifdef YYPARSE_PARAM
1536 #if (defined __STDC__ || defined __C99__FUNC__ \
1537 || defined __cplusplus || defined _MSC_VER)
1539 yyparse (void *YYPARSE_PARAM
)
1542 yyparse (YYPARSE_PARAM
)
1543 void *YYPARSE_PARAM
;
1545 #else /* ! YYPARSE_PARAM */
1546 #if (defined __STDC__ || defined __C99__FUNC__ \
1547 || defined __cplusplus || defined _MSC_VER)
1557 /* The lookahead symbol. */
1560 /* The semantic value of the lookahead symbol. */
1563 /* Number of syntax errors so far. */
1565 /* Location data for the lookahead symbol. */
1571 /* Number of tokens to shift before error messages enabled. */
1573 /* Lookahead token as an internal (translated) token number. */
1576 /* Buffer for error messages, and its allocated size. */
1578 char *yymsg
= yymsgbuf
;
1579 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1582 /* Three stacks and their tools:
1583 `yyss': related to states,
1584 `yyvs': related to semantic values,
1585 `yyls': related to locations.
1587 Refer to the stacks thru separate pointers, to allow yyoverflow
1588 to reallocate them elsewhere. */
1590 /* The state stack. */
1591 yytype_int16 yyssa
[YYINITDEPTH
];
1592 yytype_int16
*yyss
= yyssa
;
1593 yytype_int16
*yyssp
;
1595 /* The semantic value stack. */
1596 YYSTYPE yyvsa
[YYINITDEPTH
];
1597 YYSTYPE
*yyvs
= yyvsa
;
1600 /* The location stack. */
1601 YYLTYPE yylsa
[YYINITDEPTH
];
1602 YYLTYPE
*yyls
= yylsa
;
1604 /* The locations where the error started and ended. */
1605 YYLTYPE yyerror_range
[2];
1607 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1609 YYSIZE_T yystacksize
= YYINITDEPTH
;
1611 /* The variables used to return semantic value and location from the
1616 /* The number of symbols on the RHS of the reduced rule.
1617 Keep to zero when no symbol should be popped. */
1620 YYDPRINTF ((stderr
, "Starting parse\n"));
1625 yychar
= YYEMPTY
; /* Cause a token to be read. */
1627 /* Initialize stack pointers.
1628 Waste one element of value and location stack
1629 so that they stay on the same level as the state stack.
1630 The wasted elements are never initialized. */
1635 #if YYLTYPE_IS_TRIVIAL
1636 /* Initialize the default location before parsing starts. */
1637 yylloc
.first_line
= yylloc
.last_line
= 1;
1638 yylloc
.first_column
= yylloc
.last_column
= 1;
1642 /* User initialization code. */
1643 /* Line 1082 of yacc.c. */
1644 #line 89 "parse-gram.y"
1646 /* Bison's grammar can initial empty locations, hence a default
1647 location is needed. */
1648 boundary_set (&yylloc
.start
, current_file
, 1, 1);
1649 boundary_set (&yylloc
.end
, current_file
, 1, 1);
1651 /* Line 1082 of yacc.c. */
1652 #line 1653 "parse-gram.c"
1656 /*------------------------------------------------------------.
1657 | yynewstate -- Push a new state, which is found in yystate. |
1658 `------------------------------------------------------------*/
1660 /* In all cases, when you get here, the value and location stacks
1661 have just been pushed. So pushing a state here evens the stacks. */
1667 if (yyss
+ yystacksize
- 1 <= yyssp
)
1669 /* Get the current used size of the three stacks, in elements. */
1670 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1674 /* Give user a chance to reallocate the stack. Use copies of
1675 these so that the &'s don't force the real ones into
1677 YYSTYPE
*yyvs1
= yyvs
;
1678 yytype_int16
*yyss1
= yyss
;
1679 YYLTYPE
*yyls1
= yyls
;
1681 /* Each stack pointer address is followed by the size of the
1682 data in use in that stack, in bytes. This used to be a
1683 conditional around just the two extra args, but that might
1684 be undefined if yyoverflow is a macro. */
1685 yyoverflow (YY_("memory exhausted"),
1686 &yyss1
, yysize
* sizeof (*yyssp
),
1687 &yyvs1
, yysize
* sizeof (*yyvsp
),
1688 &yyls1
, yysize
* sizeof (*yylsp
),
1694 #else /* no yyoverflow */
1695 # ifndef YYSTACK_RELOCATE
1696 goto yyexhaustedlab
;
1698 /* Extend the stack our own way. */
1699 if (YYMAXDEPTH
<= yystacksize
)
1700 goto yyexhaustedlab
;
1702 if (YYMAXDEPTH
< yystacksize
)
1703 yystacksize
= YYMAXDEPTH
;
1706 yytype_int16
*yyss1
= yyss
;
1707 union yyalloc
*yyptr
=
1708 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1710 goto yyexhaustedlab
;
1711 YYSTACK_RELOCATE (yyss
);
1712 YYSTACK_RELOCATE (yyvs
);
1713 YYSTACK_RELOCATE (yyls
);
1714 # undef YYSTACK_RELOCATE
1716 YYSTACK_FREE (yyss1
);
1719 #endif /* no yyoverflow */
1721 yyssp
= yyss
+ yysize
- 1;
1722 yyvsp
= yyvs
+ yysize
- 1;
1723 yylsp
= yyls
+ yysize
- 1;
1725 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1726 (unsigned long int) yystacksize
));
1728 if (yyss
+ yystacksize
- 1 <= yyssp
)
1732 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1734 if (yystate
== YYFINAL
)
1744 /* Do appropriate processing given the current state. Read a
1745 lookahead token if we need one and don't already have one. */
1747 /* First try to decide what to do without reference to lookahead token. */
1748 yyn
= yypact
[yystate
];
1749 if (yyn
== YYPACT_NINF
)
1752 /* Not known => get a lookahead token if don't already have one. */
1754 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1755 if (yychar
== YYEMPTY
)
1757 YYDPRINTF ((stderr
, "Reading a token: "));
1761 if (yychar
<= YYEOF
)
1763 yychar
= yytoken
= YYEOF
;
1764 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1768 yytoken
= YYTRANSLATE (yychar
);
1769 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1772 /* If the proper action on seeing token YYTOKEN is to reduce or to
1773 detect an error, take that action. */
1775 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1780 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1786 /* Count tokens shifted since error; after three, turn off error
1791 /* Shift the lookahead token. */
1792 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1794 /* Discard the shifted token. */
1803 /*-----------------------------------------------------------.
1804 | yydefault -- do the default action for the current state. |
1805 `-----------------------------------------------------------*/
1807 yyn
= yydefact
[yystate
];
1813 /*-----------------------------.
1814 | yyreduce -- Do a reduction. |
1815 `-----------------------------*/
1817 /* yyn is the number of a rule to reduce with. */
1820 /* If YYLEN is nonzero, implement the default value of the action:
1823 Otherwise, the following line sets YYVAL to garbage.
1824 This behavior is undocumented and Bison
1825 users should not rely upon it. Assigning to YYVAL
1826 unconditionally makes the parser a bit smaller, and it avoids a
1827 GCC warning that YYVAL may be used uninitialized. */
1828 yyval
= yyvsp
[1-yylen
];
1830 /* Default location. */
1831 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1832 YY_REDUCE_PRINT (yyn
);
1836 /* Line 1269 of yacc.c. */
1837 #line 223 "parse-gram.y"
1838 { prologue_augment (translate_code ((yyvsp
[(1) - (1)].chars
), (yylsp
[(1) - (1)])), (yylsp
[(1) - (1)]), union_seen
); }
1842 /* Line 1269 of yacc.c. */
1843 #line 224 "parse-gram.y"
1844 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), true); }
1848 /* Line 1269 of yacc.c. */
1849 #line 225 "parse-gram.y"
1850 { prologue_augment ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)]), false); }
1854 /* Line 1269 of yacc.c. */
1855 #line 226 "parse-gram.y"
1856 { debug_flag
= true; }
1860 /* Line 1269 of yacc.c. */
1861 #line 227 "parse-gram.y"
1862 { muscle_insert ((yyvsp
[(2) - (3)].chars
), (yyvsp
[(3) - (3)].chars
)); }
1866 /* Line 1269 of yacc.c. */
1867 #line 228 "parse-gram.y"
1868 { defines_flag
= true; }
1872 /* Line 1269 of yacc.c. */
1873 #line 229 "parse-gram.y"
1874 { muscle_code_grow ("end_header", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1878 /* Line 1269 of yacc.c. */
1879 #line 230 "parse-gram.y"
1880 { error_verbose
= true; }
1884 /* Line 1269 of yacc.c. */
1885 #line 231 "parse-gram.y"
1886 { expected_sr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1890 /* Line 1269 of yacc.c. */
1891 #line 232 "parse-gram.y"
1892 { expected_rr_conflicts
= (yyvsp
[(2) - (2)].integer
); }
1896 /* Line 1269 of yacc.c. */
1897 #line 233 "parse-gram.y"
1898 { spec_file_prefix
= (yyvsp
[(3) - (3)].chars
); }
1902 /* Line 1269 of yacc.c. */
1903 #line 235 "parse-gram.y"
1905 nondeterministic_parser
= true;
1911 /* Line 1269 of yacc.c. */
1912 #line 240 "parse-gram.y"
1914 muscle_code_grow ("initial_action", translate_symbol_action ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
1919 /* Line 1269 of yacc.c. */
1920 #line 243 "parse-gram.y"
1921 { add_param ("lex_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1925 /* Line 1269 of yacc.c. */
1926 #line 244 "parse-gram.y"
1927 { locations_flag
= true; }
1931 /* Line 1269 of yacc.c. */
1932 #line 245 "parse-gram.y"
1933 { spec_name_prefix
= (yyvsp
[(3) - (3)].chars
); }
1937 /* Line 1269 of yacc.c. */
1938 #line 246 "parse-gram.y"
1939 { no_lines_flag
= true; }
1943 /* Line 1269 of yacc.c. */
1944 #line 247 "parse-gram.y"
1945 { nondeterministic_parser
= true; }
1949 /* Line 1269 of yacc.c. */
1950 #line 248 "parse-gram.y"
1951 { spec_outfile
= (yyvsp
[(3) - (3)].chars
); }
1955 /* Line 1269 of yacc.c. */
1956 #line 249 "parse-gram.y"
1957 { add_param ("parse_param", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1961 /* Line 1269 of yacc.c. */
1962 #line 250 "parse-gram.y"
1963 { pure_parser
= true; }
1967 /* Line 1269 of yacc.c. */
1968 #line 251 "parse-gram.y"
1969 { version_check (&(yylsp
[(2) - (2)]), (yyvsp
[(2) - (2)].chars
)); }
1973 /* Line 1269 of yacc.c. */
1974 #line 252 "parse-gram.y"
1975 { skeleton
= (yyvsp
[(2) - (2)].chars
); }
1979 /* Line 1269 of yacc.c. */
1980 #line 253 "parse-gram.y"
1981 { muscle_code_grow ("start_header", (yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
1985 /* Line 1269 of yacc.c. */
1986 #line 254 "parse-gram.y"
1987 { token_table_flag
= true; }
1991 /* Line 1269 of yacc.c. */
1992 #line 255 "parse-gram.y"
1993 { report_flag
= report_states
; }
1997 /* Line 1269 of yacc.c. */
1998 #line 256 "parse-gram.y"
1999 { yacc_flag
= true; }
2003 /* Line 1269 of yacc.c. */
2004 #line 264 "parse-gram.y"
2006 grammar_start_symbol_set ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]));
2011 /* Line 1269 of yacc.c. */
2012 #line 268 "parse-gram.y"
2015 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2016 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2017 symbol_list_destructor_set (list
, action
, (yylsp
[(2) - (3)]));
2018 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2023 /* Line 1269 of yacc.c. */
2024 #line 276 "parse-gram.y"
2027 const char *action
= translate_symbol_action ((yyvsp
[(2) - (3)].chars
), (yylsp
[(2) - (3)]));
2028 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2029 symbol_list_printer_set (list
, action
, (yylsp
[(2) - (3)]));
2030 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2035 /* Line 1269 of yacc.c. */
2036 #line 284 "parse-gram.y"
2038 default_prec
= true;
2043 /* Line 1269 of yacc.c. */
2044 #line 288 "parse-gram.y"
2046 default_prec
= false;
2051 /* Line 1269 of yacc.c. */
2052 #line 301 "parse-gram.y"
2057 /* Line 1269 of yacc.c. */
2058 #line 302 "parse-gram.y"
2059 { muscle_code_grow ("union_name", (yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2063 /* Line 1269 of yacc.c. */
2064 #line 307 "parse-gram.y"
2066 char const *body
= (yyvsp
[(3) - (3)].chars
);
2068 /* Concatenate the %union bodies. If this is the first %union, make sure
2069 the synchronization line appears after the opening '{' so as not to
2070 confuse Doxygen. Otherwise, turn the previous %union's trailing '}'
2071 into '\n', and omit the new %union's leading '{'. */
2074 muscle_grow ("stype", "{", "");
2078 char *code
= muscle_find ("stype");
2079 code
[strlen (code
) - 1] = '\n';
2084 muscle_code_grow ("stype", body
, (yylsp
[(3) - (3)]));
2089 /* Line 1269 of yacc.c. */
2090 #line 334 "parse-gram.y"
2091 { current_class
= nterm_sym
; }
2095 /* Line 1269 of yacc.c. */
2096 #line 335 "parse-gram.y"
2098 current_class
= unknown_sym
;
2099 current_type
= NULL
;
2104 /* Line 1269 of yacc.c. */
2105 #line 339 "parse-gram.y"
2106 { current_class
= token_sym
; }
2110 /* Line 1269 of yacc.c. */
2111 #line 340 "parse-gram.y"
2113 current_class
= unknown_sym
;
2114 current_type
= NULL
;
2119 /* Line 1269 of yacc.c. */
2120 #line 345 "parse-gram.y"
2124 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2125 symbol_type_set (list
->content
.sym
, (yyvsp
[(2) - (3)].uniqstr
), (yylsp
[(2) - (3)]));
2126 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2131 /* Line 1269 of yacc.c. */
2132 #line 356 "parse-gram.y"
2136 for (list
= (yyvsp
[(3) - (3)].list
); list
; list
= list
->next
)
2138 symbol_type_set (list
->content
.sym
, current_type
, (yylsp
[(2) - (3)]));
2139 symbol_precedence_set (list
->content
.sym
, current_prec
, (yyvsp
[(1) - (3)].assoc
), (yylsp
[(1) - (3)]));
2141 symbol_list_free ((yyvsp
[(3) - (3)].list
));
2142 current_type
= NULL
;
2147 /* Line 1269 of yacc.c. */
2148 #line 370 "parse-gram.y"
2149 { (yyval
.assoc
) = left_assoc
; }
2153 /* Line 1269 of yacc.c. */
2154 #line 371 "parse-gram.y"
2155 { (yyval
.assoc
) = right_assoc
; }
2159 /* Line 1269 of yacc.c. */
2160 #line 372 "parse-gram.y"
2161 { (yyval
.assoc
) = non_assoc
; }
2165 /* Line 1269 of yacc.c. */
2166 #line 376 "parse-gram.y"
2167 { current_type
= NULL
; }
2171 /* Line 1269 of yacc.c. */
2172 #line 377 "parse-gram.y"
2173 { current_type
= (yyvsp
[(1) - (1)].uniqstr
); tag_seen
= true; }
2177 /* Line 1269 of yacc.c. */
2178 #line 383 "parse-gram.y"
2179 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2183 /* Line 1269 of yacc.c. */
2184 #line 385 "parse-gram.y"
2185 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), symbol_list_sym_new ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)]))); }
2189 /* Line 1269 of yacc.c. */
2190 #line 389 "parse-gram.y"
2191 { (yyval
.list
) = (yyvsp
[(1) - (1)].list
); }
2195 /* Line 1269 of yacc.c. */
2196 #line 390 "parse-gram.y"
2197 { (yyval
.list
) = symbol_list_prepend ((yyvsp
[(1) - (2)].list
), (yyvsp
[(2) - (2)].list
)); }
2201 /* Line 1269 of yacc.c. */
2202 #line 394 "parse-gram.y"
2203 { (yyval
.list
) = symbol_list_sym_new ((yyvsp
[(1) - (1)].symbol
), (yylsp
[(1) - (1)])); }
2207 /* Line 1269 of yacc.c. */
2208 #line 395 "parse-gram.y"
2209 { (yyval
.list
) = symbol_list_type_new ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2213 /* Line 1269 of yacc.c. */
2214 #line 396 "parse-gram.y"
2215 { (yyval
.list
) = symbol_list_default_new ((yylsp
[(1) - (1)])); }
2219 /* Line 1269 of yacc.c. */
2220 #line 402 "parse-gram.y"
2222 current_type
= (yyvsp
[(1) - (1)].uniqstr
);
2228 /* Line 1269 of yacc.c. */
2229 #line 407 "parse-gram.y"
2231 symbol_class_set ((yyvsp
[(1) - (1)].symbol
), current_class
, (yylsp
[(1) - (1)]), true);
2232 symbol_type_set ((yyvsp
[(1) - (1)].symbol
), current_type
, (yylsp
[(1) - (1)]));
2237 /* Line 1269 of yacc.c. */
2238 #line 412 "parse-gram.y"
2240 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2241 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2242 symbol_user_token_number_set ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].integer
), (yylsp
[(2) - (2)]));
2247 /* Line 1269 of yacc.c. */
2248 #line 418 "parse-gram.y"
2250 symbol_class_set ((yyvsp
[(1) - (2)].symbol
), current_class
, (yylsp
[(1) - (2)]), true);
2251 symbol_type_set ((yyvsp
[(1) - (2)].symbol
), current_type
, (yylsp
[(1) - (2)]));
2252 symbol_make_alias ((yyvsp
[(1) - (2)].symbol
), (yyvsp
[(2) - (2)].symbol
), (yyloc
));
2257 /* Line 1269 of yacc.c. */
2258 #line 424 "parse-gram.y"
2260 symbol_class_set ((yyvsp
[(1) - (3)].symbol
), current_class
, (yylsp
[(1) - (3)]), true);
2261 symbol_type_set ((yyvsp
[(1) - (3)].symbol
), current_type
, (yylsp
[(1) - (3)]));
2262 symbol_user_token_number_set ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(2) - (3)].integer
), (yylsp
[(2) - (3)]));
2263 symbol_make_alias ((yyvsp
[(1) - (3)].symbol
), (yyvsp
[(3) - (3)].symbol
), (yyloc
));
2268 /* Line 1269 of yacc.c. */
2269 #line 454 "parse-gram.y"
2276 /* Line 1269 of yacc.c. */
2277 #line 460 "parse-gram.y"
2278 { current_lhs
= (yyvsp
[(1) - (1)].symbol
); current_lhs_location
= (yylsp
[(1) - (1)]); }
2282 /* Line 1269 of yacc.c. */
2283 #line 464 "parse-gram.y"
2284 { grammar_current_rule_end ((yylsp
[(1) - (1)])); }
2288 /* Line 1269 of yacc.c. */
2289 #line 465 "parse-gram.y"
2290 { grammar_current_rule_end ((yylsp
[(3) - (3)])); }
2294 /* Line 1269 of yacc.c. */
2295 #line 471 "parse-gram.y"
2296 { grammar_current_rule_begin (current_lhs
, current_lhs_location
); }
2300 /* Line 1269 of yacc.c. */
2301 #line 473 "parse-gram.y"
2302 { grammar_current_rule_symbol_append ((yyvsp
[(2) - (2)].symbol
), (yylsp
[(2) - (2)])); }
2306 /* Line 1269 of yacc.c. */
2307 #line 475 "parse-gram.y"
2308 { grammar_current_rule_action_append ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])); }
2312 /* Line 1269 of yacc.c. */
2313 #line 477 "parse-gram.y"
2314 { grammar_current_rule_prec_set ((yyvsp
[(3) - (3)].symbol
), (yylsp
[(3) - (3)])); }
2318 /* Line 1269 of yacc.c. */
2319 #line 479 "parse-gram.y"
2320 { grammar_current_rule_dprec_set ((yyvsp
[(3) - (3)].integer
), (yylsp
[(3) - (3)])); }
2324 /* Line 1269 of yacc.c. */
2325 #line 481 "parse-gram.y"
2326 { grammar_current_rule_merge_set ((yyvsp
[(3) - (3)].uniqstr
), (yylsp
[(3) - (3)])); }
2330 /* Line 1269 of yacc.c. */
2331 #line 497 "parse-gram.y"
2333 static char one
[] = "1";
2334 (yyval
.chars
) = one
;
2339 /* Line 1269 of yacc.c. */
2340 #line 507 "parse-gram.y"
2342 (yyvsp
[(1) - (1)].chars
)[strlen ((yyvsp
[(1) - (1)].chars
)) - 1] = '\n';
2343 (yyval
.chars
) = translate_code ((yyvsp
[(1) - (1)].chars
) + 1, (yylsp
[(1) - (1)]));
2348 /* Line 1269 of yacc.c. */
2349 #line 523 "parse-gram.y"
2350 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2354 /* Line 1269 of yacc.c. */
2355 #line 525 "parse-gram.y"
2357 (yyval
.symbol
) = symbol_get (char_name ((yyvsp
[(1) - (1)].character
)), (yylsp
[(1) - (1)]));
2358 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2359 symbol_user_token_number_set ((yyval
.symbol
), (yyvsp
[(1) - (1)].character
), (yylsp
[(1) - (1)]));
2364 /* Line 1269 of yacc.c. */
2365 #line 533 "parse-gram.y"
2366 { (yyval
.symbol
) = symbol_from_uniqstr ((yyvsp
[(1) - (1)].uniqstr
), (yylsp
[(1) - (1)])); }
2370 /* Line 1269 of yacc.c. */
2371 #line 545 "parse-gram.y"
2373 (yyval
.symbol
) = symbol_get (quotearg_style (c_quoting_style
, (yyvsp
[(1) - (1)].chars
)), (yylsp
[(1) - (1)]));
2374 symbol_class_set ((yyval
.symbol
), token_sym
, (yylsp
[(1) - (1)]), false);
2379 /* Line 1269 of yacc.c. */
2380 #line 554 "parse-gram.y"
2382 muscle_code_grow ("epilogue", translate_code ((yyvsp
[(2) - (2)].chars
), (yylsp
[(2) - (2)])), (yylsp
[(2) - (2)]));
2383 gram_scanner_last_string_free ();
2388 /* Line 1269 of yacc.c. */
2389 #line 2390 "parse-gram.c"
2392 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2396 YY_STACK_PRINT (yyss
, yyssp
);
2401 /* Now `shift' the result of the reduction. Determine what state
2402 that goes to, based on the state we popped back to and the rule
2403 number reduced by. */
2407 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2408 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2409 yystate
= yytable
[yystate
];
2411 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2416 /*------------------------------------.
2417 | yyerrlab -- here on detecting error |
2418 `------------------------------------*/
2420 /* If not already recovering from an error, report this error. */
2424 #if ! YYERROR_VERBOSE
2425 yyerror (YY_("syntax error"));
2428 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2429 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2431 YYSIZE_T yyalloc
= 2 * yysize
;
2432 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2433 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2434 if (yymsg
!= yymsgbuf
)
2435 YYSTACK_FREE (yymsg
);
2436 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2438 yymsg_alloc
= yyalloc
;
2442 yymsg_alloc
= sizeof yymsgbuf
;
2446 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2448 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2453 yyerror (YY_("syntax error"));
2455 goto yyexhaustedlab
;
2461 yyerror_range
[0] = yylloc
;
2463 if (yyerrstatus
== 3)
2465 /* If just tried and failed to reuse lookahead token after an
2466 error, discard it. */
2468 if (yychar
<= YYEOF
)
2470 /* Return failure if at end of input. */
2471 if (yychar
== YYEOF
)
2476 yydestruct ("Error: discarding",
2477 yytoken
, &yylval
, &yylloc
);
2482 /* Else will try to reuse lookahead token after shifting the error
2487 /*---------------------------------------------------.
2488 | yyerrorlab -- error raised explicitly by YYERROR. |
2489 `---------------------------------------------------*/
2492 /* Pacify compilers like GCC when the user code never invokes
2493 YYERROR and the label yyerrorlab therefore never appears in user
2495 if (/*CONSTCOND*/ 0)
2498 yyerror_range
[0] = yylsp
[1-yylen
];
2499 /* Do not reclaim the symbols of the rule which action triggered
2503 YY_STACK_PRINT (yyss
, yyssp
);
2508 /*-------------------------------------------------------------.
2509 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2510 `-------------------------------------------------------------*/
2512 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2516 yyn
= yypact
[yystate
];
2517 if (yyn
!= YYPACT_NINF
)
2520 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2528 /* Pop the current state because it cannot handle the error token. */
2532 yyerror_range
[0] = *yylsp
;
2533 yydestruct ("Error: popping",
2534 yystos
[yystate
], yyvsp
, yylsp
);
2537 YY_STACK_PRINT (yyss
, yyssp
);
2542 yyerror_range
[1] = yylloc
;
2543 /* Using YYLLOC is tempting, but would change the location of
2544 the lookahead. YYLOC is available though. */
2545 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
2548 /* Shift the error token. */
2549 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2555 /*-------------------------------------.
2556 | yyacceptlab -- YYACCEPT comes here. |
2557 `-------------------------------------*/
2562 /*-----------------------------------.
2563 | yyabortlab -- YYABORT comes here. |
2564 `-----------------------------------*/
2570 /*-------------------------------------------------.
2571 | yyexhaustedlab -- memory exhaustion comes here. |
2572 `-------------------------------------------------*/
2574 yyerror (YY_("memory exhausted"));
2580 if (yychar
!= YYEMPTY
)
2581 yydestruct ("Cleanup: discarding lookahead",
2582 yytoken
, &yylval
, &yylloc
);
2583 /* Do not reclaim the symbols of the rule which action triggered
2584 this YYABORT or YYACCEPT. */
2586 YY_STACK_PRINT (yyss
, yyssp
);
2587 while (yyssp
!= yyss
)
2589 yydestruct ("Cleanup: popping",
2590 yystos
[*yyssp
], yyvsp
, yylsp
);
2595 YYSTACK_FREE (yyss
);
2598 if (yymsg
!= yymsgbuf
)
2599 YYSTACK_FREE (yymsg
);
2601 /* Make sure YYID is used. */
2602 return YYID (yyresult
);
2606 /* Line 1486 of yacc.c. */
2607 #line 560 "parse-gram.y"
2611 /* Return the location of the left-hand side of a rule whose
2612 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2613 the right-hand side, and return an empty location equal to the end
2614 boundary of RHS[0] if the right-hand side is empty. */
2617 lloc_default (YYLTYPE
const *rhs
, int n
)
2622 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2623 The bug is fixed in 7.4.2m, but play it safe for now. */
2624 loc
.start
= rhs
[n
].end
;
2625 loc
.end
= rhs
[n
].end
;
2627 /* Ignore empty nonterminals the start of the the right-hand side.
2628 Do not bother to ignore them at the end of the right-hand side,
2629 since empty nonterminals have the same end as their predecessors. */
2630 for (i
= 1; i
<= n
; i
++)
2631 if (! equal_boundaries (rhs
[i
].start
, rhs
[i
].end
))
2633 loc
.start
= rhs
[i
].start
;
2641 /* Add a lex-param or a parse-param (depending on TYPE) with
2642 declaration DECL and location LOC. */
2645 add_param (char const *type
, char *decl
, location loc
)
2647 static char const alphanum
[26 + 26 + 1 + 10] =
2648 "abcdefghijklmnopqrstuvwxyz"
2649 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2652 char const *name_start
= NULL
;
2655 /* Stop on last actual character. */
2656 for (p
= decl
; p
[1]; p
++)
2658 || ! memchr (alphanum
, p
[-1], sizeof alphanum
))
2659 && memchr (alphanum
, p
[0], sizeof alphanum
- 10))
2662 /* Strip the surrounding '{' and '}', and any blanks just inside
2664 while (*--p
== ' ' || *p
== '\t')
2667 while (*++decl
== ' ' || *decl
== '\t')
2671 complain_at (loc
, _("missing identifier in parameter declaration"));
2678 memchr (alphanum
, name_start
[name_len
], sizeof alphanum
);
2682 name
= xmalloc (name_len
+ 1);
2683 memcpy (name
, name_start
, name_len
);
2684 name
[name_len
] = '\0';
2685 muscle_pair_list_grow (type
, decl
, name
);
2689 gram_scanner_last_string_free ();
2694 version_check (location
const *loc
, char const *version
)
2696 if (strverscmp (version
, PACKAGE_VERSION
) > 0)
2698 complain_at (*loc
, "require bison %s, but have %s",
2699 version
, PACKAGE_VERSION
);
2705 gram_error (location
const *loc
, char const *msg
)
2707 complain_at (*loc
, "%s", msg
);
2711 token_name (int type
)
2713 return yytname
[YYTRANSLATE (type
)];
2724 buf
[0] = '\''; buf
[1] = c
; buf
[2] = '\''; buf
[3] = '\0';
2725 return quotearg_style (escape_quoting_style
, buf
);