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