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