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