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