]>
Commit | Line | Data |
---|---|---|
1 | /* A Bison parser, made by GNU Bison 2.4.1.86-ae09ec. */ | |
2 | ||
3 | /* Skeleton implementation for Bison's Yacc-like parsers in C | |
4 | ||
5 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | |
6 | 2007, 2008, 2009 Free Software 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 3 of the License, or | |
11 | (at your option) 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, see <http://www.gnu.org/licenses/>. */ | |
20 | ||
21 | /* As a special exception, you may create a larger work that contains | |
22 | part or all of the Bison parser skeleton and distribute that work | |
23 | under terms of your choice, so long as that work isn't itself a | |
24 | parser generator using the skeleton or a modified version thereof | |
25 | as a parser skeleton. Alternatively, if you modify or redistribute | |
26 | the parser skeleton itself, you may (at your option) remove this | |
27 | special exception, which will cause the skeleton and the resulting | |
28 | Bison output files to be licensed under the GNU General Public | |
29 | License without this special exception. | |
30 | ||
31 | This special exception was added by the Free Software Foundation in | |
32 | version 2.2 of Bison. */ | |
33 | ||
34 | /* C LALR(1) parser skeleton written by Richard Stallman, by | |
35 | simplifying the original so-called "semantic" parser. */ | |
36 | ||
37 | /* All symbols defined below should begin with yy or YY, to avoid | |
38 | infringing on user name space. This should be done even for local | |
39 | variables, as they might otherwise be expanded by user macros. | |
40 | There are some unavoidable exceptions within include files to | |
41 | define necessary library symbols; they are noted "INFRINGES ON | |
42 | USER NAME SPACE" below. */ | |
43 | ||
44 | /* Identify Bison output. */ | |
45 | #define YYBISON 1 | |
46 | ||
47 | /* Bison version. */ | |
48 | #define YYBISON_VERSION "2.4.1.86-ae09ec" | |
49 | ||
50 | /* Skeleton name. */ | |
51 | #define YYSKELETON_NAME "yacc.c" | |
52 | ||
53 | /* Pure parsers. */ | |
54 | #define YYPURE 1 | |
55 | ||
56 | /* Push parsers. */ | |
57 | #define YYPUSH 0 | |
58 | ||
59 | /* Pull parsers. */ | |
60 | #define YYPULL 1 | |
61 | ||
62 | /* Using locations. */ | |
63 | #define YYLSP_NEEDED 1 | |
64 | ||
65 | /* Substitute the variable and function names. */ | |
66 | #define yyparse gram_parse | |
67 | #define yylex gram_lex | |
68 | #define yyerror gram_error | |
69 | #define yylval gram_lval | |
70 | #define yychar gram_char | |
71 | #define yydebug gram_debug | |
72 | #define yynerrs gram_nerrs | |
73 | #define yylloc gram_lloc | |
74 | ||
75 | /* Copy the first part of user declarations. */ | |
76 | ||
77 | /* Line 190 of yacc.c */ | |
78 | #line 1 "parse-gram.y" | |
79 | /* Bison Grammar Parser -*- C -*- | |
80 | ||
81 | Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free | |
82 | Software Foundation, Inc. | |
83 | ||
84 | This file is part of Bison, the GNU Compiler Compiler. | |
85 | ||
86 | This program is free software: you can redistribute it and/or modify | |
87 | it under the terms of the GNU General Public License as published by | |
88 | the Free Software Foundation, either version 3 of the License, or | |
89 | (at your option) any later version. | |
90 | ||
91 | This program is distributed in the hope that it will be useful, | |
92 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
93 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
94 | GNU General Public License for more details. | |
95 | ||
96 | You should have received a copy of the GNU General Public License | |
97 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
98 | ||
99 | #include <config.h> | |
100 | #include "system.h" | |
101 | ||
102 | #include "complain.h" | |
103 | #include "conflicts.h" | |
104 | #include "files.h" | |
105 | #include "getargs.h" | |
106 | #include "gram.h" | |
107 | #include "muscle_tab.h" | |
108 | #include "named-ref.h" | |
109 | #include "quotearg.h" | |
110 | #include "reader.h" | |
111 | #include "symlist.h" | |
112 | #include "scan-gram.h" | |
113 | #include "scan-code.h" | |
114 | ||
115 | #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N) | |
116 | static YYLTYPE lloc_default (YYLTYPE const *, int); | |
117 | ||
118 | #define YY_LOCATION_PRINT(File, Loc) \ | |
119 | location_print (File, Loc) | |
120 | ||
121 | static void version_check (location const *loc, char const *version); | |
122 | ||
123 | /* Request detailed syntax error messages, and pass them to GRAM_ERROR. | |
124 | FIXME: depends on the undocumented availability of YYLLOC. */ | |
125 | #undef yyerror | |
126 | #define yyerror(Msg) \ | |
127 | gram_error (&yylloc, Msg) | |
128 | static void gram_error (location const *, char const *); | |
129 | ||
130 | static char const *char_name (char); | |
131 | ||
132 | /** Add a lex-param or a parse-param. | |
133 | * | |
134 | * \param type \a lex_param or \a parse_param | |
135 | * \param decl the formal argument | |
136 | * \param loc the location in the source. | |
137 | */ | |
138 | static void add_param (char const *type, char *decl, location loc); | |
139 | ||
140 | ||
141 | static symbol_class current_class = unknown_sym; | |
142 | static uniqstr current_type = NULL; | |
143 | static symbol *current_lhs; | |
144 | static location current_lhs_location; | |
145 | static named_ref *current_lhs_named_ref; | |
146 | static int current_prec = 0; | |
147 | ||
148 | #define YYTYPE_INT16 int_fast16_t | |
149 | #define YYTYPE_INT8 int_fast8_t | |
150 | #define YYTYPE_UINT16 uint_fast16_t | |
151 | #define YYTYPE_UINT8 uint_fast8_t | |
152 | ||
153 | ||
154 | /* Line 190 of yacc.c */ | |
155 | #line 156 "../../branch-2.5/src/parse-gram.c" | |
156 | ||
157 | /* Enabling traces. */ | |
158 | #ifndef YYDEBUG | |
159 | # define YYDEBUG 1 | |
160 | #endif | |
161 | ||
162 | /* Enabling verbose error messages. */ | |
163 | #ifdef YYERROR_VERBOSE | |
164 | # undef YYERROR_VERBOSE | |
165 | # define YYERROR_VERBOSE 1 | |
166 | #else | |
167 | # define YYERROR_VERBOSE 1 | |
168 | #endif | |
169 | ||
170 | /* Enabling the token table. */ | |
171 | #ifndef YYTOKEN_TABLE | |
172 | # define YYTOKEN_TABLE 0 | |
173 | #endif | |
174 | ||
175 | ||
176 | /* Tokens. */ | |
177 | #ifndef YYTOKENTYPE | |
178 | # define YYTOKENTYPE | |
179 | /* Put the tokens into the symbol table, so that GDB and other debuggers | |
180 | know about them. */ | |
181 | enum yytokentype { | |
182 | GRAM_EOF = 0, | |
183 | STRING = 258, | |
184 | INT = 259, | |
185 | PERCENT_TOKEN = 260, | |
186 | PERCENT_NTERM = 261, | |
187 | PERCENT_TYPE = 262, | |
188 | PERCENT_DESTRUCTOR = 263, | |
189 | PERCENT_PRINTER = 264, | |
190 | PERCENT_LEFT = 265, | |
191 | PERCENT_RIGHT = 266, | |
192 | PERCENT_NONASSOC = 267, | |
193 | PERCENT_PREC = 268, | |
194 | PERCENT_DPREC = 269, | |
195 | PERCENT_MERGE = 270, | |
196 | PERCENT_CODE = 271, | |
197 | PERCENT_DEBUG = 272, | |
198 | PERCENT_DEFAULT_PREC = 273, | |
199 | PERCENT_DEFINE = 274, | |
200 | PERCENT_DEFINES = 275, | |
201 | PERCENT_ERROR_VERBOSE = 276, | |
202 | PERCENT_EXPECT = 277, | |
203 | PERCENT_EXPECT_RR = 278, | |
204 | PERCENT_FILE_PREFIX = 279, | |
205 | PERCENT_GLR_PARSER = 280, | |
206 | PERCENT_INITIAL_ACTION = 281, | |
207 | PERCENT_LANGUAGE = 282, | |
208 | PERCENT_LEX_PARAM = 283, | |
209 | PERCENT_LOCATIONS = 284, | |
210 | PERCENT_NAME_PREFIX = 285, | |
211 | PERCENT_NO_DEFAULT_PREC = 286, | |
212 | PERCENT_NO_LINES = 287, | |
213 | PERCENT_NONDETERMINISTIC_PARSER = 288, | |
214 | PERCENT_OUTPUT = 289, | |
215 | PERCENT_PARSE_PARAM = 290, | |
216 | PERCENT_PURE_PARSER = 291, | |
217 | PERCENT_REQUIRE = 292, | |
218 | PERCENT_SKELETON = 293, | |
219 | PERCENT_START = 294, | |
220 | PERCENT_TOKEN_TABLE = 295, | |
221 | PERCENT_VERBOSE = 296, | |
222 | PERCENT_YACC = 297, | |
223 | BRACED_CODE = 298, | |
224 | CHAR = 299, | |
225 | EPILOGUE = 300, | |
226 | EQUAL = 301, | |
227 | ID = 302, | |
228 | ID_COLON = 303, | |
229 | PERCENT_PERCENT = 304, | |
230 | PIPE = 305, | |
231 | PROLOGUE = 306, | |
232 | SEMICOLON = 307, | |
233 | TYPE = 308, | |
234 | TYPE_TAG_ANY = 309, | |
235 | TYPE_TAG_NONE = 310, | |
236 | BRACKETED_ID = 311, | |
237 | PERCENT_UNION = 312 | |
238 | }; | |
239 | #endif | |
240 | /* Tokens. */ | |
241 | #define GRAM_EOF 0 | |
242 | #define STRING 258 | |
243 | #define INT 259 | |
244 | #define PERCENT_TOKEN 260 | |
245 | #define PERCENT_NTERM 261 | |
246 | #define PERCENT_TYPE 262 | |
247 | #define PERCENT_DESTRUCTOR 263 | |
248 | #define PERCENT_PRINTER 264 | |
249 | #define PERCENT_LEFT 265 | |
250 | #define PERCENT_RIGHT 266 | |
251 | #define PERCENT_NONASSOC 267 | |
252 | #define PERCENT_PREC 268 | |
253 | #define PERCENT_DPREC 269 | |
254 | #define PERCENT_MERGE 270 | |
255 | #define PERCENT_CODE 271 | |
256 | #define PERCENT_DEBUG 272 | |
257 | #define PERCENT_DEFAULT_PREC 273 | |
258 | #define PERCENT_DEFINE 274 | |
259 | #define PERCENT_DEFINES 275 | |
260 | #define PERCENT_ERROR_VERBOSE 276 | |
261 | #define PERCENT_EXPECT 277 | |
262 | #define PERCENT_EXPECT_RR 278 | |
263 | #define PERCENT_FILE_PREFIX 279 | |
264 | #define PERCENT_GLR_PARSER 280 | |
265 | #define PERCENT_INITIAL_ACTION 281 | |
266 | #define PERCENT_LANGUAGE 282 | |
267 | #define PERCENT_LEX_PARAM 283 | |
268 | #define PERCENT_LOCATIONS 284 | |
269 | #define PERCENT_NAME_PREFIX 285 | |
270 | #define PERCENT_NO_DEFAULT_PREC 286 | |
271 | #define PERCENT_NO_LINES 287 | |
272 | #define PERCENT_NONDETERMINISTIC_PARSER 288 | |
273 | #define PERCENT_OUTPUT 289 | |
274 | #define PERCENT_PARSE_PARAM 290 | |
275 | #define PERCENT_PURE_PARSER 291 | |
276 | #define PERCENT_REQUIRE 292 | |
277 | #define PERCENT_SKELETON 293 | |
278 | #define PERCENT_START 294 | |
279 | #define PERCENT_TOKEN_TABLE 295 | |
280 | #define PERCENT_VERBOSE 296 | |
281 | #define PERCENT_YACC 297 | |
282 | #define BRACED_CODE 298 | |
283 | #define CHAR 299 | |
284 | #define EPILOGUE 300 | |
285 | #define EQUAL 301 | |
286 | #define ID 302 | |
287 | #define ID_COLON 303 | |
288 | #define PERCENT_PERCENT 304 | |
289 | #define PIPE 305 | |
290 | #define PROLOGUE 306 | |
291 | #define SEMICOLON 307 | |
292 | #define TYPE 308 | |
293 | #define TYPE_TAG_ANY 309 | |
294 | #define TYPE_TAG_NONE 310 | |
295 | #define BRACKETED_ID 311 | |
296 | #define PERCENT_UNION 312 | |
297 | ||
298 | ||
299 | ||
300 | ||
301 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | |
302 | typedef union YYSTYPE | |
303 | { | |
304 | ||
305 | /* Line 215 of yacc.c */ | |
306 | #line 94 "parse-gram.y" | |
307 | ||
308 | symbol *symbol; | |
309 | symbol_list *list; | |
310 | int integer; | |
311 | char const *chars; | |
312 | char *code; | |
313 | assoc assoc; | |
314 | uniqstr uniqstr; | |
315 | unsigned char character; | |
316 | named_ref *named_ref; | |
317 | ||
318 | ||
319 | ||
320 | /* Line 215 of yacc.c */ | |
321 | #line 322 "../../branch-2.5/src/parse-gram.c" | |
322 | } YYSTYPE; | |
323 | # define YYSTYPE_IS_TRIVIAL 1 | |
324 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ | |
325 | # define YYSTYPE_IS_DECLARED 1 | |
326 | #endif | |
327 | ||
328 | #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED | |
329 | typedef struct YYLTYPE | |
330 | { | |
331 | int first_line; | |
332 | int first_column; | |
333 | int last_line; | |
334 | int last_column; | |
335 | } YYLTYPE; | |
336 | # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ | |
337 | # define YYLTYPE_IS_DECLARED 1 | |
338 | # define YYLTYPE_IS_TRIVIAL 1 | |
339 | #endif | |
340 | ||
341 | ||
342 | /* Copy the second part of user declarations. */ | |
343 | ||
344 | ||
345 | /* Line 265 of yacc.c */ | |
346 | #line 347 "../../branch-2.5/src/parse-gram.c" | |
347 | ||
348 | #ifdef short | |
349 | # undef short | |
350 | #endif | |
351 | ||
352 | #ifdef YYTYPE_UINT8 | |
353 | typedef YYTYPE_UINT8 yytype_uint8; | |
354 | #else | |
355 | typedef unsigned char yytype_uint8; | |
356 | #endif | |
357 | ||
358 | #ifdef YYTYPE_INT8 | |
359 | typedef YYTYPE_INT8 yytype_int8; | |
360 | #elif (defined __STDC__ || defined __C99__FUNC__ \ | |
361 | || defined __cplusplus || defined _MSC_VER) | |
362 | typedef signed char yytype_int8; | |
363 | #else | |
364 | typedef short int yytype_int8; | |
365 | #endif | |
366 | ||
367 | #ifdef YYTYPE_UINT16 | |
368 | typedef YYTYPE_UINT16 yytype_uint16; | |
369 | #else | |
370 | typedef unsigned short int yytype_uint16; | |
371 | #endif | |
372 | ||
373 | #ifdef YYTYPE_INT16 | |
374 | typedef YYTYPE_INT16 yytype_int16; | |
375 | #else | |
376 | typedef short int yytype_int16; | |
377 | #endif | |
378 | ||
379 | #ifndef YYSIZE_T | |
380 | # ifdef __SIZE_TYPE__ | |
381 | # define YYSIZE_T __SIZE_TYPE__ | |
382 | # elif defined size_t | |
383 | # define YYSIZE_T size_t | |
384 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ | |
385 | || defined __cplusplus || defined _MSC_VER) | |
386 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
387 | # define YYSIZE_T size_t | |
388 | # else | |
389 | # define YYSIZE_T unsigned int | |
390 | # endif | |
391 | #endif | |
392 | ||
393 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) | |
394 | ||
395 | #ifndef YY_ | |
396 | # if YYENABLE_NLS | |
397 | # if ENABLE_NLS | |
398 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | |
399 | # define YY_(msgid) dgettext ("bison-runtime", msgid) | |
400 | # endif | |
401 | # endif | |
402 | # ifndef YY_ | |
403 | # define YY_(msgid) msgid | |
404 | # endif | |
405 | #endif | |
406 | ||
407 | /* Suppress unused-variable warnings by "using" E. */ | |
408 | #if ! defined lint || defined __GNUC__ | |
409 | # define YYUSE(e) ((void) (e)) | |
410 | #else | |
411 | # define YYUSE(e) /* empty */ | |
412 | #endif | |
413 | ||
414 | /* Identity function, used to suppress warnings about constant conditions. */ | |
415 | #ifndef lint | |
416 | # define YYID(n) (n) | |
417 | #else | |
418 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
419 | || defined __cplusplus || defined _MSC_VER) | |
420 | static int | |
421 | YYID (int yyi) | |
422 | #else | |
423 | static int | |
424 | YYID (yyi) | |
425 | int yyi; | |
426 | #endif | |
427 | { | |
428 | return yyi; | |
429 | } | |
430 | #endif | |
431 | ||
432 | #if ! defined yyoverflow || YYERROR_VERBOSE | |
433 | ||
434 | /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
435 | ||
436 | # ifdef YYSTACK_USE_ALLOCA | |
437 | # if YYSTACK_USE_ALLOCA | |
438 | # ifdef __GNUC__ | |
439 | # define YYSTACK_ALLOC __builtin_alloca | |
440 | # elif defined __BUILTIN_VA_ARG_INCR | |
441 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ | |
442 | # elif defined _AIX | |
443 | # define YYSTACK_ALLOC __alloca | |
444 | # elif defined _MSC_VER | |
445 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ | |
446 | # define alloca _alloca | |
447 | # else | |
448 | # define YYSTACK_ALLOC alloca | |
449 | # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | |
450 | || defined __cplusplus || defined _MSC_VER) | |
451 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
452 | # ifndef _STDLIB_H | |
453 | # define _STDLIB_H 1 | |
454 | # endif | |
455 | # endif | |
456 | # endif | |
457 | # endif | |
458 | # endif | |
459 | ||
460 | # ifdef YYSTACK_ALLOC | |
461 | /* Pacify GCC's `empty if-body' warning. */ | |
462 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) | |
463 | # ifndef YYSTACK_ALLOC_MAXIMUM | |
464 | /* The OS might guarantee only one guard page at the bottom of the stack, | |
465 | and a page size can be as small as 4096 bytes. So we cannot safely | |
466 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number | |
467 | to allow for a few compiler-allocated temporary stack slots. */ | |
468 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ | |
469 | # endif | |
470 | # else | |
471 | # define YYSTACK_ALLOC YYMALLOC | |
472 | # define YYSTACK_FREE YYFREE | |
473 | # ifndef YYSTACK_ALLOC_MAXIMUM | |
474 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM | |
475 | # endif | |
476 | # if (defined __cplusplus && ! defined _STDLIB_H \ | |
477 | && ! ((defined YYMALLOC || defined malloc) \ | |
478 | && (defined YYFREE || defined free))) | |
479 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
480 | # ifndef _STDLIB_H | |
481 | # define _STDLIB_H 1 | |
482 | # endif | |
483 | # endif | |
484 | # ifndef YYMALLOC | |
485 | # define YYMALLOC malloc | |
486 | # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | |
487 | || defined __cplusplus || defined _MSC_VER) | |
488 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ | |
489 | # endif | |
490 | # endif | |
491 | # ifndef YYFREE | |
492 | # define YYFREE free | |
493 | # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | |
494 | || defined __cplusplus || defined _MSC_VER) | |
495 | void free (void *); /* INFRINGES ON USER NAME SPACE */ | |
496 | # endif | |
497 | # endif | |
498 | # endif | |
499 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ | |
500 | ||
501 | ||
502 | #if (! defined yyoverflow \ | |
503 | && (! defined __cplusplus \ | |
504 | || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ | |
505 | && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
506 | ||
507 | /* A type that is properly aligned for any stack member. */ | |
508 | union yyalloc | |
509 | { | |
510 | yytype_int16 yyss_alloc; | |
511 | YYSTYPE yyvs_alloc; | |
512 | YYLTYPE yyls_alloc; | |
513 | }; | |
514 | ||
515 | /* The size of the maximum gap between one aligned stack and the next. */ | |
516 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) | |
517 | ||
518 | /* The size of an array large to enough to hold all stacks, each with | |
519 | N elements. */ | |
520 | # define YYSTACK_BYTES(N) \ | |
521 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ | |
522 | + 2 * YYSTACK_GAP_MAXIMUM) | |
523 | ||
524 | /* Copy COUNT objects from FROM to TO. The source and destination do | |
525 | not overlap. */ | |
526 | # ifndef YYCOPY | |
527 | # if defined __GNUC__ && 1 < __GNUC__ | |
528 | # define YYCOPY(To, From, Count) \ | |
529 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
530 | # else | |
531 | # define YYCOPY(To, From, Count) \ | |
532 | do \ | |
533 | { \ | |
534 | YYSIZE_T yyi; \ | |
535 | for (yyi = 0; yyi < (Count); yyi++) \ | |
536 | (To)[yyi] = (From)[yyi]; \ | |
537 | } \ | |
538 | while (YYID (0)) | |
539 | # endif | |
540 | # endif | |
541 | ||
542 | /* Relocate STACK from its old location to the new one. The | |
543 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
544 | elements in the stack, and YYPTR gives the new location of the | |
545 | stack. Advance YYPTR to a properly aligned location for the next | |
546 | stack. */ | |
547 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ | |
548 | do \ | |
549 | { \ | |
550 | YYSIZE_T yynewbytes; \ | |
551 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | |
552 | Stack = &yyptr->Stack_alloc; \ | |
553 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
554 | yyptr += yynewbytes / sizeof (*yyptr); \ | |
555 | } \ | |
556 | while (YYID (0)) | |
557 | ||
558 | #endif | |
559 | ||
560 | /* YYFINAL -- State number of the termination state. */ | |
561 | #define YYFINAL 3 | |
562 | /* YYLAST -- Last index in YYTABLE. */ | |
563 | #define YYLAST 159 | |
564 | ||
565 | /* YYNTOKENS -- Number of terminals. */ | |
566 | #define YYNTOKENS 58 | |
567 | /* YYNNTS -- Number of nonterminals. */ | |
568 | #define YYNNTS 34 | |
569 | /* YYNRULES -- Number of rules. */ | |
570 | #define YYNRULES 107 | |
571 | /* YYNRULES -- Number of states. */ | |
572 | #define YYNSTATES 147 | |
573 | ||
574 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
575 | #define YYUNDEFTOK 2 | |
576 | #define YYMAXUTOK 312 | |
577 | ||
578 | #define YYTRANSLATE(YYX) \ | |
579 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | |
580 | ||
581 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ | |
582 | static const yytype_uint8 yytranslate[] = | |
583 | { | |
584 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
585 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
586 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
587 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
588 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
589 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
590 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
591 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
592 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
593 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
594 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
595 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
596 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
597 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
598 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
599 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
600 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
601 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
602 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
603 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
604 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
605 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
606 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
607 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
608 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
609 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | |
610 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | |
611 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | |
612 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | |
613 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, | |
614 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, | |
615 | 55, 56, 57 | |
616 | }; | |
617 | ||
618 | #if YYDEBUG | |
619 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | |
620 | YYRHS. */ | |
621 | static const yytype_uint16 yyprhs[] = | |
622 | { | |
623 | 0, 0, 3, 8, 9, 12, 14, 16, 18, 22, | |
624 | 24, 27, 29, 32, 35, 38, 42, 44, 47, 50, | |
625 | 53, 55, 58, 62, 64, 66, 69, 73, 76, 78, | |
626 | 81, 84, 86, 88, 90, 92, 94, 96, 99, 103, | |
627 | 107, 109, 111, 114, 118, 119, 121, 125, 126, 130, | |
628 | 131, 135, 139, 143, 145, 147, 149, 150, 152, 154, | |
629 | 157, 159, 162, 164, 167, 169, 172, 174, 176, 178, | |
630 | 180, 182, 184, 187, 190, 194, 196, 199, 201, 204, | |
631 | 206, 209, 212, 213, 218, 220, 224, 227, 228, 232, | |
632 | 236, 240, 244, 248, 249, 251, 253, 255, 256, 258, | |
633 | 260, 262, 264, 266, 268, 270, 272, 273 | |
634 | }; | |
635 | ||
636 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ | |
637 | static const yytype_int8 yyrhs[] = | |
638 | { | |
639 | 59, 0, -1, 60, 49, 77, 91, -1, -1, 60, | |
640 | 61, -1, 62, -1, 51, -1, 17, -1, 19, 84, | |
641 | 85, -1, 20, -1, 20, 3, -1, 21, -1, 22, | |
642 | 4, -1, 23, 4, -1, 24, 3, -1, 24, 46, | |
643 | 3, -1, 25, -1, 26, 43, -1, 27, 3, -1, | |
644 | 28, 43, -1, 29, -1, 30, 3, -1, 30, 46, | |
645 | 3, -1, 32, -1, 33, -1, 34, 3, -1, 34, | |
646 | 46, 3, -1, 35, 43, -1, 36, -1, 37, 3, | |
647 | -1, 38, 3, -1, 40, -1, 41, -1, 42, -1, | |
648 | 52, -1, 67, -1, 64, -1, 39, 89, -1, 8, | |
649 | 43, 73, -1, 9, 43, 73, -1, 18, -1, 31, | |
650 | -1, 16, 86, -1, 16, 47, 86, -1, -1, 47, | |
651 | -1, 57, 63, 86, -1, -1, 6, 65, 76, -1, | |
652 | -1, 5, 66, 76, -1, 7, 53, 72, -1, 68, | |
653 | 69, 70, -1, 10, -1, 11, -1, 12, -1, -1, | |
654 | 53, -1, 71, -1, 70, 71, -1, 89, -1, 89, | |
655 | 4, -1, 89, -1, 72, 89, -1, 74, -1, 73, | |
656 | 74, -1, 89, -1, 53, -1, 54, -1, 55, -1, | |
657 | 53, -1, 87, -1, 87, 4, -1, 87, 90, -1, | |
658 | 87, 4, 90, -1, 75, -1, 76, 75, -1, 78, | |
659 | -1, 77, 78, -1, 79, -1, 62, 52, -1, 1, | |
660 | 52, -1, -1, 88, 83, 80, 81, -1, 82, -1, | |
661 | 81, 50, 82, -1, 81, 52, -1, -1, 82, 89, | |
662 | 83, -1, 82, 43, 83, -1, 82, 13, 89, -1, | |
663 | 82, 14, 4, -1, 82, 15, 53, -1, -1, 56, | |
664 | -1, 47, -1, 3, -1, -1, 3, -1, 43, -1, | |
665 | 47, -1, 44, -1, 48, -1, 87, -1, 90, -1, | |
666 | 3, -1, -1, 49, 45, -1 | |
667 | }; | |
668 | ||
669 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | |
670 | static const yytype_uint16 yyrline[] = | |
671 | { | |
672 | 0, 207, 207, 215, 217, 221, 222, 232, 233, 238, | |
673 | 239, 244, 245, 246, 247, 248, 249, 254, 263, 264, | |
674 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 288, | |
675 | 289, 313, 314, 315, 316, 320, 321, 322, 326, 333, | |
676 | 340, 344, 348, 355, 370, 371, 375, 387, 387, 392, | |
677 | 392, 397, 408, 423, 424, 425, 429, 430, 435, 437, | |
678 | 442, 443, 448, 450, 455, 456, 460, 461, 462, 463, | |
679 | 468, 473, 478, 484, 490, 501, 502, 511, 512, 518, | |
680 | 519, 520, 527, 527, 532, 533, 534, 539, 541, 543, | |
681 | 545, 547, 549, 554, 556, 567, 568, 573, 574, 583, | |
682 | 603, 605, 614, 619, 620, 625, 632, 634 | |
683 | }; | |
684 | #endif | |
685 | ||
686 | #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE | |
687 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | |
688 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | |
689 | static const char *const yytname[] = | |
690 | { | |
691 | "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"", | |
692 | "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"", | |
693 | "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"", | |
694 | "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"", | |
695 | "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"", | |
696 | "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"", | |
697 | "\"%initial-action\"", "\"%language\"", "\"%lex-param\"", | |
698 | "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"", | |
699 | "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"", | |
700 | "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"", | |
701 | "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", | |
702 | "\"{...}\"", "\"char\"", "\"epilogue\"", "\"=\"", "\"identifier\"", | |
703 | "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"", "\";\"", "\"type\"", | |
704 | "\"<*>\"", "\"<>\"", "\"[identifier]\"", "\"%union\"", "$accept", | |
705 | "input", "prologue_declarations", "prologue_declaration", | |
706 | "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2", | |
707 | "precedence_declaration", "precedence_declarator", "type.opt", | |
708 | "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist", | |
709 | "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar", | |
710 | "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs", | |
711 | "named_ref.opt", "variable", "content.opt", "braceless", "id", | |
712 | "id_colon", "symbol", "string_as_id", "epilogue.opt", 0 | |
713 | }; | |
714 | #endif | |
715 | ||
716 | # ifdef YYPRINT | |
717 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to | |
718 | token YYLEX-NUM. */ | |
719 | static const yytype_uint16 yytoknum[] = | |
720 | { | |
721 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
722 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | |
723 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | |
724 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |
725 | 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, | |
726 | 305, 306, 307, 308, 309, 310, 311, 312 | |
727 | }; | |
728 | # endif | |
729 | ||
730 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
731 | static const yytype_uint8 yyr1[] = | |
732 | { | |
733 | 0, 58, 59, 60, 60, 61, 61, 61, 61, 61, | |
734 | 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, | |
735 | 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, | |
736 | 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, | |
737 | 62, 62, 62, 62, 63, 63, 62, 65, 64, 66, | |
738 | 64, 64, 67, 68, 68, 68, 69, 69, 70, 70, | |
739 | 71, 71, 72, 72, 73, 73, 74, 74, 74, 74, | |
740 | 75, 75, 75, 75, 75, 76, 76, 77, 77, 78, | |
741 | 78, 78, 80, 79, 81, 81, 81, 82, 82, 82, | |
742 | 82, 82, 82, 83, 83, 84, 84, 85, 85, 86, | |
743 | 87, 87, 88, 89, 89, 90, 91, 91 | |
744 | }; | |
745 | ||
746 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
747 | static const yytype_uint8 yyr2[] = | |
748 | { | |
749 | 0, 2, 4, 0, 2, 1, 1, 1, 3, 1, | |
750 | 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, | |
751 | 1, 2, 3, 1, 1, 2, 3, 2, 1, 2, | |
752 | 2, 1, 1, 1, 1, 1, 1, 2, 3, 3, | |
753 | 1, 1, 2, 3, 0, 1, 3, 0, 3, 0, | |
754 | 3, 3, 3, 1, 1, 1, 0, 1, 1, 2, | |
755 | 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, | |
756 | 1, 1, 2, 2, 3, 1, 2, 1, 2, 1, | |
757 | 2, 2, 0, 4, 1, 3, 2, 0, 3, 3, | |
758 | 3, 3, 3, 0, 1, 1, 1, 0, 1, 1, | |
759 | 1, 1, 1, 1, 1, 1, 0, 2 | |
760 | }; | |
761 | ||
762 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. | |
763 | Performed when YYTABLE doesn't specify something else to do. Zero | |
764 | means the default is an error. */ | |
765 | static const yytype_uint8 yydefact[] = | |
766 | { | |
767 | 3, 0, 0, 1, 49, 47, 0, 0, 0, 53, | |
768 | 54, 55, 0, 7, 40, 0, 9, 11, 0, 0, | |
769 | 0, 16, 0, 0, 0, 20, 0, 41, 23, 24, | |
770 | 0, 0, 28, 0, 0, 0, 31, 32, 33, 0, | |
771 | 6, 34, 44, 4, 5, 36, 35, 56, 0, 0, | |
772 | 0, 0, 0, 99, 0, 42, 96, 95, 97, 10, | |
773 | 12, 13, 14, 0, 17, 18, 19, 21, 0, 25, | |
774 | 0, 27, 29, 30, 105, 101, 100, 103, 37, 104, | |
775 | 0, 102, 0, 0, 77, 79, 93, 45, 0, 57, | |
776 | 0, 70, 75, 50, 71, 48, 51, 62, 67, 68, | |
777 | 69, 38, 64, 66, 39, 43, 98, 8, 15, 22, | |
778 | 26, 81, 80, 0, 78, 2, 94, 82, 46, 52, | |
779 | 58, 60, 76, 72, 73, 63, 65, 107, 87, 59, | |
780 | 61, 74, 83, 84, 87, 86, 0, 0, 0, 93, | |
781 | 93, 85, 90, 91, 92, 89, 88 | |
782 | }; | |
783 | ||
784 | /* YYDEFGOTO[NTERM-NUM]. */ | |
785 | static const yytype_int16 yydefgoto[] = | |
786 | { | |
787 | -1, 1, 2, 43, 82, 88, 45, 49, 48, 46, | |
788 | 47, 90, 119, 120, 96, 101, 102, 92, 93, 83, | |
789 | 84, 85, 128, 132, 133, 117, 58, 107, 55, 77, | |
790 | 86, 103, 79, 115 | |
791 | }; | |
792 | ||
793 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
794 | STATE-NUM. */ | |
795 | #define YYPACT_NINF -60 | |
796 | static const yytype_int16 yypact[] = | |
797 | { | |
798 | -60, 4, 102, -60, -60, -60, 7, 10, 22, -60, | |
799 | -60, -60, -6, -60, -60, 27, 40, -60, 65, 72, | |
800 | 2, -60, 35, 79, 47, -60, 11, -60, -60, -60, | |
801 | 25, 48, -60, 89, 90, 0, -60, -60, -60, 15, | |
802 | -60, -60, 52, -60, -60, -60, -60, 41, -2, -2, | |
803 | 0, 26, 26, -60, 59, -60, -60, -60, 92, -60, | |
804 | -60, -60, -60, 100, -60, -60, -60, -60, 101, -60, | |
805 | 112, -60, -60, -60, -60, -60, -60, -60, -60, -60, | |
806 | 64, -60, 93, 1, -60, -60, 49, -60, 59, -60, | |
807 | 0, -60, -60, -2, 83, -2, 0, -60, -60, -60, | |
808 | -60, 26, -60, -60, 26, -60, -60, -60, -60, -60, | |
809 | -60, -60, -60, 103, -60, -60, -60, -60, -60, 0, | |
810 | -60, 113, -60, 143, -60, -60, -60, -60, -60, -60, | |
811 | -60, -60, -16, 53, -60, -60, 0, 145, 94, 49, | |
812 | 49, 53, -60, -60, -60, -60, -60 | |
813 | }; | |
814 | ||
815 | /* YYPGOTO[NTERM-NUM]. */ | |
816 | static const yytype_int16 yypgoto[] = | |
817 | { | |
818 | -60, -60, -60, -60, 148, -60, -60, -60, -60, -60, | |
819 | -60, -60, -60, 33, -60, 104, -42, -18, 106, -60, | |
820 | 74, -60, -60, -60, 24, -51, -60, -60, -36, -10, | |
821 | -60, -35, -59, -60 | |
822 | }; | |
823 | ||
824 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | |
825 | positive, shift that token. If negative, reduce the rule which | |
826 | number is the opposite. If zero, do what YYDEFACT says. | |
827 | If YYTABLE_NINF, syntax error. */ | |
828 | #define YYTABLE_NINF -107 | |
829 | static const yytype_int16 yytable[] = | |
830 | { | |
831 | 78, -106, 80, 74, 3, 62, 4, 5, 6, 7, | |
832 | 8, 9, 10, 11, 67, 97, 80, 12, 105, 14, | |
833 | 4, 5, 6, 7, 8, 9, 10, 11, 69, 74, | |
834 | 56, 12, 27, 14, 134, 124, 135, 53, 94, 94, | |
835 | 35, 54, 75, 59, 75, 76, 27, 76, 63, 81, | |
836 | 113, 91, 118, 51, 35, 121, 74, 68, 42, 126, | |
837 | 50, 125, 126, 81, 131, 52, 136, 137, 138, 60, | |
838 | 75, 70, 42, 76, 57, 122, 61, 122, 64, 98, | |
839 | 99, 100, 65, 94, 121, 94, 74, 123, 145, 146, | |
840 | 66, 71, 72, 73, 89, 106, 139, 75, 140, 87, | |
841 | 76, 142, 53, 108, 109, 116, 140, 4, 5, 6, | |
842 | 7, 8, 9, 10, 11, 110, 111, 130, 12, 13, | |
843 | 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, | |
844 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, | |
845 | 34, 35, 36, 37, 38, 112, 74, 144, 127, 143, | |
846 | 44, 39, 129, 40, 41, 95, 104, 114, 141, 42 | |
847 | }; | |
848 | ||
849 | static const yytype_uint8 yycheck[] = | |
850 | { | |
851 | 35, 0, 1, 3, 0, 3, 5, 6, 7, 8, | |
852 | 9, 10, 11, 12, 3, 50, 1, 16, 54, 18, | |
853 | 5, 6, 7, 8, 9, 10, 11, 12, 3, 3, | |
854 | 3, 16, 31, 18, 50, 94, 52, 43, 48, 49, | |
855 | 39, 47, 44, 3, 44, 47, 31, 47, 46, 48, | |
856 | 49, 53, 88, 43, 39, 90, 3, 46, 57, 101, | |
857 | 53, 96, 104, 48, 123, 43, 13, 14, 15, 4, | |
858 | 44, 46, 57, 47, 47, 93, 4, 95, 43, 53, | |
859 | 54, 55, 3, 93, 119, 95, 3, 4, 139, 140, | |
860 | 43, 43, 3, 3, 53, 3, 43, 44, 133, 47, | |
861 | 47, 136, 43, 3, 3, 56, 141, 5, 6, 7, | |
862 | 8, 9, 10, 11, 12, 3, 52, 4, 16, 17, | |
863 | 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, | |
864 | 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, | |
865 | 38, 39, 40, 41, 42, 52, 3, 53, 45, 4, | |
866 | 2, 49, 119, 51, 52, 49, 52, 83, 134, 57 | |
867 | }; | |
868 | ||
869 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | |
870 | symbol of state STATE-NUM. */ | |
871 | static const yytype_uint8 yystos[] = | |
872 | { | |
873 | 0, 59, 60, 0, 5, 6, 7, 8, 9, 10, | |
874 | 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, | |
875 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, | |
876 | 34, 35, 36, 37, 38, 39, 40, 41, 42, 49, | |
877 | 51, 52, 57, 61, 62, 64, 67, 68, 66, 65, | |
878 | 53, 43, 43, 43, 47, 86, 3, 47, 84, 3, | |
879 | 4, 4, 3, 46, 43, 3, 43, 3, 46, 3, | |
880 | 46, 43, 3, 3, 3, 44, 47, 87, 89, 90, | |
881 | 1, 48, 62, 77, 78, 79, 88, 47, 63, 53, | |
882 | 69, 53, 75, 76, 87, 76, 72, 89, 53, 54, | |
883 | 55, 73, 74, 89, 73, 86, 3, 85, 3, 3, | |
884 | 3, 52, 52, 49, 78, 91, 56, 83, 86, 70, | |
885 | 71, 89, 75, 4, 90, 89, 74, 45, 80, 71, | |
886 | 4, 90, 81, 82, 50, 52, 13, 14, 15, 43, | |
887 | 89, 82, 89, 4, 53, 83, 83 | |
888 | }; | |
889 | ||
890 | #define yyerrok (yyerrstatus = 0) | |
891 | #define yyclearin (yychar = YYEMPTY) | |
892 | #define YYEMPTY (-2) | |
893 | #define YYEOF 0 | |
894 | ||
895 | #define YYACCEPT goto yyacceptlab | |
896 | #define YYABORT goto yyabortlab | |
897 | #define YYERROR goto yyerrorlab | |
898 | ||
899 | ||
900 | /* Like YYERROR except do call yyerror. This remains here temporarily | |
901 | to ease the transition to the new meaning of YYERROR, for GCC. | |
902 | Once GCC version 2 has supplanted version 1, this can go. */ | |
903 | ||
904 | #define YYFAIL goto yyerrlab | |
905 | ||
906 | #define YYRECOVERING() (!!yyerrstatus) | |
907 | ||
908 | #define YYBACKUP(Token, Value) \ | |
909 | do \ | |
910 | if (yychar == YYEMPTY && yylen == 1) \ | |
911 | { \ | |
912 | yychar = (Token); \ | |
913 | yylval = (Value); \ | |
914 | yytoken = YYTRANSLATE (yychar); \ | |
915 | YYPOPSTACK (1); \ | |
916 | goto yybackup; \ | |
917 | } \ | |
918 | else \ | |
919 | { \ | |
920 | yyerror (YY_("syntax error: cannot back up")); \ | |
921 | YYERROR; \ | |
922 | } \ | |
923 | while (YYID (0)) | |
924 | ||
925 | ||
926 | #define YYTERROR 1 | |
927 | #define YYERRCODE 256 | |
928 | ||
929 | ||
930 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | |
931 | If N is 0, then set CURRENT to the empty location which ends | |
932 | the previous symbol: RHS[0] (always defined). */ | |
933 | ||
934 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) | |
935 | #ifndef YYLLOC_DEFAULT | |
936 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ | |
937 | do \ | |
938 | if (YYID (N)) \ | |
939 | { \ | |
940 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ | |
941 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ | |
942 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ | |
943 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ | |
944 | } \ | |
945 | else \ | |
946 | { \ | |
947 | (Current).first_line = (Current).last_line = \ | |
948 | YYRHSLOC (Rhs, 0).last_line; \ | |
949 | (Current).first_column = (Current).last_column = \ | |
950 | YYRHSLOC (Rhs, 0).last_column; \ | |
951 | } \ | |
952 | while (YYID (0)) | |
953 | #endif | |
954 | ||
955 | ||
956 | /* YY_LOCATION_PRINT -- Print the location on the stream. | |
957 | This macro was not mandated originally: define only if we know | |
958 | we won't break user code: when these are the locations we know. */ | |
959 | ||
960 | #ifndef YY_LOCATION_PRINT | |
961 | # if YYLTYPE_IS_TRIVIAL | |
962 | # define YY_LOCATION_PRINT(File, Loc) \ | |
963 | fprintf (File, "%d.%d-%d.%d", \ | |
964 | (Loc).first_line, (Loc).first_column, \ | |
965 | (Loc).last_line, (Loc).last_column) | |
966 | # else | |
967 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | |
968 | # endif | |
969 | #endif | |
970 | ||
971 | ||
972 | /* YYLEX -- calling `yylex' with the right arguments. */ | |
973 | ||
974 | #ifdef YYLEX_PARAM | |
975 | # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) | |
976 | #else | |
977 | # define YYLEX yylex (&yylval, &yylloc) | |
978 | #endif | |
979 | ||
980 | /* Enable debugging if requested. */ | |
981 | #if YYDEBUG | |
982 | ||
983 | # ifndef YYFPRINTF | |
984 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
985 | # define YYFPRINTF fprintf | |
986 | # endif | |
987 | ||
988 | # define YYDPRINTF(Args) \ | |
989 | do { \ | |
990 | if (yydebug) \ | |
991 | YYFPRINTF Args; \ | |
992 | } while (YYID (0)) | |
993 | ||
994 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ | |
995 | do { \ | |
996 | if (yydebug) \ | |
997 | { \ | |
998 | YYFPRINTF (stderr, "%s ", Title); \ | |
999 | yy_symbol_print (stderr, \ | |
1000 | Type, Value, Location); \ | |
1001 | YYFPRINTF (stderr, "\n"); \ | |
1002 | } \ | |
1003 | } while (YYID (0)) | |
1004 | ||
1005 | ||
1006 | /*--------------------------------. | |
1007 | | Print this symbol on YYOUTPUT. | | |
1008 | `--------------------------------*/ | |
1009 | ||
1010 | /*ARGSUSED*/ | |
1011 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1012 | || defined __cplusplus || defined _MSC_VER) | |
1013 | static void | |
1014 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) | |
1015 | #else | |
1016 | static void | |
1017 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) | |
1018 | FILE *yyoutput; | |
1019 | int yytype; | |
1020 | YYSTYPE const * const yyvaluep; | |
1021 | YYLTYPE const * const yylocationp; | |
1022 | #endif | |
1023 | { | |
1024 | if (!yyvaluep) | |
1025 | return; | |
1026 | YYUSE (yylocationp); | |
1027 | # ifdef YYPRINT | |
1028 | if (yytype < YYNTOKENS) | |
1029 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
1030 | # else | |
1031 | YYUSE (yyoutput); | |
1032 | # endif | |
1033 | switch (yytype) | |
1034 | { | |
1035 | case 3: /* "\"string\"" */ | |
1036 | ||
1037 | /* Line 716 of yacc.c */ | |
1038 | #line 184 "parse-gram.y" | |
1039 | { fputs (quotearg_style (c_quoting_style, (yyvaluep->chars)), stderr); }; | |
1040 | ||
1041 | /* Line 716 of yacc.c */ | |
1042 | #line 1043 "../../branch-2.5/src/parse-gram.c" | |
1043 | break; | |
1044 | case 4: /* "\"integer\"" */ | |
1045 | ||
1046 | /* Line 716 of yacc.c */ | |
1047 | #line 196 "parse-gram.y" | |
1048 | { fprintf (stderr, "%d", (yyvaluep->integer)); }; | |
1049 | ||
1050 | /* Line 716 of yacc.c */ | |
1051 | #line 1052 "../../branch-2.5/src/parse-gram.c" | |
1052 | break; | |
1053 | case 43: /* "\"{...}\"" */ | |
1054 | ||
1055 | /* Line 716 of yacc.c */ | |
1056 | #line 186 "parse-gram.y" | |
1057 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->code)); }; | |
1058 | ||
1059 | /* Line 716 of yacc.c */ | |
1060 | #line 1061 "../../branch-2.5/src/parse-gram.c" | |
1061 | break; | |
1062 | case 44: /* "\"char\"" */ | |
1063 | ||
1064 | /* Line 716 of yacc.c */ | |
1065 | #line 178 "parse-gram.y" | |
1066 | { fputs (char_name ((yyvaluep->character)), stderr); }; | |
1067 | ||
1068 | /* Line 716 of yacc.c */ | |
1069 | #line 1070 "../../branch-2.5/src/parse-gram.c" | |
1070 | break; | |
1071 | case 45: /* "\"epilogue\"" */ | |
1072 | ||
1073 | /* Line 716 of yacc.c */ | |
1074 | #line 186 "parse-gram.y" | |
1075 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; | |
1076 | ||
1077 | /* Line 716 of yacc.c */ | |
1078 | #line 1079 "../../branch-2.5/src/parse-gram.c" | |
1079 | break; | |
1080 | case 47: /* "\"identifier\"" */ | |
1081 | ||
1082 | /* Line 716 of yacc.c */ | |
1083 | #line 192 "parse-gram.y" | |
1084 | { fputs ((yyvaluep->uniqstr), stderr); }; | |
1085 | ||
1086 | /* Line 716 of yacc.c */ | |
1087 | #line 1088 "../../branch-2.5/src/parse-gram.c" | |
1088 | break; | |
1089 | case 48: /* "\"identifier:\"" */ | |
1090 | ||
1091 | /* Line 716 of yacc.c */ | |
1092 | #line 193 "parse-gram.y" | |
1093 | { fprintf (stderr, "%s:", (yyvaluep->uniqstr)); }; | |
1094 | ||
1095 | /* Line 716 of yacc.c */ | |
1096 | #line 1097 "../../branch-2.5/src/parse-gram.c" | |
1097 | break; | |
1098 | case 51: /* "\"%{...%}\"" */ | |
1099 | ||
1100 | /* Line 716 of yacc.c */ | |
1101 | #line 186 "parse-gram.y" | |
1102 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; | |
1103 | ||
1104 | /* Line 716 of yacc.c */ | |
1105 | #line 1106 "../../branch-2.5/src/parse-gram.c" | |
1106 | break; | |
1107 | case 53: /* "\"type\"" */ | |
1108 | ||
1109 | /* Line 716 of yacc.c */ | |
1110 | #line 191 "parse-gram.y" | |
1111 | { fprintf (stderr, "<%s>", (yyvaluep->uniqstr)); }; | |
1112 | ||
1113 | /* Line 716 of yacc.c */ | |
1114 | #line 1115 "../../branch-2.5/src/parse-gram.c" | |
1115 | break; | |
1116 | case 84: /* "variable" */ | |
1117 | ||
1118 | /* Line 716 of yacc.c */ | |
1119 | #line 192 "parse-gram.y" | |
1120 | { fputs ((yyvaluep->uniqstr), stderr); }; | |
1121 | ||
1122 | /* Line 716 of yacc.c */ | |
1123 | #line 1124 "../../branch-2.5/src/parse-gram.c" | |
1124 | break; | |
1125 | case 85: /* "content.opt" */ | |
1126 | ||
1127 | /* Line 716 of yacc.c */ | |
1128 | #line 186 "parse-gram.y" | |
1129 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; | |
1130 | ||
1131 | /* Line 716 of yacc.c */ | |
1132 | #line 1133 "../../branch-2.5/src/parse-gram.c" | |
1133 | break; | |
1134 | case 86: /* "braceless" */ | |
1135 | ||
1136 | /* Line 716 of yacc.c */ | |
1137 | #line 186 "parse-gram.y" | |
1138 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; | |
1139 | ||
1140 | /* Line 716 of yacc.c */ | |
1141 | #line 1142 "../../branch-2.5/src/parse-gram.c" | |
1142 | break; | |
1143 | case 87: /* "id" */ | |
1144 | ||
1145 | /* Line 716 of yacc.c */ | |
1146 | #line 199 "parse-gram.y" | |
1147 | { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; | |
1148 | ||
1149 | /* Line 716 of yacc.c */ | |
1150 | #line 1151 "../../branch-2.5/src/parse-gram.c" | |
1151 | break; | |
1152 | case 88: /* "id_colon" */ | |
1153 | ||
1154 | /* Line 716 of yacc.c */ | |
1155 | #line 200 "parse-gram.y" | |
1156 | { fprintf (stderr, "%s:", (yyvaluep->symbol)->tag); }; | |
1157 | ||
1158 | /* Line 716 of yacc.c */ | |
1159 | #line 1160 "../../branch-2.5/src/parse-gram.c" | |
1160 | break; | |
1161 | case 89: /* "symbol" */ | |
1162 | ||
1163 | /* Line 716 of yacc.c */ | |
1164 | #line 199 "parse-gram.y" | |
1165 | { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; | |
1166 | ||
1167 | /* Line 716 of yacc.c */ | |
1168 | #line 1169 "../../branch-2.5/src/parse-gram.c" | |
1169 | break; | |
1170 | case 90: /* "string_as_id" */ | |
1171 | ||
1172 | /* Line 716 of yacc.c */ | |
1173 | #line 199 "parse-gram.y" | |
1174 | { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; | |
1175 | ||
1176 | /* Line 716 of yacc.c */ | |
1177 | #line 1178 "../../branch-2.5/src/parse-gram.c" | |
1178 | break; | |
1179 | default: | |
1180 | break; | |
1181 | } | |
1182 | } | |
1183 | ||
1184 | ||
1185 | /*--------------------------------. | |
1186 | | Print this symbol on YYOUTPUT. | | |
1187 | `--------------------------------*/ | |
1188 | ||
1189 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1190 | || defined __cplusplus || defined _MSC_VER) | |
1191 | static void | |
1192 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) | |
1193 | #else | |
1194 | static void | |
1195 | yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp) | |
1196 | FILE *yyoutput; | |
1197 | int yytype; | |
1198 | YYSTYPE const * const yyvaluep; | |
1199 | YYLTYPE const * const yylocationp; | |
1200 | #endif | |
1201 | { | |
1202 | if (yytype < YYNTOKENS) | |
1203 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); | |
1204 | else | |
1205 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); | |
1206 | ||
1207 | YY_LOCATION_PRINT (yyoutput, *yylocationp); | |
1208 | YYFPRINTF (yyoutput, ": "); | |
1209 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp); | |
1210 | YYFPRINTF (yyoutput, ")"); | |
1211 | } | |
1212 | ||
1213 | /*------------------------------------------------------------------. | |
1214 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
1215 | | TOP (included). | | |
1216 | `------------------------------------------------------------------*/ | |
1217 | ||
1218 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1219 | || defined __cplusplus || defined _MSC_VER) | |
1220 | static void | |
1221 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) | |
1222 | #else | |
1223 | static void | |
1224 | yy_stack_print (yybottom, yytop) | |
1225 | yytype_int16 *yybottom; | |
1226 | yytype_int16 *yytop; | |
1227 | #endif | |
1228 | { | |
1229 | YYFPRINTF (stderr, "Stack now"); | |
1230 | for (; yybottom <= yytop; yybottom++) | |
1231 | { | |
1232 | int yybot = *yybottom; | |
1233 | YYFPRINTF (stderr, " %d", yybot); | |
1234 | } | |
1235 | YYFPRINTF (stderr, "\n"); | |
1236 | } | |
1237 | ||
1238 | # define YY_STACK_PRINT(Bottom, Top) \ | |
1239 | do { \ | |
1240 | if (yydebug) \ | |
1241 | yy_stack_print ((Bottom), (Top)); \ | |
1242 | } while (YYID (0)) | |
1243 | ||
1244 | ||
1245 | /*------------------------------------------------. | |
1246 | | Report that the YYRULE is going to be reduced. | | |
1247 | `------------------------------------------------*/ | |
1248 | ||
1249 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1250 | || defined __cplusplus || defined _MSC_VER) | |
1251 | static void | |
1252 | yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) | |
1253 | #else | |
1254 | static void | |
1255 | yy_reduce_print (yyvsp, yylsp, yyrule) | |
1256 | YYSTYPE *yyvsp; | |
1257 | YYLTYPE *yylsp; | |
1258 | int yyrule; | |
1259 | #endif | |
1260 | { | |
1261 | int yynrhs = yyr2[yyrule]; | |
1262 | int yyi; | |
1263 | unsigned long int yylno = yyrline[yyrule]; | |
1264 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", | |
1265 | yyrule - 1, yylno); | |
1266 | /* The symbols being reduced. */ | |
1267 | for (yyi = 0; yyi < yynrhs; yyi++) | |
1268 | { | |
1269 | YYFPRINTF (stderr, " $%d = ", yyi + 1); | |
1270 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], | |
1271 | &(yyvsp[(yyi + 1) - (yynrhs)]) | |
1272 | , &(yylsp[(yyi + 1) - (yynrhs)]) ); | |
1273 | YYFPRINTF (stderr, "\n"); | |
1274 | } | |
1275 | } | |
1276 | ||
1277 | # define YY_REDUCE_PRINT(Rule) \ | |
1278 | do { \ | |
1279 | if (yydebug) \ | |
1280 | yy_reduce_print (yyvsp, yylsp, Rule); \ | |
1281 | } while (YYID (0)) | |
1282 | ||
1283 | /* Nonzero means print parse trace. It is left uninitialized so that | |
1284 | multiple parsers can coexist. */ | |
1285 | int yydebug; | |
1286 | #else /* !YYDEBUG */ | |
1287 | # define YYDPRINTF(Args) | |
1288 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) | |
1289 | # define YY_STACK_PRINT(Bottom, Top) | |
1290 | # define YY_REDUCE_PRINT(Rule) | |
1291 | #endif /* !YYDEBUG */ | |
1292 | ||
1293 | ||
1294 | /* YYINITDEPTH -- initial size of the parser's stacks. */ | |
1295 | #ifndef YYINITDEPTH | |
1296 | # define YYINITDEPTH 200 | |
1297 | #endif | |
1298 | ||
1299 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only | |
1300 | if the built-in stack extension method is used). | |
1301 | ||
1302 | Do not make this value too large; the results are undefined if | |
1303 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) | |
1304 | evaluated with infinite-precision integer arithmetic. */ | |
1305 | ||
1306 | #ifndef YYMAXDEPTH | |
1307 | # define YYMAXDEPTH 10000 | |
1308 | #endif | |
1309 | ||
1310 | \f | |
1311 | ||
1312 | #if YYERROR_VERBOSE | |
1313 | ||
1314 | # ifndef yystrlen | |
1315 | # if defined __GLIBC__ && defined _STRING_H | |
1316 | # define yystrlen strlen | |
1317 | # else | |
1318 | /* Return the length of YYSTR. */ | |
1319 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1320 | || defined __cplusplus || defined _MSC_VER) | |
1321 | static YYSIZE_T | |
1322 | yystrlen (const char *yystr) | |
1323 | #else | |
1324 | static YYSIZE_T | |
1325 | yystrlen (yystr) | |
1326 | const char *yystr; | |
1327 | #endif | |
1328 | { | |
1329 | YYSIZE_T yylen; | |
1330 | for (yylen = 0; yystr[yylen]; yylen++) | |
1331 | continue; | |
1332 | return yylen; | |
1333 | } | |
1334 | # endif | |
1335 | # endif | |
1336 | ||
1337 | # ifndef yystpcpy | |
1338 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE | |
1339 | # define yystpcpy stpcpy | |
1340 | # else | |
1341 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
1342 | YYDEST. */ | |
1343 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1344 | || defined __cplusplus || defined _MSC_VER) | |
1345 | static char * | |
1346 | yystpcpy (char *yydest, const char *yysrc) | |
1347 | #else | |
1348 | static char * | |
1349 | yystpcpy (yydest, yysrc) | |
1350 | char *yydest; | |
1351 | const char *yysrc; | |
1352 | #endif | |
1353 | { | |
1354 | char *yyd = yydest; | |
1355 | const char *yys = yysrc; | |
1356 | ||
1357 | while ((*yyd++ = *yys++) != '\0') | |
1358 | continue; | |
1359 | ||
1360 | return yyd - 1; | |
1361 | } | |
1362 | # endif | |
1363 | # endif | |
1364 | ||
1365 | # ifndef yytnamerr | |
1366 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary | |
1367 | quotes and backslashes, so that it's suitable for yyerror. The | |
1368 | heuristic is that double-quoting is unnecessary unless the string | |
1369 | contains an apostrophe, a comma, or backslash (other than | |
1370 | backslash-backslash). YYSTR is taken from yytname. If YYRES is | |
1371 | null, do not copy; instead, return the length of what the result | |
1372 | would have been. */ | |
1373 | static YYSIZE_T | |
1374 | yytnamerr (char *yyres, const char *yystr) | |
1375 | { | |
1376 | if (*yystr == '"') | |
1377 | { | |
1378 | YYSIZE_T yyn = 0; | |
1379 | char const *yyp = yystr; | |
1380 | ||
1381 | for (;;) | |
1382 | switch (*++yyp) | |
1383 | { | |
1384 | case '\'': | |
1385 | case ',': | |
1386 | goto do_not_strip_quotes; | |
1387 | ||
1388 | case '\\': | |
1389 | if (*++yyp != '\\') | |
1390 | goto do_not_strip_quotes; | |
1391 | /* Fall through. */ | |
1392 | default: | |
1393 | if (yyres) | |
1394 | yyres[yyn] = *yyp; | |
1395 | yyn++; | |
1396 | break; | |
1397 | ||
1398 | case '"': | |
1399 | if (yyres) | |
1400 | yyres[yyn] = '\0'; | |
1401 | return yyn; | |
1402 | } | |
1403 | do_not_strip_quotes: ; | |
1404 | } | |
1405 | ||
1406 | if (! yyres) | |
1407 | return yystrlen (yystr); | |
1408 | ||
1409 | return yystpcpy (yyres, yystr) - yyres; | |
1410 | } | |
1411 | # endif | |
1412 | ||
1413 | /* Copy into YYRESULT an error message about the unexpected token | |
1414 | YYCHAR while in state YYSTATE. Return the number of bytes copied, | |
1415 | including the terminating null byte. If YYRESULT is null, do not | |
1416 | copy anything; just return the number of bytes that would be | |
1417 | copied. As a special case, return 0 if an ordinary "syntax error" | |
1418 | message will do. Return YYSIZE_MAXIMUM if overflow occurs during | |
1419 | size calculation. */ | |
1420 | static YYSIZE_T | |
1421 | yysyntax_error (char *yyresult, int yystate, int yychar) | |
1422 | { | |
1423 | int yyn = yypact[yystate]; | |
1424 | ||
1425 | if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) | |
1426 | return 0; | |
1427 | else | |
1428 | { | |
1429 | int yytype = YYTRANSLATE (yychar); | |
1430 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); | |
1431 | YYSIZE_T yysize = yysize0; | |
1432 | YYSIZE_T yysize1; | |
1433 | int yysize_overflow = 0; | |
1434 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | |
1435 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |
1436 | int yyx; | |
1437 | ||
1438 | # if 0 | |
1439 | /* This is so xgettext sees the translatable formats that are | |
1440 | constructed on the fly. */ | |
1441 | YY_("syntax error, unexpected %s"); | |
1442 | YY_("syntax error, unexpected %s, expecting %s"); | |
1443 | YY_("syntax error, unexpected %s, expecting %s or %s"); | |
1444 | YY_("syntax error, unexpected %s, expecting %s or %s or %s"); | |
1445 | YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); | |
1446 | # endif | |
1447 | char *yyfmt; | |
1448 | char const *yyf; | |
1449 | static char const yyunexpected[] = "syntax error, unexpected %s"; | |
1450 | static char const yyexpecting[] = ", expecting %s"; | |
1451 | static char const yyor[] = " or %s"; | |
1452 | char yyformat[sizeof yyunexpected | |
1453 | + sizeof yyexpecting - 1 | |
1454 | + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) | |
1455 | * (sizeof yyor - 1))]; | |
1456 | char const *yyprefix = yyexpecting; | |
1457 | ||
1458 | /* Start YYX at -YYN if negative to avoid negative indexes in | |
1459 | YYCHECK. */ | |
1460 | int yyxbegin = yyn < 0 ? -yyn : 0; | |
1461 | ||
1462 | /* Stay within bounds of both yycheck and yytname. */ | |
1463 | int yychecklim = YYLAST - yyn + 1; | |
1464 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; | |
1465 | int yycount = 1; | |
1466 | ||
1467 | yyarg[0] = yytname[yytype]; | |
1468 | yyfmt = yystpcpy (yyformat, yyunexpected); | |
1469 | ||
1470 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) | |
1471 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | |
1472 | { | |
1473 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | |
1474 | { | |
1475 | yycount = 1; | |
1476 | yysize = yysize0; | |
1477 | yyformat[sizeof yyunexpected - 1] = '\0'; | |
1478 | break; | |
1479 | } | |
1480 | yyarg[yycount++] = yytname[yyx]; | |
1481 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); | |
1482 | yysize_overflow |= (yysize1 < yysize); | |
1483 | yysize = yysize1; | |
1484 | yyfmt = yystpcpy (yyfmt, yyprefix); | |
1485 | yyprefix = yyor; | |
1486 | } | |
1487 | ||
1488 | yyf = YY_(yyformat); | |
1489 | yysize1 = yysize + yystrlen (yyf); | |
1490 | yysize_overflow |= (yysize1 < yysize); | |
1491 | yysize = yysize1; | |
1492 | ||
1493 | if (yysize_overflow) | |
1494 | return YYSIZE_MAXIMUM; | |
1495 | ||
1496 | if (yyresult) | |
1497 | { | |
1498 | /* Avoid sprintf, as that infringes on the user's name space. | |
1499 | Don't have undefined behavior even if the translation | |
1500 | produced a string with the wrong number of "%s"s. */ | |
1501 | char *yyp = yyresult; | |
1502 | int yyi = 0; | |
1503 | while ((*yyp = *yyf) != '\0') | |
1504 | { | |
1505 | if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) | |
1506 | { | |
1507 | yyp += yytnamerr (yyp, yyarg[yyi++]); | |
1508 | yyf += 2; | |
1509 | } | |
1510 | else | |
1511 | { | |
1512 | yyp++; | |
1513 | yyf++; | |
1514 | } | |
1515 | } | |
1516 | } | |
1517 | return yysize; | |
1518 | } | |
1519 | } | |
1520 | #endif /* YYERROR_VERBOSE */ | |
1521 | \f | |
1522 | ||
1523 | /*-----------------------------------------------. | |
1524 | | Release the memory associated to this symbol. | | |
1525 | `-----------------------------------------------*/ | |
1526 | ||
1527 | /*ARGSUSED*/ | |
1528 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1529 | || defined __cplusplus || defined _MSC_VER) | |
1530 | static void | |
1531 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) | |
1532 | #else | |
1533 | static void | |
1534 | yydestruct (yymsg, yytype, yyvaluep, yylocationp) | |
1535 | const char *yymsg; | |
1536 | int yytype; | |
1537 | YYSTYPE *yyvaluep; | |
1538 | YYLTYPE *yylocationp; | |
1539 | #endif | |
1540 | { | |
1541 | YYUSE (yyvaluep); | |
1542 | YYUSE (yylocationp); | |
1543 | ||
1544 | if (!yymsg) | |
1545 | yymsg = "Deleting"; | |
1546 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
1547 | ||
1548 | switch (yytype) | |
1549 | { | |
1550 | ||
1551 | default: | |
1552 | break; | |
1553 | } | |
1554 | } | |
1555 | ||
1556 | /* Prevent warnings from -Wmissing-prototypes. */ | |
1557 | #ifdef YYPARSE_PARAM | |
1558 | #if defined __STDC__ || defined __cplusplus | |
1559 | int yyparse (void *YYPARSE_PARAM); | |
1560 | #else | |
1561 | int yyparse (); | |
1562 | #endif | |
1563 | #else /* ! YYPARSE_PARAM */ | |
1564 | #if defined __STDC__ || defined __cplusplus | |
1565 | int yyparse (void); | |
1566 | #else | |
1567 | int yyparse (); | |
1568 | #endif | |
1569 | #endif /* ! YYPARSE_PARAM */ | |
1570 | ||
1571 | ||
1572 | ||
1573 | ||
1574 | ||
1575 | /*-------------------------. | |
1576 | | yyparse or yypush_parse. | | |
1577 | `-------------------------*/ | |
1578 | ||
1579 | #ifdef YYPARSE_PARAM | |
1580 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1581 | || defined __cplusplus || defined _MSC_VER) | |
1582 | int | |
1583 | yyparse (void *YYPARSE_PARAM) | |
1584 | #else | |
1585 | int | |
1586 | yyparse (YYPARSE_PARAM) | |
1587 | void *YYPARSE_PARAM; | |
1588 | #endif | |
1589 | #else /* ! YYPARSE_PARAM */ | |
1590 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1591 | || defined __cplusplus || defined _MSC_VER) | |
1592 | int | |
1593 | yyparse (void) | |
1594 | #else | |
1595 | int | |
1596 | yyparse () | |
1597 | ||
1598 | #endif | |
1599 | #endif | |
1600 | { | |
1601 | /* The lookahead symbol. */ | |
1602 | int yychar; | |
1603 | ||
1604 | /* The semantic value of the lookahead symbol. */ | |
1605 | YYSTYPE yylval; | |
1606 | ||
1607 | /* Location data for the lookahead symbol. */ | |
1608 | YYLTYPE yylloc; | |
1609 | ||
1610 | /* Number of syntax errors so far. */ | |
1611 | int yynerrs; | |
1612 | ||
1613 | int yystate; | |
1614 | /* Number of tokens to shift before error messages enabled. */ | |
1615 | int yyerrstatus; | |
1616 | ||
1617 | /* The stacks and their tools: | |
1618 | `yyss': related to states. | |
1619 | `yyvs': related to semantic values. | |
1620 | `yyls': related to locations. | |
1621 | ||
1622 | Refer to the stacks thru separate pointers, to allow yyoverflow | |
1623 | to reallocate them elsewhere. */ | |
1624 | ||
1625 | /* The state stack. */ | |
1626 | yytype_int16 yyssa[YYINITDEPTH]; | |
1627 | yytype_int16 *yyss; | |
1628 | yytype_int16 *yyssp; | |
1629 | ||
1630 | /* The semantic value stack. */ | |
1631 | YYSTYPE yyvsa[YYINITDEPTH]; | |
1632 | YYSTYPE *yyvs; | |
1633 | YYSTYPE *yyvsp; | |
1634 | ||
1635 | /* The location stack. */ | |
1636 | YYLTYPE yylsa[YYINITDEPTH]; | |
1637 | YYLTYPE *yyls; | |
1638 | YYLTYPE *yylsp; | |
1639 | ||
1640 | /* The locations where the error started and ended. */ | |
1641 | YYLTYPE yyerror_range[2]; | |
1642 | ||
1643 | YYSIZE_T yystacksize; | |
1644 | ||
1645 | int yyn; | |
1646 | int yyresult; | |
1647 | /* Lookahead token as an internal (translated) token number. */ | |
1648 | int yytoken; | |
1649 | /* The variables used to return semantic value and location from the | |
1650 | action routines. */ | |
1651 | YYSTYPE yyval; | |
1652 | YYLTYPE yyloc; | |
1653 | ||
1654 | #if YYERROR_VERBOSE | |
1655 | /* Buffer for error messages, and its allocated size. */ | |
1656 | char yymsgbuf[128]; | |
1657 | char *yymsg = yymsgbuf; | |
1658 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
1659 | #endif | |
1660 | ||
1661 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) | |
1662 | ||
1663 | /* The number of symbols on the RHS of the reduced rule. | |
1664 | Keep to zero when no symbol should be popped. */ | |
1665 | int yylen = 0; | |
1666 | ||
1667 | yytoken = 0; | |
1668 | yyss = yyssa; | |
1669 | yyvs = yyvsa; | |
1670 | yyls = yylsa; | |
1671 | yystacksize = YYINITDEPTH; | |
1672 | ||
1673 | YYDPRINTF ((stderr, "Starting parse\n")); | |
1674 | ||
1675 | yystate = 0; | |
1676 | yyerrstatus = 0; | |
1677 | yynerrs = 0; | |
1678 | yychar = YYEMPTY; /* Cause a token to be read. */ | |
1679 | ||
1680 | /* Initialize stack pointers. | |
1681 | Waste one element of value and location stack | |
1682 | so that they stay on the same level as the state stack. | |
1683 | The wasted elements are never initialized. */ | |
1684 | yyssp = yyss; | |
1685 | yyvsp = yyvs; | |
1686 | yylsp = yyls; | |
1687 | ||
1688 | #if YYLTYPE_IS_TRIVIAL | |
1689 | /* Initialize the default location before parsing starts. */ | |
1690 | yylloc.first_line = yylloc.last_line = 1; | |
1691 | yylloc.first_column = yylloc.last_column = 1; | |
1692 | #endif | |
1693 | ||
1694 | /* User initialization code. */ | |
1695 | ||
1696 | /* Line 1243 of yacc.c */ | |
1697 | #line 86 "parse-gram.y" | |
1698 | { | |
1699 | /* Bison's grammar can initial empty locations, hence a default | |
1700 | location is needed. */ | |
1701 | boundary_set (&yylloc.start, current_file, 1, 1); | |
1702 | boundary_set (&yylloc.end, current_file, 1, 1); | |
1703 | } | |
1704 | ||
1705 | /* Line 1243 of yacc.c */ | |
1706 | #line 1707 "../../branch-2.5/src/parse-gram.c" | |
1707 | yylsp[0] = yylloc; | |
1708 | ||
1709 | goto yysetstate; | |
1710 | ||
1711 | /*------------------------------------------------------------. | |
1712 | | yynewstate -- Push a new state, which is found in yystate. | | |
1713 | `------------------------------------------------------------*/ | |
1714 | yynewstate: | |
1715 | /* In all cases, when you get here, the value and location stacks | |
1716 | have just been pushed. So pushing a state here evens the stacks. */ | |
1717 | yyssp++; | |
1718 | ||
1719 | yysetstate: | |
1720 | *yyssp = yystate; | |
1721 | ||
1722 | if (yyss + yystacksize - 1 <= yyssp) | |
1723 | { | |
1724 | /* Get the current used size of the three stacks, in elements. */ | |
1725 | YYSIZE_T yysize = yyssp - yyss + 1; | |
1726 | ||
1727 | #ifdef yyoverflow | |
1728 | { | |
1729 | /* Give user a chance to reallocate the stack. Use copies of | |
1730 | these so that the &'s don't force the real ones into | |
1731 | memory. */ | |
1732 | YYSTYPE *yyvs1 = yyvs; | |
1733 | yytype_int16 *yyss1 = yyss; | |
1734 | YYLTYPE *yyls1 = yyls; | |
1735 | ||
1736 | /* Each stack pointer address is followed by the size of the | |
1737 | data in use in that stack, in bytes. This used to be a | |
1738 | conditional around just the two extra args, but that might | |
1739 | be undefined if yyoverflow is a macro. */ | |
1740 | yyoverflow (YY_("memory exhausted"), | |
1741 | &yyss1, yysize * sizeof (*yyssp), | |
1742 | &yyvs1, yysize * sizeof (*yyvsp), | |
1743 | &yyls1, yysize * sizeof (*yylsp), | |
1744 | &yystacksize); | |
1745 | ||
1746 | yyls = yyls1; | |
1747 | yyss = yyss1; | |
1748 | yyvs = yyvs1; | |
1749 | } | |
1750 | #else /* no yyoverflow */ | |
1751 | # ifndef YYSTACK_RELOCATE | |
1752 | goto yyexhaustedlab; | |
1753 | # else | |
1754 | /* Extend the stack our own way. */ | |
1755 | if (YYMAXDEPTH <= yystacksize) | |
1756 | goto yyexhaustedlab; | |
1757 | yystacksize *= 2; | |
1758 | if (YYMAXDEPTH < yystacksize) | |
1759 | yystacksize = YYMAXDEPTH; | |
1760 | ||
1761 | { | |
1762 | yytype_int16 *yyss1 = yyss; | |
1763 | union yyalloc *yyptr = | |
1764 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
1765 | if (! yyptr) | |
1766 | goto yyexhaustedlab; | |
1767 | YYSTACK_RELOCATE (yyss_alloc, yyss); | |
1768 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); | |
1769 | YYSTACK_RELOCATE (yyls_alloc, yyls); | |
1770 | # undef YYSTACK_RELOCATE | |
1771 | if (yyss1 != yyssa) | |
1772 | YYSTACK_FREE (yyss1); | |
1773 | } | |
1774 | # endif | |
1775 | #endif /* no yyoverflow */ | |
1776 | ||
1777 | yyssp = yyss + yysize - 1; | |
1778 | yyvsp = yyvs + yysize - 1; | |
1779 | yylsp = yyls + yysize - 1; | |
1780 | ||
1781 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", | |
1782 | (unsigned long int) yystacksize)); | |
1783 | ||
1784 | if (yyss + yystacksize - 1 <= yyssp) | |
1785 | YYABORT; | |
1786 | } | |
1787 | ||
1788 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | |
1789 | ||
1790 | if (yystate == YYFINAL) | |
1791 | YYACCEPT; | |
1792 | ||
1793 | goto yybackup; | |
1794 | ||
1795 | /*-----------. | |
1796 | | yybackup. | | |
1797 | `-----------*/ | |
1798 | yybackup: | |
1799 | ||
1800 | /* Do appropriate processing given the current state. Read a | |
1801 | lookahead token if we need one and don't already have one. */ | |
1802 | ||
1803 | /* First try to decide what to do without reference to lookahead token. */ | |
1804 | yyn = yypact[yystate]; | |
1805 | if (yyn == YYPACT_NINF) | |
1806 | goto yydefault; | |
1807 | ||
1808 | /* Not known => get a lookahead token if don't already have one. */ | |
1809 | ||
1810 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ | |
1811 | if (yychar == YYEMPTY) | |
1812 | { | |
1813 | YYDPRINTF ((stderr, "Reading a token: ")); | |
1814 | yychar = YYLEX; | |
1815 | } | |
1816 | ||
1817 | if (yychar <= YYEOF) | |
1818 | { | |
1819 | yychar = yytoken = YYEOF; | |
1820 | YYDPRINTF ((stderr, "Now at end of input.\n")); | |
1821 | } | |
1822 | else | |
1823 | { | |
1824 | yytoken = YYTRANSLATE (yychar); | |
1825 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); | |
1826 | } | |
1827 | ||
1828 | /* If the proper action on seeing token YYTOKEN is to reduce or to | |
1829 | detect an error, take that action. */ | |
1830 | yyn += yytoken; | |
1831 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) | |
1832 | goto yydefault; | |
1833 | yyn = yytable[yyn]; | |
1834 | if (yyn <= 0) | |
1835 | { | |
1836 | if (yyn == 0 || yyn == YYTABLE_NINF) | |
1837 | goto yyerrlab; | |
1838 | yyn = -yyn; | |
1839 | goto yyreduce; | |
1840 | } | |
1841 | ||
1842 | /* Count tokens shifted since error; after three, turn off error | |
1843 | status. */ | |
1844 | if (yyerrstatus) | |
1845 | yyerrstatus--; | |
1846 | ||
1847 | /* Shift the lookahead token. */ | |
1848 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); | |
1849 | ||
1850 | /* Discard the shifted token. */ | |
1851 | yychar = YYEMPTY; | |
1852 | ||
1853 | yystate = yyn; | |
1854 | *++yyvsp = yylval; | |
1855 | *++yylsp = yylloc; | |
1856 | goto yynewstate; | |
1857 | ||
1858 | ||
1859 | /*-----------------------------------------------------------. | |
1860 | | yydefault -- do the default action for the current state. | | |
1861 | `-----------------------------------------------------------*/ | |
1862 | yydefault: | |
1863 | yyn = yydefact[yystate]; | |
1864 | if (yyn == 0) | |
1865 | goto yyerrlab; | |
1866 | goto yyreduce; | |
1867 | ||
1868 | ||
1869 | /*-----------------------------. | |
1870 | | yyreduce -- Do a reduction. | | |
1871 | `-----------------------------*/ | |
1872 | yyreduce: | |
1873 | /* yyn is the number of a rule to reduce with. */ | |
1874 | yylen = yyr2[yyn]; | |
1875 | ||
1876 | /* If YYLEN is nonzero, implement the default value of the action: | |
1877 | `$$ = $1'. | |
1878 | ||
1879 | Otherwise, the following line sets YYVAL to garbage. | |
1880 | This behavior is undocumented and Bison | |
1881 | users should not rely upon it. Assigning to YYVAL | |
1882 | unconditionally makes the parser a bit smaller, and it avoids a | |
1883 | GCC warning that YYVAL may be used uninitialized. */ | |
1884 | yyval = yyvsp[1-yylen]; | |
1885 | ||
1886 | /* Default location. */ | |
1887 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); | |
1888 | YY_REDUCE_PRINT (yyn); | |
1889 | switch (yyn) | |
1890 | { | |
1891 | case 6: | |
1892 | ||
1893 | /* Line 1456 of yacc.c */ | |
1894 | #line 223 "parse-gram.y" | |
1895 | { | |
1896 | code_props plain_code; | |
1897 | code_props_plain_init (&plain_code, (yyvsp[(1) - (1)].chars), (yylsp[(1) - (1)])); | |
1898 | code_props_translate_code (&plain_code); | |
1899 | gram_scanner_last_string_free (); | |
1900 | muscle_code_grow (union_seen ? "post_prologue" : "pre_prologue", | |
1901 | plain_code.code, (yylsp[(1) - (1)])); | |
1902 | code_scanner_last_string_free (); | |
1903 | } | |
1904 | break; | |
1905 | ||
1906 | case 7: | |
1907 | ||
1908 | /* Line 1456 of yacc.c */ | |
1909 | #line 232 "parse-gram.y" | |
1910 | { debug_flag = true; } | |
1911 | break; | |
1912 | ||
1913 | case 8: | |
1914 | ||
1915 | /* Line 1456 of yacc.c */ | |
1916 | #line 234 "parse-gram.y" | |
1917 | { | |
1918 | muscle_percent_define_insert ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars), | |
1919 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
1920 | } | |
1921 | break; | |
1922 | ||
1923 | case 9: | |
1924 | ||
1925 | /* Line 1456 of yacc.c */ | |
1926 | #line 238 "parse-gram.y" | |
1927 | { defines_flag = true; } | |
1928 | break; | |
1929 | ||
1930 | case 10: | |
1931 | ||
1932 | /* Line 1456 of yacc.c */ | |
1933 | #line 240 "parse-gram.y" | |
1934 | { | |
1935 | defines_flag = true; | |
1936 | spec_defines_file = xstrdup ((yyvsp[(2) - (2)].chars)); | |
1937 | } | |
1938 | break; | |
1939 | ||
1940 | case 11: | |
1941 | ||
1942 | /* Line 1456 of yacc.c */ | |
1943 | #line 244 "parse-gram.y" | |
1944 | { error_verbose = true; } | |
1945 | break; | |
1946 | ||
1947 | case 12: | |
1948 | ||
1949 | /* Line 1456 of yacc.c */ | |
1950 | #line 245 "parse-gram.y" | |
1951 | { expected_sr_conflicts = (yyvsp[(2) - (2)].integer); } | |
1952 | break; | |
1953 | ||
1954 | case 13: | |
1955 | ||
1956 | /* Line 1456 of yacc.c */ | |
1957 | #line 246 "parse-gram.y" | |
1958 | { expected_rr_conflicts = (yyvsp[(2) - (2)].integer); } | |
1959 | break; | |
1960 | ||
1961 | case 14: | |
1962 | ||
1963 | /* Line 1456 of yacc.c */ | |
1964 | #line 247 "parse-gram.y" | |
1965 | { spec_file_prefix = (yyvsp[(2) - (2)].chars); } | |
1966 | break; | |
1967 | ||
1968 | case 15: | |
1969 | ||
1970 | /* Line 1456 of yacc.c */ | |
1971 | #line 248 "parse-gram.y" | |
1972 | { spec_file_prefix = (yyvsp[(3) - (3)].chars); } | |
1973 | break; | |
1974 | ||
1975 | case 16: | |
1976 | ||
1977 | /* Line 1456 of yacc.c */ | |
1978 | #line 250 "parse-gram.y" | |
1979 | { | |
1980 | nondeterministic_parser = true; | |
1981 | glr_parser = true; | |
1982 | } | |
1983 | break; | |
1984 | ||
1985 | case 17: | |
1986 | ||
1987 | /* Line 1456 of yacc.c */ | |
1988 | #line 255 "parse-gram.y" | |
1989 | { | |
1990 | code_props action; | |
1991 | code_props_symbol_action_init (&action, (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); | |
1992 | code_props_translate_code (&action); | |
1993 | gram_scanner_last_string_free (); | |
1994 | muscle_code_grow ("initial_action", action.code, (yylsp[(2) - (2)])); | |
1995 | code_scanner_last_string_free (); | |
1996 | } | |
1997 | break; | |
1998 | ||
1999 | case 18: | |
2000 | ||
2001 | /* Line 1456 of yacc.c */ | |
2002 | #line 263 "parse-gram.y" | |
2003 | { language_argmatch ((yyvsp[(2) - (2)].chars), grammar_prio, (yylsp[(1) - (2)])); } | |
2004 | break; | |
2005 | ||
2006 | case 19: | |
2007 | ||
2008 | /* Line 1456 of yacc.c */ | |
2009 | #line 264 "parse-gram.y" | |
2010 | { add_param ("lex_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); } | |
2011 | break; | |
2012 | ||
2013 | case 20: | |
2014 | ||
2015 | /* Line 1456 of yacc.c */ | |
2016 | #line 265 "parse-gram.y" | |
2017 | { locations_flag = true; } | |
2018 | break; | |
2019 | ||
2020 | case 21: | |
2021 | ||
2022 | /* Line 1456 of yacc.c */ | |
2023 | #line 266 "parse-gram.y" | |
2024 | { spec_name_prefix = (yyvsp[(2) - (2)].chars); } | |
2025 | break; | |
2026 | ||
2027 | case 22: | |
2028 | ||
2029 | /* Line 1456 of yacc.c */ | |
2030 | #line 267 "parse-gram.y" | |
2031 | { spec_name_prefix = (yyvsp[(3) - (3)].chars); } | |
2032 | break; | |
2033 | ||
2034 | case 23: | |
2035 | ||
2036 | /* Line 1456 of yacc.c */ | |
2037 | #line 268 "parse-gram.y" | |
2038 | { no_lines_flag = true; } | |
2039 | break; | |
2040 | ||
2041 | case 24: | |
2042 | ||
2043 | /* Line 1456 of yacc.c */ | |
2044 | #line 269 "parse-gram.y" | |
2045 | { nondeterministic_parser = true; } | |
2046 | break; | |
2047 | ||
2048 | case 25: | |
2049 | ||
2050 | /* Line 1456 of yacc.c */ | |
2051 | #line 270 "parse-gram.y" | |
2052 | { spec_outfile = (yyvsp[(2) - (2)].chars); } | |
2053 | break; | |
2054 | ||
2055 | case 26: | |
2056 | ||
2057 | /* Line 1456 of yacc.c */ | |
2058 | #line 271 "parse-gram.y" | |
2059 | { spec_outfile = (yyvsp[(3) - (3)].chars); } | |
2060 | break; | |
2061 | ||
2062 | case 27: | |
2063 | ||
2064 | /* Line 1456 of yacc.c */ | |
2065 | #line 272 "parse-gram.y" | |
2066 | { add_param ("parse_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); } | |
2067 | break; | |
2068 | ||
2069 | case 28: | |
2070 | ||
2071 | /* Line 1456 of yacc.c */ | |
2072 | #line 274 "parse-gram.y" | |
2073 | { | |
2074 | /* %pure-parser is deprecated in favor of `%define api.pure', so use | |
2075 | `%define api.pure' in a backward-compatible manner here. First, don't | |
2076 | complain if %pure-parser is specified multiple times. */ | |
2077 | if (!muscle_find_const ("percent_define(api.pure)")) | |
2078 | muscle_percent_define_insert ("api.pure", (yylsp[(1) - (1)]), "", | |
2079 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
2080 | /* In all cases, use api.pure now so that the backend doesn't complain if | |
2081 | the skeleton ignores api.pure, but do warn now if there's a previous | |
2082 | conflicting definition from an actual %define. */ | |
2083 | if (!muscle_percent_define_flag_if ("api.pure")) | |
2084 | muscle_percent_define_insert ("api.pure", (yylsp[(1) - (1)]), "", | |
2085 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
2086 | } | |
2087 | break; | |
2088 | ||
2089 | case 29: | |
2090 | ||
2091 | /* Line 1456 of yacc.c */ | |
2092 | #line 288 "parse-gram.y" | |
2093 | { version_check (&(yylsp[(2) - (2)]), (yyvsp[(2) - (2)].chars)); } | |
2094 | break; | |
2095 | ||
2096 | case 30: | |
2097 | ||
2098 | /* Line 1456 of yacc.c */ | |
2099 | #line 290 "parse-gram.y" | |
2100 | { | |
2101 | char const *skeleton_user = (yyvsp[(2) - (2)].chars); | |
2102 | if (strchr (skeleton_user, '/')) | |
2103 | { | |
2104 | size_t dir_length = strlen (current_file); | |
2105 | char *skeleton_build; | |
2106 | while (dir_length && current_file[dir_length - 1] != '/') | |
2107 | --dir_length; | |
2108 | while (dir_length && current_file[dir_length - 1] == '/') | |
2109 | --dir_length; | |
2110 | skeleton_build = | |
2111 | xmalloc (dir_length + 1 + strlen (skeleton_user) + 1); | |
2112 | if (dir_length > 0) | |
2113 | { | |
2114 | strncpy (skeleton_build, current_file, dir_length); | |
2115 | skeleton_build[dir_length++] = '/'; | |
2116 | } | |
2117 | strcpy (skeleton_build + dir_length, skeleton_user); | |
2118 | skeleton_user = uniqstr_new (skeleton_build); | |
2119 | free (skeleton_build); | |
2120 | } | |
2121 | skeleton_arg (skeleton_user, grammar_prio, (yylsp[(1) - (2)])); | |
2122 | } | |
2123 | break; | |
2124 | ||
2125 | case 31: | |
2126 | ||
2127 | /* Line 1456 of yacc.c */ | |
2128 | #line 313 "parse-gram.y" | |
2129 | { token_table_flag = true; } | |
2130 | break; | |
2131 | ||
2132 | case 32: | |
2133 | ||
2134 | /* Line 1456 of yacc.c */ | |
2135 | #line 314 "parse-gram.y" | |
2136 | { report_flag |= report_states; } | |
2137 | break; | |
2138 | ||
2139 | case 33: | |
2140 | ||
2141 | /* Line 1456 of yacc.c */ | |
2142 | #line 315 "parse-gram.y" | |
2143 | { yacc_flag = true; } | |
2144 | break; | |
2145 | ||
2146 | case 37: | |
2147 | ||
2148 | /* Line 1456 of yacc.c */ | |
2149 | #line 323 "parse-gram.y" | |
2150 | { | |
2151 | grammar_start_symbol_set ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)])); | |
2152 | } | |
2153 | break; | |
2154 | ||
2155 | case 38: | |
2156 | ||
2157 | /* Line 1456 of yacc.c */ | |
2158 | #line 327 "parse-gram.y" | |
2159 | { | |
2160 | symbol_list *list; | |
2161 | for (list = (yyvsp[(3) - (3)].list); list; list = list->next) | |
2162 | symbol_list_destructor_set (list, (yyvsp[(2) - (3)].code), (yylsp[(2) - (3)])); | |
2163 | symbol_list_free ((yyvsp[(3) - (3)].list)); | |
2164 | } | |
2165 | break; | |
2166 | ||
2167 | case 39: | |
2168 | ||
2169 | /* Line 1456 of yacc.c */ | |
2170 | #line 334 "parse-gram.y" | |
2171 | { | |
2172 | symbol_list *list; | |
2173 | for (list = (yyvsp[(3) - (3)].list); list; list = list->next) | |
2174 | symbol_list_printer_set (list, (yyvsp[(2) - (3)].code), (yylsp[(2) - (3)])); | |
2175 | symbol_list_free ((yyvsp[(3) - (3)].list)); | |
2176 | } | |
2177 | break; | |
2178 | ||
2179 | case 40: | |
2180 | ||
2181 | /* Line 1456 of yacc.c */ | |
2182 | #line 341 "parse-gram.y" | |
2183 | { | |
2184 | default_prec = true; | |
2185 | } | |
2186 | break; | |
2187 | ||
2188 | case 41: | |
2189 | ||
2190 | /* Line 1456 of yacc.c */ | |
2191 | #line 345 "parse-gram.y" | |
2192 | { | |
2193 | default_prec = false; | |
2194 | } | |
2195 | break; | |
2196 | ||
2197 | case 42: | |
2198 | ||
2199 | /* Line 1456 of yacc.c */ | |
2200 | #line 349 "parse-gram.y" | |
2201 | { | |
2202 | /* Do not invoke muscle_percent_code_grow here since it invokes | |
2203 | muscle_user_name_list_grow. */ | |
2204 | muscle_code_grow ("percent_code()", (yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)])); | |
2205 | code_scanner_last_string_free (); | |
2206 | } | |
2207 | break; | |
2208 | ||
2209 | case 43: | |
2210 | ||
2211 | /* Line 1456 of yacc.c */ | |
2212 | #line 356 "parse-gram.y" | |
2213 | { | |
2214 | muscle_percent_code_grow ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)])); | |
2215 | code_scanner_last_string_free (); | |
2216 | } | |
2217 | break; | |
2218 | ||
2219 | case 44: | |
2220 | ||
2221 | /* Line 1456 of yacc.c */ | |
2222 | #line 370 "parse-gram.y" | |
2223 | {} | |
2224 | break; | |
2225 | ||
2226 | case 45: | |
2227 | ||
2228 | /* Line 1456 of yacc.c */ | |
2229 | #line 371 "parse-gram.y" | |
2230 | { muscle_code_grow ("union_name", (yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } | |
2231 | break; | |
2232 | ||
2233 | case 46: | |
2234 | ||
2235 | /* Line 1456 of yacc.c */ | |
2236 | #line 376 "parse-gram.y" | |
2237 | { | |
2238 | union_seen = true; | |
2239 | muscle_code_grow ("stype", (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)])); | |
2240 | code_scanner_last_string_free (); | |
2241 | } | |
2242 | break; | |
2243 | ||
2244 | case 47: | |
2245 | ||
2246 | /* Line 1456 of yacc.c */ | |
2247 | #line 387 "parse-gram.y" | |
2248 | { current_class = nterm_sym; } | |
2249 | break; | |
2250 | ||
2251 | case 48: | |
2252 | ||
2253 | /* Line 1456 of yacc.c */ | |
2254 | #line 388 "parse-gram.y" | |
2255 | { | |
2256 | current_class = unknown_sym; | |
2257 | current_type = NULL; | |
2258 | } | |
2259 | break; | |
2260 | ||
2261 | case 49: | |
2262 | ||
2263 | /* Line 1456 of yacc.c */ | |
2264 | #line 392 "parse-gram.y" | |
2265 | { current_class = token_sym; } | |
2266 | break; | |
2267 | ||
2268 | case 50: | |
2269 | ||
2270 | /* Line 1456 of yacc.c */ | |
2271 | #line 393 "parse-gram.y" | |
2272 | { | |
2273 | current_class = unknown_sym; | |
2274 | current_type = NULL; | |
2275 | } | |
2276 | break; | |
2277 | ||
2278 | case 51: | |
2279 | ||
2280 | /* Line 1456 of yacc.c */ | |
2281 | #line 398 "parse-gram.y" | |
2282 | { | |
2283 | symbol_list *list; | |
2284 | tag_seen = true; | |
2285 | for (list = (yyvsp[(3) - (3)].list); list; list = list->next) | |
2286 | symbol_type_set (list->content.sym, (yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)])); | |
2287 | symbol_list_free ((yyvsp[(3) - (3)].list)); | |
2288 | } | |
2289 | break; | |
2290 | ||
2291 | case 52: | |
2292 | ||
2293 | /* Line 1456 of yacc.c */ | |
2294 | #line 409 "parse-gram.y" | |
2295 | { | |
2296 | symbol_list *list; | |
2297 | ++current_prec; | |
2298 | for (list = (yyvsp[(3) - (3)].list); list; list = list->next) | |
2299 | { | |
2300 | symbol_type_set (list->content.sym, current_type, (yylsp[(2) - (3)])); | |
2301 | symbol_precedence_set (list->content.sym, current_prec, (yyvsp[(1) - (3)].assoc), (yylsp[(1) - (3)])); | |
2302 | } | |
2303 | symbol_list_free ((yyvsp[(3) - (3)].list)); | |
2304 | current_type = NULL; | |
2305 | } | |
2306 | break; | |
2307 | ||
2308 | case 53: | |
2309 | ||
2310 | /* Line 1456 of yacc.c */ | |
2311 | #line 423 "parse-gram.y" | |
2312 | { (yyval.assoc) = left_assoc; } | |
2313 | break; | |
2314 | ||
2315 | case 54: | |
2316 | ||
2317 | /* Line 1456 of yacc.c */ | |
2318 | #line 424 "parse-gram.y" | |
2319 | { (yyval.assoc) = right_assoc; } | |
2320 | break; | |
2321 | ||
2322 | case 55: | |
2323 | ||
2324 | /* Line 1456 of yacc.c */ | |
2325 | #line 425 "parse-gram.y" | |
2326 | { (yyval.assoc) = non_assoc; } | |
2327 | break; | |
2328 | ||
2329 | case 56: | |
2330 | ||
2331 | /* Line 1456 of yacc.c */ | |
2332 | #line 429 "parse-gram.y" | |
2333 | { current_type = NULL; } | |
2334 | break; | |
2335 | ||
2336 | case 57: | |
2337 | ||
2338 | /* Line 1456 of yacc.c */ | |
2339 | #line 430 "parse-gram.y" | |
2340 | { current_type = (yyvsp[(1) - (1)].uniqstr); tag_seen = true; } | |
2341 | break; | |
2342 | ||
2343 | case 58: | |
2344 | ||
2345 | /* Line 1456 of yacc.c */ | |
2346 | #line 436 "parse-gram.y" | |
2347 | { (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); } | |
2348 | break; | |
2349 | ||
2350 | case 59: | |
2351 | ||
2352 | /* Line 1456 of yacc.c */ | |
2353 | #line 438 "parse-gram.y" | |
2354 | { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); } | |
2355 | break; | |
2356 | ||
2357 | case 60: | |
2358 | ||
2359 | /* Line 1456 of yacc.c */ | |
2360 | #line 442 "parse-gram.y" | |
2361 | { (yyval.symbol) = (yyvsp[(1) - (1)].symbol); } | |
2362 | break; | |
2363 | ||
2364 | case 61: | |
2365 | ||
2366 | /* Line 1456 of yacc.c */ | |
2367 | #line 443 "parse-gram.y" | |
2368 | { (yyval.symbol) = (yyvsp[(1) - (2)].symbol); symbol_user_token_number_set ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].integer), (yylsp[(2) - (2)])); } | |
2369 | break; | |
2370 | ||
2371 | case 62: | |
2372 | ||
2373 | /* Line 1456 of yacc.c */ | |
2374 | #line 449 "parse-gram.y" | |
2375 | { (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); } | |
2376 | break; | |
2377 | ||
2378 | case 63: | |
2379 | ||
2380 | /* Line 1456 of yacc.c */ | |
2381 | #line 451 "parse-gram.y" | |
2382 | { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); } | |
2383 | break; | |
2384 | ||
2385 | case 64: | |
2386 | ||
2387 | /* Line 1456 of yacc.c */ | |
2388 | #line 455 "parse-gram.y" | |
2389 | { (yyval.list) = (yyvsp[(1) - (1)].list); } | |
2390 | break; | |
2391 | ||
2392 | case 65: | |
2393 | ||
2394 | /* Line 1456 of yacc.c */ | |
2395 | #line 456 "parse-gram.y" | |
2396 | { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list)); } | |
2397 | break; | |
2398 | ||
2399 | case 66: | |
2400 | ||
2401 | /* Line 1456 of yacc.c */ | |
2402 | #line 460 "parse-gram.y" | |
2403 | { (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); } | |
2404 | break; | |
2405 | ||
2406 | case 67: | |
2407 | ||
2408 | /* Line 1456 of yacc.c */ | |
2409 | #line 461 "parse-gram.y" | |
2410 | { (yyval.list) = symbol_list_type_new ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } | |
2411 | break; | |
2412 | ||
2413 | case 68: | |
2414 | ||
2415 | /* Line 1456 of yacc.c */ | |
2416 | #line 462 "parse-gram.y" | |
2417 | { (yyval.list) = symbol_list_default_tagged_new ((yylsp[(1) - (1)])); } | |
2418 | break; | |
2419 | ||
2420 | case 69: | |
2421 | ||
2422 | /* Line 1456 of yacc.c */ | |
2423 | #line 463 "parse-gram.y" | |
2424 | { (yyval.list) = symbol_list_default_tagless_new ((yylsp[(1) - (1)])); } | |
2425 | break; | |
2426 | ||
2427 | case 70: | |
2428 | ||
2429 | /* Line 1456 of yacc.c */ | |
2430 | #line 469 "parse-gram.y" | |
2431 | { | |
2432 | current_type = (yyvsp[(1) - (1)].uniqstr); | |
2433 | tag_seen = true; | |
2434 | } | |
2435 | break; | |
2436 | ||
2437 | case 71: | |
2438 | ||
2439 | /* Line 1456 of yacc.c */ | |
2440 | #line 474 "parse-gram.y" | |
2441 | { | |
2442 | symbol_class_set ((yyvsp[(1) - (1)].symbol), current_class, (yylsp[(1) - (1)]), true); | |
2443 | symbol_type_set ((yyvsp[(1) - (1)].symbol), current_type, (yylsp[(1) - (1)])); | |
2444 | } | |
2445 | break; | |
2446 | ||
2447 | case 72: | |
2448 | ||
2449 | /* Line 1456 of yacc.c */ | |
2450 | #line 479 "parse-gram.y" | |
2451 | { | |
2452 | symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true); | |
2453 | symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)])); | |
2454 | symbol_user_token_number_set ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].integer), (yylsp[(2) - (2)])); | |
2455 | } | |
2456 | break; | |
2457 | ||
2458 | case 73: | |
2459 | ||
2460 | /* Line 1456 of yacc.c */ | |
2461 | #line 485 "parse-gram.y" | |
2462 | { | |
2463 | symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true); | |
2464 | symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)])); | |
2465 | symbol_make_alias ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].symbol), (yyloc)); | |
2466 | } | |
2467 | break; | |
2468 | ||
2469 | case 74: | |
2470 | ||
2471 | /* Line 1456 of yacc.c */ | |
2472 | #line 491 "parse-gram.y" | |
2473 | { | |
2474 | symbol_class_set ((yyvsp[(1) - (3)].symbol), current_class, (yylsp[(1) - (3)]), true); | |
2475 | symbol_type_set ((yyvsp[(1) - (3)].symbol), current_type, (yylsp[(1) - (3)])); | |
2476 | symbol_user_token_number_set ((yyvsp[(1) - (3)].symbol), (yyvsp[(2) - (3)].integer), (yylsp[(2) - (3)])); | |
2477 | symbol_make_alias ((yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol), (yyloc)); | |
2478 | } | |
2479 | break; | |
2480 | ||
2481 | case 81: | |
2482 | ||
2483 | /* Line 1456 of yacc.c */ | |
2484 | #line 521 "parse-gram.y" | |
2485 | { | |
2486 | yyerrok; | |
2487 | } | |
2488 | break; | |
2489 | ||
2490 | case 82: | |
2491 | ||
2492 | /* Line 1456 of yacc.c */ | |
2493 | #line 527 "parse-gram.y" | |
2494 | { current_lhs = (yyvsp[(1) - (2)].symbol); current_lhs_location = (yylsp[(1) - (2)]); | |
2495 | current_lhs_named_ref = (yyvsp[(2) - (2)].named_ref); } | |
2496 | break; | |
2497 | ||
2498 | case 84: | |
2499 | ||
2500 | /* Line 1456 of yacc.c */ | |
2501 | #line 532 "parse-gram.y" | |
2502 | { grammar_current_rule_end ((yylsp[(1) - (1)])); } | |
2503 | break; | |
2504 | ||
2505 | case 85: | |
2506 | ||
2507 | /* Line 1456 of yacc.c */ | |
2508 | #line 533 "parse-gram.y" | |
2509 | { grammar_current_rule_end ((yylsp[(3) - (3)])); } | |
2510 | break; | |
2511 | ||
2512 | case 87: | |
2513 | ||
2514 | /* Line 1456 of yacc.c */ | |
2515 | #line 539 "parse-gram.y" | |
2516 | { grammar_current_rule_begin (current_lhs, current_lhs_location, | |
2517 | current_lhs_named_ref); } | |
2518 | break; | |
2519 | ||
2520 | case 88: | |
2521 | ||
2522 | /* Line 1456 of yacc.c */ | |
2523 | #line 542 "parse-gram.y" | |
2524 | { grammar_current_rule_symbol_append ((yyvsp[(2) - (3)].symbol), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].named_ref)); } | |
2525 | break; | |
2526 | ||
2527 | case 89: | |
2528 | ||
2529 | /* Line 1456 of yacc.c */ | |
2530 | #line 544 "parse-gram.y" | |
2531 | { grammar_current_rule_action_append ((yyvsp[(2) - (3)].code), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].named_ref)); } | |
2532 | break; | |
2533 | ||
2534 | case 90: | |
2535 | ||
2536 | /* Line 1456 of yacc.c */ | |
2537 | #line 546 "parse-gram.y" | |
2538 | { grammar_current_rule_prec_set ((yyvsp[(3) - (3)].symbol), (yylsp[(3) - (3)])); } | |
2539 | break; | |
2540 | ||
2541 | case 91: | |
2542 | ||
2543 | /* Line 1456 of yacc.c */ | |
2544 | #line 548 "parse-gram.y" | |
2545 | { grammar_current_rule_dprec_set ((yyvsp[(3) - (3)].integer), (yylsp[(3) - (3)])); } | |
2546 | break; | |
2547 | ||
2548 | case 92: | |
2549 | ||
2550 | /* Line 1456 of yacc.c */ | |
2551 | #line 550 "parse-gram.y" | |
2552 | { grammar_current_rule_merge_set ((yyvsp[(3) - (3)].uniqstr), (yylsp[(3) - (3)])); } | |
2553 | break; | |
2554 | ||
2555 | case 93: | |
2556 | ||
2557 | /* Line 1456 of yacc.c */ | |
2558 | #line 554 "parse-gram.y" | |
2559 | { (yyval.named_ref) = 0; } | |
2560 | break; | |
2561 | ||
2562 | case 94: | |
2563 | ||
2564 | /* Line 1456 of yacc.c */ | |
2565 | #line 556 "parse-gram.y" | |
2566 | { (yyval.named_ref) = named_ref_new((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } | |
2567 | break; | |
2568 | ||
2569 | case 96: | |
2570 | ||
2571 | /* Line 1456 of yacc.c */ | |
2572 | #line 568 "parse-gram.y" | |
2573 | { (yyval.uniqstr) = uniqstr_new ((yyvsp[(1) - (1)].chars)); } | |
2574 | break; | |
2575 | ||
2576 | case 97: | |
2577 | ||
2578 | /* Line 1456 of yacc.c */ | |
2579 | #line 573 "parse-gram.y" | |
2580 | { (yyval.chars) = ""; } | |
2581 | break; | |
2582 | ||
2583 | case 99: | |
2584 | ||
2585 | /* Line 1456 of yacc.c */ | |
2586 | #line 584 "parse-gram.y" | |
2587 | { | |
2588 | code_props plain_code; | |
2589 | (yyvsp[(1) - (1)].code)[strlen ((yyvsp[(1) - (1)].code)) - 1] = '\n'; | |
2590 | code_props_plain_init (&plain_code, (yyvsp[(1) - (1)].code)+1, (yylsp[(1) - (1)])); | |
2591 | code_props_translate_code (&plain_code); | |
2592 | gram_scanner_last_string_free (); | |
2593 | (yyval.chars) = plain_code.code; | |
2594 | } | |
2595 | break; | |
2596 | ||
2597 | case 100: | |
2598 | ||
2599 | /* Line 1456 of yacc.c */ | |
2600 | #line 604 "parse-gram.y" | |
2601 | { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } | |
2602 | break; | |
2603 | ||
2604 | case 101: | |
2605 | ||
2606 | /* Line 1456 of yacc.c */ | |
2607 | #line 606 "parse-gram.y" | |
2608 | { | |
2609 | (yyval.symbol) = symbol_get (char_name ((yyvsp[(1) - (1)].character)), (yylsp[(1) - (1)])); | |
2610 | symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false); | |
2611 | symbol_user_token_number_set ((yyval.symbol), (yyvsp[(1) - (1)].character), (yylsp[(1) - (1)])); | |
2612 | } | |
2613 | break; | |
2614 | ||
2615 | case 102: | |
2616 | ||
2617 | /* Line 1456 of yacc.c */ | |
2618 | #line 614 "parse-gram.y" | |
2619 | { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } | |
2620 | break; | |
2621 | ||
2622 | case 105: | |
2623 | ||
2624 | /* Line 1456 of yacc.c */ | |
2625 | #line 626 "parse-gram.y" | |
2626 | { | |
2627 | (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[(1) - (1)].chars)), (yylsp[(1) - (1)])); | |
2628 | symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false); | |
2629 | } | |
2630 | break; | |
2631 | ||
2632 | case 107: | |
2633 | ||
2634 | /* Line 1456 of yacc.c */ | |
2635 | #line 635 "parse-gram.y" | |
2636 | { | |
2637 | code_props plain_code; | |
2638 | code_props_plain_init (&plain_code, (yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)])); | |
2639 | code_props_translate_code (&plain_code); | |
2640 | gram_scanner_last_string_free (); | |
2641 | muscle_code_grow ("epilogue", plain_code.code, (yylsp[(2) - (2)])); | |
2642 | code_scanner_last_string_free (); | |
2643 | } | |
2644 | break; | |
2645 | ||
2646 | ||
2647 | ||
2648 | /* Line 1456 of yacc.c */ | |
2649 | #line 2650 "../../branch-2.5/src/parse-gram.c" | |
2650 | default: break; | |
2651 | } | |
2652 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); | |
2653 | ||
2654 | YYPOPSTACK (yylen); | |
2655 | yylen = 0; | |
2656 | YY_STACK_PRINT (yyss, yyssp); | |
2657 | ||
2658 | *++yyvsp = yyval; | |
2659 | *++yylsp = yyloc; | |
2660 | ||
2661 | /* Now `shift' the result of the reduction. Determine what state | |
2662 | that goes to, based on the state we popped back to and the rule | |
2663 | number reduced by. */ | |
2664 | ||
2665 | yyn = yyr1[yyn]; | |
2666 | ||
2667 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; | |
2668 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
2669 | yystate = yytable[yystate]; | |
2670 | else | |
2671 | yystate = yydefgoto[yyn - YYNTOKENS]; | |
2672 | ||
2673 | goto yynewstate; | |
2674 | ||
2675 | ||
2676 | /*------------------------------------. | |
2677 | | yyerrlab -- here on detecting error | | |
2678 | `------------------------------------*/ | |
2679 | yyerrlab: | |
2680 | /* If not already recovering from an error, report this error. */ | |
2681 | if (!yyerrstatus) | |
2682 | { | |
2683 | ++yynerrs; | |
2684 | #if ! YYERROR_VERBOSE | |
2685 | yyerror (YY_("syntax error")); | |
2686 | #else | |
2687 | { | |
2688 | YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); | |
2689 | if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) | |
2690 | { | |
2691 | YYSIZE_T yyalloc = 2 * yysize; | |
2692 | if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) | |
2693 | yyalloc = YYSTACK_ALLOC_MAXIMUM; | |
2694 | if (yymsg != yymsgbuf) | |
2695 | YYSTACK_FREE (yymsg); | |
2696 | yymsg = (char *) YYSTACK_ALLOC (yyalloc); | |
2697 | if (yymsg) | |
2698 | yymsg_alloc = yyalloc; | |
2699 | else | |
2700 | { | |
2701 | yymsg = yymsgbuf; | |
2702 | yymsg_alloc = sizeof yymsgbuf; | |
2703 | } | |
2704 | } | |
2705 | ||
2706 | if (0 < yysize && yysize <= yymsg_alloc) | |
2707 | { | |
2708 | (void) yysyntax_error (yymsg, yystate, yychar); | |
2709 | yyerror (yymsg); | |
2710 | } | |
2711 | else | |
2712 | { | |
2713 | yyerror (YY_("syntax error")); | |
2714 | if (yysize != 0) | |
2715 | goto yyexhaustedlab; | |
2716 | } | |
2717 | } | |
2718 | #endif | |
2719 | } | |
2720 | ||
2721 | yyerror_range[0] = yylloc; | |
2722 | ||
2723 | if (yyerrstatus == 3) | |
2724 | { | |
2725 | /* If just tried and failed to reuse lookahead token after an | |
2726 | error, discard it. */ | |
2727 | ||
2728 | if (yychar <= YYEOF) | |
2729 | { | |
2730 | /* Return failure if at end of input. */ | |
2731 | if (yychar == YYEOF) | |
2732 | YYABORT; | |
2733 | } | |
2734 | else | |
2735 | { | |
2736 | yydestruct ("Error: discarding", | |
2737 | yytoken, &yylval, &yylloc); | |
2738 | yychar = YYEMPTY; | |
2739 | } | |
2740 | } | |
2741 | ||
2742 | /* Else will try to reuse lookahead token after shifting the error | |
2743 | token. */ | |
2744 | goto yyerrlab1; | |
2745 | ||
2746 | ||
2747 | /*---------------------------------------------------. | |
2748 | | yyerrorlab -- error raised explicitly by YYERROR. | | |
2749 | `---------------------------------------------------*/ | |
2750 | yyerrorlab: | |
2751 | ||
2752 | /* Pacify compilers like GCC when the user code never invokes | |
2753 | YYERROR and the label yyerrorlab therefore never appears in user | |
2754 | code. */ | |
2755 | if (/*CONSTCOND*/ 0) | |
2756 | goto yyerrorlab; | |
2757 | ||
2758 | yyerror_range[0] = yylsp[1-yylen]; | |
2759 | /* Do not reclaim the symbols of the rule which action triggered | |
2760 | this YYERROR. */ | |
2761 | YYPOPSTACK (yylen); | |
2762 | yylen = 0; | |
2763 | YY_STACK_PRINT (yyss, yyssp); | |
2764 | yystate = *yyssp; | |
2765 | goto yyerrlab1; | |
2766 | ||
2767 | ||
2768 | /*-------------------------------------------------------------. | |
2769 | | yyerrlab1 -- common code for both syntax error and YYERROR. | | |
2770 | `-------------------------------------------------------------*/ | |
2771 | yyerrlab1: | |
2772 | yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
2773 | ||
2774 | for (;;) | |
2775 | { | |
2776 | yyn = yypact[yystate]; | |
2777 | if (yyn != YYPACT_NINF) | |
2778 | { | |
2779 | yyn += YYTERROR; | |
2780 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
2781 | { | |
2782 | yyn = yytable[yyn]; | |
2783 | if (0 < yyn) | |
2784 | break; | |
2785 | } | |
2786 | } | |
2787 | ||
2788 | /* Pop the current state because it cannot handle the error token. */ | |
2789 | if (yyssp == yyss) | |
2790 | YYABORT; | |
2791 | ||
2792 | yyerror_range[0] = *yylsp; | |
2793 | yydestruct ("Error: popping", | |
2794 | yystos[yystate], yyvsp, yylsp); | |
2795 | YYPOPSTACK (1); | |
2796 | yystate = *yyssp; | |
2797 | YY_STACK_PRINT (yyss, yyssp); | |
2798 | } | |
2799 | ||
2800 | *++yyvsp = yylval; | |
2801 | ||
2802 | yyerror_range[1] = yylloc; | |
2803 | /* Using YYLLOC is tempting, but would change the location of | |
2804 | the lookahead. YYLOC is available though. */ | |
2805 | YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); | |
2806 | *++yylsp = yyloc; | |
2807 | ||
2808 | /* Shift the error token. */ | |
2809 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); | |
2810 | ||
2811 | yystate = yyn; | |
2812 | goto yynewstate; | |
2813 | ||
2814 | ||
2815 | /*-------------------------------------. | |
2816 | | yyacceptlab -- YYACCEPT comes here. | | |
2817 | `-------------------------------------*/ | |
2818 | yyacceptlab: | |
2819 | yyresult = 0; | |
2820 | goto yyreturn; | |
2821 | ||
2822 | /*-----------------------------------. | |
2823 | | yyabortlab -- YYABORT comes here. | | |
2824 | `-----------------------------------*/ | |
2825 | yyabortlab: | |
2826 | yyresult = 1; | |
2827 | goto yyreturn; | |
2828 | ||
2829 | #if !defined(yyoverflow) || YYERROR_VERBOSE | |
2830 | /*-------------------------------------------------. | |
2831 | | yyexhaustedlab -- memory exhaustion comes here. | | |
2832 | `-------------------------------------------------*/ | |
2833 | yyexhaustedlab: | |
2834 | yyerror (YY_("memory exhausted")); | |
2835 | yyresult = 2; | |
2836 | /* Fall through. */ | |
2837 | #endif | |
2838 | ||
2839 | yyreturn: | |
2840 | if (yychar != YYEMPTY) | |
2841 | yydestruct ("Cleanup: discarding lookahead", | |
2842 | yytoken, &yylval, &yylloc); | |
2843 | /* Do not reclaim the symbols of the rule which action triggered | |
2844 | this YYABORT or YYACCEPT. */ | |
2845 | YYPOPSTACK (yylen); | |
2846 | YY_STACK_PRINT (yyss, yyssp); | |
2847 | while (yyssp != yyss) | |
2848 | { | |
2849 | yydestruct ("Cleanup: popping", | |
2850 | yystos[*yyssp], yyvsp, yylsp); | |
2851 | YYPOPSTACK (1); | |
2852 | } | |
2853 | #ifndef yyoverflow | |
2854 | if (yyss != yyssa) | |
2855 | YYSTACK_FREE (yyss); | |
2856 | #endif | |
2857 | #if YYERROR_VERBOSE | |
2858 | if (yymsg != yymsgbuf) | |
2859 | YYSTACK_FREE (yymsg); | |
2860 | #endif | |
2861 | /* Make sure YYID is used. */ | |
2862 | return YYID (yyresult); | |
2863 | } | |
2864 | ||
2865 | ||
2866 | ||
2867 | /* Line 1676 of yacc.c */ | |
2868 | #line 645 "parse-gram.y" | |
2869 | ||
2870 | ||
2871 | ||
2872 | /* Return the location of the left-hand side of a rule whose | |
2873 | right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in | |
2874 | the right-hand side, and return an empty location equal to the end | |
2875 | boundary of RHS[0] if the right-hand side is empty. */ | |
2876 | ||
2877 | static YYLTYPE | |
2878 | lloc_default (YYLTYPE const *rhs, int n) | |
2879 | { | |
2880 | int i; | |
2881 | YYLTYPE loc; | |
2882 | ||
2883 | /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;". | |
2884 | The bug is fixed in 7.4.2m, but play it safe for now. */ | |
2885 | loc.start = rhs[n].end; | |
2886 | loc.end = rhs[n].end; | |
2887 | ||
2888 | /* Ignore empty nonterminals the start of the the right-hand side. | |
2889 | Do not bother to ignore them at the end of the right-hand side, | |
2890 | since empty nonterminals have the same end as their predecessors. */ | |
2891 | for (i = 1; i <= n; i++) | |
2892 | if (! equal_boundaries (rhs[i].start, rhs[i].end)) | |
2893 | { | |
2894 | loc.start = rhs[i].start; | |
2895 | break; | |
2896 | } | |
2897 | ||
2898 | return loc; | |
2899 | } | |
2900 | ||
2901 | ||
2902 | /* Add a lex-param or a parse-param (depending on TYPE) with | |
2903 | declaration DECL and location LOC. */ | |
2904 | ||
2905 | static void | |
2906 | add_param (char const *type, char *decl, location loc) | |
2907 | { | |
2908 | static char const alphanum[26 + 26 + 1 + 10] = | |
2909 | "abcdefghijklmnopqrstuvwxyz" | |
2910 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
2911 | "_" | |
2912 | "0123456789"; | |
2913 | char const *name_start = NULL; | |
2914 | char *p; | |
2915 | ||
2916 | /* Stop on last actual character. */ | |
2917 | for (p = decl; p[1]; p++) | |
2918 | if ((p == decl | |
2919 | || ! memchr (alphanum, p[-1], sizeof alphanum)) | |
2920 | && memchr (alphanum, p[0], sizeof alphanum - 10)) | |
2921 | name_start = p; | |
2922 | ||
2923 | /* Strip the surrounding '{' and '}', and any blanks just inside | |
2924 | the braces. */ | |
2925 | while (*--p == ' ' || *p == '\t') | |
2926 | continue; | |
2927 | p[1] = '\0'; | |
2928 | while (*++decl == ' ' || *decl == '\t') | |
2929 | continue; | |
2930 | ||
2931 | if (! name_start) | |
2932 | complain_at (loc, _("missing identifier in parameter declaration")); | |
2933 | else | |
2934 | { | |
2935 | char *name; | |
2936 | size_t name_len; | |
2937 | ||
2938 | for (name_len = 1; | |
2939 | memchr (alphanum, name_start[name_len], sizeof alphanum); | |
2940 | name_len++) | |
2941 | continue; | |
2942 | ||
2943 | name = xmalloc (name_len + 1); | |
2944 | memcpy (name, name_start, name_len); | |
2945 | name[name_len] = '\0'; | |
2946 | muscle_pair_list_grow (type, decl, name); | |
2947 | free (name); | |
2948 | } | |
2949 | ||
2950 | gram_scanner_last_string_free (); | |
2951 | } | |
2952 | ||
2953 | ||
2954 | static void | |
2955 | version_check (location const *loc, char const *version) | |
2956 | { | |
2957 | if (strverscmp (version, PACKAGE_VERSION) > 0) | |
2958 | { | |
2959 | complain_at (*loc, "require bison %s, but have %s", | |
2960 | version, PACKAGE_VERSION); | |
2961 | exit (63); | |
2962 | } | |
2963 | } | |
2964 | ||
2965 | static void | |
2966 | gram_error (location const *loc, char const *msg) | |
2967 | { | |
2968 | complain_at (*loc, "%s", msg); | |
2969 | } | |
2970 | ||
2971 | char const * | |
2972 | token_name (int type) | |
2973 | { | |
2974 | return yytname[YYTRANSLATE (type)]; | |
2975 | } | |
2976 | ||
2977 | static char const * | |
2978 | char_name (char c) | |
2979 | { | |
2980 | if (c == '\'') | |
2981 | return "'\\''"; | |
2982 | else | |
2983 | { | |
2984 | char buf[4]; | |
2985 | buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0'; | |
2986 | return quotearg_style (escape_quoting_style, buf); | |
2987 | } | |
2988 | } | |
2989 |