1 /* A Bison parser, made from parse-gram.y
4 /* Skeleton output parser for Bison,
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
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., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* As a special exception, when this file is copied by Bison into a
24 Bison output file, you may use that output file without restriction.
25 This special exception was added by the Free Software Foundation
26 in version 1.24 of Bison. */
28 /* This is the parser code that is written into each bison parser when
29 the %semantic_parser declaration is not specified in the grammar.
30 It was written by Richard Stallman by simplifying the original so
31 called ``semantic'' parser. */
33 /* All symbols defined below should begin with yy or YY, to avoid
34 infringing on user name space. This should be done even for local
35 variables, as they might otherwise be expanded by user macros.
36 There are some unavoidable exceptions within include files to
37 define necessary library symbols; they are noted "INFRINGES ON
38 USER NAME SPACE" below. */
40 /* Identify Bison output. */
46 /* Using locations. */
47 #define YYLSP_NEEDED 1
49 /* If NAME_PREFIX is specified substitute the variables and functions
51 #define yyparse gram_parse
52 #define yylex gram_lex
53 #define yyerror gram_error
54 #define yylval gram_lval
55 #define yychar gram_char
56 #define yydebug gram_debug
57 #define yynerrs gram_nerrs
58 #define yylloc gram_lloc
60 /* Copy the first part of user declarations. */
61 #line 31 "parse-gram.y"
64 #include "muscle_tab.h"
71 #include "conflicts.h"
73 /* Produce verbose parse errors. */
74 #define YYERROR_VERBOSE 1
75 #define YYLLOC_DEFAULT(Current, Rhs, N) \
79 Current.first_column = Rhs[1].first_column; \
80 Current.first_line = Rhs[1].first_line; \
81 Current.last_column = Rhs[N].last_column; \
82 Current.last_line = Rhs[N].last_line; \
90 /* Pass the control structure to YYPARSE and YYLEX. */
91 #define YYPARSE_PARAM gram_control
92 #define YYLEX_PARAM gram_control
93 /* YYPARSE receives GRAM_CONTROL as a void *. Provide a
94 correctly typed access to it. */
95 #define yycontrol ((gram_control_t *) gram_control)
97 /* Request detailed parse error messages, and pass them to
100 #define yyerror(Msg) \
101 gram_error (yycontrol, &yylloc, Msg)
103 #define YYPRINT(File, Type, Value) \
104 yyprint (File, Type, &Value)
105 static void yyprint (FILE *file
, int type
, const yystype
*value
);
107 symbol_class current_class
= unknown_sym
;
108 char *current_type
= 0;
109 symbol_t
*current_lhs
;
110 location_t current_lhs_location
;
111 associativity current_assoc
;
112 int current_prec
= 0;
113 braced_code_t current_braced_code
= action_braced_code
;
118 # if defined (__STDC__) || defined (__cplusplus)
119 /* Put the tokens into the symbol table, so that GDB and other debuggers
129 PERCENT_DESTRUCTOR
= 264,
130 PERCENT_PRINTER
= 265,
134 PERCENT_NONASSOC
= 269,
135 PERCENT_EXPECT
= 270,
138 PERCENT_VERBOSE
= 273,
139 PERCENT_ERROR_VERBOSE
= 274,
140 PERCENT_OUTPUT
= 275,
141 PERCENT_FILE_PREFIX
= 276,
142 PERCENT_NAME_PREFIX
= 277,
143 PERCENT_DEFINE
= 278,
144 PERCENT_PURE_PARSER
= 279,
145 PERCENT_DEFINES
= 280,
148 PERCENT_LOCATIONS
= 283,
149 PERCENT_NO_LINES
= 284,
150 PERCENT_SKELETON
= 285,
151 PERCENT_TOKEN_TABLE
= 286,
158 PERCENT_PERCENT
= 293,
164 /* POSIX requires `int' for tokens in interfaces. */
165 # define YYTOKENTYPE int
166 #endif /* !YYTOKENTYPE */
169 #define CHARACTER 259
171 #define PERCENT_TOKEN 261
172 #define PERCENT_NTERM 262
173 #define PERCENT_TYPE 263
174 #define PERCENT_DESTRUCTOR 264
175 #define PERCENT_PRINTER 265
176 #define PERCENT_UNION 266
177 #define PERCENT_LEFT 267
178 #define PERCENT_RIGHT 268
179 #define PERCENT_NONASSOC 269
180 #define PERCENT_EXPECT 270
181 #define PERCENT_START 271
182 #define PERCENT_PREC 272
183 #define PERCENT_VERBOSE 273
184 #define PERCENT_ERROR_VERBOSE 274
185 #define PERCENT_OUTPUT 275
186 #define PERCENT_FILE_PREFIX 276
187 #define PERCENT_NAME_PREFIX 277
188 #define PERCENT_DEFINE 278
189 #define PERCENT_PURE_PARSER 279
190 #define PERCENT_DEFINES 280
191 #define PERCENT_YACC 281
192 #define PERCENT_DEBUG 282
193 #define PERCENT_LOCATIONS 283
194 #define PERCENT_NO_LINES 284
195 #define PERCENT_SKELETON 285
196 #define PERCENT_TOKEN_TABLE 286
199 #define SEMICOLON 289
203 #define PERCENT_PERCENT 293
206 #define BRACED_CODE 296
211 /* Enabling traces. */
216 /* Enabling verbose error messages. */
217 #ifdef YYERROR_VERBOSE
218 # undef YYERROR_VERBOSE
219 # define YYERROR_VERBOSE 1
221 # define YYERROR_VERBOSE 0
225 #line 88 "parse-gram.y"
233 /* Line 232 of /usr/local/share/bison/bison.simple. */
234 #line 235 "parse-gram.c"
235 # define YYSTYPE yystype
236 # define YYSTYPE_IS_TRIVIAL 1
240 typedef struct yyltype
247 # define YYLTYPE yyltype
248 # define YYLTYPE_IS_TRIVIAL 1
251 /* Copy the second part of user declarations. */
254 /* Line 252 of /usr/local/share/bison/bison.simple. */
255 #line 256 "parse-gram.c"
257 #if ! defined (yyoverflow) || YYERROR_VERBOSE
259 /* The parser invokes alloca or malloc; define the necessary symbols. */
261 # if YYSTACK_USE_ALLOCA
262 # define YYSTACK_ALLOC alloca
264 # ifndef YYSTACK_USE_ALLOCA
265 # if defined (alloca) || defined (_ALLOCA_H)
266 # define YYSTACK_ALLOC alloca
269 # define YYSTACK_ALLOC __builtin_alloca
275 # ifdef YYSTACK_ALLOC
276 /* Pacify GCC's `empty if-body' warning. */
277 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
279 # if defined (__STDC__) || defined (__cplusplus)
280 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
281 # define YYSIZE_T size_t
283 # define YYSTACK_ALLOC malloc
284 # define YYSTACK_FREE free
286 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
289 #if (! defined (yyoverflow) \
290 && (! defined (__cplusplus) \
291 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
293 /* A type that is properly aligned for any stack member. */
301 /* The size of the maximum gap between one aligned stack and the next. */
302 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
304 /* The size of an array large to enough to hold all stacks, each with
306 # define YYSTACK_BYTES(N) \
307 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
308 + 2 * YYSTACK_GAP_MAX)
310 /* Copy COUNT objects from FROM to TO. The source and destination do
314 # define YYCOPY(To, From, Count) \
315 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
317 # define YYCOPY(To, From, Count) \
320 register YYSIZE_T yyi; \
321 for (yyi = 0; yyi < (Count); yyi++) \
322 (To)[yyi] = (From)[yyi]; \
328 /* Relocate STACK from its old location to the new one. The
329 local variables YYSIZE and YYSTACKSIZE give the old and new number of
330 elements in the stack, and YYPTR gives the new location of the
331 stack. Advance YYPTR to a properly aligned location for the next
333 # define YYSTACK_RELOCATE(Stack) \
336 YYSIZE_T yynewbytes; \
337 YYCOPY (&yyptr->Stack, Stack, yysize); \
338 Stack = &yyptr->Stack; \
339 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
340 yyptr += yynewbytes / sizeof (*yyptr); \
346 /* YYFINAL -- State number of the termination state. */
348 #define YYFLAG -32768
351 /* YYNTOKENS -- Number of terminals. */
353 /* YYNNTS -- Number of nonterminals. */
355 /* YYNRULES -- Number of rules. */
357 /* YYNRULES -- Number of states. */
358 #define YYNSTATES 101
360 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
362 #define YYMAXUTOK 296
364 #define YYTRANSLATE(X) \
365 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
367 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
368 static const unsigned char yytranslate
[] =
370 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
371 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
374 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
375 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
376 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
377 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
378 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
379 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
396 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
397 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
398 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
399 35, 36, 37, 38, 39, 40, 41
403 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
405 static const unsigned char yyprhs
[] =
407 0, 0, 3, 8, 9, 13, 15, 17, 19, 23,
408 25, 27, 30, 34, 36, 40, 42, 46, 48, 51,
409 53, 55, 57, 59, 61, 64, 67, 68, 73, 74,
410 79, 80, 84, 85, 89, 93, 97, 99, 101, 103,
411 104, 106, 108, 111, 113, 115, 118, 121, 125, 127,
412 130, 132, 135, 137, 140, 141, 147, 149, 153, 154,
413 157, 160, 164, 166, 168, 170, 172, 174, 176, 177,
417 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
418 static const signed char yyrhs
[] =
420 43, 0, -1, 44, 38, 58, 68, -1, -1, 44,
421 45, 69, -1, 46, -1, 39, -1, 27, -1, 23,
422 67, 67, -1, 25, -1, 19, -1, 15, 5, -1,
423 21, 33, 67, -1, 28, -1, 22, 33, 67, -1,
424 29, -1, 20, 33, 67, -1, 24, -1, 30, 67,
425 -1, 31, -1, 18, -1, 26, -1, 52, -1, 49,
426 -1, 16, 64, -1, 11, 41, -1, -1, 9, 47,
427 41, 55, -1, -1, 10, 48, 41, 55, -1, -1,
428 7, 50, 57, -1, -1, 6, 51, 57, -1, 8,
429 32, 55, -1, 53, 54, 55, -1, 12, -1, 13,
430 -1, 14, -1, -1, 32, -1, 64, -1, 55, 64,
431 -1, 32, -1, 37, -1, 37, 5, -1, 37, 66,
432 -1, 37, 5, 66, -1, 56, -1, 57, 56, -1,
433 59, -1, 58, 59, -1, 60, -1, 46, 34, -1,
434 -1, 37, 35, 61, 62, 34, -1, 63, -1, 62,
435 36, 63, -1, -1, 63, 64, -1, 63, 65, -1,
436 63, 17, 64, -1, 37, -1, 66, -1, 4, -1,
437 41, -1, 3, -1, 3, -1, -1, 38, 40, -1,
441 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
442 static const unsigned short yyrline
[] =
444 0, 155, 155, 168, 170, 173, 175, 176, 177, 178,
445 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
446 189, 190, 193, 195, 196, 200, 207, 206, 217, 216,
447 229, 228, 234, 234, 239, 248, 263, 265, 266, 269,
448 271, 276, 278, 282, 287, 292, 298, 304, 314, 317,
449 326, 328, 334, 336, 340, 339, 344, 346, 349, 352,
450 354, 356, 360, 362, 363, 366, 372, 381, 389, 394,
455 #if YYDEBUG || YYERROR_VERBOSE
456 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
457 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
458 static const char *const yytname
[] =
460 "\"end of string\"", "error", "$undefined.", "STRING", "CHARACTER", "INT",
461 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
462 "\"%printer\"", "\"%union\"", "\"%left\"", "\"%right\"",
463 "\"%nonassoc\"", "\"%expect\"", "\"%start\"", "\"%prec\"",
464 "\"%verbose\"", "\"%error-verbose\"", "\"%output\"", "\"%file-prefix\"",
465 "\"%name-prefix\"", "\"%define\"", "\"%pure-parser\"", "\"%defines\"",
466 "\"%yacc\"", "\"%debug\"", "\"%locations\"", "\"%no-lines\"",
467 "\"%skeleton\"", "\"%token-table\"", "TYPE", "\"=\"", "\";\"", "\":\"",
468 "\"|\"", "\"identifier\"", "\"%%\"", "PROLOGUE", "EPILOGUE",
469 "BRACED_CODE", "$axiom", "input", "declarations", "declaration",
470 "grammar_declaration", "@1", "@2", "symbol_declaration", "@3", "@4",
471 "precedence_declaration", "precedence_declarator", "type.opt",
472 "symbols.1", "symbol_def", "symbol_defs.1", "grammar",
473 "rules_or_grammar_declaration", "rules", "@5", "rhses.1", "rhs",
474 "symbol", "action", "string_as_id", "string_content", "epilogue.opt",
479 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
481 static const short yytoknum
[] =
483 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
484 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
485 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
486 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
490 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
491 static const unsigned char yyr1
[] =
493 0, 42, 43, 44, 44, 45, 45, 45, 45, 45,
494 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
495 45, 45, 46, 46, 46, 46, 47, 46, 48, 46,
496 50, 49, 51, 49, 49, 52, 53, 53, 53, 54,
497 54, 55, 55, 56, 56, 56, 56, 56, 57, 57,
498 58, 58, 59, 59, 61, 60, 62, 62, 63, 63,
499 63, 63, 64, 64, 64, 65, 66, 67, 68, 68,
503 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
504 static const unsigned char yyr2
[] =
506 0, 2, 4, 0, 3, 1, 1, 1, 3, 1,
507 1, 2, 3, 1, 3, 1, 3, 1, 2, 1,
508 1, 1, 1, 1, 2, 2, 0, 4, 0, 4,
509 0, 3, 0, 3, 3, 3, 1, 1, 1, 0,
510 1, 1, 2, 1, 1, 2, 2, 3, 1, 2,
511 1, 2, 1, 2, 0, 5, 1, 3, 0, 2,
512 2, 3, 1, 1, 1, 1, 1, 1, 0, 2,
516 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
517 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
518 means the default is an error. */
519 static const short yydefact
[] =
521 3, 0, 0, 0, 32, 30, 0, 26, 28, 0,
522 36, 37, 38, 0, 0, 20, 10, 0, 0, 0,
523 0, 17, 9, 21, 7, 13, 15, 0, 19, 0,
524 6, 70, 5, 23, 22, 39, 0, 0, 0, 0,
525 0, 25, 11, 66, 64, 62, 24, 63, 0, 0,
526 0, 67, 0, 18, 0, 0, 68, 50, 52, 71,
527 4, 40, 0, 43, 44, 48, 33, 31, 34, 41,
528 0, 0, 16, 12, 14, 8, 54, 53, 0, 51,
529 2, 35, 45, 46, 49, 42, 27, 29, 58, 69,
530 47, 0, 56, 55, 58, 0, 65, 59, 60, 57,
534 /* YYPGOTO[NTERM-NUM]. */
535 static const short yydefgoto
[] =
537 -1, 1, 2, 31, 55, 39, 40, 33, 37, 36,
538 34, 35, 62, 68, 65, 66, 56, 57, 58, 88,
539 91, 92, 69, 98, 47, 52, 80, 60
542 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
544 static const short yypact
[] =
546 -32768, 8, 80,-32768,-32768,-32768, -19,-32768,-32768, -11,
547 -32768,-32768,-32768, 31, 0,-32768,-32768, 5, 9, 11,
548 40,-32768,-32768,-32768,-32768,-32768,-32768, 40,-32768, 114,
549 -32768, 12,-32768,-32768,-32768, 13, -27, -27, 0, 14,
550 15,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 40, 40,
551 40,-32768, 40,-32768, 16, 18, 10,-32768,-32768,-32768,
552 -32768,-32768, 0,-32768, 6,-32768, -27, -27, 0,-32768,
553 0, 0,-32768,-32768,-32768,-32768,-32768,-32768, 17,-32768,
554 -32768, 0, 46,-32768,-32768,-32768, 0, 0,-32768,-32768,
555 -32768, -22, -2,-32768,-32768, 0,-32768,-32768,-32768, -2,
559 /* YYPGOTO[NTERM-NUM]. */
560 static const short yypgoto
[] =
562 -32768,-32768,-32768,-32768, 48,-32768,-32768,-32768,-32768,-32768,
563 -32768,-32768,-32768, -30, -33, 21,-32768, -3,-32768,-32768,
564 -32768, -35, -14,-32768, -57, -21,-32768,-32768
567 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
568 positive, shift that token. If negative, reduce the rule which
569 number is the opposite. If zero, do what YYDEFACT says. */
570 static const short yytable
[] =
572 46, 43, 44, 43, 44, 63, 53, 83, 3, 43,
573 64, 82, 93, 38, 94, 95, 4, 5, 6, 7,
574 8, 9, 10, 11, 12, 90, 14, 72, 73, 74,
575 41, 75, 81, 84, 84, 45, 42, 45, 48, 96,
576 86, 87, 49, 51, 50, 61, 59, 54, 78, 43,
577 32, 76, 77, 79, 85, 70, 71, 89, 67, 99,
578 0, 0, 0, 0, 0, 0, 0, 85, 0, 0,
579 0, 0, 85, 85, 0, 0, 0, 0, 97, 0,
580 0, 100, 0, 0, 0, 97, 4, 5, 6, 7,
581 8, 9, 10, 11, 12, 13, 14, 0, 15, 16,
582 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
583 27, 28, 0, 0, 0, 0, 0, 0, 29, 30,
584 4, 5, 6, 7, 8, 9, 10, 11, 12, 0,
585 14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
586 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
590 static const short yycheck
[] =
592 14, 3, 4, 3, 4, 32, 27, 64, 0, 3,
593 37, 5, 34, 32, 36, 17, 6, 7, 8, 9,
594 10, 11, 12, 13, 14, 82, 16, 48, 49, 50,
595 41, 52, 62, 66, 67, 37, 5, 37, 33, 41,
596 70, 71, 33, 3, 33, 32, 34, 37, 38, 3,
597 2, 35, 34, 56, 68, 41, 41, 40, 37, 94,
598 -1, -1, -1, -1, -1, -1, -1, 81, -1, -1,
599 -1, -1, 86, 87, -1, -1, -1, -1, 92, -1,
600 -1, 95, -1, -1, -1, 99, 6, 7, 8, 9,
601 10, 11, 12, 13, 14, 15, 16, -1, 18, 19,
602 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
603 30, 31, -1, -1, -1, -1, -1, -1, 38, 39,
604 6, 7, 8, 9, 10, 11, 12, 13, 14, -1,
605 16, -1, -1, -1, -1, -1, -1, -1, -1, -1,
606 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
610 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
611 symbol of state STATE-NUM. */
612 static const unsigned char yystos
[] =
614 0, 43, 44, 0, 6, 7, 8, 9, 10, 11,
615 12, 13, 14, 15, 16, 18, 19, 20, 21, 22,
616 23, 24, 25, 26, 27, 28, 29, 30, 31, 38,
617 39, 45, 46, 49, 52, 53, 51, 50, 32, 47,
618 48, 41, 5, 3, 4, 37, 64, 66, 33, 33,
619 33, 3, 67, 67, 37, 46, 58, 59, 60, 34,
620 69, 32, 54, 32, 37, 56, 57, 57, 55, 64,
621 41, 41, 67, 67, 67, 67, 35, 34, 38, 59,
622 68, 55, 5, 66, 56, 64, 55, 55, 61, 40,
623 66, 62, 63, 34, 36, 17, 41, 64, 65, 63,
627 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
628 # define YYSIZE_T __SIZE_TYPE__
630 #if ! defined (YYSIZE_T) && defined (size_t)
631 # define YYSIZE_T size_t
633 #if ! defined (YYSIZE_T)
634 # if defined (__STDC__) || defined (__cplusplus)
635 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
636 # define YYSIZE_T size_t
639 #if ! defined (YYSIZE_T)
640 # define YYSIZE_T unsigned int
643 #define yyerrok (yyerrstatus = 0)
644 #define yyclearin (yychar = YYEMPTY)
648 #define YYACCEPT goto yyacceptlab
649 #define YYABORT goto yyabortlab
650 #define YYERROR goto yyerrlab1
652 /* Like YYERROR except do call yyerror. This remains here temporarily
653 to ease the transition to the new meaning of YYERROR, for GCC.
654 Once GCC version 2 has supplanted version 1, this can go. */
656 #define YYFAIL goto yyerrlab
658 #define YYRECOVERING() (!!yyerrstatus)
660 #define YYBACKUP(Token, Value) \
662 if (yychar == YYEMPTY && yylen == 1) \
666 yychar1 = YYTRANSLATE (yychar); \
672 yyerror ("syntax error: cannot back up"); \
678 #define YYERRCODE 256
680 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
683 #ifndef YYLLOC_DEFAULT
684 # define YYLLOC_DEFAULT(Current, Rhs, N) \
685 Current.first_line = Rhs[1].first_line; \
686 Current.first_column = Rhs[1].first_column; \
687 Current.last_line = Rhs[N].last_line; \
688 Current.last_column = Rhs[N].last_column;
691 /* YYLEX -- calling `yylex' with the right arguments. */
694 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
696 # define YYLEX yylex (&yylval, &yylloc)
699 /* Enable debugging if requested. */
703 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
704 # define YYFPRINTF fprintf
707 # define YYDPRINTF(Args) \
712 # define YYDSYMPRINT(Args) \
717 /* Nonzero means print parse trace. It is left uninitialized so that
718 multiple parsers can coexist. */
721 # define YYDPRINTF(Args)
722 # define YYDSYMPRINT(Args)
723 #endif /* !YYDEBUG */
725 /* YYINITDEPTH -- initial size of the parser's stacks. */
727 # define YYINITDEPTH 200
730 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
731 if the built-in stack extension method is used).
733 Do not make this value too large; the results are undefined if
734 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
735 evaluated with infinite-precision integer arithmetic. */
742 # define YYMAXDEPTH 10000
750 # if defined (__GLIBC__) && defined (_STRING_H)
751 # define yystrlen strlen
753 /* Return the length of YYSTR. */
755 # if defined (__STDC__) || defined (__cplusplus)
756 yystrlen (const char *yystr
)
762 register const char *yys
= yystr
;
764 while (*yys
++ != '\0')
767 return yys
- yystr
- 1;
773 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
774 # define yystpcpy stpcpy
776 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
779 # if defined (__STDC__) || defined (__cplusplus)
780 yystpcpy (char *yydest
, const char *yysrc
)
782 yystpcpy (yydest
, yysrc
)
787 register char *yyd
= yydest
;
788 register const char *yys
= yysrc
;
790 while ((*yyd
++ = *yys
++) != '\0')
798 #endif /* !YYERROR_VERBOSE */
802 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
803 into yyparse. The argument should have type void *.
804 It should actually point to an object.
805 Grammar actions can access the variable by casting it
806 to the proper pointer type. */
809 # if defined (__STDC__) || defined (__cplusplus)
810 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
811 # define YYPARSE_PARAM_DECL
813 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
814 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
816 #else /* !YYPARSE_PARAM */
817 # define YYPARSE_PARAM_ARG
818 # define YYPARSE_PARAM_DECL
819 #endif /* !YYPARSE_PARAM */
821 /* Prevent warning if -Wstrict-prototypes. */
823 # ifdef YYPARSE_PARAM
824 int yyparse (void *);
830 #if defined (__STDC__) || defined (__cplusplus)
831 static void yydestructor (int yytype
,
832 YYSTYPE yyvalue
, YYLTYPE yylocation
);
834 static void yysymprint (FILE* out
, int yytype
,
835 YYSTYPE yyvalue
, YYLTYPE yylocation
);
843 yyparse (YYPARSE_PARAM_ARG
)
846 /* The lookahead symbol. */
849 /* The semantic value of the lookahead symbol. */
852 /* Number of parse errors so far. */
854 /* Location data for the lookahead symbol. */
857 register int yystate
;
860 /* Number of tokens to shift before error messages enabled. */
862 /* Lookahead token as an internal (translated) token number. */
865 /* Three stacks and their tools:
866 `yyss': related to states,
867 `yyvs': related to semantic values,
868 `yyls': related to locations.
870 Refer to the stacks thru separate pointers, to allow yyoverflow
871 to reallocate them elsewhere. */
873 /* The state stack. */
874 short yyssa
[YYINITDEPTH
];
876 register short *yyssp
;
878 /* The semantic value stack. */
879 YYSTYPE yyvsa
[YYINITDEPTH
];
880 YYSTYPE
*yyvs
= yyvsa
;
881 register YYSTYPE
*yyvsp
;
883 /* The location stack. */
884 YYLTYPE yylsa
[YYINITDEPTH
];
885 YYLTYPE
*yyls
= yylsa
;
888 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
890 YYSIZE_T yystacksize
= YYINITDEPTH
;
892 /* The variables used to return semantic value and location from the
897 /* When reducing, the number of symbols on the RHS of the reduced
901 YYDPRINTF ((stderr
, "Starting parse\n"));
906 yychar
= YYEMPTY
; /* Cause a token to be read. */
908 /* Initialize stack pointers.
909 Waste one element of value and location stack
910 so that they stay on the same level as the state stack.
911 The wasted elements are never initialized. */
918 /*------------------------------------------------------------.
919 | yynewstate -- Push a new state, which is found in yystate. |
920 `------------------------------------------------------------*/
922 /* In all cases, when you get here, the value and location stacks
923 have just been pushed. so pushing a state here evens the stacks.
930 if (yyssp
>= yyss
+ yystacksize
- 1)
932 /* Get the current used size of the three stacks, in elements. */
933 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
937 /* Give user a chance to reallocate the stack. Use copies of
938 these so that the &'s don't force the real ones into
940 YYSTYPE
*yyvs1
= yyvs
;
942 YYLTYPE
*yyls1
= yyls
;
944 /* Each stack pointer address is followed by the size of the
945 data in use in that stack, in bytes. This used to be a
946 conditional around just the two extra args, but that might
947 be undefined if yyoverflow is a macro. */
948 yyoverflow ("parser stack overflow",
949 &yyss1
, yysize
* sizeof (*yyssp
),
950 &yyvs1
, yysize
* sizeof (*yyvsp
),
951 &yyls1
, yysize
* sizeof (*yylsp
),
957 #else /* no yyoverflow */
958 # ifndef YYSTACK_RELOCATE
961 /* Extend the stack our own way. */
962 if (yystacksize
>= YYMAXDEPTH
)
965 if (yystacksize
> YYMAXDEPTH
)
966 yystacksize
= YYMAXDEPTH
;
970 union yyalloc
*yyptr
=
971 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
974 YYSTACK_RELOCATE (yyss
);
975 YYSTACK_RELOCATE (yyvs
);
976 YYSTACK_RELOCATE (yyls
);
977 # undef YYSTACK_RELOCATE
979 YYSTACK_FREE (yyss1
);
982 #endif /* no yyoverflow */
984 yyssp
= yyss
+ yysize
- 1;
985 yyvsp
= yyvs
+ yysize
- 1;
986 yylsp
= yyls
+ yysize
- 1;
988 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
989 (unsigned long int) yystacksize
));
991 if (yyssp
>= yyss
+ yystacksize
- 1)
995 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1004 /* Do appropriate processing given the current state. */
1005 /* Read a lookahead token if we need one and don't already have one. */
1008 /* First try to decide what to do without reference to lookahead token. */
1010 yyn
= yypact
[yystate
];
1014 /* Not known => get a lookahead token if don't already have one. */
1016 /* yychar is either YYEMPTY or YYEOF
1017 or a valid token in external form. */
1019 if (yychar
== YYEMPTY
)
1021 YYDPRINTF ((stderr
, "Reading a token: "));
1025 /* Convert token to internal form (in yychar1) for indexing tables with. */
1027 if (yychar
<= 0) /* This means end of input. */
1030 yychar
= YYEOF
; /* Don't call YYLEX any more. */
1032 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1036 yychar1
= YYTRANSLATE (yychar
);
1038 /* We have to keep this `#if YYDEBUG', since we use variables
1039 which are defined only if `YYDEBUG' is set. */
1040 YYDPRINTF ((stderr
, "Next token is "));
1041 YYDSYMPRINT ((stderr
, yychar1
, yylval
, yyloc
));
1042 YYDPRINTF ((stderr
, "\n"));
1046 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
1051 /* yyn is what to do for this token type in this state.
1052 Negative => reduce, -yyn is rule number.
1053 Positive => shift, yyn is new state.
1054 New state is final state => don't bother to shift,
1055 just return success.
1056 0, or most negative number => error. */
1071 /* Shift the lookahead token. */
1072 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1073 yychar
, yytname
[yychar1
]));
1075 /* Discard the token being shifted unless it is eof. */
1076 if (yychar
!= YYEOF
)
1082 /* Count tokens shifted since error; after three, turn off error
1091 /*-----------------------------------------------------------.
1092 | yydefault -- do the default action for the current state. |
1093 `-----------------------------------------------------------*/
1095 yyn
= yydefact
[yystate
];
1101 /*-----------------------------.
1102 | yyreduce -- Do a reduction. |
1103 `-----------------------------*/
1105 /* yyn is the number of a rule to reduce with. */
1108 /* If YYLEN is nonzero, implement the default value of the action:
1111 Otherwise, the following line sets YYVAL to the semantic value of
1112 the lookahead token. This behavior is undocumented and Bison
1113 users should not rely upon it. Assigning to YYVAL
1114 unconditionally makes the parser a bit smaller, and it avoids a
1115 GCC warning that YYVAL may be used uninitialized. */
1116 yyval
= yyvsp
[1-yylen
];
1118 /* Default location. */
1119 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1122 /* We have to keep this `#if YYDEBUG', since we use variables which
1123 are defined only if `YYDEBUG' is set. */
1128 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1129 yyn
- 1, yyrline
[yyn
]);
1131 /* Print the symbols being reduced, and their result. */
1132 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] >= 0; yyi
++)
1133 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1134 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1140 #line 157 "parse-gram.y"
1142 yycontrol
->errcode
= 0;
1143 epilogue_set (yyvsp
[0].string
, yylsp
[0]);
1148 #line 175 "parse-gram.y"
1149 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1153 #line 176 "parse-gram.y"
1158 #line 177 "parse-gram.y"
1159 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1163 #line 178 "parse-gram.y"
1164 { defines_flag
= 1; }
1168 #line 179 "parse-gram.y"
1169 { error_verbose
= 1; }
1173 #line 180 "parse-gram.y"
1174 { expected_conflicts
= yyvsp
[0].integer
; }
1178 #line 181 "parse-gram.y"
1179 { spec_file_prefix
= yyvsp
[0].string
; }
1183 #line 182 "parse-gram.y"
1184 { locations_flag
= 1; }
1188 #line 183 "parse-gram.y"
1189 { spec_name_prefix
= yyvsp
[0].string
; }
1193 #line 184 "parse-gram.y"
1194 { no_lines_flag
= 1; }
1198 #line 185 "parse-gram.y"
1199 { spec_outfile
= yyvsp
[0].string
; }
1203 #line 186 "parse-gram.y"
1204 { pure_parser
= 1; }
1208 #line 187 "parse-gram.y"
1209 { skeleton
= yyvsp
[0].string
; }
1213 #line 188 "parse-gram.y"
1214 { token_table_flag
= 1; }
1218 #line 189 "parse-gram.y"
1219 { report_flag
= 1; }
1223 #line 190 "parse-gram.y"
1228 #line 197 "parse-gram.y"
1230 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1235 #line 201 "parse-gram.y"
1238 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1239 muscle_insert ("stype", yyvsp
[0].string
);
1244 #line 207 "parse-gram.y"
1245 { current_braced_code
= destructor_braced_code
; }
1249 #line 209 "parse-gram.y"
1251 symbol_list_t
*list
;
1252 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1253 symbol_destructor_set (list
->sym
, list
->location
, yyvsp
[-1].string
);
1254 symbol_list_free (yyvsp
[0].list
);
1255 current_braced_code
= action_braced_code
;
1260 #line 217 "parse-gram.y"
1261 { current_braced_code
= printer_braced_code
; }
1265 #line 219 "parse-gram.y"
1267 symbol_list_t
*list
;
1268 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1269 symbol_printer_set (list
->sym
, yyvsp
[-1].string
, list
->location
);
1270 symbol_list_free (yyvsp
[0].list
);
1271 current_braced_code
= action_braced_code
;
1276 #line 229 "parse-gram.y"
1277 { current_class
= nterm_sym
; }
1281 #line 230 "parse-gram.y"
1283 current_class
= unknown_sym
;
1284 current_type
= NULL
;
1289 #line 234 "parse-gram.y"
1290 { current_class
= token_sym
; }
1294 #line 235 "parse-gram.y"
1296 current_class
= unknown_sym
;
1297 current_type
= NULL
;
1302 #line 240 "parse-gram.y"
1304 symbol_list_t
*list
;
1305 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1306 symbol_type_set (list
->sym
, list
->location
, yyvsp
[-1].string
);
1307 symbol_list_free (yyvsp
[0].list
);
1312 #line 250 "parse-gram.y"
1314 symbol_list_t
*list
;
1316 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1318 symbol_type_set (list
->sym
, list
->location
, current_type
);
1319 symbol_precedence_set (list
->sym
, list
->location
, current_prec
, yyvsp
[-2].assoc
);
1321 symbol_list_free (yyvsp
[0].list
);
1322 current_type
= NULL
;
1327 #line 264 "parse-gram.y"
1328 { yyval
.assoc
= left_assoc
; }
1332 #line 265 "parse-gram.y"
1333 { yyval
.assoc
= right_assoc
; }
1337 #line 266 "parse-gram.y"
1338 { yyval
.assoc
= non_assoc
; }
1342 #line 270 "parse-gram.y"
1343 { current_type
= NULL
;}
1347 #line 271 "parse-gram.y"
1348 { current_type
= yyvsp
[0].string
; }
1352 #line 277 "parse-gram.y"
1353 { yyval
.list
= symbol_list_new (yyvsp
[0].symbol
, yylsp
[0]); }
1357 #line 278 "parse-gram.y"
1358 { yyval
.list
= symbol_list_prepend (yyvsp
[-1].list
, yyvsp
[0].symbol
, yylsp
[0]); }
1362 #line 284 "parse-gram.y"
1364 current_type
= yyvsp
[0].string
;
1369 #line 288 "parse-gram.y"
1371 symbol_class_set (yyvsp
[0].symbol
, current_class
, yylsp
[0]);
1372 symbol_type_set (yyvsp
[0].symbol
, yylsp
[0], current_type
);
1377 #line 293 "parse-gram.y"
1379 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1380 symbol_type_set (yyvsp
[-1].symbol
, yylsp
[-1], current_type
);
1381 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
, yylsp
[0]);
1386 #line 299 "parse-gram.y"
1388 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1389 symbol_type_set (yyvsp
[-1].symbol
, yylsp
[-1], current_type
);
1390 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
);
1395 #line 305 "parse-gram.y"
1397 symbol_class_set (yyvsp
[-2].symbol
, current_class
, yylsp
[-2]);
1398 symbol_type_set (yyvsp
[-2].symbol
, yylsp
[-2], current_type
);
1399 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
, yylsp
[-1]);
1400 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
);
1405 #line 316 "parse-gram.y"
1410 #line 318 "parse-gram.y"
1415 #line 340 "parse-gram.y"
1416 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1420 #line 341 "parse-gram.y"
1425 #line 345 "parse-gram.y"
1426 { grammar_rule_end (yylsp
[0]); }
1430 #line 346 "parse-gram.y"
1431 { grammar_rule_end (yylsp
[0]); }
1435 #line 351 "parse-gram.y"
1436 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1440 #line 353 "parse-gram.y"
1441 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1445 #line 355 "parse-gram.y"
1446 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1450 #line 357 "parse-gram.y"
1451 { grammar_current_rule_prec_set (yyvsp
[0].symbol
, yylsp
[0]); }
1455 #line 361 "parse-gram.y"
1456 { yyval
.symbol
= yyvsp
[0].symbol
; }
1460 #line 362 "parse-gram.y"
1461 { yyval
.symbol
= yyvsp
[0].symbol
; }
1465 #line 363 "parse-gram.y"
1466 { yyval
.symbol
= getsym (yyvsp
[0].string
, yylsp
[0]); }
1470 #line 368 "parse-gram.y"
1471 { yyval
.string
= yyvsp
[0].string
; }
1475 #line 374 "parse-gram.y"
1477 yyval
.symbol
= getsym (yyvsp
[0].string
, yylsp
[0]);
1478 symbol_class_set (yyval
.symbol
, token_sym
, yylsp
[0]);
1483 #line 383 "parse-gram.y"
1485 yyval
.string
= yyvsp
[0].string
+ 1;
1486 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1491 #line 391 "parse-gram.y"
1493 yyval
.string
= xstrdup ("");
1498 #line 395 "parse-gram.y"
1500 yyval
.string
= yyvsp
[0].string
;
1507 /* Line 1000 of /usr/local/share/bison/bison.simple. */
1508 #line 1509 "parse-gram.c"
1517 short *yyssp1
= yyss
- 1;
1518 YYFPRINTF (stderr
, "state stack now");
1519 while (yyssp1
!= yyssp
)
1520 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1521 YYFPRINTF (stderr
, "\n");
1528 /* Now `shift' the result of the reduction. Determine what state
1529 that goes to, based on the state we popped back to and the rule
1530 number reduced by. */
1534 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1535 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1536 yystate
= yytable
[yystate
];
1538 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1543 /*------------------------------------.
1544 | yyerrlab -- here on detecting error |
1545 `------------------------------------*/
1547 /* If not already recovering from an error, report this error. */
1553 yyn
= yypact
[yystate
];
1555 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1557 YYSIZE_T yysize
= 0;
1562 /* Start YYX at -YYN if negative to avoid negative indexes in
1564 for (yyx
= yyn
< 0 ? -yyn
: 0;
1565 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1566 if (yycheck
[yyx
+ yyn
] == yyx
)
1567 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1568 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1569 yysize
+= yystrlen (yytname
[YYTRANSLATE (yychar
)]);
1570 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1573 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1574 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1579 for (yyx
= yyn
< 0 ? -yyn
: 0;
1580 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1582 if (yycheck
[yyx
+ yyn
] == yyx
)
1584 const char *yyq
= ! yycount
? ", expecting " : " or ";
1585 yyp
= yystpcpy (yyp
, yyq
);
1586 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1591 YYSTACK_FREE (yymsg
);
1594 yyerror ("parse error; also virtual memory exhausted");
1597 #endif /* YYERROR_VERBOSE */
1598 yyerror ("parse error");
1603 /*----------------------------------------------------.
1604 | yyerrlab1 -- error raised explicitly by an action. |
1605 `----------------------------------------------------*/
1607 if (yyerrstatus
== 3)
1609 /* If just tried and failed to reuse lookahead token after an
1610 error, discard it. */
1612 /* Return failure if at end of input. */
1613 if (yychar
== YYEOF
)
1615 /* Pop the error token. */
1617 /* Pop the rest of the stack. */
1618 while (yyssp
> yyss
)
1620 YYDPRINTF ((stderr
, "Error: popping "));
1621 YYDSYMPRINT ((stderr
,
1624 YYDPRINTF ((stderr
, "\n"));
1625 yydestructor (yystos
[*yyssp
], *yyvsp
, *yylsp
);
1631 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1632 yychar
, yytname
[yychar1
]));
1633 yydestructor (yychar1
, yylval
, yylloc
);
1637 /* Else will try to reuse lookahead token after shifting the error
1640 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1644 yyn
= yypact
[yystate
];
1648 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1656 /* Pop the current state because it cannot handle the error token. */
1660 YYDPRINTF ((stderr
, "Error: popping "));
1661 YYDSYMPRINT ((stderr
,
1662 yystos
[*yyssp
], *yyvsp
, *yylsp
));
1663 YYDPRINTF ((stderr
, "\n"));
1665 yydestructor (yystos
[yystate
], *yyvsp
, *yylsp
);
1673 short *yyssp1
= yyss
- 1;
1674 YYFPRINTF (stderr
, "Error: state stack now");
1675 while (yyssp1
!= yyssp
)
1676 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1677 YYFPRINTF (stderr
, "\n");
1685 YYDPRINTF ((stderr
, "Shifting error token, "));
1694 /*-------------------------------------.
1695 | yyacceptlab -- YYACCEPT comes here. |
1696 `-------------------------------------*/
1701 /*-----------------------------------.
1702 | yyabortlab -- YYABORT comes here. |
1703 `-----------------------------------*/
1709 /*----------------------------------------------.
1710 | yyoverflowlab -- parser overflow comes here. |
1711 `----------------------------------------------*/
1713 yyerror ("parser stack overflow");
1721 YYSTACK_FREE (yyss
);
1727 /*-----------------------------------------------.
1728 | Release the memory associated to this symbol. |
1729 `-----------------------------------------------*/
1732 yydestructor (int yytype
,
1733 YYSTYPE yyvalue
, YYLTYPE yylocation
)
1744 /*-----------------------------.
1745 | Print this symbol on YYOUT. |
1746 `-----------------------------*/
1749 yysymprint (FILE* yyout
, int yytype
,
1750 YYSTYPE yyvalue
, YYLTYPE yylocation
)
1752 if (yytype
< YYNTOKENS
)
1753 YYFPRINTF (yyout
, "token %s (", yytname
[yytype
]);
1755 YYFPRINTF (yyout
, "nterm %s (", yytname
[yytype
]);
1757 YYPRINT (yyout
, yytype
, yyvalue
);
1764 # endif /* !defined YYPRINT. */
1765 YYFPRINTF (yyout
, ")");
1767 #endif /* YYDEBUG. */
1769 #line 404 "parse-gram.y"
1771 /*------------------------------------------------------------------.
1772 | When debugging the parser, display tokens' locations and values. |
1773 `------------------------------------------------------------------*/
1776 yyprint (FILE *file
,
1777 int type
, const yystype
*value
)
1783 fprintf (file
, " = '%s'", value
->string
);
1787 fprintf (file
, " = %s", value
->symbol
->tag
);
1791 fprintf (file
, " = %d", value
->integer
);
1795 fprintf (file
, " = \"%s\"", value
->string
);
1799 fprintf (file
, " = <%s>", value
->string
);
1805 fprintf (file
, " = {{ %s }}", value
->string
);
1811 gram_error (gram_control_t
*control ATTRIBUTE_UNUSED
,
1812 location_t
*yylloc
, const char *msg
)
1814 LOCATION_PRINT (stderr
, *yylloc
);
1815 fprintf (stderr
, ": %s\n", msg
);