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