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