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