1 /* A Bison parser, made from parse-gram.y
4 /* Skeleton output parser for Bison,
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* As a special exception, when this file is copied by Bison into a
24 Bison output file, you may use that output file without restriction.
25 This special exception was added by the Free Software Foundation
26 in version 1.24 of Bison. */
28 /* This is the parser code that is written into each bison parser when
29 the %semantic_parser declaration is not specified in the grammar.
30 It was written by Richard Stallman by simplifying the original so
31 called ``semantic'' parser. */
33 /* All symbols defined below should begin with yy or YY, to avoid
34 infringing on user name space. This should be done even for local
35 variables, as they might otherwise be expanded by user macros.
36 There are some unavoidable exceptions within include files to
37 define necessary library symbols; they are noted "INFRINGES ON
38 USER NAME SPACE" below. */
40 /* Identify Bison output. */
46 /* Using locations. */
47 #define YYLSP_NEEDED 1
49 /* If NAME_PREFIX is specified substitute the variables and functions
51 #define yyparse gram_parse
52 #define yylex gram_lex
53 #define yyerror gram_error
54 #define yylval gram_lval
55 #define yychar gram_char
56 #define yydebug gram_debug
57 #define yynerrs gram_nerrs
59 # define yylloc gram_lloc
63 /* Copy the first part of user declarations. */
64 #line 31 "parse-gram.y"
67 #include "muscle_tab.h"
73 #include "conflicts.h"
75 /* Produce verbose parse errors. */
76 #define YYERROR_VERBOSE 1
77 #define YYLLOC_DEFAULT(Current, Rhs, N) \
81 Current.first_column = Rhs[1].first_column; \
82 Current.first_line = Rhs[1].first_line; \
83 Current.last_column = Rhs[N].last_column; \
84 Current.last_line = Rhs[N].last_line; \
92 /* Pass the control structure to YYPARSE and YYLEX. */
93 #define YYPARSE_PARAM gram_control
94 #define YYLEX_PARAM gram_control
95 /* YYPARSE receives GRAM_CONTROL as a void *. Provide a
96 correctly typed access to it. */
97 #define yycontrol ((gram_control_t *) gram_control)
99 /* Request detailed parse error messages, and pass them to
102 #define yyerror(Msg) \
103 gram_error (yycontrol, &yylloc, Msg)
105 /* When debugging our pure parser, we want to see values and locations
107 #define YYPRINT(File, Type, Value) \
108 yyprint (File, &yylloc, Type, &Value)
109 static void yyprint (FILE *file
, const location_t
*loc
,
110 int type
, const yystype
*value
);
112 symbol_class current_class
= unknown_sym
;
113 char *current_type
= 0;
114 symbol_t
*current_lhs
;
115 location_t current_lhs_location
;
116 associativity current_assoc
;
117 int current_prec
= 0;
122 # if defined (__STDC__) || defined (__cplusplus)
123 /* Put the tokens into the symbol table, so that GDB and other debuggers
136 PERCENT_NONASSOC
= 267,
137 PERCENT_EXPECT
= 268,
140 PERCENT_VERBOSE
= 271,
141 PERCENT_ERROR_VERBOSE
= 272,
142 PERCENT_OUTPUT
= 273,
143 PERCENT_FILE_PREFIX
= 274,
144 PERCENT_NAME_PREFIX
= 275,
145 PERCENT_DEFINE
= 276,
146 PERCENT_PURE_PARSER
= 277,
147 PERCENT_DEFINES
= 278,
150 PERCENT_LOCATIONS
= 281,
151 PERCENT_NO_LINES
= 282,
152 PERCENT_SKELETON
= 283,
153 PERCENT_TOKEN_TABLE
= 284,
160 PERCENT_PERCENT
= 291,
166 /* POSIX requires `int' for tokens in interfaces. */
167 # define YYTOKENTYPE int
168 #endif /* !YYTOKENTYPE */
171 #define CHARACTER 259
173 #define PERCENT_TOKEN 261
174 #define PERCENT_NTERM 262
175 #define PERCENT_TYPE 263
176 #define PERCENT_UNION 264
177 #define PERCENT_LEFT 265
178 #define PERCENT_RIGHT 266
179 #define PERCENT_NONASSOC 267
180 #define PERCENT_EXPECT 268
181 #define PERCENT_START 269
182 #define PERCENT_PREC 270
183 #define PERCENT_VERBOSE 271
184 #define PERCENT_ERROR_VERBOSE 272
185 #define PERCENT_OUTPUT 273
186 #define PERCENT_FILE_PREFIX 274
187 #define PERCENT_NAME_PREFIX 275
188 #define PERCENT_DEFINE 276
189 #define PERCENT_PURE_PARSER 277
190 #define PERCENT_DEFINES 278
191 #define PERCENT_YACC 279
192 #define PERCENT_DEBUG 280
193 #define PERCENT_LOCATIONS 281
194 #define PERCENT_NO_LINES 282
195 #define PERCENT_SKELETON 283
196 #define PERCENT_TOKEN_TABLE 284
199 #define SEMICOLON 287
203 #define PERCENT_PERCENT 291
206 #define BRACED_CODE 294
211 /* Enabling traces. */
216 /* Enabling verbose error messages. */
217 #ifdef YYERROR_VERBOSE
218 # undef YYERROR_VERBOSE
219 # define YYERROR_VERBOSE 1
221 # define YYERROR_VERBOSE 0
225 #line 89 "parse-gram.y"
232 /* Line 199 of /usr/local/share/bison/bison.simple. */
233 #line 234 "parse-gram.c"
234 # define YYSTYPE yystype
235 # define YYSTYPE_IS_TRIVIAL 1
239 typedef struct yyltype
246 # define YYLTYPE yyltype
247 # define YYLTYPE_IS_TRIVIAL 1
250 /* Copy the second part of user declarations. */
253 /* Line 219 of /usr/local/share/bison/bison.simple. */
254 #line 255 "parse-gram.c"
256 #if ! defined (yyoverflow) || YYERROR_VERBOSE
258 /* The parser invokes alloca or malloc; define the necessary symbols. */
260 # if YYSTACK_USE_ALLOCA
261 # define YYSTACK_ALLOC alloca
263 # ifndef YYSTACK_USE_ALLOCA
264 # if defined (alloca) || defined (_ALLOCA_H)
265 # define YYSTACK_ALLOC alloca
268 # define YYSTACK_ALLOC __builtin_alloca
274 # ifdef YYSTACK_ALLOC
275 /* Pacify GCC's `empty if-body' warning. */
276 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
278 # if defined (__STDC__) || defined (__cplusplus)
279 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
280 # define YYSIZE_T size_t
282 # define YYSTACK_ALLOC malloc
283 # define YYSTACK_FREE free
285 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
288 #if (! defined (yyoverflow) \
289 && (! defined (__cplusplus) \
290 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
292 /* A type that is properly aligned for any stack member. */
302 /* The size of the maximum gap between one aligned stack and the next. */
303 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
305 /* The size of an array large to enough to hold all stacks, each with
308 # define YYSTACK_BYTES(N) \
309 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
310 + 2 * YYSTACK_GAP_MAX)
312 # define YYSTACK_BYTES(N) \
313 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
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 /* YYFINAL -- State number of the termination state. */
355 #define YYFLAG -32768
358 /* YYNTOKENS -- Number of terminals. */
360 /* YYNNTS -- Number of nonterminals. */
362 /* YYNRULES -- Number of rules. */
364 /* YYNRULES -- Number of states. */
367 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
369 #define YYMAXUTOK 294
371 #define YYTRANSLATE(X) \
372 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
374 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
375 static const unsigned char yytranslate
[] =
377 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
378 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
379 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
403 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
404 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
405 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
410 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
412 static const unsigned char yyprhs
[] =
414 0, 0, 3, 8, 9, 13, 15, 17, 19, 23,
415 25, 27, 30, 34, 36, 40, 42, 46, 48, 51,
416 53, 55, 57, 59, 61, 64, 67, 68, 72, 73,
417 77, 78, 83, 84, 89, 91, 93, 95, 96, 98,
418 100, 103, 105, 108, 110, 112, 115, 118, 122, 124,
419 127, 129, 132, 134, 137, 138, 144, 146, 150, 151,
420 154, 157, 161, 163, 165, 167, 169, 171, 173, 174,
424 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
425 static const signed char yyrhs
[] =
427 41, 0, -1, 42, 36, 57, 67, -1, -1, 42,
428 43, 68, -1, 44, -1, 37, -1, 25, -1, 21,
429 66, 66, -1, 23, -1, 17, -1, 13, 5, -1,
430 19, 31, 66, -1, 26, -1, 20, 31, 66, -1,
431 27, -1, 18, 31, 66, -1, 22, -1, 28, 66,
432 -1, 29, -1, 16, -1, 24, -1, 49, -1, 45,
433 -1, 14, 63, -1, 9, 39, -1, -1, 7, 46,
434 56, -1, -1, 6, 47, 56, -1, -1, 8, 30,
435 48, 53, -1, -1, 51, 52, 50, 54, -1, 10,
436 -1, 11, -1, 12, -1, -1, 30, -1, 35, -1,
437 53, 35, -1, 63, -1, 54, 63, -1, 30, -1,
438 35, -1, 35, 5, -1, 35, 65, -1, 35, 5,
439 65, -1, 55, -1, 56, 55, -1, 58, -1, 57,
440 58, -1, 59, -1, 44, 32, -1, -1, 35, 33,
441 60, 61, 32, -1, 62, -1, 61, 34, 62, -1,
442 -1, 62, 63, -1, 62, 64, -1, 62, 15, 63,
443 -1, 35, -1, 65, -1, 4, -1, 39, -1, 3,
444 -1, 3, -1, -1, 36, 38, -1, -1, 32, -1
447 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
448 static const unsigned short yyrline
[] =
450 0, 150, 150, 163, 165, 168, 170, 171, 172, 173,
451 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
452 184, 185, 188, 190, 191, 195, 203, 203, 209, 209,
453 214, 214, 220, 220, 227, 229, 230, 233, 235, 239,
454 241, 245, 251, 259, 264, 269, 275, 281, 291, 294,
455 303, 305, 311, 313, 316, 316, 321, 323, 326, 329,
456 331, 333, 337, 339, 340, 343, 349, 358, 366, 371,
461 #if YYDEBUG || YYERROR_VERBOSE
462 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
463 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
464 static const char *const yytname
[] =
466 "\"end of string\"", "error", "$undefined.", "STRING", "CHARACTER", "INT",
467 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%union\"", "\"%left\"",
468 "\"%right\"", "\"%nonassoc\"", "\"%expect\"", "\"%start\"", "\"%prec\"",
469 "\"%verbose\"", "\"%error-verbose\"", "\"%output\"", "\"%file-prefix\"",
470 "\"%name-prefix\"", "\"%define\"", "\"%pure-parser\"", "\"%defines\"",
471 "\"%yacc\"", "\"%debug\"", "\"%locations\"", "\"%no-lines\"",
472 "\"%skeleton\"", "\"%token-table\"", "TYPE", "\"=\"", "\";\"", "\":\"",
473 "\"|\"", "\"identifier\"", "\"%%\"", "PROLOGUE", "EPILOGUE",
474 "BRACED_CODE", "$axiom", "input", "declarations", "declaration",
475 "grammar_declaration", "symbol_declaration", "@1", "@2", "@3",
476 "precedence_declaration", "@4", "precedence_declarator", "type.opt",
477 "nterms_to_type.1", "terms_to_prec.1", "symbol_def", "symbol_defs.1",
478 "grammar", "rules_or_grammar_declaration", "rules", "@5", "rhses.1",
479 "rhs", "symbol", "action", "string_as_id", "string_content",
480 "epilogue.opt", "semi_colon.opt", 0
484 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
486 static const short yytoknum
[] =
488 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
489 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
490 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
491 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
495 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
496 static const unsigned char yyr1
[] =
498 0, 40, 41, 42, 42, 43, 43, 43, 43, 43,
499 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
500 43, 43, 44, 44, 44, 44, 46, 45, 47, 45,
501 48, 45, 50, 49, 51, 51, 51, 52, 52, 53,
502 53, 54, 54, 55, 55, 55, 55, 55, 56, 56,
503 57, 57, 58, 58, 60, 59, 61, 61, 62, 62,
504 62, 62, 63, 63, 63, 64, 65, 66, 67, 67,
508 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
509 static const unsigned char yyr2
[] =
511 0, 2, 4, 0, 3, 1, 1, 1, 3, 1,
512 1, 2, 3, 1, 3, 1, 3, 1, 2, 1,
513 1, 1, 1, 1, 2, 2, 0, 3, 0, 3,
514 0, 4, 0, 4, 1, 1, 1, 0, 1, 1,
515 2, 1, 2, 1, 1, 2, 2, 3, 1, 2,
516 1, 2, 1, 2, 0, 5, 1, 3, 0, 2,
517 2, 3, 1, 1, 1, 1, 1, 1, 0, 2,
521 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
522 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
523 means the default is an error. */
524 static const short yydefact
[] =
526 3, 0, 0, 0, 28, 26, 0, 0, 34, 35,
527 36, 0, 0, 20, 10, 0, 0, 0, 0, 17,
528 9, 21, 7, 13, 15, 0, 19, 0, 6, 70,
529 5, 23, 22, 37, 0, 0, 30, 25, 11, 66,
530 64, 62, 24, 63, 0, 0, 0, 67, 0, 18,
531 0, 0, 68, 50, 52, 71, 4, 38, 32, 43,
532 44, 48, 29, 27, 0, 16, 12, 14, 8, 54,
533 53, 0, 51, 2, 0, 45, 46, 49, 39, 31,
534 58, 69, 33, 41, 47, 40, 0, 56, 42, 55,
535 58, 0, 65, 59, 60, 57, 61
538 /* YYPGOTO[NTERM-NUM]. */
539 static const short yydefgoto
[] =
541 -1, 1, 2, 29, 51, 31, 35, 34, 64, 32,
542 74, 33, 58, 79, 82, 61, 62, 52, 53, 54,
543 80, 86, 87, 93, 94, 43, 48, 73, 56
546 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
548 static const short yypact
[] =
550 -32768, 9, 32,-32768,-32768,-32768, -13, -9,-32768,-32768,
551 -32768, 27, 0,-32768,-32768, 3, 5, 33, 60,-32768,
552 -32768,-32768,-32768,-32768,-32768, 60,-32768, 12,-32768, 34,
553 -32768,-32768,-32768, 35, -24, -24,-32768,-32768,-32768,-32768,
554 -32768,-32768,-32768,-32768, 60, 60, 60,-32768, 60,-32768,
555 38, 49, 66,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
556 2,-32768, -24, -24, 47,-32768,-32768,-32768,-32768,-32768,
557 -32768, 29,-32768,-32768, 0, 80,-32768,-32768,-32768, 50,
558 -32768,-32768, 0,-32768,-32768,-32768, -20, -2,-32768,-32768,
559 -32768, 0,-32768,-32768,-32768, -2,-32768
562 /* YYPGOTO[NTERM-NUM]. */
563 static const short yypgoto
[] =
565 -32768,-32768,-32768,-32768, 82,-32768,-32768,-32768,-32768,-32768,
566 -32768,-32768,-32768,-32768,-32768, -47, 51,-32768, 36,-32768,
567 -32768,-32768, -3, -12,-32768, -50, -17,-32768,-32768
570 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
571 positive, shift that token. If negative, reduce the rule which
572 number is the opposite. If zero, do what YYDEFACT says. */
573 static const short yytable
[] =
575 42, 39, 40, 39, 40, 39, 59, 75, 49, 3,
576 76, 60, 89, 91, 90, 77, 77, 36, 4, 5,
577 6, 7, 8, 9, 10, 84, 12, 65, 66, 67,
578 37, 68, 38, 41, 44, 41, 45, 92, 4, 5,
579 6, 7, 8, 9, 10, 11, 12, 50, 13, 14,
580 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
581 25, 26, 83, 47, 46, 57, 55, 81, 27, 28,
582 88, 69, 4, 5, 6, 7, 8, 9, 10, 96,
583 12, 70, 78, 39, 30, 85, 63, 95, 72, 0,
584 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
588 static const short yycheck
[] =
590 12, 3, 4, 3, 4, 3, 30, 5, 25, 0,
591 60, 35, 32, 15, 34, 62, 63, 30, 6, 7,
592 8, 9, 10, 11, 12, 75, 14, 44, 45, 46,
593 39, 48, 5, 35, 31, 35, 31, 39, 6, 7,
594 8, 9, 10, 11, 12, 13, 14, 35, 16, 17,
595 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
596 28, 29, 74, 3, 31, 30, 32, 38, 36, 37,
597 82, 33, 6, 7, 8, 9, 10, 11, 12, 91,
598 14, 32, 35, 3, 2, 35, 35, 90, 52, -1,
599 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
604 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
605 symbol of state STATE-NUM. */
606 static const unsigned char yystos
[] =
608 0, 41, 42, 0, 6, 7, 8, 9, 10, 11,
609 12, 13, 14, 16, 17, 18, 19, 20, 21, 22,
610 23, 24, 25, 26, 27, 28, 29, 36, 37, 43,
611 44, 45, 49, 51, 47, 46, 30, 39, 5, 3,
612 4, 35, 63, 65, 31, 31, 31, 3, 66, 66,
613 35, 44, 57, 58, 59, 32, 68, 30, 52, 30,
614 35, 55, 56, 56, 48, 66, 66, 66, 66, 33,
615 32, 36, 58, 67, 50, 5, 65, 55, 35, 53,
616 60, 38, 54, 63, 65, 35, 61, 62, 63, 32,
617 34, 15, 39, 63, 64, 62, 63
621 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
622 # define YYSIZE_T __SIZE_TYPE__
624 #if ! defined (YYSIZE_T) && defined (size_t)
625 # define YYSIZE_T size_t
627 #if ! defined (YYSIZE_T)
628 # if defined (__STDC__) || defined (__cplusplus)
629 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
630 # define YYSIZE_T size_t
633 #if ! defined (YYSIZE_T)
634 # define YYSIZE_T unsigned int
637 #define yyerrok (yyerrstatus = 0)
638 #define yyclearin (yychar = YYEMPTY)
642 #define YYACCEPT goto yyacceptlab
643 #define YYABORT goto yyabortlab
644 #define YYERROR goto yyerrlab1
646 /* Like YYERROR except do call yyerror. This remains here temporarily
647 to ease the transition to the new meaning of YYERROR, for GCC.
648 Once GCC version 2 has supplanted version 1, this can go. */
650 #define YYFAIL goto yyerrlab
652 #define YYRECOVERING() (!!yyerrstatus)
654 #define YYBACKUP(Token, Value) \
656 if (yychar == YYEMPTY && yylen == 1) \
660 yychar1 = YYTRANSLATE (yychar); \
666 yyerror ("syntax error: cannot back up"); \
672 #define YYERRCODE 256
674 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
677 #ifndef YYLLOC_DEFAULT
678 # define YYLLOC_DEFAULT(Current, Rhs, N) \
679 Current.first_line = Rhs[1].first_line; \
680 Current.first_column = Rhs[1].first_column; \
681 Current.last_line = Rhs[N].last_line; \
682 Current.last_column = Rhs[N].last_column;
685 /* YYLEX -- calling `yylex' with the right arguments. */
690 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
692 # define YYLEX yylex (&yylval, &yylloc)
694 # else /* !YYLSP_NEEDED */
696 # define YYLEX yylex (&yylval, YYLEX_PARAM)
698 # define YYLEX yylex (&yylval)
700 # endif /* !YYLSP_NEEDED */
702 # define YYLEX yylex ()
705 /* Enable debugging if requested. */
709 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
710 # define YYFPRINTF fprintf
713 # define YYDPRINTF(Args) \
718 /* Nonzero means print parse trace. It is left uninitialized so that
719 multiple parsers can coexist. */
722 # define YYDPRINTF(Args)
723 #endif /* !YYDEBUG */
725 /* YYINITDEPTH -- initial size of the parser's stacks. */
727 # define YYINITDEPTH 200
730 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
731 if the built-in stack extension method is used).
733 Do not make this value too large; the results are undefined if
734 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
735 evaluated with infinite-precision integer arithmetic. */
742 # define YYMAXDEPTH 10000
750 # if defined (__GLIBC__) && defined (_STRING_H)
751 # define yystrlen strlen
753 /* Return the length of YYSTR. */
755 # if defined (__STDC__) || defined (__cplusplus)
756 yystrlen (const char *yystr
)
762 register const char *yys
= yystr
;
764 while (*yys
++ != '\0')
767 return yys
- yystr
- 1;
773 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
774 # define yystpcpy stpcpy
776 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
779 # if defined (__STDC__) || defined (__cplusplus)
780 yystpcpy (char *yydest
, const char *yysrc
)
782 yystpcpy (yydest
, yysrc
)
787 register char *yyd
= yydest
;
788 register const char *yys
= yysrc
;
790 while ((*yyd
++ = *yys
++) != '\0')
798 #endif /* !YYERROR_VERBOSE */
802 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
803 into yyparse. The argument should have type void *.
804 It should actually point to an object.
805 Grammar actions can access the variable by casting it
806 to the proper pointer type. */
809 # if defined (__STDC__) || defined (__cplusplus)
810 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
811 # define YYPARSE_PARAM_DECL
813 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
814 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
816 #else /* !YYPARSE_PARAM */
817 # define YYPARSE_PARAM_ARG
818 # define YYPARSE_PARAM_DECL
819 #endif /* !YYPARSE_PARAM */
821 /* Prevent warning if -Wstrict-prototypes. */
823 # ifdef YYPARSE_PARAM
824 int yyparse (void *);
830 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
831 variables are global, or local to YYPARSE. */
833 #define YY_DECL_NON_LSP_VARIABLES \
834 /* The lookahead symbol. */ \
837 /* The semantic value of the lookahead symbol. */ \
840 /* Number of parse errors so far. */ \
844 # define YY_DECL_VARIABLES \
845 YY_DECL_NON_LSP_VARIABLES \
847 /* Location data for the lookahead symbol. */ \
850 # define YY_DECL_VARIABLES \
851 YY_DECL_NON_LSP_VARIABLES
854 /* If nonreentrant, generate the variables here. */
861 yyparse (YYPARSE_PARAM_ARG
)
864 /* If reentrant, generate the variables here. */
869 register int yystate
;
872 /* Number of tokens to shift before error messages enabled. */
874 /* Lookahead token as an internal (translated) token number. */
877 /* Three stacks and their tools:
878 `yyss': related to states,
879 `yyvs': related to semantic values,
880 `yyls': related to locations.
882 Refer to the stacks thru separate pointers, to allow yyoverflow
883 to reallocate them elsewhere. */
885 /* The state stack. */
886 short yyssa
[YYINITDEPTH
];
888 register short *yyssp
;
890 /* The semantic value stack. */
891 YYSTYPE yyvsa
[YYINITDEPTH
];
892 YYSTYPE
*yyvs
= yyvsa
;
893 register YYSTYPE
*yyvsp
;
896 /* The location stack. */
897 YYLTYPE yylsa
[YYINITDEPTH
];
898 YYLTYPE
*yyls
= yylsa
;
903 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
905 # define YYPOPSTACK (yyvsp--, yyssp--)
908 YYSIZE_T yystacksize
= YYINITDEPTH
;
910 /* The variables used to return semantic value and location from the
917 /* When reducing, the number of symbols on the RHS of the reduced
921 YYDPRINTF ((stderr
, "Starting parse\n"));
926 yychar
= YYEMPTY
; /* Cause a token to be read. */
928 /* Initialize stack pointers.
929 Waste one element of value and location stack
930 so that they stay on the same level as the state stack.
931 The wasted elements are never initialized. */
940 /*------------------------------------------------------------.
941 | yynewstate -- Push a new state, which is found in yystate. |
942 `------------------------------------------------------------*/
944 /* In all cases, when you get here, the value and location stacks
945 have just been pushed. so pushing a state here evens the stacks.
952 if (yyssp
>= yyss
+ yystacksize
- 1)
954 /* Get the current used size of the three stacks, in elements. */
955 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
959 /* Give user a chance to reallocate the stack. Use copies of
960 these so that the &'s don't force the real ones into
962 YYSTYPE
*yyvs1
= yyvs
;
965 /* Each stack pointer address is followed by the size of the
966 data in use in that stack, in bytes. */
968 YYLTYPE
*yyls1
= yyls
;
969 /* This used to be a conditional around just the two extra args,
970 but that might be undefined if yyoverflow is a macro. */
971 yyoverflow ("parser stack overflow",
972 &yyss1
, yysize
* sizeof (*yyssp
),
973 &yyvs1
, yysize
* sizeof (*yyvsp
),
974 &yyls1
, yysize
* sizeof (*yylsp
),
978 yyoverflow ("parser stack overflow",
979 &yyss1
, yysize
* sizeof (*yyssp
),
980 &yyvs1
, yysize
* sizeof (*yyvsp
),
986 #else /* no yyoverflow */
987 # ifndef YYSTACK_RELOCATE
990 /* Extend the stack our own way. */
991 if (yystacksize
>= YYMAXDEPTH
)
994 if (yystacksize
> YYMAXDEPTH
)
995 yystacksize
= YYMAXDEPTH
;
999 union yyalloc
*yyptr
=
1000 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1003 YYSTACK_RELOCATE (yyss
);
1004 YYSTACK_RELOCATE (yyvs
);
1006 YYSTACK_RELOCATE (yyls
);
1008 # undef YYSTACK_RELOCATE
1010 YYSTACK_FREE (yyss1
);
1013 #endif /* no yyoverflow */
1015 yyssp
= yyss
+ yysize
- 1;
1016 yyvsp
= yyvs
+ yysize
- 1;
1018 yylsp
= yyls
+ yysize
- 1;
1021 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1022 (unsigned long int) yystacksize
));
1024 if (yyssp
>= yyss
+ yystacksize
- 1)
1028 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1037 /* Do appropriate processing given the current state. */
1038 /* Read a lookahead token if we need one and don't already have one. */
1041 /* First try to decide what to do without reference to lookahead token. */
1043 yyn
= yypact
[yystate
];
1047 /* Not known => get a lookahead token if don't already have one. */
1049 /* yychar is either YYEMPTY or YYEOF
1050 or a valid token in external form. */
1052 if (yychar
== YYEMPTY
)
1054 YYDPRINTF ((stderr
, "Reading a token: "));
1058 /* Convert token to internal form (in yychar1) for indexing tables with. */
1060 if (yychar
<= 0) /* This means end of input. */
1063 yychar
= YYEOF
; /* Don't call YYLEX any more. */
1065 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1069 yychar1
= YYTRANSLATE (yychar
);
1072 /* We have to keep this `#if YYDEBUG', since we use variables
1073 which are defined only if `YYDEBUG' is set. */
1076 YYFPRINTF (stderr
, "Next token is %d (%s",
1077 yychar
, yytname
[yychar1
]);
1078 /* Give the individual parser a way to print the precise
1079 meaning of a token, for further debugging info. */
1081 YYPRINT (stderr
, yychar
, yylval
);
1083 YYFPRINTF (stderr
, ")\n");
1089 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
1094 /* yyn is what to do for this token type in this state.
1095 Negative => reduce, -yyn is rule number.
1096 Positive => shift, yyn is new state.
1097 New state is final state => don't bother to shift,
1098 just return success.
1099 0, or most negative number => error. */
1114 /* Shift the lookahead token. */
1115 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1116 yychar
, yytname
[yychar1
]));
1118 /* Discard the token being shifted unless it is eof. */
1119 if (yychar
!= YYEOF
)
1127 /* Count tokens shifted since error; after three, turn off error
1136 /*-----------------------------------------------------------.
1137 | yydefault -- do the default action for the current state. |
1138 `-----------------------------------------------------------*/
1140 yyn
= yydefact
[yystate
];
1146 /*-----------------------------.
1147 | yyreduce -- Do a reduction. |
1148 `-----------------------------*/
1150 /* yyn is the number of a rule to reduce with. */
1153 /* If YYLEN is nonzero, implement the default value of the action:
1156 Otherwise, the following line sets YYVAL to the semantic value of
1157 the lookahead token. This behavior is undocumented and Bison
1158 users should not rely upon it. Assigning to YYVAL
1159 unconditionally makes the parser a bit smaller, and it avoids a
1160 GCC warning that YYVAL may be used uninitialized. */
1161 yyval
= yyvsp
[1-yylen
];
1164 /* Default location. */
1165 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1169 /* We have to keep this `#if YYDEBUG', since we use variables which
1170 are defined only if `YYDEBUG' is set. */
1175 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1176 yyn
- 1, yyrline
[yyn
]);
1178 /* Print the symbols being reduced, and their result. */
1179 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] >= 0; yyi
++)
1180 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1181 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1187 #line 152 "parse-gram.y"
1189 yycontrol
->errcode
= 0;
1190 epilogue_set (yyvsp
[0].string
, yylsp
[0]);
1195 #line 170 "parse-gram.y"
1196 { prologue_augment (yyvsp
[0].string
, yylsp
[0]); }
1200 #line 171 "parse-gram.y"
1205 #line 172 "parse-gram.y"
1206 { muscle_insert (yyvsp
[-1].string
, yyvsp
[0].string
); }
1210 #line 173 "parse-gram.y"
1211 { defines_flag
= 1; }
1215 #line 174 "parse-gram.y"
1216 { error_verbose
= 1; }
1220 #line 175 "parse-gram.y"
1221 { expected_conflicts
= yyvsp
[0].integer
; }
1225 #line 176 "parse-gram.y"
1226 { spec_file_prefix
= yyvsp
[0].string
; }
1230 #line 177 "parse-gram.y"
1231 { locations_flag
= 1; }
1235 #line 178 "parse-gram.y"
1236 { spec_name_prefix
= yyvsp
[0].string
; }
1240 #line 179 "parse-gram.y"
1241 { no_lines_flag
= 1; }
1245 #line 180 "parse-gram.y"
1246 { spec_outfile
= yyvsp
[0].string
; }
1250 #line 181 "parse-gram.y"
1251 { pure_parser
= 1; }
1255 #line 182 "parse-gram.y"
1256 { skeleton
= yyvsp
[0].string
; }
1260 #line 183 "parse-gram.y"
1261 { token_table_flag
= 1; }
1265 #line 184 "parse-gram.y"
1266 { report_flag
= 1; }
1270 #line 185 "parse-gram.y"
1275 #line 192 "parse-gram.y"
1277 grammar_start_symbol_set (yyvsp
[0].symbol
, yylsp
[0]);
1282 #line 196 "parse-gram.y"
1285 MUSCLE_INSERT_INT ("stype_line", yylsp
[0].first_line
);
1286 muscle_insert ("stype", yyvsp
[0].string
);
1291 #line 204 "parse-gram.y"
1292 { current_class
= nterm_sym
; }
1296 #line 205 "parse-gram.y"
1298 current_class
= unknown_sym
;
1299 current_type
= NULL
;
1304 #line 209 "parse-gram.y"
1305 { current_class
= token_sym
; }
1309 #line 210 "parse-gram.y"
1311 current_class
= unknown_sym
;
1312 current_type
= NULL
;
1317 #line 214 "parse-gram.y"
1318 {current_type
= yyvsp
[0].string
; }
1322 #line 215 "parse-gram.y"
1324 current_type
= NULL
;
1329 #line 222 "parse-gram.y"
1330 { current_assoc
= yyvsp
[-1].assoc
; ++current_prec
; }
1334 #line 224 "parse-gram.y"
1335 { current_assoc
= non_assoc
; current_type
= NULL
; }
1339 #line 228 "parse-gram.y"
1340 { yyval
.assoc
= left_assoc
; }
1344 #line 229 "parse-gram.y"
1345 { yyval
.assoc
= right_assoc
; }
1349 #line 230 "parse-gram.y"
1350 { yyval
.assoc
= non_assoc
; }
1354 #line 234 "parse-gram.y"
1355 { current_type
= NULL
;}
1359 #line 235 "parse-gram.y"
1360 { current_type
= yyvsp
[0].string
; }
1364 #line 240 "parse-gram.y"
1365 { symbol_type_set (yyvsp
[0].symbol
, current_type
); }
1369 #line 241 "parse-gram.y"
1370 { symbol_type_set (yyvsp
[0].symbol
, current_type
); }
1374 #line 247 "parse-gram.y"
1376 symbol_type_set (yyvsp
[0].symbol
, current_type
);
1377 symbol_precedence_set (yyvsp
[0].symbol
, current_prec
, current_assoc
);
1382 #line 252 "parse-gram.y"
1384 symbol_type_set (yyvsp
[0].symbol
, current_type
);
1385 symbol_precedence_set (yyvsp
[0].symbol
, current_prec
, current_assoc
);
1390 #line 261 "parse-gram.y"
1392 current_type
= yyvsp
[0].string
;
1397 #line 265 "parse-gram.y"
1399 symbol_class_set (yyvsp
[0].symbol
, current_class
);
1400 symbol_type_set (yyvsp
[0].symbol
, current_type
);
1405 #line 270 "parse-gram.y"
1407 symbol_class_set (yyvsp
[-1].symbol
, current_class
);
1408 symbol_type_set (yyvsp
[-1].symbol
, current_type
);
1409 symbol_user_token_number_set (yyvsp
[-1].symbol
, yyvsp
[0].integer
);
1414 #line 276 "parse-gram.y"
1416 symbol_class_set (yyvsp
[-1].symbol
, current_class
);
1417 symbol_type_set (yyvsp
[-1].symbol
, current_type
);
1418 symbol_make_alias (yyvsp
[-1].symbol
, yyvsp
[0].symbol
);
1423 #line 282 "parse-gram.y"
1425 symbol_class_set (yyvsp
[-2].symbol
, current_class
);
1426 symbol_type_set (yyvsp
[-2].symbol
, current_type
);
1427 symbol_user_token_number_set (yyvsp
[-2].symbol
, yyvsp
[-1].integer
);
1428 symbol_make_alias (yyvsp
[-2].symbol
, yyvsp
[0].symbol
);
1433 #line 293 "parse-gram.y"
1438 #line 295 "parse-gram.y"
1443 #line 317 "parse-gram.y"
1444 { current_lhs
= yyvsp
[-1].symbol
; current_lhs_location
= yylsp
[-1]; }
1448 #line 318 "parse-gram.y"
1453 #line 322 "parse-gram.y"
1454 { grammar_rule_end (yylsp
[0]); }
1458 #line 323 "parse-gram.y"
1459 { grammar_rule_end (yylsp
[0]); }
1463 #line 328 "parse-gram.y"
1464 { grammar_rule_begin (current_lhs
, current_lhs_location
); }
1468 #line 330 "parse-gram.y"
1469 { grammar_current_rule_symbol_append (yyvsp
[0].symbol
, yylsp
[0]); }
1473 #line 332 "parse-gram.y"
1474 { grammar_current_rule_action_append (yyvsp
[0].string
, yylsp
[0]); }
1478 #line 334 "parse-gram.y"
1479 { grammar_current_rule_prec_set (yyvsp
[0].symbol
); }
1483 #line 338 "parse-gram.y"
1484 { yyval
.symbol
= yyvsp
[0].symbol
; }
1488 #line 339 "parse-gram.y"
1489 { yyval
.symbol
= yyvsp
[0].symbol
; }
1493 #line 340 "parse-gram.y"
1494 { yyval
.symbol
= getsym (yyvsp
[0].string
, yylsp
[0]); }
1498 #line 345 "parse-gram.y"
1499 { yyval
.string
= yyvsp
[0].string
; }
1503 #line 351 "parse-gram.y"
1505 yyval
.symbol
= getsym (yyvsp
[0].string
, yylsp
[0]);
1506 symbol_class_set (yyval
.symbol
, token_sym
);
1511 #line 360 "parse-gram.y"
1513 yyval
.string
= yyvsp
[0].string
+ 1;
1514 yyval
.string
[strlen (yyval
.string
) - 1] = '\0';
1519 #line 368 "parse-gram.y"
1521 yyval
.string
= xstrdup ("");
1526 #line 372 "parse-gram.y"
1528 yyval
.string
= yyvsp
[0].string
;
1535 /* Line 1012 of /usr/local/share/bison/bison.simple. */
1536 #line 1537 "parse-gram.c"
1547 short *yyssp1
= yyss
- 1;
1548 YYFPRINTF (stderr
, "state stack now");
1549 while (yyssp1
!= yyssp
)
1550 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1551 YYFPRINTF (stderr
, "\n");
1560 /* Now `shift' the result of the reduction. Determine what state
1561 that goes to, based on the state we popped back to and the rule
1562 number reduced by. */
1566 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1567 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1568 yystate
= yytable
[yystate
];
1570 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1575 /*------------------------------------.
1576 | yyerrlab -- here on detecting error |
1577 `------------------------------------*/
1579 /* If not already recovering from an error, report this error. */
1585 yyn
= yypact
[yystate
];
1587 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1589 YYSIZE_T yysize
= 0;
1594 /* Start YYX at -YYN if negative to avoid negative indexes in
1596 for (yyx
= yyn
< 0 ? -yyn
: 0;
1597 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1598 if (yycheck
[yyx
+ yyn
] == yyx
)
1599 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1600 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1601 yysize
+= yystrlen (yytname
[YYTRANSLATE (yychar
)]);
1602 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1605 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1606 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1611 for (yyx
= yyn
< 0 ? -yyn
: 0;
1612 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1614 if (yycheck
[yyx
+ yyn
] == yyx
)
1616 const char *yyq
= ! yycount
? ", expecting " : " or ";
1617 yyp
= yystpcpy (yyp
, yyq
);
1618 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1623 YYSTACK_FREE (yymsg
);
1626 yyerror ("parse error; also virtual memory exhausted");
1629 #endif /* YYERROR_VERBOSE */
1630 yyerror ("parse error");
1635 /*----------------------------------------------------.
1636 | yyerrlab1 -- error raised explicitly by an action. |
1637 `----------------------------------------------------*/
1639 if (yyerrstatus
== 3)
1641 /* If just tried and failed to reuse lookahead token after an
1642 error, discard it. */
1644 /* Return failure if at end of input. */
1645 if (yychar
== YYEOF
)
1647 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1648 yychar
, yytname
[yychar1
]));
1652 /* Else will try to reuse lookahead token after shifting the error
1655 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1659 yyn
= yypact
[yystate
];
1663 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1671 /* Pop the current state because it cannot handle the error token. */
1678 if (yystos
[yystate
] < YYNTOKENS
)
1680 YYFPRINTF (stderr
, "Error: popping token %d (%s",
1681 yytoknum
[yystos
[yystate
]], yytname
[yystos
[yystate
]]);
1683 YYPRINT (stderr
, yytoknum
[yystos
[yystate
]], *yyvsp
);
1685 YYFPRINTF (stderr
, ")\n");
1689 YYFPRINTF (stderr
, "Error: popping nonterminal (%s)\n",
1690 yytname
[yystos
[yystate
]]);
1704 short *yyssp1
= yyss
- 1;
1705 YYFPRINTF (stderr
, "Error: state stack now");
1706 while (yyssp1
!= yyssp
)
1707 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1708 YYFPRINTF (stderr
, "\n");
1716 YYDPRINTF ((stderr
, "Shifting error token, "));
1727 /*-------------------------------------.
1728 | yyacceptlab -- YYACCEPT comes here. |
1729 `-------------------------------------*/
1734 /*-----------------------------------.
1735 | yyabortlab -- YYABORT comes here. |
1736 `-----------------------------------*/
1741 /*---------------------------------------------.
1742 | yyoverflowab -- parser overflow comes here. |
1743 `---------------------------------------------*/
1745 yyerror ("parser stack overflow");
1752 YYSTACK_FREE (yyss
);
1757 #line 381 "parse-gram.y"
1759 /*------------------------------------------------------------------.
1760 | When debugging the parser, display tokens' locations and values. |
1761 `------------------------------------------------------------------*/
1764 yyprint (FILE *file
,
1765 const location_t
*loc
, int type
, const yystype
*value
)
1768 LOCATION_PRINT (file
, *loc
);
1773 fprintf (file
, " = '%s'", value
->string
);
1777 fprintf (file
, " = %s", value
->symbol
->tag
);
1781 fprintf (file
, " = %d", value
->integer
);
1785 fprintf (file
, " = \"%s\"", value
->string
);
1789 fprintf (file
, " = <%s>", value
->string
);
1795 fprintf (file
, " = {{ %s }}", value
->string
);
1801 gram_error (gram_control_t
*control ATTRIBUTE_UNUSED
,
1802 location_t
*yylloc
, const char *msg
)
1804 LOCATION_PRINT (stderr
, *yylloc
);
1805 fprintf (stderr
, ": %s\n", msg
);