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