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