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