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