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