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