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"
60 #include "muscle_tab.h"
67 #include "conflicts.h"
69 /* Produce verbose parse errors. */
70 #define YYERROR_VERBOSE 1
71 #define YYLLOC_DEFAULT(Current, Rhs, N) \
75 Current.first_column = Rhs[1].first_column; \
76 Current.first_line = Rhs[1].first_line; \
77 Current.last_column = Rhs[N].last_column; \
78 Current.last_line = Rhs[N].last_line; \
86 /* Pass the control structure to YYPARSE and YYLEX. */
87 #define YYPARSE_PARAM gram_control
88 #define YYLEX_PARAM gram_control
89 /* YYPARSE receives GRAM_CONTROL as a void *. Provide a
90 correctly typed access to it. */
91 #define yycontrol ((gram_control_t *) gram_control)
93 /* Request detailed parse error messages, and pass them to
96 #define yyerror(Msg) \
97 gram_error (yycontrol, &yylloc, Msg)
99 #define YYPRINT(File, Type, Value) \
100 yyprint (File, Type, &Value)
101 static void yyprint (FILE *file
, int type
, const yystype
*value
);
103 symbol_class current_class
= unknown_sym
;
104 char *current_type
= 0;
105 symbol_t
*current_lhs
;
106 location_t current_lhs_location
;
107 associativity current_assoc
;
108 int current_prec
= 0;
109 braced_code_t current_braced_code
= action_braced_code
;
114 # if defined (__STDC__) || defined (__cplusplus)
115 /* Put the tokens into the symbol table, so that GDB and other debuggers
125 PERCENT_DESTRUCTOR
= 264,
126 PERCENT_PRINTER
= 265,
130 PERCENT_NONASSOC
= 269,
131 PERCENT_EXPECT
= 270,
136 PERCENT_VERBOSE
= 275,
137 PERCENT_ERROR_VERBOSE
= 276,
138 PERCENT_OUTPUT
= 277,
139 PERCENT_FILE_PREFIX
= 278,
140 PERCENT_NAME_PREFIX
= 279,
141 PERCENT_DEFINE
= 280,
142 PERCENT_PURE_PARSER
= 281,
143 PERCENT_GLR_PARSER
= 282,
144 PERCENT_DEFINES
= 283,
147 PERCENT_LOCATIONS
= 286,
148 PERCENT_NO_LINES
= 287,
149 PERCENT_SKELETON
= 288,
150 PERCENT_TOKEN_TABLE
= 289,
157 PERCENT_PERCENT
= 296,
163 /* POSIX requires `int' for tokens in interfaces. */
164 # define YYTOKENTYPE int
165 #endif /* !YYTOKENTYPE */
168 #define CHARACTER 259
170 #define PERCENT_TOKEN 261
171 #define PERCENT_NTERM 262
172 #define PERCENT_TYPE 263
173 #define PERCENT_DESTRUCTOR 264
174 #define PERCENT_PRINTER 265
175 #define PERCENT_UNION 266
176 #define PERCENT_LEFT 267
177 #define PERCENT_RIGHT 268
178 #define PERCENT_NONASSOC 269
179 #define PERCENT_EXPECT 270
180 #define PERCENT_START 271
181 #define PERCENT_PREC 272
182 #define PERCENT_DPREC 273
183 #define PERCENT_MERGE 274
184 #define PERCENT_VERBOSE 275
185 #define PERCENT_ERROR_VERBOSE 276
186 #define PERCENT_OUTPUT 277
187 #define PERCENT_FILE_PREFIX 278
188 #define PERCENT_NAME_PREFIX 279
189 #define PERCENT_DEFINE 280
190 #define PERCENT_PURE_PARSER 281
191 #define PERCENT_GLR_PARSER 282
192 #define PERCENT_DEFINES 283
193 #define PERCENT_YACC 284
194 #define PERCENT_DEBUG 285
195 #define PERCENT_LOCATIONS 286
196 #define PERCENT_NO_LINES 287
197 #define PERCENT_SKELETON 288
198 #define PERCENT_TOKEN_TABLE 289
201 #define SEMICOLON 292
205 #define PERCENT_PERCENT 296
208 #define BRACED_CODE 299
213 /* Enabling traces. */
218 /* Enabling verbose error messages. */
219 #ifdef YYERROR_VERBOSE
220 # undef YYERROR_VERBOSE
221 # define YYERROR_VERBOSE 1
223 # define YYERROR_VERBOSE 0
227 #line 88 "parse-gram.y"
235 /* Line 187 of /home/lrde/prof/akim/src/bison/data/yacc.c. */
236 #line 237 "parse-gram.c"
237 # define YYSTYPE yystype
238 # define YYSTYPE_IS_TRIVIAL 1
242 typedef struct yyltype
249 # define YYLTYPE yyltype
250 # define YYLTYPE_IS_TRIVIAL 1
253 /* Copy the second part of user declarations. */
256 /* Line 207 of /home/lrde/prof/akim/src/bison/data/yacc.c. */
257 #line 258 "parse-gram.c"
259 #if ! defined (yyoverflow) || YYERROR_VERBOSE
261 /* The parser invokes alloca or malloc; define the necessary symbols. */
263 # if YYSTACK_USE_ALLOCA
264 # define YYSTACK_ALLOC alloca
266 # ifndef YYSTACK_USE_ALLOCA
267 # if defined (alloca) || defined (_ALLOCA_H)
268 # define YYSTACK_ALLOC alloca
271 # define YYSTACK_ALLOC __builtin_alloca
277 # ifdef YYSTACK_ALLOC
278 /* Pacify GCC's `empty if-body' warning. */
279 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
281 # if defined (__STDC__) || defined (__cplusplus)
282 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
283 # define YYSIZE_T size_t
285 # define YYSTACK_ALLOC malloc
286 # define YYSTACK_FREE free
288 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
291 #if (! defined (yyoverflow) \
292 && (! defined (__cplusplus) \
293 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
295 /* A type that is properly aligned for any stack member. */
303 /* The size of the maximum gap between one aligned stack and the next. */
304 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
306 /* The size of an array large to enough to hold all stacks, each with
308 # define YYSTACK_BYTES(N) \
309 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
310 + 2 * YYSTACK_GAP_MAX)
312 /* Copy COUNT objects from FROM to TO. The source and destination do
316 # define YYCOPY(To, From, Count) \
317 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
319 # define YYCOPY(To, From, Count) \
322 register YYSIZE_T yyi; \
323 for (yyi = 0; yyi < (Count); yyi++) \
324 (To)[yyi] = (From)[yyi]; \
330 /* Relocate STACK from its old location to the new one. The
331 local variables YYSIZE and YYSTACKSIZE give the old and new number of
332 elements in the stack, and YYPTR gives the new location of the
333 stack. Advance YYPTR to a properly aligned location for the next
335 # define YYSTACK_RELOCATE(Stack) \
338 YYSIZE_T yynewbytes; \
339 YYCOPY (&yyptr->Stack, Stack, yysize); \
340 Stack = &yyptr->Stack; \
341 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
342 yyptr += yynewbytes / sizeof (*yyptr); \
348 /* YYFINAL -- State number of the termination state. */
350 #define YYFLAG -32768
353 /* YYNTOKENS -- Number of terminals. */
355 /* YYNNTS -- Number of nonterminals. */
357 /* YYNRULES -- Number of rules. */
359 /* YYNRULES -- Number of states. */
360 #define YYNSTATES 106
362 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
364 #define YYMAXUTOK 299
366 #define YYTRANSLATE(X) \
367 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
369 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
370 static const unsigned char yytranslate
[] =
372 0, 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, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
398 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
399 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
400 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
401 35, 36, 37, 38, 39, 40, 41, 42, 43, 44
405 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
407 static const unsigned char yyprhs
[] =
409 0, 0, 3, 8, 9, 13, 15, 17, 19, 23,
410 25, 27, 30, 34, 36, 40, 42, 46, 48, 50,
411 53, 55, 57, 59, 61, 63, 66, 69, 70, 75,
412 76, 81, 82, 86, 87, 91, 95, 99, 101, 103,
413 105, 106, 108, 110, 113, 115, 117, 120, 123, 127,
414 129, 132, 134, 137, 139, 142, 143, 149, 151, 155,
415 156, 159, 162, 166, 170, 174, 176, 178, 180, 182,
416 184, 186, 187, 190, 191
419 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
420 static const signed char yyrhs
[] =
422 46, 0, -1, 47, 41, 61, 71, -1, -1, 47,
423 48, 72, -1, 49, -1, 42, -1, 30, -1, 25,
424 70, 70, -1, 28, -1, 21, -1, 15, 5, -1,
425 23, 36, 70, -1, 31, -1, 24, 36, 70, -1,
426 32, -1, 22, 36, 70, -1, 26, -1, 27, -1,
427 33, 70, -1, 34, -1, 20, -1, 29, -1, 55,
428 -1, 52, -1, 16, 67, -1, 11, 44, -1, -1,
429 9, 50, 44, 58, -1, -1, 10, 51, 44, 58,
430 -1, -1, 7, 53, 60, -1, -1, 6, 54, 60,
431 -1, 8, 35, 58, -1, 56, 57, 58, -1, 12,
432 -1, 13, -1, 14, -1, -1, 35, -1, 67, -1,
433 58, 67, -1, 35, -1, 40, -1, 40, 5, -1,
434 40, 69, -1, 40, 5, 69, -1, 59, -1, 60,
435 59, -1, 62, -1, 61, 62, -1, 63, -1, 49,
436 37, -1, -1, 40, 38, 64, 65, 37, -1, 66,
437 -1, 65, 39, 66, -1, -1, 66, 67, -1, 66,
438 68, -1, 66, 17, 67, -1, 66, 18, 5, -1,
439 66, 19, 35, -1, 40, -1, 69, -1, 4, -1,
440 44, -1, 3, -1, 3, -1, -1, 41, 43, -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, 194, 197, 199, 200, 204, 211, 210, 221,
450 220, 233, 232, 238, 238, 243, 252, 267, 269, 270,
451 273, 275, 280, 282, 286, 291, 296, 302, 308, 318,
452 321, 330, 332, 338, 340, 344, 343, 348, 350, 353,
453 356, 358, 360, 362, 364, 368, 370, 371, 374, 380,
454 389, 397, 402, 408, 410
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\"", "\"%dprec\"",
467 "\"%merge\"", "\"%verbose\"", "\"%error-verbose\"", "\"%output\"",
468 "\"%file-prefix\"", "\"%name-prefix\"", "\"%define\"",
469 "\"%pure-parser\"", "\"%glr-parser\"", "\"%defines\"", "\"%yacc\"",
470 "\"%debug\"", "\"%locations\"", "\"%no-lines\"", "\"%skeleton\"",
471 "\"%token-table\"", "TYPE", "\"=\"", "\";\"", "\":\"", "\"|\"",
472 "\"identifier\"", "\"%%\"", "PROLOGUE", "EPILOGUE", "BRACED_CODE",
473 "$axiom", "input", "declarations", "declaration", "grammar_declaration",
474 "@1", "@2", "symbol_declaration", "@3", "@4", "precedence_declaration",
475 "precedence_declarator", "type.opt", "symbols.1", "symbol_def",
476 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
477 "@5", "rhses.1", "rhs", "symbol", "action", "string_as_id",
478 "string_content", "epilogue.opt", "semi_colon.opt", 0
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,
490 295, 296, 297, 298, 299, -1
493 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
494 static const unsigned char yyr1
[] =
496 0, 45, 46, 47, 47, 48, 48, 48, 48, 48,
497 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
498 48, 48, 48, 49, 49, 49, 49, 50, 49, 51,
499 49, 53, 52, 54, 52, 52, 55, 56, 56, 56,
500 57, 57, 58, 58, 59, 59, 59, 59, 59, 60,
501 60, 61, 61, 62, 62, 64, 63, 65, 65, 66,
502 66, 66, 66, 66, 66, 67, 67, 67, 68, 69,
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, 1, 2,
511 1, 1, 1, 1, 1, 2, 2, 0, 4, 0,
512 4, 0, 3, 0, 3, 3, 3, 1, 1, 1,
513 0, 1, 1, 2, 1, 1, 2, 2, 3, 1,
514 2, 1, 2, 1, 2, 0, 5, 1, 3, 0,
515 2, 2, 3, 3, 3, 1, 1, 1, 1, 1,
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, 33, 31, 0, 27, 29, 0,
525 37, 38, 39, 0, 0, 21, 10, 0, 0, 0,
526 0, 17, 18, 9, 22, 7, 13, 15, 0, 20,
527 0, 6, 73, 5, 24, 23, 40, 0, 0, 0,
528 0, 0, 26, 11, 69, 67, 65, 25, 66, 0,
529 0, 0, 70, 0, 19, 0, 0, 71, 51, 53,
530 74, 4, 41, 0, 44, 45, 49, 34, 32, 35,
531 42, 0, 0, 16, 12, 14, 8, 55, 54, 0,
532 52, 2, 36, 46, 47, 50, 43, 28, 30, 59,
533 72, 48, 0, 57, 56, 59, 0, 0, 0, 68,
534 60, 61, 58, 62, 63, 64
537 /* YYPGOTO[NTERM-NUM]. */
538 static const short yydefgoto
[] =
540 -1, 1, 2, 32, 56, 40, 41, 34, 38, 37,
541 35, 36, 63, 69, 66, 67, 57, 58, 59, 89,
542 92, 93, 70, 101, 48, 53, 81, 61
545 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
547 static const short yypact
[] =
549 -32768, 7, 83,-32768,-32768,-32768, -23,-32768,-32768, 3,
550 -32768,-32768,-32768, 43, 0,-32768,-32768, 13, 14, 15,
551 51,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 51,-32768,
552 23,-32768, 19,-32768,-32768,-32768, 22, -29, -29, 0,
553 17, 18,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 51,
554 51, 51,-32768, 51,-32768, 20, 27, 12,-32768,-32768,
555 -32768,-32768,-32768, 0,-32768, 5,-32768, -29, -29, 0,
556 -32768, 0, 0,-32768,-32768,-32768,-32768,-32768,-32768, 28,
557 -32768,-32768, 0, 56,-32768,-32768,-32768, 0, 0,-32768,
558 -32768,-32768, 4, -2,-32768,-32768, 0, 55, 35,-32768,
559 -32768,-32768, -2,-32768,-32768,-32768
562 /* YYPGOTO[NTERM-NUM]. */
563 static const short yypgoto
[] =
565 -32768,-32768,-32768,-32768, 70,-32768,-32768,-32768,-32768,-32768,
566 -32768,-32768,-32768, -58, -22, 37,-32768, 21,-32768,-32768,
567 -32768, -19, -14,-32768, -56, 16,-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 47, 44, 45, 44, 45, 82, 64, 3, 44, 84,
576 83, 65, 39, 87, 88, 96, 97, 98, 4, 5,
577 6, 7, 8, 9, 10, 11, 12, 91, 14, 4,
578 5, 6, 7, 8, 9, 10, 11, 12, 46, 14,
579 46, 94, 99, 95, 54, 85, 85, 42, 43, 49,
580 50, 51, 55, 79, 52, 86, 60, 62, 77, 44,
581 104, 71, 72, 55, 78, 73, 74, 75, 86, 76,
582 105, 90, 33, 86, 86, 68, 102, 0, 80, 100,
583 0, 0, 103, 0, 0, 0, 0, 0, 100, 4,
584 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
585 0, 0, 0, 15, 16, 17, 18, 19, 20, 21,
586 22, 23, 24, 25, 26, 27, 28, 29, 0, 0,
590 static const short yycheck
[] =
592 14, 3, 4, 3, 4, 63, 35, 0, 3, 65,
593 5, 40, 35, 71, 72, 17, 18, 19, 6, 7,
594 8, 9, 10, 11, 12, 13, 14, 83, 16, 6,
595 7, 8, 9, 10, 11, 12, 13, 14, 40, 16,
596 40, 37, 44, 39, 28, 67, 68, 44, 5, 36,
597 36, 36, 40, 41, 3, 69, 37, 35, 38, 3,
598 5, 44, 44, 40, 37, 49, 50, 51, 82, 53,
599 35, 43, 2, 87, 88, 38, 95, -1, 57, 93,
600 -1, -1, 96, -1, -1, -1, -1, -1, 102, 6,
601 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
602 -1, -1, -1, 20, 21, 22, 23, 24, 25, 26,
603 27, 28, 29, 30, 31, 32, 33, 34, -1, -1,
604 -1, -1, -1, -1, 41, 42
607 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
608 symbol of state STATE-NUM. */
609 static const unsigned char yystos
[] =
611 0, 46, 47, 0, 6, 7, 8, 9, 10, 11,
612 12, 13, 14, 15, 16, 20, 21, 22, 23, 24,
613 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
614 41, 42, 48, 49, 52, 55, 56, 54, 53, 35,
615 50, 51, 44, 5, 3, 4, 40, 67, 69, 36,
616 36, 36, 3, 70, 70, 40, 49, 61, 62, 63,
617 37, 72, 35, 57, 35, 40, 59, 60, 60, 58,
618 67, 44, 44, 70, 70, 70, 70, 38, 37, 41,
619 62, 71, 58, 5, 69, 59, 67, 58, 58, 64,
620 43, 69, 65, 66, 37, 39, 17, 18, 19, 44,
621 67, 68, 66, 67, 5, 35
624 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
625 # define YYSIZE_T __SIZE_TYPE__
627 #if ! defined (YYSIZE_T) && defined (size_t)
628 # define YYSIZE_T size_t
630 #if ! defined (YYSIZE_T)
631 # if defined (__STDC__) || defined (__cplusplus)
632 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
633 # define YYSIZE_T size_t
636 #if ! defined (YYSIZE_T)
637 # define YYSIZE_T unsigned int
640 #define yyerrok (yyerrstatus = 0)
641 #define yyclearin (yychar = YYEMPTY)
645 #define YYACCEPT goto yyacceptlab
646 #define YYABORT goto yyabortlab
647 #define YYERROR goto yyerrlab1
649 /* Like YYERROR except do call yyerror. This remains here temporarily
650 to ease the transition to the new meaning of YYERROR, for GCC.
651 Once GCC version 2 has supplanted version 1, this can go. */
653 #define YYFAIL goto yyerrlab
655 #define YYRECOVERING() (!!yyerrstatus)
657 #define YYBACKUP(Token, Value) \
659 if (yychar == YYEMPTY && yylen == 1) \
663 yychar1 = YYTRANSLATE (yychar); \
669 yyerror ("syntax error: cannot back up"); \
675 #define YYERRCODE 256
677 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
680 #ifndef YYLLOC_DEFAULT
681 # define YYLLOC_DEFAULT(Current, Rhs, N) \
682 Current.first_line = Rhs[1].first_line; \
683 Current.first_column = Rhs[1].first_column; \
684 Current.last_line = Rhs[N].last_line; \
685 Current.last_column = Rhs[N].last_column;
688 /* YYLEX -- calling `yylex' with the right arguments. */
691 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
693 # define YYLEX yylex (&yylval, &yylloc)
696 /* Enable debugging if requested. */
700 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
701 # define YYFPRINTF fprintf
704 # define YYDPRINTF(Args) \
709 # define YYDSYMPRINT(Args) \
714 /* Nonzero means print parse trace. It is left uninitialized so that
715 multiple parsers can coexist. */
718 # define YYDPRINTF(Args)
719 # define YYDSYMPRINT(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 *);
827 #if defined (__STDC__) || defined (__cplusplus)
828 static void yydestruct (int yytype
,
829 YYSTYPE yyvalue
, YYLTYPE yylocation
);
831 static void yysymprint (FILE* out
, int yytype
,
832 YYSTYPE yyvalue
, YYLTYPE yylocation
);
840 yyparse (YYPARSE_PARAM_ARG
)
843 /* The lookahead symbol. */
846 /* The semantic value of the lookahead symbol. */
849 /* Number of parse errors so far. */
851 /* Location data for the lookahead symbol. */
854 register int yystate
;
857 /* Number of tokens to shift before error messages enabled. */
859 /* Lookahead token as an internal (translated) token number. */
862 /* Three stacks and their tools:
863 `yyss': related to states,
864 `yyvs': related to semantic values,
865 `yyls': related to locations.
867 Refer to the stacks thru separate pointers, to allow yyoverflow
868 to reallocate them elsewhere. */
870 /* The state stack. */
871 short yyssa
[YYINITDEPTH
];
873 register short *yyssp
;
875 /* The semantic value stack. */
876 YYSTYPE yyvsa
[YYINITDEPTH
];
877 YYSTYPE
*yyvs
= yyvsa
;
878 register YYSTYPE
*yyvsp
;
880 /* The location stack. */
881 YYLTYPE yylsa
[YYINITDEPTH
];
882 YYLTYPE
*yyls
= yylsa
;
885 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
887 YYSIZE_T yystacksize
= YYINITDEPTH
;
889 /* The variables used to return semantic value and location from the
894 /* When reducing, the number of symbols on the RHS of the reduced
898 YYDPRINTF ((stderr
, "Starting parse\n"));
903 yychar
= YYEMPTY
; /* Cause a token to be read. */
905 /* Initialize stack pointers.
906 Waste one element of value and location stack
907 so that they stay on the same level as the state stack.
908 The wasted elements are never initialized. */
915 /*------------------------------------------------------------.
916 | yynewstate -- Push a new state, which is found in yystate. |
917 `------------------------------------------------------------*/
919 /* In all cases, when you get here, the value and location stacks
920 have just been pushed. so pushing a state here evens the stacks.
927 if (yyssp
>= yyss
+ yystacksize
- 1)
929 /* Get the current used size of the three stacks, in elements. */
930 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
934 /* Give user a chance to reallocate the stack. Use copies of
935 these so that the &'s don't force the real ones into
937 YYSTYPE
*yyvs1
= yyvs
;
939 YYLTYPE
*yyls1
= yyls
;
941 /* Each stack pointer address is followed by the size of the
942 data in use in that stack, in bytes. This used to be a
943 conditional around just the two extra args, but that might
944 be undefined if yyoverflow is a macro. */
945 yyoverflow ("parser stack overflow",
946 &yyss1
, yysize
* sizeof (*yyssp
),
947 &yyvs1
, yysize
* sizeof (*yyvsp
),
948 &yyls1
, yysize
* sizeof (*yylsp
),
954 #else /* no yyoverflow */
955 # ifndef YYSTACK_RELOCATE
958 /* Extend the stack our own way. */
959 if (yystacksize
>= YYMAXDEPTH
)
962 if (yystacksize
> YYMAXDEPTH
)
963 yystacksize
= YYMAXDEPTH
;
967 union yyalloc
*yyptr
=
968 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
971 YYSTACK_RELOCATE (yyss
);
972 YYSTACK_RELOCATE (yyvs
);
973 YYSTACK_RELOCATE (yyls
);
974 # undef YYSTACK_RELOCATE
976 YYSTACK_FREE (yyss1
);
979 #endif /* no yyoverflow */
981 yyssp
= yyss
+ yysize
- 1;
982 yyvsp
= yyvs
+ yysize
- 1;
983 yylsp
= yyls
+ yysize
- 1;
985 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
986 (unsigned long int) yystacksize
));
988 if (yyssp
>= yyss
+ yystacksize
- 1)
992 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1001 /* Do appropriate processing given the current state. */
1002 /* Read a lookahead token if we need one and don't already have one. */
1005 /* First try to decide what to do without reference to lookahead token. */
1007 yyn
= yypact
[yystate
];
1011 /* Not known => get a lookahead token if don't already have one. */
1013 /* yychar is either YYEMPTY or YYEOF
1014 or a valid token in external form. */
1016 if (yychar
== YYEMPTY
)
1018 YYDPRINTF ((stderr
, "Reading a token: "));
1022 /* Convert token to internal form (in yychar1) for indexing tables with. */
1024 if (yychar
<= 0) /* This means end of input. */
1027 yychar
= YYEOF
; /* Don't call YYLEX any more. */
1029 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1033 yychar1
= YYTRANSLATE (yychar
);
1035 /* We have to keep this `#if YYDEBUG', since we use variables
1036 which are defined only if `YYDEBUG' is set. */
1037 YYDPRINTF ((stderr
, "Next token is "));
1038 YYDSYMPRINT ((stderr
, yychar1
, yylval
, yyloc
));
1039 YYDPRINTF ((stderr
, "\n"));
1043 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
1048 /* yyn is what to do for this token type in this state.
1049 Negative => reduce, -yyn is rule number.
1050 Positive => shift, yyn is new state.
1051 New state is final state => don't bother to shift,
1052 just return success.
1053 0, or most negative number => error. */
1068 /* Shift the lookahead token. */
1069 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1070 yychar
, yytname
[yychar1
]));
1072 /* Discard the token being shifted unless it is eof. */
1073 if (yychar
!= YYEOF
)
1079 /* Count tokens shifted since error; after three, turn off error
1088 /*-----------------------------------------------------------.
1089 | yydefault -- do the default action for the current state. |
1090 `-----------------------------------------------------------*/
1092 yyn
= yydefact
[yystate
];
1098 /*-----------------------------.
1099 | yyreduce -- Do a reduction. |
1100 `-----------------------------*/
1102 /* yyn is the number of a rule to reduce with. */
1105 /* If YYLEN is nonzero, implement the default value of the action:
1108 Otherwise, the following line sets YYVAL to the semantic value of
1109 the lookahead token. This behavior is undocumented and Bison
1110 users should not rely upon it. Assigning to YYVAL
1111 unconditionally makes the parser a bit smaller, and it avoids a
1112 GCC warning that YYVAL may be used uninitialized. */
1113 yyval
= yyvsp
[1-yylen
];
1115 /* Default location. */
1116 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1119 /* We have to keep this `#if YYDEBUG', since we use variables which
1120 are defined only if `YYDEBUG' is set. */
1125 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1126 yyn
- 1, yyrline
[yyn
]);
1128 /* Print the symbols being reduced, and their result. */
1129 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] >= 0; yyi
++)
1130 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1131 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1137 #line 160 "parse-gram.y"
1139 yycontrol
->errcode
= 0;
1140 epilogue_set (yyvsp
[0].string
, yylsp
[0]);
1145 #line 178 "parse-gram.y"
1146 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1150 #line 179 "parse-gram.y"
1155 #line 180 "parse-gram.y"
1156 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1160 #line 181 "parse-gram.y"
1161 { defines_flag
= 1; }
1165 #line 182 "parse-gram.y"
1166 { error_verbose
= 1; }
1170 #line 183 "parse-gram.y"
1171 { expected_conflicts
= yyvsp
[0].integer
; }
1175 #line 184 "parse-gram.y"
1176 { spec_file_prefix
= yyvsp
[0].string
; }
1180 #line 185 "parse-gram.y"
1181 { locations_flag
= 1; }
1185 #line 186 "parse-gram.y"
1186 { spec_name_prefix
= yyvsp
[0].string
; }
1190 #line 187 "parse-gram.y"
1191 { no_lines_flag
= 1; }
1195 #line 188 "parse-gram.y"
1196 { spec_outfile
= yyvsp
[0].string
; }
1200 #line 189 "parse-gram.y"
1201 { pure_parser
= 1; }
1205 #line 190 "parse-gram.y"
1210 #line 191 "parse-gram.y"
1211 { skeleton
= yyvsp
[0].string
; }
1215 #line 192 "parse-gram.y"
1216 { token_table_flag
= 1; }
1220 #line 193 "parse-gram.y"
1221 { report_flag
= 1; }
1225 #line 194 "parse-gram.y"
1230 #line 201 "parse-gram.y"
1232 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1237 #line 205 "parse-gram.y"
1240 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1241 muscle_insert ("stype", yyvsp
[0].string
);
1246 #line 211 "parse-gram.y"
1247 { current_braced_code
= destructor_braced_code
; }
1251 #line 213 "parse-gram.y"
1253 symbol_list_t
*list
;
1254 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1255 symbol_destructor_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1256 symbol_list_free (yyvsp
[0].list
);
1257 current_braced_code
= action_braced_code
;
1262 #line 221 "parse-gram.y"
1263 { current_braced_code
= printer_braced_code
; }
1267 #line 223 "parse-gram.y"
1269 symbol_list_t
*list
;
1270 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1271 symbol_printer_set (list
->sym
, yyvsp
[-1].string
, list
->location
);
1272 symbol_list_free (yyvsp
[0].list
);
1273 current_braced_code
= action_braced_code
;
1278 #line 233 "parse-gram.y"
1279 { current_class
= nterm_sym
; }
1283 #line 234 "parse-gram.y"
1285 current_class
= unknown_sym
;
1286 current_type
= NULL
;
1291 #line 238 "parse-gram.y"
1292 { current_class
= token_sym
; }
1296 #line 239 "parse-gram.y"
1298 current_class
= unknown_sym
;
1299 current_type
= NULL
;
1304 #line 244 "parse-gram.y"
1306 symbol_list_t
*list
;
1307 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1308 symbol_type_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1309 symbol_list_free (yyvsp
[0].list
);
1314 #line 254 "parse-gram.y"
1316 symbol_list_t
*list
;
1318 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1320 symbol_type_set (list
->sym
, current_type
, yylsp
[-1]);
1321 symbol_precedence_set (list
->sym
, current_prec
, yyvsp
[-2].assoc
, yylsp
[-2]);
1323 symbol_list_free (yyvsp
[0].list
);
1324 current_type
= NULL
;
1329 #line 268 "parse-gram.y"
1330 { yyval
.assoc
= left_assoc
; }
1334 #line 269 "parse-gram.y"
1335 { yyval
.assoc
= right_assoc
; }
1339 #line 270 "parse-gram.y"
1340 { yyval
.assoc
= non_assoc
; }
1344 #line 274 "parse-gram.y"
1345 { current_type
= NULL
;}
1349 #line 275 "parse-gram.y"
1350 { current_type
= yyvsp
[0].string
; }
1354 #line 281 "parse-gram.y"
1355 { yyval
.list
= symbol_list_new (yyvsp
[0].symbol
, yylsp
[0]); }
1359 #line 282 "parse-gram.y"
1360 { yyval
.list
= symbol_list_prepend (yyvsp
[-1].list
, yyvsp
[0].symbol
, yylsp
[0]); }
1364 #line 288 "parse-gram.y"
1366 current_type
= yyvsp
[0].string
;
1371 #line 292 "parse-gram.y"
1373 symbol_class_set (yyvsp
[0].symbol
, current_class
, yylsp
[0]);
1374 symbol_type_set (yyvsp
[0].symbol
, current_type
, yylsp
[0]);
1379 #line 297 "parse-gram.y"
1381 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1382 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1383 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
, yylsp
[0]);
1388 #line 303 "parse-gram.y"
1390 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1391 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1392 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
);
1397 #line 309 "parse-gram.y"
1399 symbol_class_set (yyvsp
[-2].symbol
, current_class
, yylsp
[-2]);
1400 symbol_type_set (yyvsp
[-2].symbol
, current_type
, yylsp
[-2]);
1401 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
, yylsp
[-1]);
1402 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
);
1407 #line 320 "parse-gram.y"
1412 #line 322 "parse-gram.y"
1417 #line 344 "parse-gram.y"
1418 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1422 #line 345 "parse-gram.y"
1427 #line 349 "parse-gram.y"
1428 { grammar_rule_end (yylsp
[0]); }
1432 #line 350 "parse-gram.y"
1433 { grammar_rule_end (yylsp
[0]); }
1437 #line 355 "parse-gram.y"
1438 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1442 #line 357 "parse-gram.y"
1443 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1447 #line 359 "parse-gram.y"
1448 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1452 #line 361 "parse-gram.y"
1453 { grammar_current_rule_prec_set (yyvsp
[0].symbol
, yylsp
[0]); }
1457 #line 363 "parse-gram.y"
1458 { grammar_current_rule_dprec_set (yyvsp
[0].integer
, yylsp
[0]); }
1462 #line 365 "parse-gram.y"
1463 { grammar_current_rule_merge_set (yyvsp
[0].string
, yylsp
[0]); }
1467 #line 369 "parse-gram.y"
1468 { yyval
.symbol
= yyvsp
[0].symbol
; }
1472 #line 370 "parse-gram.y"
1473 { yyval
.symbol
= yyvsp
[0].symbol
; }
1477 #line 371 "parse-gram.y"
1478 { yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]); }
1482 #line 376 "parse-gram.y"
1483 { yyval
.string
= yyvsp
[0].string
; }
1487 #line 382 "parse-gram.y"
1489 yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]);
1490 symbol_class_set (yyval
.symbol
, token_sym
, yylsp
[0]);
1495 #line 391 "parse-gram.y"
1497 yyval
.string
= yyvsp
[0].string
+ 1;
1498 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1503 #line 399 "parse-gram.y"
1505 yyval
.string
= xstrdup ("");
1510 #line 403 "parse-gram.y"
1512 yyval
.string
= yyvsp
[0].string
;
1519 /* Line 955 of /home/lrde/prof/akim/src/bison/data/yacc.c. */
1520 #line 1521 "parse-gram.c"
1529 short *yyssp1
= yyss
- 1;
1530 YYFPRINTF (stderr
, "state stack now");
1531 while (yyssp1
!= yyssp
)
1532 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1533 YYFPRINTF (stderr
, "\n");
1540 /* Now `shift' the result of the reduction. Determine what state
1541 that goes to, based on the state we popped back to and the rule
1542 number reduced by. */
1546 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1547 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1548 yystate
= yytable
[yystate
];
1550 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1555 /*------------------------------------.
1556 | yyerrlab -- here on detecting error |
1557 `------------------------------------*/
1559 /* If not already recovering from an error, report this error. */
1565 yyn
= yypact
[yystate
];
1567 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1569 YYSIZE_T yysize
= 0;
1574 /* Start YYX at -YYN if negative to avoid negative indexes in
1576 for (yyx
= yyn
< 0 ? -yyn
: 0;
1577 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1578 if (yycheck
[yyx
+ yyn
] == yyx
)
1579 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1580 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1581 yysize
+= yystrlen (yytname
[YYTRANSLATE (yychar
)]);
1582 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1585 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1586 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1591 for (yyx
= yyn
< 0 ? -yyn
: 0;
1592 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1594 if (yycheck
[yyx
+ yyn
] == yyx
)
1596 const char *yyq
= ! yycount
? ", expecting " : " or ";
1597 yyp
= yystpcpy (yyp
, yyq
);
1598 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1603 YYSTACK_FREE (yymsg
);
1606 yyerror ("parse error; also virtual memory exhausted");
1609 #endif /* YYERROR_VERBOSE */
1610 yyerror ("parse error");
1615 /*----------------------------------------------------.
1616 | yyerrlab1 -- error raised explicitly by an action. |
1617 `----------------------------------------------------*/
1619 if (yyerrstatus
== 3)
1621 /* If just tried and failed to reuse lookahead token after an
1622 error, discard it. */
1624 /* Return failure if at end of input. */
1625 if (yychar
== YYEOF
)
1627 /* Pop the error token. */
1629 /* Pop the rest of the stack. */
1630 while (yyssp
> yyss
)
1632 YYDPRINTF ((stderr
, "Error: popping "));
1633 YYDSYMPRINT ((stderr
,
1636 YYDPRINTF ((stderr
, "\n"));
1637 yydestruct (yystos
[*yyssp
], *yyvsp
, *yylsp
);
1643 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1644 yychar
, yytname
[yychar1
]));
1645 yydestruct (yychar1
, yylval
, yylloc
);
1649 /* Else will try to reuse lookahead token after shifting the error
1652 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1656 yyn
= yypact
[yystate
];
1660 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1668 /* Pop the current state because it cannot handle the error token. */
1672 YYDPRINTF ((stderr
, "Error: popping "));
1673 YYDSYMPRINT ((stderr
,
1674 yystos
[*yyssp
], *yyvsp
, *yylsp
));
1675 YYDPRINTF ((stderr
, "\n"));
1677 yydestruct (yystos
[yystate
], *yyvsp
, *yylsp
);
1685 short *yyssp1
= yyss
- 1;
1686 YYFPRINTF (stderr
, "Error: state stack now");
1687 while (yyssp1
!= yyssp
)
1688 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1689 YYFPRINTF (stderr
, "\n");
1697 YYDPRINTF ((stderr
, "Shifting error token, "));
1706 /*-------------------------------------.
1707 | yyacceptlab -- YYACCEPT comes here. |
1708 `-------------------------------------*/
1713 /*-----------------------------------.
1714 | yyabortlab -- YYABORT comes here. |
1715 `-----------------------------------*/
1721 /*----------------------------------------------.
1722 | yyoverflowlab -- parser overflow comes here. |
1723 `----------------------------------------------*/
1725 yyerror ("parser stack overflow");
1733 YYSTACK_FREE (yyss
);
1739 /*-----------------------------------------------.
1740 | Release the memory associated to this symbol. |
1741 `-----------------------------------------------*/
1744 yydestruct (int yytype
,
1745 YYSTYPE yyvalue
, YYLTYPE yylocation
)
1747 /* Pacify ``unused variable'' warnings. */
1760 /*-----------------------------.
1761 | Print this symbol on YYOUT. |
1762 `-----------------------------*/
1765 yysymprint (FILE* yyout
, int yytype
,
1766 YYSTYPE yyvalue
, YYLTYPE yylocation
)
1768 /* Pacify ``unused variable'' warnings. */
1772 if (yytype
< YYNTOKENS
)
1774 YYFPRINTF (yyout
, "token %s (", yytname
[yytype
]);
1776 YYPRINT (yyout
, yytoknum
[yytype
], yyvalue
);
1780 YYFPRINTF (yyout
, "nterm %s (", yytname
[yytype
]);
1787 YYFPRINTF (yyout
, ")");
1789 #endif /* YYDEBUG. */
1791 #line 412 "parse-gram.y"
1793 /*------------------------------------------------------------------.
1794 | When debugging the parser, display tokens' locations and values. |
1795 `------------------------------------------------------------------*/
1798 yyprint (FILE *file
,
1799 int type
, const yystype
*value
)
1805 fprintf (file
, " = '%s'", value
->string
);
1809 fprintf (file
, " = %s", value
->symbol
->tag
);
1813 fprintf (file
, " = %d", value
->integer
);
1817 fprintf (file
, " = \"%s\"", value
->string
);
1821 fprintf (file
, " = <%s>", value
->string
);
1827 fprintf (file
, " = {{ %s }}", value
->string
);
1833 gram_error (gram_control_t
*control ATTRIBUTE_UNUSED
,
1834 location_t
*yylloc
, const char *msg
)
1836 LOCATION_PRINT (stderr
, *yylloc
);
1837 fprintf (stderr
, ": %s\n", msg
);