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