1 /* A Bison parser, made from parse-gram.y, by GNU bison 1.49b. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
42 /* Using locations. */
43 #define YYLSP_NEEDED 1
45 /* If NAME_PREFIX is specified substitute the variables and functions
47 #define yyparse gram_parse
48 #define yylex gram_lex
49 #define yyerror gram_error
50 #define yylval gram_lval
51 #define yychar gram_char
52 #define yydebug gram_debug
53 #define yynerrs gram_nerrs
54 #define yylloc gram_lloc
56 /* Copy the first part of user declarations. */
57 #line 31 "parse-gram.y"
61 #include "muscle_tab.h"
68 #include "conflicts.h"
70 /* Produce verbose parse errors. */
71 #define YYERROR_VERBOSE 1
72 #define YYLLOC_DEFAULT(Current, Rhs, N) \
76 Current.first_column = Rhs[1].first_column; \
77 Current.first_line = Rhs[1].first_line; \
78 Current.last_column = Rhs[N].last_column; \
79 Current.last_line = Rhs[N].last_line; \
87 /* Pass the control structure to YYPARSE and YYLEX. */
88 #define YYPARSE_PARAM gram_control
89 #define YYLEX_PARAM gram_control
90 /* YYPARSE receives GRAM_CONTROL as a void *. Provide a
91 correctly typed access to it. */
92 #define yycontrol ((gram_control_t *) gram_control)
94 /* Request detailed parse error messages, and pass them to
97 #define yyerror(Msg) \
98 gram_error (yycontrol, &yylloc, Msg)
100 #define YYPRINT(File, Type, Value) \
101 yyprint (File, Type, &Value)
102 static void yyprint (FILE *file
, int type
, const yystype
*value
);
104 symbol_class current_class
= unknown_sym
;
105 char *current_type
= 0;
106 symbol_t
*current_lhs
;
107 location_t current_lhs_location
;
108 associativity current_assoc
;
109 int current_prec
= 0;
110 braced_code_t current_braced_code
= action_braced_code
;
115 # if defined (__STDC__) || defined (__cplusplus)
116 /* Put the tokens into the symbol table, so that GDB and other debuggers
126 PERCENT_DESTRUCTOR
= 264,
127 PERCENT_PRINTER
= 265,
131 PERCENT_NONASSOC
= 269,
132 PERCENT_EXPECT
= 270,
137 PERCENT_VERBOSE
= 275,
138 PERCENT_ERROR_VERBOSE
= 276,
139 PERCENT_OUTPUT
= 277,
140 PERCENT_FILE_PREFIX
= 278,
141 PERCENT_NAME_PREFIX
= 279,
142 PERCENT_DEFINE
= 280,
143 PERCENT_PURE_PARSER
= 281,
144 PERCENT_GLR_PARSER
= 282,
145 PERCENT_DEFINES
= 283,
148 PERCENT_LOCATIONS
= 286,
149 PERCENT_NO_LINES
= 287,
150 PERCENT_SKELETON
= 288,
151 PERCENT_TOKEN_TABLE
= 289,
158 PERCENT_PERCENT
= 296,
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_DPREC 273
184 #define PERCENT_MERGE 274
185 #define PERCENT_VERBOSE 275
186 #define PERCENT_ERROR_VERBOSE 276
187 #define PERCENT_OUTPUT 277
188 #define PERCENT_FILE_PREFIX 278
189 #define PERCENT_NAME_PREFIX 279
190 #define PERCENT_DEFINE 280
191 #define PERCENT_PURE_PARSER 281
192 #define PERCENT_GLR_PARSER 282
193 #define PERCENT_DEFINES 283
194 #define PERCENT_YACC 284
195 #define PERCENT_DEBUG 285
196 #define PERCENT_LOCATIONS 286
197 #define PERCENT_NO_LINES 287
198 #define PERCENT_SKELETON 288
199 #define PERCENT_TOKEN_TABLE 289
202 #define SEMICOLON 292
206 #define PERCENT_PERCENT 296
209 #define BRACED_CODE 299
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 89 "parse-gram.y"
236 /* Line 187 of /usr/local/share/bison/yacc.c. */
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 207 of /usr/local/share/bison/yacc.c. */
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 108
363 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
365 #define YYMAXUTOK 299
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, 42, 43, 44
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, 50,
412 53, 55, 57, 59, 61, 63, 66, 69, 70, 75,
413 76, 81, 82, 86, 87, 91, 95, 99, 101, 103,
414 105, 106, 108, 110, 113, 115, 117, 120, 123, 127,
415 129, 132, 134, 137, 139, 142, 145, 146, 152, 154,
416 158, 159, 162, 165, 169, 173, 177, 179, 181, 183,
417 185, 187, 189, 190, 193, 194
420 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
421 static const signed char yyrhs
[] =
423 46, 0, -1, 47, 41, 61, 71, -1, -1, 47,
424 48, 72, -1, 49, -1, 42, -1, 30, -1, 25,
425 70, 70, -1, 28, -1, 21, -1, 15, 5, -1,
426 23, 36, 70, -1, 31, -1, 24, 36, 70, -1,
427 32, -1, 22, 36, 70, -1, 26, -1, 27, -1,
428 33, 70, -1, 34, -1, 20, -1, 29, -1, 55,
429 -1, 52, -1, 16, 67, -1, 11, 44, -1, -1,
430 9, 50, 44, 58, -1, -1, 10, 51, 44, 58,
431 -1, -1, 7, 53, 60, -1, -1, 6, 54, 60,
432 -1, 8, 35, 58, -1, 56, 57, 58, -1, 12,
433 -1, 13, -1, 14, -1, -1, 35, -1, 67, -1,
434 58, 67, -1, 35, -1, 40, -1, 40, 5, -1,
435 40, 69, -1, 40, 5, 69, -1, 59, -1, 60,
436 59, -1, 62, -1, 61, 62, -1, 63, -1, 49,
437 37, -1, 1, 37, -1, -1, 40, 38, 64, 65,
438 37, -1, 66, -1, 65, 39, 66, -1, -1, 66,
439 67, -1, 66, 68, -1, 66, 17, 67, -1, 66,
440 18, 5, -1, 66, 19, 35, -1, 40, -1, 69,
441 -1, 4, -1, 44, -1, 3, -1, 3, -1, -1,
442 41, 43, -1, -1, 37, -1
445 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
446 static const unsigned short yyrline
[] =
448 0, 159, 159, 172, 174, 177, 179, 180, 181, 182,
449 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
450 193, 194, 195, 198, 200, 201, 205, 212, 211, 222,
451 221, 234, 233, 239, 239, 244, 253, 268, 270, 271,
452 274, 276, 281, 283, 287, 292, 297, 303, 309, 319,
453 322, 331, 333, 339, 341, 346, 353, 352, 357, 359,
454 362, 365, 367, 369, 371, 373, 377, 379, 380, 383,
455 389, 398, 406, 411, 417, 419
459 #if YYDEBUG || YYERROR_VERBOSE
460 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
461 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
462 static const char *const yytname
[] =
464 "\"end of string\"", "error", "$undefined.", "STRING", "CHARACTER", "INT",
465 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
466 "\"%printer\"", "\"%union\"", "\"%left\"", "\"%right\"",
467 "\"%nonassoc\"", "\"%expect\"", "\"%start\"", "\"%prec\"", "\"%dprec\"",
468 "\"%merge\"", "\"%verbose\"", "\"%error-verbose\"", "\"%output\"",
469 "\"%file-prefix\"", "\"%name-prefix\"", "\"%define\"",
470 "\"%pure-parser\"", "\"%glr-parser\"", "\"%defines\"", "\"%yacc\"",
471 "\"%debug\"", "\"%locations\"", "\"%no-lines\"", "\"%skeleton\"",
472 "\"%token-table\"", "TYPE", "\"=\"", "\";\"", "\":\"", "\"|\"",
473 "\"identifier\"", "\"%%\"", "PROLOGUE", "EPILOGUE", "BRACED_CODE",
474 "$axiom", "input", "declarations", "declaration", "grammar_declaration",
475 "@1", "@2", "symbol_declaration", "@3", "@4", "precedence_declaration",
476 "precedence_declarator", "type.opt", "symbols.1", "symbol_def",
477 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
478 "@5", "rhses.1", "rhs", "symbol", "action", "string_as_id",
479 "string_content", "epilogue.opt", "semi_colon.opt", 0
483 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
485 static const short yytoknum
[] =
487 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
488 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
489 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
490 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
491 295, 296, 297, 298, 299, -1
494 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
495 static const unsigned char yyr1
[] =
497 0, 45, 46, 47, 47, 48, 48, 48, 48, 48,
498 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
499 48, 48, 48, 49, 49, 49, 49, 50, 49, 51,
500 49, 53, 52, 54, 52, 52, 55, 56, 56, 56,
501 57, 57, 58, 58, 59, 59, 59, 59, 59, 60,
502 60, 61, 61, 62, 62, 62, 64, 63, 65, 65,
503 66, 66, 66, 66, 66, 66, 67, 67, 67, 68,
504 69, 70, 71, 71, 72, 72
507 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
508 static const unsigned char yyr2
[] =
510 0, 2, 4, 0, 3, 1, 1, 1, 3, 1,
511 1, 2, 3, 1, 3, 1, 3, 1, 1, 2,
512 1, 1, 1, 1, 1, 2, 2, 0, 4, 0,
513 4, 0, 3, 0, 3, 3, 3, 1, 1, 1,
514 0, 1, 1, 2, 1, 1, 2, 2, 3, 1,
515 2, 1, 2, 1, 2, 2, 0, 5, 1, 3,
516 0, 2, 2, 3, 3, 3, 1, 1, 1, 1,
520 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
521 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
522 means the default is an error. */
523 static const short yydefact
[] =
525 3, 0, 0, 0, 33, 31, 0, 27, 29, 0,
526 37, 38, 39, 0, 0, 21, 10, 0, 0, 0,
527 0, 17, 18, 9, 22, 7, 13, 15, 0, 20,
528 0, 6, 74, 5, 24, 23, 40, 0, 0, 0,
529 0, 0, 26, 11, 70, 68, 66, 25, 67, 0,
530 0, 0, 71, 0, 19, 0, 0, 0, 0, 51,
531 53, 75, 4, 41, 0, 44, 45, 49, 34, 32,
532 35, 42, 0, 0, 16, 12, 14, 8, 55, 56,
533 54, 0, 52, 2, 36, 46, 47, 50, 43, 28,
534 30, 60, 73, 48, 0, 58, 57, 60, 0, 0,
535 0, 69, 61, 62, 59, 63, 64, 65
538 /* YYPGOTO[NTERM-NUM]. */
539 static const short yydefgoto
[] =
541 -1, 1, 2, 32, 57, 40, 41, 34, 38, 37,
542 35, 36, 64, 70, 67, 68, 58, 59, 60, 91,
543 94, 95, 71, 103, 48, 53, 83, 62
546 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
548 static const short yypact
[] =
550 -32768, 35, 85,-32768,-32768,-32768, 2,-32768,-32768, -5,
551 -32768,-32768,-32768, 31, 0,-32768,-32768, 18, 21, 22,
552 59,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 59,-32768,
553 37,-32768, 26,-32768,-32768,-32768, 29, -19, -19, 0,
554 23, 24,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 59,
555 59, 59,-32768, 59,-32768, 28, 33, 32, 1,-32768,
556 -32768,-32768,-32768,-32768, 0,-32768, 17,-32768, -19, -19,
557 0,-32768, 0, 0,-32768,-32768,-32768,-32768,-32768,-32768,
558 -32768, 30,-32768,-32768, 0, 63,-32768,-32768,-32768, 0,
559 0,-32768,-32768,-32768, -8, 15,-32768,-32768, 0, 67,
560 39,-32768,-32768,-32768, 15,-32768,-32768,-32768
563 /* YYPGOTO[NTERM-NUM]. */
564 static const short yypgoto
[] =
566 -32768,-32768,-32768,-32768, 76,-32768,-32768,-32768,-32768,-32768,
567 -32768,-32768,-32768, -12, -45, 41,-32768, 25,-32768,-32768,
568 -32768, -17, -14,-32768, -60, -23,-32768,-32768
571 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
572 positive, shift that token. If negative, reduce the rule which
573 number is the opposite. If zero, do what YYDEFACT says. */
574 static const short yytable
[] =
576 47, -72, 55, 44, 45, 54, 86, 4, 5, 6,
577 7, 8, 9, 10, 11, 12, 65, 14, 44, 45,
578 44, 66, 85, 87, 87, 93, 74, 75, 76, 96,
579 77, 97, 98, 99, 100, 3, 43, 39, 55, 42,
580 46, 56, 81, 4, 5, 6, 7, 8, 9, 10,
581 11, 12, 84, 14, 49, 46, 88, 50, 51, 101,
582 89, 90, 52, 61, 63, 78, 44, 72, 73, 80,
583 88, 79, 106, 92, 107, 88, 88, 56, 33, 69,
584 104, 102, 0, 82, 105, 0, 0, 0, 0, 0,
585 102, 4, 5, 6, 7, 8, 9, 10, 11, 12,
586 13, 14, 0, 0, 0, 15, 16, 17, 18, 19,
587 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
588 0, 0, 0, 0, 0, 0, 30, 31
591 static const short yycheck
[] =
593 14, 0, 1, 3, 4, 28, 66, 6, 7, 8,
594 9, 10, 11, 12, 13, 14, 35, 16, 3, 4,
595 3, 40, 5, 68, 69, 85, 49, 50, 51, 37,
596 53, 39, 17, 18, 19, 0, 5, 35, 1, 44,
597 40, 40, 41, 6, 7, 8, 9, 10, 11, 12,
598 13, 14, 64, 16, 36, 40, 70, 36, 36, 44,
599 72, 73, 3, 37, 35, 37, 3, 44, 44, 37,
600 84, 38, 5, 43, 35, 89, 90, 40, 2, 38,
601 97, 95, -1, 58, 98, -1, -1, -1, -1, -1,
602 104, 6, 7, 8, 9, 10, 11, 12, 13, 14,
603 15, 16, -1, -1, -1, 20, 21, 22, 23, 24,
604 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
605 -1, -1, -1, -1, -1, -1, 41, 42
608 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
609 symbol of state STATE-NUM. */
610 static const unsigned char yystos
[] =
612 0, 46, 47, 0, 6, 7, 8, 9, 10, 11,
613 12, 13, 14, 15, 16, 20, 21, 22, 23, 24,
614 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
615 41, 42, 48, 49, 52, 55, 56, 54, 53, 35,
616 50, 51, 44, 5, 3, 4, 40, 67, 69, 36,
617 36, 36, 3, 70, 70, 1, 40, 49, 61, 62,
618 63, 37, 72, 35, 57, 35, 40, 59, 60, 60,
619 58, 67, 44, 44, 70, 70, 70, 70, 37, 38,
620 37, 41, 62, 71, 58, 5, 69, 59, 67, 58,
621 58, 64, 43, 69, 65, 66, 37, 39, 17, 18,
622 19, 44, 67, 68, 66, 67, 5, 35
625 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
626 # define YYSIZE_T __SIZE_TYPE__
628 #if ! defined (YYSIZE_T) && defined (size_t)
629 # define YYSIZE_T size_t
631 #if ! defined (YYSIZE_T)
632 # if defined (__STDC__) || defined (__cplusplus)
633 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
634 # define YYSIZE_T size_t
637 #if ! defined (YYSIZE_T)
638 # define YYSIZE_T unsigned int
641 #define yyerrok (yyerrstatus = 0)
642 #define yyclearin (yychar = YYEMPTY)
646 #define YYACCEPT goto yyacceptlab
647 #define YYABORT goto yyabortlab
648 #define YYERROR goto yyerrlab1
650 /* Like YYERROR except do call yyerror. This remains here temporarily
651 to ease the transition to the new meaning of YYERROR, for GCC.
652 Once GCC version 2 has supplanted version 1, this can go. */
654 #define YYFAIL goto yyerrlab
656 #define YYRECOVERING() (!!yyerrstatus)
658 #define YYBACKUP(Token, Value) \
660 if (yychar == YYEMPTY && yylen == 1) \
664 yychar1 = YYTRANSLATE (yychar); \
670 yyerror ("syntax error: cannot back up"); \
676 #define YYERRCODE 256
678 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
681 #ifndef YYLLOC_DEFAULT
682 # define YYLLOC_DEFAULT(Current, Rhs, N) \
683 Current.first_line = Rhs[1].first_line; \
684 Current.first_column = Rhs[1].first_column; \
685 Current.last_line = Rhs[N].last_line; \
686 Current.last_column = Rhs[N].last_column;
689 /* YYLEX -- calling `yylex' with the right arguments. */
692 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
694 # define YYLEX yylex (&yylval, &yylloc)
697 /* Enable debugging if requested. */
701 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
702 # define YYFPRINTF fprintf
705 # define YYDPRINTF(Args) \
710 # define YYDSYMPRINT(Args) \
715 /* Nonzero means print parse trace. It is left uninitialized so that
716 multiple parsers can coexist. */
719 # define YYDPRINTF(Args)
720 # define YYDSYMPRINT(Args)
721 #endif /* !YYDEBUG */
723 /* YYINITDEPTH -- initial size of the parser's stacks. */
725 # define YYINITDEPTH 200
728 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
729 if the built-in stack extension method is used).
731 Do not make this value too large; the results are undefined if
732 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
733 evaluated with infinite-precision integer arithmetic. */
740 # define YYMAXDEPTH 10000
748 # if defined (__GLIBC__) && defined (_STRING_H)
749 # define yystrlen strlen
751 /* Return the length of YYSTR. */
753 # if defined (__STDC__) || defined (__cplusplus)
754 yystrlen (const char *yystr
)
760 register const char *yys
= yystr
;
762 while (*yys
++ != '\0')
765 return yys
- yystr
- 1;
771 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
772 # define yystpcpy stpcpy
774 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
777 # if defined (__STDC__) || defined (__cplusplus)
778 yystpcpy (char *yydest
, const char *yysrc
)
780 yystpcpy (yydest
, yysrc
)
785 register char *yyd
= yydest
;
786 register const char *yys
= yysrc
;
788 while ((*yyd
++ = *yys
++) != '\0')
796 #endif /* !YYERROR_VERBOSE */
800 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
801 into yyparse. The argument should have type void *.
802 It should actually point to an object.
803 Grammar actions can access the variable by casting it
804 to the proper pointer type. */
807 # if defined (__STDC__) || defined (__cplusplus)
808 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
809 # define YYPARSE_PARAM_DECL
811 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
812 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
814 #else /* !YYPARSE_PARAM */
815 # define YYPARSE_PARAM_ARG
816 # define YYPARSE_PARAM_DECL
817 #endif /* !YYPARSE_PARAM */
819 /* Prevent warning if -Wstrict-prototypes. */
821 # ifdef YYPARSE_PARAM
822 int yyparse (void *);
828 #if defined (__STDC__) || defined (__cplusplus)
829 static void yydestruct (int yytype
,
830 YYSTYPE yyvalue
, YYLTYPE yylocation
);
832 static void yysymprint (FILE* out
, int yytype
,
833 YYSTYPE yyvalue
, YYLTYPE yylocation
);
841 yyparse (YYPARSE_PARAM_ARG
)
844 /* The lookahead symbol. */
847 /* The semantic value of the lookahead symbol. */
850 /* Number of parse errors so far. */
852 /* Location data for the lookahead symbol. */
855 register int yystate
;
858 /* Number of tokens to shift before error messages enabled. */
860 /* Lookahead token as an internal (translated) token number. */
863 /* Three stacks and their tools:
864 `yyss': related to states,
865 `yyvs': related to semantic values,
866 `yyls': related to locations.
868 Refer to the stacks thru separate pointers, to allow yyoverflow
869 to reallocate them elsewhere. */
871 /* The state stack. */
872 short yyssa
[YYINITDEPTH
];
874 register short *yyssp
;
876 /* The semantic value stack. */
877 YYSTYPE yyvsa
[YYINITDEPTH
];
878 YYSTYPE
*yyvs
= yyvsa
;
879 register YYSTYPE
*yyvsp
;
881 /* The location stack. */
882 YYLTYPE yylsa
[YYINITDEPTH
];
883 YYLTYPE
*yyls
= yylsa
;
886 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
888 YYSIZE_T yystacksize
= YYINITDEPTH
;
890 /* The variables used to return semantic value and location from the
895 /* When reducing, the number of symbols on the RHS of the reduced
899 YYDPRINTF ((stderr
, "Starting parse\n"));
904 yychar
= YYEMPTY
; /* Cause a token to be read. */
906 /* Initialize stack pointers.
907 Waste one element of value and location stack
908 so that they stay on the same level as the state stack.
909 The wasted elements are never initialized. */
916 /*------------------------------------------------------------.
917 | yynewstate -- Push a new state, which is found in yystate. |
918 `------------------------------------------------------------*/
920 /* In all cases, when you get here, the value and location stacks
921 have just been pushed. so pushing a state here evens the stacks.
928 if (yyssp
>= yyss
+ yystacksize
- 1)
930 /* Get the current used size of the three stacks, in elements. */
931 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
935 /* Give user a chance to reallocate the stack. Use copies of
936 these so that the &'s don't force the real ones into
938 YYSTYPE
*yyvs1
= yyvs
;
940 YYLTYPE
*yyls1
= yyls
;
942 /* Each stack pointer address is followed by the size of the
943 data in use in that stack, in bytes. This used to be a
944 conditional around just the two extra args, but that might
945 be undefined if yyoverflow is a macro. */
946 yyoverflow ("parser stack overflow",
947 &yyss1
, yysize
* sizeof (*yyssp
),
948 &yyvs1
, yysize
* sizeof (*yyvsp
),
949 &yyls1
, yysize
* sizeof (*yylsp
),
955 #else /* no yyoverflow */
956 # ifndef YYSTACK_RELOCATE
959 /* Extend the stack our own way. */
960 if (yystacksize
>= YYMAXDEPTH
)
963 if (yystacksize
> YYMAXDEPTH
)
964 yystacksize
= YYMAXDEPTH
;
968 union yyalloc
*yyptr
=
969 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
972 YYSTACK_RELOCATE (yyss
);
973 YYSTACK_RELOCATE (yyvs
);
974 YYSTACK_RELOCATE (yyls
);
975 # undef YYSTACK_RELOCATE
977 YYSTACK_FREE (yyss1
);
980 #endif /* no yyoverflow */
982 yyssp
= yyss
+ yysize
- 1;
983 yyvsp
= yyvs
+ yysize
- 1;
984 yylsp
= yyls
+ yysize
- 1;
986 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
987 (unsigned long int) yystacksize
));
989 if (yyssp
>= yyss
+ yystacksize
- 1)
993 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1002 /* Do appropriate processing given the current state. */
1003 /* Read a lookahead token if we need one and don't already have one. */
1006 /* First try to decide what to do without reference to lookahead token. */
1008 yyn
= yypact
[yystate
];
1012 /* Not known => get a lookahead token if don't already have one. */
1014 /* yychar is either YYEMPTY or YYEOF
1015 or a valid token in external form. */
1017 if (yychar
== YYEMPTY
)
1019 YYDPRINTF ((stderr
, "Reading a token: "));
1023 /* Convert token to internal form (in yychar1) for indexing tables with. */
1025 if (yychar
<= 0) /* This means end of input. */
1028 yychar
= YYEOF
; /* Don't call YYLEX any more. */
1030 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1034 yychar1
= YYTRANSLATE (yychar
);
1036 /* We have to keep this `#if YYDEBUG', since we use variables
1037 which are defined only if `YYDEBUG' is set. */
1038 YYDPRINTF ((stderr
, "Next token is "));
1039 YYDSYMPRINT ((stderr
, yychar1
, yylval
, yyloc
));
1040 YYDPRINTF ((stderr
, "\n"));
1044 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
1049 /* yyn is what to do for this token type in this state.
1050 Negative => reduce, -yyn is rule number.
1051 Positive => shift, yyn is new state.
1052 New state is final state => don't bother to shift,
1053 just return success.
1054 0, or most negative number => error. */
1069 /* Shift the lookahead token. */
1070 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1071 yychar
, yytname
[yychar1
]));
1073 /* Discard the token being shifted unless it is eof. */
1074 if (yychar
!= YYEOF
)
1080 /* Count tokens shifted since error; after three, turn off error
1089 /*-----------------------------------------------------------.
1090 | yydefault -- do the default action for the current state. |
1091 `-----------------------------------------------------------*/
1093 yyn
= yydefact
[yystate
];
1099 /*-----------------------------.
1100 | yyreduce -- Do a reduction. |
1101 `-----------------------------*/
1103 /* yyn is the number of a rule to reduce with. */
1106 /* If YYLEN is nonzero, implement the default value of the action:
1109 Otherwise, the following line sets YYVAL to the semantic value of
1110 the lookahead token. This behavior is undocumented and Bison
1111 users should not rely upon it. Assigning to YYVAL
1112 unconditionally makes the parser a bit smaller, and it avoids a
1113 GCC warning that YYVAL may be used uninitialized. */
1114 yyval
= yyvsp
[1-yylen
];
1116 /* Default location. */
1117 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1120 /* We have to keep this `#if YYDEBUG', since we use variables which
1121 are defined only if `YYDEBUG' is set. */
1126 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1127 yyn
- 1, yyrline
[yyn
]);
1129 /* Print the symbols being reduced, and their result. */
1130 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] >= 0; yyi
++)
1131 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1132 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1138 #line 161 "parse-gram.y"
1140 yycontrol
->errcode
= 0;
1141 epilogue_set (yyvsp
[0].string
, yylsp
[0]);
1146 #line 179 "parse-gram.y"
1147 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1151 #line 180 "parse-gram.y"
1156 #line 181 "parse-gram.y"
1157 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1161 #line 182 "parse-gram.y"
1162 { defines_flag
= 1; }
1166 #line 183 "parse-gram.y"
1167 { error_verbose
= 1; }
1171 #line 184 "parse-gram.y"
1172 { expected_conflicts
= yyvsp
[0].integer
; }
1176 #line 185 "parse-gram.y"
1177 { spec_file_prefix
= yyvsp
[0].string
; }
1181 #line 186 "parse-gram.y"
1182 { locations_flag
= 1; }
1186 #line 187 "parse-gram.y"
1187 { spec_name_prefix
= yyvsp
[0].string
; }
1191 #line 188 "parse-gram.y"
1192 { no_lines_flag
= 1; }
1196 #line 189 "parse-gram.y"
1197 { spec_outfile
= yyvsp
[0].string
; }
1201 #line 190 "parse-gram.y"
1202 { pure_parser
= 1; }
1206 #line 191 "parse-gram.y"
1211 #line 192 "parse-gram.y"
1212 { skeleton
= yyvsp
[0].string
; }
1216 #line 193 "parse-gram.y"
1217 { token_table_flag
= 1; }
1221 #line 194 "parse-gram.y"
1222 { report_flag
= 1; }
1226 #line 195 "parse-gram.y"
1231 #line 202 "parse-gram.y"
1233 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1238 #line 206 "parse-gram.y"
1241 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1242 muscle_insert ("stype", yyvsp
[0].string
);
1247 #line 212 "parse-gram.y"
1248 { current_braced_code
= destructor_braced_code
; }
1252 #line 214 "parse-gram.y"
1254 symbol_list_t
*list
;
1255 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1256 symbol_destructor_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1257 symbol_list_free (yyvsp
[0].list
);
1258 current_braced_code
= action_braced_code
;
1263 #line 222 "parse-gram.y"
1264 { current_braced_code
= printer_braced_code
; }
1268 #line 224 "parse-gram.y"
1270 symbol_list_t
*list
;
1271 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1272 symbol_printer_set (list
->sym
, yyvsp
[-1].string
, list
->location
);
1273 symbol_list_free (yyvsp
[0].list
);
1274 current_braced_code
= action_braced_code
;
1279 #line 234 "parse-gram.y"
1280 { current_class
= nterm_sym
; }
1284 #line 235 "parse-gram.y"
1286 current_class
= unknown_sym
;
1287 current_type
= NULL
;
1292 #line 239 "parse-gram.y"
1293 { current_class
= token_sym
; }
1297 #line 240 "parse-gram.y"
1299 current_class
= unknown_sym
;
1300 current_type
= NULL
;
1305 #line 245 "parse-gram.y"
1307 symbol_list_t
*list
;
1308 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1309 symbol_type_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1310 symbol_list_free (yyvsp
[0].list
);
1315 #line 255 "parse-gram.y"
1317 symbol_list_t
*list
;
1319 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1321 symbol_type_set (list
->sym
, current_type
, yylsp
[-1]);
1322 symbol_precedence_set (list
->sym
, current_prec
, yyvsp
[-2].assoc
, yylsp
[-2]);
1324 symbol_list_free (yyvsp
[0].list
);
1325 current_type
= NULL
;
1330 #line 269 "parse-gram.y"
1331 { yyval
.assoc
= left_assoc
; }
1335 #line 270 "parse-gram.y"
1336 { yyval
.assoc
= right_assoc
; }
1340 #line 271 "parse-gram.y"
1341 { yyval
.assoc
= non_assoc
; }
1345 #line 275 "parse-gram.y"
1346 { current_type
= NULL
;}
1350 #line 276 "parse-gram.y"
1351 { current_type
= yyvsp
[0].string
; }
1355 #line 282 "parse-gram.y"
1356 { yyval
.list
= symbol_list_new (yyvsp
[0].symbol
, yylsp
[0]); }
1360 #line 283 "parse-gram.y"
1361 { yyval
.list
= symbol_list_prepend (yyvsp
[-1].list
, yyvsp
[0].symbol
, yylsp
[0]); }
1365 #line 289 "parse-gram.y"
1367 current_type
= yyvsp
[0].string
;
1372 #line 293 "parse-gram.y"
1374 symbol_class_set (yyvsp
[0].symbol
, current_class
, yylsp
[0]);
1375 symbol_type_set (yyvsp
[0].symbol
, current_type
, yylsp
[0]);
1380 #line 298 "parse-gram.y"
1382 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1383 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1384 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
, yylsp
[0]);
1389 #line 304 "parse-gram.y"
1391 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1392 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1393 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
, yyloc
);
1398 #line 310 "parse-gram.y"
1400 symbol_class_set (yyvsp
[-2].symbol
, current_class
, yylsp
[-2]);
1401 symbol_type_set (yyvsp
[-2].symbol
, current_type
, yylsp
[-2]);
1402 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
, yylsp
[-1]);
1403 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
, yyloc
);
1408 #line 321 "parse-gram.y"
1413 #line 323 "parse-gram.y"
1418 #line 342 "parse-gram.y"
1421 complain_at (yyloc
, _("POSIX forbids declarations in the grammar"));
1426 #line 347 "parse-gram.y"
1433 #line 353 "parse-gram.y"
1434 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1438 #line 354 "parse-gram.y"
1443 #line 358 "parse-gram.y"
1444 { grammar_rule_end (yylsp
[0]); }
1448 #line 359 "parse-gram.y"
1449 { grammar_rule_end (yylsp
[0]); }
1453 #line 364 "parse-gram.y"
1454 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1458 #line 366 "parse-gram.y"
1459 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1463 #line 368 "parse-gram.y"
1464 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1468 #line 370 "parse-gram.y"
1469 { grammar_current_rule_prec_set (yyvsp
[0].symbol
, yylsp
[0]); }
1473 #line 372 "parse-gram.y"
1474 { grammar_current_rule_dprec_set (yyvsp
[0].integer
, yylsp
[0]); }
1478 #line 374 "parse-gram.y"
1479 { grammar_current_rule_merge_set (yyvsp
[0].string
, yylsp
[0]); }
1483 #line 378 "parse-gram.y"
1484 { yyval
.symbol
= yyvsp
[0].symbol
; }
1488 #line 379 "parse-gram.y"
1489 { yyval
.symbol
= yyvsp
[0].symbol
; }
1493 #line 380 "parse-gram.y"
1494 { yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]); }
1498 #line 385 "parse-gram.y"
1499 { yyval
.string
= yyvsp
[0].string
; }
1503 #line 391 "parse-gram.y"
1505 yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]);
1506 symbol_class_set (yyval
.symbol
, token_sym
, yylsp
[0]);
1511 #line 400 "parse-gram.y"
1513 yyval
.string
= yyvsp
[0].string
+ 1;
1514 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1519 #line 408 "parse-gram.y"
1521 yyval
.string
= xstrdup ("");
1526 #line 412 "parse-gram.y"
1528 yyval
.string
= yyvsp
[0].string
;
1535 /* Line 955 of /usr/local/share/bison/yacc.c. */
1536 #line 1537 "parse-gram.c"
1545 short *yyssp1
= yyss
- 1;
1546 YYFPRINTF (stderr
, "state stack now");
1547 while (yyssp1
!= yyssp
)
1548 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1549 YYFPRINTF (stderr
, "\n");
1556 /* Now `shift' the result of the reduction. Determine what state
1557 that goes to, based on the state we popped back to and the rule
1558 number reduced by. */
1562 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1563 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1564 yystate
= yytable
[yystate
];
1566 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1571 /*------------------------------------.
1572 | yyerrlab -- here on detecting error |
1573 `------------------------------------*/
1575 /* If not already recovering from an error, report this error. */
1581 yyn
= yypact
[yystate
];
1583 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1585 YYSIZE_T yysize
= 0;
1590 /* Start YYX at -YYN if negative to avoid negative indexes in
1592 for (yyx
= yyn
< 0 ? -yyn
: 0;
1593 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1594 if (yycheck
[yyx
+ yyn
] == yyx
)
1595 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1596 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1597 yysize
+= yystrlen (yytname
[YYTRANSLATE (yychar
)]);
1598 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1601 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1602 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1607 for (yyx
= yyn
< 0 ? -yyn
: 0;
1608 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1610 if (yycheck
[yyx
+ yyn
] == yyx
)
1612 const char *yyq
= ! yycount
? ", expecting " : " or ";
1613 yyp
= yystpcpy (yyp
, yyq
);
1614 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1619 YYSTACK_FREE (yymsg
);
1622 yyerror ("parse error; also virtual memory exhausted");
1625 #endif /* YYERROR_VERBOSE */
1626 yyerror ("parse error");
1631 /*----------------------------------------------------.
1632 | yyerrlab1 -- error raised explicitly by an action. |
1633 `----------------------------------------------------*/
1635 if (yyerrstatus
== 3)
1637 /* If just tried and failed to reuse lookahead token after an
1638 error, discard it. */
1640 /* Return failure if at end of input. */
1641 if (yychar
== YYEOF
)
1643 /* Pop the error token. */
1645 /* Pop the rest of the stack. */
1646 while (yyssp
> yyss
)
1648 YYDPRINTF ((stderr
, "Error: popping "));
1649 YYDSYMPRINT ((stderr
,
1652 YYDPRINTF ((stderr
, "\n"));
1653 yydestruct (yystos
[*yyssp
], *yyvsp
, *yylsp
);
1659 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1660 yychar
, yytname
[yychar1
]));
1661 yydestruct (yychar1
, yylval
, yylloc
);
1665 /* Else will try to reuse lookahead token after shifting the error
1668 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1672 yyn
= yypact
[yystate
];
1676 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1684 /* Pop the current state because it cannot handle the error token. */
1688 YYDPRINTF ((stderr
, "Error: popping "));
1689 YYDSYMPRINT ((stderr
,
1690 yystos
[*yyssp
], *yyvsp
, *yylsp
));
1691 YYDPRINTF ((stderr
, "\n"));
1693 yydestruct (yystos
[yystate
], *yyvsp
, *yylsp
);
1701 short *yyssp1
= yyss
- 1;
1702 YYFPRINTF (stderr
, "Error: state stack now");
1703 while (yyssp1
!= yyssp
)
1704 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1705 YYFPRINTF (stderr
, "\n");
1713 YYDPRINTF ((stderr
, "Shifting error token, "));
1722 /*-------------------------------------.
1723 | yyacceptlab -- YYACCEPT comes here. |
1724 `-------------------------------------*/
1729 /*-----------------------------------.
1730 | yyabortlab -- YYABORT comes here. |
1731 `-----------------------------------*/
1737 /*----------------------------------------------.
1738 | yyoverflowlab -- parser overflow comes here. |
1739 `----------------------------------------------*/
1741 yyerror ("parser stack overflow");
1749 YYSTACK_FREE (yyss
);
1755 /*-----------------------------------------------.
1756 | Release the memory associated to this symbol. |
1757 `-----------------------------------------------*/
1760 yydestruct (int yytype
,
1761 YYSTYPE yyvalue
, YYLTYPE yylocation
)
1763 /* Pacify ``unused variable'' warnings. */
1776 /*-----------------------------.
1777 | Print this symbol on YYOUT. |
1778 `-----------------------------*/
1781 yysymprint (FILE* yyout
, int yytype
,
1782 YYSTYPE yyvalue
, YYLTYPE yylocation
)
1784 /* Pacify ``unused variable'' warnings. */
1788 if (yytype
< YYNTOKENS
)
1790 YYFPRINTF (yyout
, "token %s (", yytname
[yytype
]);
1792 YYPRINT (yyout
, yytoknum
[yytype
], yyvalue
);
1796 YYFPRINTF (yyout
, "nterm %s (", yytname
[yytype
]);
1803 YYFPRINTF (yyout
, ")");
1805 #endif /* YYDEBUG. */
1807 #line 421 "parse-gram.y"
1809 /*------------------------------------------------------------------.
1810 | When debugging the parser, display tokens' locations and values. |
1811 `------------------------------------------------------------------*/
1814 yyprint (FILE *file
,
1815 int type
, const yystype
*value
)
1821 fprintf (file
, " = '%s'", value
->string
);
1825 fprintf (file
, " = %s", value
->symbol
->tag
);
1829 fprintf (file
, " = %d", value
->integer
);
1833 fprintf (file
, " = \"%s\"", value
->string
);
1837 fprintf (file
, " = <%s>", value
->string
);
1843 fprintf (file
, " = {{ %s }}", value
->string
);
1849 gram_error (gram_control_t
*control ATTRIBUTE_UNUSED
,
1850 location_t
*yylloc
, const char *msg
)
1852 complain_at (*yylloc
, "%s", msg
);