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