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