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