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