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