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