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