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