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 char *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"
240 /* Line 212 of /tmp/prefix/share/bison/yacc.c. */
241 #line 241 "parse-gram.c"
242 # define YYSTYPE yystype
243 # define YYSTYPE_IS_TRIVIAL 1
247 typedef struct yyltype
254 # define YYLTYPE yyltype
255 # define YYLTYPE_IS_TRIVIAL 1
258 /* Copy the second part of user declarations. */
261 /* Line 232 of /tmp/prefix/share/bison/yacc.c. */
262 #line 262 "parse-gram.c"
264 #if ! defined (yyoverflow) || YYERROR_VERBOSE
266 /* The parser invokes alloca or malloc; define the necessary symbols. */
268 # if YYSTACK_USE_ALLOCA
269 # define YYSTACK_ALLOC alloca
271 # ifndef YYSTACK_USE_ALLOCA
272 # if defined (alloca) || defined (_ALLOCA_H)
273 # define YYSTACK_ALLOC alloca
276 # define YYSTACK_ALLOC __builtin_alloca
282 # ifdef YYSTACK_ALLOC
283 /* Pacify GCC's `empty if-body' warning. */
284 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
286 # if defined (__STDC__) || defined (__cplusplus)
287 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
288 # define YYSIZE_T size_t
290 # define YYSTACK_ALLOC malloc
291 # define YYSTACK_FREE free
293 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
296 #if (! defined (yyoverflow) \
297 && (! defined (__cplusplus) \
298 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
300 /* A type that is properly aligned for any stack member. */
308 /* The size of the maximum gap between one aligned stack and the next. */
309 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
311 /* The size of an array large to enough to hold all stacks, each with
313 # define YYSTACK_BYTES(N) \
314 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
315 + 2 * YYSTACK_GAP_MAX)
317 /* Copy COUNT objects from FROM to TO. The source and destination do
321 # define YYCOPY(To, From, Count) \
322 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
324 # define YYCOPY(To, From, Count) \
327 register YYSIZE_T yyi; \
328 for (yyi = 0; yyi < (Count); yyi++) \
329 (To)[yyi] = (From)[yyi]; \
335 /* Relocate STACK from its old location to the new one. The
336 local variables YYSIZE and YYSTACKSIZE give the old and new number of
337 elements in the stack, and YYPTR gives the new location of the
338 stack. Advance YYPTR to a properly aligned location for the next
340 # define YYSTACK_RELOCATE(Stack) \
343 YYSIZE_T yynewbytes; \
344 YYCOPY (&yyptr->Stack, Stack, yysize); \
345 Stack = &yyptr->Stack; \
346 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
347 yyptr += yynewbytes / sizeof (*yyptr); \
353 #if defined (__STDC__) || defined (__cplusplus)
354 typedef signed char yysigned_char
;
356 typedef short yysigned_char
;
359 /* YYFINAL -- State number of the termination state. */
361 /* YYLAST -- Last index in YYTABLE. */
364 /* YYNTOKENS -- Number of terminals. */
366 /* YYNNTS -- Number of nonterminals. */
368 /* YYNRULES -- Number of rules. */
370 /* YYNRULES -- Number of states. */
371 #define YYNSTATES 115
373 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
375 #define YYMAXUTOK 301
377 #define YYTRANSLATE(X) \
378 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
380 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
381 static const unsigned char yytranslate
[] =
383 0, 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, 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, 1, 2, 3, 4,
409 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
410 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
411 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
412 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
417 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
419 static const unsigned char yyprhs
[] =
421 0, 0, 3, 8, 9, 13, 15, 17, 19, 23,
422 25, 27, 30, 34, 36, 41, 43, 47, 49, 53,
423 58, 60, 63, 65, 67, 69, 71, 73, 76, 79,
424 80, 85, 86, 91, 92, 96, 97, 101, 105, 109,
425 111, 113, 115, 116, 118, 120, 123, 125, 127, 130,
426 133, 137, 139, 142, 144, 147, 149, 152, 155, 156,
427 162, 164, 168, 169, 172, 175, 179, 183, 187, 189,
428 191, 193, 195, 197, 198, 201, 202
431 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
432 static const yysigned_char yyrhs
[] =
434 48, 0, -1, 49, 43, 63, 73, -1, -1, 49,
435 50, 74, -1, 51, -1, 44, -1, 17, -1, 18,
436 72, 72, -1, 19, -1, 20, -1, 21, 4, -1,
437 22, 37, 72, -1, 23, -1, 24, 72, 40, 72,
438 -1, 25, -1, 26, 37, 72, -1, 27, -1, 28,
439 37, 72, -1, 29, 72, 40, 72, -1, 30, -1,
440 31, 72, -1, 33, -1, 34, -1, 35, -1, 57,
441 -1, 54, -1, 32, 69, -1, 10, 46, -1, -1,
442 8, 52, 46, 60, -1, -1, 9, 53, 46, 60,
443 -1, -1, 6, 55, 62, -1, -1, 5, 56, 62,
444 -1, 7, 36, 60, -1, 58, 59, 60, -1, 11,
445 -1, 12, -1, 13, -1, -1, 36, -1, 69, -1,
446 60, 69, -1, 36, -1, 42, -1, 42, 4, -1,
447 42, 71, -1, 42, 4, 71, -1, 61, -1, 62,
448 61, -1, 64, -1, 63, 64, -1, 65, -1, 51,
449 38, -1, 1, 38, -1, -1, 42, 39, 66, 67,
450 38, -1, 68, -1, 67, 41, 68, -1, -1, 68,
451 69, -1, 68, 70, -1, 68, 14, 69, -1, 68,
452 15, 4, -1, 68, 16, 36, -1, 42, -1, 71,
453 -1, 46, -1, 3, -1, 3, -1, -1, 43, 45,
457 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
458 static const unsigned short yyrline
[] =
460 0, 167, 167, 180, 182, 185, 187, 188, 189, 190,
461 191, 192, 193, 194, 195, 197, 198, 199, 200, 201,
462 203, 204, 205, 206, 207, 210, 212, 213, 217, 224,
463 223, 234, 233, 246, 245, 251, 251, 256, 265, 280,
464 282, 283, 286, 288, 293, 295, 299, 304, 309, 315,
465 321, 331, 334, 343, 345, 351, 353, 358, 365, 364,
466 369, 371, 374, 377, 379, 381, 383, 385, 389, 391,
467 394, 400, 409, 417, 422, 428, 430
471 #if YYDEBUG || YYERROR_VERBOSE
472 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
473 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
474 static const char *const yytname
[] =
476 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
477 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
478 "\"%printer\"", "\"%union\"", "\"%left\"", "\"%right\"",
479 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%debug\"",
480 "\"%define\"", "\"%defines\"", "\"%error-verbose\"", "\"%expect\"",
481 "\"%file-prefix\"", "\"%glr-parser\"", "\"%lex-param\"",
482 "\"%locations\"", "\"%name-prefix\"", "\"%no-lines\"", "\"%output\"",
483 "\"%parse-param\"", "\"%pure-parser\"", "\"%skeleton\"", "\"%start\"",
484 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"type\"", "\"=\"",
485 "\";\"", "\":\"", "\",\"", "\"|\"", "\"identifier\"", "\"%%\"",
486 "\"%{...%}\"", "\"epilogue\"", "\"{...}\"", "$accept", "input",
487 "declarations", "declaration", "grammar_declaration", "@1", "@2",
488 "symbol_declaration", "@3", "@4", "precedence_declaration",
489 "precedence_declarator", "type.opt", "symbols.1", "symbol_def",
490 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
491 "@5", "rhses.1", "rhs", "symbol", "action", "string_as_id",
492 "string_content", "epilogue.opt", "semi_colon.opt", 0
497 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
499 static const unsigned short yytoknum
[] =
501 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
502 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
503 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
504 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
505 295, 296, 297, 298, 299, 300, 301
509 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
510 static const unsigned char yyr1
[] =
512 0, 47, 48, 49, 49, 50, 50, 50, 50, 50,
513 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
514 50, 50, 50, 50, 50, 51, 51, 51, 51, 52,
515 51, 53, 51, 55, 54, 56, 54, 54, 57, 58,
516 58, 58, 59, 59, 60, 60, 61, 61, 61, 61,
517 61, 62, 62, 63, 63, 64, 64, 64, 66, 65,
518 67, 67, 68, 68, 68, 68, 68, 68, 69, 69,
519 70, 71, 72, 73, 73, 74, 74
522 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
523 static const unsigned char yyr2
[] =
525 0, 2, 4, 0, 3, 1, 1, 1, 3, 1,
526 1, 2, 3, 1, 4, 1, 3, 1, 3, 4,
527 1, 2, 1, 1, 1, 1, 1, 2, 2, 0,
528 4, 0, 4, 0, 3, 0, 3, 3, 3, 1,
529 1, 1, 0, 1, 1, 2, 1, 1, 2, 2,
530 3, 1, 2, 1, 2, 1, 2, 2, 0, 5,
531 1, 3, 0, 2, 2, 3, 3, 3, 1, 1,
535 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
536 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
537 means the default is an error. */
538 static const unsigned char yydefact
[] =
540 3, 0, 0, 1, 35, 33, 0, 29, 31, 0,
541 39, 40, 41, 7, 0, 9, 10, 0, 0, 13,
542 0, 15, 0, 17, 0, 0, 20, 0, 0, 22,
543 23, 24, 0, 6, 75, 5, 26, 25, 42, 0,
544 0, 0, 0, 0, 28, 72, 0, 11, 0, 0,
545 0, 0, 0, 21, 71, 68, 27, 69, 0, 0,
546 0, 0, 53, 55, 76, 4, 43, 0, 46, 47,
547 51, 36, 34, 37, 44, 0, 0, 8, 12, 0,
548 16, 18, 0, 57, 58, 56, 0, 54, 2, 38,
549 48, 49, 52, 45, 30, 32, 14, 19, 62, 74,
550 50, 0, 60, 59, 62, 0, 0, 0, 70, 63,
554 /* YYDEFGOTO[NTERM-NUM]. */
555 static const yysigned_char yydefgoto
[] =
557 -1, 1, 2, 34, 60, 42, 43, 36, 40, 39,
558 37, 38, 67, 73, 70, 71, 61, 62, 63, 98,
559 101, 102, 74, 110, 57, 46, 88, 65
562 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
564 #define YYPACT_NINF -67
565 static const yysigned_char yypact
[] =
567 -67, 7, 81, -67, -67, -67, -13, -67, -67, -16,
568 -67, -67, -67, -67, 32, -67, -67, 36, 20, -67,
569 32, -67, 21, -67, 22, 32, -67, 32, -1, -67,
570 -67, -67, 43, -67, 24, -67, -67, -67, 28, -14,
571 -14, -1, 25, 26, -67, -67, 32, -67, 32, 30,
572 32, 32, 33, -67, -67, -67, -67, -67, 38, 29,
573 40, 4, -67, -67, -67, -67, -67, -1, -67, 16,
574 -67, -14, -14, -1, -67, -1, -1, -67, -67, 32,
575 -67, -67, 32, -67, -67, -67, 34, -67, -67, -1,
576 77, -67, -67, -67, -1, -1, -67, -67, -67, -67,
577 -67, -20, 23, -67, -67, -1, 78, 45, -67, -67,
578 -67, 23, -67, -67, -67
581 /* YYPGOTO[NTERM-NUM]. */
582 static const yysigned_char yypgoto
[] =
584 -67, -67, -67, -67, 82, -67, -67, -67, -67, -67,
585 -67, -67, -67, -42, -29, 55, -67, 35, -67, -67,
586 -67, -7, -28, -67, -66, -19, -67, -67
589 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
590 positive, shift that token. If negative, reduce the rule which
591 number is the opposite. If zero, do what YYDEFACT says.
592 If YYTABLE_NINF, parse error. */
593 #define YYTABLE_NINF -74
594 static const yysigned_char yytable
[] =
596 56, 49, 54, 91, -73, 58, 52, 3, 53, 4,
597 5, 6, 7, 8, 9, 10, 11, 12, 103, 54,
598 90, 104, 68, 41, 100, 89, 54, 77, 69, 78,
599 44, 80, 81, 94, 95, 45, 28, 105, 106, 107,
600 47, 55, 92, 92, 58, 93, 59, 86, 4, 5,
601 6, 7, 8, 9, 10, 11, 12, 48, 50, 51,
602 96, 93, 64, 97, 66, 55, 93, 93, 84, 108,
603 79, 75, 76, 82, 109, 28, 83, 112, 85, 99,
604 54, 114, 113, 109, 35, 59, 4, 5, 6, 7,
605 8, 9, 10, 11, 12, 72, 87, 111, 13, 14,
606 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
607 25, 26, 27, 28, 29, 30, 31, 0, 0, 0,
611 static const yysigned_char yycheck
[] =
613 28, 20, 3, 69, 0, 1, 25, 0, 27, 5,
614 6, 7, 8, 9, 10, 11, 12, 13, 38, 3,
615 4, 41, 36, 36, 90, 67, 3, 46, 42, 48,
616 46, 50, 51, 75, 76, 3, 32, 14, 15, 16,
617 4, 42, 71, 72, 1, 73, 42, 43, 5, 6,
618 7, 8, 9, 10, 11, 12, 13, 37, 37, 37,
619 79, 89, 38, 82, 36, 42, 94, 95, 39, 46,
620 40, 46, 46, 40, 102, 32, 38, 105, 38, 45,
621 3, 36, 4, 111, 2, 42, 5, 6, 7, 8,
622 9, 10, 11, 12, 13, 40, 61, 104, 17, 18,
623 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
624 29, 30, 31, 32, 33, 34, 35, -1, -1, -1,
625 -1, -1, -1, -1, 43, 44
628 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
629 symbol of state STATE-NUM. */
630 static const unsigned char yystos
[] =
632 0, 48, 49, 0, 5, 6, 7, 8, 9, 10,
633 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
634 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
635 34, 35, 43, 44, 50, 51, 54, 57, 58, 56,
636 55, 36, 52, 53, 46, 3, 72, 4, 37, 72,
637 37, 37, 72, 72, 3, 42, 69, 71, 1, 42,
638 51, 63, 64, 65, 38, 74, 36, 59, 36, 42,
639 61, 62, 62, 60, 69, 46, 46, 72, 72, 40,
640 72, 72, 40, 38, 39, 38, 43, 64, 73, 60,
641 4, 71, 61, 69, 60, 60, 72, 72, 66, 45,
642 71, 67, 68, 38, 41, 14, 15, 16, 46, 69,
646 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
647 # define YYSIZE_T __SIZE_TYPE__
649 #if ! defined (YYSIZE_T) && defined (size_t)
650 # define YYSIZE_T size_t
652 #if ! defined (YYSIZE_T)
653 # if defined (__STDC__) || defined (__cplusplus)
654 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
655 # define YYSIZE_T size_t
658 #if ! defined (YYSIZE_T)
659 # define YYSIZE_T unsigned int
662 #define yyerrok (yyerrstatus = 0)
663 #define yyclearin (yychar = YYEMPTY)
667 #define YYACCEPT goto yyacceptlab
668 #define YYABORT goto yyabortlab
669 #define YYERROR goto yyerrlab1
671 /* Like YYERROR except do call yyerror. This remains here temporarily
672 to ease the transition to the new meaning of YYERROR, for GCC.
673 Once GCC version 2 has supplanted version 1, this can go. */
675 #define YYFAIL goto yyerrlab
677 #define YYRECOVERING() (!!yyerrstatus)
679 #define YYBACKUP(Token, Value) \
681 if (yychar == YYEMPTY && yylen == 1) \
685 yychar1 = YYTRANSLATE (yychar); \
691 yyerror ("syntax error: cannot back up"); \
697 #define YYERRCODE 256
699 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
702 #ifndef YYLLOC_DEFAULT
703 # define YYLLOC_DEFAULT(Current, Rhs, N) \
704 Current.first_line = Rhs[1].first_line; \
705 Current.first_column = Rhs[1].first_column; \
706 Current.last_line = Rhs[N].last_line; \
707 Current.last_column = Rhs[N].last_column;
710 /* YYLEX -- calling `yylex' with the right arguments. */
713 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
715 # define YYLEX yylex (&yylval, &yylloc)
718 /* Enable debugging if requested. */
722 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
723 # define YYFPRINTF fprintf
726 # define YYDPRINTF(Args) \
731 # define YYDSYMPRINT(Args) \
736 /* Nonzero means print parse trace. It is left uninitialized so that
737 multiple parsers can coexist. */
740 # define YYDPRINTF(Args)
741 # define YYDSYMPRINT(Args)
742 #endif /* !YYDEBUG */
744 /* YYINITDEPTH -- initial size of the parser's stacks. */
746 # define YYINITDEPTH 200
749 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
750 if the built-in stack extension method is used).
752 Do not make this value too large; the results are undefined if
753 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
754 evaluated with infinite-precision integer arithmetic. */
761 # define YYMAXDEPTH 10000
769 # if defined (__GLIBC__) && defined (_STRING_H)
770 # define yystrlen strlen
772 /* Return the length of YYSTR. */
774 # if defined (__STDC__) || defined (__cplusplus)
775 yystrlen (const char *yystr
)
781 register const char *yys
= yystr
;
783 while (*yys
++ != '\0')
786 return yys
- yystr
- 1;
792 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
793 # define yystpcpy stpcpy
795 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
798 # if defined (__STDC__) || defined (__cplusplus)
799 yystpcpy (char *yydest
, const char *yysrc
)
801 yystpcpy (yydest
, yysrc
)
806 register char *yyd
= yydest
;
807 register const char *yys
= yysrc
;
809 while ((*yyd
++ = *yys
++) != '\0')
817 #endif /* !YYERROR_VERBOSE */
822 /*-----------------------------.
823 | Print this symbol on YYOUT. |
824 `-----------------------------*/
826 #if defined (__STDC__) || defined (__cplusplus)
828 yysymprint (FILE *yyout
, int yytype
, YYSTYPE yyvalue
, YYLTYPE yylocation
)
831 yysymprint (yyout
, yytype
, yyvalue
, yylocation
)
838 /* Pacify ``unused variable'' warnings. */
842 if (yytype
< YYNTOKENS
)
844 YYFPRINTF (yyout
, "token %s (", yytname
[yytype
]);
846 YYPRINT (yyout
, yytoknum
[yytype
], yyvalue
);
850 YYFPRINTF (yyout
, "nterm %s (", yytname
[yytype
]);
857 YYFPRINTF (yyout
, ")");
859 #endif /* YYDEBUG. */
862 /*-----------------------------------------------.
863 | Release the memory associated to this symbol. |
864 `-----------------------------------------------*/
866 #if defined (__STDC__) || defined (__cplusplus)
868 yydestruct (int yytype
, YYSTYPE yyvalue
, YYLTYPE yylocation
)
871 yydestruct (yytype
, yyvalue
, yylocation
)
877 /* Pacify ``unused variable'' warnings. */
890 /* Prevent warnings from -Wmissing-prototypes. */
893 # if defined (__STDC__) || defined (__cplusplus)
894 int yyparse (void *YYPARSE_PARAM
);
898 #else /* ! YYPARSE_PARAM */
899 #if defined (__STDC__) || defined (__cplusplus)
916 # if defined (__STDC__) || defined (__cplusplus)
917 int yyparse (void *YYPARSE_PARAM
)
919 int yyparse (YYPARSE_PARAM
)
922 #else /* ! YYPARSE_PARAM */
923 #if defined (__STDC__) || defined (__cplusplus)
933 /* The lookahead symbol. */
936 /* The semantic value of the lookahead symbol. */
939 /* Number of parse errors so far. */
941 /* Location data for the lookahead symbol. */
944 register int yystate
;
947 /* Number of tokens to shift before error messages enabled. */
949 /* Lookahead token as an internal (translated) token number. */
952 /* Three stacks and their tools:
953 `yyss': related to states,
954 `yyvs': related to semantic values,
955 `yyls': related to locations.
957 Refer to the stacks thru separate pointers, to allow yyoverflow
958 to reallocate them elsewhere. */
960 /* The state stack. */
961 short yyssa
[YYINITDEPTH
];
963 register short *yyssp
;
965 /* The semantic value stack. */
966 YYSTYPE yyvsa
[YYINITDEPTH
];
967 YYSTYPE
*yyvs
= yyvsa
;
968 register YYSTYPE
*yyvsp
;
970 /* The location stack. */
971 YYLTYPE yylsa
[YYINITDEPTH
];
972 YYLTYPE
*yyls
= yylsa
;
975 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
977 YYSIZE_T yystacksize
= YYINITDEPTH
;
979 /* The variables used to return semantic value and location from the
984 /* When reducing, the number of symbols on the RHS of the reduced
988 YYDPRINTF ((stderr
, "Starting parse\n"));
993 yychar
= YYEMPTY
; /* Cause a token to be read. */
995 /* Initialize stack pointers.
996 Waste one element of value and location stack
997 so that they stay on the same level as the state stack.
998 The wasted elements are never initialized. */
1005 /*------------------------------------------------------------.
1006 | yynewstate -- Push a new state, which is found in yystate. |
1007 `------------------------------------------------------------*/
1009 /* In all cases, when you get here, the value and location stacks
1010 have just been pushed. so pushing a state here evens the stacks.
1017 if (yyss
+ yystacksize
- 1 <= yyssp
)
1019 /* Get the current used size of the three stacks, in elements. */
1020 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1024 /* Give user a chance to reallocate the stack. Use copies of
1025 these so that the &'s don't force the real ones into
1027 YYSTYPE
*yyvs1
= yyvs
;
1028 short *yyss1
= yyss
;
1029 YYLTYPE
*yyls1
= yyls
;
1031 /* Each stack pointer address is followed by the size of the
1032 data in use in that stack, in bytes. This used to be a
1033 conditional around just the two extra args, but that might
1034 be undefined if yyoverflow is a macro. */
1035 yyoverflow ("parser stack overflow",
1036 &yyss1
, yysize
* sizeof (*yyssp
),
1037 &yyvs1
, yysize
* sizeof (*yyvsp
),
1038 &yyls1
, yysize
* sizeof (*yylsp
),
1044 #else /* no yyoverflow */
1045 # ifndef YYSTACK_RELOCATE
1048 /* Extend the stack our own way. */
1049 if (YYMAXDEPTH
<= yystacksize
)
1052 if (YYMAXDEPTH
< yystacksize
)
1053 yystacksize
= YYMAXDEPTH
;
1056 short *yyss1
= yyss
;
1057 union yyalloc
*yyptr
=
1058 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1061 YYSTACK_RELOCATE (yyss
);
1062 YYSTACK_RELOCATE (yyvs
);
1063 YYSTACK_RELOCATE (yyls
);
1064 # undef YYSTACK_RELOCATE
1066 YYSTACK_FREE (yyss1
);
1069 #endif /* no yyoverflow */
1071 yyssp
= yyss
+ yysize
- 1;
1072 yyvsp
= yyvs
+ yysize
- 1;
1073 yylsp
= yyls
+ yysize
- 1;
1075 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1076 (unsigned long int) yystacksize
));
1078 if (yyss
+ yystacksize
- 1 <= yyssp
)
1082 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1091 /* Do appropriate processing given the current state. */
1092 /* Read a lookahead token if we need one and don't already have one. */
1095 /* First try to decide what to do without reference to lookahead token. */
1097 yyn
= yypact
[yystate
];
1098 if (yyn
== YYPACT_NINF
)
1101 /* Not known => get a lookahead token if don't already have one. */
1103 /* yychar is either YYEMPTY or YYEOF
1104 or a valid token in external form. */
1106 if (yychar
== YYEMPTY
)
1108 YYDPRINTF ((stderr
, "Reading a token: "));
1112 /* Convert token to internal form (in yychar1) for indexing tables with. */
1114 if (yychar
<= 0) /* This means end of input. */
1117 yychar
= YYEOF
; /* Don't call YYLEX any more. */
1119 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1123 yychar1
= YYTRANSLATE (yychar
);
1125 /* We have to keep this `#if YYDEBUG', since we use variables
1126 which are defined only if `YYDEBUG' is set. */
1127 YYDPRINTF ((stderr
, "Next token is "));
1128 YYDSYMPRINT ((stderr
, yychar1
, yylval
, yyloc
));
1129 YYDPRINTF ((stderr
, "\n"));
1132 /* If the proper action on seeing token YYCHAR1 is to reduce or to
1133 detect an error, take that action. */
1135 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yychar1
)
1140 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1149 /* Shift the lookahead token. */
1150 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1151 yychar
, yytname
[yychar1
]));
1153 /* Discard the token being shifted unless it is eof. */
1154 if (yychar
!= YYEOF
)
1160 /* Count tokens shifted since error; after three, turn off error
1169 /*-----------------------------------------------------------.
1170 | yydefault -- do the default action for the current state. |
1171 `-----------------------------------------------------------*/
1173 yyn
= yydefact
[yystate
];
1179 /*-----------------------------.
1180 | yyreduce -- Do a reduction. |
1181 `-----------------------------*/
1183 /* yyn is the number of a rule to reduce with. */
1186 /* If YYLEN is nonzero, implement the default value of the action:
1189 Otherwise, the following line sets YYVAL to garbage.
1190 This behavior is undocumented and Bison
1191 users should not rely upon it. Assigning to YYVAL
1192 unconditionally makes the parser a bit smaller, and it avoids a
1193 GCC warning that YYVAL may be used uninitialized. */
1194 yyval
= yyvsp
[1-yylen
];
1196 /* Default location. */
1197 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1200 /* We have to keep this `#if YYDEBUG', since we use variables which
1201 are defined only if `YYDEBUG' is set. */
1206 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1207 yyn
- 1, yyrline
[yyn
]);
1209 /* Print the symbols being reduced, and their result. */
1210 for (yyi
= yyprhs
[yyn
]; 0 <= yyrhs
[yyi
]; yyi
++)
1211 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1212 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1218 #line 169 "parse-gram.y"
1220 yycontrol
->errcode
= 0;
1221 epilogue_set (yyvsp
[0].string
, yylsp
[0]);
1226 #line 187 "parse-gram.y"
1227 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1231 #line 188 "parse-gram.y"
1236 #line 189 "parse-gram.y"
1237 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1241 #line 190 "parse-gram.y"
1242 { defines_flag
= 1; }
1246 #line 191 "parse-gram.y"
1247 { error_verbose
= 1; }
1251 #line 192 "parse-gram.y"
1252 { expected_conflicts
= yyvsp
[0].integer
; }
1256 #line 193 "parse-gram.y"
1257 { spec_file_prefix
= yyvsp
[0].string
; }
1261 #line 194 "parse-gram.y"
1266 #line 196 "parse-gram.y"
1267 { muscle_pair_list_grow ("lex_param", yyvsp
[-2].string
, yyvsp
[0].string
); }
1271 #line 197 "parse-gram.y"
1272 { locations_flag
= 1; }
1276 #line 198 "parse-gram.y"
1277 { spec_name_prefix
= yyvsp
[0].string
; }
1281 #line 199 "parse-gram.y"
1282 { no_lines_flag
= 1; }
1286 #line 200 "parse-gram.y"
1287 { spec_outfile
= yyvsp
[0].string
; }
1291 #line 202 "parse-gram.y"
1292 { muscle_pair_list_grow ("parse_param", yyvsp
[-2].string
, yyvsp
[0].string
); }
1296 #line 203 "parse-gram.y"
1297 { pure_parser
= 1; }
1301 #line 204 "parse-gram.y"
1302 { skeleton
= yyvsp
[0].string
; }
1306 #line 205 "parse-gram.y"
1307 { token_table_flag
= 1; }
1311 #line 206 "parse-gram.y"
1312 { report_flag
= 1; }
1316 #line 207 "parse-gram.y"
1321 #line 214 "parse-gram.y"
1323 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1328 #line 218 "parse-gram.y"
1331 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1332 muscle_insert ("stype", yyvsp
[0].string
);
1337 #line 224 "parse-gram.y"
1338 { current_braced_code
= destructor_braced_code
; }
1342 #line 226 "parse-gram.y"
1344 symbol_list_t
*list
;
1345 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1346 symbol_destructor_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1347 symbol_list_free (yyvsp
[0].list
);
1348 current_braced_code
= action_braced_code
;
1353 #line 234 "parse-gram.y"
1354 { current_braced_code
= printer_braced_code
; }
1358 #line 236 "parse-gram.y"
1360 symbol_list_t
*list
;
1361 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1362 symbol_printer_set (list
->sym
, yyvsp
[-1].string
, list
->location
);
1363 symbol_list_free (yyvsp
[0].list
);
1364 current_braced_code
= action_braced_code
;
1369 #line 246 "parse-gram.y"
1370 { current_class
= nterm_sym
; }
1374 #line 247 "parse-gram.y"
1376 current_class
= unknown_sym
;
1377 current_type
= NULL
;
1382 #line 251 "parse-gram.y"
1383 { current_class
= token_sym
; }
1387 #line 252 "parse-gram.y"
1389 current_class
= unknown_sym
;
1390 current_type
= NULL
;
1395 #line 257 "parse-gram.y"
1397 symbol_list_t
*list
;
1398 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1399 symbol_type_set (list
->sym
, yyvsp
[-1].string
, yylsp
[-1]);
1400 symbol_list_free (yyvsp
[0].list
);
1405 #line 267 "parse-gram.y"
1407 symbol_list_t
*list
;
1409 for (list
= yyvsp
[0].list
; list
; list
= list
->next
)
1411 symbol_type_set (list
->sym
, current_type
, yylsp
[-1]);
1412 symbol_precedence_set (list
->sym
, current_prec
, yyvsp
[-2].assoc
, yylsp
[-2]);
1414 symbol_list_free (yyvsp
[0].list
);
1415 current_type
= NULL
;
1420 #line 281 "parse-gram.y"
1421 { yyval
.assoc
= left_assoc
; }
1425 #line 282 "parse-gram.y"
1426 { yyval
.assoc
= right_assoc
; }
1430 #line 283 "parse-gram.y"
1431 { yyval
.assoc
= non_assoc
; }
1435 #line 287 "parse-gram.y"
1436 { current_type
= NULL
; }
1440 #line 288 "parse-gram.y"
1441 { current_type
= yyvsp
[0].string
; }
1445 #line 294 "parse-gram.y"
1446 { yyval
.list
= symbol_list_new (yyvsp
[0].symbol
, yylsp
[0]); }
1450 #line 295 "parse-gram.y"
1451 { yyval
.list
= symbol_list_prepend (yyvsp
[-1].list
, yyvsp
[0].symbol
, yylsp
[0]); }
1455 #line 301 "parse-gram.y"
1457 current_type
= yyvsp
[0].string
;
1462 #line 305 "parse-gram.y"
1464 symbol_class_set (yyvsp
[0].symbol
, current_class
, yylsp
[0]);
1465 symbol_type_set (yyvsp
[0].symbol
, current_type
, yylsp
[0]);
1470 #line 310 "parse-gram.y"
1472 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1473 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1474 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
, yylsp
[0]);
1479 #line 316 "parse-gram.y"
1481 symbol_class_set (yyvsp
[-1].symbol
, current_class
, yylsp
[-1]);
1482 symbol_type_set (yyvsp
[-1].symbol
, current_type
, yylsp
[-1]);
1483 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
, yyloc
);
1488 #line 322 "parse-gram.y"
1490 symbol_class_set (yyvsp
[-2].symbol
, current_class
, yylsp
[-2]);
1491 symbol_type_set (yyvsp
[-2].symbol
, current_type
, yylsp
[-2]);
1492 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
, yylsp
[-1]);
1493 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
, yyloc
);
1498 #line 333 "parse-gram.y"
1503 #line 335 "parse-gram.y"
1508 #line 354 "parse-gram.y"
1511 complain_at (yyloc
, _("POSIX forbids declarations in the grammar"));
1516 #line 359 "parse-gram.y"
1523 #line 365 "parse-gram.y"
1524 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1528 #line 366 "parse-gram.y"
1533 #line 370 "parse-gram.y"
1534 { grammar_rule_end (yylsp
[0]); }
1538 #line 371 "parse-gram.y"
1539 { grammar_rule_end (yylsp
[0]); }
1543 #line 376 "parse-gram.y"
1544 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1548 #line 378 "parse-gram.y"
1549 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1553 #line 380 "parse-gram.y"
1554 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1558 #line 382 "parse-gram.y"
1559 { grammar_current_rule_prec_set (yyvsp
[0].symbol
, yylsp
[0]); }
1563 #line 384 "parse-gram.y"
1564 { grammar_current_rule_dprec_set (yyvsp
[0].integer
, yylsp
[0]); }
1568 #line 386 "parse-gram.y"
1569 { grammar_current_rule_merge_set (yyvsp
[0].string
, yylsp
[0]); }
1573 #line 390 "parse-gram.y"
1574 { yyval
.symbol
= yyvsp
[0].symbol
; }
1578 #line 391 "parse-gram.y"
1579 { yyval
.symbol
= yyvsp
[0].symbol
; }
1583 #line 396 "parse-gram.y"
1584 { yyval
.string
= yyvsp
[0].string
; }
1588 #line 402 "parse-gram.y"
1590 yyval
.symbol
= symbol_get (yyvsp
[0].string
, yylsp
[0]);
1591 symbol_class_set (yyval
.symbol
, token_sym
, yylsp
[0]);
1596 #line 411 "parse-gram.y"
1598 yyval
.string
= yyvsp
[0].string
+ 1;
1599 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1604 #line 419 "parse-gram.y"
1606 yyval
.string
= xstrdup ("");
1611 #line 423 "parse-gram.y"
1613 yyval
.string
= yyvsp
[0].string
;
1620 /* Line 1031 of /tmp/prefix/share/bison/yacc.c. */
1621 #line 1621 "parse-gram.c"
1630 short *yyssp1
= yyss
- 1;
1631 YYFPRINTF (stderr
, "state stack now");
1632 while (yyssp1
!= yyssp
)
1633 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1634 YYFPRINTF (stderr
, "\n");
1641 /* Now `shift' the result of the reduction. Determine what state
1642 that goes to, based on the state we popped back to and the rule
1643 number reduced by. */
1647 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1648 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1649 yystate
= yytable
[yystate
];
1651 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1656 /*------------------------------------.
1657 | yyerrlab -- here on detecting error |
1658 `------------------------------------*/
1660 /* If not already recovering from an error, report this error. */
1665 yyn
= yypact
[yystate
];
1667 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
1669 YYSIZE_T yysize
= 0;
1670 int yytype
= YYTRANSLATE (yychar
);
1675 /* Start YYX at -YYN if negative to avoid negative indexes in
1677 for (yyx
= yyn
< 0 ? -yyn
: 0;
1678 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1679 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1680 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1681 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1682 yysize
+= yystrlen (yytname
[yytype
]);
1683 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1686 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1687 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
1692 for (yyx
= yyn
< 0 ? -yyn
: 0;
1693 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1695 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1697 const char *yyq
= ! yycount
? ", expecting " : " or ";
1698 yyp
= yystpcpy (yyp
, yyq
);
1699 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1704 YYSTACK_FREE (yymsg
);
1707 yyerror ("parse error; also virtual memory exhausted");
1710 #endif /* YYERROR_VERBOSE */
1711 yyerror ("parse error");
1716 /*----------------------------------------------------.
1717 | yyerrlab1 -- error raised explicitly by an action. |
1718 `----------------------------------------------------*/
1720 if (yyerrstatus
== 3)
1722 /* If just tried and failed to reuse lookahead token after an
1723 error, discard it. */
1725 /* Return failure if at end of input. */
1726 if (yychar
== YYEOF
)
1728 /* Pop the error token. */
1730 /* Pop the rest of the stack. */
1731 while (yyss
< yyssp
)
1733 YYDPRINTF ((stderr
, "Error: popping "));
1734 YYDSYMPRINT ((stderr
,
1737 YYDPRINTF ((stderr
, "\n"));
1738 yydestruct (yystos
[*yyssp
], *yyvsp
, *yylsp
);
1744 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1745 yychar
, yytname
[yychar1
]));
1746 yydestruct (yychar1
, yylval
, yylloc
);
1750 /* Else will try to reuse lookahead token after shifting the error
1753 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1757 yyn
= yypact
[yystate
];
1758 if (yyn
!= YYPACT_NINF
)
1761 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1769 /* Pop the current state because it cannot handle the error token. */
1773 YYDPRINTF ((stderr
, "Error: popping "));
1774 YYDSYMPRINT ((stderr
,
1775 yystos
[*yyssp
], *yyvsp
, *yylsp
));
1776 YYDPRINTF ((stderr
, "\n"));
1778 yydestruct (yystos
[yystate
], *yyvsp
, *yylsp
);
1786 short *yyssp1
= yyss
- 1;
1787 YYFPRINTF (stderr
, "Error: state stack now");
1788 while (yyssp1
!= yyssp
)
1789 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1790 YYFPRINTF (stderr
, "\n");
1798 YYDPRINTF ((stderr
, "Shifting error token, "));
1807 /*-------------------------------------.
1808 | yyacceptlab -- YYACCEPT comes here. |
1809 `-------------------------------------*/
1814 /*-----------------------------------.
1815 | yyabortlab -- YYABORT comes here. |
1816 `-----------------------------------*/
1822 /*----------------------------------------------.
1823 | yyoverflowlab -- parser overflow comes here. |
1824 `----------------------------------------------*/
1826 yyerror ("parser stack overflow");
1834 YYSTACK_FREE (yyss
);
1840 #line 432 "parse-gram.y"
1842 /*------------------------------------------------------------------.
1843 | When debugging the parser, display tokens' locations and values. |
1844 `------------------------------------------------------------------*/
1847 yyprint (FILE *file
,
1848 int type
, const yystype
*value
)
1854 fprintf (file
, " = %s", value
->symbol
->tag
);
1858 fprintf (file
, " = %d", value
->integer
);
1862 fprintf (file
, " = \"%s\"", value
->string
);
1866 fprintf (file
, " = <%s>", value
->string
);
1872 fprintf (file
, " = {{ %s }}", value
->string
);
1878 gram_error (location_t
*yylloc
, const char *msg
)
1880 complain_at (*yylloc
, "%s", msg
);