1 /* A Bison parser, made from parse-gram.y, 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 237 of /usr/local/share/bison/yacc.c. */
242 #line 243 "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 257 of /usr/local/share/bison/yacc.c. */
263 #line 264 "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 115
374 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
376 #define YYMAXUTOK 301
378 #define YYTRANSLATE(X) \
379 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
381 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
382 static const unsigned char yytranslate
[] =
384 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
410 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
411 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
412 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
413 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
418 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
420 static const unsigned char yyprhs
[] =
422 0, 0, 3, 8, 9, 13, 15, 17, 19, 23,
423 25, 27, 30, 34, 36, 41, 43, 47, 49, 53,
424 58, 60, 63, 65, 67, 69, 71, 73, 76, 79,
425 80, 85, 86, 91, 92, 96, 97, 101, 105, 109,
426 111, 113, 115, 116, 118, 120, 123, 125, 127, 130,
427 133, 137, 139, 142, 144, 147, 149, 152, 155, 156,
428 162, 164, 168, 169, 172, 175, 179, 183, 187, 189,
429 191, 193, 195, 197, 198, 201, 202
432 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
433 static const yysigned_char yyrhs
[] =
435 48, 0, -1, 49, 43, 63, 73, -1, -1, 49,
436 50, 74, -1, 51, -1, 44, -1, 17, -1, 18,
437 72, 72, -1, 19, -1, 20, -1, 21, 4, -1,
438 22, 37, 72, -1, 23, -1, 24, 72, 40, 72,
439 -1, 25, -1, 26, 37, 72, -1, 27, -1, 28,
440 37, 72, -1, 29, 72, 40, 72, -1, 30, -1,
441 31, 72, -1, 33, -1, 34, -1, 35, -1, 57,
442 -1, 54, -1, 32, 69, -1, 10, 46, -1, -1,
443 8, 52, 46, 60, -1, -1, 9, 53, 46, 60,
444 -1, -1, 6, 55, 62, -1, -1, 5, 56, 62,
445 -1, 7, 36, 60, -1, 58, 59, 60, -1, 11,
446 -1, 12, -1, 13, -1, -1, 36, -1, 69, -1,
447 60, 69, -1, 36, -1, 42, -1, 42, 4, -1,
448 42, 71, -1, 42, 4, 71, -1, 61, -1, 62,
449 61, -1, 64, -1, 63, 64, -1, 65, -1, 51,
450 38, -1, 1, 38, -1, -1, 42, 39, 66, 67,
451 38, -1, 68, -1, 67, 41, 68, -1, -1, 68,
452 69, -1, 68, 70, -1, 68, 14, 69, -1, 68,
453 15, 4, -1, 68, 16, 36, -1, 42, -1, 71,
454 -1, 46, -1, 3, -1, 3, -1, -1, 43, 45,
458 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
459 static const unsigned short yyrline
[] =
461 0, 169, 169, 182, 184, 187, 189, 190, 191, 192,
462 193, 194, 195, 196, 197, 199, 200, 201, 202, 203,
463 205, 206, 207, 208, 209, 212, 214, 215, 219, 226,
464 225, 236, 235, 248, 247, 253, 253, 258, 267, 282,
465 284, 285, 288, 290, 295, 297, 301, 306, 311, 317,
466 323, 333, 336, 345, 347, 353, 355, 360, 367, 366,
467 371, 373, 376, 379, 381, 383, 385, 387, 391, 393,
468 396, 402, 411, 419, 424, 430, 432
472 #if YYDEBUG || YYERROR_VERBOSE
473 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
474 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
475 static const char *const yytname
[] =
477 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
478 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
479 "\"%printer\"", "\"%union\"", "\"%left\"", "\"%right\"",
480 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%debug\"",
481 "\"%define\"", "\"%defines\"", "\"%error-verbose\"", "\"%expect\"",
482 "\"%file-prefix\"", "\"%glr-parser\"", "\"%lex-param\"",
483 "\"%locations\"", "\"%name-prefix\"", "\"%no-lines\"", "\"%output\"",
484 "\"%parse-param\"", "\"%pure-parser\"", "\"%skeleton\"", "\"%start\"",
485 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"type\"", "\"=\"",
486 "\";\"", "\":\"", "\",\"", "\"|\"", "\"identifier\"", "\"%%\"",
487 "\"%{...%}\"", "\"epilogue\"", "\"{...}\"", "$accept", "input",
488 "declarations", "declaration", "grammar_declaration", "@1", "@2",
489 "symbol_declaration", "@3", "@4", "precedence_declaration",
490 "precedence_declarator", "type.opt", "symbols.1", "symbol_def",
491 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
492 "@5", "rhses.1", "rhs", "symbol", "action", "string_as_id",
493 "string_content", "epilogue.opt", "semi_colon.opt", 0
498 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
500 static const unsigned short yytoknum
[] =
502 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
503 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
504 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
505 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
506 295, 296, 297, 298, 299, 300, 301
510 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
511 static const unsigned char yyr1
[] =
513 0, 47, 48, 49, 49, 50, 50, 50, 50, 50,
514 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
515 50, 50, 50, 50, 50, 51, 51, 51, 51, 52,
516 51, 53, 51, 55, 54, 56, 54, 54, 57, 58,
517 58, 58, 59, 59, 60, 60, 61, 61, 61, 61,
518 61, 62, 62, 63, 63, 64, 64, 64, 66, 65,
519 67, 67, 68, 68, 68, 68, 68, 68, 69, 69,
520 70, 71, 72, 73, 73, 74, 74
523 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
524 static const unsigned char yyr2
[] =
526 0, 2, 4, 0, 3, 1, 1, 1, 3, 1,
527 1, 2, 3, 1, 4, 1, 3, 1, 3, 4,
528 1, 2, 1, 1, 1, 1, 1, 2, 2, 0,
529 4, 0, 4, 0, 3, 0, 3, 3, 3, 1,
530 1, 1, 0, 1, 1, 2, 1, 1, 2, 2,
531 3, 1, 2, 1, 2, 1, 2, 2, 0, 5,
532 1, 3, 0, 2, 2, 3, 3, 3, 1, 1,
536 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
537 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
538 means the default is an error. */
539 static const unsigned char yydefact
[] =
541 3, 0, 0, 1, 35, 33, 0, 29, 31, 0,
542 39, 40, 41, 7, 0, 9, 10, 0, 0, 13,
543 0, 15, 0, 17, 0, 0, 20, 0, 0, 22,
544 23, 24, 0, 6, 75, 5, 26, 25, 42, 0,
545 0, 0, 0, 0, 28, 72, 0, 11, 0, 0,
546 0, 0, 0, 21, 71, 68, 27, 69, 0, 0,
547 0, 0, 53, 55, 76, 4, 43, 0, 46, 47,
548 51, 36, 34, 37, 44, 0, 0, 8, 12, 0,
549 16, 18, 0, 57, 58, 56, 0, 54, 2, 38,
550 48, 49, 52, 45, 30, 32, 14, 19, 62, 74,
551 50, 0, 60, 59, 62, 0, 0, 0, 70, 63,
555 /* YYDEFGOTO[NTERM-NUM]. */
556 static const yysigned_char yydefgoto
[] =
558 -1, 1, 2, 34, 60, 42, 43, 36, 40, 39,
559 37, 38, 67, 73, 70, 71, 61, 62, 63, 98,
560 101, 102, 74, 110, 57, 46, 88, 65
563 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
565 #define YYPACT_NINF -67
566 static const yysigned_char yypact
[] =
568 -67, 7, 81, -67, -67, -67, -13, -67, -67, -16,
569 -67, -67, -67, -67, 32, -67, -67, 36, 20, -67,
570 32, -67, 21, -67, 22, 32, -67, 32, -1, -67,
571 -67, -67, 43, -67, 24, -67, -67, -67, 28, -14,
572 -14, -1, 25, 26, -67, -67, 32, -67, 32, 30,
573 32, 32, 33, -67, -67, -67, -67, -67, 38, 29,
574 40, 4, -67, -67, -67, -67, -67, -1, -67, 16,
575 -67, -14, -14, -1, -67, -1, -1, -67, -67, 32,
576 -67, -67, 32, -67, -67, -67, 34, -67, -67, -1,
577 77, -67, -67, -67, -1, -1, -67, -67, -67, -67,
578 -67, -20, 23, -67, -67, -1, 78, 45, -67, -67,
579 -67, 23, -67, -67, -67
582 /* YYPGOTO[NTERM-NUM]. */
583 static const yysigned_char yypgoto
[] =
585 -67, -67, -67, -67, 82, -67, -67, -67, -67, -67,
586 -67, -67, -67, -42, -29, 55, -67, 35, -67, -67,
587 -67, -7, -28, -67, -66, -19, -67, -67
590 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
591 positive, shift that token. If negative, reduce the rule which
592 number is the opposite. If zero, do what YYDEFACT says.
593 If YYTABLE_NINF, parse error. */
594 #define YYTABLE_NINF -74
595 static const yysigned_char yytable
[] =
597 56, 49, 54, 91, -73, 58, 52, 3, 53, 4,
598 5, 6, 7, 8, 9, 10, 11, 12, 103, 54,
599 90, 104, 68, 41, 100, 89, 54, 77, 69, 78,
600 44, 80, 81, 94, 95, 45, 28, 105, 106, 107,
601 47, 55, 92, 92, 58, 93, 59, 86, 4, 5,
602 6, 7, 8, 9, 10, 11, 12, 48, 50, 51,
603 96, 93, 64, 97, 66, 55, 93, 93, 84, 108,
604 79, 75, 76, 82, 109, 28, 83, 112, 85, 99,
605 54, 114, 113, 109, 35, 59, 4, 5, 6, 7,
606 8, 9, 10, 11, 12, 72, 87, 111, 13, 14,
607 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
608 25, 26, 27, 28, 29, 30, 31, 0, 0, 0,
612 static const yysigned_char yycheck
[] =
614 28, 20, 3, 69, 0, 1, 25, 0, 27, 5,
615 6, 7, 8, 9, 10, 11, 12, 13, 38, 3,
616 4, 41, 36, 36, 90, 67, 3, 46, 42, 48,
617 46, 50, 51, 75, 76, 3, 32, 14, 15, 16,
618 4, 42, 71, 72, 1, 73, 42, 43, 5, 6,
619 7, 8, 9, 10, 11, 12, 13, 37, 37, 37,
620 79, 89, 38, 82, 36, 42, 94, 95, 39, 46,
621 40, 46, 46, 40, 102, 32, 38, 105, 38, 45,
622 3, 36, 4, 111, 2, 42, 5, 6, 7, 8,
623 9, 10, 11, 12, 13, 40, 61, 104, 17, 18,
624 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
625 29, 30, 31, 32, 33, 34, 35, -1, -1, -1,
626 -1, -1, -1, -1, 43, 44
629 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
630 symbol of state STATE-NUM. */
631 static const unsigned char yystos
[] =
633 0, 48, 49, 0, 5, 6, 7, 8, 9, 10,
634 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
635 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
636 34, 35, 43, 44, 50, 51, 54, 57, 58, 56,
637 55, 36, 52, 53, 46, 3, 72, 4, 37, 72,
638 37, 37, 72, 72, 3, 42, 69, 71, 1, 42,
639 51, 63, 64, 65, 38, 74, 36, 59, 36, 42,
640 61, 62, 62, 60, 69, 46, 46, 72, 72, 40,
641 72, 72, 40, 38, 39, 38, 43, 64, 73, 60,
642 4, 71, 61, 69, 60, 60, 72, 72, 66, 45,
643 71, 67, 68, 38, 41, 14, 15, 16, 46, 69,
647 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
648 # define YYSIZE_T __SIZE_TYPE__
650 #if ! defined (YYSIZE_T) && defined (size_t)
651 # define YYSIZE_T size_t
653 #if ! defined (YYSIZE_T)
654 # if defined (__STDC__) || defined (__cplusplus)
655 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
656 # define YYSIZE_T size_t
659 #if ! defined (YYSIZE_T)
660 # define YYSIZE_T unsigned int
663 #define yyerrok (yyerrstatus = 0)
664 #define yyclearin (yychar = YYEMPTY)
668 #define YYACCEPT goto yyacceptlab
669 #define YYABORT goto yyabortlab
670 #define YYERROR goto yyerrlab1
672 /* Like YYERROR except do call yyerror. This remains here temporarily
673 to ease the transition to the new meaning of YYERROR, for GCC.
674 Once GCC version 2 has supplanted version 1, this can go. */
676 #define YYFAIL goto yyerrlab
678 #define YYRECOVERING() (!!yyerrstatus)
680 #define YYBACKUP(Token, Value) \
682 if (yychar == YYEMPTY && yylen == 1) \
686 yychar1 = YYTRANSLATE (yychar); \
692 yyerror ("syntax error: cannot back up"); \
698 #define YYERRCODE 256
700 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
703 #ifndef YYLLOC_DEFAULT
704 # define YYLLOC_DEFAULT(Current, Rhs, N) \
705 Current.first_line = Rhs[1].first_line; \
706 Current.first_column = Rhs[1].first_column; \
707 Current.last_line = Rhs[N].last_line; \
708 Current.last_column = Rhs[N].last_column;
711 /* YYLEX -- calling `yylex' with the right arguments. */
714 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
716 # define YYLEX yylex (&yylval, &yylloc)
719 /* Enable debugging if requested. */
723 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
724 # define YYFPRINTF fprintf
727 # define YYDPRINTF(Args) \
732 # define YYDSYMPRINT(Args) \
737 /* Nonzero means print parse trace. It is left uninitialized so that
738 multiple parsers can coexist. */
741 # define YYDPRINTF(Args)
742 # define YYDSYMPRINT(Args)
743 #endif /* !YYDEBUG */
745 /* YYINITDEPTH -- initial size of the parser's stacks. */
747 # define YYINITDEPTH 200
750 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
751 if the built-in stack extension method is used).
753 Do not make this value too large; the results are undefined if
754 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
755 evaluated with infinite-precision integer arithmetic. */
762 # define YYMAXDEPTH 10000
770 # if defined (__GLIBC__) && defined (_STRING_H)
771 # define yystrlen strlen
773 /* Return the length of YYSTR. */
775 # if defined (__STDC__) || defined (__cplusplus)
776 yystrlen (const char *yystr
)
782 register const char *yys
= yystr
;
784 while (*yys
++ != '\0')
787 return yys
- yystr
- 1;
793 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
794 # define yystpcpy stpcpy
796 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
799 # if defined (__STDC__) || defined (__cplusplus)
800 yystpcpy (char *yydest
, const char *yysrc
)
802 yystpcpy (yydest
, yysrc
)
807 register char *yyd
= yydest
;
808 register const char *yys
= yysrc
;
810 while ((*yyd
++ = *yys
++) != '\0')
818 #endif /* !YYERROR_VERBOSE */
823 /*-----------------------------.
824 | Print this symbol on YYOUT. |
825 `-----------------------------*/
827 #if defined (__STDC__) || defined (__cplusplus)
829 yysymprint (FILE *yyout
, int yytype
, YYSTYPE yyvalue
, YYLTYPE yylocation
)
832 yysymprint (yyout
, yytype
, yyvalue
, yylocation
)
839 /* Pacify ``unused variable'' warnings. */
843 if (yytype
< YYNTOKENS
)
845 YYFPRINTF (yyout
, "token %s (", yytname
[yytype
]);
847 YYPRINT (yyout
, yytoknum
[yytype
], yyvalue
);
851 YYFPRINTF (yyout
, "nterm %s (", yytname
[yytype
]);
858 YYFPRINTF (yyout
, ")");
860 #endif /* YYDEBUG. */
863 /*-----------------------------------------------.
864 | Release the memory associated to this symbol. |
865 `-----------------------------------------------*/
867 #if defined (__STDC__) || defined (__cplusplus)
869 yydestruct (int yytype
, YYSTYPE yyvalue
, YYLTYPE yylocation
)
872 yydestruct (yytype
, yyvalue
, yylocation
)
878 /* Pacify ``unused variable'' warnings. */
891 /* Prevent warnings from -Wmissing-prototypes. */
894 # if defined (__STDC__) || defined (__cplusplus)
895 int yyparse (void *YYPARSE_PARAM
);
899 #else /* ! YYPARSE_PARAM */
900 #if defined (__STDC__) || defined (__cplusplus)
917 # if defined (__STDC__) || defined (__cplusplus)
918 int yyparse (void *YYPARSE_PARAM
)
920 int yyparse (YYPARSE_PARAM
)
923 #else /* ! YYPARSE_PARAM */
924 #if defined (__STDC__) || defined (__cplusplus)
934 /* The lookahead symbol. */
937 /* The semantic value of the lookahead symbol. */
940 /* Number of parse errors so far. */
942 /* Location data for the lookahead symbol. */
945 register int yystate
;
948 /* Number of tokens to shift before error messages enabled. */
950 /* Lookahead token as an internal (translated) token number. */
953 /* Three stacks and their tools:
954 `yyss': related to states,
955 `yyvs': related to semantic values,
956 `yyls': related to locations.
958 Refer to the stacks thru separate pointers, to allow yyoverflow
959 to reallocate them elsewhere. */
961 /* The state stack. */
962 short yyssa
[YYINITDEPTH
];
964 register short *yyssp
;
966 /* The semantic value stack. */
967 YYSTYPE yyvsa
[YYINITDEPTH
];
968 YYSTYPE
*yyvs
= yyvsa
;
969 register YYSTYPE
*yyvsp
;
971 /* The location stack. */
972 YYLTYPE yylsa
[YYINITDEPTH
];
973 YYLTYPE
*yyls
= yylsa
;
976 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
978 YYSIZE_T yystacksize
= YYINITDEPTH
;
980 /* The variables used to return semantic value and location from the
985 /* When reducing, the number of symbols on the RHS of the reduced
989 YYDPRINTF ((stderr
, "Starting parse\n"));
994 yychar
= YYEMPTY
; /* Cause a token to be read. */
996 /* Initialize stack pointers.
997 Waste one element of value and location stack
998 so that they stay on the same level as the state stack.
999 The wasted elements are never initialized. */
1006 /*------------------------------------------------------------.
1007 | yynewstate -- Push a new state, which is found in yystate. |
1008 `------------------------------------------------------------*/
1010 /* In all cases, when you get here, the value and location stacks
1011 have just been pushed. so pushing a state here evens the stacks.
1018 if (yyss
+ yystacksize
- 1 <= yyssp
)
1020 /* Get the current used size of the three stacks, in elements. */
1021 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1025 /* Give user a chance to reallocate the stack. Use copies of
1026 these so that the &'s don't force the real ones into
1028 YYSTYPE
*yyvs1
= yyvs
;
1029 short *yyss1
= yyss
;
1030 YYLTYPE
*yyls1
= yyls
;
1032 /* Each stack pointer address is followed by the size of the
1033 data in use in that stack, in bytes. This used to be a
1034 conditional around just the two extra args, but that might
1035 be undefined if yyoverflow is a macro. */
1036 yyoverflow ("parser stack overflow",
1037 &yyss1
, yysize
* sizeof (*yyssp
),
1038 &yyvs1
, yysize
* sizeof (*yyvsp
),
1039 &yyls1
, yysize
* sizeof (*yylsp
),
1045 #else /* no yyoverflow */
1046 # ifndef YYSTACK_RELOCATE
1049 /* Extend the stack our own way. */
1050 if (YYMAXDEPTH
<= yystacksize
)
1053 if (YYMAXDEPTH
< yystacksize
)
1054 yystacksize
= YYMAXDEPTH
;
1057 short *yyss1
= yyss
;
1058 union yyalloc
*yyptr
=
1059 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1062 YYSTACK_RELOCATE (yyss
);
1063 YYSTACK_RELOCATE (yyvs
);
1064 YYSTACK_RELOCATE (yyls
);
1065 # undef YYSTACK_RELOCATE
1067 YYSTACK_FREE (yyss1
);
1070 #endif /* no yyoverflow */
1072 yyssp
= yyss
+ yysize
- 1;
1073 yyvsp
= yyvs
+ yysize
- 1;
1074 yylsp
= yyls
+ yysize
- 1;
1076 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1077 (unsigned long int) yystacksize
));
1079 if (yyss
+ yystacksize
- 1 <= yyssp
)
1083 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1092 /* Do appropriate processing given the current state. */
1093 /* Read a lookahead token if we need one and don't already have one. */
1096 /* First try to decide what to do without reference to lookahead token. */
1098 yyn
= yypact
[yystate
];
1099 if (yyn
== YYPACT_NINF
)
1102 /* Not known => get a lookahead token if don't already have one. */
1104 /* yychar is either YYEMPTY or YYEOF
1105 or a valid token in external form. */
1107 if (yychar
== YYEMPTY
)
1109 YYDPRINTF ((stderr
, "Reading a token: "));
1113 /* Convert token to internal form (in yychar1) for indexing tables with. */
1115 if (yychar
<= 0) /* This means end of input. */
1118 yychar
= YYEOF
; /* Don't call YYLEX any more. */
1120 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1124 yychar1
= YYTRANSLATE (yychar
);
1126 /* We have to keep this `#if YYDEBUG', since we use variables
1127 which are defined only if `YYDEBUG' is set. */
1128 YYDPRINTF ((stderr
, "Next token is "));
1129 YYDSYMPRINT ((stderr
, yychar1
, yylval
, yyloc
));
1130 YYDPRINTF ((stderr
, "\n"));
1133 /* If the proper action on seeing token YYCHAR1 is to reduce or to
1134 detect an error, take that action. */
1136 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yychar1
)
1141 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1150 /* Shift the lookahead token. */
1151 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1152 yychar
, yytname
[yychar1
]));
1154 /* Discard the token being shifted unless it is eof. */
1155 if (yychar
!= YYEOF
)
1161 /* Count tokens shifted since error; after three, turn off error
1170 /*-----------------------------------------------------------.
1171 | yydefault -- do the default action for the current state. |
1172 `-----------------------------------------------------------*/
1174 yyn
= yydefact
[yystate
];
1180 /*-----------------------------.
1181 | yyreduce -- Do a reduction. |
1182 `-----------------------------*/
1184 /* yyn is the number of a rule to reduce with. */
1187 /* If YYLEN is nonzero, implement the default value of the action:
1190 Otherwise, the following line sets YYVAL to garbage.
1191 This behavior is undocumented and Bison
1192 users should not rely upon it. Assigning to YYVAL
1193 unconditionally makes the parser a bit smaller, and it avoids a
1194 GCC warning that YYVAL may be used uninitialized. */
1195 yyval
= yyvsp
[1-yylen
];
1197 /* Default location. */
1198 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1201 /* We have to keep this `#if YYDEBUG', since we use variables which
1202 are defined only if `YYDEBUG' is set. */
1207 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1208 yyn
- 1, yyrline
[yyn
]);
1210 /* Print the symbols being reduced, and their result. */
1211 for (yyi
= yyprhs
[yyn
]; 0 <= yyrhs
[yyi
]; yyi
++)
1212 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1213 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1219 #line 171 "parse-gram.y"
1221 yycontrol
->errcode
= 0;
1222 epilogue_set (yyvsp
[0].string
, yylsp
[0]);
1227 #line 189 "parse-gram.y"
1228 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1232 #line 190 "parse-gram.y"
1237 #line 191 "parse-gram.y"
1238 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1242 #line 192 "parse-gram.y"
1243 { defines_flag
= 1; }
1247 #line 193 "parse-gram.y"
1248 { error_verbose
= 1; }
1252 #line 194 "parse-gram.y"
1253 { expected_conflicts
= yyvsp
[0].integer
; }
1257 #line 195 "parse-gram.y"
1258 { spec_file_prefix
= yyvsp
[0].string
; }
1262 #line 196 "parse-gram.y"
1267 #line 198 "parse-gram.y"
1268 { muscle_pair_list_grow ("lex_param", yyvsp
[-2].string
, yyvsp
[0].string
); }
1272 #line 199 "parse-gram.y"
1273 { locations_flag
= 1; }
1277 #line 200 "parse-gram.y"
1278 { spec_name_prefix
= yyvsp
[0].string
; }
1282 #line 201 "parse-gram.y"
1283 { no_lines_flag
= 1; }
1287 #line 202 "parse-gram.y"
1288 { spec_outfile
= yyvsp
[0].string
; }
1292 #line 204 "parse-gram.y"
1293 { muscle_pair_list_grow ("parse_param", yyvsp
[-2].string
, yyvsp
[0].string
); }
1297 #line 205 "parse-gram.y"
1298 { pure_parser
= 1; }
1302 #line 206 "parse-gram.y"
1303 { skeleton
= yyvsp
[0].string
; }
1307 #line 207 "parse-gram.y"
1308 { token_table_flag
= 1; }
1312 #line 208 "parse-gram.y"
1313 { report_flag
= 1; }
1317 #line 209 "parse-gram.y"
1322 #line 216 "parse-gram.y"
1324 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1329 #line 220 "parse-gram.y"
1332 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1333 muscle_insert ("stype", yyvsp
[0].string
);
1338 #line 226 "parse-gram.y"
1339 { current_braced_code
= destructor_braced_code
; }
1343 #line 228 "parse-gram.y"
1345 symbol_list_t
*list
;
1346 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1347 symbol_destructor_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1348 symbol_list_free (yyvsp
[0].list
);
1349 current_braced_code
= action_braced_code
;
1354 #line 236 "parse-gram.y"
1355 { current_braced_code
= printer_braced_code
; }
1359 #line 238 "parse-gram.y"
1361 symbol_list_t
*list
;
1362 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1363 symbol_printer_set (list
->sym
, yyvsp
[-1].string
, list
->location
);
1364 symbol_list_free (yyvsp
[0].list
);
1365 current_braced_code
= action_braced_code
;
1370 #line 248 "parse-gram.y"
1371 { current_class
= nterm_sym
; }
1375 #line 249 "parse-gram.y"
1377 current_class
= unknown_sym
;
1378 current_type
= NULL
;
1383 #line 253 "parse-gram.y"
1384 { current_class
= token_sym
; }
1388 #line 254 "parse-gram.y"
1390 current_class
= unknown_sym
;
1391 current_type
= NULL
;
1396 #line 259 "parse-gram.y"
1398 symbol_list_t
*list
;
1399 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1400 symbol_type_set (list
->sym
, yyvsp
[-1].struniq
, yylsp
[-1]);
1401 symbol_list_free (yyvsp
[0].list
);
1406 #line 269 "parse-gram.y"
1408 symbol_list_t
*list
;
1410 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1412 symbol_type_set (list
->sym
, current_type
, yylsp
[-1]);
1413 symbol_precedence_set (list
->sym
, current_prec
, yyvsp
[-2].assoc
, yylsp
[-2]);
1415 symbol_list_free (yyvsp
[0].list
);
1416 current_type
= NULL
;
1421 #line 283 "parse-gram.y"
1422 { yyval
.assoc
= left_assoc
; }
1426 #line 284 "parse-gram.y"
1427 { yyval
.assoc
= right_assoc
; }
1431 #line 285 "parse-gram.y"
1432 { yyval
.assoc
= non_assoc
; }
1436 #line 289 "parse-gram.y"
1437 { current_type
= NULL
; }
1441 #line 290 "parse-gram.y"
1442 { current_type
= yyvsp
[0].struniq
; }
1446 #line 296 "parse-gram.y"
1447 { yyval
.list
= symbol_list_new (yyvsp
[0].symbol
, yylsp
[0]); }
1451 #line 297 "parse-gram.y"
1452 { yyval
.list
= symbol_list_prepend (yyvsp
[-1].list
, yyvsp
[0].symbol
, yylsp
[0]); }
1456 #line 303 "parse-gram.y"
1458 current_type
= yyvsp
[0].struniq
;
1463 #line 307 "parse-gram.y"
1465 symbol_class_set (yyvsp
[0].symbol
, current_class
, yylsp
[0]);
1466 symbol_type_set (yyvsp
[0].symbol
, current_type
, yylsp
[0]);
1471 #line 312 "parse-gram.y"
1473 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1474 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1475 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
, yylsp
[0]);
1480 #line 318 "parse-gram.y"
1482 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1483 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1484 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
, yyloc
);
1489 #line 324 "parse-gram.y"
1491 symbol_class_set (yyvsp
[-2].symbol
, current_class
, yylsp
[-2]);
1492 symbol_type_set (yyvsp
[-2].symbol
, current_type
, yylsp
[-2]);
1493 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
, yylsp
[-1]);
1494 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
, yyloc
);
1499 #line 335 "parse-gram.y"
1504 #line 337 "parse-gram.y"
1509 #line 356 "parse-gram.y"
1512 complain_at (yyloc
, _("POSIX forbids declarations in the grammar"));
1517 #line 361 "parse-gram.y"
1524 #line 367 "parse-gram.y"
1525 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1529 #line 368 "parse-gram.y"
1534 #line 372 "parse-gram.y"
1535 { grammar_rule_end (yylsp
[0]); }
1539 #line 373 "parse-gram.y"
1540 { grammar_rule_end (yylsp
[0]); }
1544 #line 378 "parse-gram.y"
1545 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1549 #line 380 "parse-gram.y"
1550 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1554 #line 382 "parse-gram.y"
1555 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1559 #line 384 "parse-gram.y"
1560 { grammar_current_rule_prec_set (yyvsp
[0].symbol
, yylsp
[0]); }
1564 #line 386 "parse-gram.y"
1565 { grammar_current_rule_dprec_set (yyvsp
[0].integer
, yylsp
[0]); }
1569 #line 388 "parse-gram.y"
1570 { grammar_current_rule_merge_set (yyvsp
[0].struniq
, yylsp
[0]); }
1574 #line 392 "parse-gram.y"
1575 { yyval
.symbol
= yyvsp
[0].symbol
; }
1579 #line 393 "parse-gram.y"
1580 { yyval
.symbol
= yyvsp
[0].symbol
; }
1584 #line 398 "parse-gram.y"
1585 { yyval
.string
= yyvsp
[0].string
; }
1589 #line 404 "parse-gram.y"
1591 yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]);
1592 symbol_class_set (yyval
.symbol
, token_sym
, yylsp
[0]);
1597 #line 413 "parse-gram.y"
1599 yyval
.string
= yyvsp
[0].string
+ 1;
1600 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1605 #line 421 "parse-gram.y"
1607 yyval
.string
= xstrdup ("");
1612 #line 425 "parse-gram.y"
1614 yyval
.string
= yyvsp
[0].string
;
1621 /* Line 1056 of /usr/local/share/bison/yacc.c. */
1622 #line 1623 "parse-gram.c"
1631 short *yyssp1
= yyss
- 1;
1632 YYFPRINTF (stderr
, "state stack now");
1633 while (yyssp1
!= yyssp
)
1634 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1635 YYFPRINTF (stderr
, "\n");
1642 /* Now `shift' the result of the reduction. Determine what state
1643 that goes to, based on the state we popped back to and the rule
1644 number reduced by. */
1648 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1649 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1650 yystate
= yytable
[yystate
];
1652 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1657 /*------------------------------------.
1658 | yyerrlab -- here on detecting error |
1659 `------------------------------------*/
1661 /* If not already recovering from an error, report this error. */
1666 yyn
= yypact
[yystate
];
1668 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
1670 YYSIZE_T yysize
= 0;
1671 int yytype
= YYTRANSLATE (yychar
);
1676 /* Start YYX at -YYN if negative to avoid negative indexes in
1678 for (yyx
= yyn
< 0 ? -yyn
: 0;
1679 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1680 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1681 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1682 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1683 yysize
+= yystrlen (yytname
[yytype
]);
1684 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1687 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1688 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
1693 for (yyx
= yyn
< 0 ? -yyn
: 0;
1694 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1696 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1698 const char *yyq
= ! yycount
? ", expecting " : " or ";
1699 yyp
= yystpcpy (yyp
, yyq
);
1700 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1705 YYSTACK_FREE (yymsg
);
1708 yyerror ("parse error; also virtual memory exhausted");
1711 #endif /* YYERROR_VERBOSE */
1712 yyerror ("parse error");
1717 /*----------------------------------------------------.
1718 | yyerrlab1 -- error raised explicitly by an action. |
1719 `----------------------------------------------------*/
1721 if (yyerrstatus
== 3)
1723 /* If just tried and failed to reuse lookahead token after an
1724 error, discard it. */
1726 /* Return failure if at end of input. */
1727 if (yychar
== YYEOF
)
1729 /* Pop the error token. */
1731 /* Pop the rest of the stack. */
1732 while (yyss
< yyssp
)
1734 YYDPRINTF ((stderr
, "Error: popping "));
1735 YYDSYMPRINT ((stderr
,
1738 YYDPRINTF ((stderr
, "\n"));
1739 yydestruct (yystos
[*yyssp
], *yyvsp
, *yylsp
);
1745 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1746 yychar
, yytname
[yychar1
]));
1747 yydestruct (yychar1
, yylval
, yylloc
);
1751 /* Else will try to reuse lookahead token after shifting the error
1754 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1758 yyn
= yypact
[yystate
];
1759 if (yyn
!= YYPACT_NINF
)
1762 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1770 /* Pop the current state because it cannot handle the error token. */
1774 YYDPRINTF ((stderr
, "Error: popping "));
1775 YYDSYMPRINT ((stderr
,
1776 yystos
[*yyssp
], *yyvsp
, *yylsp
));
1777 YYDPRINTF ((stderr
, "\n"));
1779 yydestruct (yystos
[yystate
], *yyvsp
, *yylsp
);
1787 short *yyssp1
= yyss
- 1;
1788 YYFPRINTF (stderr
, "Error: state stack now");
1789 while (yyssp1
!= yyssp
)
1790 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1791 YYFPRINTF (stderr
, "\n");
1799 YYDPRINTF ((stderr
, "Shifting error token, "));
1808 /*-------------------------------------.
1809 | yyacceptlab -- YYACCEPT comes here. |
1810 `-------------------------------------*/
1815 /*-----------------------------------.
1816 | yyabortlab -- YYABORT comes here. |
1817 `-----------------------------------*/
1823 /*----------------------------------------------.
1824 | yyoverflowlab -- parser overflow comes here. |
1825 `----------------------------------------------*/
1827 yyerror ("parser stack overflow");
1835 YYSTACK_FREE (yyss
);
1841 #line 434 "parse-gram.y"
1843 /*------------------------------------------------------------------.
1844 | When debugging the parser, display tokens' locations and values. |
1845 `------------------------------------------------------------------*/
1848 yyprint (FILE *file
,
1849 int type
, const yystype
*value
)
1855 fprintf (file
, " = %s", value
->symbol
->tag
);
1859 fprintf (file
, " = %d", value
->integer
);
1863 fprintf (file
, " = \"%s\"", value
->string
);
1867 fprintf (file
, " = <%s>", value
->struniq
);
1873 fprintf (file
, " = {{ %s }}", value
->string
);
1879 gram_error (location_t
*yylloc
, const char *msg
)
1881 complain_at (*yylloc
, "%s", msg
);