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