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