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