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