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