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