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