Commit | Line | Data |
---|---|---|
34d867d7 | 1 | /* A Bison parser, made by GNU Bison 2.5.1.19-ced26-dirty. */ |
e9955c83 | 2 | |
448dc38b | 3 | /* Bison implementation for Yacc-like parsers in C |
136a0f76 | 4 | |
9c883a6b | 5 | Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. |
136a0f76 | 6 | |
f16b0819 | 7 | This program is free software: you can redistribute it and/or modify |
1921f1d7 | 8 | it under the terms of the GNU General Public License as published by |
f16b0819 PE |
9 | the Free Software Foundation, either version 3 of the License, or |
10 | (at your option) any later version. | |
136a0f76 | 11 | |
1921f1d7 AD |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
136a0f76 | 16 | |
1921f1d7 | 17 | You should have received a copy of the GNU General Public License |
f16b0819 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
1921f1d7 | 19 | |
04c12cb8 PE |
20 | /* As a special exception, you may create a larger work that contains |
21 | part or all of the Bison parser skeleton and distribute that work | |
22 | under terms of your choice, so long as that work isn't itself a | |
23 | parser generator using the skeleton or a modified version thereof | |
24 | as a parser skeleton. Alternatively, if you modify or redistribute | |
25 | the parser skeleton itself, you may (at your option) remove this | |
26 | special exception, which will cause the skeleton and the resulting | |
27 | Bison output files to be licensed under the GNU General Public | |
28 | License without this special exception. | |
136a0f76 | 29 | |
04c12cb8 PE |
30 | This special exception was added by the Free Software Foundation in |
31 | version 2.2 of Bison. */ | |
1921f1d7 | 32 | |
66809587 PE |
33 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
34 | simplifying the original so-called "semantic" parser. */ | |
1921f1d7 AD |
35 | |
36 | /* All symbols defined below should begin with yy or YY, to avoid | |
37 | infringing on user name space. This should be done even for local | |
38 | variables, as they might otherwise be expanded by user macros. | |
39 | There are some unavoidable exceptions within include files to | |
40 | define necessary library symbols; they are noted "INFRINGES ON | |
41 | USER NAME SPACE" below. */ | |
42 | ||
43 | /* Identify Bison output. */ | |
62ddaef6 PE |
44 | #define YYBISON 1 |
45 | ||
f5109f5a | 46 | /* Bison version. */ |
34d867d7 | 47 | #define YYBISON_VERSION "2.5.1.19-ced26-dirty" |
f5109f5a | 48 | |
62ddaef6 PE |
49 | /* Skeleton name. */ |
50 | #define YYSKELETON_NAME "yacc.c" | |
1921f1d7 AD |
51 | |
52 | /* Pure parsers. */ | |
62ddaef6 | 53 | #define YYPURE 1 |
1921f1d7 | 54 | |
e021811a JD |
55 | /* Push parsers. */ |
56 | #define YYPUSH 0 | |
57 | ||
58 | /* Pull parsers. */ | |
59 | #define YYPULL 1 | |
60 | ||
1921f1d7 AD |
61 | /* Using locations. */ |
62 | #define YYLSP_NEEDED 1 | |
e96c9728 | 63 | |
76dcf299 | 64 | /* Substitute the variable and function names. */ |
e021811a JD |
65 | #define yyparse gram_parse |
66 | #define yylex gram_lex | |
67 | #define yyerror gram_error | |
68 | #define yylval gram_lval | |
69 | #define yychar gram_char | |
70 | #define yydebug gram_debug | |
71 | #define yynerrs gram_nerrs | |
72 | #define yylloc gram_lloc | |
e9955c83 | 73 | |
1921f1d7 | 74 | /* Copy the first part of user declarations. */ |
136a0f76 | 75 | |
34d867d7 | 76 | /* Line 323 of yacc.c */ |
0bf92491 | 77 | #line 1 "parse-gram.y" |
a76ca263 PE |
78 | /* Bison Grammar Parser -*- C -*- |
79 | ||
c932d613 | 80 | Copyright (C) 2002-2012 Free Software Foundation, Inc. |
a76ca263 PE |
81 | |
82 | This file is part of Bison, the GNU Compiler Compiler. | |
83 | ||
f16b0819 | 84 | This program is free software: you can redistribute it and/or modify |
a76ca263 | 85 | it under the terms of the GNU General Public License as published by |
f16b0819 | 86 | the Free Software Foundation, either version 3 of the License, or |
a76ca263 PE |
87 | (at your option) any later version. |
88 | ||
89 | This program is distributed in the hope that it will be useful, | |
90 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
91 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
92 | GNU General Public License for more details. | |
93 | ||
94 | You should have received a copy of the GNU General Public License | |
f16b0819 | 95 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
e9955c83 | 96 | |
72c4d336 | 97 | #include <config.h> |
e9955c83 | 98 | #include "system.h" |
05d18c24 | 99 | |
b275314e | 100 | #include "complain.h" |
05d18c24 | 101 | #include "conflicts.h" |
e9955c83 AD |
102 | #include "files.h" |
103 | #include "getargs.h" | |
e9955c83 | 104 | #include "gram.h" |
23ec25b7 | 105 | #include "muscle-tab.h" |
8bea3dbd | 106 | #include "named-ref.h" |
2ce37586 | 107 | #include "quotearg.h" |
e9955c83 | 108 | #include "reader.h" |
05d18c24 | 109 | #include "symlist.h" |
e9071366 AD |
110 | #include "scan-gram.h" |
111 | #include "scan-code.h" | |
45aab21d | 112 | #include "xmemdup0.h" |
e9955c83 | 113 | |
05d18c24 PE |
114 | #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N) |
115 | static YYLTYPE lloc_default (YYLTYPE const *, int); | |
e9955c83 | 116 | |
8a8dc872 | 117 | #define YY_LOCATION_PRINT(File, Loc) \ |
bf8b3d98 | 118 | location_print (File, Loc) |
8a8dc872 | 119 | |
b50d2359 AD |
120 | static void version_check (location const *loc, char const *version); |
121 | ||
f0616f0b | 122 | /* Request detailed syntax error messages, and pass them to GRAM_ERROR. |
05d18c24 | 123 | FIXME: depends on the undocumented availability of YYLLOC. */ |
e9955c83 AD |
124 | #undef yyerror |
125 | #define yyerror(Msg) \ | |
bf8b3d98 | 126 | gram_error (&yylloc, Msg) |
05d18c24 | 127 | static void gram_error (location const *, char const *); |
e9955c83 | 128 | |
d2a1a60a PE |
129 | static char const *char_name (char); |
130 | ||
2ce4ed68 AD |
131 | /** Add a lex-param or a parse-param. |
132 | * | |
133 | * \param type \a lex_param or \a parse_param | |
134 | * \param decl the formal argument | |
135 | * \param loc the location in the source. | |
136 | */ | |
137 | static void add_param (char const *type, char *decl, location loc); | |
138 | ||
e9955c83 | 139 | |
5f3df396 | 140 | static symbol_class current_class = unknown_sym; |
1f4cc0f4 | 141 | static uniqstr current_type = NULL; |
49e8e901 | 142 | static symbol *current_lhs_symbol; |
7029f892 | 143 | static location current_lhs_location; |
0210a4bf | 144 | static named_ref *current_lhs_named_ref; |
5f3df396 | 145 | static int current_prec = 0; |
e9955c83 | 146 | |
49e8e901 JD |
147 | /** Set the new current left-hand side symbol, possibly common |
148 | * to several right-hand side parts of rule. | |
149 | */ | |
150 | static | |
151 | void | |
152 | current_lhs(symbol *sym, location loc, named_ref *ref) | |
153 | { | |
154 | current_lhs_symbol = sym; | |
155 | current_lhs_location = loc; | |
156 | /* In order to simplify memory management, named references for lhs | |
157 | are always assigned by deep copy into the current symbol_list | |
158 | node. This is because a single named-ref in the grammar may | |
159 | result in several uses when the user factors lhs between several | |
160 | rules using "|". Therefore free the parser's original copy. */ | |
161 | free (current_lhs_named_ref); | |
162 | current_lhs_named_ref = ref; | |
163 | } | |
164 | ||
165 | ||
b3d9b5ba PE |
166 | #define YYTYPE_INT16 int_fast16_t |
167 | #define YYTYPE_INT8 int_fast8_t | |
168 | #define YYTYPE_UINT16 uint_fast16_t | |
169 | #define YYTYPE_UINT8 uint_fast8_t | |
bf8b3d98 | 170 | |
1921f1d7 | 171 | |
34d867d7 | 172 | /* Line 323 of yacc.c */ |
45aab21d | 173 | #line 174 "parse-gram.c" |
9c883a6b JM |
174 | |
175 | # ifndef YY_NULL | |
176 | # if defined __cplusplus && 201103L <= __cplusplus | |
177 | # define YY_NULL nullptr | |
178 | # else | |
179 | # define YY_NULL 0 | |
180 | # endif | |
181 | # endif | |
136a0f76 | 182 | |
1921f1d7 AD |
183 | /* Enabling verbose error messages. */ |
184 | #ifdef YYERROR_VERBOSE | |
185 | # undef YYERROR_VERBOSE | |
186 | # define YYERROR_VERBOSE 1 | |
187 | #else | |
cd3684cf | 188 | # define YYERROR_VERBOSE 1 |
1921f1d7 AD |
189 | #endif |
190 | ||
5f3df396 PE |
191 | /* Enabling the token table. */ |
192 | #ifndef YYTOKEN_TABLE | |
193 | # define YYTOKEN_TABLE 0 | |
194 | #endif | |
195 | ||
34d867d7 | 196 | #include "parse-gram.h" |
73521d9f | 197 | |
1921f1d7 | 198 | /* Copy the second part of user declarations. */ |
0c15323d | 199 | |
136a0f76 | 200 | |
34d867d7 AD |
201 | /* Line 344 of yacc.c */ |
202 | #line 203 "parse-gram.c" | |
bf8b3d98 PE |
203 | |
204 | #ifdef short | |
205 | # undef short | |
206 | #endif | |
207 | ||
208 | #ifdef YYTYPE_UINT8 | |
209 | typedef YYTYPE_UINT8 yytype_uint8; | |
210 | #else | |
211 | typedef unsigned char yytype_uint8; | |
212 | #endif | |
213 | ||
214 | #ifdef YYTYPE_INT8 | |
215 | typedef YYTYPE_INT8 yytype_int8; | |
216 | #elif (defined __STDC__ || defined __C99__FUNC__ \ | |
217 | || defined __cplusplus || defined _MSC_VER) | |
218 | typedef signed char yytype_int8; | |
219 | #else | |
220 | typedef short int yytype_int8; | |
221 | #endif | |
222 | ||
223 | #ifdef YYTYPE_UINT16 | |
224 | typedef YYTYPE_UINT16 yytype_uint16; | |
225 | #else | |
226 | typedef unsigned short int yytype_uint16; | |
227 | #endif | |
228 | ||
229 | #ifdef YYTYPE_INT16 | |
230 | typedef YYTYPE_INT16 yytype_int16; | |
231 | #else | |
232 | typedef short int yytype_int16; | |
233 | #endif | |
2ed28444 | 234 | |
ac243428 | 235 | #ifndef YYSIZE_T |
bf8b3d98 | 236 | # ifdef __SIZE_TYPE__ |
ac243428 | 237 | # define YYSIZE_T __SIZE_TYPE__ |
bf8b3d98 | 238 | # elif defined size_t |
ac243428 | 239 | # define YYSIZE_T size_t |
bf8b3d98 PE |
240 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
241 | || defined __cplusplus || defined _MSC_VER) | |
ac243428 PE |
242 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
243 | # define YYSIZE_T size_t | |
244 | # else | |
245 | # define YYSIZE_T unsigned int | |
246 | # endif | |
4b43d402 | 247 | #endif |
e9955c83 | 248 | |
2abdfeef PE |
249 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
250 | ||
6088a2a0 | 251 | #ifndef YY_ |
41d35e54 | 252 | # if defined YYENABLE_NLS && YYENABLE_NLS |
6088a2a0 PE |
253 | # if ENABLE_NLS |
254 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | |
255 | # define YY_(msgid) dgettext ("bison-runtime", msgid) | |
256 | # endif | |
257 | # endif | |
258 | # ifndef YY_ | |
259 | # define YY_(msgid) msgid | |
260 | # endif | |
261 | #endif | |
262 | ||
e764d4df | 263 | /* Suppress unused-variable warnings by "using" E. */ |
bf8b3d98 | 264 | #if ! defined lint || defined __GNUC__ |
7029f892 PE |
265 | # define YYUSE(e) ((void) (e)) |
266 | #else | |
267 | # define YYUSE(e) /* empty */ | |
268 | #endif | |
269 | ||
270 | /* Identity function, used to suppress warnings about constant conditions. */ | |
271 | #ifndef lint | |
272 | # define YYID(n) (n) | |
273 | #else | |
bf8b3d98 PE |
274 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
275 | || defined __cplusplus || defined _MSC_VER) | |
7029f892 | 276 | static int |
3b452f4e | 277 | YYID (int yyi) |
7029f892 PE |
278 | #else |
279 | static int | |
3b452f4e JD |
280 | YYID (yyi) |
281 | int yyi; | |
7029f892 PE |
282 | #endif |
283 | { | |
3b452f4e | 284 | return yyi; |
7029f892 PE |
285 | } |
286 | #endif | |
e764d4df | 287 | |
723fe7d1 | 288 | #if 1 |
cd3684cf | 289 | |
e9955c83 AD |
290 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
291 | ||
e9955c83 | 292 | # ifdef YYSTACK_ALLOC |
3b0ffc7e | 293 | /* Pacify GCC's `empty if-body' warning. */ |
7029f892 | 294 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
2ce37586 | 295 | # ifndef YYSTACK_ALLOC_MAXIMUM |
7768896a PE |
296 | /* The OS might guarantee only one guard page at the bottom of the stack, |
297 | and a page size can be as small as 4096 bytes. So we cannot safely | |
298 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number | |
299 | to allow for a few compiler-allocated temporary stack slots. */ | |
f52b276c | 300 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
2ce37586 | 301 | # endif |
e9955c83 | 302 | # else |
cd3684cf AD |
303 | # define YYSTACK_ALLOC YYMALLOC |
304 | # define YYSTACK_FREE YYFREE | |
2ce37586 | 305 | # ifndef YYSTACK_ALLOC_MAXIMUM |
2abdfeef | 306 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
2ce37586 | 307 | # endif |
ea6046b9 | 308 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
765f22f0 PE |
309 | && ! ((defined YYMALLOC || defined malloc) \ |
310 | && (defined YYFREE || defined free))) | |
311 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
ea6046b9 PE |
312 | # ifndef EXIT_SUCCESS |
313 | # define EXIT_SUCCESS 0 | |
765f22f0 | 314 | # endif |
0925ebb4 | 315 | # endif |
4b43d402 PE |
316 | # ifndef YYMALLOC |
317 | # define YYMALLOC malloc | |
ea6046b9 | 318 | # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
bf8b3d98 | 319 | || defined __cplusplus || defined _MSC_VER) |
4b43d402 PE |
320 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
321 | # endif | |
322 | # endif | |
323 | # ifndef YYFREE | |
324 | # define YYFREE free | |
ea6046b9 | 325 | # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
bf8b3d98 | 326 | || defined __cplusplus || defined _MSC_VER) |
4b43d402 PE |
327 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
328 | # endif | |
329 | # endif | |
e9955c83 | 330 | # endif |
723fe7d1 JD |
331 | # define YYCOPY_NEEDED 1 |
332 | #endif | |
e9955c83 AD |
333 | |
334 | ||
bf8b3d98 PE |
335 | #if (! defined yyoverflow \ |
336 | && (! defined __cplusplus \ | |
337 | || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ | |
338 | && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
e9955c83 AD |
339 | |
340 | /* A type that is properly aligned for any stack member. */ | |
341 | union yyalloc | |
342 | { | |
e021811a JD |
343 | yytype_int16 yyss_alloc; |
344 | YYSTYPE yyvs_alloc; | |
345 | YYLTYPE yyls_alloc; | |
e9955c83 AD |
346 | }; |
347 | ||
348 | /* The size of the maximum gap between one aligned stack and the next. */ | |
05d18c24 | 349 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
e9955c83 AD |
350 | |
351 | /* The size of an array large to enough to hold all stacks, each with | |
352 | N elements. */ | |
366eea36 | 353 | # define YYSTACK_BYTES(N) \ |
bf8b3d98 | 354 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
05d18c24 | 355 | + 2 * YYSTACK_GAP_MAXIMUM) |
e9955c83 | 356 | |
723fe7d1 | 357 | # define YYCOPY_NEEDED 1 |
e9955c83 AD |
358 | |
359 | /* Relocate STACK from its old location to the new one. The | |
360 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
361 | elements in the stack, and YYPTR gives the new location of the | |
362 | stack. Advance YYPTR to a properly aligned location for the next | |
363 | stack. */ | |
e021811a | 364 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
e9955c83 AD |
365 | do \ |
366 | { \ | |
367 | YYSIZE_T yynewbytes; \ | |
e021811a JD |
368 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
369 | Stack = &yyptr->Stack_alloc; \ | |
05d18c24 | 370 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
e9955c83 AD |
371 | yyptr += yynewbytes / sizeof (*yyptr); \ |
372 | } \ | |
7029f892 | 373 | while (YYID (0)) |
e9955c83 AD |
374 | |
375 | #endif | |
376 | ||
723fe7d1 | 377 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
6c6f6f4b | 378 | /* Copy COUNT objects from SRC to DST. The source and destination do |
723fe7d1 JD |
379 | not overlap. */ |
380 | # ifndef YYCOPY | |
381 | # if defined __GNUC__ && 1 < __GNUC__ | |
6c6f6f4b AD |
382 | # define YYCOPY(Dst, Src, Count) \ |
383 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) | |
723fe7d1 | 384 | # else |
6c6f6f4b AD |
385 | # define YYCOPY(Dst, Src, Count) \ |
386 | do \ | |
387 | { \ | |
388 | YYSIZE_T yyi; \ | |
389 | for (yyi = 0; yyi < (Count); yyi++) \ | |
390 | (Dst)[yyi] = (Src)[yyi]; \ | |
391 | } \ | |
723fe7d1 JD |
392 | while (YYID (0)) |
393 | # endif | |
394 | # endif | |
395 | #endif /* !YYCOPY_NEEDED */ | |
396 | ||
3b0ffc7e | 397 | /* YYFINAL -- State number of the termination state. */ |
1921f1d7 | 398 | #define YYFINAL 3 |
d33cb3ae | 399 | /* YYLAST -- Last index in YYTABLE. */ |
f37495f6 | 400 | #define YYLAST 160 |
1921f1d7 | 401 | |
3b0ffc7e | 402 | /* YYNTOKENS -- Number of terminals. */ |
0210a4bf | 403 | #define YYNTOKENS 58 |
3b0ffc7e | 404 | /* YYNNTS -- Number of nonterminals. */ |
0210a4bf | 405 | #define YYNNTS 34 |
3b0ffc7e | 406 | /* YYNRULES -- Number of rules. */ |
f37495f6 | 407 | #define YYNRULES 108 |
3b0ffc7e | 408 | /* YYNRULES -- Number of states. */ |
f37495f6 | 409 | #define YYNSTATES 148 |
1921f1d7 AD |
410 | |
411 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
412 | #define YYUNDEFTOK 2 | |
0210a4bf | 413 | #define YYMAXUTOK 312 |
1921f1d7 | 414 | |
5f3df396 | 415 | #define YYTRANSLATE(YYX) \ |
73521d9f | 416 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
1921f1d7 AD |
417 | |
418 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ | |
bf8b3d98 | 419 | static const yytype_uint8 yytranslate[] = |
1921f1d7 AD |
420 | { |
421 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
422 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
423 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
424 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
425 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
426 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
427 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
428 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
429 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
430 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
431 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
432 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
433 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
434 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
435 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
436 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
437 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
438 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
439 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
440 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
441 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
442 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
443 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
444 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
445 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
446 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | |
447 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | |
448 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | |
449 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | |
ae7453f2 | 450 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
34f98f46 | 451 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
0210a4bf | 452 | 55, 56, 57 |
1921f1d7 AD |
453 | }; |
454 | ||
455 | #if YYDEBUG | |
456 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | |
457 | YYRHS. */ | |
02975b9a | 458 | static const yytype_uint16 yyprhs[] = |
1921f1d7 | 459 | { |
2cbe6b7f | 460 | 0, 0, 3, 8, 9, 12, 14, 16, 18, 22, |
02975b9a | 461 | 24, 27, 29, 32, 35, 38, 42, 44, 47, 50, |
5e6feb86 | 462 | 53, 55, 58, 62, 64, 66, 69, 73, 76, 78, |
d782395d JD |
463 | 81, 84, 86, 88, 90, 92, 94, 96, 99, 103, |
464 | 107, 109, 111, 114, 118, 119, 121, 125, 126, 130, | |
465 | 131, 135, 139, 143, 145, 147, 149, 150, 152, 154, | |
ab7f29f8 JD |
466 | 157, 159, 162, 164, 167, 169, 172, 174, 176, 178, |
467 | 180, 182, 184, 187, 190, 194, 196, 199, 201, 204, | |
0210a4bf AR |
468 | 206, 209, 212, 213, 218, 220, 224, 227, 228, 232, |
469 | 236, 240, 244, 248, 249, 251, 253, 255, 256, 258, | |
f37495f6 | 470 | 260, 262, 264, 266, 268, 270, 272, 274, 275 |
1921f1d7 AD |
471 | }; |
472 | ||
3b0ffc7e | 473 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
bf8b3d98 | 474 | static const yytype_int8 yyrhs[] = |
1921f1d7 | 475 | { |
42ec0ae1 JD |
476 | 59, 0, -1, 60, 50, 77, 91, -1, -1, 60, |
477 | 61, -1, 62, -1, 52, -1, 17, -1, 19, 84, | |
0210a4bf | 478 | 85, -1, 20, -1, 20, 3, -1, 21, -1, 22, |
42ec0ae1 | 479 | 4, -1, 23, 4, -1, 24, 3, -1, 24, 47, |
d782395d | 480 | 3, -1, 25, -1, 26, 43, -1, 27, 3, -1, |
42ec0ae1 | 481 | 28, 43, -1, 29, -1, 30, 3, -1, 30, 47, |
8e0a5e9e | 482 | 3, -1, 32, -1, 33, -1, 34, 3, -1, 34, |
42ec0ae1 | 483 | 47, 3, -1, 35, 43, -1, 36, -1, 37, 3, |
d782395d | 484 | -1, 38, 3, -1, 40, -1, 41, -1, 42, -1, |
42ec0ae1 | 485 | 53, -1, 67, -1, 64, -1, 39, 89, -1, 8, |
0210a4bf | 486 | 43, 73, -1, 9, 43, 73, -1, 18, -1, 31, |
42ec0ae1 | 487 | -1, 16, 86, -1, 16, 48, 86, -1, -1, 48, |
0210a4bf | 488 | -1, 57, 63, 86, -1, -1, 6, 65, 76, -1, |
42ec0ae1 | 489 | -1, 5, 66, 76, -1, 7, 54, 72, -1, 68, |
0210a4bf | 490 | 69, 70, -1, 10, -1, 11, -1, 12, -1, -1, |
42ec0ae1 | 491 | 54, -1, 71, -1, 70, 71, -1, 89, -1, 89, |
0210a4bf | 492 | 4, -1, 89, -1, 72, 89, -1, 74, -1, 73, |
42ec0ae1 JD |
493 | 74, -1, 89, -1, 54, -1, 55, -1, 56, -1, |
494 | 54, -1, 87, -1, 87, 4, -1, 87, 90, -1, | |
0210a4bf | 495 | 87, 4, 90, -1, 75, -1, 76, 75, -1, 78, |
42ec0ae1 JD |
496 | -1, 77, 78, -1, 79, -1, 62, 53, -1, 1, |
497 | 53, -1, -1, 88, 83, 80, 81, -1, 82, -1, | |
498 | 81, 51, 82, -1, 81, 53, -1, -1, 82, 89, | |
0210a4bf | 499 | 83, -1, 82, 43, 83, -1, 82, 13, 89, -1, |
42ec0ae1 JD |
500 | 82, 14, 4, -1, 82, 15, 54, -1, -1, 44, |
501 | -1, 48, -1, 3, -1, -1, 48, -1, 3, -1, | |
502 | 43, -1, 48, -1, 45, -1, 49, -1, 87, -1, | |
503 | 90, -1, 3, -1, -1, 50, 46, -1 | |
1921f1d7 AD |
504 | }; |
505 | ||
506 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | |
bf8b3d98 | 507 | static const yytype_uint16 yyrline[] = |
1921f1d7 | 508 | { |
45aab21d AD |
509 | 0, 229, 229, 237, 239, 243, 244, 254, 255, 260, |
510 | 261, 266, 267, 268, 269, 270, 271, 276, 285, 286, | |
511 | 287, 288, 289, 290, 291, 292, 293, 294, 295, 310, | |
512 | 311, 335, 336, 337, 338, 342, 343, 344, 348, 355, | |
513 | 362, 366, 370, 377, 392, 393, 397, 409, 409, 414, | |
514 | 414, 419, 430, 445, 446, 447, 451, 452, 457, 459, | |
515 | 464, 465, 470, 472, 477, 478, 482, 483, 484, 485, | |
516 | 490, 495, 500, 506, 512, 523, 524, 533, 534, 540, | |
517 | 541, 542, 549, 549, 557, 558, 559, 564, 566, 568, | |
518 | 570, 572, 574, 579, 581, 592, 593, 598, 599, 600, | |
519 | 609, 629, 631, 640, 645, 646, 651, 658, 660 | |
1921f1d7 AD |
520 | }; |
521 | #endif | |
522 | ||
5f3df396 | 523 | #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
9cbfdc9e | 524 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
3b0ffc7e | 525 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
1921f1d7 AD |
526 | static const char *const yytname[] = |
527 | { | |
9cbfdc9e | 528 | "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"", |
e9071366 | 529 | "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"", |
12e35840 | 530 | "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"", "\"%prec\"", |
8e0a5e9e | 531 | "\"%dprec\"", "\"%merge\"", "\"%code\"", "\"%debug\"", |
12e35840 JD |
532 | "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"", |
533 | "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"", | |
5e6feb86 PE |
534 | "\"%initial-action\"", "\"%language\"", "\"%lex-param\"", |
535 | "\"%locations\"", "\"%name-prefix\"", "\"%no-default-prec\"", | |
536 | "\"%no-lines\"", "\"%nondeterministic-parser\"", "\"%output\"", | |
d782395d JD |
537 | "\"%parse-param\"", "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"", |
538 | "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", | |
42ec0ae1 JD |
539 | "\"{...}\"", "\"[identifier]\"", "\"char\"", "\"epilogue\"", "\"=\"", |
540 | "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"", "\"%{...%}\"", | |
541 | "\";\"", "\"type\"", "\"<*>\"", "\"<>\"", "\"%union\"", "$accept", | |
8bea3dbd AR |
542 | "input", "prologue_declarations", "prologue_declaration", |
543 | "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2", | |
d782395d | 544 | "precedence_declaration", "precedence_declarator", "type.opt", |
ab7f29f8 JD |
545 | "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist", |
546 | "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar", | |
547 | "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs", | |
0210a4bf | 548 | "named_ref.opt", "variable", "content.opt", "braceless", "id", |
9c883a6b | 549 | "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL |
1921f1d7 AD |
550 | }; |
551 | #endif | |
552 | ||
3d38c03a | 553 | # ifdef YYPRINT |
1921f1d7 AD |
554 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
555 | token YYLEX-NUM. */ | |
bf8b3d98 | 556 | static const yytype_uint16 yytoknum[] = |
1921f1d7 AD |
557 | { |
558 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
559 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | |
560 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | |
561 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |
d6328241 | 562 | 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, |
0210a4bf | 563 | 305, 306, 307, 308, 309, 310, 311, 312 |
1921f1d7 | 564 | }; |
3d38c03a | 565 | # endif |
1921f1d7 AD |
566 | |
567 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
bf8b3d98 | 568 | static const yytype_uint8 yyr1[] = |
1921f1d7 | 569 | { |
0210a4bf AR |
570 | 0, 58, 59, 60, 60, 61, 61, 61, 61, 61, |
571 | 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, | |
572 | 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, | |
573 | 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, | |
574 | 62, 62, 62, 62, 63, 63, 62, 65, 64, 66, | |
575 | 64, 64, 67, 68, 68, 68, 69, 69, 70, 70, | |
576 | 71, 71, 72, 72, 73, 73, 74, 74, 74, 74, | |
577 | 75, 75, 75, 75, 75, 76, 76, 77, 77, 78, | |
578 | 78, 78, 80, 79, 81, 81, 81, 82, 82, 82, | |
f37495f6 JD |
579 | 82, 82, 82, 83, 83, 84, 84, 85, 85, 85, |
580 | 86, 87, 87, 88, 89, 89, 90, 91, 91 | |
1921f1d7 AD |
581 | }; |
582 | ||
583 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
bf8b3d98 | 584 | static const yytype_uint8 yyr2[] = |
1921f1d7 | 585 | { |
2cbe6b7f | 586 | 0, 2, 4, 0, 2, 1, 1, 1, 3, 1, |
5e6feb86 | 587 | 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, |
d782395d JD |
588 | 1, 2, 3, 1, 1, 2, 3, 2, 1, 2, |
589 | 2, 1, 1, 1, 1, 1, 1, 2, 3, 3, | |
590 | 1, 1, 2, 3, 0, 1, 3, 0, 3, 0, | |
591 | 3, 3, 3, 1, 1, 1, 0, 1, 1, 2, | |
ab7f29f8 JD |
592 | 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, |
593 | 1, 1, 2, 2, 3, 1, 2, 1, 2, 1, | |
0210a4bf AR |
594 | 2, 2, 0, 4, 1, 3, 2, 0, 3, 3, |
595 | 3, 3, 3, 0, 1, 1, 1, 0, 1, 1, | |
f37495f6 | 596 | 1, 1, 1, 1, 1, 1, 1, 0, 2 |
1921f1d7 AD |
597 | }; |
598 | ||
620b5727 JD |
599 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. |
600 | Performed when YYTABLE doesn't specify something else to do. Zero | |
1921f1d7 | 601 | means the default is an error. */ |
bf8b3d98 | 602 | static const yytype_uint8 yydefact[] = |
1921f1d7 | 603 | { |
d782395d JD |
604 | 3, 0, 0, 1, 49, 47, 0, 0, 0, 53, |
605 | 54, 55, 0, 7, 40, 0, 9, 11, 0, 0, | |
606 | 0, 16, 0, 0, 0, 20, 0, 41, 23, 24, | |
607 | 0, 0, 28, 0, 0, 0, 31, 32, 33, 0, | |
608 | 6, 34, 44, 4, 5, 36, 35, 56, 0, 0, | |
f37495f6 | 609 | 0, 0, 0, 100, 0, 42, 96, 95, 97, 10, |
d782395d | 610 | 12, 13, 14, 0, 17, 18, 19, 21, 0, 25, |
f37495f6 JD |
611 | 0, 27, 29, 30, 106, 102, 101, 104, 37, 105, |
612 | 0, 103, 0, 0, 77, 79, 93, 45, 0, 57, | |
ab7f29f8 | 613 | 0, 70, 75, 50, 71, 48, 51, 62, 67, 68, |
f37495f6 JD |
614 | 69, 38, 64, 66, 39, 43, 99, 98, 8, 15, |
615 | 22, 26, 81, 80, 0, 78, 2, 94, 82, 46, | |
616 | 52, 58, 60, 76, 72, 73, 63, 65, 108, 87, | |
617 | 59, 61, 74, 83, 84, 87, 86, 0, 0, 0, | |
618 | 93, 93, 85, 90, 91, 92, 89, 88 | |
1921f1d7 AD |
619 | }; |
620 | ||
3b0ffc7e | 621 | /* YYDEFGOTO[NTERM-NUM]. */ |
ab7f29f8 | 622 | static const yytype_int16 yydefgoto[] = |
1921f1d7 | 623 | { |
d782395d | 624 | -1, 1, 2, 43, 82, 88, 45, 49, 48, 46, |
f37495f6 JD |
625 | 47, 90, 120, 121, 96, 101, 102, 92, 93, 83, |
626 | 84, 85, 129, 133, 134, 118, 58, 108, 55, 77, | |
627 | 86, 103, 79, 116 | |
1921f1d7 AD |
628 | }; |
629 | ||
630 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
631 | STATE-NUM. */ | |
42ec0ae1 | 632 | #define YYPACT_NINF -91 |
7172e23e | 633 | static const yytype_int16 yypact[] = |
1921f1d7 | 634 | { |
42ec0ae1 JD |
635 | -91, 3, 103, -91, -91, -91, -36, 2, 10, -91, |
636 | -91, -91, 9, -91, -91, 32, 60, -91, 65, 67, | |
637 | 27, -91, 41, 73, 51, -91, 39, -91, -91, -91, | |
638 | 40, 52, -91, 93, 95, 33, -91, -91, -91, 15, | |
639 | -91, -91, 53, -91, -91, -91, -91, 46, 43, 43, | |
640 | 33, 11, 11, -91, 61, -91, -91, -91, 35, -91, | |
641 | -91, -91, -91, 100, -91, -91, -91, -91, 102, -91, | |
642 | 113, -91, -91, -91, -91, -91, -91, -91, -91, -91, | |
643 | 64, -91, 94, 1, -91, -91, 62, -91, 61, -91, | |
644 | 33, -91, -91, 43, 86, 43, 33, -91, -91, -91, | |
645 | -91, 11, -91, -91, 11, -91, -91, -91, -91, -91, | |
646 | -91, -91, -91, -91, 72, -91, -91, -91, -91, -91, | |
647 | 33, -91, 142, -91, 145, -91, -91, -91, -91, -91, | |
648 | -91, -91, -91, 17, 34, -91, -91, 33, 146, 97, | |
649 | 62, 62, 34, -91, -91, -91, -91, -91 | |
1921f1d7 AD |
650 | }; |
651 | ||
652 | /* YYPGOTO[NTERM-NUM]. */ | |
8e0a5e9e | 653 | static const yytype_int16 yypgoto[] = |
1921f1d7 | 654 | { |
42ec0ae1 JD |
655 | -91, -91, -91, -91, 147, -91, -91, -91, -91, -91, |
656 | -91, -91, -91, 37, -91, 106, -60, -33, 105, -91, | |
657 | 69, -91, -91, -91, 24, -48, -91, -91, -49, -20, | |
658 | -91, -35, -90, -91 | |
1921f1d7 AD |
659 | }; |
660 | ||
661 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | |
662 | positive, shift that token. If negative, reduce the rule which | |
e4bcae3c | 663 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
f37495f6 | 664 | #define YYTABLE_NINF -108 |
2ce4ed68 | 665 | static const yytype_int16 yytable[] = |
1921f1d7 | 666 | { |
42ec0ae1 JD |
667 | 78, -107, 80, 3, 125, 105, 4, 5, 6, 7, |
668 | 8, 9, 10, 11, 74, 97, 80, 12, 50, 14, | |
669 | 4, 5, 6, 7, 8, 9, 10, 11, 94, 94, | |
670 | 62, 12, 27, 14, 132, 56, 74, 74, 106, 119, | |
671 | 35, 127, 67, 69, 127, 51, 27, 137, 138, 139, | |
672 | 81, 114, 53, 52, 35, 122, 75, 54, 42, 76, | |
673 | 123, 126, 123, 59, 81, 98, 99, 100, 135, 60, | |
674 | 136, 61, 42, 94, 63, 94, 65, 140, 75, 75, | |
675 | 57, 76, 76, 107, 64, 122, 68, 70, 75, 74, | |
676 | 124, 76, 146, 147, 66, 71, 72, 91, 73, 141, | |
677 | 89, 87, 143, 109, 53, 110, 117, 141, 4, 5, | |
678 | 6, 7, 8, 9, 10, 11, 111, 112, 128, 12, | |
f37495f6 JD |
679 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, |
680 | 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, | |
42ec0ae1 JD |
681 | 33, 34, 35, 36, 37, 38, 131, 113, 74, 44, |
682 | 144, 145, 115, 39, 95, 40, 41, 130, 104, 142, | |
f37495f6 | 683 | 42 |
1921f1d7 AD |
684 | }; |
685 | ||
d5eb0826 | 686 | #define yypact_value_is_default(yystate) \ |
42ec0ae1 | 687 | ((yystate) == (-91)) |
1fa30307 | 688 | |
d5eb0826 | 689 | #define yytable_value_is_error(yytable_value) \ |
e4bcae3c | 690 | YYID (0) |
1fa30307 | 691 | |
d782395d | 692 | static const yytype_uint8 yycheck[] = |
1921f1d7 | 693 | { |
42ec0ae1 | 694 | 35, 0, 1, 0, 94, 54, 5, 6, 7, 8, |
0210a4bf | 695 | 9, 10, 11, 12, 3, 50, 1, 16, 54, 18, |
42ec0ae1 JD |
696 | 5, 6, 7, 8, 9, 10, 11, 12, 48, 49, |
697 | 3, 16, 31, 18, 124, 3, 3, 3, 3, 88, | |
698 | 39, 101, 3, 3, 104, 43, 31, 13, 14, 15, | |
699 | 49, 50, 43, 43, 39, 90, 45, 48, 57, 48, | |
700 | 93, 96, 95, 3, 49, 54, 55, 56, 51, 4, | |
701 | 53, 4, 57, 93, 47, 95, 3, 43, 45, 45, | |
702 | 48, 48, 48, 48, 43, 120, 47, 47, 45, 3, | |
703 | 4, 48, 140, 141, 43, 43, 3, 54, 3, 134, | |
704 | 54, 48, 137, 3, 43, 3, 44, 142, 5, 6, | |
705 | 7, 8, 9, 10, 11, 12, 3, 53, 46, 16, | |
f37495f6 JD |
706 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
707 | 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, | |
42ec0ae1 JD |
708 | 37, 38, 39, 40, 41, 42, 4, 53, 3, 2, |
709 | 4, 54, 83, 50, 49, 52, 53, 120, 52, 135, | |
f37495f6 | 710 | 57 |
1921f1d7 AD |
711 | }; |
712 | ||
1921f1d7 AD |
713 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
714 | symbol of state STATE-NUM. */ | |
bf8b3d98 | 715 | static const yytype_uint8 yystos[] = |
1921f1d7 | 716 | { |
0210a4bf | 717 | 0, 59, 60, 0, 5, 6, 7, 8, 9, 10, |
12e35840 JD |
718 | 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, |
719 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, | |
42ec0ae1 JD |
720 | 34, 35, 36, 37, 38, 39, 40, 41, 42, 50, |
721 | 52, 53, 57, 61, 62, 64, 67, 68, 66, 65, | |
722 | 54, 43, 43, 43, 48, 86, 3, 48, 84, 3, | |
723 | 4, 4, 3, 47, 43, 3, 43, 3, 47, 3, | |
724 | 47, 43, 3, 3, 3, 45, 48, 87, 89, 90, | |
725 | 1, 49, 62, 77, 78, 79, 88, 48, 63, 54, | |
726 | 69, 54, 75, 76, 87, 76, 72, 89, 54, 55, | |
727 | 56, 73, 74, 89, 73, 86, 3, 48, 85, 3, | |
728 | 3, 3, 53, 53, 50, 78, 91, 44, 83, 86, | |
729 | 70, 71, 89, 75, 4, 90, 89, 74, 46, 80, | |
730 | 71, 4, 90, 81, 82, 51, 53, 13, 14, 15, | |
731 | 43, 89, 82, 89, 4, 54, 83, 83 | |
1921f1d7 | 732 | }; |
e9955c83 | 733 | |
e9955c83 | 734 | #define yyerrok (yyerrstatus = 0) |
73521d9f PE |
735 | #define yyclearin (yychar = YYEMPTY) |
736 | #define YYEMPTY (-2) | |
e9955c83 | 737 | #define YYEOF 0 |
1921f1d7 | 738 | |
e9955c83 | 739 | #define YYACCEPT goto yyacceptlab |
1921f1d7 | 740 | #define YYABORT goto yyabortlab |
465b4444 | 741 | #define YYERROR goto yyerrorlab |
6d5aa694 | 742 | |
1921f1d7 | 743 | |
e9955c83 AD |
744 | /* Like YYERROR except do call yyerror. This remains here temporarily |
745 | to ease the transition to the new meaning of YYERROR, for GCC. | |
41d35e54 JD |
746 | Once GCC version 2 has supplanted version 1, this can go. However, |
747 | YYFAIL appears to be in use. Nevertheless, it is formally deprecated | |
748 | in Bison 2.4.2's NEWS entry, where a plan to phase it out is | |
749 | discussed. */ | |
1921f1d7 | 750 | |
e9955c83 | 751 | #define YYFAIL goto yyerrlab |
41d35e54 JD |
752 | #if defined YYFAIL |
753 | /* This is here to suppress warnings from the GCC cpp's | |
754 | -Wunused-macros. Normally we don't worry about that warning, but | |
755 | some users do, and we want to make it easy for users to remove | |
756 | YYFAIL uses, which will produce warnings from Bison 2.5. */ | |
757 | #endif | |
1921f1d7 | 758 | |
e9955c83 | 759 | #define YYRECOVERING() (!!yyerrstatus) |
1921f1d7 | 760 | |
f95faa25 AD |
761 | #define YYBACKUP(Token, Value) \ |
762 | do \ | |
763 | if (yychar == YYEMPTY) \ | |
764 | { \ | |
765 | yychar = (Token); \ | |
766 | yylval = (Value); \ | |
767 | YYPOPSTACK (yylen); \ | |
768 | yystate = *yyssp; \ | |
769 | YY_LAC_DISCARD ("YYBACKUP"); \ | |
770 | goto yybackup; \ | |
771 | } \ | |
772 | else \ | |
773 | { \ | |
6088a2a0 | 774 | yyerror (YY_("syntax error: cannot back up")); \ |
e9955c83 AD |
775 | YYERROR; \ |
776 | } \ | |
7029f892 | 777 | while (YYID (0)) |
e9955c83 | 778 | |
8a8dc872 | 779 | |
e9955c83 AD |
780 | #define YYTERROR 1 |
781 | #define YYERRCODE 256 | |
782 | ||
8a8dc872 AD |
783 | |
784 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | |
785 | If N is 0, then set CURRENT to the empty location which ends | |
786 | the previous symbol: RHS[0] (always defined). */ | |
e9955c83 | 787 | |
bbd3fa0c | 788 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
e9955c83 | 789 | #ifndef YYLLOC_DEFAULT |
bbd3fa0c PE |
790 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
791 | do \ | |
3b0ffc7e | 792 | if (YYID (N)) \ |
bbd3fa0c | 793 | { \ |
da436e43 PE |
794 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ |
795 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ | |
796 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ | |
797 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ | |
bbd3fa0c PE |
798 | } \ |
799 | else \ | |
800 | { \ | |
801 | (Current).first_line = (Current).last_line = \ | |
da436e43 | 802 | YYRHSLOC (Rhs, 0).last_line; \ |
bbd3fa0c | 803 | (Current).first_column = (Current).last_column = \ |
da436e43 | 804 | YYRHSLOC (Rhs, 0).last_column; \ |
bbd3fa0c | 805 | } \ |
7029f892 | 806 | while (YYID (0)) |
8a8dc872 AD |
807 | #endif |
808 | ||
809 | ||
810 | /* YY_LOCATION_PRINT -- Print the location on the stream. | |
811 | This macro was not mandated originally: define only if we know | |
812 | we won't break user code: when these are the locations we know. */ | |
813 | ||
814 | #ifndef YY_LOCATION_PRINT | |
41d35e54 | 815 | # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL |
8a8dc872 AD |
816 | # define YY_LOCATION_PRINT(File, Loc) \ |
817 | fprintf (File, "%d.%d-%d.%d", \ | |
bf8b3d98 PE |
818 | (Loc).first_line, (Loc).first_column, \ |
819 | (Loc).last_line, (Loc).last_column) | |
8a8dc872 AD |
820 | # else |
821 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | |
822 | # endif | |
e9955c83 AD |
823 | #endif |
824 | ||
8a8dc872 | 825 | |
e9955c83 AD |
826 | /* YYLEX -- calling `yylex' with the right arguments. */ |
827 | ||
366eea36 | 828 | #ifdef YYLEX_PARAM |
d33cb3ae | 829 | # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) |
366eea36 | 830 | #else |
d33cb3ae | 831 | # define YYLEX yylex (&yylval, &yylloc) |
366eea36 | 832 | #endif |
e9955c83 AD |
833 | |
834 | /* Enable debugging if requested. */ | |
835 | #if YYDEBUG | |
836 | ||
74e543d2 | 837 | # ifndef YYFPRINTF |
e9955c83 AD |
838 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
839 | # define YYFPRINTF fprintf | |
840 | # endif | |
841 | ||
842 | # define YYDPRINTF(Args) \ | |
843 | do { \ | |
844 | if (yydebug) \ | |
845 | YYFPRINTF Args; \ | |
7029f892 | 846 | } while (YYID (0)) |
05d18c24 | 847 | |
4b367315 AD |
848 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
849 | do { \ | |
850 | if (yydebug) \ | |
851 | { \ | |
852 | YYFPRINTF (stderr, "%s ", Title); \ | |
3b0ffc7e | 853 | yy_symbol_print (stderr, \ |
bf8b3d98 | 854 | Type, Value, Location); \ |
4b367315 AD |
855 | YYFPRINTF (stderr, "\n"); \ |
856 | } \ | |
7029f892 | 857 | } while (YYID (0)) |
f0616f0b | 858 | |
3b0ffc7e | 859 | |
66809587 PE |
860 | /*--------------------------------. |
861 | | Print this symbol on YYOUTPUT. | | |
862 | `--------------------------------*/ | |
863 | ||
7029f892 | 864 | /*ARGSUSED*/ |
bf8b3d98 PE |
865 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
866 | || defined __cplusplus || defined _MSC_VER) | |
66809587 | 867 | static void |
d2a1a60a | 868 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) |
66809587 PE |
869 | #else |
870 | static void | |
3b0ffc7e | 871 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) |
66809587 PE |
872 | FILE *yyoutput; |
873 | int yytype; | |
d2a1a60a PE |
874 | YYSTYPE const * const yyvaluep; |
875 | YYLTYPE const * const yylocationp; | |
66809587 PE |
876 | #endif |
877 | { | |
9c883a6b JM |
878 | FILE *yyo = yyoutput; |
879 | YYUSE (yyo); | |
bf8b3d98 PE |
880 | if (!yyvaluep) |
881 | return; | |
66809587 | 882 | YYUSE (yylocationp); |
66809587 PE |
883 | # ifdef YYPRINT |
884 | if (yytype < YYNTOKENS) | |
885 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
bf8b3d98 PE |
886 | # else |
887 | YYUSE (yyoutput); | |
66809587 PE |
888 | # endif |
889 | switch (yytype) | |
890 | { | |
891 | case 3: /* "\"string\"" */ | |
136a0f76 | 892 | |
34d867d7 | 893 | /* Line 822 of yacc.c */ |
45aab21d | 894 | #line 204 "parse-gram.y" |
d2a1a60a | 895 | { fputs (quotearg_style (c_quoting_style, (yyvaluep->chars)), stderr); }; |
136a0f76 | 896 | |
34d867d7 AD |
897 | /* Line 822 of yacc.c */ |
898 | #line 899 "parse-gram.c" | |
bf8b3d98 PE |
899 | break; |
900 | case 4: /* "\"integer\"" */ | |
136a0f76 | 901 | |
34d867d7 | 902 | /* Line 822 of yacc.c */ |
45aab21d | 903 | #line 216 "parse-gram.y" |
bf8b3d98 | 904 | { fprintf (stderr, "%d", (yyvaluep->integer)); }; |
136a0f76 | 905 | |
34d867d7 AD |
906 | /* Line 822 of yacc.c */ |
907 | #line 908 "parse-gram.c" | |
bf8b3d98 | 908 | break; |
d782395d | 909 | case 43: /* "\"{...}\"" */ |
136a0f76 | 910 | |
34d867d7 | 911 | /* Line 822 of yacc.c */ |
45aab21d | 912 | #line 206 "parse-gram.y" |
ff8d8df2 | 913 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->code)); }; |
136a0f76 | 914 | |
34d867d7 AD |
915 | /* Line 822 of yacc.c */ |
916 | #line 917 "parse-gram.c" | |
bf8b3d98 | 917 | break; |
42ec0ae1 JD |
918 | case 44: /* "\"[identifier]\"" */ |
919 | ||
34d867d7 | 920 | /* Line 822 of yacc.c */ |
45aab21d | 921 | #line 211 "parse-gram.y" |
42ec0ae1 JD |
922 | { fprintf (stderr, "[%s]", (yyvaluep->uniqstr)); }; |
923 | ||
34d867d7 AD |
924 | /* Line 822 of yacc.c */ |
925 | #line 926 "parse-gram.c" | |
42ec0ae1 JD |
926 | break; |
927 | case 45: /* "\"char\"" */ | |
136a0f76 | 928 | |
34d867d7 | 929 | /* Line 822 of yacc.c */ |
45aab21d | 930 | #line 198 "parse-gram.y" |
d2a1a60a | 931 | { fputs (char_name ((yyvaluep->character)), stderr); }; |
136a0f76 | 932 | |
34d867d7 AD |
933 | /* Line 822 of yacc.c */ |
934 | #line 935 "parse-gram.c" | |
bf8b3d98 | 935 | break; |
42ec0ae1 | 936 | case 46: /* "\"epilogue\"" */ |
136a0f76 | 937 | |
34d867d7 | 938 | /* Line 822 of yacc.c */ |
45aab21d | 939 | #line 206 "parse-gram.y" |
58d7a1a1 | 940 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; |
136a0f76 | 941 | |
34d867d7 AD |
942 | /* Line 822 of yacc.c */ |
943 | #line 944 "parse-gram.c" | |
bf8b3d98 | 944 | break; |
42ec0ae1 | 945 | case 48: /* "\"identifier\"" */ |
136a0f76 | 946 | |
34d867d7 | 947 | /* Line 822 of yacc.c */ |
45aab21d | 948 | #line 210 "parse-gram.y" |
d2a1a60a | 949 | { fputs ((yyvaluep->uniqstr), stderr); }; |
136a0f76 | 950 | |
34d867d7 AD |
951 | /* Line 822 of yacc.c */ |
952 | #line 953 "parse-gram.c" | |
58d7a1a1 | 953 | break; |
42ec0ae1 | 954 | case 49: /* "\"identifier:\"" */ |
136a0f76 | 955 | |
34d867d7 | 956 | /* Line 822 of yacc.c */ |
45aab21d | 957 | #line 212 "parse-gram.y" |
58d7a1a1 | 958 | { fprintf (stderr, "%s:", (yyvaluep->uniqstr)); }; |
136a0f76 | 959 | |
34d867d7 AD |
960 | /* Line 822 of yacc.c */ |
961 | #line 962 "parse-gram.c" | |
bf8b3d98 | 962 | break; |
42ec0ae1 | 963 | case 52: /* "\"%{...%}\"" */ |
136a0f76 | 964 | |
34d867d7 | 965 | /* Line 822 of yacc.c */ |
45aab21d | 966 | #line 206 "parse-gram.y" |
bf8b3d98 | 967 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; |
136a0f76 | 968 | |
34d867d7 AD |
969 | /* Line 822 of yacc.c */ |
970 | #line 971 "parse-gram.c" | |
bf8b3d98 | 971 | break; |
42ec0ae1 | 972 | case 54: /* "\"type\"" */ |
136a0f76 | 973 | |
34d867d7 | 974 | /* Line 822 of yacc.c */ |
45aab21d | 975 | #line 213 "parse-gram.y" |
58d7a1a1 | 976 | { fprintf (stderr, "<%s>", (yyvaluep->uniqstr)); }; |
136a0f76 | 977 | |
34d867d7 AD |
978 | /* Line 822 of yacc.c */ |
979 | #line 980 "parse-gram.c" | |
42ec0ae1 JD |
980 | break; |
981 | case 71: /* "symbol.prec" */ | |
982 | ||
34d867d7 | 983 | /* Line 822 of yacc.c */ |
45aab21d | 984 | #line 219 "parse-gram.y" |
42ec0ae1 JD |
985 | { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; |
986 | ||
34d867d7 AD |
987 | /* Line 822 of yacc.c */ |
988 | #line 989 "parse-gram.c" | |
bf8b3d98 | 989 | break; |
0210a4bf | 990 | case 84: /* "variable" */ |
136a0f76 | 991 | |
34d867d7 | 992 | /* Line 822 of yacc.c */ |
45aab21d | 993 | #line 210 "parse-gram.y" |
16dc6a9e | 994 | { fputs ((yyvaluep->uniqstr), stderr); }; |
136a0f76 | 995 | |
34d867d7 AD |
996 | /* Line 822 of yacc.c */ |
997 | #line 998 "parse-gram.c" | |
58d7a1a1 | 998 | break; |
0210a4bf | 999 | case 85: /* "content.opt" */ |
136a0f76 | 1000 | |
34d867d7 | 1001 | /* Line 822 of yacc.c */ |
45aab21d | 1002 | #line 206 "parse-gram.y" |
2ce4ed68 | 1003 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; |
136a0f76 | 1004 | |
34d867d7 AD |
1005 | /* Line 822 of yacc.c */ |
1006 | #line 1007 "parse-gram.c" | |
2ce4ed68 | 1007 | break; |
0210a4bf | 1008 | case 86: /* "braceless" */ |
16dc6a9e | 1009 | |
34d867d7 | 1010 | /* Line 822 of yacc.c */ |
45aab21d | 1011 | #line 206 "parse-gram.y" |
16dc6a9e JD |
1012 | { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; |
1013 | ||
34d867d7 AD |
1014 | /* Line 822 of yacc.c */ |
1015 | #line 1016 "parse-gram.c" | |
16dc6a9e | 1016 | break; |
0210a4bf | 1017 | case 87: /* "id" */ |
136a0f76 | 1018 | |
34d867d7 | 1019 | /* Line 822 of yacc.c */ |
45aab21d | 1020 | #line 219 "parse-gram.y" |
bf8b3d98 | 1021 | { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; |
136a0f76 | 1022 | |
34d867d7 AD |
1023 | /* Line 822 of yacc.c */ |
1024 | #line 1025 "parse-gram.c" | |
2ce4ed68 | 1025 | break; |
0210a4bf | 1026 | case 88: /* "id_colon" */ |
136a0f76 | 1027 | |
34d867d7 | 1028 | /* Line 822 of yacc.c */ |
45aab21d | 1029 | #line 220 "parse-gram.y" |
2ce4ed68 | 1030 | { fprintf (stderr, "%s:", (yyvaluep->symbol)->tag); }; |
136a0f76 | 1031 | |
34d867d7 AD |
1032 | /* Line 822 of yacc.c */ |
1033 | #line 1034 "parse-gram.c" | |
bf8b3d98 | 1034 | break; |
0210a4bf | 1035 | case 89: /* "symbol" */ |
136a0f76 | 1036 | |
34d867d7 | 1037 | /* Line 822 of yacc.c */ |
45aab21d | 1038 | #line 219 "parse-gram.y" |
bf8b3d98 | 1039 | { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; |
136a0f76 | 1040 | |
34d867d7 AD |
1041 | /* Line 822 of yacc.c */ |
1042 | #line 1043 "parse-gram.c" | |
bf8b3d98 | 1043 | break; |
0210a4bf | 1044 | case 90: /* "string_as_id" */ |
136a0f76 | 1045 | |
34d867d7 | 1046 | /* Line 822 of yacc.c */ |
45aab21d | 1047 | #line 219 "parse-gram.y" |
2ce4ed68 | 1048 | { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; |
136a0f76 | 1049 | |
34d867d7 AD |
1050 | /* Line 822 of yacc.c */ |
1051 | #line 1052 "parse-gram.c" | |
bf8b3d98 | 1052 | break; |
66809587 | 1053 | default: |
bf8b3d98 | 1054 | break; |
66809587 | 1055 | } |
3b0ffc7e PE |
1056 | } |
1057 | ||
1058 | ||
1059 | /*--------------------------------. | |
1060 | | Print this symbol on YYOUTPUT. | | |
1061 | `--------------------------------*/ | |
1062 | ||
bf8b3d98 PE |
1063 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1064 | || defined __cplusplus || defined _MSC_VER) | |
3b0ffc7e | 1065 | static void |
d2a1a60a | 1066 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) |
3b0ffc7e PE |
1067 | #else |
1068 | static void | |
1069 | yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp) | |
1070 | FILE *yyoutput; | |
1071 | int yytype; | |
d2a1a60a PE |
1072 | YYSTYPE const * const yyvaluep; |
1073 | YYLTYPE const * const yylocationp; | |
3b0ffc7e PE |
1074 | #endif |
1075 | { | |
1076 | if (yytype < YYNTOKENS) | |
1077 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); | |
1078 | else | |
1079 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); | |
1080 | ||
1081 | YY_LOCATION_PRINT (yyoutput, *yylocationp); | |
1082 | YYFPRINTF (yyoutput, ": "); | |
1083 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp); | |
66809587 PE |
1084 | YYFPRINTF (yyoutput, ")"); |
1085 | } | |
1086 | ||
05d18c24 PE |
1087 | /*------------------------------------------------------------------. |
1088 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
cd3684cf | 1089 | | TOP (included). | |
05d18c24 PE |
1090 | `------------------------------------------------------------------*/ |
1091 | ||
bf8b3d98 PE |
1092 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1093 | || defined __cplusplus || defined _MSC_VER) | |
05d18c24 | 1094 | static void |
3b452f4e | 1095 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
05d18c24 PE |
1096 | #else |
1097 | static void | |
3b452f4e JD |
1098 | yy_stack_print (yybottom, yytop) |
1099 | yytype_int16 *yybottom; | |
1100 | yytype_int16 *yytop; | |
05d18c24 PE |
1101 | #endif |
1102 | { | |
74e543d2 | 1103 | YYFPRINTF (stderr, "Stack now"); |
3b452f4e JD |
1104 | for (; yybottom <= yytop; yybottom++) |
1105 | { | |
1106 | int yybot = *yybottom; | |
1107 | YYFPRINTF (stderr, " %d", yybot); | |
1108 | } | |
74e543d2 | 1109 | YYFPRINTF (stderr, "\n"); |
05d18c24 PE |
1110 | } |
1111 | ||
1112 | # define YY_STACK_PRINT(Bottom, Top) \ | |
1113 | do { \ | |
1114 | if (yydebug) \ | |
1115 | yy_stack_print ((Bottom), (Top)); \ | |
7029f892 | 1116 | } while (YYID (0)) |
05d18c24 PE |
1117 | |
1118 | ||
1119 | /*------------------------------------------------. | |
1120 | | Report that the YYRULE is going to be reduced. | | |
1121 | `------------------------------------------------*/ | |
1122 | ||
bf8b3d98 PE |
1123 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1124 | || defined __cplusplus || defined _MSC_VER) | |
05d18c24 | 1125 | static void |
66809587 | 1126 | yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) |
05d18c24 PE |
1127 | #else |
1128 | static void | |
d2a1a60a | 1129 | yy_reduce_print (yyvsp, yylsp, yyrule) |
66809587 PE |
1130 | YYSTYPE *yyvsp; |
1131 | YYLTYPE *yylsp; | |
05d18c24 PE |
1132 | int yyrule; |
1133 | #endif | |
1134 | { | |
66809587 | 1135 | int yynrhs = yyr2[yyrule]; |
05d18c24 | 1136 | int yyi; |
6088a2a0 | 1137 | unsigned long int yylno = yyrline[yyrule]; |
66809587 | 1138 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
bf8b3d98 | 1139 | yyrule - 1, yylno); |
66809587 PE |
1140 | /* The symbols being reduced. */ |
1141 | for (yyi = 0; yyi < yynrhs; yyi++) | |
1142 | { | |
0bf92491 | 1143 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
3b0ffc7e | 1144 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
bf8b3d98 PE |
1145 | &(yyvsp[(yyi + 1) - (yynrhs)]) |
1146 | , &(yylsp[(yyi + 1) - (yynrhs)]) ); | |
0bf92491 | 1147 | YYFPRINTF (stderr, "\n"); |
66809587 | 1148 | } |
05d18c24 PE |
1149 | } |
1150 | ||
1151 | # define YY_REDUCE_PRINT(Rule) \ | |
1152 | do { \ | |
1153 | if (yydebug) \ | |
66809587 | 1154 | yy_reduce_print (yyvsp, yylsp, Rule); \ |
7029f892 | 1155 | } while (YYID (0)) |
05d18c24 | 1156 | |
e9955c83 AD |
1157 | /* Nonzero means print parse trace. It is left uninitialized so that |
1158 | multiple parsers can coexist. */ | |
1159 | int yydebug; | |
1160 | #else /* !YYDEBUG */ | |
1161 | # define YYDPRINTF(Args) | |
8a8dc872 | 1162 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
05d18c24 PE |
1163 | # define YY_STACK_PRINT(Bottom, Top) |
1164 | # define YY_REDUCE_PRINT(Rule) | |
e9955c83 AD |
1165 | #endif /* !YYDEBUG */ |
1166 | ||
05d18c24 | 1167 | |
e9955c83 AD |
1168 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
1169 | #ifndef YYINITDEPTH | |
1170 | # define YYINITDEPTH 200 | |
1171 | #endif | |
1172 | ||
1173 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only | |
1174 | if the built-in stack extension method is used). | |
1175 | ||
1176 | Do not make this value too large; the results are undefined if | |
2ce37586 | 1177 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
e9955c83 AD |
1178 | evaluated with infinite-precision integer arithmetic. */ |
1179 | ||
e9955c83 AD |
1180 | #ifndef YYMAXDEPTH |
1181 | # define YYMAXDEPTH 10000 | |
1182 | #endif | |
1921f1d7 | 1183 | |
723fe7d1 JD |
1184 | /* Given a state stack such that *YYBOTTOM is its bottom, such that |
1185 | *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty | |
1186 | stack, and such that *YYCAPACITY is the maximum number of elements it | |
1187 | can hold without a reallocation, make sure there is enough room to | |
1188 | store YYADD more elements. If not, allocate a new stack using | |
1189 | YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM, | |
1190 | *YYTOP, and *YYCAPACITY to reflect the new capacity and memory | |
1191 | location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack | |
1192 | using YYSTACK_FREE. Return 0 if successful or if no reallocation is | |
1193 | required. Return 1 if memory is exhausted. */ | |
1194 | static int | |
1195 | yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd, | |
1196 | #if YYDEBUG | |
1197 | char const *yydebug_prefix, | |
1198 | char const *yydebug_suffix, | |
1199 | #endif | |
1200 | yytype_int16 **yybottom, | |
1201 | yytype_int16 *yybottom_no_free, | |
1202 | yytype_int16 **yytop, yytype_int16 *yytop_empty) | |
1203 | { | |
1204 | YYSIZE_T yysize_old = | |
1205 | *yytop == yytop_empty ? 0 : *yytop - *yybottom + 1; | |
1206 | YYSIZE_T yysize_new = yysize_old + yyadd; | |
1207 | if (*yycapacity < yysize_new) | |
1208 | { | |
1209 | YYSIZE_T yyalloc = 2 * yysize_new; | |
1210 | yytype_int16 *yybottom_new; | |
1211 | /* Use YYMAXDEPTH for maximum stack size given that the stack | |
1212 | should never need to grow larger than the main state stack | |
1213 | needs to grow without LAC. */ | |
1214 | if (YYMAXDEPTH < yysize_new) | |
1215 | { | |
1216 | YYDPRINTF ((stderr, "%smax size exceeded%s", yydebug_prefix, | |
1217 | yydebug_suffix)); | |
1218 | return 1; | |
1219 | } | |
1220 | if (YYMAXDEPTH < yyalloc) | |
1221 | yyalloc = YYMAXDEPTH; | |
1222 | yybottom_new = | |
1223 | (yytype_int16*) YYSTACK_ALLOC (yyalloc * sizeof *yybottom_new); | |
1224 | if (!yybottom_new) | |
1225 | { | |
1226 | YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix, | |
1227 | yydebug_suffix)); | |
1228 | return 1; | |
1229 | } | |
1230 | if (*yytop != yytop_empty) | |
1231 | { | |
1232 | YYCOPY (yybottom_new, *yybottom, yysize_old); | |
1233 | *yytop = yybottom_new + (yysize_old - 1); | |
1234 | } | |
1235 | if (*yybottom != yybottom_no_free) | |
1236 | YYSTACK_FREE (*yybottom); | |
1237 | *yybottom = yybottom_new; | |
1238 | *yycapacity = yyalloc; | |
1239 | } | |
1240 | return 0; | |
1241 | } | |
1242 | ||
1243 | /* Establish the initial context for the current lookahead if no initial | |
1244 | context is currently established. | |
1245 | ||
1246 | We define a context as a snapshot of the parser stacks. We define | |
1247 | the initial context for a lookahead as the context in which the | |
1248 | parser initially examines that lookahead in order to select a | |
1249 | syntactic action. Thus, if the lookahead eventually proves | |
1250 | syntactically unacceptable (possibly in a later context reached via a | |
1251 | series of reductions), the initial context can be used to determine | |
1252 | the exact set of tokens that would be syntactically acceptable in the | |
1253 | lookahead's place. Moreover, it is the context after which any | |
1254 | further semantic actions would be erroneous because they would be | |
1255 | determined by a syntactically unacceptable token. | |
1256 | ||
1257 | YY_LAC_ESTABLISH should be invoked when a reduction is about to be | |
1258 | performed in an inconsistent state (which, for the purposes of LAC, | |
1259 | includes consistent states that don't know they're consistent because | |
1260 | their default reductions have been disabled). Iff there is a | |
1261 | lookahead token, it should also be invoked before reporting a syntax | |
1262 | error. This latter case is for the sake of the debugging output. | |
1263 | ||
1264 | For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as | |
1265 | follows. If no initial context is currently established for the | |
1266 | current lookahead, then check if that lookahead can eventually be | |
1267 | shifted if syntactic actions continue from the current context. | |
1268 | Report a syntax error if it cannot. */ | |
1269 | #define YY_LAC_ESTABLISH \ | |
1270 | do { \ | |
1271 | if (!yy_lac_established) \ | |
1272 | { \ | |
1273 | YYDPRINTF ((stderr, \ | |
1274 | "LAC: initial context established for %s\n", \ | |
1275 | yytname[yytoken])); \ | |
1276 | yy_lac_established = 1; \ | |
1277 | { \ | |
1278 | int yy_lac_status = \ | |
1279 | yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \ | |
1280 | if (yy_lac_status == 2) \ | |
1281 | goto yyexhaustedlab; \ | |
1282 | if (yy_lac_status == 1) \ | |
1283 | goto yyerrlab; \ | |
1284 | } \ | |
1285 | } \ | |
1286 | } while (YYID (0)) | |
1287 | ||
1288 | /* Discard any previous initial lookahead context because of Event, | |
1289 | which may be a lookahead change or an invalidation of the currently | |
1290 | established initial context for the current lookahead. | |
1291 | ||
1292 | The most common example of a lookahead change is a shift. An example | |
1293 | of both cases is syntax error recovery. That is, a syntax error | |
1294 | occurs when the lookahead is syntactically erroneous for the | |
1295 | currently established initial context, so error recovery manipulates | |
1296 | the parser stacks to try to find a new initial context in which the | |
1297 | current lookahead is syntactically acceptable. If it fails to find | |
1298 | such a context, it discards the lookahead. */ | |
1299 | #if YYDEBUG | |
1300 | # define YY_LAC_DISCARD(Event) \ | |
1301 | do { \ | |
1302 | if (yy_lac_established) \ | |
1303 | { \ | |
1304 | if (yydebug) \ | |
1305 | YYFPRINTF (stderr, "LAC: initial context discarded due to " \ | |
1306 | Event "\n"); \ | |
1307 | yy_lac_established = 0; \ | |
1308 | } \ | |
1309 | } while (YYID (0)) | |
1310 | #else | |
1311 | # define YY_LAC_DISCARD(Event) yy_lac_established = 0 | |
1312 | #endif | |
1313 | ||
1314 | /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can | |
1315 | eventually (after perhaps some reductions) be shifted, return 1 if | |
1316 | not, or return 2 if memory is exhausted. As preconditions and | |
1317 | postconditions: *YYES_CAPACITY is the allocated size of the array to | |
1318 | which *YYES points, and either *YYES = YYESA or *YYES points to an | |
1319 | array allocated with YYSTACK_ALLOC. yy_lac may overwrite the | |
1320 | contents of either array, alter *YYES and *YYES_CAPACITY, and free | |
1321 | any old *YYES other than YYESA. */ | |
1322 | static int | |
1323 | yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes, | |
1324 | YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken) | |
1325 | { | |
1326 | yytype_int16 *yyes_prev = yyssp; | |
1327 | yytype_int16 *yyesp = yyes_prev; | |
1328 | YYDPRINTF ((stderr, "LAC: checking lookahead %s:", yytname[yytoken])); | |
1329 | if (yytoken == YYUNDEFTOK) | |
1330 | { | |
1331 | YYDPRINTF ((stderr, " Always Err\n")); | |
1332 | return 1; | |
1333 | } | |
1334 | while (1) | |
1335 | { | |
1336 | int yyrule = yypact[*yyesp]; | |
1337 | if (yypact_value_is_default (yyrule) | |
1338 | || (yyrule += yytoken) < 0 || YYLAST < yyrule | |
1339 | || yycheck[yyrule] != yytoken) | |
1340 | { | |
1341 | yyrule = yydefact[*yyesp]; | |
1342 | if (yyrule == 0) | |
1343 | { | |
1344 | YYDPRINTF ((stderr, " Err\n")); | |
1345 | return 1; | |
1346 | } | |
1347 | } | |
1348 | else | |
1349 | { | |
1350 | yyrule = yytable[yyrule]; | |
1351 | if (yytable_value_is_error (yyrule)) | |
1352 | { | |
1353 | YYDPRINTF ((stderr, " Err\n")); | |
1354 | return 1; | |
1355 | } | |
1356 | if (0 < yyrule) | |
1357 | { | |
1358 | YYDPRINTF ((stderr, " S%d\n", yyrule)); | |
1359 | return 0; | |
1360 | } | |
1361 | yyrule = -yyrule; | |
1362 | } | |
1363 | { | |
1364 | YYSIZE_T yylen = yyr2[yyrule]; | |
1365 | YYDPRINTF ((stderr, " R%d", yyrule - 1)); | |
1366 | if (yyesp != yyes_prev) | |
1367 | { | |
1368 | YYSIZE_T yysize = yyesp - *yyes + 1; | |
1369 | if (yylen < yysize) | |
1370 | { | |
1371 | yyesp -= yylen; | |
1372 | yylen = 0; | |
1373 | } | |
1374 | else | |
1375 | { | |
1376 | yylen -= yysize; | |
1377 | yyesp = yyes_prev; | |
1378 | } | |
1379 | } | |
1380 | if (yylen) | |
1381 | yyesp = yyes_prev -= yylen; | |
1382 | } | |
1383 | { | |
1384 | int yystate; | |
1385 | { | |
1386 | int yylhs = yyr1[yyrule] - YYNTOKENS; | |
1387 | yystate = yypgoto[yylhs] + *yyesp; | |
1388 | if (yystate < 0 || YYLAST < yystate | |
1389 | || yycheck[yystate] != *yyesp) | |
1390 | yystate = yydefgoto[yylhs]; | |
1391 | else | |
1392 | yystate = yytable[yystate]; | |
1393 | } | |
1394 | if (yyesp == yyes_prev) | |
1395 | { | |
1396 | yyesp = *yyes; | |
1397 | *yyesp = yystate; | |
1398 | } | |
1399 | else | |
1400 | { | |
1401 | if (yy_lac_stack_realloc (yyes_capacity, 1, | |
1402 | #if YYDEBUG | |
1403 | " (", ")", | |
1404 | #endif | |
1405 | yyes, yyesa, &yyesp, yyes_prev)) | |
1406 | { | |
1407 | YYDPRINTF ((stderr, "\n")); | |
1408 | return 2; | |
1409 | } | |
1410 | *++yyesp = yystate; | |
1411 | } | |
7e5ef706 | 1412 | YYDPRINTF ((stderr, " G%d", yystate)); |
723fe7d1 JD |
1413 | } |
1414 | } | |
1415 | } | |
1416 | ||
1921f1d7 AD |
1417 | |
1418 | #if YYERROR_VERBOSE | |
e9955c83 AD |
1419 | |
1420 | # ifndef yystrlen | |
bf8b3d98 | 1421 | # if defined __GLIBC__ && defined _STRING_H |
e9955c83 AD |
1422 | # define yystrlen strlen |
1423 | # else | |
1424 | /* Return the length of YYSTR. */ | |
bf8b3d98 PE |
1425 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1426 | || defined __cplusplus || defined _MSC_VER) | |
e9955c83 | 1427 | static YYSIZE_T |
e9955c83 | 1428 | yystrlen (const char *yystr) |
2e4c30fa PE |
1429 | #else |
1430 | static YYSIZE_T | |
e9955c83 | 1431 | yystrlen (yystr) |
2e4c30fa PE |
1432 | const char *yystr; |
1433 | #endif | |
e9955c83 | 1434 | { |
7029f892 PE |
1435 | YYSIZE_T yylen; |
1436 | for (yylen = 0; yystr[yylen]; yylen++) | |
e9955c83 | 1437 | continue; |
7029f892 | 1438 | return yylen; |
e9955c83 AD |
1439 | } |
1440 | # endif | |
1441 | # endif | |
1442 | ||
1443 | # ifndef yystpcpy | |
bf8b3d98 | 1444 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
e9955c83 AD |
1445 | # define yystpcpy stpcpy |
1446 | # else | |
1447 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
1448 | YYDEST. */ | |
bf8b3d98 PE |
1449 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1450 | || defined __cplusplus || defined _MSC_VER) | |
e9955c83 | 1451 | static char * |
e9955c83 | 1452 | yystpcpy (char *yydest, const char *yysrc) |
2e4c30fa PE |
1453 | #else |
1454 | static char * | |
e9955c83 | 1455 | yystpcpy (yydest, yysrc) |
2e4c30fa PE |
1456 | char *yydest; |
1457 | const char *yysrc; | |
1458 | #endif | |
e9955c83 | 1459 | { |
b4fb989f PE |
1460 | char *yyd = yydest; |
1461 | const char *yys = yysrc; | |
e9955c83 AD |
1462 | |
1463 | while ((*yyd++ = *yys++) != '\0') | |
1464 | continue; | |
1465 | ||
1466 | return yyd - 1; | |
1467 | } | |
1468 | # endif | |
1469 | # endif | |
0c15323d | 1470 | |
9cbfdc9e PE |
1471 | # ifndef yytnamerr |
1472 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary | |
1473 | quotes and backslashes, so that it's suitable for yyerror. The | |
1474 | heuristic is that double-quoting is unnecessary unless the string | |
1475 | contains an apostrophe, a comma, or backslash (other than | |
1476 | backslash-backslash). YYSTR is taken from yytname. If YYRES is | |
1477 | null, do not copy; instead, return the length of what the result | |
1478 | would have been. */ | |
1479 | static YYSIZE_T | |
1480 | yytnamerr (char *yyres, const char *yystr) | |
1481 | { | |
1482 | if (*yystr == '"') | |
1483 | { | |
d2a1a60a | 1484 | YYSIZE_T yyn = 0; |
9cbfdc9e PE |
1485 | char const *yyp = yystr; |
1486 | ||
1487 | for (;;) | |
1488 | switch (*++yyp) | |
1489 | { | |
1490 | case '\'': | |
1491 | case ',': | |
1492 | goto do_not_strip_quotes; | |
1493 | ||
1494 | case '\\': | |
1495 | if (*++yyp != '\\') | |
1496 | goto do_not_strip_quotes; | |
1497 | /* Fall through. */ | |
1498 | default: | |
1499 | if (yyres) | |
1500 | yyres[yyn] = *yyp; | |
1501 | yyn++; | |
1502 | break; | |
1503 | ||
1504 | case '"': | |
1505 | if (yyres) | |
1506 | yyres[yyn] = '\0'; | |
1507 | return yyn; | |
1508 | } | |
1509 | do_not_strip_quotes: ; | |
1510 | } | |
1511 | ||
1512 | if (! yyres) | |
1513 | return yystrlen (yystr); | |
1514 | ||
1515 | return yystpcpy (yyres, yystr) - yyres; | |
1516 | } | |
1517 | # endif | |
1518 | ||
69a2ab11 | 1519 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
ea13bea8 | 1520 | about the unexpected token YYTOKEN for the state stack whose top is |
723fe7d1 JD |
1521 | YYSSP. In order to see if a particular token T is a |
1522 | valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T). | |
69a2ab11 | 1523 | |
095a1d11 JD |
1524 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
1525 | not large enough to hold the message. In that case, also set | |
1526 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the | |
723fe7d1 JD |
1527 | required number of bytes is too large to store or if |
1528 | yy_lac returned 2. */ | |
69a2ab11 JD |
1529 | static int |
1530 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |
723fe7d1 JD |
1531 | yytype_int16 *yyesa, yytype_int16 **yyes, |
1532 | YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken) | |
f953cb20 | 1533 | { |
9c883a6b | 1534 | YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); |
f953cb20 JD |
1535 | YYSIZE_T yysize = yysize0; |
1536 | YYSIZE_T yysize1; | |
1537 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | |
1538 | /* Internationalized format string. */ | |
9c883a6b | 1539 | const char *yyformat = YY_NULL; |
f953cb20 JD |
1540 | /* Arguments of yyformat. */ |
1541 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |
095a1d11 JD |
1542 | /* Number of reported tokens (one for the "unexpected", one per |
1543 | "expected"). */ | |
1544 | int yycount = 0; | |
f953cb20 | 1545 | |
095a1d11 JD |
1546 | /* There are many possibilities here to consider: |
1547 | - Assume YYFAIL is not used. It's too flawed to consider. See | |
1548 | <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> | |
1549 | for details. YYERROR is fine as it does not invoke this | |
1550 | function. | |
1551 | - If this state is a consistent state with a default action, then | |
1552 | the only way this function was invoked is if the default action | |
1553 | is an error action. In that case, don't check for expected | |
1554 | tokens because there are none. | |
1555 | - The only way there can be no lookahead present (in yychar) is if | |
1556 | this state is a consistent state with a default action. Thus, | |
1557 | detecting the absence of a lookahead is sufficient to determine | |
1558 | that there is no unexpected or expected token to report. In that | |
1559 | case, just report a simple "syntax error". | |
1560 | - Don't assume there isn't a lookahead just because this state is a | |
1561 | consistent state with a default action. There might have been a | |
1562 | previous inconsistent state, consistent state with a non-default | |
1563 | action, or user semantic action that manipulated yychar. | |
723fe7d1 JD |
1564 | In the first two cases, it might appear that the current syntax |
1565 | error should have been detected in the previous state when yy_lac | |
1566 | was invoked. However, at that time, there might have been a | |
1567 | different syntax error that discarded a different initial context | |
1568 | during error recovery, leaving behind the current lookahead. | |
095a1d11 JD |
1569 | */ |
1570 | if (yytoken != YYEMPTY) | |
1571 | { | |
ea13bea8 | 1572 | int yyn = yypact[*yyssp]; |
723fe7d1 | 1573 | YYDPRINTF ((stderr, "Constructing syntax error message\n")); |
095a1d11 JD |
1574 | yyarg[yycount++] = yytname[yytoken]; |
1575 | if (!yypact_value_is_default (yyn)) | |
1576 | { | |
f953cb20 | 1577 | int yyx; |
ea13bea8 | 1578 | |
723fe7d1 JD |
1579 | for (yyx = 0; yyx < YYNTOKENS; ++yyx) |
1580 | if (yyx != YYTERROR && yyx != YYUNDEFTOK) | |
f953cb20 | 1581 | { |
723fe7d1 JD |
1582 | { |
1583 | int yy_lac_status = yy_lac (yyesa, yyes, yyes_capacity, | |
1584 | yyssp, yyx); | |
1585 | if (yy_lac_status == 2) | |
1586 | return 2; | |
1587 | if (yy_lac_status == 1) | |
1588 | continue; | |
1589 | } | |
f953cb20 JD |
1590 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
1591 | { | |
1592 | yycount = 1; | |
1593 | yysize = yysize0; | |
1594 | break; | |
1595 | } | |
1596 | yyarg[yycount++] = yytname[yyx]; | |
9c883a6b | 1597 | yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); |
095a1d11 JD |
1598 | if (! (yysize <= yysize1 |
1599 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1600 | return 2; | |
f953cb20 JD |
1601 | yysize = yysize1; |
1602 | } | |
095a1d11 | 1603 | } |
723fe7d1 JD |
1604 | # if YYDEBUG |
1605 | else if (yydebug) | |
1606 | YYFPRINTF (stderr, "No expected tokens.\n"); | |
1607 | # endif | |
095a1d11 | 1608 | } |
f953cb20 JD |
1609 | |
1610 | switch (yycount) | |
2abdfeef | 1611 | { |
ea13bea8 | 1612 | # define YYCASE_(N, S) \ |
f953cb20 JD |
1613 | case N: \ |
1614 | yyformat = S; \ | |
1615 | break | |
095a1d11 | 1616 | YYCASE_(0, YY_("syntax error")); |
f953cb20 JD |
1617 | YYCASE_(1, YY_("syntax error, unexpected %s")); |
1618 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | |
1619 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | |
1620 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | |
1621 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | |
ea13bea8 | 1622 | # undef YYCASE_ |
f953cb20 | 1623 | } |
69a2ab11 | 1624 | |
f953cb20 JD |
1625 | yysize1 = yysize + yystrlen (yyformat); |
1626 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
095a1d11 | 1627 | return 2; |
f953cb20 JD |
1628 | yysize = yysize1; |
1629 | ||
1630 | if (*yymsg_alloc < yysize) | |
1631 | { | |
1632 | *yymsg_alloc = 2 * yysize; | |
1633 | if (! (yysize <= *yymsg_alloc | |
1634 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) | |
1635 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; | |
095a1d11 | 1636 | return 1; |
f953cb20 JD |
1637 | } |
1638 | ||
1639 | /* Avoid sprintf, as that infringes on the user's name space. | |
1640 | Don't have undefined behavior even if the translation | |
1641 | produced a string with the wrong number of "%s"s. */ | |
1642 | { | |
1643 | char *yyp = *yymsg; | |
1644 | int yyi = 0; | |
1645 | while ((*yyp = *yyformat) != '\0') | |
1646 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | |
69a2ab11 | 1647 | { |
f953cb20 JD |
1648 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
1649 | yyformat += 2; | |
69a2ab11 | 1650 | } |
f953cb20 | 1651 | else |
69a2ab11 | 1652 | { |
f953cb20 JD |
1653 | yyp++; |
1654 | yyformat++; | |
69a2ab11 | 1655 | } |
f953cb20 JD |
1656 | } |
1657 | return 0; | |
1658 | } | |
2abdfeef | 1659 | #endif /* YYERROR_VERBOSE */ |
e9955c83 | 1660 | |
04b6e11e PE |
1661 | /*-----------------------------------------------. |
1662 | | Release the memory associated to this symbol. | | |
1663 | `-----------------------------------------------*/ | |
1664 | ||
7029f892 | 1665 | /*ARGSUSED*/ |
bf8b3d98 PE |
1666 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1667 | || defined __cplusplus || defined _MSC_VER) | |
d33cb3ae | 1668 | static void |
8a8dc872 | 1669 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) |
04b6e11e | 1670 | #else |
d33cb3ae | 1671 | static void |
8a8dc872 AD |
1672 | yydestruct (yymsg, yytype, yyvaluep, yylocationp) |
1673 | const char *yymsg; | |
04b6e11e | 1674 | int yytype; |
886b69d1 AD |
1675 | YYSTYPE *yyvaluep; |
1676 | YYLTYPE *yylocationp; | |
04b6e11e PE |
1677 | #endif |
1678 | { | |
e764d4df PE |
1679 | YYUSE (yyvaluep); |
1680 | YYUSE (yylocationp); | |
04b6e11e | 1681 | |
8a8dc872 AD |
1682 | if (!yymsg) |
1683 | yymsg = "Deleting"; | |
1684 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
1685 | ||
04b6e11e PE |
1686 | switch (yytype) |
1687 | { | |
886b69d1 | 1688 | |
04b6e11e | 1689 | default: |
bf8b3d98 | 1690 | break; |
04b6e11e PE |
1691 | } |
1692 | } | |
04b6e11e | 1693 | |
93d0103d | 1694 | |
e776192e | 1695 | |
e9955c83 | 1696 | |
93d0103d JD |
1697 | /*----------. |
1698 | | yyparse. | | |
1699 | `----------*/ | |
d33cb3ae PE |
1700 | |
1701 | #ifdef YYPARSE_PARAM | |
bf8b3d98 PE |
1702 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1703 | || defined __cplusplus || defined _MSC_VER) | |
2e4c30fa PE |
1704 | int |
1705 | yyparse (void *YYPARSE_PARAM) | |
1706 | #else | |
1707 | int | |
1708 | yyparse (YYPARSE_PARAM) | |
1709 | void *YYPARSE_PARAM; | |
1710 | #endif | |
d33cb3ae | 1711 | #else /* ! YYPARSE_PARAM */ |
bf8b3d98 PE |
1712 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1713 | || defined __cplusplus || defined _MSC_VER) | |
d33cb3ae PE |
1714 | int |
1715 | yyparse (void) | |
1716 | #else | |
e9955c83 | 1717 | int |
d33cb3ae | 1718 | yyparse () |
74e543d2 | 1719 | |
d33cb3ae PE |
1720 | #endif |
1721 | #endif | |
e9955c83 | 1722 | { |
e021811a | 1723 | /* The lookahead symbol. */ |
366eea36 AD |
1724 | int yychar; |
1725 | ||
9bc0dd67 | 1726 | /* The semantic value of the lookahead symbol. */ |
366eea36 AD |
1727 | YYSTYPE yylval; |
1728 | ||
9bc0dd67 | 1729 | /* Location data for the lookahead symbol. */ |
366eea36 | 1730 | YYLTYPE yylloc; |
e9955c83 | 1731 | |
e021811a JD |
1732 | /* Number of syntax errors so far. */ |
1733 | int yynerrs; | |
e9955c83 | 1734 | |
e021811a JD |
1735 | int yystate; |
1736 | /* Number of tokens to shift before error messages enabled. */ | |
1737 | int yyerrstatus; | |
e9955c83 | 1738 | |
e021811a JD |
1739 | /* The stacks and their tools: |
1740 | `yyss': related to states. | |
1741 | `yyvs': related to semantic values. | |
1742 | `yyls': related to locations. | |
e9955c83 | 1743 | |
cbdb6d91 | 1744 | Refer to the stacks through separate pointers, to allow yyoverflow |
e021811a | 1745 | to reallocate them elsewhere. */ |
e9955c83 | 1746 | |
e021811a JD |
1747 | /* The state stack. */ |
1748 | yytype_int16 yyssa[YYINITDEPTH]; | |
1749 | yytype_int16 *yyss; | |
1750 | yytype_int16 *yyssp; | |
e9955c83 | 1751 | |
e021811a JD |
1752 | /* The semantic value stack. */ |
1753 | YYSTYPE yyvsa[YYINITDEPTH]; | |
1754 | YYSTYPE *yyvs; | |
1755 | YYSTYPE *yyvsp; | |
e9955c83 | 1756 | |
e021811a JD |
1757 | /* The location stack. */ |
1758 | YYLTYPE yylsa[YYINITDEPTH]; | |
1759 | YYLTYPE *yyls; | |
1760 | YYLTYPE *yylsp; | |
1761 | ||
1762 | /* The locations where the error started and ended. */ | |
a005dbcb | 1763 | YYLTYPE yyerror_range[3]; |
e9955c83 | 1764 | |
e021811a | 1765 | YYSIZE_T yystacksize; |
e9955c83 | 1766 | |
723fe7d1 JD |
1767 | yytype_int16 yyesa[20]; |
1768 | yytype_int16 *yyes; | |
1769 | YYSIZE_T yyes_capacity; | |
1770 | ||
1771 | int yy_lac_established = 0; | |
e021811a JD |
1772 | int yyn; |
1773 | int yyresult; | |
1774 | /* Lookahead token as an internal (translated) token number. */ | |
1775 | int yytoken; | |
e9955c83 AD |
1776 | /* The variables used to return semantic value and location from the |
1777 | action routines. */ | |
1778 | YYSTYPE yyval; | |
e9955c83 | 1779 | YYLTYPE yyloc; |
e9955c83 | 1780 | |
e021811a JD |
1781 | #if YYERROR_VERBOSE |
1782 | /* Buffer for error messages, and its allocated size. */ | |
1783 | char yymsgbuf[128]; | |
1784 | char *yymsg = yymsgbuf; | |
1785 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
1786 | #endif | |
1787 | ||
1788 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) | |
1789 | ||
3b0ffc7e PE |
1790 | /* The number of symbols on the RHS of the reduced rule. |
1791 | Keep to zero when no symbol should be popped. */ | |
1792 | int yylen = 0; | |
e9955c83 | 1793 | |
e021811a JD |
1794 | yytoken = 0; |
1795 | yyss = yyssa; | |
1796 | yyvs = yyvsa; | |
1797 | yyls = yylsa; | |
e021811a JD |
1798 | yystacksize = YYINITDEPTH; |
1799 | ||
723fe7d1 JD |
1800 | yyes = yyesa; |
1801 | yyes_capacity = sizeof yyesa / sizeof *yyes; | |
1802 | if (YYMAXDEPTH < yyes_capacity) | |
1803 | yyes_capacity = YYMAXDEPTH; | |
1804 | ||
74e543d2 | 1805 | YYDPRINTF ((stderr, "Starting parse\n")); |
e9955c83 AD |
1806 | |
1807 | yystate = 0; | |
1808 | yyerrstatus = 0; | |
1809 | yynerrs = 0; | |
e021811a | 1810 | yychar = YYEMPTY; /* Cause a token to be read. */ |
e9955c83 AD |
1811 | |
1812 | /* Initialize stack pointers. | |
1813 | Waste one element of value and location stack | |
1814 | so that they stay on the same level as the state stack. | |
1815 | The wasted elements are never initialized. */ | |
e9955c83 AD |
1816 | yyssp = yyss; |
1817 | yyvsp = yyvs; | |
e9955c83 | 1818 | yylsp = yyls; |
e021811a | 1819 | |
41d35e54 | 1820 | #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL |
8a8dc872 AD |
1821 | /* Initialize the default location before parsing starts. */ |
1822 | yylloc.first_line = yylloc.last_line = 1; | |
b3d9b5ba | 1823 | yylloc.first_column = yylloc.last_column = 1; |
8a8dc872 AD |
1824 | #endif |
1825 | ||
e021811a | 1826 | /* User initialization code. */ |
cd3684cf | 1827 | |
34d867d7 | 1828 | /* Line 1585 of yacc.c */ |
45aab21d | 1829 | #line 106 "parse-gram.y" |
cd3684cf AD |
1830 | { |
1831 | /* Bison's grammar can initial empty locations, hence a default | |
1832 | location is needed. */ | |
4a678af8 JD |
1833 | boundary_set (&yylloc.start, current_file, 1, 1); |
1834 | boundary_set (&yylloc.end, current_file, 1, 1); | |
cd3684cf | 1835 | } |
136a0f76 | 1836 | |
34d867d7 AD |
1837 | /* Line 1585 of yacc.c */ |
1838 | #line 1839 "parse-gram.c" | |
5f6da1c0 | 1839 | yylsp[0] = yylloc; |
e021811a | 1840 | |
e9955c83 AD |
1841 | goto yysetstate; |
1842 | ||
1843 | /*------------------------------------------------------------. | |
1844 | | yynewstate -- Push a new state, which is found in yystate. | | |
1845 | `------------------------------------------------------------*/ | |
1846 | yynewstate: | |
1847 | /* In all cases, when you get here, the value and location stacks | |
3b0ffc7e | 1848 | have just been pushed. So pushing a state here evens the stacks. */ |
e9955c83 AD |
1849 | yyssp++; |
1850 | ||
1851 | yysetstate: | |
1852 | *yyssp = yystate; | |
1853 | ||
d33cb3ae | 1854 | if (yyss + yystacksize - 1 <= yyssp) |
e9955c83 AD |
1855 | { |
1856 | /* Get the current used size of the three stacks, in elements. */ | |
1857 | YYSIZE_T yysize = yyssp - yyss + 1; | |
1858 | ||
1859 | #ifdef yyoverflow | |
1860 | { | |
3b0ffc7e | 1861 | /* Give user a chance to reallocate the stack. Use copies of |
e9955c83 AD |
1862 | these so that the &'s don't force the real ones into |
1863 | memory. */ | |
1864 | YYSTYPE *yyvs1 = yyvs; | |
bf8b3d98 | 1865 | yytype_int16 *yyss1 = yyss; |
366eea36 | 1866 | YYLTYPE *yyls1 = yyls; |
e9955c83 AD |
1867 | |
1868 | /* Each stack pointer address is followed by the size of the | |
366eea36 AD |
1869 | data in use in that stack, in bytes. This used to be a |
1870 | conditional around just the two extra args, but that might | |
1871 | be undefined if yyoverflow is a macro. */ | |
6088a2a0 | 1872 | yyoverflow (YY_("memory exhausted"), |
e9955c83 AD |
1873 | &yyss1, yysize * sizeof (*yyssp), |
1874 | &yyvs1, yysize * sizeof (*yyvsp), | |
1875 | &yyls1, yysize * sizeof (*yylsp), | |
1876 | &yystacksize); | |
e021811a | 1877 | |
e9955c83 | 1878 | yyls = yyls1; |
e9955c83 AD |
1879 | yyss = yyss1; |
1880 | yyvs = yyvs1; | |
1881 | } | |
1882 | #else /* no yyoverflow */ | |
1883 | # ifndef YYSTACK_RELOCATE | |
6088a2a0 | 1884 | goto yyexhaustedlab; |
e9955c83 AD |
1885 | # else |
1886 | /* Extend the stack our own way. */ | |
d33cb3ae | 1887 | if (YYMAXDEPTH <= yystacksize) |
6088a2a0 | 1888 | goto yyexhaustedlab; |
e9955c83 | 1889 | yystacksize *= 2; |
d33cb3ae | 1890 | if (YYMAXDEPTH < yystacksize) |
e9955c83 AD |
1891 | yystacksize = YYMAXDEPTH; |
1892 | ||
1893 | { | |
bf8b3d98 | 1894 | yytype_int16 *yyss1 = yyss; |
e9955c83 AD |
1895 | union yyalloc *yyptr = |
1896 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
1897 | if (! yyptr) | |
6088a2a0 | 1898 | goto yyexhaustedlab; |
e021811a JD |
1899 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
1900 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); | |
1901 | YYSTACK_RELOCATE (yyls_alloc, yyls); | |
1921f1d7 | 1902 | # undef YYSTACK_RELOCATE |
e9955c83 AD |
1903 | if (yyss1 != yyssa) |
1904 | YYSTACK_FREE (yyss1); | |
1905 | } | |
1906 | # endif | |
1907 | #endif /* no yyoverflow */ | |
1908 | ||
1909 | yyssp = yyss + yysize - 1; | |
1910 | yyvsp = yyvs + yysize - 1; | |
e9955c83 | 1911 | yylsp = yyls + yysize - 1; |
e9955c83 | 1912 | |
6088a2a0 | 1913 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
e9955c83 AD |
1914 | (unsigned long int) yystacksize)); |
1915 | ||
d33cb3ae | 1916 | if (yyss + yystacksize - 1 <= yyssp) |
e9955c83 AD |
1917 | YYABORT; |
1918 | } | |
1919 | ||
6088a2a0 | 1920 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
e9955c83 | 1921 | |
ec5479ce JD |
1922 | if (yystate == YYFINAL) |
1923 | YYACCEPT; | |
1924 | ||
e9955c83 AD |
1925 | goto yybackup; |
1926 | ||
1927 | /*-----------. | |
1928 | | yybackup. | | |
1929 | `-----------*/ | |
1930 | yybackup: | |
1931 | ||
3b0ffc7e | 1932 | /* Do appropriate processing given the current state. Read a |
9bc0dd67 | 1933 | lookahead token if we need one and don't already have one. */ |
e9955c83 | 1934 | |
9bc0dd67 | 1935 | /* First try to decide what to do without reference to lookahead token. */ |
e9955c83 | 1936 | yyn = yypact[yystate]; |
d5eb0826 | 1937 | if (yypact_value_is_default (yyn)) |
e9955c83 AD |
1938 | goto yydefault; |
1939 | ||
9bc0dd67 | 1940 | /* Not known => get a lookahead token if don't already have one. */ |
e9955c83 | 1941 | |
9bc0dd67 | 1942 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
73521d9f | 1943 | if (yychar == YYEMPTY) |
e9955c83 | 1944 | { |
74e543d2 | 1945 | YYDPRINTF ((stderr, "Reading a token: ")); |
e9955c83 AD |
1946 | yychar = YYLEX; |
1947 | } | |
1948 | ||
73521d9f | 1949 | if (yychar <= YYEOF) |
e9955c83 | 1950 | { |
73521d9f | 1951 | yychar = yytoken = YYEOF; |
74e543d2 | 1952 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
e9955c83 AD |
1953 | } |
1954 | else | |
1955 | { | |
73521d9f | 1956 | yytoken = YYTRANSLATE (yychar); |
6088a2a0 | 1957 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
e9955c83 AD |
1958 | } |
1959 | ||
886b69d1 | 1960 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
ae7453f2 | 1961 | detect an error, take that action. */ |
886b69d1 | 1962 | yyn += yytoken; |
219741d8 | 1963 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
723fe7d1 JD |
1964 | { |
1965 | YY_LAC_ESTABLISH; | |
1966 | goto yydefault; | |
1967 | } | |
e9955c83 | 1968 | yyn = yytable[yyn]; |
ae7453f2 | 1969 | if (yyn <= 0) |
e9955c83 | 1970 | { |
d5eb0826 | 1971 | if (yytable_value_is_error (yyn)) |
ea13bea8 | 1972 | goto yyerrlab; |
723fe7d1 | 1973 | YY_LAC_ESTABLISH; |
e9955c83 AD |
1974 | yyn = -yyn; |
1975 | goto yyreduce; | |
1976 | } | |
e9955c83 | 1977 | |
3b0ffc7e PE |
1978 | /* Count tokens shifted since error; after three, turn off error |
1979 | status. */ | |
1980 | if (yyerrstatus) | |
1981 | yyerrstatus--; | |
1982 | ||
9bc0dd67 | 1983 | /* Shift the lookahead token. */ |
6088a2a0 | 1984 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
e9955c83 | 1985 | |
ec5479ce JD |
1986 | /* Discard the shifted token. */ |
1987 | yychar = YYEMPTY; | |
723fe7d1 | 1988 | YY_LAC_DISCARD ("shift"); |
e9955c83 | 1989 | |
3b0ffc7e | 1990 | yystate = yyn; |
e9955c83 | 1991 | *++yyvsp = yylval; |
e9955c83 | 1992 | *++yylsp = yylloc; |
e9955c83 AD |
1993 | goto yynewstate; |
1994 | ||
1995 | ||
1996 | /*-----------------------------------------------------------. | |
1997 | | yydefault -- do the default action for the current state. | | |
1998 | `-----------------------------------------------------------*/ | |
1999 | yydefault: | |
2000 | yyn = yydefact[yystate]; | |
2001 | if (yyn == 0) | |
2002 | goto yyerrlab; | |
2003 | goto yyreduce; | |
2004 | ||
2005 | ||
2006 | /*-----------------------------. | |
2007 | | yyreduce -- Do a reduction. | | |
2008 | `-----------------------------*/ | |
2009 | yyreduce: | |
2010 | /* yyn is the number of a rule to reduce with. */ | |
2011 | yylen = yyr2[yyn]; | |
2012 | ||
2013 | /* If YYLEN is nonzero, implement the default value of the action: | |
2014 | `$$ = $1'. | |
2015 | ||
04b6e11e PE |
2016 | Otherwise, the following line sets YYVAL to garbage. |
2017 | This behavior is undocumented and Bison | |
e9955c83 AD |
2018 | users should not rely upon it. Assigning to YYVAL |
2019 | unconditionally makes the parser a bit smaller, and it avoids a | |
2020 | GCC warning that YYVAL may be used uninitialized. */ | |
2021 | yyval = yyvsp[1-yylen]; | |
2022 | ||
3b0ffc7e | 2023 | /* Default location. */ |
bf8b3d98 | 2024 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
05d18c24 | 2025 | YY_REDUCE_PRINT (yyn); |
723fe7d1 JD |
2026 | { |
2027 | int yychar_backup = yychar; | |
2028 | switch (yyn) | |
2029 | { | |
2030 | case 6: | |
136a0f76 | 2031 | |
34d867d7 | 2032 | /* Line 1801 of yacc.c */ |
45aab21d | 2033 | #line 245 "parse-gram.y" |
7c0c6181 JD |
2034 | { |
2035 | code_props plain_code; | |
2036 | code_props_plain_init (&plain_code, (yyvsp[(1) - (1)].chars), (yylsp[(1) - (1)])); | |
2037 | code_props_translate_code (&plain_code); | |
2038 | gram_scanner_last_string_free (); | |
7ecec4dd JD |
2039 | muscle_code_grow (union_seen ? "post_prologue" : "pre_prologue", |
2040 | plain_code.code, (yylsp[(1) - (1)])); | |
7c0c6181 JD |
2041 | code_scanner_last_string_free (); |
2042 | } | |
1921f1d7 AD |
2043 | break; |
2044 | ||
8efe435c | 2045 | case 7: |
136a0f76 | 2046 | |
34d867d7 | 2047 | /* Line 1801 of yacc.c */ |
45aab21d | 2048 | #line 254 "parse-gram.y" |
9bc0dd67 JD |
2049 | { debug_flag = true; } |
2050 | break; | |
2051 | ||
2cbe6b7f | 2052 | case 8: |
136a0f76 | 2053 | |
34d867d7 | 2054 | /* Line 1801 of yacc.c */ |
45aab21d | 2055 | #line 256 "parse-gram.y" |
7eb8a0bc | 2056 | { |
34d41938 JD |
2057 | muscle_percent_define_insert ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars), |
2058 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
7eb8a0bc | 2059 | } |
1921f1d7 AD |
2060 | break; |
2061 | ||
2cbe6b7f | 2062 | case 9: |
136a0f76 | 2063 | |
34d867d7 | 2064 | /* Line 1801 of yacc.c */ |
45aab21d | 2065 | #line 260 "parse-gram.y" |
2ce4ed68 | 2066 | { defines_flag = true; } |
e9955c83 | 2067 | break; |
1921f1d7 | 2068 | |
2cbe6b7f | 2069 | case 10: |
1921f1d7 | 2070 | |
34d867d7 | 2071 | /* Line 1801 of yacc.c */ |
45aab21d | 2072 | #line 262 "parse-gram.y" |
02975b9a JD |
2073 | { |
2074 | defines_flag = true; | |
2075 | spec_defines_file = xstrdup ((yyvsp[(2) - (2)].chars)); | |
2076 | } | |
e9955c83 | 2077 | break; |
1921f1d7 | 2078 | |
2cbe6b7f | 2079 | case 11: |
136a0f76 | 2080 | |
34d867d7 | 2081 | /* Line 1801 of yacc.c */ |
45aab21d | 2082 | #line 266 "parse-gram.y" |
02975b9a | 2083 | { error_verbose = true; } |
d6328241 PH |
2084 | break; |
2085 | ||
2cbe6b7f | 2086 | case 12: |
136a0f76 | 2087 | |
34d867d7 | 2088 | /* Line 1801 of yacc.c */ |
45aab21d | 2089 | #line 267 "parse-gram.y" |
02975b9a | 2090 | { expected_sr_conflicts = (yyvsp[(2) - (2)].integer); } |
fb9712a9 AD |
2091 | break; |
2092 | ||
2cbe6b7f | 2093 | case 13: |
136a0f76 | 2094 | |
34d867d7 | 2095 | /* Line 1801 of yacc.c */ |
45aab21d | 2096 | #line 268 "parse-gram.y" |
02975b9a | 2097 | { expected_rr_conflicts = (yyvsp[(2) - (2)].integer); } |
34f98f46 JD |
2098 | break; |
2099 | ||
2cbe6b7f | 2100 | case 14: |
136a0f76 | 2101 | |
34d867d7 | 2102 | /* Line 1801 of yacc.c */ |
45aab21d | 2103 | #line 269 "parse-gram.y" |
02975b9a JD |
2104 | { spec_file_prefix = (yyvsp[(2) - (2)].chars); } |
2105 | break; | |
2106 | ||
2107 | case 15: | |
2108 | ||
34d867d7 | 2109 | /* Line 1801 of yacc.c */ |
45aab21d | 2110 | #line 270 "parse-gram.y" |
02975b9a JD |
2111 | { spec_file_prefix = (yyvsp[(3) - (3)].chars); } |
2112 | break; | |
2113 | ||
2114 | case 16: | |
2115 | ||
34d867d7 | 2116 | /* Line 1801 of yacc.c */ |
45aab21d | 2117 | #line 272 "parse-gram.y" |
cd3684cf | 2118 | { |
bf8b3d98 PE |
2119 | nondeterministic_parser = true; |
2120 | glr_parser = true; | |
2121 | } | |
e9955c83 | 2122 | break; |
1921f1d7 | 2123 | |
02975b9a | 2124 | case 17: |
136a0f76 | 2125 | |
34d867d7 | 2126 | /* Line 1801 of yacc.c */ |
45aab21d | 2127 | #line 277 "parse-gram.y" |
cd3684cf | 2128 | { |
7c0c6181 JD |
2129 | code_props action; |
2130 | code_props_symbol_action_init (&action, (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); | |
2131 | code_props_translate_code (&action); | |
2132 | gram_scanner_last_string_free (); | |
2133 | muscle_code_grow ("initial_action", action.code, (yylsp[(2) - (2)])); | |
2134 | code_scanner_last_string_free (); | |
bf8b3d98 | 2135 | } |
e9955c83 | 2136 | break; |
1921f1d7 | 2137 | |
02975b9a | 2138 | case 18: |
136a0f76 | 2139 | |
34d867d7 | 2140 | /* Line 1801 of yacc.c */ |
45aab21d | 2141 | #line 285 "parse-gram.y" |
e186a284 | 2142 | { language_argmatch ((yyvsp[(2) - (2)].chars), grammar_prio, (yylsp[(1) - (2)])); } |
e9955c83 | 2143 | break; |
1921f1d7 | 2144 | |
02975b9a | 2145 | case 19: |
136a0f76 | 2146 | |
34d867d7 | 2147 | /* Line 1801 of yacc.c */ |
45aab21d | 2148 | #line 286 "parse-gram.y" |
5e6feb86 | 2149 | { add_param ("lex_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); } |
e9955c83 | 2150 | break; |
1921f1d7 | 2151 | |
02975b9a | 2152 | case 20: |
136a0f76 | 2153 | |
34d867d7 | 2154 | /* Line 1801 of yacc.c */ |
45aab21d | 2155 | #line 287 "parse-gram.y" |
5e6feb86 | 2156 | { locations_flag = true; } |
02975b9a JD |
2157 | break; |
2158 | ||
2159 | case 21: | |
2160 | ||
34d867d7 | 2161 | /* Line 1801 of yacc.c */ |
45aab21d | 2162 | #line 288 "parse-gram.y" |
5e6feb86 | 2163 | { spec_name_prefix = (yyvsp[(2) - (2)].chars); } |
e9955c83 | 2164 | break; |
1921f1d7 | 2165 | |
02975b9a | 2166 | case 22: |
136a0f76 | 2167 | |
34d867d7 | 2168 | /* Line 1801 of yacc.c */ |
45aab21d | 2169 | #line 289 "parse-gram.y" |
5e6feb86 | 2170 | { spec_name_prefix = (yyvsp[(3) - (3)].chars); } |
4cdb01db | 2171 | break; |
1921f1d7 | 2172 | |
02975b9a | 2173 | case 23: |
136a0f76 | 2174 | |
34d867d7 | 2175 | /* Line 1801 of yacc.c */ |
45aab21d | 2176 | #line 290 "parse-gram.y" |
5e6feb86 | 2177 | { no_lines_flag = true; } |
4cdb01db | 2178 | break; |
1921f1d7 | 2179 | |
02975b9a JD |
2180 | case 24: |
2181 | ||
34d867d7 | 2182 | /* Line 1801 of yacc.c */ |
45aab21d | 2183 | #line 291 "parse-gram.y" |
5e6feb86 | 2184 | { nondeterministic_parser = true; } |
02975b9a JD |
2185 | break; |
2186 | ||
2187 | case 25: | |
136a0f76 | 2188 | |
34d867d7 | 2189 | /* Line 1801 of yacc.c */ |
45aab21d | 2190 | #line 292 "parse-gram.y" |
5e6feb86 | 2191 | { spec_outfile = (yyvsp[(2) - (2)].chars); } |
4cdb01db | 2192 | break; |
1921f1d7 | 2193 | |
02975b9a | 2194 | case 26: |
136a0f76 | 2195 | |
34d867d7 | 2196 | /* Line 1801 of yacc.c */ |
45aab21d | 2197 | #line 293 "parse-gram.y" |
5e6feb86 | 2198 | { spec_outfile = (yyvsp[(3) - (3)].chars); } |
676385e2 PH |
2199 | break; |
2200 | ||
02975b9a | 2201 | case 27: |
136a0f76 | 2202 | |
34d867d7 | 2203 | /* Line 1801 of yacc.c */ |
45aab21d | 2204 | #line 294 "parse-gram.y" |
5e6feb86 | 2205 | { add_param ("parse_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); } |
ae7453f2 AD |
2206 | break; |
2207 | ||
02975b9a | 2208 | case 28: |
136a0f76 | 2209 | |
34d867d7 | 2210 | /* Line 1801 of yacc.c */ |
45aab21d | 2211 | #line 296 "parse-gram.y" |
d9df47b6 JD |
2212 | { |
2213 | /* %pure-parser is deprecated in favor of `%define api.pure', so use | |
2214 | `%define api.pure' in a backward-compatible manner here. First, don't | |
2215 | complain if %pure-parser is specified multiple times. */ | |
2216 | if (!muscle_find_const ("percent_define(api.pure)")) | |
34d41938 JD |
2217 | muscle_percent_define_insert ("api.pure", (yylsp[(1) - (1)]), "", |
2218 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
d9df47b6 JD |
2219 | /* In all cases, use api.pure now so that the backend doesn't complain if |
2220 | the skeleton ignores api.pure, but do warn now if there's a previous | |
2221 | conflicting definition from an actual %define. */ | |
2222 | if (!muscle_percent_define_flag_if ("api.pure")) | |
34d41938 JD |
2223 | muscle_percent_define_insert ("api.pure", (yylsp[(1) - (1)]), "", |
2224 | MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); | |
d9df47b6 | 2225 | } |
ae7453f2 AD |
2226 | break; |
2227 | ||
02975b9a | 2228 | case 29: |
136a0f76 | 2229 | |
34d867d7 | 2230 | /* Line 1801 of yacc.c */ |
45aab21d | 2231 | #line 310 "parse-gram.y" |
7172e23e | 2232 | { version_check (&(yylsp[(2) - (2)]), (yyvsp[(2) - (2)].chars)); } |
b50d2359 AD |
2233 | break; |
2234 | ||
d782395d | 2235 | case 30: |
136a0f76 | 2236 | |
34d867d7 | 2237 | /* Line 1801 of yacc.c */ |
45aab21d | 2238 | #line 312 "parse-gram.y" |
a7867f53 JD |
2239 | { |
2240 | char const *skeleton_user = (yyvsp[(2) - (2)].chars); | |
d143e9c3 | 2241 | if (mbschr (skeleton_user, '/')) |
a7867f53 JD |
2242 | { |
2243 | size_t dir_length = strlen (current_file); | |
2244 | char *skeleton_build; | |
2245 | while (dir_length && current_file[dir_length - 1] != '/') | |
2246 | --dir_length; | |
2247 | while (dir_length && current_file[dir_length - 1] == '/') | |
2248 | --dir_length; | |
2249 | skeleton_build = | |
2250 | xmalloc (dir_length + 1 + strlen (skeleton_user) + 1); | |
2251 | if (dir_length > 0) | |
2252 | { | |
9c883a6b | 2253 | memcpy (skeleton_build, current_file, dir_length); |
a7867f53 JD |
2254 | skeleton_build[dir_length++] = '/'; |
2255 | } | |
2256 | strcpy (skeleton_build + dir_length, skeleton_user); | |
2257 | skeleton_user = uniqstr_new (skeleton_build); | |
2258 | free (skeleton_build); | |
2259 | } | |
e186a284 | 2260 | skeleton_arg (skeleton_user, grammar_prio, (yylsp[(1) - (2)])); |
a7867f53 | 2261 | } |
3fa3725a PE |
2262 | break; |
2263 | ||
d782395d | 2264 | case 31: |
136a0f76 | 2265 | |
34d867d7 | 2266 | /* Line 1801 of yacc.c */ |
45aab21d | 2267 | #line 335 "parse-gram.y" |
7172e23e | 2268 | { token_table_flag = true; } |
5e6feb86 PE |
2269 | break; |
2270 | ||
d782395d | 2271 | case 32: |
5e6feb86 | 2272 | |
34d867d7 | 2273 | /* Line 1801 of yacc.c */ |
45aab21d | 2274 | #line 336 "parse-gram.y" |
ef1b4273 | 2275 | { report_flag |= report_states; } |
7172e23e JD |
2276 | break; |
2277 | ||
d782395d | 2278 | case 33: |
7172e23e | 2279 | |
34d867d7 | 2280 | /* Line 1801 of yacc.c */ |
45aab21d | 2281 | #line 337 "parse-gram.y" |
83a457be | 2282 | { yacc_flag = true; } |
4cdb01db | 2283 | break; |
1921f1d7 | 2284 | |
d782395d | 2285 | case 37: |
136a0f76 | 2286 | |
34d867d7 | 2287 | /* Line 1801 of yacc.c */ |
45aab21d | 2288 | #line 345 "parse-gram.y" |
1921f1d7 | 2289 | { |
66809587 | 2290 | grammar_start_symbol_set ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)])); |
4cdb01db | 2291 | } |
e9955c83 | 2292 | break; |
1921f1d7 | 2293 | |
d782395d | 2294 | case 38: |
136a0f76 | 2295 | |
34d867d7 | 2296 | /* Line 1801 of yacc.c */ |
45aab21d | 2297 | #line 349 "parse-gram.y" |
1921f1d7 | 2298 | { |
05d18c24 | 2299 | symbol_list *list; |
e9071366 | 2300 | for (list = (yyvsp[(3) - (3)].list); list; list = list->next) |
7c0c6181 | 2301 | symbol_list_destructor_set (list, (yyvsp[(2) - (3)].code), (yylsp[(2) - (3)])); |
e9071366 | 2302 | symbol_list_free ((yyvsp[(3) - (3)].list)); |
4cdb01db | 2303 | } |
e9955c83 | 2304 | break; |
1921f1d7 | 2305 | |
d782395d | 2306 | case 39: |
136a0f76 | 2307 | |
34d867d7 | 2308 | /* Line 1801 of yacc.c */ |
45aab21d | 2309 | #line 356 "parse-gram.y" |
1921f1d7 | 2310 | { |
05d18c24 | 2311 | symbol_list *list; |
e9071366 | 2312 | for (list = (yyvsp[(3) - (3)].list); list; list = list->next) |
7c0c6181 | 2313 | symbol_list_printer_set (list, (yyvsp[(2) - (3)].code), (yylsp[(2) - (3)])); |
e9071366 | 2314 | symbol_list_free ((yyvsp[(3) - (3)].list)); |
4cdb01db | 2315 | } |
e9955c83 | 2316 | break; |
1921f1d7 | 2317 | |
d782395d | 2318 | case 40: |
136a0f76 | 2319 | |
34d867d7 | 2320 | /* Line 1801 of yacc.c */ |
45aab21d | 2321 | #line 363 "parse-gram.y" |
92f5e991 | 2322 | { |
66ef8b9d | 2323 | default_prec = true; |
92f5e991 | 2324 | } |
9280d3ef AD |
2325 | break; |
2326 | ||
d782395d | 2327 | case 41: |
136a0f76 | 2328 | |
34d867d7 | 2329 | /* Line 1801 of yacc.c */ |
45aab21d | 2330 | #line 367 "parse-gram.y" |
66ef8b9d PE |
2331 | { |
2332 | default_prec = false; | |
2333 | } | |
92f5e991 AD |
2334 | break; |
2335 | ||
d782395d | 2336 | case 42: |
2cbe6b7f | 2337 | |
34d867d7 | 2338 | /* Line 1801 of yacc.c */ |
45aab21d | 2339 | #line 371 "parse-gram.y" |
8e0a5e9e | 2340 | { |
9611cfa2 JD |
2341 | /* Do not invoke muscle_percent_code_grow here since it invokes |
2342 | muscle_user_name_list_grow. */ | |
592d0b1e | 2343 | muscle_code_grow ("percent_code()", (yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)])); |
8e0a5e9e JD |
2344 | code_scanner_last_string_free (); |
2345 | } | |
2cbe6b7f JD |
2346 | break; |
2347 | ||
d782395d | 2348 | case 43: |
2cbe6b7f | 2349 | |
34d867d7 | 2350 | /* Line 1801 of yacc.c */ |
45aab21d | 2351 | #line 378 "parse-gram.y" |
8e0a5e9e | 2352 | { |
9611cfa2 | 2353 | muscle_percent_code_grow ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)])); |
8e0a5e9e | 2354 | code_scanner_last_string_free (); |
8e0a5e9e | 2355 | } |
58d7a1a1 AD |
2356 | break; |
2357 | ||
d782395d | 2358 | case 44: |
136a0f76 | 2359 | |
34d867d7 | 2360 | /* Line 1801 of yacc.c */ |
45aab21d | 2361 | #line 392 "parse-gram.y" |
2cbe6b7f | 2362 | {} |
66ef8b9d PE |
2363 | break; |
2364 | ||
d782395d | 2365 | case 45: |
136a0f76 | 2366 | |
34d867d7 | 2367 | /* Line 1801 of yacc.c */ |
45aab21d | 2368 | #line 393 "parse-gram.y" |
2cbe6b7f JD |
2369 | { muscle_code_grow ("union_name", (yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } |
2370 | break; | |
2371 | ||
d782395d | 2372 | case 46: |
2cbe6b7f | 2373 | |
34d867d7 | 2374 | /* Line 1801 of yacc.c */ |
45aab21d | 2375 | #line 398 "parse-gram.y" |
9280d3ef | 2376 | { |
1f4cc0f4 | 2377 | union_seen = true; |
7ecec4dd JD |
2378 | muscle_code_grow ("stype", (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)])); |
2379 | code_scanner_last_string_free (); | |
9280d3ef AD |
2380 | } |
2381 | break; | |
2382 | ||
d782395d | 2383 | case 47: |
136a0f76 | 2384 | |
34d867d7 | 2385 | /* Line 1801 of yacc.c */ |
45aab21d | 2386 | #line 409 "parse-gram.y" |
58d7a1a1 | 2387 | { current_class = nterm_sym; } |
366eea36 AD |
2388 | break; |
2389 | ||
d782395d | 2390 | case 48: |
136a0f76 | 2391 | |
34d867d7 | 2392 | /* Line 1801 of yacc.c */ |
45aab21d | 2393 | #line 410 "parse-gram.y" |
366eea36 AD |
2394 | { |
2395 | current_class = unknown_sym; | |
2396 | current_type = NULL; | |
2397 | } | |
2398 | break; | |
2399 | ||
d782395d | 2400 | case 49: |
136a0f76 | 2401 | |
34d867d7 | 2402 | /* Line 1801 of yacc.c */ |
45aab21d | 2403 | #line 414 "parse-gram.y" |
58d7a1a1 AD |
2404 | { current_class = token_sym; } |
2405 | break; | |
2406 | ||
d782395d | 2407 | case 50: |
136a0f76 | 2408 | |
34d867d7 | 2409 | /* Line 1801 of yacc.c */ |
45aab21d | 2410 | #line 415 "parse-gram.y" |
58d7a1a1 AD |
2411 | { |
2412 | current_class = unknown_sym; | |
2413 | current_type = NULL; | |
2414 | } | |
2415 | break; | |
2416 | ||
d782395d | 2417 | case 51: |
136a0f76 | 2418 | |
34d867d7 | 2419 | /* Line 1801 of yacc.c */ |
45aab21d | 2420 | #line 420 "parse-gram.y" |
1e0bab92 | 2421 | { |
05d18c24 | 2422 | symbol_list *list; |
3acc0308 | 2423 | tag_seen = true; |
66809587 | 2424 | for (list = (yyvsp[(3) - (3)].list); list; list = list->next) |
3be03b13 | 2425 | symbol_type_set (list->content.sym, (yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)])); |
66809587 | 2426 | symbol_list_free ((yyvsp[(3) - (3)].list)); |
1e0bab92 | 2427 | } |
e9955c83 | 2428 | break; |
1921f1d7 | 2429 | |
d782395d | 2430 | case 52: |
136a0f76 | 2431 | |
34d867d7 | 2432 | /* Line 1801 of yacc.c */ |
45aab21d | 2433 | #line 431 "parse-gram.y" |
1921f1d7 | 2434 | { |
05d18c24 | 2435 | symbol_list *list; |
1e0bab92 | 2436 | ++current_prec; |
66809587 | 2437 | for (list = (yyvsp[(3) - (3)].list); list; list = list->next) |
1e0bab92 | 2438 | { |
3be03b13 JD |
2439 | symbol_type_set (list->content.sym, current_type, (yylsp[(2) - (3)])); |
2440 | symbol_precedence_set (list->content.sym, current_prec, (yyvsp[(1) - (3)].assoc), (yylsp[(1) - (3)])); | |
1e0bab92 | 2441 | } |
66809587 | 2442 | symbol_list_free ((yyvsp[(3) - (3)].list)); |
2c569025 AD |
2443 | current_type = NULL; |
2444 | } | |
e9955c83 | 2445 | break; |
1921f1d7 | 2446 | |
d782395d | 2447 | case 53: |
136a0f76 | 2448 | |
34d867d7 | 2449 | /* Line 1801 of yacc.c */ |
45aab21d | 2450 | #line 445 "parse-gram.y" |
76dcf299 | 2451 | { (yyval.assoc) = left_assoc; } |
e9955c83 | 2452 | break; |
1921f1d7 | 2453 | |
d782395d | 2454 | case 54: |
136a0f76 | 2455 | |
34d867d7 | 2456 | /* Line 1801 of yacc.c */ |
45aab21d | 2457 | #line 446 "parse-gram.y" |
76dcf299 | 2458 | { (yyval.assoc) = right_assoc; } |
e9955c83 | 2459 | break; |
1921f1d7 | 2460 | |
d782395d | 2461 | case 55: |
136a0f76 | 2462 | |
34d867d7 | 2463 | /* Line 1801 of yacc.c */ |
45aab21d | 2464 | #line 447 "parse-gram.y" |
76dcf299 | 2465 | { (yyval.assoc) = non_assoc; } |
4cdb01db | 2466 | break; |
1921f1d7 | 2467 | |
d782395d | 2468 | case 56: |
136a0f76 | 2469 | |
34d867d7 | 2470 | /* Line 1801 of yacc.c */ |
45aab21d | 2471 | #line 451 "parse-gram.y" |
62ddaef6 | 2472 | { current_type = NULL; } |
e9955c83 | 2473 | break; |
1921f1d7 | 2474 | |
d782395d | 2475 | case 57: |
136a0f76 | 2476 | |
34d867d7 | 2477 | /* Line 1801 of yacc.c */ |
45aab21d | 2478 | #line 452 "parse-gram.y" |
1f4cc0f4 | 2479 | { current_type = (yyvsp[(1) - (1)].uniqstr); tag_seen = true; } |
e9955c83 | 2480 | break; |
1921f1d7 | 2481 | |
d782395d | 2482 | case 58: |
136a0f76 | 2483 | |
34d867d7 | 2484 | /* Line 1801 of yacc.c */ |
45aab21d | 2485 | #line 458 "parse-gram.y" |
3be03b13 JD |
2486 | { (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); } |
2487 | break; | |
2488 | ||
d782395d | 2489 | case 59: |
136a0f76 | 2490 | |
34d867d7 | 2491 | /* Line 1801 of yacc.c */ |
45aab21d | 2492 | #line 460 "parse-gram.y" |
3be03b13 JD |
2493 | { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); } |
2494 | break; | |
2495 | ||
d782395d | 2496 | case 60: |
136a0f76 | 2497 | |
34d867d7 | 2498 | /* Line 1801 of yacc.c */ |
45aab21d | 2499 | #line 464 "parse-gram.y" |
ab7f29f8 | 2500 | { (yyval.symbol) = (yyvsp[(1) - (1)].symbol); } |
4cdb01db | 2501 | break; |
1921f1d7 | 2502 | |
d782395d | 2503 | case 61: |
136a0f76 | 2504 | |
34d867d7 | 2505 | /* Line 1801 of yacc.c */ |
45aab21d | 2506 | #line 465 "parse-gram.y" |
ab7f29f8 | 2507 | { (yyval.symbol) = (yyvsp[(1) - (2)].symbol); symbol_user_token_number_set ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].integer), (yylsp[(2) - (2)])); } |
4cdb01db | 2508 | break; |
1921f1d7 | 2509 | |
d782395d | 2510 | case 62: |
136a0f76 | 2511 | |
34d867d7 | 2512 | /* Line 1801 of yacc.c */ |
45aab21d | 2513 | #line 471 "parse-gram.y" |
3be03b13 JD |
2514 | { (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); } |
2515 | break; | |
2516 | ||
d782395d | 2517 | case 63: |
136a0f76 | 2518 | |
34d867d7 | 2519 | /* Line 1801 of yacc.c */ |
45aab21d | 2520 | #line 473 "parse-gram.y" |
ab7f29f8 | 2521 | { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); } |
3be03b13 JD |
2522 | break; |
2523 | ||
d782395d | 2524 | case 64: |
136a0f76 | 2525 | |
34d867d7 | 2526 | /* Line 1801 of yacc.c */ |
45aab21d | 2527 | #line 477 "parse-gram.y" |
ab7f29f8 | 2528 | { (yyval.list) = (yyvsp[(1) - (1)].list); } |
3be03b13 JD |
2529 | break; |
2530 | ||
d782395d | 2531 | case 65: |
136a0f76 | 2532 | |
34d867d7 | 2533 | /* Line 1801 of yacc.c */ |
45aab21d | 2534 | #line 478 "parse-gram.y" |
ab7f29f8 | 2535 | { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list)); } |
12e35840 JD |
2536 | break; |
2537 | ||
d782395d | 2538 | case 66: |
12e35840 | 2539 | |
34d867d7 | 2540 | /* Line 1801 of yacc.c */ |
45aab21d | 2541 | #line 482 "parse-gram.y" |
ab7f29f8 JD |
2542 | { (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); } |
2543 | break; | |
2544 | ||
2545 | case 67: | |
2546 | ||
34d867d7 | 2547 | /* Line 1801 of yacc.c */ |
45aab21d | 2548 | #line 483 "parse-gram.y" |
ab7f29f8 JD |
2549 | { (yyval.list) = symbol_list_type_new ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } |
2550 | break; | |
2551 | ||
2552 | case 68: | |
2553 | ||
34d867d7 | 2554 | /* Line 1801 of yacc.c */ |
45aab21d | 2555 | #line 484 "parse-gram.y" |
ab7f29f8 JD |
2556 | { (yyval.list) = symbol_list_default_tagged_new ((yylsp[(1) - (1)])); } |
2557 | break; | |
2558 | ||
2559 | case 69: | |
2560 | ||
34d867d7 | 2561 | /* Line 1801 of yacc.c */ |
45aab21d | 2562 | #line 485 "parse-gram.y" |
ab7f29f8 JD |
2563 | { (yyval.list) = symbol_list_default_tagless_new ((yylsp[(1) - (1)])); } |
2564 | break; | |
2565 | ||
2566 | case 70: | |
2567 | ||
34d867d7 | 2568 | /* Line 1801 of yacc.c */ |
45aab21d | 2569 | #line 491 "parse-gram.y" |
1921f1d7 | 2570 | { |
66809587 | 2571 | current_type = (yyvsp[(1) - (1)].uniqstr); |
1f4cc0f4 | 2572 | tag_seen = true; |
4cdb01db | 2573 | } |
e9955c83 | 2574 | break; |
1921f1d7 | 2575 | |
ab7f29f8 | 2576 | case 71: |
136a0f76 | 2577 | |
34d867d7 | 2578 | /* Line 1801 of yacc.c */ |
45aab21d | 2579 | #line 496 "parse-gram.y" |
1921f1d7 | 2580 | { |
f52b276c | 2581 | symbol_class_set ((yyvsp[(1) - (1)].symbol), current_class, (yylsp[(1) - (1)]), true); |
66809587 | 2582 | symbol_type_set ((yyvsp[(1) - (1)].symbol), current_type, (yylsp[(1) - (1)])); |
4cdb01db | 2583 | } |
e9955c83 | 2584 | break; |
1921f1d7 | 2585 | |
ab7f29f8 | 2586 | case 72: |
136a0f76 | 2587 | |
34d867d7 | 2588 | /* Line 1801 of yacc.c */ |
45aab21d | 2589 | #line 501 "parse-gram.y" |
1921f1d7 | 2590 | { |
f52b276c | 2591 | symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true); |
66809587 PE |
2592 | symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)])); |
2593 | symbol_user_token_number_set ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].integer), (yylsp[(2) - (2)])); | |
4cdb01db | 2594 | } |
e9955c83 | 2595 | break; |
1921f1d7 | 2596 | |
ab7f29f8 | 2597 | case 73: |
136a0f76 | 2598 | |
34d867d7 | 2599 | /* Line 1801 of yacc.c */ |
45aab21d | 2600 | #line 507 "parse-gram.y" |
1921f1d7 | 2601 | { |
f52b276c | 2602 | symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true); |
66809587 PE |
2603 | symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)])); |
2604 | symbol_make_alias ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].symbol), (yyloc)); | |
4cdb01db | 2605 | } |
e9955c83 | 2606 | break; |
1921f1d7 | 2607 | |
ab7f29f8 | 2608 | case 74: |
136a0f76 | 2609 | |
34d867d7 | 2610 | /* Line 1801 of yacc.c */ |
45aab21d | 2611 | #line 513 "parse-gram.y" |
1921f1d7 | 2612 | { |
f52b276c | 2613 | symbol_class_set ((yyvsp[(1) - (3)].symbol), current_class, (yylsp[(1) - (3)]), true); |
66809587 PE |
2614 | symbol_type_set ((yyvsp[(1) - (3)].symbol), current_type, (yylsp[(1) - (3)])); |
2615 | symbol_user_token_number_set ((yyvsp[(1) - (3)].symbol), (yyvsp[(2) - (3)].integer), (yylsp[(2) - (3)])); | |
2616 | symbol_make_alias ((yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol), (yyloc)); | |
4cdb01db | 2617 | } |
e9955c83 | 2618 | break; |
1921f1d7 | 2619 | |
ab7f29f8 | 2620 | case 81: |
136a0f76 | 2621 | |
34d867d7 | 2622 | /* Line 1801 of yacc.c */ |
45aab21d | 2623 | #line 543 "parse-gram.y" |
b275314e AD |
2624 | { |
2625 | yyerrok; | |
2626 | } | |
e9955c83 | 2627 | break; |
1921f1d7 | 2628 | |
ab7f29f8 | 2629 | case 82: |
136a0f76 | 2630 | |
34d867d7 | 2631 | /* Line 1801 of yacc.c */ |
45aab21d | 2632 | #line 549 "parse-gram.y" |
49e8e901 JD |
2633 | { current_lhs ((yyvsp[(1) - (2)].symbol), (yylsp[(1) - (2)]), (yyvsp[(2) - (2)].named_ref)); } |
2634 | break; | |
2635 | ||
2636 | case 83: | |
2637 | ||
34d867d7 | 2638 | /* Line 1801 of yacc.c */ |
45aab21d | 2639 | #line 550 "parse-gram.y" |
49e8e901 JD |
2640 | { |
2641 | /* Free the current lhs. */ | |
2642 | current_lhs (0, (yylsp[(1) - (4)]), 0); | |
2643 | } | |
e9955c83 | 2644 | break; |
1921f1d7 | 2645 | |
ab7f29f8 | 2646 | case 84: |
136a0f76 | 2647 | |
34d867d7 | 2648 | /* Line 1801 of yacc.c */ |
45aab21d | 2649 | #line 557 "parse-gram.y" |
8f3596a6 | 2650 | { grammar_current_rule_end ((yylsp[(1) - (1)])); } |
4cdb01db | 2651 | break; |
1921f1d7 | 2652 | |
ab7f29f8 | 2653 | case 85: |
136a0f76 | 2654 | |
34d867d7 | 2655 | /* Line 1801 of yacc.c */ |
45aab21d | 2656 | #line 558 "parse-gram.y" |
8f3596a6 | 2657 | { grammar_current_rule_end ((yylsp[(3) - (3)])); } |
e9955c83 | 2658 | break; |
1921f1d7 | 2659 | |
ab7f29f8 | 2660 | case 87: |
136a0f76 | 2661 | |
34d867d7 | 2662 | /* Line 1801 of yacc.c */ |
45aab21d | 2663 | #line 564 "parse-gram.y" |
49e8e901 | 2664 | { grammar_current_rule_begin (current_lhs_symbol, current_lhs_location, |
0210a4bf | 2665 | current_lhs_named_ref); } |
e9071366 AD |
2666 | break; |
2667 | ||
ab7f29f8 | 2668 | case 88: |
136a0f76 | 2669 | |
34d867d7 | 2670 | /* Line 1801 of yacc.c */ |
45aab21d | 2671 | #line 567 "parse-gram.y" |
0210a4bf | 2672 | { grammar_current_rule_symbol_append ((yyvsp[(2) - (3)].symbol), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].named_ref)); } |
676385e2 PH |
2673 | break; |
2674 | ||
ab7f29f8 | 2675 | case 89: |
136a0f76 | 2676 | |
34d867d7 | 2677 | /* Line 1801 of yacc.c */ |
45aab21d | 2678 | #line 569 "parse-gram.y" |
0210a4bf | 2679 | { grammar_current_rule_action_append ((yyvsp[(2) - (3)].code), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].named_ref)); } |
676385e2 PH |
2680 | break; |
2681 | ||
ab7f29f8 | 2682 | case 90: |
136a0f76 | 2683 | |
34d867d7 | 2684 | /* Line 1801 of yacc.c */ |
45aab21d | 2685 | #line 571 "parse-gram.y" |
5e6feb86 | 2686 | { grammar_current_rule_prec_set ((yyvsp[(3) - (3)].symbol), (yylsp[(3) - (3)])); } |
3fa3725a PE |
2687 | break; |
2688 | ||
ab7f29f8 | 2689 | case 91: |
136a0f76 | 2690 | |
34d867d7 | 2691 | /* Line 1801 of yacc.c */ |
45aab21d | 2692 | #line 573 "parse-gram.y" |
5e6feb86 PE |
2693 | { grammar_current_rule_dprec_set ((yyvsp[(3) - (3)].integer), (yylsp[(3) - (3)])); } |
2694 | break; | |
2695 | ||
ab7f29f8 | 2696 | case 92: |
5e6feb86 | 2697 | |
34d867d7 | 2698 | /* Line 1801 of yacc.c */ |
45aab21d | 2699 | #line 575 "parse-gram.y" |
66809587 | 2700 | { grammar_current_rule_merge_set ((yyvsp[(3) - (3)].uniqstr), (yylsp[(3) - (3)])); } |
b275314e AD |
2701 | break; |
2702 | ||
0210a4bf | 2703 | case 93: |
136a0f76 | 2704 | |
34d867d7 | 2705 | /* Line 1801 of yacc.c */ |
45aab21d | 2706 | #line 579 "parse-gram.y" |
0210a4bf AR |
2707 | { (yyval.named_ref) = 0; } |
2708 | break; | |
2709 | ||
2710 | case 94: | |
2711 | ||
34d867d7 | 2712 | /* Line 1801 of yacc.c */ |
45aab21d | 2713 | #line 581 "parse-gram.y" |
0210a4bf AR |
2714 | { (yyval.named_ref) = named_ref_new((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } |
2715 | break; | |
2716 | ||
2717 | case 96: | |
2718 | ||
34d867d7 | 2719 | /* Line 1801 of yacc.c */ |
45aab21d | 2720 | #line 593 "parse-gram.y" |
16dc6a9e JD |
2721 | { (yyval.uniqstr) = uniqstr_new ((yyvsp[(1) - (1)].chars)); } |
2722 | break; | |
2723 | ||
0210a4bf | 2724 | case 97: |
16dc6a9e | 2725 | |
34d867d7 | 2726 | /* Line 1801 of yacc.c */ |
45aab21d | 2727 | #line 598 "parse-gram.y" |
663ce7bb | 2728 | { (yyval.chars) = ""; } |
2ce4ed68 AD |
2729 | break; |
2730 | ||
f37495f6 JD |
2731 | case 98: |
2732 | ||
34d867d7 | 2733 | /* Line 1801 of yacc.c */ |
45aab21d | 2734 | #line 599 "parse-gram.y" |
f37495f6 JD |
2735 | { (yyval.chars) = (yyvsp[(1) - (1)].uniqstr); } |
2736 | break; | |
2737 | ||
2738 | case 100: | |
136a0f76 | 2739 | |
34d867d7 | 2740 | /* Line 1801 of yacc.c */ |
45aab21d | 2741 | #line 610 "parse-gram.y" |
2ce4ed68 | 2742 | { |
7c0c6181 | 2743 | code_props plain_code; |
ff8d8df2 | 2744 | (yyvsp[(1) - (1)].code)[strlen ((yyvsp[(1) - (1)].code)) - 1] = '\n'; |
7c0c6181 JD |
2745 | code_props_plain_init (&plain_code, (yyvsp[(1) - (1)].code)+1, (yylsp[(1) - (1)])); |
2746 | code_props_translate_code (&plain_code); | |
2747 | gram_scanner_last_string_free (); | |
2748 | (yyval.chars) = plain_code.code; | |
2ce4ed68 AD |
2749 | } |
2750 | break; | |
2751 | ||
f37495f6 | 2752 | case 101: |
136a0f76 | 2753 | |
34d867d7 | 2754 | /* Line 1801 of yacc.c */ |
45aab21d | 2755 | #line 630 "parse-gram.y" |
203b9274 | 2756 | { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } |
916708d5 AD |
2757 | break; |
2758 | ||
f37495f6 | 2759 | case 102: |
136a0f76 | 2760 | |
34d867d7 | 2761 | /* Line 1801 of yacc.c */ |
45aab21d | 2762 | #line 632 "parse-gram.y" |
d2a1a60a PE |
2763 | { |
2764 | (yyval.symbol) = symbol_get (char_name ((yyvsp[(1) - (1)].character)), (yylsp[(1) - (1)])); | |
2765 | symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false); | |
2766 | symbol_user_token_number_set ((yyval.symbol), (yyvsp[(1) - (1)].character), (yylsp[(1) - (1)])); | |
2767 | } | |
66ef8b9d PE |
2768 | break; |
2769 | ||
f37495f6 | 2770 | case 103: |
136a0f76 | 2771 | |
34d867d7 | 2772 | /* Line 1801 of yacc.c */ |
45aab21d | 2773 | #line 640 "parse-gram.y" |
203b9274 | 2774 | { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); } |
58d7a1a1 AD |
2775 | break; |
2776 | ||
f37495f6 | 2777 | case 106: |
136a0f76 | 2778 | |
34d867d7 | 2779 | /* Line 1801 of yacc.c */ |
45aab21d | 2780 | #line 652 "parse-gram.y" |
1921f1d7 | 2781 | { |
66809587 | 2782 | (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[(1) - (1)].chars)), (yylsp[(1) - (1)])); |
db89d400 | 2783 | symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false); |
4cdb01db | 2784 | } |
e9955c83 | 2785 | break; |
1921f1d7 | 2786 | |
f37495f6 | 2787 | case 108: |
136a0f76 | 2788 | |
34d867d7 | 2789 | /* Line 1801 of yacc.c */ |
45aab21d | 2790 | #line 661 "parse-gram.y" |
1921f1d7 | 2791 | { |
7c0c6181 JD |
2792 | code_props plain_code; |
2793 | code_props_plain_init (&plain_code, (yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)])); | |
2794 | code_props_translate_code (&plain_code); | |
e9071366 | 2795 | gram_scanner_last_string_free (); |
7c0c6181 JD |
2796 | muscle_code_grow ("epilogue", plain_code.code, (yylsp[(2) - (2)])); |
2797 | code_scanner_last_string_free (); | |
4cdb01db | 2798 | } |
e9955c83 AD |
2799 | break; |
2800 | ||
2801 | ||
136a0f76 | 2802 | |
34d867d7 AD |
2803 | /* Line 1801 of yacc.c */ |
2804 | #line 2805 "parse-gram.c" | |
723fe7d1 JD |
2805 | default: break; |
2806 | } | |
2807 | if (yychar_backup != yychar) | |
2808 | YY_LAC_DISCARD ("yychar change"); | |
2809 | } | |
abcc7c03 JD |
2810 | /* User semantic actions sometimes alter yychar, and that requires |
2811 | that yytoken be updated with the new translation. We take the | |
2812 | approach of translating immediately before every use of yytoken. | |
2813 | One alternative is translating here after every semantic action, | |
2814 | but that translation would be missed if the semantic action invokes | |
2815 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or | |
2816 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an | |
2817 | incorrect destructor might then be invoked immediately. In the | |
2818 | case of YYERROR or YYBACKUP, subsequent parser actions might lead | |
2819 | to an incorrect destructor call or verbose syntax error message | |
2820 | before the lookahead is translated. */ | |
66809587 | 2821 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
1921f1d7 | 2822 | |
3b0ffc7e PE |
2823 | YYPOPSTACK (yylen); |
2824 | yylen = 0; | |
05d18c24 | 2825 | YY_STACK_PRINT (yyss, yyssp); |
e9955c83 AD |
2826 | |
2827 | *++yyvsp = yyval; | |
e9955c83 | 2828 | *++yylsp = yyloc; |
e9955c83 AD |
2829 | |
2830 | /* Now `shift' the result of the reduction. Determine what state | |
2831 | that goes to, based on the state we popped back to and the rule | |
2832 | number reduced by. */ | |
2833 | ||
2834 | yyn = yyr1[yyn]; | |
2835 | ||
1921f1d7 | 2836 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
219741d8 | 2837 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
e9955c83 AD |
2838 | yystate = yytable[yystate]; |
2839 | else | |
1921f1d7 | 2840 | yystate = yydefgoto[yyn - YYNTOKENS]; |
e9955c83 AD |
2841 | |
2842 | goto yynewstate; | |
2843 | ||
2844 | ||
2845 | /*------------------------------------. | |
2846 | | yyerrlab -- here on detecting error | | |
2847 | `------------------------------------*/ | |
2848 | yyerrlab: | |
abcc7c03 JD |
2849 | /* Make sure we have latest lookahead translation. See comments at |
2850 | user semantic actions for why this is necessary. */ | |
095a1d11 | 2851 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
abcc7c03 | 2852 | |
e9955c83 AD |
2853 | /* If not already recovering from an error, report this error. */ |
2854 | if (!yyerrstatus) | |
2855 | { | |
2856 | ++yynerrs; | |
2abdfeef PE |
2857 | #if ! YYERROR_VERBOSE |
2858 | yyerror (YY_("syntax error")); | |
2859 | #else | |
723fe7d1 JD |
2860 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
2861 | yyesa, &yyes, &yyes_capacity, \ | |
2862 | yyssp, yytoken) | |
f953cb20 JD |
2863 | { |
2864 | char const *yymsgp = YY_("syntax error"); | |
ea13bea8 | 2865 | int yysyntax_error_status; |
723fe7d1 JD |
2866 | if (yychar != YYEMPTY) |
2867 | YY_LAC_ESTABLISH; | |
ea13bea8 | 2868 | yysyntax_error_status = YYSYNTAX_ERROR; |
f953cb20 JD |
2869 | if (yysyntax_error_status == 0) |
2870 | yymsgp = yymsg; | |
095a1d11 | 2871 | else if (yysyntax_error_status == 1) |
f953cb20 JD |
2872 | { |
2873 | if (yymsg != yymsgbuf) | |
2874 | YYSTACK_FREE (yymsg); | |
2875 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); | |
2876 | if (!yymsg) | |
2877 | { | |
2878 | yymsg = yymsgbuf; | |
2879 | yymsg_alloc = sizeof yymsgbuf; | |
095a1d11 | 2880 | yysyntax_error_status = 2; |
f953cb20 JD |
2881 | } |
2882 | else | |
2883 | { | |
2884 | yysyntax_error_status = YYSYNTAX_ERROR; | |
2885 | yymsgp = yymsg; | |
2886 | } | |
2887 | } | |
2888 | yyerror (yymsgp); | |
2889 | if (yysyntax_error_status == 2) | |
2890 | goto yyexhaustedlab; | |
2891 | } | |
2892 | # undef YYSYNTAX_ERROR | |
2abdfeef | 2893 | #endif |
e9955c83 | 2894 | } |
e9955c83 | 2895 | |
a005dbcb | 2896 | yyerror_range[1] = yylloc; |
78a00b7d | 2897 | |
e9955c83 AD |
2898 | if (yyerrstatus == 3) |
2899 | { | |
9bc0dd67 | 2900 | /* If just tried and failed to reuse lookahead token after an |
e9955c83 AD |
2901 | error, discard it. */ |
2902 | ||
465b4444 | 2903 | if (yychar <= YYEOF) |
bf8b3d98 | 2904 | { |
d11e0cfa | 2905 | /* Return failure if at end of input. */ |
465b4444 | 2906 | if (yychar == YYEOF) |
7768896a | 2907 | YYABORT; |
bf8b3d98 | 2908 | } |
465b4444 PE |
2909 | else |
2910 | { | |
4b367315 | 2911 | yydestruct ("Error: discarding", |
bf8b3d98 | 2912 | yytoken, &yylval, &yylloc); |
465b4444 | 2913 | yychar = YYEMPTY; |
465b4444 | 2914 | } |
e9955c83 AD |
2915 | } |
2916 | ||
9bc0dd67 | 2917 | /* Else will try to reuse lookahead token after shifting the error |
e9955c83 | 2918 | token. */ |
6d5aa694 | 2919 | goto yyerrlab1; |
e9955c83 | 2920 | |
05d18c24 | 2921 | |
465b4444 PE |
2922 | /*---------------------------------------------------. |
2923 | | yyerrorlab -- error raised explicitly by YYERROR. | | |
2924 | `---------------------------------------------------*/ | |
2925 | yyerrorlab: | |
2926 | ||
e1054895 PE |
2927 | /* Pacify compilers like GCC when the user code never invokes |
2928 | YYERROR and the label yyerrorlab therefore never appears in user | |
2929 | code. */ | |
e764d4df | 2930 | if (/*CONSTCOND*/ 0) |
465b4444 | 2931 | goto yyerrorlab; |
465b4444 | 2932 | |
a005dbcb | 2933 | yyerror_range[1] = yylsp[1-yylen]; |
3b0ffc7e PE |
2934 | /* Do not reclaim the symbols of the rule which action triggered |
2935 | this YYERROR. */ | |
2936 | YYPOPSTACK (yylen); | |
2937 | yylen = 0; | |
2938 | YY_STACK_PRINT (yyss, yyssp); | |
465b4444 | 2939 | yystate = *yyssp; |
465b4444 PE |
2940 | goto yyerrlab1; |
2941 | ||
2942 | ||
2943 | /*-------------------------------------------------------------. | |
2944 | | yyerrlab1 -- common code for both syntax error and YYERROR. | | |
2945 | `-------------------------------------------------------------*/ | |
05d18c24 | 2946 | yyerrlab1: |
1921f1d7 | 2947 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
e9955c83 | 2948 | |
1921f1d7 AD |
2949 | for (;;) |
2950 | { | |
2951 | yyn = yypact[yystate]; | |
d5eb0826 | 2952 | if (!yypact_value_is_default (yyn)) |
1921f1d7 AD |
2953 | { |
2954 | yyn += YYTERROR; | |
2955 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
2956 | { | |
2957 | yyn = yytable[yyn]; | |
2958 | if (0 < yyn) | |
2959 | break; | |
2960 | } | |
2961 | } | |
4cdb01db | 2962 | |
1921f1d7 AD |
2963 | /* Pop the current state because it cannot handle the error token. */ |
2964 | if (yyssp == yyss) | |
2965 | YYABORT; | |
0c15323d | 2966 | |
a005dbcb | 2967 | yyerror_range[1] = *yylsp; |
4b367315 | 2968 | yydestruct ("Error: popping", |
bf8b3d98 | 2969 | yystos[yystate], yyvsp, yylsp); |
3b0ffc7e | 2970 | YYPOPSTACK (1); |
465b4444 | 2971 | yystate = *yyssp; |
05d18c24 | 2972 | YY_STACK_PRINT (yyss, yyssp); |
e9955c83 AD |
2973 | } |
2974 | ||
723fe7d1 JD |
2975 | /* If the stack popping above didn't lose the initial context for the |
2976 | current lookahead token, the shift below will for sure. */ | |
2977 | YY_LAC_DISCARD ("error recovery"); | |
2978 | ||
e9955c83 | 2979 | *++yyvsp = yylval; |
8a8dc872 | 2980 | |
a005dbcb | 2981 | yyerror_range[2] = yylloc; |
8a8dc872 | 2982 | /* Using YYLLOC is tempting, but would change the location of |
9bc0dd67 | 2983 | the lookahead. YYLOC is available though. */ |
a005dbcb | 2984 | YYLLOC_DEFAULT (yyloc, yyerror_range, 2); |
78a00b7d | 2985 | *++yylsp = yyloc; |
e9955c83 | 2986 | |
3b0ffc7e | 2987 | /* Shift the error token. */ |
6088a2a0 | 2988 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
8a8dc872 | 2989 | |
e9955c83 AD |
2990 | yystate = yyn; |
2991 | goto yynewstate; | |
2992 | ||
2993 | ||
2994 | /*-------------------------------------. | |
2995 | | yyacceptlab -- YYACCEPT comes here. | | |
2996 | `-------------------------------------*/ | |
2997 | yyacceptlab: | |
2998 | yyresult = 0; | |
2999 | goto yyreturn; | |
3000 | ||
3001 | /*-----------------------------------. | |
3002 | | yyabortlab -- YYABORT comes here. | | |
3003 | `-----------------------------------*/ | |
3004 | yyabortlab: | |
3005 | yyresult = 1; | |
3006 | goto yyreturn; | |
3007 | ||
723fe7d1 | 3008 | #if 1 |
6088a2a0 PE |
3009 | /*-------------------------------------------------. |
3010 | | yyexhaustedlab -- memory exhaustion comes here. | | |
3011 | `-------------------------------------------------*/ | |
3012 | yyexhaustedlab: | |
3013 | yyerror (YY_("memory exhausted")); | |
e9955c83 AD |
3014 | yyresult = 2; |
3015 | /* Fall through. */ | |
366eea36 | 3016 | #endif |
e9955c83 AD |
3017 | |
3018 | yyreturn: | |
ec5479ce | 3019 | if (yychar != YYEMPTY) |
abcc7c03 JD |
3020 | { |
3021 | /* Make sure we have latest lookahead translation. See comments at | |
3022 | user semantic actions for why this is necessary. */ | |
3023 | yytoken = YYTRANSLATE (yychar); | |
3024 | yydestruct ("Cleanup: discarding lookahead", | |
3025 | yytoken, &yylval, &yylloc); | |
3026 | } | |
3b0ffc7e PE |
3027 | /* Do not reclaim the symbols of the rule which action triggered |
3028 | this YYABORT or YYACCEPT. */ | |
3029 | YYPOPSTACK (yylen); | |
3030 | YY_STACK_PRINT (yyss, yyssp); | |
d11e0cfa PE |
3031 | while (yyssp != yyss) |
3032 | { | |
ec5d1a8a | 3033 | yydestruct ("Cleanup: popping", |
d11e0cfa | 3034 | yystos[*yyssp], yyvsp, yylsp); |
3b0ffc7e | 3035 | YYPOPSTACK (1); |
d11e0cfa | 3036 | } |
e9955c83 AD |
3037 | #ifndef yyoverflow |
3038 | if (yyss != yyssa) | |
3039 | YYSTACK_FREE (yyss); | |
2abdfeef | 3040 | #endif |
723fe7d1 JD |
3041 | if (yyes != yyesa) |
3042 | YYSTACK_FREE (yyes); | |
2abdfeef PE |
3043 | #if YYERROR_VERBOSE |
3044 | if (yymsg != yymsgbuf) | |
3045 | YYSTACK_FREE (yymsg); | |
e9955c83 | 3046 | #endif |
d2a1a60a PE |
3047 | /* Make sure YYID is used. */ |
3048 | return YYID (yyresult); | |
e9955c83 | 3049 | } |
1921f1d7 | 3050 | |
366eea36 | 3051 | |
136a0f76 | 3052 | |
34d867d7 | 3053 | /* Line 2062 of yacc.c */ |
45aab21d | 3054 | #line 671 "parse-gram.y" |
05d18c24 PE |
3055 | |
3056 | ||
3057 | ||
3058 | /* Return the location of the left-hand side of a rule whose | |
3059 | right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in | |
3060 | the right-hand side, and return an empty location equal to the end | |
3061 | boundary of RHS[0] if the right-hand side is empty. */ | |
3062 | ||
3063 | static YYLTYPE | |
3064 | lloc_default (YYLTYPE const *rhs, int n) | |
3065 | { | |
3066 | int i; | |
1d64f0ba | 3067 | YYLTYPE loc; |
329d23c5 PE |
3068 | |
3069 | /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;". | |
3070 | The bug is fixed in 7.4.2m, but play it safe for now. */ | |
3071 | loc.start = rhs[n].end; | |
3072 | loc.end = rhs[n].end; | |
05d18c24 | 3073 | |
77315a51 | 3074 | /* Ignore empty nonterminals the start of the right-hand side. |
73521d9f PE |
3075 | Do not bother to ignore them at the end of the right-hand side, |
3076 | since empty nonterminals have the same end as their predecessors. */ | |
05d18c24 PE |
3077 | for (i = 1; i <= n; i++) |
3078 | if (! equal_boundaries (rhs[i].start, rhs[i].end)) | |
3079 | { | |
1d64f0ba | 3080 | loc.start = rhs[i].start; |
05d18c24 PE |
3081 | break; |
3082 | } | |
3083 | ||
1d64f0ba | 3084 | return loc; |
05d18c24 PE |
3085 | } |
3086 | ||
3087 | ||
3088 | /* Add a lex-param or a parse-param (depending on TYPE) with | |
3089 | declaration DECL and location LOC. */ | |
3090 | ||
3091 | static void | |
73521d9f | 3092 | add_param (char const *type, char *decl, location loc) |
05d18c24 | 3093 | { |
8a8dc872 | 3094 | static char const alphanum[26 + 26 + 1 + 10] = |
05d18c24 PE |
3095 | "abcdefghijklmnopqrstuvwxyz" |
3096 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
8a8dc872 AD |
3097 | "_" |
3098 | "0123456789"; | |
05d18c24 | 3099 | char const *name_start = NULL; |
73521d9f | 3100 | char *p; |
05d18c24 | 3101 | |
2ed24dd8 | 3102 | /* Stop on last actual character. */ |
e503aa60 | 3103 | for (p = decl; p[1]; p++) |
8a8dc872 AD |
3104 | if ((p == decl |
3105 | || ! memchr (alphanum, p[-1], sizeof alphanum)) | |
3106 | && memchr (alphanum, p[0], sizeof alphanum - 10)) | |
05d18c24 | 3107 | name_start = p; |
2ed24dd8 | 3108 | |
8a8dc872 AD |
3109 | /* Strip the surrounding '{' and '}', and any blanks just inside |
3110 | the braces. */ | |
3111 | while (*--p == ' ' || *p == '\t') | |
3112 | continue; | |
e503aa60 | 3113 | p[1] = '\0'; |
8a8dc872 AD |
3114 | while (*++decl == ' ' || *decl == '\t') |
3115 | continue; | |
73521d9f | 3116 | |
05d18c24 PE |
3117 | if (! name_start) |
3118 | complain_at (loc, _("missing identifier in parameter declaration")); | |
3119 | else | |
3120 | { | |
45aab21d | 3121 | char *name = xmemdup0 (name_start, strspn (name_start, alphanum)); |
05d18c24 PE |
3122 | muscle_pair_list_grow (type, decl, name); |
3123 | free (name); | |
3124 | } | |
3125 | ||
e9071366 | 3126 | gram_scanner_last_string_free (); |
05d18c24 | 3127 | } |
e9955c83 | 3128 | |
2ce4ed68 | 3129 | |
b50d2359 AD |
3130 | static void |
3131 | version_check (location const *loc, char const *version) | |
3132 | { | |
3133 | if (strverscmp (version, PACKAGE_VERSION) > 0) | |
9b8a5ce0 AD |
3134 | { |
3135 | complain_at (*loc, "require bison %s, but have %s", | |
f95faa25 | 3136 | version, PACKAGE_VERSION); |
6c6f6f4b | 3137 | exit (EX_MISMATCH); |
9b8a5ce0 | 3138 | } |
b50d2359 AD |
3139 | } |
3140 | ||
05d18c24 PE |
3141 | static void |
3142 | gram_error (location const *loc, char const *msg) | |
e9955c83 | 3143 | { |
05d18c24 | 3144 | complain_at (*loc, "%s", msg); |
e9955c83 | 3145 | } |
1921f1d7 | 3146 | |
73521d9f PE |
3147 | char const * |
3148 | token_name (int type) | |
3149 | { | |
e0045d49 | 3150 | return yytname[YYTRANSLATE (type)]; |
73521d9f PE |
3151 | } |
3152 | ||
d2a1a60a PE |
3153 | static char const * |
3154 | char_name (char c) | |
3155 | { | |
3156 | if (c == '\'') | |
3157 | return "'\\''"; | |
3158 | else | |
3159 | { | |
3160 | char buf[4]; | |
3161 | buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0'; | |
3162 | return quotearg_style (escape_quoting_style, buf); | |
3163 | } | |
3164 | } | |
3165 |