1 /* A Bison parser, made by GNU Bison 1.75b. */
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. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 1
48 /* If NAME_PREFIX is specified substitute the variables and functions
50 #define yyparse gram_parse
51 #define yylex gram_lex
52 #define yyerror gram_error
53 #define yylval gram_lval
54 #define yychar gram_char
55 #define yydebug gram_debug
56 #define yynerrs gram_nerrs
57 #define yylloc gram_lloc
62 /* Put the tokens into the symbol table, so that GDB and other debuggers
71 PERCENT_DESTRUCTOR
= 263,
72 PERCENT_PRINTER
= 264,
76 PERCENT_NONASSOC
= 268,
82 PERCENT_DEFINES
= 274,
83 PERCENT_ERROR_VERBOSE
= 275,
85 PERCENT_FILE_PREFIX
= 277,
86 PERCENT_GLR_PARSER
= 278,
87 PERCENT_LEX_PARAM
= 279,
88 PERCENT_LOCATIONS
= 280,
89 PERCENT_NAME_PREFIX
= 281,
90 PERCENT_NO_LINES
= 282,
92 PERCENT_PARSE_PARAM
= 284,
93 PERCENT_PURE_PARSER
= 285,
94 PERCENT_SKELETON
= 286,
96 PERCENT_TOKEN_TABLE
= 288,
97 PERCENT_VERBOSE
= 289,
106 PERCENT_PERCENT
= 298,
115 #define PERCENT_TOKEN 260
116 #define PERCENT_NTERM 261
117 #define PERCENT_TYPE 262
118 #define PERCENT_DESTRUCTOR 263
119 #define PERCENT_PRINTER 264
120 #define PERCENT_UNION 265
121 #define PERCENT_LEFT 266
122 #define PERCENT_RIGHT 267
123 #define PERCENT_NONASSOC 268
124 #define PERCENT_PREC 269
125 #define PERCENT_DPREC 270
126 #define PERCENT_MERGE 271
127 #define PERCENT_DEBUG 272
128 #define PERCENT_DEFINE 273
129 #define PERCENT_DEFINES 274
130 #define PERCENT_ERROR_VERBOSE 275
131 #define PERCENT_EXPECT 276
132 #define PERCENT_FILE_PREFIX 277
133 #define PERCENT_GLR_PARSER 278
134 #define PERCENT_LEX_PARAM 279
135 #define PERCENT_LOCATIONS 280
136 #define PERCENT_NAME_PREFIX 281
137 #define PERCENT_NO_LINES 282
138 #define PERCENT_OUTPUT 283
139 #define PERCENT_PARSE_PARAM 284
140 #define PERCENT_PURE_PARSER 285
141 #define PERCENT_SKELETON 286
142 #define PERCENT_START 287
143 #define PERCENT_TOKEN_TABLE 288
144 #define PERCENT_VERBOSE 289
145 #define PERCENT_YACC 290
148 #define SEMICOLON 293
153 #define PERCENT_PERCENT 298
156 #define BRACED_CODE 301
161 /* Copy the first part of user declarations. */
162 #line 31 "parse-gram.y"
165 #include "complain.h"
166 #include "muscle_tab.h"
173 #include "conflicts.h"
175 /* Produce verbose parse errors. */
176 #define YYERROR_VERBOSE 1
177 #define YYLLOC_DEFAULT(Current, Rhs, N) \
181 Current.first_column = Rhs[1].first_column; \
182 Current.first_line = Rhs[1].first_line; \
183 Current.last_column = Rhs[N].last_column; \
184 Current.last_line = Rhs[N].last_line; \
192 /* Pass the control structure to YYPARSE and YYLEX. */
193 #define YYPARSE_PARAM gram_control
194 #define YYLEX_PARAM gram_control
195 /* YYPARSE receives GRAM_CONTROL as a void *. Provide a
196 correctly typed access to it. */
197 #define yycontrol ((gram_control_t *) gram_control)
199 /* Request detailed parse error messages, and pass them to GRAM_ERROR.
200 FIXME: depends on the undocumented availability of YYLLOC.t */
202 #define yyerror(Msg) \
203 gram_error (&yylloc, Msg)
205 #define YYPRINT(File, Type, Value) \
206 yyprint (File, Type, &Value)
207 static void yyprint (FILE *file
, int type
, const yystype
*value
);
209 symbol_class current_class
= unknown_sym
;
210 struniq_t current_type
= 0;
211 symbol_t
*current_lhs
;
212 location_t current_lhs_location
;
213 assoc_t current_assoc
;
214 int current_prec
= 0;
215 braced_code_t current_braced_code
= action_braced_code
;
218 /* Enabling traces. */
223 /* Enabling verbose error messages. */
224 #ifdef YYERROR_VERBOSE
225 # undef YYERROR_VERBOSE
226 # define YYERROR_VERBOSE 1
228 # define YYERROR_VERBOSE 0
232 #line 89 "parse-gram.y"
241 /* Line 195 of /usr/local/share/bison/yacc.c. */
242 #line 242 "parse-gram.c"
243 # define YYSTYPE yystype
244 # define YYSTYPE_IS_TRIVIAL 1
248 typedef struct yyltype
255 # define YYLTYPE yyltype
256 # define YYLTYPE_IS_TRIVIAL 1
259 /* Copy the second part of user declarations. */
262 /* Line 215 of /usr/local/share/bison/yacc.c. */
263 #line 263 "parse-gram.c"
265 #if ! defined (yyoverflow) || YYERROR_VERBOSE
267 /* The parser invokes alloca or malloc; define the necessary symbols. */
269 # if YYSTACK_USE_ALLOCA
270 # define YYSTACK_ALLOC alloca
272 # ifndef YYSTACK_USE_ALLOCA
273 # if defined (alloca) || defined (_ALLOCA_H)
274 # define YYSTACK_ALLOC alloca
277 # define YYSTACK_ALLOC __builtin_alloca
283 # ifdef YYSTACK_ALLOC
284 /* Pacify GCC's `empty if-body' warning. */
285 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
287 # if defined (__STDC__) || defined (__cplusplus)
288 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
289 # define YYSIZE_T size_t
291 # define YYSTACK_ALLOC malloc
292 # define YYSTACK_FREE free
294 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
297 #if (! defined (yyoverflow) \
298 && (! defined (__cplusplus) \
299 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
301 /* A type that is properly aligned for any stack member. */
309 /* The size of the maximum gap between one aligned stack and the next. */
310 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
312 /* The size of an array large to enough to hold all stacks, each with
314 # define YYSTACK_BYTES(N) \
315 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
316 + 2 * YYSTACK_GAP_MAX)
318 /* Copy COUNT objects from FROM to TO. The source and destination do
322 # define YYCOPY(To, From, Count) \
323 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
325 # define YYCOPY(To, From, Count) \
328 register YYSIZE_T yyi; \
329 for (yyi = 0; yyi < (Count); yyi++) \
330 (To)[yyi] = (From)[yyi]; \
336 /* Relocate STACK from its old location to the new one. The
337 local variables YYSIZE and YYSTACKSIZE give the old and new number of
338 elements in the stack, and YYPTR gives the new location of the
339 stack. Advance YYPTR to a properly aligned location for the next
341 # define YYSTACK_RELOCATE(Stack) \
344 YYSIZE_T yynewbytes; \
345 YYCOPY (&yyptr->Stack, Stack, yysize); \
346 Stack = &yyptr->Stack; \
347 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
348 yyptr += yynewbytes / sizeof (*yyptr); \
354 #if defined (__STDC__) || defined (__cplusplus)
355 typedef signed char yysigned_char
;
357 typedef short yysigned_char
;
360 /* YYFINAL -- State number of the termination state. */
362 /* YYLAST -- Last index in YYTABLE. */
365 /* YYNTOKENS -- Number of terminals. */
367 /* YYNNTS -- Number of nonterminals. */
369 /* YYNRULES -- Number of rules. */
371 /* YYNRULES -- Number of states. */
372 #define YYNSTATES 116
374 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
376 #define YYMAXUTOK 301
378 #define YYTRANSLATE(YYX) \
379 ((YYX <= 0) ? YYEOF : \
380 (unsigned)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
382 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
383 static const unsigned char yytranslate
[] =
385 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
411 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
412 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
413 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
414 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
419 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
421 static const unsigned char yyprhs
[] =
423 0, 0, 3, 8, 9, 13, 15, 17, 19, 23,
424 25, 27, 30, 34, 36, 41, 43, 47, 49, 53,
425 58, 60, 63, 65, 67, 69, 71, 73, 76, 79,
426 80, 85, 86, 91, 92, 96, 97, 101, 105, 109,
427 111, 113, 115, 116, 118, 120, 123, 125, 127, 130,
428 133, 137, 139, 142, 144, 147, 149, 152, 155, 156,
429 162, 164, 168, 169, 172, 175, 179, 183, 187, 189,
430 191, 193, 195, 197, 199, 200, 203, 204
433 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
434 static const yysigned_char yyrhs
[] =
436 48, 0, -1, 49, 43, 63, 74, -1, -1, 49,
437 50, 75, -1, 51, -1, 44, -1, 17, -1, 18,
438 72, 72, -1, 19, -1, 20, -1, 21, 4, -1,
439 22, 37, 72, -1, 23, -1, 24, 73, 40, 73,
440 -1, 25, -1, 26, 37, 72, -1, 27, -1, 28,
441 37, 72, -1, 29, 73, 40, 73, -1, 30, -1,
442 31, 72, -1, 33, -1, 34, -1, 35, -1, 57,
443 -1, 54, -1, 32, 69, -1, 10, 46, -1, -1,
444 8, 52, 46, 60, -1, -1, 9, 53, 46, 60,
445 -1, -1, 6, 55, 62, -1, -1, 5, 56, 62,
446 -1, 7, 36, 60, -1, 58, 59, 60, -1, 11,
447 -1, 12, -1, 13, -1, -1, 36, -1, 69, -1,
448 60, 69, -1, 36, -1, 42, -1, 42, 4, -1,
449 42, 71, -1, 42, 4, 71, -1, 61, -1, 62,
450 61, -1, 64, -1, 63, 64, -1, 65, -1, 51,
451 38, -1, 1, 38, -1, -1, 42, 39, 66, 67,
452 38, -1, 68, -1, 67, 41, 68, -1, -1, 68,
453 69, -1, 68, 70, -1, 68, 14, 69, -1, 68,
454 15, 4, -1, 68, 16, 36, -1, 42, -1, 71,
455 -1, 46, -1, 3, -1, 3, -1, 46, -1, -1,
456 43, 45, -1, -1, 38, -1
459 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
460 static const unsigned short yyrline
[] =
462 0, 170, 170, 182, 184, 187, 189, 190, 191, 192,
463 193, 194, 195, 196, 197, 202, 203, 204, 205, 206,
464 211, 212, 213, 214, 215, 218, 220, 221, 225, 232,
465 231, 242, 241, 254, 253, 259, 259, 264, 273, 288,
466 290, 291, 294, 296, 301, 303, 307, 312, 317, 323,
467 329, 339, 342, 351, 353, 359, 361, 366, 373, 372,
468 377, 379, 382, 385, 387, 389, 391, 393, 397, 399,
469 402, 408, 417, 426, 434, 436, 443, 445
473 #if YYDEBUG || YYERROR_VERBOSE
474 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
475 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
476 static const char *const yytname
[] =
478 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
479 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
480 "\"%printer\"", "\"%union\"", "\"%left\"", "\"%right\"",
481 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%debug\"",
482 "\"%define\"", "\"%defines\"", "\"%error-verbose\"", "\"%expect\"",
483 "\"%file-prefix\"", "\"%glr-parser\"", "\"%lex-param\"",
484 "\"%locations\"", "\"%name-prefix\"", "\"%no-lines\"", "\"%output\"",
485 "\"%parse-param\"", "\"%pure-parser\"", "\"%skeleton\"", "\"%start\"",
486 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"type\"", "\"=\"",
487 "\";\"", "\":\"", "\",\"", "\"|\"", "\"identifier\"", "\"%%\"",
488 "\"%{...%}\"", "\"epilogue\"", "\"{...}\"", "$accept", "input",
489 "declarations", "declaration", "grammar_declaration", "@1", "@2",
490 "symbol_declaration", "@3", "@4", "precedence_declaration",
491 "precedence_declarator", "type.opt", "symbols.1", "symbol_def",
492 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
493 "@5", "rhses.1", "rhs", "symbol", "action", "string_as_id",
494 "string_content", "code_content", "epilogue.opt", "semi_colon.opt", 0
499 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
501 static const unsigned short yytoknum
[] =
503 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
504 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
505 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
506 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
507 295, 296, 297, 298, 299, 300, 301
511 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
512 static const unsigned char yyr1
[] =
514 0, 47, 48, 49, 49, 50, 50, 50, 50, 50,
515 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
516 50, 50, 50, 50, 50, 51, 51, 51, 51, 52,
517 51, 53, 51, 55, 54, 56, 54, 54, 57, 58,
518 58, 58, 59, 59, 60, 60, 61, 61, 61, 61,
519 61, 62, 62, 63, 63, 64, 64, 64, 66, 65,
520 67, 67, 68, 68, 68, 68, 68, 68, 69, 69,
521 70, 71, 72, 73, 74, 74, 75, 75
524 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
525 static const unsigned char yyr2
[] =
527 0, 2, 4, 0, 3, 1, 1, 1, 3, 1,
528 1, 2, 3, 1, 4, 1, 3, 1, 3, 4,
529 1, 2, 1, 1, 1, 1, 1, 2, 2, 0,
530 4, 0, 4, 0, 3, 0, 3, 3, 3, 1,
531 1, 1, 0, 1, 1, 2, 1, 1, 2, 2,
532 3, 1, 2, 1, 2, 1, 2, 2, 0, 5,
533 1, 3, 0, 2, 2, 3, 3, 3, 1, 1,
534 1, 1, 1, 1, 0, 2, 0, 1
537 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
538 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
539 means the default is an error. */
540 static const unsigned char yydefact
[] =
542 3, 0, 0, 1, 35, 33, 0, 29, 31, 0,
543 39, 40, 41, 7, 0, 9, 10, 0, 0, 13,
544 0, 15, 0, 17, 0, 0, 20, 0, 0, 22,
545 23, 24, 0, 6, 76, 5, 26, 25, 42, 0,
546 0, 0, 0, 0, 28, 72, 0, 11, 0, 73,
547 0, 0, 0, 0, 21, 71, 68, 27, 69, 0,
548 0, 0, 0, 53, 55, 77, 4, 43, 0, 46,
549 47, 51, 36, 34, 37, 44, 0, 0, 8, 12,
550 0, 16, 18, 0, 57, 58, 56, 0, 54, 2,
551 38, 48, 49, 52, 45, 30, 32, 14, 19, 62,
552 75, 50, 0, 60, 59, 62, 0, 0, 0, 70,
553 63, 64, 61, 65, 66, 67
556 /* YYDEFGOTO[NTERM-NUM]. */
557 static const yysigned_char yydefgoto
[] =
559 -1, 1, 2, 34, 61, 42, 43, 36, 40, 39,
560 37, 38, 68, 74, 71, 72, 62, 63, 64, 99,
561 102, 103, 75, 111, 58, 46, 50, 89, 66
564 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
566 #define YYPACT_NINF -66
567 static const yysigned_char yypact
[] =
569 -66, 6, 108, -66, -66, -66, -16, -66, -66, -21,
570 -66, -66, -66, -66, 19, -66, -66, 32, 5, -66,
571 3, -66, 10, -66, 11, 3, -66, 19, 1, -66,
572 -66, -66, 80, -66, 12, -66, -66, -66, 16, -19,
573 -19, 1, 7, 8, -66, -66, 19, -66, 19, -66,
574 18, 19, 19, 20, -66, -66, -66, -66, -66, 13,
575 24, 17, 2, -66, -66, -66, -66, -66, 1, -66,
576 29, -66, -19, -19, 1, -66, 1, 1, -66, -66,
577 3, -66, -66, 3, -66, -66, -66, 21, -66, -66,
578 1, 61, -66, -66, -66, 1, 1, -66, -66, -66,
579 -66, -66, -17, 15, -66, -66, 1, 65, 34, -66,
580 -66, -66, 15, -66, -66, -66
583 /* YYPGOTO[NTERM-NUM]. */
584 static const yysigned_char yypgoto
[] =
586 -66, -66, -66, -66, 63, -66, -66, -66, -66, -66,
587 -66, -66, -66, -49, -34, 31, -66, 14, -66, -66,
588 -66, -33, -28, -66, -65, -11, -24, -66, -66
591 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
592 positive, shift that token. If negative, reduce the rule which
593 number is the opposite. If zero, do what YYDEFACT says.
594 If YYTABLE_NINF, parse error. */
595 #define YYTABLE_NINF -75
596 static const yysigned_char yytable
[] =
598 57, 53, -74, 59, 55, 92, 3, 4, 5, 6,
599 7, 8, 9, 10, 11, 12, 54, 69, 55, 90,
600 41, 104, 45, 70, 105, 44, 101, 95, 96, 106,
601 107, 108, 55, 91, 28, 78, 47, 79, 93, 93,
602 81, 82, 48, 56, 60, 87, 94, 51, 52, 49,
603 65, 84, 67, 76, 77, 86, 97, 56, 80, 98,
604 83, 109, 94, 85, 55, 35, 100, 94, 94, 114,
605 115, 73, 112, 0, 0, 110, 88, 0, 113, 0,
606 0, 59, 0, 0, 110, 4, 5, 6, 7, 8,
607 9, 10, 11, 12, 0, 0, 0, 0, 0, 0,
608 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
609 0, 0, 28, 4, 5, 6, 7, 8, 9, 10,
610 11, 12, 60, 0, 0, 13, 14, 15, 16, 17,
611 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
612 28, 29, 30, 31, 0, 0, 0, 0, 0, 0,
616 static const yysigned_char yycheck
[] =
618 28, 25, 0, 1, 3, 70, 0, 5, 6, 7,
619 8, 9, 10, 11, 12, 13, 27, 36, 3, 68,
620 36, 38, 3, 42, 41, 46, 91, 76, 77, 14,
621 15, 16, 3, 4, 32, 46, 4, 48, 72, 73,
622 51, 52, 37, 42, 42, 43, 74, 37, 37, 46,
623 38, 38, 36, 46, 46, 38, 80, 42, 40, 83,
624 40, 46, 90, 39, 3, 2, 45, 95, 96, 4,
625 36, 40, 105, -1, -1, 103, 62, -1, 106, -1,
626 -1, 1, -1, -1, 112, 5, 6, 7, 8, 9,
627 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
628 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
629 -1, -1, 32, 5, 6, 7, 8, 9, 10, 11,
630 12, 13, 42, -1, -1, 17, 18, 19, 20, 21,
631 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
632 32, 33, 34, 35, -1, -1, -1, -1, -1, -1,
636 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
637 symbol of state STATE-NUM. */
638 static const unsigned char yystos
[] =
640 0, 48, 49, 0, 5, 6, 7, 8, 9, 10,
641 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
642 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
643 34, 35, 43, 44, 50, 51, 54, 57, 58, 56,
644 55, 36, 52, 53, 46, 3, 72, 4, 37, 46,
645 73, 37, 37, 73, 72, 3, 42, 69, 71, 1,
646 42, 51, 63, 64, 65, 38, 75, 36, 59, 36,
647 42, 61, 62, 62, 60, 69, 46, 46, 72, 72,
648 40, 72, 72, 40, 38, 39, 38, 43, 64, 74,
649 60, 4, 71, 61, 69, 60, 60, 73, 73, 66,
650 45, 71, 67, 68, 38, 41, 14, 15, 16, 46,
651 69, 70, 68, 69, 4, 36
654 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
655 # define YYSIZE_T __SIZE_TYPE__
657 #if ! defined (YYSIZE_T) && defined (size_t)
658 # define YYSIZE_T size_t
660 #if ! defined (YYSIZE_T)
661 # if defined (__STDC__) || defined (__cplusplus)
662 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
663 # define YYSIZE_T size_t
666 #if ! defined (YYSIZE_T)
667 # define YYSIZE_T unsigned int
670 #define yyerrok (yyerrstatus = 0)
671 #define yyclearin (yytoken = YYEMPTY)
675 #define YYACCEPT goto yyacceptlab
676 #define YYABORT goto yyabortlab
677 #define YYERROR goto yyerrlab1
679 /* Like YYERROR except do call yyerror. This remains here temporarily
680 to ease the transition to the new meaning of YYERROR, for GCC.
681 Once GCC version 2 has supplanted version 1, this can go. */
683 #define YYFAIL goto yyerrlab
685 #define YYRECOVERING() (!!yyerrstatus)
687 #define YYBACKUP(Token, Value) \
689 if (yytoken == YYEMPTY && yylen == 1) \
693 yytoken = YYTRANSLATE (yychar); \
699 yyerror ("syntax error: cannot back up"); \
705 #define YYERRCODE 256
707 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
710 #ifndef YYLLOC_DEFAULT
711 # define YYLLOC_DEFAULT(Current, Rhs, N) \
712 Current.first_line = Rhs[1].first_line; \
713 Current.first_column = Rhs[1].first_column; \
714 Current.last_line = Rhs[N].last_line; \
715 Current.last_column = Rhs[N].last_column;
718 /* YYLEX -- calling `yylex' with the right arguments. */
721 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
723 # define YYLEX yylex (&yylval, &yylloc)
726 /* Enable debugging if requested. */
730 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
731 # define YYFPRINTF fprintf
734 # define YYDPRINTF(Args) \
739 # define YYDSYMPRINT(Args) \
744 /* Nonzero means print parse trace. It is left uninitialized so that
745 multiple parsers can coexist. */
748 # define YYDPRINTF(Args)
749 # define YYDSYMPRINT(Args)
750 #endif /* !YYDEBUG */
752 /* YYINITDEPTH -- initial size of the parser's stacks. */
754 # define YYINITDEPTH 200
757 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
758 if the built-in stack extension method is used).
760 Do not make this value too large; the results are undefined if
761 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
762 evaluated with infinite-precision integer arithmetic. */
769 # define YYMAXDEPTH 10000
777 # if defined (__GLIBC__) && defined (_STRING_H)
778 # define yystrlen strlen
780 /* Return the length of YYSTR. */
782 # if defined (__STDC__) || defined (__cplusplus)
783 yystrlen (const char *yystr
)
789 register const char *yys
= yystr
;
791 while (*yys
++ != '\0')
794 return yys
- yystr
- 1;
800 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
801 # define yystpcpy stpcpy
803 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
806 # if defined (__STDC__) || defined (__cplusplus)
807 yystpcpy (char *yydest
, const char *yysrc
)
809 yystpcpy (yydest
, yysrc
)
814 register char *yyd
= yydest
;
815 register const char *yys
= yysrc
;
817 while ((*yyd
++ = *yys
++) != '\0')
825 #endif /* !YYERROR_VERBOSE */
830 /*-----------------------------.
831 | Print this symbol on YYOUT. |
832 `-----------------------------*/
834 #if defined (__STDC__) || defined (__cplusplus)
836 yysymprint (FILE *yyout
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
839 yysymprint (yyout
, yytype
, yyvaluep
, yylocationp
)
843 YYLTYPE
*yylocationp
;
846 /* Pacify ``unused variable'' warnings. */
850 if (yytype
< YYNTOKENS
)
852 YYFPRINTF (yyout
, "token %s (", yytname
[yytype
]);
854 YYPRINT (yyout
, yytoknum
[yytype
], *yyvaluep
);
858 YYFPRINTF (yyout
, "nterm %s (", yytname
[yytype
]);
865 YYFPRINTF (yyout
, ")");
868 #endif /* YYDEBUG. */
869 /*-----------------------------------------------.
870 | Release the memory associated to this symbol. |
871 `-----------------------------------------------*/
873 #if defined (__STDC__) || defined (__cplusplus)
875 yydestruct (int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
878 yydestruct (yytype
, yyvaluep
, yylocationp
)
881 YYLTYPE
*yylocationp
;
884 /* Pacify ``unused variable'' warnings. */
897 /* Prevent warnings from -Wmissing-prototypes. */
900 # if defined (__STDC__) || defined (__cplusplus)
901 int yyparse (void *YYPARSE_PARAM
);
905 #else /* ! YYPARSE_PARAM */
906 #if defined (__STDC__) || defined (__cplusplus)
923 # if defined (__STDC__) || defined (__cplusplus)
924 int yyparse (void *YYPARSE_PARAM
)
926 int yyparse (YYPARSE_PARAM
)
929 #else /* ! YYPARSE_PARAM */
930 #if defined (__STDC__) || defined (__cplusplus)
940 /* The lookahead symbol. */
943 /* The semantic value of the lookahead symbol. */
946 /* Number of parse errors so far. */
948 /* Location data for the lookahead symbol. */
951 register int yystate
;
954 /* Number of tokens to shift before error messages enabled. */
956 /* Lookahead token as an internal (translated) token number. */
959 /* Three stacks and their tools:
960 `yyss': related to states,
961 `yyvs': related to semantic values,
962 `yyls': related to locations.
964 Refer to the stacks thru separate pointers, to allow yyoverflow
965 to reallocate them elsewhere. */
967 /* The state stack. */
968 short yyssa
[YYINITDEPTH
];
970 register short *yyssp
;
972 /* The semantic value stack. */
973 YYSTYPE yyvsa
[YYINITDEPTH
];
974 YYSTYPE
*yyvs
= yyvsa
;
975 register YYSTYPE
*yyvsp
;
977 /* The location stack. */
978 YYLTYPE yylsa
[YYINITDEPTH
];
979 YYLTYPE
*yyls
= yylsa
;
982 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
984 YYSIZE_T yystacksize
= YYINITDEPTH
;
986 /* The variables used to return semantic value and location from the
991 /* When reducing, the number of symbols on the RHS of the reduced
995 YYDPRINTF ((stderr
, "Starting parse\n"));
1000 yychar
= yytoken
= YYEMPTY
; /* Cause a token to be read. */
1002 /* Initialize stack pointers.
1003 Waste one element of value and location stack
1004 so that they stay on the same level as the state stack.
1005 The wasted elements are never initialized. */
1012 /*------------------------------------------------------------.
1013 | yynewstate -- Push a new state, which is found in yystate. |
1014 `------------------------------------------------------------*/
1016 /* In all cases, when you get here, the value and location stacks
1017 have just been pushed. so pushing a state here evens the stacks.
1024 if (yyss
+ yystacksize
- 1 <= yyssp
)
1026 /* Get the current used size of the three stacks, in elements. */
1027 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1031 /* Give user a chance to reallocate the stack. Use copies of
1032 these so that the &'s don't force the real ones into
1034 YYSTYPE
*yyvs1
= yyvs
;
1035 short *yyss1
= yyss
;
1036 YYLTYPE
*yyls1
= yyls
;
1038 /* Each stack pointer address is followed by the size of the
1039 data in use in that stack, in bytes. This used to be a
1040 conditional around just the two extra args, but that might
1041 be undefined if yyoverflow is a macro. */
1042 yyoverflow ("parser stack overflow",
1043 &yyss1
, yysize
* sizeof (*yyssp
),
1044 &yyvs1
, yysize
* sizeof (*yyvsp
),
1045 &yyls1
, yysize
* sizeof (*yylsp
),
1051 #else /* no yyoverflow */
1052 # ifndef YYSTACK_RELOCATE
1055 /* Extend the stack our own way. */
1056 if (YYMAXDEPTH
<= yystacksize
)
1059 if (YYMAXDEPTH
< yystacksize
)
1060 yystacksize
= YYMAXDEPTH
;
1063 short *yyss1
= yyss
;
1064 union yyalloc
*yyptr
=
1065 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1068 YYSTACK_RELOCATE (yyss
);
1069 YYSTACK_RELOCATE (yyvs
);
1070 YYSTACK_RELOCATE (yyls
);
1071 # undef YYSTACK_RELOCATE
1073 YYSTACK_FREE (yyss1
);
1076 #endif /* no yyoverflow */
1078 yyssp
= yyss
+ yysize
- 1;
1079 yyvsp
= yyvs
+ yysize
- 1;
1080 yylsp
= yyls
+ yysize
- 1;
1082 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1083 (unsigned long int) yystacksize
));
1085 if (yyss
+ yystacksize
- 1 <= yyssp
)
1089 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1098 /* Do appropriate processing given the current state. */
1099 /* Read a lookahead token if we need one and don't already have one. */
1102 /* First try to decide what to do without reference to lookahead token. */
1104 yyn
= yypact
[yystate
];
1105 if (yyn
== YYPACT_NINF
)
1108 /* Not known => get a lookahead token if don't already have one. */
1110 /* YYTOKEN is either YYEMPTY or YYEOF or a valid token. */
1111 if (yytoken
== YYEMPTY
)
1113 YYDPRINTF ((stderr
, "Reading a token: "));
1115 yytoken
= YYTRANSLATE (yychar
);
1118 if (yytoken
== YYEOF
)
1120 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1124 /* We have to keep this `#if YYDEBUG', since we use variables
1125 which are defined only if `YYDEBUG' is set. */
1126 YYDPRINTF ((stderr
, "Next token is "));
1127 YYDSYMPRINT ((stderr
, yytoken
, &yylval
, &yyloc
));
1128 YYDPRINTF ((stderr
, "\n"));
1131 /* If the proper action on seeing token YYTOKEN is to reduce or to
1132 detect an error, take that action. */
1134 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1139 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1148 /* Shift the lookahead token. */
1149 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1150 yytoken
, yytname
[yytoken
]));
1152 /* Discard the token being shifted unless it is eof. */
1153 if (yytoken
!= YYEOF
)
1159 /* Count tokens shifted since error; after three, turn off error
1168 /*-----------------------------------------------------------.
1169 | yydefault -- do the default action for the current state. |
1170 `-----------------------------------------------------------*/
1172 yyn
= yydefact
[yystate
];
1178 /*-----------------------------.
1179 | yyreduce -- Do a reduction. |
1180 `-----------------------------*/
1182 /* yyn is the number of a rule to reduce with. */
1185 /* If YYLEN is nonzero, implement the default value of the action:
1188 Otherwise, the following line sets YYVAL to garbage.
1189 This behavior is undocumented and Bison
1190 users should not rely upon it. Assigning to YYVAL
1191 unconditionally makes the parser a bit smaller, and it avoids a
1192 GCC warning that YYVAL may be used uninitialized. */
1193 yyval
= yyvsp
[1-yylen
];
1195 /* Default location. */
1196 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1199 /* We have to keep this `#if YYDEBUG', since we use variables which
1200 are defined only if `YYDEBUG' is set. */
1205 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1206 yyn
- 1, yyrline
[yyn
]);
1208 /* Print the symbols being reduced, and their result. */
1209 for (yyi
= yyprhs
[yyn
]; 0 <= yyrhs
[yyi
]; yyi
++)
1210 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1211 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1217 #line 172 "parse-gram.y"
1219 yycontrol
->errcode
= 0;
1224 #line 189 "parse-gram.y"
1225 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1229 #line 190 "parse-gram.y"
1234 #line 191 "parse-gram.y"
1235 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1239 #line 192 "parse-gram.y"
1240 { defines_flag
= 1; }
1244 #line 193 "parse-gram.y"
1245 { error_verbose
= 1; }
1249 #line 194 "parse-gram.y"
1250 { expected_conflicts
= yyvsp
[0].integer
; }
1254 #line 195 "parse-gram.y"
1255 { spec_file_prefix
= yyvsp
[0].string
; }
1259 #line 196 "parse-gram.y"
1264 #line 198 "parse-gram.y"
1266 muscle_pair_list_grow ("lex_param", yyvsp
[-2].string
, yyvsp
[0].string
);
1267 scanner_last_string_free ();
1272 #line 202 "parse-gram.y"
1273 { locations_flag
= 1; }
1277 #line 203 "parse-gram.y"
1278 { spec_name_prefix
= yyvsp
[0].string
; }
1282 #line 204 "parse-gram.y"
1283 { no_lines_flag
= 1; }
1287 #line 205 "parse-gram.y"
1288 { spec_outfile
= yyvsp
[0].string
; }
1292 #line 207 "parse-gram.y"
1294 muscle_pair_list_grow ("parse_param", yyvsp
[-2].string
, yyvsp
[0].string
);
1295 scanner_last_string_free ();
1300 #line 211 "parse-gram.y"
1301 { pure_parser
= 1; }
1305 #line 212 "parse-gram.y"
1306 { skeleton
= yyvsp
[0].string
; }
1310 #line 213 "parse-gram.y"
1311 { token_table_flag
= 1; }
1315 #line 214 "parse-gram.y"
1316 { report_flag
= 1; }
1320 #line 215 "parse-gram.y"
1325 #line 222 "parse-gram.y"
1327 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1332 #line 226 "parse-gram.y"
1335 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1336 muscle_insert ("stype", yyvsp
[0].string
);
1341 #line 232 "parse-gram.y"
1342 { current_braced_code
= destructor_braced_code
; }
1346 #line 234 "parse-gram.y"
1348 symbol_list_t
*list
;
1349 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1350 symbol_destructor_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1351 symbol_list_free (yyvsp
[0].list
);
1352 current_braced_code
= action_braced_code
;
1357 #line 242 "parse-gram.y"
1358 { current_braced_code
= printer_braced_code
; }
1362 #line 244 "parse-gram.y"
1364 symbol_list_t
*list
;
1365 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1366 symbol_printer_set (list
->sym
, yyvsp
[-1].string
, list
->location
);
1367 symbol_list_free (yyvsp
[0].list
);
1368 current_braced_code
= action_braced_code
;
1373 #line 254 "parse-gram.y"
1374 { current_class
= nterm_sym
; }
1378 #line 255 "parse-gram.y"
1380 current_class
= unknown_sym
;
1381 current_type
= NULL
;
1386 #line 259 "parse-gram.y"
1387 { current_class
= token_sym
; }
1391 #line 260 "parse-gram.y"
1393 current_class
= unknown_sym
;
1394 current_type
= NULL
;
1399 #line 265 "parse-gram.y"
1401 symbol_list_t
*list
;
1402 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1403 symbol_type_set (list
->sym
, yyvsp
[-1].struniq
, yylsp
[-1]);
1404 symbol_list_free (yyvsp
[0].list
);
1409 #line 275 "parse-gram.y"
1411 symbol_list_t
*list
;
1413 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1415 symbol_type_set (list
->sym
, current_type
, yylsp
[-1]);
1416 symbol_precedence_set (list
->sym
, current_prec
, yyvsp
[-2].assoc
, yylsp
[-2]);
1418 symbol_list_free (yyvsp
[0].list
);
1419 current_type
= NULL
;
1424 #line 289 "parse-gram.y"
1425 { yyval
.assoc
= left_assoc
; }
1429 #line 290 "parse-gram.y"
1430 { yyval
.assoc
= right_assoc
; }
1434 #line 291 "parse-gram.y"
1435 { yyval
.assoc
= non_assoc
; }
1439 #line 295 "parse-gram.y"
1440 { current_type
= NULL
; }
1444 #line 296 "parse-gram.y"
1445 { current_type
= yyvsp
[0].struniq
; }
1449 #line 302 "parse-gram.y"
1450 { yyval
.list
= symbol_list_new (yyvsp
[0].symbol
, yylsp
[0]); }
1454 #line 303 "parse-gram.y"
1455 { yyval
.list
= symbol_list_prepend (yyvsp
[-1].list
, yyvsp
[0].symbol
, yylsp
[0]); }
1459 #line 309 "parse-gram.y"
1461 current_type
= yyvsp
[0].struniq
;
1466 #line 313 "parse-gram.y"
1468 symbol_class_set (yyvsp
[0].symbol
, current_class
, yylsp
[0]);
1469 symbol_type_set (yyvsp
[0].symbol
, current_type
, yylsp
[0]);
1474 #line 318 "parse-gram.y"
1476 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1477 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1478 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
, yylsp
[0]);
1483 #line 324 "parse-gram.y"
1485 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1486 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1487 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
, yyloc
);
1492 #line 330 "parse-gram.y"
1494 symbol_class_set (yyvsp
[-2].symbol
, current_class
, yylsp
[-2]);
1495 symbol_type_set (yyvsp
[-2].symbol
, current_type
, yylsp
[-2]);
1496 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
, yylsp
[-1]);
1497 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
, yyloc
);
1502 #line 341 "parse-gram.y"
1507 #line 343 "parse-gram.y"
1512 #line 362 "parse-gram.y"
1515 complain_at (yyloc
, _("POSIX forbids declarations in the grammar"));
1520 #line 367 "parse-gram.y"
1527 #line 373 "parse-gram.y"
1528 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1532 #line 374 "parse-gram.y"
1537 #line 378 "parse-gram.y"
1538 { grammar_rule_end (yylsp
[0]); }
1542 #line 379 "parse-gram.y"
1543 { grammar_rule_end (yylsp
[0]); }
1547 #line 384 "parse-gram.y"
1548 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1552 #line 386 "parse-gram.y"
1553 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1557 #line 388 "parse-gram.y"
1558 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1562 #line 390 "parse-gram.y"
1563 { grammar_current_rule_prec_set (yyvsp
[0].symbol
, yylsp
[0]); }
1567 #line 392 "parse-gram.y"
1568 { grammar_current_rule_dprec_set (yyvsp
[0].integer
, yylsp
[0]); }
1572 #line 394 "parse-gram.y"
1573 { grammar_current_rule_merge_set (yyvsp
[0].struniq
, yylsp
[0]); }
1577 #line 398 "parse-gram.y"
1578 { yyval
.symbol
= yyvsp
[0].symbol
; }
1582 #line 399 "parse-gram.y"
1583 { yyval
.symbol
= yyvsp
[0].symbol
; }
1587 #line 404 "parse-gram.y"
1588 { yyval
.string
= yyvsp
[0].string
; }
1592 #line 410 "parse-gram.y"
1594 yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]);
1595 symbol_class_set (yyval
.symbol
, token_sym
, yylsp
[0]);
1600 #line 419 "parse-gram.y"
1602 yyval
.string
= yyvsp
[0].string
+ 1;
1603 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1608 #line 428 "parse-gram.y"
1610 yyval
.string
= yyvsp
[0].string
+ 1;
1611 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1616 #line 437 "parse-gram.y"
1618 epilogue_augment (yyvsp
[0].string
, yylsp
[0]);
1619 scanner_last_string_free ();
1626 /* Line 950 of /usr/local/share/bison/yacc.c. */
1627 #line 1627 "parse-gram.c"
1636 short *yyssp1
= yyss
- 1;
1637 YYFPRINTF (stderr
, "state stack now");
1638 while (yyssp1
!= yyssp
)
1639 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1640 YYFPRINTF (stderr
, "\n");
1647 /* Now `shift' the result of the reduction. Determine what state
1648 that goes to, based on the state we popped back to and the rule
1649 number reduced by. */
1653 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1654 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1655 yystate
= yytable
[yystate
];
1657 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1662 /*------------------------------------.
1663 | yyerrlab -- here on detecting error |
1664 `------------------------------------*/
1666 /* If not already recovering from an error, report this error. */
1671 yyn
= yypact
[yystate
];
1673 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
1675 YYSIZE_T yysize
= 0;
1676 int yytype
= YYTRANSLATE (yychar
);
1681 /* Start YYX at -YYN if negative to avoid negative indexes in
1683 for (yyx
= yyn
< 0 ? -yyn
: 0;
1684 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1685 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1686 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1687 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1688 yysize
+= yystrlen (yytname
[yytype
]);
1689 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1692 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1693 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
1698 for (yyx
= yyn
< 0 ? -yyn
: 0;
1699 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1701 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1703 const char *yyq
= ! yycount
? ", expecting " : " or ";
1704 yyp
= yystpcpy (yyp
, yyq
);
1705 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1710 YYSTACK_FREE (yymsg
);
1713 yyerror ("parse error; also virtual memory exhausted");
1716 #endif /* YYERROR_VERBOSE */
1717 yyerror ("parse error");
1722 /*----------------------------------------------------.
1723 | yyerrlab1 -- error raised explicitly by an action. |
1724 `----------------------------------------------------*/
1726 if (yyerrstatus
== 3)
1728 /* If just tried and failed to reuse lookahead token after an
1729 error, discard it. */
1731 /* Return failure if at end of input. */
1732 if (yytoken
== YYEOF
)
1734 /* Pop the error token. */
1736 /* Pop the rest of the stack. */
1737 while (yyss
< yyssp
)
1739 YYDPRINTF ((stderr
, "Error: popping "));
1740 YYDSYMPRINT ((stderr
,
1743 YYDPRINTF ((stderr
, "\n"));
1744 yydestruct (yystos
[*yyssp
], yyvsp
, yylsp
);
1750 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1751 yytoken
, yytname
[yytoken
]));
1752 yydestruct (yytoken
, &yylval
, &yylloc
);
1756 /* Else will try to reuse lookahead token after shifting the error
1759 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1763 yyn
= yypact
[yystate
];
1764 if (yyn
!= YYPACT_NINF
)
1767 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1775 /* Pop the current state because it cannot handle the error token. */
1779 YYDPRINTF ((stderr
, "Error: popping "));
1780 YYDSYMPRINT ((stderr
,
1781 yystos
[*yyssp
], yyvsp
, yylsp
));
1782 YYDPRINTF ((stderr
, "\n"));
1784 yydestruct (yystos
[yystate
], yyvsp
, yylsp
);
1792 short *yyssp1
= yyss
- 1;
1793 YYFPRINTF (stderr
, "Error: state stack now");
1794 while (yyssp1
!= yyssp
)
1795 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1796 YYFPRINTF (stderr
, "\n");
1804 YYDPRINTF ((stderr
, "Shifting error token, "));
1813 /*-------------------------------------.
1814 | yyacceptlab -- YYACCEPT comes here. |
1815 `-------------------------------------*/
1820 /*-----------------------------------.
1821 | yyabortlab -- YYABORT comes here. |
1822 `-----------------------------------*/
1828 /*----------------------------------------------.
1829 | yyoverflowlab -- parser overflow comes here. |
1830 `----------------------------------------------*/
1832 yyerror ("parser stack overflow");
1840 YYSTACK_FREE (yyss
);
1846 #line 447 "parse-gram.y"
1848 /*------------------------------------------------------------------.
1849 | When debugging the parser, display tokens' locations and values. |
1850 `------------------------------------------------------------------*/
1853 yyprint (FILE *file
,
1854 int type
, const yystype
*value
)
1860 fprintf (file
, " = %s", value
->symbol
->tag
);
1864 fprintf (file
, " = %d", value
->integer
);
1868 fprintf (file
, " = \"%s\"", value
->string
);
1872 fprintf (file
, " = <%s>", value
->struniq
);
1878 fprintf (file
, " = {{ %s }}", value
->string
);
1882 fprintf (file
, "unknown token type");
1888 gram_error (location_t
*yylloc
, const char *msg
)
1890 complain_at (*yylloc
, "%s", msg
);