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