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