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