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