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