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