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