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