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 /* When debugging our pure parser, we want to see values and locations
105 #define YYPRINT(File, Type, Value) \
106 yyprint (File, &yylloc, Type, &Value)
107 static void yyprint (FILE *file
, const location_t
*loc
,
108 int type
, const yystype
*value
);
110 symbol_class current_class
= unknown_sym
;
111 char *current_type
= 0;
112 symbol_t
*current_lhs
;
113 location_t current_lhs_location
;
114 associativity current_assoc
;
115 int current_prec
= 0;
116 braced_code_t current_braced_code
= action_braced_code
;
121 # if defined (__STDC__) || defined (__cplusplus)
122 /* Put the tokens into the symbol table, so that GDB and other debuggers
132 PERCENT_DESTRUCTOR
= 264,
133 PERCENT_PRINTER
= 265,
137 PERCENT_NONASSOC
= 269,
138 PERCENT_EXPECT
= 270,
141 PERCENT_VERBOSE
= 273,
142 PERCENT_ERROR_VERBOSE
= 274,
143 PERCENT_OUTPUT
= 275,
144 PERCENT_FILE_PREFIX
= 276,
145 PERCENT_NAME_PREFIX
= 277,
146 PERCENT_DEFINE
= 278,
147 PERCENT_PURE_PARSER
= 279,
148 PERCENT_DEFINES
= 280,
151 PERCENT_LOCATIONS
= 283,
152 PERCENT_NO_LINES
= 284,
153 PERCENT_SKELETON
= 285,
154 PERCENT_TOKEN_TABLE
= 286,
161 PERCENT_PERCENT
= 293,
167 /* POSIX requires `int' for tokens in interfaces. */
168 # define YYTOKENTYPE int
169 #endif /* !YYTOKENTYPE */
172 #define CHARACTER 259
174 #define PERCENT_TOKEN 261
175 #define PERCENT_NTERM 262
176 #define PERCENT_TYPE 263
177 #define PERCENT_DESTRUCTOR 264
178 #define PERCENT_PRINTER 265
179 #define PERCENT_UNION 266
180 #define PERCENT_LEFT 267
181 #define PERCENT_RIGHT 268
182 #define PERCENT_NONASSOC 269
183 #define PERCENT_EXPECT 270
184 #define PERCENT_START 271
185 #define PERCENT_PREC 272
186 #define PERCENT_VERBOSE 273
187 #define PERCENT_ERROR_VERBOSE 274
188 #define PERCENT_OUTPUT 275
189 #define PERCENT_FILE_PREFIX 276
190 #define PERCENT_NAME_PREFIX 277
191 #define PERCENT_DEFINE 278
192 #define PERCENT_PURE_PARSER 279
193 #define PERCENT_DEFINES 280
194 #define PERCENT_YACC 281
195 #define PERCENT_DEBUG 282
196 #define PERCENT_LOCATIONS 283
197 #define PERCENT_NO_LINES 284
198 #define PERCENT_SKELETON 285
199 #define PERCENT_TOKEN_TABLE 286
202 #define SEMICOLON 289
206 #define PERCENT_PERCENT 293
209 #define BRACED_CODE 296
214 /* Enabling traces. */
219 /* Enabling verbose error messages. */
220 #ifdef YYERROR_VERBOSE
221 # undef YYERROR_VERBOSE
222 # define YYERROR_VERBOSE 1
224 # define YYERROR_VERBOSE 0
228 #line 91 "parse-gram.y"
236 /* Line 232 of /usr/local/share/bison/bison.simple. */
237 #line 238 "parse-gram.c"
238 # define YYSTYPE yystype
239 # define YYSTYPE_IS_TRIVIAL 1
243 typedef struct yyltype
250 # define YYLTYPE yyltype
251 # define YYLTYPE_IS_TRIVIAL 1
254 /* Copy the second part of user declarations. */
257 /* Line 252 of /usr/local/share/bison/bison.simple. */
258 #line 259 "parse-gram.c"
260 #if ! defined (yyoverflow) || YYERROR_VERBOSE
262 /* The parser invokes alloca or malloc; define the necessary symbols. */
264 # if YYSTACK_USE_ALLOCA
265 # define YYSTACK_ALLOC alloca
267 # ifndef YYSTACK_USE_ALLOCA
268 # if defined (alloca) || defined (_ALLOCA_H)
269 # define YYSTACK_ALLOC alloca
272 # define YYSTACK_ALLOC __builtin_alloca
278 # ifdef YYSTACK_ALLOC
279 /* Pacify GCC's `empty if-body' warning. */
280 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
282 # if defined (__STDC__) || defined (__cplusplus)
283 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
284 # define YYSIZE_T size_t
286 # define YYSTACK_ALLOC malloc
287 # define YYSTACK_FREE free
289 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
292 #if (! defined (yyoverflow) \
293 && (! defined (__cplusplus) \
294 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
296 /* A type that is properly aligned for any stack member. */
304 /* The size of the maximum gap between one aligned stack and the next. */
305 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
307 /* The size of an array large to enough to hold all stacks, each with
309 # define YYSTACK_BYTES(N) \
310 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
311 + 2 * YYSTACK_GAP_MAX)
313 /* Copy COUNT objects from FROM to TO. The source and destination do
317 # define YYCOPY(To, From, Count) \
318 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
320 # define YYCOPY(To, From, Count) \
323 register YYSIZE_T yyi; \
324 for (yyi = 0; yyi < (Count); yyi++) \
325 (To)[yyi] = (From)[yyi]; \
331 /* Relocate STACK from its old location to the new one. The
332 local variables YYSIZE and YYSTACKSIZE give the old and new number of
333 elements in the stack, and YYPTR gives the new location of the
334 stack. Advance YYPTR to a properly aligned location for the next
336 # define YYSTACK_RELOCATE(Stack) \
339 YYSIZE_T yynewbytes; \
340 YYCOPY (&yyptr->Stack, Stack, yysize); \
341 Stack = &yyptr->Stack; \
342 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
343 yyptr += yynewbytes / sizeof (*yyptr); \
349 /* YYFINAL -- State number of the termination state. */
351 #define YYFLAG -32768
354 /* YYNTOKENS -- Number of terminals. */
356 /* YYNNTS -- Number of nonterminals. */
358 /* YYNRULES -- Number of rules. */
360 /* YYNRULES -- Number of states. */
361 #define YYNSTATES 101
363 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
365 #define YYMAXUTOK 296
367 #define YYTRANSLATE(X) \
368 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
370 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
371 static const unsigned char yytranslate
[] =
373 0, 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, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
399 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
400 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
401 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
402 35, 36, 37, 38, 39, 40, 41
406 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
408 static const unsigned char yyprhs
[] =
410 0, 0, 3, 8, 9, 13, 15, 17, 19, 23,
411 25, 27, 30, 34, 36, 40, 42, 46, 48, 51,
412 53, 55, 57, 59, 61, 64, 67, 68, 73, 74,
413 79, 80, 84, 85, 89, 93, 97, 99, 101, 103,
414 104, 106, 108, 111, 113, 115, 118, 121, 125, 127,
415 130, 132, 135, 137, 140, 141, 147, 149, 153, 154,
416 157, 160, 164, 166, 168, 170, 172, 174, 176, 177,
420 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
421 static const signed char yyrhs
[] =
423 43, 0, -1, 44, 38, 58, 68, -1, -1, 44,
424 45, 69, -1, 46, -1, 39, -1, 27, -1, 23,
425 67, 67, -1, 25, -1, 19, -1, 15, 5, -1,
426 21, 33, 67, -1, 28, -1, 22, 33, 67, -1,
427 29, -1, 20, 33, 67, -1, 24, -1, 30, 67,
428 -1, 31, -1, 18, -1, 26, -1, 52, -1, 49,
429 -1, 16, 64, -1, 11, 41, -1, -1, 9, 47,
430 41, 55, -1, -1, 10, 48, 41, 55, -1, -1,
431 7, 50, 57, -1, -1, 6, 51, 57, -1, 8,
432 32, 55, -1, 53, 54, 55, -1, 12, -1, 13,
433 -1, 14, -1, -1, 32, -1, 64, -1, 55, 64,
434 -1, 32, -1, 37, -1, 37, 5, -1, 37, 66,
435 -1, 37, 5, 66, -1, 56, -1, 57, 56, -1,
436 59, -1, 58, 59, -1, 60, -1, 46, 34, -1,
437 -1, 37, 35, 61, 62, 34, -1, 63, -1, 62,
438 36, 63, -1, -1, 63, 64, -1, 63, 65, -1,
439 63, 17, 64, -1, 37, -1, 66, -1, 4, -1,
440 41, -1, 3, -1, 3, -1, -1, 38, 40, -1,
444 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
445 static const unsigned short yyrline
[] =
447 0, 158, 158, 171, 173, 176, 178, 179, 180, 181,
448 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
449 192, 193, 196, 198, 199, 203, 210, 209, 220, 219,
450 232, 231, 237, 237, 242, 251, 266, 268, 269, 272,
451 274, 279, 281, 285, 290, 295, 301, 307, 317, 320,
452 329, 331, 337, 339, 343, 342, 347, 349, 352, 355,
453 357, 359, 363, 365, 366, 369, 375, 384, 392, 397,
458 #if YYDEBUG || YYERROR_VERBOSE
459 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
460 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
461 static const char *const yytname
[] =
463 "\"end of string\"", "error", "$undefined.", "STRING", "CHARACTER", "INT",
464 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
465 "\"%printer\"", "\"%union\"", "\"%left\"", "\"%right\"",
466 "\"%nonassoc\"", "\"%expect\"", "\"%start\"", "\"%prec\"",
467 "\"%verbose\"", "\"%error-verbose\"", "\"%output\"", "\"%file-prefix\"",
468 "\"%name-prefix\"", "\"%define\"", "\"%pure-parser\"", "\"%defines\"",
469 "\"%yacc\"", "\"%debug\"", "\"%locations\"", "\"%no-lines\"",
470 "\"%skeleton\"", "\"%token-table\"", "TYPE", "\"=\"", "\";\"", "\":\"",
471 "\"|\"", "\"identifier\"", "\"%%\"", "PROLOGUE", "EPILOGUE",
472 "BRACED_CODE", "$axiom", "input", "declarations", "declaration",
473 "grammar_declaration", "@1", "@2", "symbol_declaration", "@3", "@4",
474 "precedence_declaration", "precedence_declarator", "type.opt",
475 "symbols.1", "symbol_def", "symbol_defs.1", "grammar",
476 "rules_or_grammar_declaration", "rules", "@5", "rhses.1", "rhs",
477 "symbol", "action", "string_as_id", "string_content", "epilogue.opt",
482 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
484 static const short yytoknum
[] =
486 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
487 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
488 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
489 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
493 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
494 static const unsigned char yyr1
[] =
496 0, 42, 43, 44, 44, 45, 45, 45, 45, 45,
497 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
498 45, 45, 46, 46, 46, 46, 47, 46, 48, 46,
499 50, 49, 51, 49, 49, 52, 53, 53, 53, 54,
500 54, 55, 55, 56, 56, 56, 56, 56, 57, 57,
501 58, 58, 59, 59, 61, 60, 62, 62, 63, 63,
502 63, 63, 64, 64, 64, 65, 66, 67, 68, 68,
506 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
507 static const unsigned char yyr2
[] =
509 0, 2, 4, 0, 3, 1, 1, 1, 3, 1,
510 1, 2, 3, 1, 3, 1, 3, 1, 2, 1,
511 1, 1, 1, 1, 2, 2, 0, 4, 0, 4,
512 0, 3, 0, 3, 3, 3, 1, 1, 1, 0,
513 1, 1, 2, 1, 1, 2, 2, 3, 1, 2,
514 1, 2, 1, 2, 0, 5, 1, 3, 0, 2,
515 2, 3, 1, 1, 1, 1, 1, 1, 0, 2,
519 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
520 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
521 means the default is an error. */
522 static const short yydefact
[] =
524 3, 0, 0, 0, 32, 30, 0, 26, 28, 0,
525 36, 37, 38, 0, 0, 20, 10, 0, 0, 0,
526 0, 17, 9, 21, 7, 13, 15, 0, 19, 0,
527 6, 70, 5, 23, 22, 39, 0, 0, 0, 0,
528 0, 25, 11, 66, 64, 62, 24, 63, 0, 0,
529 0, 67, 0, 18, 0, 0, 68, 50, 52, 71,
530 4, 40, 0, 43, 44, 48, 33, 31, 34, 41,
531 0, 0, 16, 12, 14, 8, 54, 53, 0, 51,
532 2, 35, 45, 46, 49, 42, 27, 29, 58, 69,
533 47, 0, 56, 55, 58, 0, 65, 59, 60, 57,
537 /* YYPGOTO[NTERM-NUM]. */
538 static const short yydefgoto
[] =
540 -1, 1, 2, 31, 55, 39, 40, 33, 37, 36,
541 34, 35, 62, 68, 65, 66, 56, 57, 58, 88,
542 91, 92, 69, 98, 47, 52, 80, 60
545 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
547 static const short yypact
[] =
549 -32768, 8, 80,-32768,-32768,-32768, -19,-32768,-32768, -11,
550 -32768,-32768,-32768, 31, 0,-32768,-32768, 5, 9, 11,
551 40,-32768,-32768,-32768,-32768,-32768,-32768, 40,-32768, 114,
552 -32768, 12,-32768,-32768,-32768, 13, -27, -27, 0, 14,
553 15,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 40, 40,
554 40,-32768, 40,-32768, 16, 18, 10,-32768,-32768,-32768,
555 -32768,-32768, 0,-32768, 6,-32768, -27, -27, 0,-32768,
556 0, 0,-32768,-32768,-32768,-32768,-32768,-32768, 17,-32768,
557 -32768, 0, 46,-32768,-32768,-32768, 0, 0,-32768,-32768,
558 -32768, -22, -2,-32768,-32768, 0,-32768,-32768,-32768, -2,
562 /* YYPGOTO[NTERM-NUM]. */
563 static const short yypgoto
[] =
565 -32768,-32768,-32768,-32768, 48,-32768,-32768,-32768,-32768,-32768,
566 -32768,-32768,-32768, -30, -33, 21,-32768, -3,-32768,-32768,
567 -32768, -35, -14,-32768, -57, -21,-32768,-32768
570 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
571 positive, shift that token. If negative, reduce the rule which
572 number is the opposite. If zero, do what YYDEFACT says. */
573 static const short yytable
[] =
575 46, 43, 44, 43, 44, 63, 53, 83, 3, 43,
576 64, 82, 93, 38, 94, 95, 4, 5, 6, 7,
577 8, 9, 10, 11, 12, 90, 14, 72, 73, 74,
578 41, 75, 81, 84, 84, 45, 42, 45, 48, 96,
579 86, 87, 49, 51, 50, 61, 59, 54, 78, 43,
580 32, 76, 77, 79, 85, 70, 71, 89, 67, 99,
581 0, 0, 0, 0, 0, 0, 0, 85, 0, 0,
582 0, 0, 85, 85, 0, 0, 0, 0, 97, 0,
583 0, 100, 0, 0, 0, 97, 4, 5, 6, 7,
584 8, 9, 10, 11, 12, 13, 14, 0, 15, 16,
585 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
586 27, 28, 0, 0, 0, 0, 0, 0, 29, 30,
587 4, 5, 6, 7, 8, 9, 10, 11, 12, 0,
588 14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
589 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
593 static const short yycheck
[] =
595 14, 3, 4, 3, 4, 32, 27, 64, 0, 3,
596 37, 5, 34, 32, 36, 17, 6, 7, 8, 9,
597 10, 11, 12, 13, 14, 82, 16, 48, 49, 50,
598 41, 52, 62, 66, 67, 37, 5, 37, 33, 41,
599 70, 71, 33, 3, 33, 32, 34, 37, 38, 3,
600 2, 35, 34, 56, 68, 41, 41, 40, 37, 94,
601 -1, -1, -1, -1, -1, -1, -1, 81, -1, -1,
602 -1, -1, 86, 87, -1, -1, -1, -1, 92, -1,
603 -1, 95, -1, -1, -1, 99, 6, 7, 8, 9,
604 10, 11, 12, 13, 14, 15, 16, -1, 18, 19,
605 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
606 30, 31, -1, -1, -1, -1, -1, -1, 38, 39,
607 6, 7, 8, 9, 10, 11, 12, 13, 14, -1,
608 16, -1, -1, -1, -1, -1, -1, -1, -1, -1,
609 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
613 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
614 symbol of state STATE-NUM. */
615 static const unsigned char yystos
[] =
617 0, 43, 44, 0, 6, 7, 8, 9, 10, 11,
618 12, 13, 14, 15, 16, 18, 19, 20, 21, 22,
619 23, 24, 25, 26, 27, 28, 29, 30, 31, 38,
620 39, 45, 46, 49, 52, 53, 51, 50, 32, 47,
621 48, 41, 5, 3, 4, 37, 64, 66, 33, 33,
622 33, 3, 67, 67, 37, 46, 58, 59, 60, 34,
623 69, 32, 54, 32, 37, 56, 57, 57, 55, 64,
624 41, 41, 67, 67, 67, 67, 35, 34, 38, 59,
625 68, 55, 5, 66, 56, 64, 55, 55, 61, 40,
626 66, 62, 63, 34, 36, 17, 41, 64, 65, 63,
630 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
631 # define YYSIZE_T __SIZE_TYPE__
633 #if ! defined (YYSIZE_T) && defined (size_t)
634 # define YYSIZE_T size_t
636 #if ! defined (YYSIZE_T)
637 # if defined (__STDC__) || defined (__cplusplus)
638 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
639 # define YYSIZE_T size_t
642 #if ! defined (YYSIZE_T)
643 # define YYSIZE_T unsigned int
646 #define yyerrok (yyerrstatus = 0)
647 #define yyclearin (yychar = YYEMPTY)
651 #define YYACCEPT goto yyacceptlab
652 #define YYABORT goto yyabortlab
653 #define YYERROR goto yyerrlab1
655 /* Like YYERROR except do call yyerror. This remains here temporarily
656 to ease the transition to the new meaning of YYERROR, for GCC.
657 Once GCC version 2 has supplanted version 1, this can go. */
659 #define YYFAIL goto yyerrlab
661 #define YYRECOVERING() (!!yyerrstatus)
663 #define YYBACKUP(Token, Value) \
665 if (yychar == YYEMPTY && yylen == 1) \
669 yychar1 = YYTRANSLATE (yychar); \
675 yyerror ("syntax error: cannot back up"); \
681 #define YYERRCODE 256
683 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
686 #ifndef YYLLOC_DEFAULT
687 # define YYLLOC_DEFAULT(Current, Rhs, N) \
688 Current.first_line = Rhs[1].first_line; \
689 Current.first_column = Rhs[1].first_column; \
690 Current.last_line = Rhs[N].last_line; \
691 Current.last_column = Rhs[N].last_column;
694 /* YYLEX -- calling `yylex' with the right arguments. */
697 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
699 # define YYLEX yylex (&yylval, &yylloc, )
702 /* Enable debugging if requested. */
706 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
707 # define YYFPRINTF fprintf
710 # define YYDPRINTF(Args) \
715 /* Nonzero means print parse trace. It is left uninitialized so that
716 multiple parsers can coexist. */
719 # define YYDPRINTF(Args)
720 #endif /* !YYDEBUG */
722 /* YYINITDEPTH -- initial size of the parser's stacks. */
724 # define YYINITDEPTH 200
727 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
728 if the built-in stack extension method is used).
730 Do not make this value too large; the results are undefined if
731 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
732 evaluated with infinite-precision integer arithmetic. */
739 # define YYMAXDEPTH 10000
747 # if defined (__GLIBC__) && defined (_STRING_H)
748 # define yystrlen strlen
750 /* Return the length of YYSTR. */
752 # if defined (__STDC__) || defined (__cplusplus)
753 yystrlen (const char *yystr
)
759 register const char *yys
= yystr
;
761 while (*yys
++ != '\0')
764 return yys
- yystr
- 1;
770 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
771 # define yystpcpy stpcpy
773 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
776 # if defined (__STDC__) || defined (__cplusplus)
777 yystpcpy (char *yydest
, const char *yysrc
)
779 yystpcpy (yydest
, yysrc
)
784 register char *yyd
= yydest
;
785 register const char *yys
= yysrc
;
787 while ((*yyd
++ = *yys
++) != '\0')
795 #endif /* !YYERROR_VERBOSE */
799 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
800 into yyparse. The argument should have type void *.
801 It should actually point to an object.
802 Grammar actions can access the variable by casting it
803 to the proper pointer type. */
806 # if defined (__STDC__) || defined (__cplusplus)
807 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
808 # define YYPARSE_PARAM_DECL
810 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
811 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
813 #else /* !YYPARSE_PARAM */
814 # define YYPARSE_PARAM_ARG
815 # define YYPARSE_PARAM_DECL
816 #endif /* !YYPARSE_PARAM */
818 /* Prevent warning if -Wstrict-prototypes. */
820 # ifdef YYPARSE_PARAM
821 int yyparse (void *);
826 static void yydestructor (int symbol_type
, YYSTYPE symbol_value
);
832 yyparse (YYPARSE_PARAM_ARG
)
835 /* The lookahead symbol. */
838 /* The semantic value of the lookahead symbol. */
841 /* Number of parse errors so far. */
843 /* Location data for the lookahead symbol. */
846 register int yystate
;
849 /* Number of tokens to shift before error messages enabled. */
851 /* Lookahead token as an internal (translated) token number. */
854 /* Three stacks and their tools:
855 `yyss': related to states,
856 `yyvs': related to semantic values,
857 `yyls': related to locations.
859 Refer to the stacks thru separate pointers, to allow yyoverflow
860 to reallocate them elsewhere. */
862 /* The state stack. */
863 short yyssa
[YYINITDEPTH
];
865 register short *yyssp
;
867 /* The semantic value stack. */
868 YYSTYPE yyvsa
[YYINITDEPTH
];
869 YYSTYPE
*yyvs
= yyvsa
;
870 register YYSTYPE
*yyvsp
;
872 /* The location stack. */
873 YYLTYPE yylsa
[YYINITDEPTH
];
874 YYLTYPE
*yyls
= yylsa
;
877 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
879 YYSIZE_T yystacksize
= YYINITDEPTH
;
881 /* The variables used to return semantic value and location from the
886 /* When reducing, the number of symbols on the RHS of the reduced
890 YYDPRINTF ((stderr
, "Starting parse\n"));
895 yychar
= YYEMPTY
; /* Cause a token to be read. */
897 /* Initialize stack pointers.
898 Waste one element of value and location stack
899 so that they stay on the same level as the state stack.
900 The wasted elements are never initialized. */
907 /*------------------------------------------------------------.
908 | yynewstate -- Push a new state, which is found in yystate. |
909 `------------------------------------------------------------*/
911 /* In all cases, when you get here, the value and location stacks
912 have just been pushed. so pushing a state here evens the stacks.
919 if (yyssp
>= yyss
+ yystacksize
- 1)
921 /* Get the current used size of the three stacks, in elements. */
922 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
926 /* Give user a chance to reallocate the stack. Use copies of
927 these so that the &'s don't force the real ones into
929 YYSTYPE
*yyvs1
= yyvs
;
931 YYLTYPE
*yyls1
= yyls
;
933 /* Each stack pointer address is followed by the size of the
934 data in use in that stack, in bytes. This used to be a
935 conditional around just the two extra args, but that might
936 be undefined if yyoverflow is a macro. */
937 yyoverflow ("parser stack overflow",
938 &yyss1
, yysize
* sizeof (*yyssp
),
939 &yyvs1
, yysize
* sizeof (*yyvsp
),
940 &yyls1
, yysize
* sizeof (*yylsp
),
946 #else /* no yyoverflow */
947 # ifndef YYSTACK_RELOCATE
950 /* Extend the stack our own way. */
951 if (yystacksize
>= YYMAXDEPTH
)
954 if (yystacksize
> YYMAXDEPTH
)
955 yystacksize
= YYMAXDEPTH
;
959 union yyalloc
*yyptr
=
960 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
963 YYSTACK_RELOCATE (yyss
);
964 YYSTACK_RELOCATE (yyvs
);
965 YYSTACK_RELOCATE (yyls
);
966 # undef YYSTACK_RELOCATE
968 YYSTACK_FREE (yyss1
);
971 #endif /* no yyoverflow */
973 yyssp
= yyss
+ yysize
- 1;
974 yyvsp
= yyvs
+ yysize
- 1;
975 yylsp
= yyls
+ yysize
- 1;
977 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
978 (unsigned long int) yystacksize
));
980 if (yyssp
>= yyss
+ yystacksize
- 1)
984 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
993 /* Do appropriate processing given the current state. */
994 /* Read a lookahead token if we need one and don't already have one. */
997 /* First try to decide what to do without reference to lookahead token. */
999 yyn
= yypact
[yystate
];
1003 /* Not known => get a lookahead token if don't already have one. */
1005 /* yychar is either YYEMPTY or YYEOF
1006 or a valid token in external form. */
1008 if (yychar
== YYEMPTY
)
1010 YYDPRINTF ((stderr
, "Reading a token: "));
1014 /* Convert token to internal form (in yychar1) for indexing tables with. */
1016 if (yychar
<= 0) /* This means end of input. */
1019 yychar
= YYEOF
; /* Don't call YYLEX any more. */
1021 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1025 yychar1
= YYTRANSLATE (yychar
);
1028 /* We have to keep this `#if YYDEBUG', since we use variables
1029 which are defined only if `YYDEBUG' is set. */
1032 YYFPRINTF (stderr
, "Next token is %d (%s",
1033 yychar
, yytname
[yychar1
]);
1034 /* Give the individual parser a way to print the precise
1035 meaning of a token, for further debugging info. */
1037 YYPRINT (stderr
, yychar
, yylval
);
1039 YYFPRINTF (stderr
, ")\n");
1045 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
1050 /* yyn is what to do for this token type in this state.
1051 Negative => reduce, -yyn is rule number.
1052 Positive => shift, yyn is new state.
1053 New state is final state => don't bother to shift,
1054 just return success.
1055 0, or most negative number => error. */
1070 /* Shift the lookahead token. */
1071 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1072 yychar
, yytname
[yychar1
]));
1074 /* Discard the token being shifted unless it is eof. */
1075 if (yychar
!= YYEOF
)
1081 /* Count tokens shifted since error; after three, turn off error
1090 /*-----------------------------------------------------------.
1091 | yydefault -- do the default action for the current state. |
1092 `-----------------------------------------------------------*/
1094 yyn
= yydefact
[yystate
];
1100 /*-----------------------------.
1101 | yyreduce -- Do a reduction. |
1102 `-----------------------------*/
1104 /* yyn is the number of a rule to reduce with. */
1107 /* If YYLEN is nonzero, implement the default value of the action:
1110 Otherwise, the following line sets YYVAL to the semantic value of
1111 the lookahead token. This behavior is undocumented and Bison
1112 users should not rely upon it. Assigning to YYVAL
1113 unconditionally makes the parser a bit smaller, and it avoids a
1114 GCC warning that YYVAL may be used uninitialized. */
1115 yyval
= yyvsp
[1-yylen
];
1117 /* Default location. */
1118 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1121 /* We have to keep this `#if YYDEBUG', since we use variables which
1122 are defined only if `YYDEBUG' is set. */
1127 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1128 yyn
- 1, yyrline
[yyn
]);
1130 /* Print the symbols being reduced, and their result. */
1131 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] >= 0; yyi
++)
1132 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1133 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1139 #line 160 "parse-gram.y"
1141 yycontrol
->errcode
= 0;
1142 epilogue_set (yyvsp
[0].string
, yylsp
[0]);
1147 #line 178 "parse-gram.y"
1148 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1152 #line 179 "parse-gram.y"
1157 #line 180 "parse-gram.y"
1158 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1162 #line 181 "parse-gram.y"
1163 { defines_flag
= 1; }
1167 #line 182 "parse-gram.y"
1168 { error_verbose
= 1; }
1172 #line 183 "parse-gram.y"
1173 { expected_conflicts
= yyvsp
[0].integer
; }
1177 #line 184 "parse-gram.y"
1178 { spec_file_prefix
= yyvsp
[0].string
; }
1182 #line 185 "parse-gram.y"
1183 { locations_flag
= 1; }
1187 #line 186 "parse-gram.y"
1188 { spec_name_prefix
= yyvsp
[0].string
; }
1192 #line 187 "parse-gram.y"
1193 { no_lines_flag
= 1; }
1197 #line 188 "parse-gram.y"
1198 { spec_outfile
= yyvsp
[0].string
; }
1202 #line 189 "parse-gram.y"
1203 { pure_parser
= 1; }
1207 #line 190 "parse-gram.y"
1208 { skeleton
= yyvsp
[0].string
; }
1212 #line 191 "parse-gram.y"
1213 { token_table_flag
= 1; }
1217 #line 192 "parse-gram.y"
1218 { report_flag
= 1; }
1222 #line 193 "parse-gram.y"
1227 #line 200 "parse-gram.y"
1229 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1234 #line 204 "parse-gram.y"
1237 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1238 muscle_insert ("stype", yyvsp
[0].string
);
1243 #line 210 "parse-gram.y"
1244 { current_braced_code
= destructor_braced_code
; }
1248 #line 212 "parse-gram.y"
1250 symbol_list_t
*list
;
1251 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1252 symbol_destructor_set (list
->sym
, list
->location
, yyvsp
[-1].string
);
1253 symbol_list_free (yyvsp
[0].list
);
1254 current_braced_code
= action_braced_code
;
1259 #line 220 "parse-gram.y"
1260 { current_braced_code
= printer_braced_code
; }
1264 #line 222 "parse-gram.y"
1266 symbol_list_t
*list
;
1267 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1268 symbol_printer_set (list
->sym
, yyvsp
[-1].string
, list
->location
);
1269 symbol_list_free (yyvsp
[0].list
);
1270 current_braced_code
= action_braced_code
;
1275 #line 232 "parse-gram.y"
1276 { current_class
= nterm_sym
; }
1280 #line 233 "parse-gram.y"
1282 current_class
= unknown_sym
;
1283 current_type
= NULL
;
1288 #line 237 "parse-gram.y"
1289 { current_class
= token_sym
; }
1293 #line 238 "parse-gram.y"
1295 current_class
= unknown_sym
;
1296 current_type
= NULL
;
1301 #line 243 "parse-gram.y"
1303 symbol_list_t
*list
;
1304 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1305 symbol_type_set (list
->sym
, list
->location
, yyvsp
[-1].string
);
1306 symbol_list_free (yyvsp
[0].list
);
1311 #line 253 "parse-gram.y"
1313 symbol_list_t
*list
;
1315 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1317 symbol_type_set (list
->sym
, list
->location
, current_type
);
1318 symbol_precedence_set (list
->sym
, list
->location
, current_prec
, yyvsp
[-2].assoc
);
1320 symbol_list_free (yyvsp
[0].list
);
1321 current_type
= NULL
;
1326 #line 267 "parse-gram.y"
1327 { yyval
.assoc
= left_assoc
; }
1331 #line 268 "parse-gram.y"
1332 { yyval
.assoc
= right_assoc
; }
1336 #line 269 "parse-gram.y"
1337 { yyval
.assoc
= non_assoc
; }
1341 #line 273 "parse-gram.y"
1342 { current_type
= NULL
;}
1346 #line 274 "parse-gram.y"
1347 { current_type
= yyvsp
[0].string
; }
1351 #line 280 "parse-gram.y"
1352 { yyval
.list
= symbol_list_new (yyvsp
[0].symbol
, yylsp
[0]); }
1356 #line 281 "parse-gram.y"
1357 { yyval
.list
= symbol_list_prepend (yyvsp
[-1].list
, yyvsp
[0].symbol
, yylsp
[0]); }
1361 #line 287 "parse-gram.y"
1363 current_type
= yyvsp
[0].string
;
1368 #line 291 "parse-gram.y"
1370 symbol_class_set (yyvsp
[0].symbol
, current_class
);
1371 symbol_type_set (yyvsp
[0].symbol
, yylsp
[0], current_type
);
1376 #line 296 "parse-gram.y"
1378 symbol_class_set (yyvsp
[-1].symbol
, current_class
);
1379 symbol_type_set (yyvsp
[-1].symbol
, yylsp
[-1], current_type
);
1380 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
);
1385 #line 302 "parse-gram.y"
1387 symbol_class_set (yyvsp
[-1].symbol
, current_class
);
1388 symbol_type_set (yyvsp
[-1].symbol
, yylsp
[-1], current_type
);
1389 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
);
1394 #line 308 "parse-gram.y"
1396 symbol_class_set (yyvsp
[-2].symbol
, current_class
);
1397 symbol_type_set (yyvsp
[-2].symbol
, yylsp
[-2], current_type
);
1398 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
);
1399 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
);
1404 #line 319 "parse-gram.y"
1409 #line 321 "parse-gram.y"
1414 #line 343 "parse-gram.y"
1415 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1419 #line 344 "parse-gram.y"
1424 #line 348 "parse-gram.y"
1425 { grammar_rule_end (yylsp
[0]); }
1429 #line 349 "parse-gram.y"
1430 { grammar_rule_end (yylsp
[0]); }
1434 #line 354 "parse-gram.y"
1435 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1439 #line 356 "parse-gram.y"
1440 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1444 #line 358 "parse-gram.y"
1445 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1449 #line 360 "parse-gram.y"
1450 { grammar_current_rule_prec_set (yyvsp
[0].symbol
); }
1454 #line 364 "parse-gram.y"
1455 { yyval
.symbol
= yyvsp
[0].symbol
; }
1459 #line 365 "parse-gram.y"
1460 { yyval
.symbol
= yyvsp
[0].symbol
; }
1464 #line 366 "parse-gram.y"
1465 { yyval
.symbol
= getsym (yyvsp
[0].string
, yylsp
[0]); }
1469 #line 371 "parse-gram.y"
1470 { yyval
.string
= yyvsp
[0].string
; }
1474 #line 377 "parse-gram.y"
1476 yyval
.symbol
= getsym (yyvsp
[0].string
, yylsp
[0]);
1477 symbol_class_set (yyval
.symbol
, token_sym
);
1482 #line 386 "parse-gram.y"
1484 yyval
.string
= yyvsp
[0].string
+ 1;
1485 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1490 #line 394 "parse-gram.y"
1492 yyval
.string
= xstrdup ("");
1497 #line 398 "parse-gram.y"
1499 yyval
.string
= yyvsp
[0].string
;
1506 /* Line 996 of /usr/local/share/bison/bison.simple. */
1507 #line 1508 "parse-gram.c"
1516 short *yyssp1
= yyss
- 1;
1517 YYFPRINTF (stderr
, "state stack now");
1518 while (yyssp1
!= yyssp
)
1519 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1520 YYFPRINTF (stderr
, "\n");
1527 /* Now `shift' the result of the reduction. Determine what state
1528 that goes to, based on the state we popped back to and the rule
1529 number reduced by. */
1533 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1534 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1535 yystate
= yytable
[yystate
];
1537 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1542 /*------------------------------------.
1543 | yyerrlab -- here on detecting error |
1544 `------------------------------------*/
1546 /* If not already recovering from an error, report this error. */
1552 yyn
= yypact
[yystate
];
1554 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1556 YYSIZE_T yysize
= 0;
1561 /* Start YYX at -YYN if negative to avoid negative indexes in
1563 for (yyx
= yyn
< 0 ? -yyn
: 0;
1564 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1565 if (yycheck
[yyx
+ yyn
] == yyx
)
1566 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1567 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1568 yysize
+= yystrlen (yytname
[YYTRANSLATE (yychar
)]);
1569 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1572 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1573 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1578 for (yyx
= yyn
< 0 ? -yyn
: 0;
1579 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1581 if (yycheck
[yyx
+ yyn
] == yyx
)
1583 const char *yyq
= ! yycount
? ", expecting " : " or ";
1584 yyp
= yystpcpy (yyp
, yyq
);
1585 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1590 YYSTACK_FREE (yymsg
);
1593 yyerror ("parse error; also virtual memory exhausted");
1596 #endif /* YYERROR_VERBOSE */
1597 yyerror ("parse error");
1602 /*----------------------------------------------------.
1603 | yyerrlab1 -- error raised explicitly by an action. |
1604 `----------------------------------------------------*/
1606 if (yyerrstatus
== 3)
1608 /* If just tried and failed to reuse lookahead token after an
1609 error, discard it. */
1611 /* Return failure if at end of input. */
1612 if (yychar
== YYEOF
)
1614 /* Pop the error token. */
1616 /* Pop the rest of the stack. */
1617 while (yyssp
> yyss
)
1622 if (yystos
[*yyssp
] < YYNTOKENS
)
1624 YYFPRINTF (stderr
, "Error: popping token %d (%s",
1625 yytoknum
[yystos
[*yyssp
]],
1626 yytname
[yystos
[*yyssp
]]);
1628 YYPRINT (stderr
, yytoknum
[yystos
[*yyssp
]], *yyvsp
);
1630 YYFPRINTF (stderr
, ")\n");
1634 YYFPRINTF (stderr
, "Error: popping nonterminal (%s)\n",
1635 yytname
[yystos
[*yyssp
]]);
1639 yydestructor (yystos
[*yyssp
], *yyvsp
);
1645 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1646 yychar
, yytname
[yychar1
]));
1647 yydestructor (yychar1
, yylval
);
1651 /* Else will try to reuse lookahead token after shifting the error
1654 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1658 yyn
= yypact
[yystate
];
1662 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1670 /* Pop the current state because it cannot handle the error token. */
1677 if (yystos
[yystate
] < YYNTOKENS
)
1679 YYFPRINTF (stderr
, "Error: popping token %d (%s",
1680 yytoknum
[yystos
[yystate
]], yytname
[yystos
[yystate
]]);
1682 YYPRINT (stderr
, yytoknum
[yystos
[yystate
]], *yyvsp
);
1684 YYFPRINTF (stderr
, ")\n");
1688 YYFPRINTF (stderr
, "Error: popping nonterminal (%s)\n",
1689 yytname
[yystos
[yystate
]]);
1694 yydestructor (yystos
[yystate
], *yyvsp
);
1702 short *yyssp1
= yyss
- 1;
1703 YYFPRINTF (stderr
, "Error: state stack now");
1704 while (yyssp1
!= yyssp
)
1705 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1706 YYFPRINTF (stderr
, "\n");
1714 YYDPRINTF ((stderr
, "Shifting error token, "));
1723 /*-------------------------------------.
1724 | yyacceptlab -- YYACCEPT comes here. |
1725 `-------------------------------------*/
1730 /*-----------------------------------.
1731 | yyabortlab -- YYABORT comes here. |
1732 `-----------------------------------*/
1738 /*----------------------------------------------.
1739 | yyoverflowlab -- parser overflow comes here. |
1740 `----------------------------------------------*/
1742 yyerror ("parser stack overflow");
1750 YYSTACK_FREE (yyss
);
1756 /*-------------------------------------------------.
1757 | Release the memory associated to SYMBOL-NUMBER. |
1758 `-------------------------------------------------*/
1761 yydestructor (int symbol_type
, YYSTYPE symbol_value
)
1763 switch (symbol_type
)
1766 YYDPRINTF ((stderr
, "yydestructor: unknown symbol type: %d (%s)\n",
1767 symbol_type
, yytname
[symbol_type
]));
1772 #line 407 "parse-gram.y"
1774 /*------------------------------------------------------------------.
1775 | When debugging the parser, display tokens' locations and values. |
1776 `------------------------------------------------------------------*/
1779 yyprint (FILE *file
,
1780 const location_t
*loc
, int type
, const yystype
*value
)
1783 LOCATION_PRINT (file
, *loc
);
1788 fprintf (file
, " = '%s'", value
->string
);
1792 fprintf (file
, " = %s", value
->symbol
->tag
);
1796 fprintf (file
, " = %d", value
->integer
);
1800 fprintf (file
, " = \"%s\"", value
->string
);
1804 fprintf (file
, " = <%s>", value
->string
);
1810 fprintf (file
, " = {{ %s }}", value
->string
);
1816 gram_error (gram_control_t
*control ATTRIBUTE_UNUSED
,
1817 location_t
*yylloc
, const char *msg
)
1819 LOCATION_PRINT (stderr
, *yylloc
);
1820 fprintf (stderr
, ": %s\n", msg
);