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 GRAM_ERROR.
95 FIXME: depends on the undocumented availability of YYLLOC.t */
97 #define yyerror(Msg) \
98 gram_error (&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 assoc_t 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 188 of /tmp/prefix/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 208 of /tmp/prefix/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. */
353 /* YYNTOKENS -- Number of terminals. */
355 /* YYNNTS -- Number of nonterminals. */
357 /* YYNRULES -- Number of rules. */
359 /* YYNRULES -- Number of states. */
360 #define YYNSTATES 108
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, 145, 146, 152, 154,
415 158, 159, 162, 165, 169, 173, 177, 179, 181, 183,
416 185, 187, 189, 190, 193, 194
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, 37, -1, -1, 40, 38, 64, 65,
437 37, -1, 66, -1, 65, 39, 66, -1, -1, 66,
438 67, -1, 66, 68, -1, 66, 17, 67, -1, 66,
439 18, 5, -1, 66, 19, 35, -1, 40, -1, 69,
440 -1, 4, -1, 44, -1, 3, -1, 3, -1, -1,
441 41, 43, -1, -1, 37, -1
444 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
445 static const unsigned short yyrline
[] =
447 0, 159, 159, 172, 174, 177, 179, 180, 181, 182,
448 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
449 193, 194, 195, 198, 200, 201, 205, 212, 211, 222,
450 221, 234, 233, 239, 239, 244, 253, 268, 270, 271,
451 274, 276, 281, 283, 287, 292, 297, 303, 309, 319,
452 322, 331, 333, 339, 341, 346, 353, 352, 357, 359,
453 362, 365, 367, 369, 371, 373, 377, 379, 380, 383,
454 389, 398, 406, 411, 417, 419
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 "$accept", "input", "declarations", "declaration",
474 "grammar_declaration", "@1", "@2", "symbol_declaration", "@3", "@4",
475 "precedence_declaration", "precedence_declarator", "type.opt",
476 "symbols.1", "symbol_def", "symbol_defs.1", "grammar",
477 "rules_or_grammar_declaration", "rules", "@5", "rhses.1", "rhs",
478 "symbol", "action", "string_as_id", "string_content", "epilogue.opt",
483 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
485 static const unsigned 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
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 unsigned char yydefact
[] =
525 3, 0, 0, 1, 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 /* YYDEFGOTO[NTERM-NUM]. */
539 static const signed char 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 #define YYPACT_NINF -61
549 static const signed char yypact
[] =
551 -61, 35, 85, -61, -61, -61, 2, -61, -61, -5,
552 -61, -61, -61, 31, 0, -61, -61, 18, 21, 22,
553 59, -61, -61, -61, -61, -61, -61, -61, 59, -61,
554 37, -61, 26, -61, -61, -61, 29, -19, -19, 0,
555 23, 24, -61, -61, -61, -61, -61, -61, -61, 59,
556 59, 59, -61, 59, -61, 28, 33, 32, 1, -61,
557 -61, -61, -61, -61, 0, -61, 17, -61, -19, -19,
558 0, -61, 0, 0, -61, -61, -61, -61, -61, -61,
559 -61, 30, -61, -61, 0, 63, -61, -61, -61, 0,
560 0, -61, -61, -61, -8, 15, -61, -61, 0, 67,
561 39, -61, -61, -61, 15, -61, -61, -61
564 /* YYPGOTO[NTERM-NUM]. */
565 static const signed char yypgoto
[] =
567 -61, -61, -61, -61, 76, -61, -61, -61, -61, -61,
568 -61, -61, -61, -12, -45, 41, -61, 25, -61, -61,
569 -61, -17, -14, -61, -60, -23, -61, -61
572 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
573 positive, shift that token. If negative, reduce the rule which
574 number is the opposite. If zero, do what YYDEFACT says. */
575 #define YYTABLE_NINF -62
576 static const signed char yytable
[] =
578 47, -72, 55, 44, 45, 54, 86, 4, 5, 6,
579 7, 8, 9, 10, 11, 12, 65, 14, 44, 45,
580 44, 66, 85, 87, 87, 93, 74, 75, 76, 96,
581 77, 97, 98, 99, 100, 3, 43, 39, 55, 42,
582 46, 56, 81, 4, 5, 6, 7, 8, 9, 10,
583 11, 12, 84, 14, 49, 46, 88, 50, 51, 101,
584 89, 90, 52, 61, 63, 78, 44, 72, 73, 80,
585 88, 79, 106, 92, 107, 88, 88, 56, 33, 69,
586 104, 102, 0, 82, 105, 0, 0, 0, 0, 0,
587 102, 4, 5, 6, 7, 8, 9, 10, 11, 12,
588 13, 14, 0, 0, 0, 15, 16, 17, 18, 19,
589 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
590 0, 0, 0, 0, 0, 0, 30, 31
593 static const signed char yycheck
[] =
595 14, 0, 1, 3, 4, 28, 66, 6, 7, 8,
596 9, 10, 11, 12, 13, 14, 35, 16, 3, 4,
597 3, 40, 5, 68, 69, 85, 49, 50, 51, 37,
598 53, 39, 17, 18, 19, 0, 5, 35, 1, 44,
599 40, 40, 41, 6, 7, 8, 9, 10, 11, 12,
600 13, 14, 64, 16, 36, 40, 70, 36, 36, 44,
601 72, 73, 3, 37, 35, 37, 3, 44, 44, 37,
602 84, 38, 5, 43, 35, 89, 90, 40, 2, 38,
603 97, 95, -1, 58, 98, -1, -1, -1, -1, -1,
604 104, 6, 7, 8, 9, 10, 11, 12, 13, 14,
605 15, 16, -1, -1, -1, 20, 21, 22, 23, 24,
606 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
607 -1, -1, -1, -1, -1, -1, 41, 42
610 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
611 symbol of state STATE-NUM. */
612 static const unsigned char yystos
[] =
614 0, 46, 47, 0, 6, 7, 8, 9, 10, 11,
615 12, 13, 14, 15, 16, 20, 21, 22, 23, 24,
616 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
617 41, 42, 48, 49, 52, 55, 56, 54, 53, 35,
618 50, 51, 44, 5, 3, 4, 40, 67, 69, 36,
619 36, 36, 3, 70, 70, 1, 40, 49, 61, 62,
620 63, 37, 72, 35, 57, 35, 40, 59, 60, 60,
621 58, 67, 44, 44, 70, 70, 70, 70, 37, 38,
622 37, 41, 62, 71, 58, 5, 69, 59, 67, 58,
623 58, 64, 43, 69, 65, 66, 37, 39, 17, 18,
624 19, 44, 67, 68, 66, 67, 5, 35
627 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
628 # define YYSIZE_T __SIZE_TYPE__
630 #if ! defined (YYSIZE_T) && defined (size_t)
631 # define YYSIZE_T size_t
633 #if ! defined (YYSIZE_T)
634 # if defined (__STDC__) || defined (__cplusplus)
635 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
636 # define YYSIZE_T size_t
639 #if ! defined (YYSIZE_T)
640 # define YYSIZE_T unsigned int
643 #define yyerrok (yyerrstatus = 0)
644 #define yyclearin (yychar = YYEMPTY)
648 #define YYACCEPT goto yyacceptlab
649 #define YYABORT goto yyabortlab
650 #define YYERROR goto yyerrlab1
652 /* Like YYERROR except do call yyerror. This remains here temporarily
653 to ease the transition to the new meaning of YYERROR, for GCC.
654 Once GCC version 2 has supplanted version 1, this can go. */
656 #define YYFAIL goto yyerrlab
658 #define YYRECOVERING() (!!yyerrstatus)
660 #define YYBACKUP(Token, Value) \
662 if (yychar == YYEMPTY && yylen == 1) \
666 yychar1 = YYTRANSLATE (yychar); \
672 yyerror ("syntax error: cannot back up"); \
678 #define YYERRCODE 256
680 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
683 #ifndef YYLLOC_DEFAULT
684 # define YYLLOC_DEFAULT(Current, Rhs, N) \
685 Current.first_line = Rhs[1].first_line; \
686 Current.first_column = Rhs[1].first_column; \
687 Current.last_line = Rhs[N].last_line; \
688 Current.last_column = Rhs[N].last_column;
691 /* YYLEX -- calling `yylex' with the right arguments. */
694 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
696 # define YYLEX yylex (&yylval, &yylloc)
699 /* Enable debugging if requested. */
703 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
704 # define YYFPRINTF fprintf
707 # define YYDPRINTF(Args) \
712 # define YYDSYMPRINT(Args) \
717 /* Nonzero means print parse trace. It is left uninitialized so that
718 multiple parsers can coexist. */
721 # define YYDPRINTF(Args)
722 # define YYDSYMPRINT(Args)
723 #endif /* !YYDEBUG */
725 /* YYINITDEPTH -- initial size of the parser's stacks. */
727 # define YYINITDEPTH 200
730 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
731 if the built-in stack extension method is used).
733 Do not make this value too large; the results are undefined if
734 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
735 evaluated with infinite-precision integer arithmetic. */
742 # define YYMAXDEPTH 10000
750 # if defined (__GLIBC__) && defined (_STRING_H)
751 # define yystrlen strlen
753 /* Return the length of YYSTR. */
755 # if defined (__STDC__) || defined (__cplusplus)
756 yystrlen (const char *yystr
)
762 register const char *yys
= yystr
;
764 while (*yys
++ != '\0')
767 return yys
- yystr
- 1;
773 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
774 # define yystpcpy stpcpy
776 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
779 # if defined (__STDC__) || defined (__cplusplus)
780 yystpcpy (char *yydest
, const char *yysrc
)
782 yystpcpy (yydest
, yysrc
)
787 register char *yyd
= yydest
;
788 register const char *yys
= yysrc
;
790 while ((*yyd
++ = *yys
++) != '\0')
798 #endif /* !YYERROR_VERBOSE */
803 /*-----------------------------.
804 | Print this symbol on YYOUT. |
805 `-----------------------------*/
808 #if defined (__STDC__) || defined (__cplusplus)
809 yysymprint (FILE* yyout
, int yytype
, YYSTYPE yyvalue
, YYLTYPE yylocation
)
811 yysymprint (yyout
, yytype
, yyvalue
, yylocation
)
818 /* Pacify ``unused variable'' warnings. */
822 if (yytype
< YYNTOKENS
)
824 YYFPRINTF (yyout
, "token %s (", yytname
[yytype
]);
826 YYPRINT (yyout
, yytoknum
[yytype
], yyvalue
);
830 YYFPRINTF (yyout
, "nterm %s (", yytname
[yytype
]);
837 YYFPRINTF (yyout
, ")");
839 #endif /* YYDEBUG. */
842 /*----------------------------------------------------------.
843 | yyreport_parse_error -- report a parse error in YYSTATE. |
844 `----------------------------------------------------------*/
847 #if defined (__STDC__) || defined (__cplusplus)
848 yyreport_parse_error (int yystate
, int yychar
, YYSTYPE yyvalue
, YYLTYPE yylloc
)
850 yyreport_parse_error (yystate
, yychar
, yyvalue
, yylloc
)
858 int yyn
= yypact
[yystate
];
860 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
863 int yytype
= YYTRANSLATE (yychar
);
868 /* Start YYX at -YYN if negative to avoid negative indexes in
870 for (yyx
= yyn
< 0 ? -yyn
: 0;
871 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
872 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
873 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
874 yysize
+= yystrlen ("parse error, unexpected ") + 1;
875 yysize
+= yystrlen (yytname
[yytype
]);
876 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
879 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
880 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
885 for (yyx
= yyn
< 0 ? -yyn
: 0;
886 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
888 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
890 const char *yyq
= ! yycount
? ", expecting " : " or ";
891 yyp
= yystpcpy (yyp
, yyq
);
892 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
897 YYSTACK_FREE (yymsg
);
900 yyerror ("parse error; also virtual memory exhausted");
903 #endif /* YYERROR_VERBOSE */
904 yyerror ("parse error");
906 /* Pacify ``unused variable'' warnings. */
914 /*-----------------------------------------------.
915 | Release the memory associated to this symbol. |
916 `-----------------------------------------------*/
919 #if defined (__STDC__) || defined (__cplusplus)
920 yydestruct (int yytype
, YYSTYPE yyvalue
, YYLTYPE yylocation
)
922 yydestruct (yytype
, yyvalue
, yylocation
)
928 /* Pacify ``unused variable'' warnings. */
941 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
942 into yyparse. The argument should have type void *.
943 It should actually point to an object.
944 Grammar actions can access the variable by casting it
945 to the proper pointer type. */
948 # if defined (__STDC__) || defined (__cplusplus)
949 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
950 # define YYPARSE_PARAM_DECL
952 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
953 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
955 #else /* !YYPARSE_PARAM */
956 # define YYPARSE_PARAM_ARG
957 # define YYPARSE_PARAM_DECL
958 #endif /* !YYPARSE_PARAM */
960 /* Prevent warning if -Wstrict-prototypes. */
962 # ifdef YYPARSE_PARAM
963 int yyparse (void *);
973 yyparse (YYPARSE_PARAM_ARG
)
976 /* The lookahead symbol. */
979 /* The semantic value of the lookahead symbol. */
982 /* Number of parse errors so far. */
984 /* Location data for the lookahead symbol. */
987 register int yystate
;
990 /* Number of tokens to shift before error messages enabled. */
992 /* Lookahead token as an internal (translated) token number. */
995 /* Three stacks and their tools:
996 `yyss': related to states,
997 `yyvs': related to semantic values,
998 `yyls': related to locations.
1000 Refer to the stacks thru separate pointers, to allow yyoverflow
1001 to reallocate them elsewhere. */
1003 /* The state stack. */
1004 short yyssa
[YYINITDEPTH
];
1005 short *yyss
= yyssa
;
1006 register short *yyssp
;
1008 /* The semantic value stack. */
1009 YYSTYPE yyvsa
[YYINITDEPTH
];
1010 YYSTYPE
*yyvs
= yyvsa
;
1011 register YYSTYPE
*yyvsp
;
1013 /* The location stack. */
1014 YYLTYPE yylsa
[YYINITDEPTH
];
1015 YYLTYPE
*yyls
= yylsa
;
1018 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1020 YYSIZE_T yystacksize
= YYINITDEPTH
;
1022 /* The variables used to return semantic value and location from the
1027 /* When reducing, the number of symbols on the RHS of the reduced
1031 YYDPRINTF ((stderr
, "Starting parse\n"));
1036 yychar
= YYEMPTY
; /* Cause a token to be read. */
1038 /* Initialize stack pointers.
1039 Waste one element of value and location stack
1040 so that they stay on the same level as the state stack.
1041 The wasted elements are never initialized. */
1048 /*------------------------------------------------------------.
1049 | yynewstate -- Push a new state, which is found in yystate. |
1050 `------------------------------------------------------------*/
1052 /* In all cases, when you get here, the value and location stacks
1053 have just been pushed. so pushing a state here evens the stacks.
1060 if (yyssp
>= yyss
+ yystacksize
- 1)
1062 /* Get the current used size of the three stacks, in elements. */
1063 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1067 /* Give user a chance to reallocate the stack. Use copies of
1068 these so that the &'s don't force the real ones into
1070 YYSTYPE
*yyvs1
= yyvs
;
1071 short *yyss1
= yyss
;
1072 YYLTYPE
*yyls1
= yyls
;
1074 /* Each stack pointer address is followed by the size of the
1075 data in use in that stack, in bytes. This used to be a
1076 conditional around just the two extra args, but that might
1077 be undefined if yyoverflow is a macro. */
1078 yyoverflow ("parser stack overflow",
1079 &yyss1
, yysize
* sizeof (*yyssp
),
1080 &yyvs1
, yysize
* sizeof (*yyvsp
),
1081 &yyls1
, yysize
* sizeof (*yylsp
),
1087 #else /* no yyoverflow */
1088 # ifndef YYSTACK_RELOCATE
1091 /* Extend the stack our own way. */
1092 if (yystacksize
>= YYMAXDEPTH
)
1095 if (yystacksize
> YYMAXDEPTH
)
1096 yystacksize
= YYMAXDEPTH
;
1099 short *yyss1
= yyss
;
1100 union yyalloc
*yyptr
=
1101 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1104 YYSTACK_RELOCATE (yyss
);
1105 YYSTACK_RELOCATE (yyvs
);
1106 YYSTACK_RELOCATE (yyls
);
1107 # undef YYSTACK_RELOCATE
1109 YYSTACK_FREE (yyss1
);
1112 #endif /* no yyoverflow */
1114 yyssp
= yyss
+ yysize
- 1;
1115 yyvsp
= yyvs
+ yysize
- 1;
1116 yylsp
= yyls
+ yysize
- 1;
1118 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1119 (unsigned long int) yystacksize
));
1121 if (yyssp
>= yyss
+ yystacksize
- 1)
1125 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1134 /* Do appropriate processing given the current state. */
1135 /* Read a lookahead token if we need one and don't already have one. */
1138 /* First try to decide what to do without reference to lookahead token. */
1140 yyn
= yypact
[yystate
];
1141 if (yyn
== YYPACT_NINF
)
1144 /* Not known => get a lookahead token if don't already have one. */
1146 /* yychar is either YYEMPTY or YYEOF
1147 or a valid token in external form. */
1149 if (yychar
== YYEMPTY
)
1151 YYDPRINTF ((stderr
, "Reading a token: "));
1155 /* Convert token to internal form (in yychar1) for indexing tables with. */
1157 if (yychar
<= 0) /* This means end of input. */
1160 yychar
= YYEOF
; /* Don't call YYLEX any more. */
1162 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1166 yychar1
= YYTRANSLATE (yychar
);
1168 /* We have to keep this `#if YYDEBUG', since we use variables
1169 which are defined only if `YYDEBUG' is set. */
1170 YYDPRINTF ((stderr
, "Next token is "));
1171 YYDSYMPRINT ((stderr
, yychar1
, yylval
, yyloc
));
1172 YYDPRINTF ((stderr
, "\n"));
1176 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yychar1
)
1181 /* yyn is what to do for this token type in this state.
1182 Negative => reduce, -yyn is rule number.
1183 Positive => shift, yyn is new state.
1184 New state is final state => don't bother to shift,
1185 just return success.
1186 0, or most negative number => error. */
1190 if (yyn
== YYTABLE_NINF
)
1201 /* Shift the lookahead token. */
1202 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1203 yychar
, yytname
[yychar1
]));
1205 /* Discard the token being shifted unless it is eof. */
1206 if (yychar
!= YYEOF
)
1212 /* Count tokens shifted since error; after three, turn off error
1221 /*-----------------------------------------------------------.
1222 | yydefault -- do the default action for the current state. |
1223 `-----------------------------------------------------------*/
1225 yyn
= yydefact
[yystate
];
1231 /*-----------------------------.
1232 | yyreduce -- Do a reduction. |
1233 `-----------------------------*/
1235 /* yyn is the number of a rule to reduce with. */
1238 /* If YYLEN is nonzero, implement the default value of the action:
1241 Otherwise, the following line sets YYVAL to garbage.
1242 This behavior is undocumented and Bison
1243 users should not rely upon it. Assigning to YYVAL
1244 unconditionally makes the parser a bit smaller, and it avoids a
1245 GCC warning that YYVAL may be used uninitialized. */
1246 yyval
= yyvsp
[1-yylen
];
1248 /* Default location. */
1249 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1252 /* We have to keep this `#if YYDEBUG', since we use variables which
1253 are defined only if `YYDEBUG' is set. */
1258 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1259 yyn
- 1, yyrline
[yyn
]);
1261 /* Print the symbols being reduced, and their result. */
1262 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] >= 0; yyi
++)
1263 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1264 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1270 #line 161 "parse-gram.y"
1272 yycontrol
->errcode
= 0;
1273 epilogue_set (yyvsp
[0].string
, yylsp
[0]);
1278 #line 179 "parse-gram.y"
1279 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1283 #line 180 "parse-gram.y"
1288 #line 181 "parse-gram.y"
1289 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1293 #line 182 "parse-gram.y"
1294 { defines_flag
= 1; }
1298 #line 183 "parse-gram.y"
1299 { error_verbose
= 1; }
1303 #line 184 "parse-gram.y"
1304 { expected_conflicts
= yyvsp
[0].integer
; }
1308 #line 185 "parse-gram.y"
1309 { spec_file_prefix
= yyvsp
[0].string
; }
1313 #line 186 "parse-gram.y"
1314 { locations_flag
= 1; }
1318 #line 187 "parse-gram.y"
1319 { spec_name_prefix
= yyvsp
[0].string
; }
1323 #line 188 "parse-gram.y"
1324 { no_lines_flag
= 1; }
1328 #line 189 "parse-gram.y"
1329 { spec_outfile
= yyvsp
[0].string
; }
1333 #line 190 "parse-gram.y"
1334 { pure_parser
= 1; }
1338 #line 191 "parse-gram.y"
1343 #line 192 "parse-gram.y"
1344 { skeleton
= yyvsp
[0].string
; }
1348 #line 193 "parse-gram.y"
1349 { token_table_flag
= 1; }
1353 #line 194 "parse-gram.y"
1354 { report_flag
= 1; }
1358 #line 195 "parse-gram.y"
1363 #line 202 "parse-gram.y"
1365 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1370 #line 206 "parse-gram.y"
1373 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1374 muscle_insert ("stype", yyvsp
[0].string
);
1379 #line 212 "parse-gram.y"
1380 { current_braced_code
= destructor_braced_code
; }
1384 #line 214 "parse-gram.y"
1386 symbol_list_t
*list
;
1387 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1388 symbol_destructor_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1389 symbol_list_free (yyvsp
[0].list
);
1390 current_braced_code
= action_braced_code
;
1395 #line 222 "parse-gram.y"
1396 { current_braced_code
= printer_braced_code
; }
1400 #line 224 "parse-gram.y"
1402 symbol_list_t
*list
;
1403 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1404 symbol_printer_set (list
->sym
, yyvsp
[-1].string
, list
->location
);
1405 symbol_list_free (yyvsp
[0].list
);
1406 current_braced_code
= action_braced_code
;
1411 #line 234 "parse-gram.y"
1412 { current_class
= nterm_sym
; }
1416 #line 235 "parse-gram.y"
1418 current_class
= unknown_sym
;
1419 current_type
= NULL
;
1424 #line 239 "parse-gram.y"
1425 { current_class
= token_sym
; }
1429 #line 240 "parse-gram.y"
1431 current_class
= unknown_sym
;
1432 current_type
= NULL
;
1437 #line 245 "parse-gram.y"
1439 symbol_list_t
*list
;
1440 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1441 symbol_type_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1442 symbol_list_free (yyvsp
[0].list
);
1447 #line 255 "parse-gram.y"
1449 symbol_list_t
*list
;
1451 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1453 symbol_type_set (list
->sym
, current_type
, yylsp
[-1]);
1454 symbol_precedence_set (list
->sym
, current_prec
, yyvsp
[-2].assoc
, yylsp
[-2]);
1456 symbol_list_free (yyvsp
[0].list
);
1457 current_type
= NULL
;
1462 #line 269 "parse-gram.y"
1463 { yyval
.assoc
= left_assoc
; }
1467 #line 270 "parse-gram.y"
1468 { yyval
.assoc
= right_assoc
; }
1472 #line 271 "parse-gram.y"
1473 { yyval
.assoc
= non_assoc
; }
1477 #line 275 "parse-gram.y"
1478 { current_type
= NULL
;}
1482 #line 276 "parse-gram.y"
1483 { current_type
= yyvsp
[0].string
; }
1487 #line 282 "parse-gram.y"
1488 { yyval
.list
= symbol_list_new (yyvsp
[0].symbol
, yylsp
[0]); }
1492 #line 283 "parse-gram.y"
1493 { yyval
.list
= symbol_list_prepend (yyvsp
[-1].list
, yyvsp
[0].symbol
, yylsp
[0]); }
1497 #line 289 "parse-gram.y"
1499 current_type
= yyvsp
[0].string
;
1504 #line 293 "parse-gram.y"
1506 symbol_class_set (yyvsp
[0].symbol
, current_class
, yylsp
[0]);
1507 symbol_type_set (yyvsp
[0].symbol
, current_type
, yylsp
[0]);
1512 #line 298 "parse-gram.y"
1514 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1515 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1516 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
, yylsp
[0]);
1521 #line 304 "parse-gram.y"
1523 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1524 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1525 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
, yyloc
);
1530 #line 310 "parse-gram.y"
1532 symbol_class_set (yyvsp
[-2].symbol
, current_class
, yylsp
[-2]);
1533 symbol_type_set (yyvsp
[-2].symbol
, current_type
, yylsp
[-2]);
1534 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
, yylsp
[-1]);
1535 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
, yyloc
);
1540 #line 321 "parse-gram.y"
1545 #line 323 "parse-gram.y"
1550 #line 342 "parse-gram.y"
1553 complain_at (yyloc
, _("POSIX forbids declarations in the grammar"));
1558 #line 347 "parse-gram.y"
1565 #line 353 "parse-gram.y"
1566 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1570 #line 354 "parse-gram.y"
1575 #line 358 "parse-gram.y"
1576 { grammar_rule_end (yylsp
[0]); }
1580 #line 359 "parse-gram.y"
1581 { grammar_rule_end (yylsp
[0]); }
1585 #line 364 "parse-gram.y"
1586 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1590 #line 366 "parse-gram.y"
1591 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1595 #line 368 "parse-gram.y"
1596 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1600 #line 370 "parse-gram.y"
1601 { grammar_current_rule_prec_set (yyvsp
[0].symbol
, yylsp
[0]); }
1605 #line 372 "parse-gram.y"
1606 { grammar_current_rule_dprec_set (yyvsp
[0].integer
, yylsp
[0]); }
1610 #line 374 "parse-gram.y"
1611 { grammar_current_rule_merge_set (yyvsp
[0].string
, yylsp
[0]); }
1615 #line 378 "parse-gram.y"
1616 { yyval
.symbol
= yyvsp
[0].symbol
; }
1620 #line 379 "parse-gram.y"
1621 { yyval
.symbol
= yyvsp
[0].symbol
; }
1625 #line 380 "parse-gram.y"
1626 { yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]); }
1630 #line 385 "parse-gram.y"
1631 { yyval
.string
= yyvsp
[0].string
; }
1635 #line 391 "parse-gram.y"
1637 yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]);
1638 symbol_class_set (yyval
.symbol
, token_sym
, yylsp
[0]);
1643 #line 400 "parse-gram.y"
1645 yyval
.string
= yyvsp
[0].string
+ 1;
1646 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1651 #line 408 "parse-gram.y"
1653 yyval
.string
= xstrdup ("");
1658 #line 412 "parse-gram.y"
1660 yyval
.string
= yyvsp
[0].string
;
1667 /* Line 1079 of /tmp/prefix/share/bison/yacc.c. */
1668 #line 1669 "parse-gram.c"
1677 short *yyssp1
= yyss
- 1;
1678 YYFPRINTF (stderr
, "state stack now");
1679 while (yyssp1
!= yyssp
)
1680 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1681 YYFPRINTF (stderr
, "\n");
1688 /* Now `shift' the result of the reduction. Determine what state
1689 that goes to, based on the state we popped back to and the rule
1690 number reduced by. */
1694 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1695 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1696 yystate
= yytable
[yystate
];
1698 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1703 /*------------------------------------.
1704 | yyerrlab -- here on detecting error |
1705 `------------------------------------*/
1707 /* If not already recovering from an error, report this error. */
1711 yyreport_parse_error (yystate
, yychar
, yylval
, yylloc
);
1716 /*----------------------------------------------------.
1717 | yyerrlab1 -- error raised explicitly by an action. |
1718 `----------------------------------------------------*/
1720 if (yyerrstatus
== 3)
1722 /* If just tried and failed to reuse lookahead token after an
1723 error, discard it. */
1725 /* Return failure if at end of input. */
1726 if (yychar
== YYEOF
)
1728 /* Pop the error token. */
1730 /* Pop the rest of the stack. */
1731 while (yyssp
> yyss
)
1733 YYDPRINTF ((stderr
, "Error: popping "));
1734 YYDSYMPRINT ((stderr
,
1737 YYDPRINTF ((stderr
, "\n"));
1738 yydestruct (yystos
[*yyssp
], *yyvsp
, *yylsp
);
1744 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1745 yychar
, yytname
[yychar1
]));
1746 yydestruct (yychar1
, yylval
, yylloc
);
1750 /* Else will try to reuse lookahead token after shifting the error
1753 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1757 yyn
= yypact
[yystate
];
1758 if (yyn
!= YYPACT_NINF
)
1761 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1769 /* Pop the current state because it cannot handle the error token. */
1773 YYDPRINTF ((stderr
, "Error: popping "));
1774 YYDSYMPRINT ((stderr
,
1775 yystos
[*yyssp
], *yyvsp
, *yylsp
));
1776 YYDPRINTF ((stderr
, "\n"));
1778 yydestruct (yystos
[yystate
], *yyvsp
, *yylsp
);
1786 short *yyssp1
= yyss
- 1;
1787 YYFPRINTF (stderr
, "Error: state stack now");
1788 while (yyssp1
!= yyssp
)
1789 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1790 YYFPRINTF (stderr
, "\n");
1798 YYDPRINTF ((stderr
, "Shifting error token, "));
1807 /*-------------------------------------.
1808 | yyacceptlab -- YYACCEPT comes here. |
1809 `-------------------------------------*/
1814 /*-----------------------------------.
1815 | yyabortlab -- YYABORT comes here. |
1816 `-----------------------------------*/
1822 /*----------------------------------------------.
1823 | yyoverflowlab -- parser overflow comes here. |
1824 `----------------------------------------------*/
1826 yyerror ("parser stack overflow");
1834 YYSTACK_FREE (yyss
);
1840 #line 421 "parse-gram.y"
1842 /*------------------------------------------------------------------.
1843 | When debugging the parser, display tokens' locations and values. |
1844 `------------------------------------------------------------------*/
1847 yyprint (FILE *file
,
1848 int type
, const yystype
*value
)
1854 fprintf (file
, " = '%s'", value
->string
);
1858 fprintf (file
, " = %s", value
->symbol
->tag
);
1862 fprintf (file
, " = %d", value
->integer
);
1866 fprintf (file
, " = \"%s\"", value
->string
);
1870 fprintf (file
, " = <%s>", value
->string
);
1876 fprintf (file
, " = {{ %s }}", value
->string
);
1882 gram_error (location_t
*yylloc
, const char *msg
)
1884 complain_at (*yylloc
, "%s", msg
);