]> git.saurik.com Git - bison.git/blob - src/parse-gram.c
cba44519152050c1f3b84186cdf743eb2544ea06
[bison.git] / src / parse-gram.c
1 /* A Bison parser, made by GNU Bison 1.875c. */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5
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)
9 any later version.
10
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.
15
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. */
20
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. */
25
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
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. */
35
36 /* Identify Bison output. */
37 #define YYBISON 1
38
39 /* Skeleton name. */
40 #define YYSKELETON_NAME "yacc.c"
41
42 /* Pure parsers. */
43 #define YYPURE 1
44
45 /* Using locations. */
46 #define YYLSP_NEEDED 1
47
48 /* If NAME_PREFIX is specified substitute the variables and functions
49 names. */
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
58
59 /* Tokens. */
60 #ifndef YYTOKENTYPE
61 # define YYTOKENTYPE
62 /* Put the tokens into the symbol table, so that GDB and other debuggers
63 know about them. */
64 enum yytokentype {
65 GRAM_EOF = 0,
66 STRING = 258,
67 INT = 259,
68 PERCENT_TOKEN = 260,
69 PERCENT_NTERM = 261,
70 PERCENT_TYPE = 262,
71 PERCENT_DESTRUCTOR = 263,
72 PERCENT_PRINTER = 264,
73 PERCENT_UNION = 265,
74 PERCENT_LEFT = 266,
75 PERCENT_RIGHT = 267,
76 PERCENT_NONASSOC = 268,
77 PERCENT_PREC = 269,
78 PERCENT_DPREC = 270,
79 PERCENT_MERGE = 271,
80 PERCENT_DEBUG = 272,
81 PERCENT_DEFAULT_PREC = 273,
82 PERCENT_DEFINE = 274,
83 PERCENT_DEFINES = 275,
84 PERCENT_ERROR_VERBOSE = 276,
85 PERCENT_EXPECT = 277,
86 PERCENT_FILE_PREFIX = 278,
87 PERCENT_GLR_PARSER = 279,
88 PERCENT_INITIAL_ACTION = 280,
89 PERCENT_LEX_PARAM = 281,
90 PERCENT_LOCATIONS = 282,
91 PERCENT_NAME_PREFIX = 283,
92 PERCENT_NO_LINES = 284,
93 PERCENT_NONDETERMINISTIC_PARSER = 285,
94 PERCENT_OUTPUT = 286,
95 PERCENT_PARSE_PARAM = 287,
96 PERCENT_PURE_PARSER = 288,
97 PERCENT_SKELETON = 289,
98 PERCENT_START = 290,
99 PERCENT_TOKEN_TABLE = 291,
100 PERCENT_VERBOSE = 292,
101 PERCENT_YACC = 293,
102 TYPE = 294,
103 EQUAL = 295,
104 SEMICOLON = 296,
105 PIPE = 297,
106 ID = 298,
107 ID_COLON = 299,
108 PERCENT_PERCENT = 300,
109 PROLOGUE = 301,
110 EPILOGUE = 302,
111 BRACED_CODE = 303
112 };
113 #endif
114 #define GRAM_EOF 0
115 #define STRING 258
116 #define INT 259
117 #define PERCENT_TOKEN 260
118 #define PERCENT_NTERM 261
119 #define PERCENT_TYPE 262
120 #define PERCENT_DESTRUCTOR 263
121 #define PERCENT_PRINTER 264
122 #define PERCENT_UNION 265
123 #define PERCENT_LEFT 266
124 #define PERCENT_RIGHT 267
125 #define PERCENT_NONASSOC 268
126 #define PERCENT_PREC 269
127 #define PERCENT_DPREC 270
128 #define PERCENT_MERGE 271
129 #define PERCENT_DEBUG 272
130 #define PERCENT_DEFAULT_PREC 273
131 #define PERCENT_DEFINE 274
132 #define PERCENT_DEFINES 275
133 #define PERCENT_ERROR_VERBOSE 276
134 #define PERCENT_EXPECT 277
135 #define PERCENT_FILE_PREFIX 278
136 #define PERCENT_GLR_PARSER 279
137 #define PERCENT_INITIAL_ACTION 280
138 #define PERCENT_LEX_PARAM 281
139 #define PERCENT_LOCATIONS 282
140 #define PERCENT_NAME_PREFIX 283
141 #define PERCENT_NO_LINES 284
142 #define PERCENT_NONDETERMINISTIC_PARSER 285
143 #define PERCENT_OUTPUT 286
144 #define PERCENT_PARSE_PARAM 287
145 #define PERCENT_PURE_PARSER 288
146 #define PERCENT_SKELETON 289
147 #define PERCENT_START 290
148 #define PERCENT_TOKEN_TABLE 291
149 #define PERCENT_VERBOSE 292
150 #define PERCENT_YACC 293
151 #define TYPE 294
152 #define EQUAL 295
153 #define SEMICOLON 296
154 #define PIPE 297
155 #define ID 298
156 #define ID_COLON 299
157 #define PERCENT_PERCENT 300
158 #define PROLOGUE 301
159 #define EPILOGUE 302
160 #define BRACED_CODE 303
161
162
163
164
165 /* Copy the first part of user declarations. */
166 #line 32 "parse-gram.y"
167
168 #include "system.h"
169
170 #include "complain.h"
171 #include "conflicts.h"
172 #include "files.h"
173 #include "getargs.h"
174 #include "gram.h"
175 #include "muscle_tab.h"
176 #include "output.h"
177 #include "reader.h"
178 #include "symlist.h"
179
180 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
181 static YYLTYPE lloc_default (YYLTYPE const *, int);
182
183 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
184 FIXME: depends on the undocumented availability of YYLLOC. */
185 #undef yyerror
186 #define yyerror(Msg) \
187 gram_error (&yylloc, Msg)
188 static void gram_error (location const *, char const *);
189
190 #define YYPRINT(File, Type, Value) \
191 print_token_value (File, Type, &Value)
192 static void print_token_value (FILE *, int, YYSTYPE const *);
193
194 static void add_param (char const *, char *, location);
195
196 symbol_class current_class = unknown_sym;
197 uniqstr current_type = 0;
198 symbol *current_lhs;
199 location current_lhs_location;
200 assoc current_assoc;
201 int current_prec = 0;
202
203
204 /* Enabling traces. */
205 #ifndef YYDEBUG
206 # define YYDEBUG 1
207 #endif
208
209 /* Enabling verbose error messages. */
210 #ifdef YYERROR_VERBOSE
211 # undef YYERROR_VERBOSE
212 # define YYERROR_VERBOSE 1
213 #else
214 # define YYERROR_VERBOSE 1
215 #endif
216
217 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
218 #line 80 "parse-gram.y"
219 typedef union YYSTYPE {
220 symbol *symbol;
221 symbol_list *list;
222 int integer;
223 char *chars;
224 assoc assoc;
225 uniqstr uniqstr;
226 } YYSTYPE;
227 /* Line 191 of yacc.c. */
228 #line 229 "parse-gram.c"
229 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
230 # define YYSTYPE_IS_DECLARED 1
231 # define YYSTYPE_IS_TRIVIAL 1
232 #endif
233
234 #if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
235 typedef struct YYLTYPE
236 {
237 int first_line;
238 int first_column;
239 int last_line;
240 int last_column;
241 } YYLTYPE;
242 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
243 # define YYLTYPE_IS_DECLARED 1
244 # define YYLTYPE_IS_TRIVIAL 1
245 #endif
246
247
248 /* Copy the second part of user declarations. */
249
250
251 /* Line 214 of yacc.c. */
252 #line 253 "parse-gram.c"
253
254 #if ! defined (yyoverflow) || YYERROR_VERBOSE
255
256 # ifndef YYFREE
257 # define YYFREE free
258 # endif
259 # ifndef YYMALLOC
260 # define YYMALLOC malloc
261 # endif
262
263 /* The parser invokes alloca or malloc; define the necessary symbols. */
264
265 # ifdef YYSTACK_USE_ALLOCA
266 # if YYSTACK_USE_ALLOCA
267 # define YYSTACK_ALLOC alloca
268 # endif
269 # else
270 # if defined (alloca) || defined (_ALLOCA_H)
271 # define YYSTACK_ALLOC alloca
272 # else
273 # ifdef __GNUC__
274 # define YYSTACK_ALLOC __builtin_alloca
275 # endif
276 # endif
277 # endif
278
279 # ifdef YYSTACK_ALLOC
280 /* Pacify GCC's `empty if-body' warning. */
281 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
282 # else
283 # if defined (__STDC__) || defined (__cplusplus)
284 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
285 # define YYSIZE_T size_t
286 # endif
287 # define YYSTACK_ALLOC YYMALLOC
288 # define YYSTACK_FREE YYFREE
289 # endif
290 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
291
292
293 #if (! defined (yyoverflow) \
294 && (! defined (__cplusplus) \
295 || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
296 && defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
297
298 /* A type that is properly aligned for any stack member. */
299 union yyalloc
300 {
301 short yyss;
302 YYSTYPE yyvs;
303 YYLTYPE yyls;
304 };
305
306 /* The size of the maximum gap between one aligned stack and the next. */
307 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
308
309 /* The size of an array large to enough to hold all stacks, each with
310 N elements. */
311 # define YYSTACK_BYTES(N) \
312 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
313 + 2 * YYSTACK_GAP_MAXIMUM)
314
315 /* Copy COUNT objects from FROM to TO. The source and destination do
316 not overlap. */
317 # ifndef YYCOPY
318 # if defined (__GNUC__) && 1 < __GNUC__
319 # define YYCOPY(To, From, Count) \
320 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
321 # else
322 # define YYCOPY(To, From, Count) \
323 do \
324 { \
325 register YYSIZE_T yyi; \
326 for (yyi = 0; yyi < (Count); yyi++) \
327 (To)[yyi] = (From)[yyi]; \
328 } \
329 while (0)
330 # endif
331 # endif
332
333 /* Relocate STACK from its old location to the new one. The
334 local variables YYSIZE and YYSTACKSIZE give the old and new number of
335 elements in the stack, and YYPTR gives the new location of the
336 stack. Advance YYPTR to a properly aligned location for the next
337 stack. */
338 # define YYSTACK_RELOCATE(Stack) \
339 do \
340 { \
341 YYSIZE_T yynewbytes; \
342 YYCOPY (&yyptr->Stack, Stack, yysize); \
343 Stack = &yyptr->Stack; \
344 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
345 yyptr += yynewbytes / sizeof (*yyptr); \
346 } \
347 while (0)
348
349 #endif
350
351 #if defined (__STDC__) || defined (__cplusplus)
352 typedef signed char yysigned_char;
353 #else
354 typedef short yysigned_char;
355 #endif
356
357 /* YYFINAL -- State number of the termination state. */
358 #define YYFINAL 3
359 /* YYLAST -- Last index in YYTABLE. */
360 #define YYLAST 153
361
362 /* YYNTOKENS -- Number of terminals. */
363 #define YYNTOKENS 49
364 /* YYNNTS -- Number of nonterminals. */
365 #define YYNNTS 25
366 /* YYNRULES -- Number of rules. */
367 #define YYNRULES 77
368 /* YYNRULES -- Number of states. */
369 #define YYNSTATES 106
370
371 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
372 #define YYUNDEFTOK 2
373 #define YYMAXUTOK 303
374
375 #define YYTRANSLATE(YYX) \
376 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
377
378 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
379 static const unsigned char yytranslate[] =
380 {
381 0, 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, 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, 1, 2, 3, 4,
407 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
408 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
409 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
410 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
411 45, 46, 47, 48
412 };
413
414 #if YYDEBUG
415 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
416 YYRHS. */
417 static const unsigned char yyprhs[] =
418 {
419 0, 0, 3, 8, 9, 12, 14, 16, 18, 22,
420 24, 26, 29, 33, 35, 37, 39, 41, 45, 47,
421 49, 53, 55, 57, 60, 62, 64, 66, 68, 70,
422 72, 75, 77, 80, 83, 86, 87, 91, 92, 96,
423 100, 104, 106, 108, 110, 111, 113, 115, 118, 120,
424 122, 125, 128, 132, 134, 137, 139, 142, 144, 147,
425 150, 151, 155, 157, 161, 164, 165, 168, 171, 175,
426 179, 183, 185, 187, 189, 191, 193, 194
427 };
428
429 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
430 static const yysigned_char yyrhs[] =
431 {
432 50, 0, -1, 51, 45, 63, 73, -1, -1, 51,
433 52, -1, 53, -1, 46, -1, 17, -1, 19, 72,
434 72, -1, 20, -1, 21, -1, 22, 4, -1, 23,
435 40, 72, -1, 24, -1, 25, -1, 26, -1, 27,
436 -1, 28, 40, 72, -1, 29, -1, 30, -1, 31,
437 40, 72, -1, 32, -1, 33, -1, 34, 72, -1,
438 36, -1, 37, -1, 38, -1, 41, -1, 57, -1,
439 54, -1, 35, 69, -1, 10, -1, 8, 60, -1,
440 9, 60, -1, 18, 4, -1, -1, 6, 55, 62,
441 -1, -1, 5, 56, 62, -1, 7, 39, 60, -1,
442 58, 59, 60, -1, 11, -1, 12, -1, 13, -1,
443 -1, 39, -1, 69, -1, 60, 69, -1, 39, -1,
444 43, -1, 43, 4, -1, 43, 71, -1, 43, 4,
445 71, -1, 61, -1, 62, 61, -1, 64, -1, 63,
446 64, -1, 65, -1, 53, 41, -1, 1, 41, -1,
447 -1, 44, 66, 67, -1, 68, -1, 67, 42, 68,
448 -1, 67, 41, -1, -1, 68, 69, -1, 68, 70,
449 -1, 68, 14, 69, -1, 68, 15, 4, -1, 68,
450 16, 39, -1, 43, -1, 71, -1, 48, -1, 3,
451 -1, 3, -1, -1, 45, 47, -1
452 };
453
454 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
455 static const unsigned short yyrline[] =
456 {
457 0, 171, 171, 179, 181, 185, 186, 187, 188, 189,
458 190, 191, 192, 193, 198, 202, 203, 204, 205, 206,
459 207, 208, 209, 210, 211, 212, 213, 214, 218, 219,
460 220, 224, 230, 237, 244, 254, 254, 259, 259, 264,
461 274, 289, 290, 291, 295, 296, 302, 303, 308, 312,
462 317, 323, 329, 340, 341, 350, 351, 357, 358, 363,
463 370, 370, 374, 375, 376, 381, 382, 384, 386, 388,
464 390, 395, 396, 400, 406, 415, 422, 424
465 };
466 #endif
467
468 #if YYDEBUG || YYERROR_VERBOSE
469 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
470 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
471 static const char *const yytname[] =
472 {
473 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
474 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor {...}\"",
475 "\"%printer {...}\"", "\"%union {...}\"", "\"%left\"", "\"%right\"",
476 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%debug\"",
477 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
478 "\"%expect\"", "\"%file-prefix\"", "\"%glr-parser\"",
479 "\"%initial-action {...}\"", "\"%lex-param {...}\"", "\"%locations\"",
480 "\"%name-prefix\"", "\"%no-lines\"", "\"%nondeterministic-parser\"",
481 "\"%output\"", "\"%parse-param {...}\"", "\"%pure-parser\"",
482 "\"%skeleton\"", "\"%start\"", "\"%token-table\"", "\"%verbose\"",
483 "\"%yacc\"", "\"type\"", "\"=\"", "\";\"", "\"|\"", "\"identifier\"",
484 "\"identifier:\"", "\"%%\"", "\"%{...%}\"", "\"epilogue\"", "\"{...}\"",
485 "$accept", "input", "declarations", "declaration", "grammar_declaration",
486 "symbol_declaration", "@1", "@2", "precedence_declaration",
487 "precedence_declarator", "type.opt", "symbols.1", "symbol_def",
488 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
489 "@3", "rhses.1", "rhs", "symbol", "action", "string_as_id",
490 "string_content", "epilogue.opt", 0
491 };
492 #endif
493
494 # ifdef YYPRINT
495 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
496 token YYLEX-NUM. */
497 static const unsigned short yytoknum[] =
498 {
499 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
500 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
501 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
502 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
503 295, 296, 297, 298, 299, 300, 301, 302, 303
504 };
505 # endif
506
507 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
508 static const unsigned char yyr1[] =
509 {
510 0, 49, 50, 51, 51, 52, 52, 52, 52, 52,
511 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
512 52, 52, 52, 52, 52, 52, 52, 52, 53, 53,
513 53, 53, 53, 53, 53, 55, 54, 56, 54, 54,
514 57, 58, 58, 58, 59, 59, 60, 60, 61, 61,
515 61, 61, 61, 62, 62, 63, 63, 64, 64, 64,
516 66, 65, 67, 67, 67, 68, 68, 68, 68, 68,
517 68, 69, 69, 70, 71, 72, 73, 73
518 };
519
520 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
521 static const unsigned char yyr2[] =
522 {
523 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
524 1, 2, 3, 1, 1, 1, 1, 3, 1, 1,
525 3, 1, 1, 2, 1, 1, 1, 1, 1, 1,
526 2, 1, 2, 2, 2, 0, 3, 0, 3, 3,
527 3, 1, 1, 1, 0, 1, 1, 2, 1, 1,
528 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
529 0, 3, 1, 3, 2, 0, 2, 2, 3, 3,
530 3, 1, 1, 1, 1, 1, 0, 2
531 };
532
533 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
534 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
535 means the default is an error. */
536 static const unsigned char yydefact[] =
537 {
538 3, 0, 0, 1, 37, 35, 0, 0, 0, 31,
539 41, 42, 43, 7, 0, 0, 9, 10, 0, 0,
540 13, 14, 15, 16, 0, 18, 19, 0, 21, 22,
541 0, 0, 24, 25, 26, 27, 0, 6, 4, 5,
542 29, 28, 44, 0, 0, 0, 74, 71, 32, 46,
543 72, 33, 34, 75, 0, 11, 0, 0, 0, 23,
544 30, 0, 60, 0, 0, 55, 57, 45, 0, 48,
545 49, 53, 38, 36, 39, 47, 8, 12, 17, 20,
546 59, 65, 58, 0, 56, 2, 40, 50, 51, 54,
547 61, 62, 77, 52, 64, 65, 0, 0, 0, 73,
548 66, 67, 63, 68, 69, 70
549 };
550
551 /* YYDEFGOTO[NTERM-NUM]. */
552 static const yysigned_char yydefgoto[] =
553 {
554 -1, 1, 2, 38, 63, 40, 44, 43, 41, 42,
555 68, 48, 71, 72, 64, 65, 66, 81, 90, 91,
556 49, 101, 50, 54, 85
557 };
558
559 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
560 STATE-NUM. */
561 #define YYPACT_NINF -63
562 static const yysigned_char yypact[] =
563 {
564 -63, 12, 107, -63, -63, -63, -18, 1, 1, -63,
565 -63, -63, -63, -63, 28, 31, -63, -63, 33, -5,
566 -63, -63, -63, -63, 0, -63, -63, 5, -63, -63,
567 31, 1, -63, -63, -63, -63, 67, -63, -63, -63,
568 -63, -63, 13, -36, -36, 1, -63, -63, 1, -63,
569 -63, 1, -63, -63, 31, -63, 31, 31, 31, -63,
570 -63, -2, -63, 10, 18, -63, -63, -63, 1, -63,
571 2, -63, -36, -36, 1, -63, -63, -63, -63, -63,
572 -63, -63, -63, -6, -63, -63, 1, 51, -63, -63,
573 -33, -1, -63, -63, -63, -63, 1, 52, 19, -63,
574 -63, -63, -1, -63, -63, -63
575 };
576
577 /* YYPGOTO[NTERM-NUM]. */
578 static const yysigned_char yypgoto[] =
579 {
580 -63, -63, -63, -63, 55, -63, -63, -63, -63, -63,
581 -63, -7, -62, 15, -63, 3, -63, -63, -63, -29,
582 -31, -63, -54, -8, -63
583 };
584
585 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
586 positive, shift that token. If negative, reduce the rule which
587 number is the opposite. If zero, do what YYDEFACT says.
588 If YYTABLE_NINF, syntax error. */
589 #define YYTABLE_NINF -77
590 static const yysigned_char yytable[] =
591 {
592 60, 51, 46, 69, 46, 46, 87, 70, 94, 95,
593 89, 89, 3, 96, 97, 98, 88, 75, -76, 61,
594 75, 45, 59, 4, 5, 6, 7, 8, 9, 10,
595 11, 12, 52, 93, 53, 56, 14, 55, 74, 80,
596 57, 92, 47, 75, 47, 58, 76, 99, 77, 78,
597 79, 82, 67, 31, 46, 75, 104, 39, 105, 73,
598 100, 86, 62, 83, 0, 103, 102, 84, 61, 0,
599 0, 100, 4, 5, 6, 7, 8, 9, 10, 11,
600 12, 0, 0, 0, 0, 14, 0, 0, 0, 0,
601 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
602 0, 0, 31, 0, 0, 0, 0, 0, 0, 0,
603 0, 62, 4, 5, 6, 7, 8, 9, 10, 11,
604 12, 0, 0, 0, 13, 14, 15, 16, 17, 18,
605 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
606 29, 30, 31, 32, 33, 34, 0, 0, 35, 0,
607 0, 0, 36, 37
608 };
609
610 static const yysigned_char yycheck[] =
611 {
612 31, 8, 3, 39, 3, 3, 4, 43, 41, 42,
613 72, 73, 0, 14, 15, 16, 70, 48, 0, 1,
614 51, 39, 30, 5, 6, 7, 8, 9, 10, 11,
615 12, 13, 4, 87, 3, 40, 18, 4, 45, 41,
616 40, 47, 43, 74, 43, 40, 54, 48, 56, 57,
617 58, 41, 39, 35, 3, 86, 4, 2, 39, 44,
618 91, 68, 44, 45, -1, 96, 95, 64, 1, -1,
619 -1, 102, 5, 6, 7, 8, 9, 10, 11, 12,
620 13, -1, -1, -1, -1, 18, -1, -1, -1, -1,
621 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
622 -1, -1, 35, -1, -1, -1, -1, -1, -1, -1,
623 -1, 44, 5, 6, 7, 8, 9, 10, 11, 12,
624 13, -1, -1, -1, 17, 18, 19, 20, 21, 22,
625 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
626 33, 34, 35, 36, 37, 38, -1, -1, 41, -1,
627 -1, -1, 45, 46
628 };
629
630 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
631 symbol of state STATE-NUM. */
632 static const unsigned char yystos[] =
633 {
634 0, 50, 51, 0, 5, 6, 7, 8, 9, 10,
635 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
636 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
637 34, 35, 36, 37, 38, 41, 45, 46, 52, 53,
638 54, 57, 58, 56, 55, 39, 3, 43, 60, 69,
639 71, 60, 4, 3, 72, 4, 40, 40, 40, 72,
640 69, 1, 44, 53, 63, 64, 65, 39, 59, 39,
641 43, 61, 62, 62, 60, 69, 72, 72, 72, 72,
642 41, 66, 41, 45, 64, 73, 60, 4, 71, 61,
643 67, 68, 47, 71, 41, 42, 14, 15, 16, 48,
644 69, 70, 68, 69, 4, 39
645 };
646
647 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
648 # define YYSIZE_T __SIZE_TYPE__
649 #endif
650 #if ! defined (YYSIZE_T) && defined (size_t)
651 # define YYSIZE_T size_t
652 #endif
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
657 # endif
658 #endif
659 #if ! defined (YYSIZE_T)
660 # define YYSIZE_T unsigned int
661 #endif
662
663 #define yyerrok (yyerrstatus = 0)
664 #define yyclearin (yychar = YYEMPTY)
665 #define YYEMPTY (-2)
666 #define YYEOF 0
667
668 #define YYACCEPT goto yyacceptlab
669 #define YYABORT goto yyabortlab
670 #define YYERROR goto yyerrorlab
671
672
673 /* Like YYERROR except do call yyerror. This remains here temporarily
674 to ease the transition to the new meaning of YYERROR, for GCC.
675 Once GCC version 2 has supplanted version 1, this can go. */
676
677 #define YYFAIL goto yyerrlab
678
679 #define YYRECOVERING() (!!yyerrstatus)
680
681 #define YYBACKUP(Token, Value) \
682 do \
683 if (yychar == YYEMPTY && yylen == 1) \
684 { \
685 yychar = (Token); \
686 yylval = (Value); \
687 yytoken = YYTRANSLATE (yychar); \
688 YYPOPSTACK; \
689 goto yybackup; \
690 } \
691 else \
692 { \
693 yyerror ("syntax error: cannot back up");\
694 YYERROR; \
695 } \
696 while (0)
697
698 #define YYTERROR 1
699 #define YYERRCODE 256
700
701 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
702 are run). */
703
704 #ifndef YYLLOC_DEFAULT
705 # define YYLLOC_DEFAULT(Current, Rhs, N) \
706 ((Current).first_line = (Rhs)[1].first_line, \
707 (Current).first_column = (Rhs)[1].first_column, \
708 (Current).last_line = (Rhs)[N].last_line, \
709 (Current).last_column = (Rhs)[N].last_column)
710 #endif
711
712 /* YYLEX -- calling `yylex' with the right arguments. */
713
714 #ifdef YYLEX_PARAM
715 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
716 #else
717 # define YYLEX yylex (&yylval, &yylloc)
718 #endif
719
720 /* Enable debugging if requested. */
721 #if YYDEBUG
722
723 # ifndef YYFPRINTF
724 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
725 # define YYFPRINTF fprintf
726 # endif
727
728 # define YYDPRINTF(Args) \
729 do { \
730 if (yydebug) \
731 YYFPRINTF Args; \
732 } while (0)
733
734 # define YYDSYMPRINT(Args) \
735 do { \
736 if (yydebug) \
737 yysymprint Args; \
738 } while (0)
739
740 # define YYDSYMPRINTF(Title, Token, Value, Location) \
741 do { \
742 if (yydebug) \
743 { \
744 YYFPRINTF (stderr, "%s ", Title); \
745 yysymprint (stderr, \
746 Token, Value, Location); \
747 YYFPRINTF (stderr, "\n"); \
748 } \
749 } while (0)
750
751 /*------------------------------------------------------------------.
752 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
753 | TOP (included). |
754 `------------------------------------------------------------------*/
755
756 #if defined (__STDC__) || defined (__cplusplus)
757 static void
758 yy_stack_print (short *bottom, short *top)
759 #else
760 static void
761 yy_stack_print (bottom, top)
762 short *bottom;
763 short *top;
764 #endif
765 {
766 YYFPRINTF (stderr, "Stack now");
767 for (/* Nothing. */; bottom <= top; ++bottom)
768 YYFPRINTF (stderr, " %d", *bottom);
769 YYFPRINTF (stderr, "\n");
770 }
771
772 # define YY_STACK_PRINT(Bottom, Top) \
773 do { \
774 if (yydebug) \
775 yy_stack_print ((Bottom), (Top)); \
776 } while (0)
777
778
779 /*------------------------------------------------.
780 | Report that the YYRULE is going to be reduced. |
781 `------------------------------------------------*/
782
783 #if defined (__STDC__) || defined (__cplusplus)
784 static void
785 yy_reduce_print (int yyrule)
786 #else
787 static void
788 yy_reduce_print (yyrule)
789 int yyrule;
790 #endif
791 {
792 int yyi;
793 unsigned int yylno = yyrline[yyrule];
794 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
795 yyrule - 1, yylno);
796 /* Print the symbols being reduced, and their result. */
797 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
798 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
799 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
800 }
801
802 # define YY_REDUCE_PRINT(Rule) \
803 do { \
804 if (yydebug) \
805 yy_reduce_print (Rule); \
806 } while (0)
807
808 /* Nonzero means print parse trace. It is left uninitialized so that
809 multiple parsers can coexist. */
810 int yydebug;
811 #else /* !YYDEBUG */
812 # define YYDPRINTF(Args)
813 # define YYDSYMPRINT(Args)
814 # define YYDSYMPRINTF(Title, Token, Value, Location)
815 # define YY_STACK_PRINT(Bottom, Top)
816 # define YY_REDUCE_PRINT(Rule)
817 #endif /* !YYDEBUG */
818
819
820 /* YYINITDEPTH -- initial size of the parser's stacks. */
821 #ifndef YYINITDEPTH
822 # define YYINITDEPTH 200
823 #endif
824
825 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
826 if the built-in stack extension method is used).
827
828 Do not make this value too large; the results are undefined if
829 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
830 evaluated with infinite-precision integer arithmetic. */
831
832 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
833 # undef YYMAXDEPTH
834 #endif
835
836 #ifndef YYMAXDEPTH
837 # define YYMAXDEPTH 10000
838 #endif
839
840 \f
841
842 #if YYERROR_VERBOSE
843
844 # ifndef yystrlen
845 # if defined (__GLIBC__) && defined (_STRING_H)
846 # define yystrlen strlen
847 # else
848 /* Return the length of YYSTR. */
849 static YYSIZE_T
850 # if defined (__STDC__) || defined (__cplusplus)
851 yystrlen (const char *yystr)
852 # else
853 yystrlen (yystr)
854 const char *yystr;
855 # endif
856 {
857 register const char *yys = yystr;
858
859 while (*yys++ != '\0')
860 continue;
861
862 return yys - yystr - 1;
863 }
864 # endif
865 # endif
866
867 # ifndef yystpcpy
868 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
869 # define yystpcpy stpcpy
870 # else
871 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
872 YYDEST. */
873 static char *
874 # if defined (__STDC__) || defined (__cplusplus)
875 yystpcpy (char *yydest, const char *yysrc)
876 # else
877 yystpcpy (yydest, yysrc)
878 char *yydest;
879 const char *yysrc;
880 # endif
881 {
882 register char *yyd = yydest;
883 register const char *yys = yysrc;
884
885 while ((*yyd++ = *yys++) != '\0')
886 continue;
887
888 return yyd - 1;
889 }
890 # endif
891 # endif
892
893 #endif /* !YYERROR_VERBOSE */
894
895 \f
896
897 #if YYDEBUG
898 /*--------------------------------.
899 | Print this symbol on YYOUTPUT. |
900 `--------------------------------*/
901
902 #if defined (__STDC__) || defined (__cplusplus)
903 static void
904 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
905 #else
906 static void
907 yysymprint (yyoutput, yytype, yyvaluep, yylocationp)
908 FILE *yyoutput;
909 int yytype;
910 YYSTYPE *yyvaluep;
911 YYLTYPE *yylocationp;
912 #endif
913 {
914 /* Pacify ``unused variable'' warnings. */
915 (void) yyvaluep;
916 (void) yylocationp;
917
918 if (yytype < YYNTOKENS)
919 {
920 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
921 # ifdef YYPRINT
922 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
923 # endif
924 }
925 else
926 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
927
928 switch (yytype)
929 {
930 default:
931 break;
932 }
933 YYFPRINTF (yyoutput, ")");
934 }
935
936 #endif /* ! YYDEBUG */
937 /*-----------------------------------------------.
938 | Release the memory associated to this symbol. |
939 `-----------------------------------------------*/
940
941 #if defined (__STDC__) || defined (__cplusplus)
942 static void
943 yydestruct (int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
944 #else
945 static void
946 yydestruct (yytype, yyvaluep, yylocationp)
947 int yytype;
948 YYSTYPE *yyvaluep;
949 YYLTYPE *yylocationp;
950 #endif
951 {
952 /* Pacify ``unused variable'' warnings. */
953 (void) yyvaluep;
954 (void) yylocationp;
955
956 switch (yytype)
957 {
958
959 default:
960 break;
961 }
962 }
963 \f
964
965 /* Prevent warnings from -Wmissing-prototypes. */
966
967 #ifdef YYPARSE_PARAM
968 # if defined (__STDC__) || defined (__cplusplus)
969 int yyparse (void *YYPARSE_PARAM);
970 # else
971 int yyparse ();
972 # endif
973 #else /* ! YYPARSE_PARAM */
974 #if defined (__STDC__) || defined (__cplusplus)
975 int yyparse (void);
976 #else
977 int yyparse ();
978 #endif
979 #endif /* ! YYPARSE_PARAM */
980
981
982
983
984
985
986 /*----------.
987 | yyparse. |
988 `----------*/
989
990 #ifdef YYPARSE_PARAM
991 # if defined (__STDC__) || defined (__cplusplus)
992 int yyparse (void *YYPARSE_PARAM)
993 # else
994 int yyparse (YYPARSE_PARAM)
995 void *YYPARSE_PARAM;
996 # endif
997 #else /* ! YYPARSE_PARAM */
998 #if defined (__STDC__) || defined (__cplusplus)
999 int
1000 yyparse (void)
1001 #else
1002 int
1003 yyparse ()
1004
1005 #endif
1006 #endif
1007 {
1008 /* The lookahead symbol. */
1009 int yychar;
1010
1011 /* The semantic value of the lookahead symbol. */
1012 YYSTYPE yylval;
1013
1014 /* Number of syntax errors so far. */
1015 int yynerrs;
1016 /* Location data for the lookahead symbol. */
1017 YYLTYPE yylloc;
1018
1019 register int yystate;
1020 register int yyn;
1021 int yyresult;
1022 /* Number of tokens to shift before error messages enabled. */
1023 int yyerrstatus;
1024 /* Lookahead token as an internal (translated) token number. */
1025 int yytoken = 0;
1026
1027 /* Three stacks and their tools:
1028 `yyss': related to states,
1029 `yyvs': related to semantic values,
1030 `yyls': related to locations.
1031
1032 Refer to the stacks thru separate pointers, to allow yyoverflow
1033 to reallocate them elsewhere. */
1034
1035 /* The state stack. */
1036 short yyssa[YYINITDEPTH];
1037 short *yyss = yyssa;
1038 register short *yyssp;
1039
1040 /* The semantic value stack. */
1041 YYSTYPE yyvsa[YYINITDEPTH];
1042 YYSTYPE *yyvs = yyvsa;
1043 register YYSTYPE *yyvsp;
1044
1045 /* The location stack. */
1046 YYLTYPE yylsa[YYINITDEPTH];
1047 YYLTYPE *yyls = yylsa;
1048 YYLTYPE *yylsp;
1049 YYLTYPE *yylerrsp;
1050
1051 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1052
1053 YYSIZE_T yystacksize = YYINITDEPTH;
1054
1055 /* The variables used to return semantic value and location from the
1056 action routines. */
1057 YYSTYPE yyval;
1058 YYLTYPE yyloc;
1059
1060 /* When reducing, the number of symbols on the RHS of the reduced
1061 rule. */
1062 int yylen;
1063
1064 YYDPRINTF ((stderr, "Starting parse\n"));
1065
1066 yystate = 0;
1067 yyerrstatus = 0;
1068 yynerrs = 0;
1069 yychar = YYEMPTY; /* Cause a token to be read. */
1070
1071 /* Initialize stack pointers.
1072 Waste one element of value and location stack
1073 so that they stay on the same level as the state stack.
1074 The wasted elements are never initialized. */
1075
1076 yyssp = yyss;
1077 yyvsp = yyvs;
1078 yylsp = yyls;
1079
1080 /* User initialization code. */
1081 #line 70 "parse-gram.y"
1082 {
1083 /* Bison's grammar can initial empty locations, hence a default
1084 location is needed. */
1085 (*yylsp).start.file = (*yylsp).end.file = current_file;
1086 (*yylsp).start.line = (*yylsp).end.line = 1;
1087 (*yylsp).start.column = (*yylsp).end.column = 0;
1088 }
1089 /* Line 818 of yacc.c. */
1090 #line 1091 "parse-gram.c"
1091 goto yysetstate;
1092
1093 /*------------------------------------------------------------.
1094 | yynewstate -- Push a new state, which is found in yystate. |
1095 `------------------------------------------------------------*/
1096 yynewstate:
1097 /* In all cases, when you get here, the value and location stacks
1098 have just been pushed. so pushing a state here evens the stacks.
1099 */
1100 yyssp++;
1101
1102 yysetstate:
1103 *yyssp = yystate;
1104
1105 if (yyss + yystacksize - 1 <= yyssp)
1106 {
1107 /* Get the current used size of the three stacks, in elements. */
1108 YYSIZE_T yysize = yyssp - yyss + 1;
1109
1110 #ifdef yyoverflow
1111 {
1112 /* Give user a chance to reallocate the stack. Use copies of
1113 these so that the &'s don't force the real ones into
1114 memory. */
1115 YYSTYPE *yyvs1 = yyvs;
1116 short *yyss1 = yyss;
1117 YYLTYPE *yyls1 = yyls;
1118
1119 /* Each stack pointer address is followed by the size of the
1120 data in use in that stack, in bytes. This used to be a
1121 conditional around just the two extra args, but that might
1122 be undefined if yyoverflow is a macro. */
1123 yyoverflow ("parser stack overflow",
1124 &yyss1, yysize * sizeof (*yyssp),
1125 &yyvs1, yysize * sizeof (*yyvsp),
1126 &yyls1, yysize * sizeof (*yylsp),
1127 &yystacksize);
1128 yyls = yyls1;
1129 yyss = yyss1;
1130 yyvs = yyvs1;
1131 }
1132 #else /* no yyoverflow */
1133 # ifndef YYSTACK_RELOCATE
1134 goto yyoverflowlab;
1135 # else
1136 /* Extend the stack our own way. */
1137 if (YYMAXDEPTH <= yystacksize)
1138 goto yyoverflowlab;
1139 yystacksize *= 2;
1140 if (YYMAXDEPTH < yystacksize)
1141 yystacksize = YYMAXDEPTH;
1142
1143 {
1144 short *yyss1 = yyss;
1145 union yyalloc *yyptr =
1146 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1147 if (! yyptr)
1148 goto yyoverflowlab;
1149 YYSTACK_RELOCATE (yyss);
1150 YYSTACK_RELOCATE (yyvs);
1151 YYSTACK_RELOCATE (yyls);
1152 # undef YYSTACK_RELOCATE
1153 if (yyss1 != yyssa)
1154 YYSTACK_FREE (yyss1);
1155 }
1156 # endif
1157 #endif /* no yyoverflow */
1158
1159 yyssp = yyss + yysize - 1;
1160 yyvsp = yyvs + yysize - 1;
1161 yylsp = yyls + yysize - 1;
1162
1163 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1164 (unsigned long int) yystacksize));
1165
1166 if (yyss + yystacksize - 1 <= yyssp)
1167 YYABORT;
1168 }
1169
1170 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1171
1172 goto yybackup;
1173
1174 /*-----------.
1175 | yybackup. |
1176 `-----------*/
1177 yybackup:
1178
1179 /* Do appropriate processing given the current state. */
1180 /* Read a lookahead token if we need one and don't already have one. */
1181 /* yyresume: */
1182
1183 /* First try to decide what to do without reference to lookahead token. */
1184
1185 yyn = yypact[yystate];
1186 if (yyn == YYPACT_NINF)
1187 goto yydefault;
1188
1189 /* Not known => get a lookahead token if don't already have one. */
1190
1191 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1192 if (yychar == YYEMPTY)
1193 {
1194 YYDPRINTF ((stderr, "Reading a token: "));
1195 yychar = YYLEX;
1196 }
1197
1198 if (yychar <= YYEOF)
1199 {
1200 yychar = yytoken = YYEOF;
1201 YYDPRINTF ((stderr, "Now at end of input.\n"));
1202 }
1203 else
1204 {
1205 yytoken = YYTRANSLATE (yychar);
1206 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1207 }
1208
1209 /* If the proper action on seeing token YYTOKEN is to reduce or to
1210 detect an error, take that action. */
1211 yyn += yytoken;
1212 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1213 goto yydefault;
1214 yyn = yytable[yyn];
1215 if (yyn <= 0)
1216 {
1217 if (yyn == 0 || yyn == YYTABLE_NINF)
1218 goto yyerrlab;
1219 yyn = -yyn;
1220 goto yyreduce;
1221 }
1222
1223 if (yyn == YYFINAL)
1224 YYACCEPT;
1225
1226 /* Shift the lookahead token. */
1227 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1228
1229 /* Discard the token being shifted unless it is eof. */
1230 if (yychar != YYEOF)
1231 yychar = YYEMPTY;
1232
1233 *++yyvsp = yylval;
1234 *++yylsp = yylloc;
1235
1236 /* Count tokens shifted since error; after three, turn off error
1237 status. */
1238 if (yyerrstatus)
1239 yyerrstatus--;
1240
1241 yystate = yyn;
1242 goto yynewstate;
1243
1244
1245 /*-----------------------------------------------------------.
1246 | yydefault -- do the default action for the current state. |
1247 `-----------------------------------------------------------*/
1248 yydefault:
1249 yyn = yydefact[yystate];
1250 if (yyn == 0)
1251 goto yyerrlab;
1252 goto yyreduce;
1253
1254
1255 /*-----------------------------.
1256 | yyreduce -- Do a reduction. |
1257 `-----------------------------*/
1258 yyreduce:
1259 /* yyn is the number of a rule to reduce with. */
1260 yylen = yyr2[yyn];
1261
1262 /* If YYLEN is nonzero, implement the default value of the action:
1263 `$$ = $1'.
1264
1265 Otherwise, the following line sets YYVAL to garbage.
1266 This behavior is undocumented and Bison
1267 users should not rely upon it. Assigning to YYVAL
1268 unconditionally makes the parser a bit smaller, and it avoids a
1269 GCC warning that YYVAL may be used uninitialized. */
1270 yyval = yyvsp[1-yylen];
1271
1272 /* Default location. */
1273 YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);
1274 YY_REDUCE_PRINT (yyn);
1275 switch (yyn)
1276 {
1277 case 6:
1278 #line 186 "parse-gram.y"
1279 { prologue_augment (yyvsp[0].chars, yylsp[0]); }
1280 break;
1281
1282 case 7:
1283 #line 187 "parse-gram.y"
1284 { debug_flag = true; }
1285 break;
1286
1287 case 8:
1288 #line 188 "parse-gram.y"
1289 { muscle_insert (yyvsp[-1].chars, yyvsp[0].chars); }
1290 break;
1291
1292 case 9:
1293 #line 189 "parse-gram.y"
1294 { defines_flag = true; }
1295 break;
1296
1297 case 10:
1298 #line 190 "parse-gram.y"
1299 { error_verbose = true; }
1300 break;
1301
1302 case 11:
1303 #line 191 "parse-gram.y"
1304 { expected_conflicts = yyvsp[0].integer; }
1305 break;
1306
1307 case 12:
1308 #line 192 "parse-gram.y"
1309 { spec_file_prefix = yyvsp[0].chars; }
1310 break;
1311
1312 case 13:
1313 #line 194 "parse-gram.y"
1314 {
1315 nondeterministic_parser = true;
1316 glr_parser = true;
1317 }
1318 break;
1319
1320 case 14:
1321 #line 199 "parse-gram.y"
1322 {
1323 muscle_code_grow ("initial_action", yyvsp[0].chars, yylsp[0]);
1324 }
1325 break;
1326
1327 case 15:
1328 #line 202 "parse-gram.y"
1329 { add_param ("lex_param", yyvsp[0].chars, yylsp[0]); }
1330 break;
1331
1332 case 16:
1333 #line 203 "parse-gram.y"
1334 { locations_flag = true; }
1335 break;
1336
1337 case 17:
1338 #line 204 "parse-gram.y"
1339 { spec_name_prefix = yyvsp[0].chars; }
1340 break;
1341
1342 case 18:
1343 #line 205 "parse-gram.y"
1344 { no_lines_flag = true; }
1345 break;
1346
1347 case 19:
1348 #line 206 "parse-gram.y"
1349 { nondeterministic_parser = true; }
1350 break;
1351
1352 case 20:
1353 #line 207 "parse-gram.y"
1354 { spec_outfile = yyvsp[0].chars; }
1355 break;
1356
1357 case 21:
1358 #line 208 "parse-gram.y"
1359 { add_param ("parse_param", yyvsp[0].chars, yylsp[0]); }
1360 break;
1361
1362 case 22:
1363 #line 209 "parse-gram.y"
1364 { pure_parser = true; }
1365 break;
1366
1367 case 23:
1368 #line 210 "parse-gram.y"
1369 { skeleton = yyvsp[0].chars; }
1370 break;
1371
1372 case 24:
1373 #line 211 "parse-gram.y"
1374 { token_table_flag = true; }
1375 break;
1376
1377 case 25:
1378 #line 212 "parse-gram.y"
1379 { report_flag = report_states; }
1380 break;
1381
1382 case 26:
1383 #line 213 "parse-gram.y"
1384 { yacc_flag = true; }
1385 break;
1386
1387 case 30:
1388 #line 221 "parse-gram.y"
1389 {
1390 grammar_start_symbol_set (yyvsp[0].symbol, yylsp[0]);
1391 }
1392 break;
1393
1394 case 31:
1395 #line 225 "parse-gram.y"
1396 {
1397 typed = true;
1398 MUSCLE_INSERT_INT ("stype_line", yylsp[0].start.line);
1399 muscle_insert ("stype", yyvsp[0].chars);
1400 }
1401 break;
1402
1403 case 32:
1404 #line 231 "parse-gram.y"
1405 {
1406 symbol_list *list;
1407 for (list = yyvsp[0].list; list; list = list->next)
1408 symbol_destructor_set (list->sym, yyvsp[-1].chars, yylsp[-1]);
1409 symbol_list_free (yyvsp[0].list);
1410 }
1411 break;
1412
1413 case 33:
1414 #line 238 "parse-gram.y"
1415 {
1416 symbol_list *list;
1417 for (list = yyvsp[0].list; list; list = list->next)
1418 symbol_printer_set (list->sym, yyvsp[-1].chars, list->location);
1419 symbol_list_free (yyvsp[0].list);
1420 }
1421 break;
1422
1423 case 34:
1424 #line 245 "parse-gram.y"
1425 {
1426 if (0 <= yyvsp[0].integer && yyvsp[0].integer <= 1)
1427 default_prec = yyvsp[0].integer;
1428 else
1429 complain_at (yylsp[-1], _("invalid value for `%default-prec'"));
1430 }
1431 break;
1432
1433 case 35:
1434 #line 254 "parse-gram.y"
1435 { current_class = nterm_sym; }
1436 break;
1437
1438 case 36:
1439 #line 255 "parse-gram.y"
1440 {
1441 current_class = unknown_sym;
1442 current_type = NULL;
1443 }
1444 break;
1445
1446 case 37:
1447 #line 259 "parse-gram.y"
1448 { current_class = token_sym; }
1449 break;
1450
1451 case 38:
1452 #line 260 "parse-gram.y"
1453 {
1454 current_class = unknown_sym;
1455 current_type = NULL;
1456 }
1457 break;
1458
1459 case 39:
1460 #line 265 "parse-gram.y"
1461 {
1462 symbol_list *list;
1463 for (list = yyvsp[0].list; list; list = list->next)
1464 symbol_type_set (list->sym, yyvsp[-1].uniqstr, yylsp[-1]);
1465 symbol_list_free (yyvsp[0].list);
1466 }
1467 break;
1468
1469 case 40:
1470 #line 275 "parse-gram.y"
1471 {
1472 symbol_list *list;
1473 ++current_prec;
1474 for (list = yyvsp[0].list; list; list = list->next)
1475 {
1476 symbol_type_set (list->sym, current_type, yylsp[-1]);
1477 symbol_precedence_set (list->sym, current_prec, yyvsp[-2].assoc, yylsp[-2]);
1478 }
1479 symbol_list_free (yyvsp[0].list);
1480 current_type = NULL;
1481 }
1482 break;
1483
1484 case 41:
1485 #line 289 "parse-gram.y"
1486 { yyval.assoc = left_assoc; }
1487 break;
1488
1489 case 42:
1490 #line 290 "parse-gram.y"
1491 { yyval.assoc = right_assoc; }
1492 break;
1493
1494 case 43:
1495 #line 291 "parse-gram.y"
1496 { yyval.assoc = non_assoc; }
1497 break;
1498
1499 case 44:
1500 #line 295 "parse-gram.y"
1501 { current_type = NULL; }
1502 break;
1503
1504 case 45:
1505 #line 296 "parse-gram.y"
1506 { current_type = yyvsp[0].uniqstr; }
1507 break;
1508
1509 case 46:
1510 #line 302 "parse-gram.y"
1511 { yyval.list = symbol_list_new (yyvsp[0].symbol, yylsp[0]); }
1512 break;
1513
1514 case 47:
1515 #line 303 "parse-gram.y"
1516 { yyval.list = symbol_list_prepend (yyvsp[-1].list, yyvsp[0].symbol, yylsp[0]); }
1517 break;
1518
1519 case 48:
1520 #line 309 "parse-gram.y"
1521 {
1522 current_type = yyvsp[0].uniqstr;
1523 }
1524 break;
1525
1526 case 49:
1527 #line 313 "parse-gram.y"
1528 {
1529 symbol_class_set (yyvsp[0].symbol, current_class, yylsp[0]);
1530 symbol_type_set (yyvsp[0].symbol, current_type, yylsp[0]);
1531 }
1532 break;
1533
1534 case 50:
1535 #line 318 "parse-gram.y"
1536 {
1537 symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]);
1538 symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]);
1539 symbol_user_token_number_set (yyvsp[-1].symbol, yyvsp[0].integer, yylsp[0]);
1540 }
1541 break;
1542
1543 case 51:
1544 #line 324 "parse-gram.y"
1545 {
1546 symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]);
1547 symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]);
1548 symbol_make_alias (yyvsp[-1].symbol, yyvsp[0].symbol, yyloc);
1549 }
1550 break;
1551
1552 case 52:
1553 #line 330 "parse-gram.y"
1554 {
1555 symbol_class_set (yyvsp[-2].symbol, current_class, yylsp[-2]);
1556 symbol_type_set (yyvsp[-2].symbol, current_type, yylsp[-2]);
1557 symbol_user_token_number_set (yyvsp[-2].symbol, yyvsp[-1].integer, yylsp[-1]);
1558 symbol_make_alias (yyvsp[-2].symbol, yyvsp[0].symbol, yyloc);
1559 }
1560 break;
1561
1562 case 58:
1563 #line 359 "parse-gram.y"
1564 {
1565 if (yacc_flag)
1566 complain_at (yyloc, _("POSIX forbids declarations in the grammar"));
1567 }
1568 break;
1569
1570 case 59:
1571 #line 364 "parse-gram.y"
1572 {
1573 yyerrok;
1574 }
1575 break;
1576
1577 case 60:
1578 #line 370 "parse-gram.y"
1579 { current_lhs = yyvsp[0].symbol; current_lhs_location = yylsp[0]; }
1580 break;
1581
1582 case 62:
1583 #line 374 "parse-gram.y"
1584 { grammar_rule_end (yylsp[0]); }
1585 break;
1586
1587 case 63:
1588 #line 375 "parse-gram.y"
1589 { grammar_rule_end (yylsp[0]); }
1590 break;
1591
1592 case 65:
1593 #line 381 "parse-gram.y"
1594 { grammar_rule_begin (current_lhs, current_lhs_location); }
1595 break;
1596
1597 case 66:
1598 #line 383 "parse-gram.y"
1599 { grammar_current_rule_symbol_append (yyvsp[0].symbol, yylsp[0]); }
1600 break;
1601
1602 case 67:
1603 #line 385 "parse-gram.y"
1604 { grammar_current_rule_action_append (yyvsp[0].chars, yylsp[0]); }
1605 break;
1606
1607 case 68:
1608 #line 387 "parse-gram.y"
1609 { grammar_current_rule_prec_set (yyvsp[0].symbol, yylsp[0]); }
1610 break;
1611
1612 case 69:
1613 #line 389 "parse-gram.y"
1614 { grammar_current_rule_dprec_set (yyvsp[0].integer, yylsp[0]); }
1615 break;
1616
1617 case 70:
1618 #line 391 "parse-gram.y"
1619 { grammar_current_rule_merge_set (yyvsp[0].uniqstr, yylsp[0]); }
1620 break;
1621
1622 case 71:
1623 #line 395 "parse-gram.y"
1624 { yyval.symbol = yyvsp[0].symbol; }
1625 break;
1626
1627 case 72:
1628 #line 396 "parse-gram.y"
1629 { yyval.symbol = yyvsp[0].symbol; }
1630 break;
1631
1632 case 73:
1633 #line 401 "parse-gram.y"
1634 { yyval.chars = yyvsp[0].chars; }
1635 break;
1636
1637 case 74:
1638 #line 407 "parse-gram.y"
1639 {
1640 yyval.symbol = symbol_get (yyvsp[0].chars, yylsp[0]);
1641 symbol_class_set (yyval.symbol, token_sym, yylsp[0]);
1642 }
1643 break;
1644
1645 case 75:
1646 #line 416 "parse-gram.y"
1647 {
1648 yyval.chars = yyvsp[0].chars + 1;
1649 yyval.chars[strlen (yyval.chars) - 1] = '\0';
1650 }
1651 break;
1652
1653 case 77:
1654 #line 425 "parse-gram.y"
1655 {
1656 muscle_code_grow ("epilogue", yyvsp[0].chars, yylsp[0]);
1657 scanner_last_string_free ();
1658 }
1659 break;
1660
1661
1662 }
1663
1664 /* Line 1010 of yacc.c. */
1665 #line 1666 "parse-gram.c"
1666 \f
1667 yyvsp -= yylen;
1668 yyssp -= yylen;
1669 yylsp -= yylen;
1670
1671 YY_STACK_PRINT (yyss, yyssp);
1672
1673 *++yyvsp = yyval;
1674 *++yylsp = yyloc;
1675
1676 /* Now `shift' the result of the reduction. Determine what state
1677 that goes to, based on the state we popped back to and the rule
1678 number reduced by. */
1679
1680 yyn = yyr1[yyn];
1681
1682 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1683 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1684 yystate = yytable[yystate];
1685 else
1686 yystate = yydefgoto[yyn - YYNTOKENS];
1687
1688 goto yynewstate;
1689
1690
1691 /*------------------------------------.
1692 | yyerrlab -- here on detecting error |
1693 `------------------------------------*/
1694 yyerrlab:
1695 /* If not already recovering from an error, report this error. */
1696 if (!yyerrstatus)
1697 {
1698 ++yynerrs;
1699 #if YYERROR_VERBOSE
1700 yyn = yypact[yystate];
1701
1702 if (YYPACT_NINF < yyn && yyn < YYLAST)
1703 {
1704 YYSIZE_T yysize = 0;
1705 int yytype = YYTRANSLATE (yychar);
1706 const char* yyprefix;
1707 char *yymsg;
1708 int yyx;
1709
1710 /* Start YYX at -YYN if negative to avoid negative indexes in
1711 YYCHECK. */
1712 int yyxbegin = yyn < 0 ? -yyn : 0;
1713
1714 /* Stay within bounds of both yycheck and yytname. */
1715 int yychecklim = YYLAST - yyn;
1716 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1717 int yycount = 0;
1718
1719 yyprefix = ", expecting ";
1720 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1721 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1722 {
1723 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
1724 yycount += 1;
1725 if (yycount == 5)
1726 {
1727 yysize = 0;
1728 break;
1729 }
1730 }
1731 yysize += (sizeof ("syntax error, unexpected ")
1732 + yystrlen (yytname[yytype]));
1733 yymsg = (char *) YYSTACK_ALLOC (yysize);
1734 if (yymsg != 0)
1735 {
1736 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1737 yyp = yystpcpy (yyp, yytname[yytype]);
1738
1739 if (yycount < 5)
1740 {
1741 yyprefix = ", expecting ";
1742 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1743 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1744 {
1745 yyp = yystpcpy (yyp, yyprefix);
1746 yyp = yystpcpy (yyp, yytname[yyx]);
1747 yyprefix = " or ";
1748 }
1749 }
1750 yyerror (yymsg);
1751 YYSTACK_FREE (yymsg);
1752 }
1753 else
1754 yyerror ("syntax error; also virtual memory exhausted");
1755 }
1756 else
1757 #endif /* YYERROR_VERBOSE */
1758 yyerror ("syntax error");
1759 }
1760
1761 yylerrsp = yylsp;
1762
1763 if (yyerrstatus == 3)
1764 {
1765 /* If just tried and failed to reuse lookahead token after an
1766 error, discard it. */
1767
1768 if (yychar <= YYEOF)
1769 {
1770 /* If at end of input, pop the error token,
1771 then the rest of the stack, then return failure. */
1772 if (yychar == YYEOF)
1773 for (;;)
1774 {
1775 YYPOPSTACK;
1776 if (yyssp == yyss)
1777 YYABORT;
1778 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1779 yydestruct (yystos[*yyssp], yyvsp, yylsp);
1780 }
1781 }
1782 else
1783 {
1784 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1785 yydestruct (yytoken, &yylval, &yylloc);
1786 yychar = YYEMPTY;
1787 *++yylerrsp = yylloc;
1788 }
1789 }
1790
1791 /* Else will try to reuse lookahead token after shifting the error
1792 token. */
1793 goto yyerrlab1;
1794
1795
1796 /*---------------------------------------------------.
1797 | yyerrorlab -- error raised explicitly by YYERROR. |
1798 `---------------------------------------------------*/
1799 yyerrorlab:
1800
1801 #ifdef __GNUC__
1802 /* Pacify GCC when the user code never invokes YYERROR and the label
1803 yyerrorlab therefore never appears in user code. */
1804 if (0)
1805 goto yyerrorlab;
1806 #endif
1807
1808 yyvsp -= yylen;
1809 yyssp -= yylen;
1810 yystate = *yyssp;
1811 yylerrsp = yylsp;
1812 *++yylerrsp = yyloc;
1813 yylsp -= yylen;
1814 goto yyerrlab1;
1815
1816
1817 /*-------------------------------------------------------------.
1818 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1819 `-------------------------------------------------------------*/
1820 yyerrlab1:
1821 yyerrstatus = 3; /* Each real token shifted decrements this. */
1822
1823 for (;;)
1824 {
1825 yyn = yypact[yystate];
1826 if (yyn != YYPACT_NINF)
1827 {
1828 yyn += YYTERROR;
1829 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1830 {
1831 yyn = yytable[yyn];
1832 if (0 < yyn)
1833 break;
1834 }
1835 }
1836
1837 /* Pop the current state because it cannot handle the error token. */
1838 if (yyssp == yyss)
1839 YYABORT;
1840
1841 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1842 yydestruct (yystos[yystate], yyvsp, yylsp);
1843 YYPOPSTACK;
1844 yystate = *yyssp;
1845 YY_STACK_PRINT (yyss, yyssp);
1846 }
1847
1848 if (yyn == YYFINAL)
1849 YYACCEPT;
1850
1851 YYDPRINTF ((stderr, "Shifting error token, "));
1852
1853 *++yyvsp = yylval;
1854 YYLLOC_DEFAULT (yyloc, yylsp, yylerrsp - yylsp);
1855 *++yylsp = yyloc;
1856
1857 yystate = yyn;
1858 goto yynewstate;
1859
1860
1861 /*-------------------------------------.
1862 | yyacceptlab -- YYACCEPT comes here. |
1863 `-------------------------------------*/
1864 yyacceptlab:
1865 yyresult = 0;
1866 goto yyreturn;
1867
1868 /*-----------------------------------.
1869 | yyabortlab -- YYABORT comes here. |
1870 `-----------------------------------*/
1871 yyabortlab:
1872 yyresult = 1;
1873 goto yyreturn;
1874
1875 #ifndef yyoverflow
1876 /*----------------------------------------------.
1877 | yyoverflowlab -- parser overflow comes here. |
1878 `----------------------------------------------*/
1879 yyoverflowlab:
1880 yyerror ("parser stack overflow");
1881 yyresult = 2;
1882 /* Fall through. */
1883 #endif
1884
1885 yyreturn:
1886 #ifndef yyoverflow
1887 if (yyss != yyssa)
1888 YYSTACK_FREE (yyss);
1889 #endif
1890 return yyresult;
1891 }
1892
1893
1894 #line 431 "parse-gram.y"
1895
1896
1897
1898 /* Return the location of the left-hand side of a rule whose
1899 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
1900 the right-hand side, and return an empty location equal to the end
1901 boundary of RHS[0] if the right-hand side is empty. */
1902
1903 static YYLTYPE
1904 lloc_default (YYLTYPE const *rhs, int n)
1905 {
1906 int i;
1907 YYLTYPE loc;
1908 loc.start = loc.end = rhs[n].end;
1909
1910 /* Ignore empty nonterminals the start of the the right-hand side.
1911 Do not bother to ignore them at the end of the right-hand side,
1912 since empty nonterminals have the same end as their predecessors. */
1913 for (i = 1; i <= n; i++)
1914 if (! equal_boundaries (rhs[i].start, rhs[i].end))
1915 {
1916 loc.start = rhs[i].start;
1917 break;
1918 }
1919
1920 return loc;
1921 }
1922
1923
1924 /* Add a lex-param or a parse-param (depending on TYPE) with
1925 declaration DECL and location LOC. */
1926
1927 static void
1928 add_param (char const *type, char *decl, location loc)
1929 {
1930 static char const alphanum[] =
1931 "0123456789"
1932 "abcdefghijklmnopqrstuvwxyz"
1933 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1934 "_";
1935 char const *alpha = alphanum + 10;
1936 char const *name_start = NULL;
1937 char *p;
1938
1939 for (p = decl; *p; p++)
1940 if ((p == decl || ! strchr (alphanum, p[-1])) && strchr (alpha, p[0]))
1941 name_start = p;
1942
1943 /* Strip the surrounding '{' and '}'. */
1944 decl++;
1945 p[-1] = '\0';
1946
1947 if (! name_start)
1948 complain_at (loc, _("missing identifier in parameter declaration"));
1949 else
1950 {
1951 char *name;
1952 size_t name_len;
1953
1954 for (name_len = 1;
1955 name_start[name_len] && strchr (alphanum, name_start[name_len]);
1956 name_len++)
1957 continue;
1958
1959 name = xmalloc (name_len + 1);
1960 memcpy (name, name_start, name_len);
1961 name[name_len] = '\0';
1962 muscle_pair_list_grow (type, decl, name);
1963 free (name);
1964 }
1965
1966 scanner_last_string_free ();
1967 }
1968
1969 /*----------------------------------------------------.
1970 | When debugging the parser, display tokens' values. |
1971 `----------------------------------------------------*/
1972
1973 static void
1974 print_token_value (FILE *file, int type, YYSTYPE const *value)
1975 {
1976 fputc (' ', file);
1977 switch (type)
1978 {
1979 case ID:
1980 fprintf (file, " = %s", value->symbol->tag);
1981 break;
1982
1983 case INT:
1984 fprintf (file, " = %d", value->integer);
1985 break;
1986
1987 case STRING:
1988 fprintf (file, " = \"%s\"", value->chars);
1989 break;
1990
1991 case TYPE:
1992 fprintf (file, " = <%s>", value->uniqstr);
1993 break;
1994
1995 case BRACED_CODE:
1996 case PERCENT_DESTRUCTOR:
1997 case PERCENT_LEX_PARAM:
1998 case PERCENT_PARSE_PARAM:
1999 case PERCENT_PRINTER:
2000 case PERCENT_UNION:
2001 case PROLOGUE:
2002 case EPILOGUE:
2003 fprintf (file, " = {{ %s }}", value->chars);
2004 break;
2005
2006 default:
2007 fprintf (file, "unknown token type");
2008 break;
2009 }
2010 }
2011
2012 static void
2013 gram_error (location const *loc, char const *msg)
2014 {
2015 complain_at (*loc, "%s", msg);
2016 }
2017
2018 char const *
2019 token_name (int type)
2020 {
2021 return yytname[type];
2022 }
2023