1 /* A Bison parser, made from parse-gram.y, by GNU bison 1.49c. */
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 /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 208 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. */
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, 162, 162, 175, 177, 180, 182, 183, 184, 185,
448 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
449 196, 197, 198, 201, 203, 204, 208, 215, 214, 225,
450 224, 237, 236, 242, 242, 247, 256, 271, 273, 274,
451 277, 279, 284, 286, 290, 295, 300, 306, 312, 322,
452 325, 334, 336, 342, 344, 349, 356, 355, 360, 362,
453 365, 368, 370, 372, 374, 376, 380, 382, 383, 386,
454 392, 401, 409, 414, 420, 422
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 file\"", "error", "$undefined", "\"string\"", "\"character\"",
464 "\"integer\"", "\"%token\"", "\"%nterm\"", "\"%type\"",
465 "\"%destructor\"", "\"%printer\"", "\"%union\"", "\"%left\"",
466 "\"%right\"", "\"%nonassoc\"", "\"%expect\"", "\"%start\"", "\"%prec\"",
467 "\"%dprec\"", "\"%merge\"", "\"%verbose\"", "\"%error-verbose\"",
468 "\"%output\"", "\"%file-prefix\"", "\"%name-prefix\"", "\"%define\"",
469 "\"%pure-parser\"", "\"%glr-parser\"", "\"%defines\"", "\"%yacc\"",
470 "\"%debug\"", "\"%locations\"", "\"%no-lines\"", "\"%skeleton\"",
471 "\"%token-table\"", "\"type\"", "\"=\"", "\";\"", "\":\"", "\"|\"",
472 "\"identifier\"", "\"%%\"", "\"%{...%}\"", "\"epilogue\"", "\"{...}\"",
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",
484 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
486 static const unsigned short yytoknum
[] =
488 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
489 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
490 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
491 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
492 295, 296, 297, 298, 299
496 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
497 static const unsigned char yyr1
[] =
499 0, 45, 46, 47, 47, 48, 48, 48, 48, 48,
500 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
501 48, 48, 48, 49, 49, 49, 49, 50, 49, 51,
502 49, 53, 52, 54, 52, 52, 55, 56, 56, 56,
503 57, 57, 58, 58, 59, 59, 59, 59, 59, 60,
504 60, 61, 61, 62, 62, 62, 64, 63, 65, 65,
505 66, 66, 66, 66, 66, 66, 67, 67, 67, 68,
506 69, 70, 71, 71, 72, 72
509 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
510 static const unsigned char yyr2
[] =
512 0, 2, 4, 0, 3, 1, 1, 1, 3, 1,
513 1, 2, 3, 1, 3, 1, 3, 1, 1, 2,
514 1, 1, 1, 1, 1, 2, 2, 0, 4, 0,
515 4, 0, 3, 0, 3, 3, 3, 1, 1, 1,
516 0, 1, 1, 2, 1, 1, 2, 2, 3, 1,
517 2, 1, 2, 1, 2, 2, 0, 5, 1, 3,
518 0, 2, 2, 3, 3, 3, 1, 1, 1, 1,
522 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
523 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
524 means the default is an error. */
525 static const unsigned char yydefact
[] =
527 3, 0, 0, 1, 33, 31, 0, 27, 29, 0,
528 37, 38, 39, 0, 0, 21, 10, 0, 0, 0,
529 0, 17, 18, 9, 22, 7, 13, 15, 0, 20,
530 0, 6, 74, 5, 24, 23, 40, 0, 0, 0,
531 0, 0, 26, 11, 70, 68, 66, 25, 67, 0,
532 0, 0, 71, 0, 19, 0, 0, 0, 0, 51,
533 53, 75, 4, 41, 0, 44, 45, 49, 34, 32,
534 35, 42, 0, 0, 16, 12, 14, 8, 55, 56,
535 54, 0, 52, 2, 36, 46, 47, 50, 43, 28,
536 30, 60, 73, 48, 0, 58, 57, 60, 0, 0,
537 0, 69, 61, 62, 59, 63, 64, 65
540 /* YYDEFGOTO[NTERM-NUM]. */
541 static const signed char yydefgoto
[] =
543 -1, 1, 2, 32, 57, 40, 41, 34, 38, 37,
544 35, 36, 64, 70, 67, 68, 58, 59, 60, 91,
545 94, 95, 71, 103, 48, 53, 83, 62
548 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
550 #define YYPACT_NINF -61
551 static const signed char yypact
[] =
553 -61, 35, 85, -61, -61, -61, 2, -61, -61, -5,
554 -61, -61, -61, 31, 0, -61, -61, 18, 21, 22,
555 59, -61, -61, -61, -61, -61, -61, -61, 59, -61,
556 37, -61, 26, -61, -61, -61, 29, -19, -19, 0,
557 23, 24, -61, -61, -61, -61, -61, -61, -61, 59,
558 59, 59, -61, 59, -61, 28, 33, 32, 1, -61,
559 -61, -61, -61, -61, 0, -61, 17, -61, -19, -19,
560 0, -61, 0, 0, -61, -61, -61, -61, -61, -61,
561 -61, 30, -61, -61, 0, 63, -61, -61, -61, 0,
562 0, -61, -61, -61, -8, 15, -61, -61, 0, 67,
563 39, -61, -61, -61, 15, -61, -61, -61
566 /* YYPGOTO[NTERM-NUM]. */
567 static const signed char yypgoto
[] =
569 -61, -61, -61, -61, 76, -61, -61, -61, -61, -61,
570 -61, -61, -61, -12, -45, 41, -61, 25, -61, -61,
571 -61, -17, -14, -61, -60, -23, -61, -61
574 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
575 positive, shift that token. If negative, reduce the rule which
576 number is the opposite. If zero, do what YYDEFACT says. */
577 #define YYTABLE_NINF -62
578 static const signed char yytable
[] =
580 47, -72, 55, 44, 45, 54, 86, 4, 5, 6,
581 7, 8, 9, 10, 11, 12, 65, 14, 44, 45,
582 44, 66, 85, 87, 87, 93, 74, 75, 76, 96,
583 77, 97, 98, 99, 100, 3, 43, 39, 55, 42,
584 46, 56, 81, 4, 5, 6, 7, 8, 9, 10,
585 11, 12, 84, 14, 49, 46, 88, 50, 51, 101,
586 89, 90, 52, 61, 63, 78, 44, 72, 73, 80,
587 88, 79, 106, 92, 107, 88, 88, 56, 33, 69,
588 104, 102, 0, 82, 105, 0, 0, 0, 0, 0,
589 102, 4, 5, 6, 7, 8, 9, 10, 11, 12,
590 13, 14, 0, 0, 0, 15, 16, 17, 18, 19,
591 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
592 0, 0, 0, 0, 0, 0, 30, 31
595 static const signed char yycheck
[] =
597 14, 0, 1, 3, 4, 28, 66, 6, 7, 8,
598 9, 10, 11, 12, 13, 14, 35, 16, 3, 4,
599 3, 40, 5, 68, 69, 85, 49, 50, 51, 37,
600 53, 39, 17, 18, 19, 0, 5, 35, 1, 44,
601 40, 40, 41, 6, 7, 8, 9, 10, 11, 12,
602 13, 14, 64, 16, 36, 40, 70, 36, 36, 44,
603 72, 73, 3, 37, 35, 37, 3, 44, 44, 37,
604 84, 38, 5, 43, 35, 89, 90, 40, 2, 38,
605 97, 95, -1, 58, 98, -1, -1, -1, -1, -1,
606 104, 6, 7, 8, 9, 10, 11, 12, 13, 14,
607 15, 16, -1, -1, -1, 20, 21, 22, 23, 24,
608 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
609 -1, -1, -1, -1, -1, -1, 41, 42
612 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
613 symbol of state STATE-NUM. */
614 static const unsigned char yystos
[] =
616 0, 46, 47, 0, 6, 7, 8, 9, 10, 11,
617 12, 13, 14, 15, 16, 20, 21, 22, 23, 24,
618 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
619 41, 42, 48, 49, 52, 55, 56, 54, 53, 35,
620 50, 51, 44, 5, 3, 4, 40, 67, 69, 36,
621 36, 36, 3, 70, 70, 1, 40, 49, 61, 62,
622 63, 37, 72, 35, 57, 35, 40, 59, 60, 60,
623 58, 67, 44, 44, 70, 70, 70, 70, 37, 38,
624 37, 41, 62, 71, 58, 5, 69, 59, 67, 58,
625 58, 64, 43, 69, 65, 66, 37, 39, 17, 18,
626 19, 44, 67, 68, 66, 67, 5, 35
629 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
630 # define YYSIZE_T __SIZE_TYPE__
632 #if ! defined (YYSIZE_T) && defined (size_t)
633 # define YYSIZE_T size_t
635 #if ! defined (YYSIZE_T)
636 # if defined (__STDC__) || defined (__cplusplus)
637 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
638 # define YYSIZE_T size_t
641 #if ! defined (YYSIZE_T)
642 # define YYSIZE_T unsigned int
645 #define yyerrok (yyerrstatus = 0)
646 #define yyclearin (yychar = YYEMPTY)
650 #define YYACCEPT goto yyacceptlab
651 #define YYABORT goto yyabortlab
652 #define YYERROR goto yyerrlab1
654 /* Like YYERROR except do call yyerror. This remains here temporarily
655 to ease the transition to the new meaning of YYERROR, for GCC.
656 Once GCC version 2 has supplanted version 1, this can go. */
658 #define YYFAIL goto yyerrlab
660 #define YYRECOVERING() (!!yyerrstatus)
662 #define YYBACKUP(Token, Value) \
664 if (yychar == YYEMPTY && yylen == 1) \
668 yychar1 = YYTRANSLATE (yychar); \
674 yyerror ("syntax error: cannot back up"); \
680 #define YYERRCODE 256
682 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
685 #ifndef YYLLOC_DEFAULT
686 # define YYLLOC_DEFAULT(Current, Rhs, N) \
687 Current.first_line = Rhs[1].first_line; \
688 Current.first_column = Rhs[1].first_column; \
689 Current.last_line = Rhs[N].last_line; \
690 Current.last_column = Rhs[N].last_column;
693 /* YYLEX -- calling `yylex' with the right arguments. */
696 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
698 # define YYLEX yylex (&yylval, &yylloc)
701 /* Enable debugging if requested. */
705 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
706 # define YYFPRINTF fprintf
709 # define YYDPRINTF(Args) \
714 # define YYDSYMPRINT(Args) \
719 /* Nonzero means print parse trace. It is left uninitialized so that
720 multiple parsers can coexist. */
723 # define YYDPRINTF(Args)
724 # define YYDSYMPRINT(Args)
725 #endif /* !YYDEBUG */
727 /* YYINITDEPTH -- initial size of the parser's stacks. */
729 # define YYINITDEPTH 200
732 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
733 if the built-in stack extension method is used).
735 Do not make this value too large; the results are undefined if
736 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
737 evaluated with infinite-precision integer arithmetic. */
744 # define YYMAXDEPTH 10000
752 # if defined (__GLIBC__) && defined (_STRING_H)
753 # define yystrlen strlen
755 /* Return the length of YYSTR. */
757 # if defined (__STDC__) || defined (__cplusplus)
758 yystrlen (const char *yystr
)
764 register const char *yys
= yystr
;
766 while (*yys
++ != '\0')
769 return yys
- yystr
- 1;
775 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
776 # define yystpcpy stpcpy
778 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
781 # if defined (__STDC__) || defined (__cplusplus)
782 yystpcpy (char *yydest
, const char *yysrc
)
784 yystpcpy (yydest
, yysrc
)
789 register char *yyd
= yydest
;
790 register const char *yys
= yysrc
;
792 while ((*yyd
++ = *yys
++) != '\0')
800 #endif /* !YYERROR_VERBOSE */
805 /*-----------------------------.
806 | Print this symbol on YYOUT. |
807 `-----------------------------*/
810 #if defined (__STDC__) || defined (__cplusplus)
811 yysymprint (FILE* yyout
, int yytype
, YYSTYPE yyvalue
, YYLTYPE yylocation
)
813 yysymprint (yyout
, yytype
, yyvalue
, yylocation
)
820 /* Pacify ``unused variable'' warnings. */
824 if (yytype
< YYNTOKENS
)
826 YYFPRINTF (yyout
, "token %s (", yytname
[yytype
]);
828 YYPRINT (yyout
, yytoknum
[yytype
], yyvalue
);
832 YYFPRINTF (yyout
, "nterm %s (", yytname
[yytype
]);
839 YYFPRINTF (yyout
, ")");
841 #endif /* YYDEBUG. */
844 /*----------------------------------------------------------.
845 | yyreport_parse_error -- report a parse error in YYSTATE. |
846 `----------------------------------------------------------*/
849 #if defined (__STDC__) || defined (__cplusplus)
850 yyreport_parse_error (int yystate
, int yychar
, YYSTYPE yyvalue
, YYLTYPE yylloc
)
852 yyreport_parse_error (yystate
, yychar
, yyvalue
, yylloc
)
860 int yyn
= yypact
[yystate
];
862 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
865 int yytype
= YYTRANSLATE (yychar
);
870 /* Start YYX at -YYN if negative to avoid negative indexes in
872 for (yyx
= yyn
< 0 ? -yyn
: 0;
873 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
874 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
875 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
876 yysize
+= yystrlen ("parse error, unexpected ") + 1;
877 yysize
+= yystrlen (yytname
[yytype
]);
878 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
881 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
882 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
887 for (yyx
= yyn
< 0 ? -yyn
: 0;
888 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
890 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
892 const char *yyq
= ! yycount
? ", expecting " : " or ";
893 yyp
= yystpcpy (yyp
, yyq
);
894 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
899 YYSTACK_FREE (yymsg
);
902 yyerror ("parse error; also virtual memory exhausted");
905 #endif /* YYERROR_VERBOSE */
906 yyerror ("parse error");
908 /* Pacify ``unused variable'' warnings. */
916 /*-----------------------------------------------.
917 | Release the memory associated to this symbol. |
918 `-----------------------------------------------*/
921 #if defined (__STDC__) || defined (__cplusplus)
922 yydestruct (int yytype
, YYSTYPE yyvalue
, YYLTYPE yylocation
)
924 yydestruct (yytype
, yyvalue
, yylocation
)
930 /* Pacify ``unused variable'' warnings. */
943 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
944 into yyparse. The argument should have type void *.
945 It should actually point to an object.
946 Grammar actions can access the variable by casting it
947 to the proper pointer type. */
950 # if defined (__STDC__) || defined (__cplusplus)
951 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
952 # define YYPARSE_PARAM_DECL
954 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
955 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
957 #else /* !YYPARSE_PARAM */
958 # define YYPARSE_PARAM_ARG
959 # define YYPARSE_PARAM_DECL
960 #endif /* !YYPARSE_PARAM */
962 /* Prevent warning if -Wstrict-prototypes. */
964 # ifdef YYPARSE_PARAM
965 int yyparse (void *);
975 yyparse (YYPARSE_PARAM_ARG
)
978 /* The lookahead symbol. */
981 /* The semantic value of the lookahead symbol. */
984 /* Number of parse errors so far. */
986 /* Location data for the lookahead symbol. */
989 register int yystate
;
992 /* Number of tokens to shift before error messages enabled. */
994 /* Lookahead token as an internal (translated) token number. */
997 /* Three stacks and their tools:
998 `yyss': related to states,
999 `yyvs': related to semantic values,
1000 `yyls': related to locations.
1002 Refer to the stacks thru separate pointers, to allow yyoverflow
1003 to reallocate them elsewhere. */
1005 /* The state stack. */
1006 short yyssa
[YYINITDEPTH
];
1007 short *yyss
= yyssa
;
1008 register short *yyssp
;
1010 /* The semantic value stack. */
1011 YYSTYPE yyvsa
[YYINITDEPTH
];
1012 YYSTYPE
*yyvs
= yyvsa
;
1013 register YYSTYPE
*yyvsp
;
1015 /* The location stack. */
1016 YYLTYPE yylsa
[YYINITDEPTH
];
1017 YYLTYPE
*yyls
= yylsa
;
1020 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1022 YYSIZE_T yystacksize
= YYINITDEPTH
;
1024 /* The variables used to return semantic value and location from the
1029 /* When reducing, the number of symbols on the RHS of the reduced
1033 YYDPRINTF ((stderr
, "Starting parse\n"));
1038 yychar
= YYEMPTY
; /* Cause a token to be read. */
1040 /* Initialize stack pointers.
1041 Waste one element of value and location stack
1042 so that they stay on the same level as the state stack.
1043 The wasted elements are never initialized. */
1050 /*------------------------------------------------------------.
1051 | yynewstate -- Push a new state, which is found in yystate. |
1052 `------------------------------------------------------------*/
1054 /* In all cases, when you get here, the value and location stacks
1055 have just been pushed. so pushing a state here evens the stacks.
1062 if (yyssp
>= yyss
+ yystacksize
- 1)
1064 /* Get the current used size of the three stacks, in elements. */
1065 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1069 /* Give user a chance to reallocate the stack. Use copies of
1070 these so that the &'s don't force the real ones into
1072 YYSTYPE
*yyvs1
= yyvs
;
1073 short *yyss1
= yyss
;
1074 YYLTYPE
*yyls1
= yyls
;
1076 /* Each stack pointer address is followed by the size of the
1077 data in use in that stack, in bytes. This used to be a
1078 conditional around just the two extra args, but that might
1079 be undefined if yyoverflow is a macro. */
1080 yyoverflow ("parser stack overflow",
1081 &yyss1
, yysize
* sizeof (*yyssp
),
1082 &yyvs1
, yysize
* sizeof (*yyvsp
),
1083 &yyls1
, yysize
* sizeof (*yylsp
),
1089 #else /* no yyoverflow */
1090 # ifndef YYSTACK_RELOCATE
1093 /* Extend the stack our own way. */
1094 if (yystacksize
>= YYMAXDEPTH
)
1097 if (yystacksize
> YYMAXDEPTH
)
1098 yystacksize
= YYMAXDEPTH
;
1101 short *yyss1
= yyss
;
1102 union yyalloc
*yyptr
=
1103 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1106 YYSTACK_RELOCATE (yyss
);
1107 YYSTACK_RELOCATE (yyvs
);
1108 YYSTACK_RELOCATE (yyls
);
1109 # undef YYSTACK_RELOCATE
1111 YYSTACK_FREE (yyss1
);
1114 #endif /* no yyoverflow */
1116 yyssp
= yyss
+ yysize
- 1;
1117 yyvsp
= yyvs
+ yysize
- 1;
1118 yylsp
= yyls
+ yysize
- 1;
1120 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1121 (unsigned long int) yystacksize
));
1123 if (yyssp
>= yyss
+ yystacksize
- 1)
1127 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1136 /* Do appropriate processing given the current state. */
1137 /* Read a lookahead token if we need one and don't already have one. */
1140 /* First try to decide what to do without reference to lookahead token. */
1142 yyn
= yypact
[yystate
];
1143 if (yyn
== YYPACT_NINF
)
1146 /* Not known => get a lookahead token if don't already have one. */
1148 /* yychar is either YYEMPTY or YYEOF
1149 or a valid token in external form. */
1151 if (yychar
== YYEMPTY
)
1153 YYDPRINTF ((stderr
, "Reading a token: "));
1157 /* Convert token to internal form (in yychar1) for indexing tables with. */
1159 if (yychar
<= 0) /* This means end of input. */
1162 yychar
= YYEOF
; /* Don't call YYLEX any more. */
1164 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1168 yychar1
= YYTRANSLATE (yychar
);
1170 /* We have to keep this `#if YYDEBUG', since we use variables
1171 which are defined only if `YYDEBUG' is set. */
1172 YYDPRINTF ((stderr
, "Next token is "));
1173 YYDSYMPRINT ((stderr
, yychar1
, yylval
, yyloc
));
1174 YYDPRINTF ((stderr
, "\n"));
1178 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yychar1
)
1183 /* yyn is what to do for this token type in this state.
1184 Negative => reduce, -yyn is rule number.
1185 Positive => shift, yyn is new state.
1186 New state is final state => don't bother to shift,
1187 just return success.
1188 0, or most negative number => error. */
1192 if (yyn
== YYTABLE_NINF
)
1203 /* Shift the lookahead token. */
1204 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1205 yychar
, yytname
[yychar1
]));
1207 /* Discard the token being shifted unless it is eof. */
1208 if (yychar
!= YYEOF
)
1214 /* Count tokens shifted since error; after three, turn off error
1223 /*-----------------------------------------------------------.
1224 | yydefault -- do the default action for the current state. |
1225 `-----------------------------------------------------------*/
1227 yyn
= yydefact
[yystate
];
1233 /*-----------------------------.
1234 | yyreduce -- Do a reduction. |
1235 `-----------------------------*/
1237 /* yyn is the number of a rule to reduce with. */
1240 /* If YYLEN is nonzero, implement the default value of the action:
1243 Otherwise, the following line sets YYVAL to garbage.
1244 This behavior is undocumented and Bison
1245 users should not rely upon it. Assigning to YYVAL
1246 unconditionally makes the parser a bit smaller, and it avoids a
1247 GCC warning that YYVAL may be used uninitialized. */
1248 yyval
= yyvsp
[1-yylen
];
1250 /* Default location. */
1251 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1254 /* We have to keep this `#if YYDEBUG', since we use variables which
1255 are defined only if `YYDEBUG' is set. */
1260 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1261 yyn
- 1, yyrline
[yyn
]);
1263 /* Print the symbols being reduced, and their result. */
1264 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] >= 0; yyi
++)
1265 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1266 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1272 #line 164 "parse-gram.y"
1274 yycontrol
->errcode
= 0;
1275 epilogue_set (yyvsp
[0].string
, yylsp
[0]);
1280 #line 182 "parse-gram.y"
1281 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1285 #line 183 "parse-gram.y"
1290 #line 184 "parse-gram.y"
1291 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1295 #line 185 "parse-gram.y"
1296 { defines_flag
= 1; }
1300 #line 186 "parse-gram.y"
1301 { error_verbose
= 1; }
1305 #line 187 "parse-gram.y"
1306 { expected_conflicts
= yyvsp
[0].integer
; }
1310 #line 188 "parse-gram.y"
1311 { spec_file_prefix
= yyvsp
[0].string
; }
1315 #line 189 "parse-gram.y"
1316 { locations_flag
= 1; }
1320 #line 190 "parse-gram.y"
1321 { spec_name_prefix
= yyvsp
[0].string
; }
1325 #line 191 "parse-gram.y"
1326 { no_lines_flag
= 1; }
1330 #line 192 "parse-gram.y"
1331 { spec_outfile
= yyvsp
[0].string
; }
1335 #line 193 "parse-gram.y"
1336 { pure_parser
= 1; }
1340 #line 194 "parse-gram.y"
1345 #line 195 "parse-gram.y"
1346 { skeleton
= yyvsp
[0].string
; }
1350 #line 196 "parse-gram.y"
1351 { token_table_flag
= 1; }
1355 #line 197 "parse-gram.y"
1356 { report_flag
= 1; }
1360 #line 198 "parse-gram.y"
1365 #line 205 "parse-gram.y"
1367 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1372 #line 209 "parse-gram.y"
1375 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1376 muscle_insert ("stype", yyvsp
[0].string
);
1381 #line 215 "parse-gram.y"
1382 { current_braced_code
= destructor_braced_code
; }
1386 #line 217 "parse-gram.y"
1388 symbol_list_t
*list
;
1389 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1390 symbol_destructor_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1391 symbol_list_free (yyvsp
[0].list
);
1392 current_braced_code
= action_braced_code
;
1397 #line 225 "parse-gram.y"
1398 { current_braced_code
= printer_braced_code
; }
1402 #line 227 "parse-gram.y"
1404 symbol_list_t
*list
;
1405 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1406 symbol_printer_set (list
->sym
, yyvsp
[-1].string
, list
->location
);
1407 symbol_list_free (yyvsp
[0].list
);
1408 current_braced_code
= action_braced_code
;
1413 #line 237 "parse-gram.y"
1414 { current_class
= nterm_sym
; }
1418 #line 238 "parse-gram.y"
1420 current_class
= unknown_sym
;
1421 current_type
= NULL
;
1426 #line 242 "parse-gram.y"
1427 { current_class
= token_sym
; }
1431 #line 243 "parse-gram.y"
1433 current_class
= unknown_sym
;
1434 current_type
= NULL
;
1439 #line 248 "parse-gram.y"
1441 symbol_list_t
*list
;
1442 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1443 symbol_type_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1444 symbol_list_free (yyvsp
[0].list
);
1449 #line 258 "parse-gram.y"
1451 symbol_list_t
*list
;
1453 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1455 symbol_type_set (list
->sym
, current_type
, yylsp
[-1]);
1456 symbol_precedence_set (list
->sym
, current_prec
, yyvsp
[-2].assoc
, yylsp
[-2]);
1458 symbol_list_free (yyvsp
[0].list
);
1459 current_type
= NULL
;
1464 #line 272 "parse-gram.y"
1465 { yyval
.assoc
= left_assoc
; }
1469 #line 273 "parse-gram.y"
1470 { yyval
.assoc
= right_assoc
; }
1474 #line 274 "parse-gram.y"
1475 { yyval
.assoc
= non_assoc
; }
1479 #line 278 "parse-gram.y"
1480 { current_type
= NULL
;}
1484 #line 279 "parse-gram.y"
1485 { current_type
= yyvsp
[0].string
; }
1489 #line 285 "parse-gram.y"
1490 { yyval
.list
= symbol_list_new (yyvsp
[0].symbol
, yylsp
[0]); }
1494 #line 286 "parse-gram.y"
1495 { yyval
.list
= symbol_list_prepend (yyvsp
[-1].list
, yyvsp
[0].symbol
, yylsp
[0]); }
1499 #line 292 "parse-gram.y"
1501 current_type
= yyvsp
[0].string
;
1506 #line 296 "parse-gram.y"
1508 symbol_class_set (yyvsp
[0].symbol
, current_class
, yylsp
[0]);
1509 symbol_type_set (yyvsp
[0].symbol
, current_type
, yylsp
[0]);
1514 #line 301 "parse-gram.y"
1516 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1517 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1518 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
, yylsp
[0]);
1523 #line 307 "parse-gram.y"
1525 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1526 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1527 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
, yyloc
);
1532 #line 313 "parse-gram.y"
1534 symbol_class_set (yyvsp
[-2].symbol
, current_class
, yylsp
[-2]);
1535 symbol_type_set (yyvsp
[-2].symbol
, current_type
, yylsp
[-2]);
1536 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
, yylsp
[-1]);
1537 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
, yyloc
);
1542 #line 324 "parse-gram.y"
1547 #line 326 "parse-gram.y"
1552 #line 345 "parse-gram.y"
1555 complain_at (yyloc
, _("POSIX forbids declarations in the grammar"));
1560 #line 350 "parse-gram.y"
1567 #line 356 "parse-gram.y"
1568 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1572 #line 357 "parse-gram.y"
1577 #line 361 "parse-gram.y"
1578 { grammar_rule_end (yylsp
[0]); }
1582 #line 362 "parse-gram.y"
1583 { grammar_rule_end (yylsp
[0]); }
1587 #line 367 "parse-gram.y"
1588 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1592 #line 369 "parse-gram.y"
1593 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1597 #line 371 "parse-gram.y"
1598 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1602 #line 373 "parse-gram.y"
1603 { grammar_current_rule_prec_set (yyvsp
[0].symbol
, yylsp
[0]); }
1607 #line 375 "parse-gram.y"
1608 { grammar_current_rule_dprec_set (yyvsp
[0].integer
, yylsp
[0]); }
1612 #line 377 "parse-gram.y"
1613 { grammar_current_rule_merge_set (yyvsp
[0].string
, yylsp
[0]); }
1617 #line 381 "parse-gram.y"
1618 { yyval
.symbol
= yyvsp
[0].symbol
; }
1622 #line 382 "parse-gram.y"
1623 { yyval
.symbol
= yyvsp
[0].symbol
; }
1627 #line 383 "parse-gram.y"
1628 { yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]); }
1632 #line 388 "parse-gram.y"
1633 { yyval
.string
= yyvsp
[0].string
; }
1637 #line 394 "parse-gram.y"
1639 yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]);
1640 symbol_class_set (yyval
.symbol
, token_sym
, yylsp
[0]);
1645 #line 403 "parse-gram.y"
1647 yyval
.string
= yyvsp
[0].string
+ 1;
1648 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1653 #line 411 "parse-gram.y"
1655 yyval
.string
= xstrdup ("");
1660 #line 415 "parse-gram.y"
1662 yyval
.string
= yyvsp
[0].string
;
1669 /* Line 1081 of /usr/local/share/bison/yacc.c. */
1670 #line 1671 "parse-gram.c"
1679 short *yyssp1
= yyss
- 1;
1680 YYFPRINTF (stderr
, "state stack now");
1681 while (yyssp1
!= yyssp
)
1682 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1683 YYFPRINTF (stderr
, "\n");
1690 /* Now `shift' the result of the reduction. Determine what state
1691 that goes to, based on the state we popped back to and the rule
1692 number reduced by. */
1696 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1697 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1698 yystate
= yytable
[yystate
];
1700 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1705 /*------------------------------------.
1706 | yyerrlab -- here on detecting error |
1707 `------------------------------------*/
1709 /* If not already recovering from an error, report this error. */
1713 yyreport_parse_error (yystate
, yychar
, yylval
, yylloc
);
1718 /*----------------------------------------------------.
1719 | yyerrlab1 -- error raised explicitly by an action. |
1720 `----------------------------------------------------*/
1722 if (yyerrstatus
== 3)
1724 /* If just tried and failed to reuse lookahead token after an
1725 error, discard it. */
1727 /* Return failure if at end of input. */
1728 if (yychar
== YYEOF
)
1730 /* Pop the error token. */
1732 /* Pop the rest of the stack. */
1733 while (yyssp
> yyss
)
1735 YYDPRINTF ((stderr
, "Error: popping "));
1736 YYDSYMPRINT ((stderr
,
1739 YYDPRINTF ((stderr
, "\n"));
1740 yydestruct (yystos
[*yyssp
], *yyvsp
, *yylsp
);
1746 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1747 yychar
, yytname
[yychar1
]));
1748 yydestruct (yychar1
, yylval
, yylloc
);
1752 /* Else will try to reuse lookahead token after shifting the error
1755 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1759 yyn
= yypact
[yystate
];
1760 if (yyn
!= YYPACT_NINF
)
1763 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1771 /* Pop the current state because it cannot handle the error token. */
1775 YYDPRINTF ((stderr
, "Error: popping "));
1776 YYDSYMPRINT ((stderr
,
1777 yystos
[*yyssp
], *yyvsp
, *yylsp
));
1778 YYDPRINTF ((stderr
, "\n"));
1780 yydestruct (yystos
[yystate
], *yyvsp
, *yylsp
);
1788 short *yyssp1
= yyss
- 1;
1789 YYFPRINTF (stderr
, "Error: state stack now");
1790 while (yyssp1
!= yyssp
)
1791 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1792 YYFPRINTF (stderr
, "\n");
1800 YYDPRINTF ((stderr
, "Shifting error token, "));
1809 /*-------------------------------------.
1810 | yyacceptlab -- YYACCEPT comes here. |
1811 `-------------------------------------*/
1816 /*-----------------------------------.
1817 | yyabortlab -- YYABORT comes here. |
1818 `-----------------------------------*/
1824 /*----------------------------------------------.
1825 | yyoverflowlab -- parser overflow comes here. |
1826 `----------------------------------------------*/
1828 yyerror ("parser stack overflow");
1836 YYSTACK_FREE (yyss
);
1842 #line 424 "parse-gram.y"
1844 /*------------------------------------------------------------------.
1845 | When debugging the parser, display tokens' locations and values. |
1846 `------------------------------------------------------------------*/
1849 yyprint (FILE *file
,
1850 int type
, const yystype
*value
)
1856 fprintf (file
, " = '%s'", value
->string
);
1860 fprintf (file
, " = %s", value
->symbol
->tag
);
1864 fprintf (file
, " = %d", value
->integer
);
1868 fprintf (file
, " = \"%s\"", value
->string
);
1872 fprintf (file
, " = <%s>", value
->string
);
1878 fprintf (file
, " = {{ %s }}", value
->string
);
1884 gram_error (location_t
*yylloc
, const char *msg
)
1886 complain_at (*yylloc
, "%s", msg
);