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