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