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