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