]> git.saurik.com Git - bison.git/blame - src/parse-gram.c
Merge remote-tracking branch 'origin/maint'
[bison.git] / src / parse-gram.c
CommitLineData
369342dd 1/* A Bison parser, made by GNU Bison 2.6.5.977-6d58-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. */
369342dd 47#define YYBISON_VERSION "2.6.5.977-6d58-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. */
369342dd 75/* Line 355 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
369342dd 132/* Line 355 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. */
369342dd 171/* Line 371 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
369342dd 186/* Line 371 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{
369342dd 313/* Line 371 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
369342dd 326/* Line 371 of yacc.c */
47f6a236 327#line 247 "src/parse-gram.y"
415b8823
AD
328
329 param_type param;
330
369342dd 331/* Line 371 of yacc.c */
25b27513 332#line 423 "src/parse-gram.y"
0294b130 333code_props_type code_type;
415b8823 334
369342dd 335/* Line 371 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
369342dd 361/* Line 374 of yacc.c */
8d9cffff 362#line 363 "src/parse-gram.c"
b18cdd91 363/* Unqualified %code blocks. */
369342dd 364/* Line 375 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
369342dd 397/* Line 375 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
369342dd 410/* Line 375 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
369342dd 902/* Error token number */
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 932
369342dd 933
8a8dc872
AD
934/* YY_LOCATION_PRINT -- Print the location on the stream.
935 This macro was not mandated originally: define only if we know
936 we won't break user code: when these are the locations we know. */
937
938#ifndef YY_LOCATION_PRINT
8d9cffff 939# if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
369342dd
AD
940# define YY_LOCATION_PRINT(File, Loc) \
941 do { \
942 fprintf (File, "%d.%d", (Loc).first_line, (Loc).first_column); \
943 if ((Loc).first_line < (Loc).last_line) \
944 fprintf (File, "-%d.%d", (Loc).last_line, (Loc).last_column - 1); \
945 else if ((Loc).first_column < (Loc).last_column - 1) \
946 fprintf (File, "-%d", (Loc).last_column - 1); \
947 } while (0)
8a8dc872
AD
948# else
949# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
950# endif
e9955c83
AD
951#endif
952
8a8dc872 953
e9955c83 954/* YYLEX -- calling `yylex' with the right arguments. */
366eea36 955#ifdef YYLEX_PARAM
d33cb3ae 956# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
366eea36 957#else
d33cb3ae 958# define YYLEX yylex (&yylval, &yylloc)
366eea36 959#endif
e9955c83
AD
960
961/* Enable debugging if requested. */
8d9cffff 962#if GRAM_DEBUG
e9955c83 963
74e543d2 964# ifndef YYFPRINTF
e9955c83
AD
965# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
966# define YYFPRINTF fprintf
967# endif
968
e9690142
JD
969# define YYDPRINTF(Args) \
970do { \
971 if (yydebug) \
972 YYFPRINTF Args; \
95dbea81 973} while (0)
05d18c24 974
e9690142
JD
975# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
976do { \
977 if (yydebug) \
978 { \
979 YYFPRINTF (stderr, "%s ", Title); \
980 yy_symbol_print (stderr, \
981 Type, Value, Location); \
982 YYFPRINTF (stderr, "\n"); \
983 } \
95dbea81 984} while (0)
f0616f0b 985
3b0ffc7e 986
66809587
PE
987/*--------------------------------.
988| Print this symbol on YYOUTPUT. |
989`--------------------------------*/
990
66809587 991static void
d2a1a60a 992yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
66809587 993{
398c298c
AD
994 FILE *yyo = yyoutput;
995 YYUSE(yyo);
d9b968d8 996 YYUSE (yylocationp);
bf8b3d98
PE
997 if (!yyvaluep)
998 return;
66809587
PE
999# ifdef YYPRINT
1000 if (yytype < YYNTOKENS)
1001 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1002# endif
1003 switch (yytype)
1004 {
dc450175 1005 case 3: // "string"
369342dd 1006/* Line 711 of yacc.c */
47f6a236 1007#line 196 "src/parse-gram.y"
0294b130 1008 { fputs (quotearg_style (c_quoting_style, ((*yyvaluep).chars)), yyo); }
369342dd
AD
1009/* Line 711 of yacc.c */
1010#line 1011 "src/parse-gram.c"
dc450175 1011 break;
136a0f76 1012
dc450175 1013 case 4: // "integer"
369342dd 1014/* Line 711 of yacc.c */
47f6a236 1015#line 209 "src/parse-gram.y"
0294b130 1016 { fprintf (yyo, "%d", ((*yyvaluep).integer)); }
369342dd
AD
1017/* Line 711 of yacc.c */
1018#line 1019 "src/parse-gram.c"
86cfae0a
AD
1019 break;
1020
2f5b478e 1021 case 24: // "%<flag>"
369342dd 1022/* Line 711 of yacc.c */
47f6a236 1023#line 205 "src/parse-gram.y"
0294b130 1024 { fprintf (yyo, "%%%s", ((*yyvaluep).uniqstr)); }
369342dd
AD
1025/* Line 711 of yacc.c */
1026#line 1027 "src/parse-gram.c"
dc450175 1027 break;
136a0f76 1028
b18cdd91 1029 case 40: // "{...}"
369342dd 1030/* Line 711 of yacc.c */
47f6a236 1031#line 198 "src/parse-gram.y"
0294b130 1032 { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).code)); }
369342dd
AD
1033/* Line 711 of yacc.c */
1034#line 1035 "src/parse-gram.c"
dc450175 1035 break;
136a0f76 1036
ca2a6d15 1037 case 42: // "[identifier]"
369342dd 1038/* Line 711 of yacc.c */
47f6a236 1039#line 203 "src/parse-gram.y"
0294b130 1040 { fprintf (yyo, "[%s]", ((*yyvaluep).uniqstr)); }
369342dd
AD
1041/* Line 711 of yacc.c */
1042#line 1043 "src/parse-gram.c"
b143f404
JD
1043 break;
1044
ca2a6d15 1045 case 43: // "char"
369342dd 1046/* Line 711 of yacc.c */
47f6a236 1047#line 190 "src/parse-gram.y"
0294b130 1048 { fputs (char_name (((*yyvaluep).character)), yyo); }
369342dd
AD
1049/* Line 711 of yacc.c */
1050#line 1051 "src/parse-gram.c"
dc450175 1051 break;
136a0f76 1052
ca2a6d15 1053 case 44: // "epilogue"
369342dd 1054/* Line 711 of yacc.c */
47f6a236 1055#line 198 "src/parse-gram.y"
0294b130 1056 { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).chars)); }
369342dd
AD
1057/* Line 711 of yacc.c */
1058#line 1059 "src/parse-gram.c"
dc450175 1059 break;
136a0f76 1060
ca2a6d15 1061 case 46: // "identifier"
369342dd 1062/* Line 711 of yacc.c */
47f6a236 1063#line 202 "src/parse-gram.y"
0294b130 1064 { fputs (((*yyvaluep).uniqstr), yyo); }
369342dd
AD
1065/* Line 711 of yacc.c */
1066#line 1067 "src/parse-gram.c"
dc450175 1067 break;
136a0f76 1068
ca2a6d15 1069 case 47: // "identifier:"
369342dd 1070/* Line 711 of yacc.c */
47f6a236 1071#line 204 "src/parse-gram.y"
0294b130 1072 { fprintf (yyo, "%s:", ((*yyvaluep).uniqstr)); }
369342dd
AD
1073/* Line 711 of yacc.c */
1074#line 1075 "src/parse-gram.c"
dc450175 1075 break;
136a0f76 1076
ca2a6d15 1077 case 50: // "%{...%}"
369342dd 1078/* Line 711 of yacc.c */
47f6a236 1079#line 198 "src/parse-gram.y"
0294b130 1080 { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).chars)); }
369342dd
AD
1081/* Line 711 of yacc.c */
1082#line 1083 "src/parse-gram.c"
dc450175 1083 break;
136a0f76 1084
ca2a6d15 1085 case 52: // "<tag>"
369342dd 1086/* Line 711 of yacc.c */
47f6a236 1087#line 206 "src/parse-gram.y"
0294b130 1088 { fprintf (yyo, "<%s>", ((*yyvaluep).uniqstr)); }
369342dd
AD
1089/* Line 711 of yacc.c */
1090#line 1091 "src/parse-gram.c"
b18cdd91
AD
1091 break;
1092
ca2a6d15 1093 case 55: // "%param"
369342dd 1094/* Line 711 of yacc.c */
47f6a236 1095#line 252 "src/parse-gram.y"
b18cdd91
AD
1096 {
1097 switch (((*yyvaluep).param))
1098 {
1099#define CASE(In, Out) \
dd875058 1100 case param_ ## In: fputs ("%" #Out, stderr); break
b18cdd91
AD
1101 CASE(lex, lex-param);
1102 CASE(parse, parse-param);
1103 CASE(both, param);
b18cdd91 1104#undef CASE
2d399888 1105 case param_none: aver (false); break;
dd875058 1106 }
b18cdd91 1107}
369342dd
AD
1108/* Line 711 of yacc.c */
1109#line 1110 "src/parse-gram.c"
b143f404
JD
1110 break;
1111
0294b130 1112 case 64: // code_props_type
369342dd 1113/* Line 711 of yacc.c */
25b27513 1114#line 424 "src/parse-gram.y"
0294b130 1115 { fprintf (yyo, "%s", code_props_type_string (((*yyvaluep).code_type))); }
369342dd
AD
1116/* Line 711 of yacc.c */
1117#line 1118 "src/parse-gram.c"
dc450175 1118 break;
136a0f76 1119
0294b130 1120 case 73: // symbol.prec
369342dd 1121/* Line 711 of yacc.c */
47f6a236 1122#line 212 "src/parse-gram.y"
0294b130 1123 { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); }
369342dd
AD
1124/* Line 711 of yacc.c */
1125#line 1126 "src/parse-gram.c"
dc450175 1126 break;
136a0f76 1127
0294b130 1128 case 77: // tag
369342dd 1129/* Line 711 of yacc.c */
47f6a236 1130#line 206 "src/parse-gram.y"
0294b130 1131 { fprintf (yyo, "<%s>", ((*yyvaluep).uniqstr)); }
369342dd
AD
1132/* Line 711 of yacc.c */
1133#line 1134 "src/parse-gram.c"
dc450175 1134 break;
136a0f76 1135
0294b130 1136 case 87: // variable
369342dd 1137/* Line 711 of yacc.c */
47f6a236 1138#line 202 "src/parse-gram.y"
0294b130 1139 { fputs (((*yyvaluep).uniqstr), yyo); }
369342dd
AD
1140/* Line 711 of yacc.c */
1141#line 1142 "src/parse-gram.c"
dc450175 1142 break;
16dc6a9e 1143
0294b130 1144 case 88: // content.opt
369342dd 1145/* Line 711 of yacc.c */
47f6a236 1146#line 198 "src/parse-gram.y"
0294b130 1147 { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).chars)); }
369342dd
AD
1148/* Line 711 of yacc.c */
1149#line 1150 "src/parse-gram.c"
dc450175 1150 break;
136a0f76 1151
0294b130 1152 case 89: // braceless
369342dd 1153/* Line 711 of yacc.c */
47f6a236 1154#line 198 "src/parse-gram.y"
0294b130 1155 { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).chars)); }
369342dd
AD
1156/* Line 711 of yacc.c */
1157#line 1158 "src/parse-gram.c"
0294b130 1158 break;
136a0f76 1159
0294b130 1160 case 90: // id
369342dd 1161/* Line 711 of yacc.c */
47f6a236 1162#line 212 "src/parse-gram.y"
0294b130 1163 { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); }
369342dd
AD
1164/* Line 711 of yacc.c */
1165#line 1166 "src/parse-gram.c"
dc450175 1166 break;
136a0f76 1167
0294b130 1168 case 91: // id_colon
369342dd 1169/* Line 711 of yacc.c */
47f6a236 1170#line 213 "src/parse-gram.y"
0294b130 1171 { fprintf (yyo, "%s:", ((*yyvaluep).symbol)->tag); }
369342dd
AD
1172/* Line 711 of yacc.c */
1173#line 1174 "src/parse-gram.c"
dc450175 1174 break;
136a0f76 1175
0294b130 1176 case 92: // symbol
369342dd 1177/* Line 711 of yacc.c */
47f6a236 1178#line 212 "src/parse-gram.y"
0294b130 1179 { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); }
369342dd
AD
1180/* Line 711 of yacc.c */
1181#line 1182 "src/parse-gram.c"
0294b130 1182 break;
136a0f76 1183
0294b130 1184 case 93: // string_as_id
369342dd 1185/* Line 711 of yacc.c */
47f6a236 1186#line 212 "src/parse-gram.y"
0294b130 1187 { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); }
369342dd
AD
1188/* Line 711 of yacc.c */
1189#line 1190 "src/parse-gram.c"
dc450175 1190 break;
136a0f76 1191
66809587 1192 default:
e9690142 1193 break;
66809587 1194 }
3b0ffc7e
PE
1195}
1196
1197
1198/*--------------------------------.
1199| Print this symbol on YYOUTPUT. |
1200`--------------------------------*/
1201
3b0ffc7e 1202static void
d2a1a60a 1203yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
3b0ffc7e
PE
1204{
1205 if (yytype < YYNTOKENS)
1206 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1207 else
1208 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1209
1210 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1211 YYFPRINTF (yyoutput, ": ");
1212 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
66809587
PE
1213 YYFPRINTF (yyoutput, ")");
1214}
1215
05d18c24
PE
1216/*------------------------------------------------------------------.
1217| yy_stack_print -- Print the state stack from its BOTTOM up to its |
cd3684cf 1218| TOP (included). |
05d18c24
PE
1219`------------------------------------------------------------------*/
1220
05d18c24 1221static void
3b452f4e 1222yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
05d18c24 1223{
74e543d2 1224 YYFPRINTF (stderr, "Stack now");
3b452f4e
JD
1225 for (; yybottom <= yytop; yybottom++)
1226 {
1227 int yybot = *yybottom;
1228 YYFPRINTF (stderr, " %d", yybot);
1229 }
74e543d2 1230 YYFPRINTF (stderr, "\n");
05d18c24
PE
1231}
1232
e9690142
JD
1233# define YY_STACK_PRINT(Bottom, Top) \
1234do { \
1235 if (yydebug) \
1236 yy_stack_print ((Bottom), (Top)); \
95dbea81 1237} while (0)
05d18c24
PE
1238
1239
1240/*------------------------------------------------.
1241| Report that the YYRULE is going to be reduced. |
1242`------------------------------------------------*/
1243
05d18c24 1244static void
d12f8e49 1245yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
05d18c24 1246{
d12f8e49 1247 unsigned long int yylno = yyrline[yyrule];
66809587 1248 int yynrhs = yyr2[yyrule];
05d18c24 1249 int yyi;
66809587 1250 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
d12f8e49 1251 yyrule - 1, yylno);
66809587
PE
1252 /* The symbols being reduced. */
1253 for (yyi = 0; yyi < yynrhs; yyi++)
1254 {
0bf92491 1255 YYFPRINTF (stderr, " $%d = ", yyi + 1);
d12f8e49
AD
1256 yy_symbol_print (stderr,
1257 yystos[yyssp[yyi + 1 - yynrhs]],
1258 &(yyvsp[(yyi + 1) - (yynrhs)])
1259 , &(yylsp[(yyi + 1) - (yynrhs)]) );
0bf92491 1260 YYFPRINTF (stderr, "\n");
66809587 1261 }
05d18c24
PE
1262}
1263
e9690142
JD
1264# define YY_REDUCE_PRINT(Rule) \
1265do { \
1266 if (yydebug) \
d12f8e49 1267 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
95dbea81 1268} while (0)
05d18c24 1269
e9955c83
AD
1270/* Nonzero means print parse trace. It is left uninitialized so that
1271 multiple parsers can coexist. */
1272int yydebug;
8d9cffff 1273#else /* !GRAM_DEBUG */
e9955c83 1274# define YYDPRINTF(Args)
8a8dc872 1275# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
05d18c24
PE
1276# define YY_STACK_PRINT(Bottom, Top)
1277# define YY_REDUCE_PRINT(Rule)
8d9cffff 1278#endif /* !GRAM_DEBUG */
e9955c83 1279
05d18c24 1280
e9955c83 1281/* YYINITDEPTH -- initial size of the parser's stacks. */
e9690142 1282#ifndef YYINITDEPTH
e9955c83
AD
1283# define YYINITDEPTH 200
1284#endif
1285
1286/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1287 if the built-in stack extension method is used).
1288
1289 Do not make this value too large; the results are undefined if
2ce37586 1290 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
e9955c83
AD
1291 evaluated with infinite-precision integer arithmetic. */
1292
e9955c83
AD
1293#ifndef YYMAXDEPTH
1294# define YYMAXDEPTH 10000
1295#endif
1921f1d7 1296
107844a3
JD
1297/* Given a state stack such that *YYBOTTOM is its bottom, such that
1298 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
1299 stack, and such that *YYCAPACITY is the maximum number of elements it
1300 can hold without a reallocation, make sure there is enough room to
1301 store YYADD more elements. If not, allocate a new stack using
1302 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1303 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1304 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1305 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1306 required. Return 1 if memory is exhausted. */
1307static int
1308yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd,
8d9cffff 1309#if GRAM_DEBUG
107844a3
JD
1310 char const *yydebug_prefix,
1311 char const *yydebug_suffix,
1312#endif
1313 yytype_int16 **yybottom,
1314 yytype_int16 *yybottom_no_free,
1315 yytype_int16 **yytop, yytype_int16 *yytop_empty)
1316{
1317 YYSIZE_T yysize_old =
1318 *yytop == yytop_empty ? 0 : *yytop - *yybottom + 1;
1319 YYSIZE_T yysize_new = yysize_old + yyadd;
1320 if (*yycapacity < yysize_new)
1321 {
1322 YYSIZE_T yyalloc = 2 * yysize_new;
1323 yytype_int16 *yybottom_new;
1324 /* Use YYMAXDEPTH for maximum stack size given that the stack
1325 should never need to grow larger than the main state stack
1326 needs to grow without LAC. */
1327 if (YYMAXDEPTH < yysize_new)
1328 {
1329 YYDPRINTF ((stderr, "%smax size exceeded%s", yydebug_prefix,
1330 yydebug_suffix));
1331 return 1;
1332 }
1333 if (YYMAXDEPTH < yyalloc)
1334 yyalloc = YYMAXDEPTH;
1335 yybottom_new =
1336 (yytype_int16*) YYSTACK_ALLOC (yyalloc * sizeof *yybottom_new);
1337 if (!yybottom_new)
1338 {
1339 YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix,
1340 yydebug_suffix));
1341 return 1;
1342 }
1343 if (*yytop != yytop_empty)
1344 {
1345 YYCOPY (yybottom_new, *yybottom, yysize_old);
1346 *yytop = yybottom_new + (yysize_old - 1);
1347 }
1348 if (*yybottom != yybottom_no_free)
1349 YYSTACK_FREE (*yybottom);
1350 *yybottom = yybottom_new;
1351 *yycapacity = yyalloc;
1352 }
1353 return 0;
1354}
1355
1356/* Establish the initial context for the current lookahead if no initial
1357 context is currently established.
1358
1359 We define a context as a snapshot of the parser stacks. We define
1360 the initial context for a lookahead as the context in which the
1361 parser initially examines that lookahead in order to select a
1362 syntactic action. Thus, if the lookahead eventually proves
1363 syntactically unacceptable (possibly in a later context reached via a
1364 series of reductions), the initial context can be used to determine
1365 the exact set of tokens that would be syntactically acceptable in the
1366 lookahead's place. Moreover, it is the context after which any
1367 further semantic actions would be erroneous because they would be
1368 determined by a syntactically unacceptable token.
1369
1370 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1371 performed in an inconsistent state (which, for the purposes of LAC,
1372 includes consistent states that don't know they're consistent because
1373 their default reductions have been disabled). Iff there is a
1374 lookahead token, it should also be invoked before reporting a syntax
1375 error. This latter case is for the sake of the debugging output.
1376
1377 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1378 follows. If no initial context is currently established for the
1379 current lookahead, then check if that lookahead can eventually be
1380 shifted if syntactic actions continue from the current context.
1381 Report a syntax error if it cannot. */
1382#define YY_LAC_ESTABLISH \
1383do { \
1384 if (!yy_lac_established) \
1385 { \
1386 YYDPRINTF ((stderr, \
1387 "LAC: initial context established for %s\n", \
1388 yytname[yytoken])); \
1389 yy_lac_established = 1; \
1390 { \
1391 int yy_lac_status = \
1392 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
1393 if (yy_lac_status == 2) \
1394 goto yyexhaustedlab; \
1395 if (yy_lac_status == 1) \
1396 goto yyerrlab; \
1397 } \
1398 } \
95dbea81 1399} while (0)
107844a3
JD
1400
1401/* Discard any previous initial lookahead context because of Event,
1402 which may be a lookahead change or an invalidation of the currently
1403 established initial context for the current lookahead.
1404
1405 The most common example of a lookahead change is a shift. An example
1406 of both cases is syntax error recovery. That is, a syntax error
1407 occurs when the lookahead is syntactically erroneous for the
1408 currently established initial context, so error recovery manipulates
1409 the parser stacks to try to find a new initial context in which the
1410 current lookahead is syntactically acceptable. If it fails to find
1411 such a context, it discards the lookahead. */
8d9cffff 1412#if GRAM_DEBUG
107844a3
JD
1413# define YY_LAC_DISCARD(Event) \
1414do { \
1415 if (yy_lac_established) \
1416 { \
1417 if (yydebug) \
1418 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
1419 Event "\n"); \
1420 yy_lac_established = 0; \
1421 } \
95dbea81 1422} while (0)
107844a3
JD
1423#else
1424# define YY_LAC_DISCARD(Event) yy_lac_established = 0
1425#endif
1426
1427/* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1428 eventually (after perhaps some reductions) be shifted, return 1 if
1429 not, or return 2 if memory is exhausted. As preconditions and
1430 postconditions: *YYES_CAPACITY is the allocated size of the array to
1431 which *YYES points, and either *YYES = YYESA or *YYES points to an
1432 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1433 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1434 any old *YYES other than YYESA. */
1435static int
1436yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes,
1437 YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken)
1438{
1439 yytype_int16 *yyes_prev = yyssp;
1440 yytype_int16 *yyesp = yyes_prev;
1441 YYDPRINTF ((stderr, "LAC: checking lookahead %s:", yytname[yytoken]));
1442 if (yytoken == YYUNDEFTOK)
1443 {
1444 YYDPRINTF ((stderr, " Always Err\n"));
1445 return 1;
1446 }
1447 while (1)
1448 {
1449 int yyrule = yypact[*yyesp];
1450 if (yypact_value_is_default (yyrule)
1451 || (yyrule += yytoken) < 0 || YYLAST < yyrule
1452 || yycheck[yyrule] != yytoken)
1453 {
1454 yyrule = yydefact[*yyesp];
1455 if (yyrule == 0)
1456 {
1457 YYDPRINTF ((stderr, " Err\n"));
1458 return 1;
1459 }
1460 }
1461 else
1462 {
1463 yyrule = yytable[yyrule];
1464 if (yytable_value_is_error (yyrule))
1465 {
1466 YYDPRINTF ((stderr, " Err\n"));
1467 return 1;
1468 }
1469 if (0 < yyrule)
1470 {
1471 YYDPRINTF ((stderr, " S%d\n", yyrule));
1472 return 0;
1473 }
1474 yyrule = -yyrule;
1475 }
1476 {
1477 YYSIZE_T yylen = yyr2[yyrule];
1478 YYDPRINTF ((stderr, " R%d", yyrule - 1));
1479 if (yyesp != yyes_prev)
1480 {
1481 YYSIZE_T yysize = yyesp - *yyes + 1;
1482 if (yylen < yysize)
1483 {
1484 yyesp -= yylen;
1485 yylen = 0;
1486 }
1487 else
1488 {
1489 yylen -= yysize;
1490 yyesp = yyes_prev;
1491 }
1492 }
1493 if (yylen)
1494 yyesp = yyes_prev -= yylen;
1495 }
1496 {
1497 int yystate;
1498 {
1499 int yylhs = yyr1[yyrule] - YYNTOKENS;
1500 yystate = yypgoto[yylhs] + *yyesp;
1501 if (yystate < 0 || YYLAST < yystate
1502 || yycheck[yystate] != *yyesp)
1503 yystate = yydefgoto[yylhs];
1504 else
1505 yystate = yytable[yystate];
1506 }
1507 if (yyesp == yyes_prev)
1508 {
1509 yyesp = *yyes;
1510 *yyesp = yystate;
1511 }
1512 else
1513 {
1514 if (yy_lac_stack_realloc (yyes_capacity, 1,
8d9cffff 1515#if GRAM_DEBUG
107844a3
JD
1516 " (", ")",
1517#endif
1518 yyes, yyesa, &yyesp, yyes_prev))
1519 {
1520 YYDPRINTF ((stderr, "\n"));
1521 return 2;
1522 }
1523 *++yyesp = yystate;
1524 }
3c9b20ff 1525 YYDPRINTF ((stderr, " G%d", yystate));
107844a3
JD
1526 }
1527 }
1528}
1529
1921f1d7
AD
1530
1531#if YYERROR_VERBOSE
e9955c83
AD
1532
1533# ifndef yystrlen
bf8b3d98 1534# if defined __GLIBC__ && defined _STRING_H
e9955c83
AD
1535# define yystrlen strlen
1536# else
1537/* Return the length of YYSTR. */
1538static YYSIZE_T
e9955c83 1539yystrlen (const char *yystr)
e9955c83 1540{
7029f892
PE
1541 YYSIZE_T yylen;
1542 for (yylen = 0; yystr[yylen]; yylen++)
e9955c83 1543 continue;
7029f892 1544 return yylen;
e9955c83
AD
1545}
1546# endif
1547# endif
1548
1549# ifndef yystpcpy
bf8b3d98 1550# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
e9955c83
AD
1551# define yystpcpy stpcpy
1552# else
1553/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1554 YYDEST. */
1555static char *
e9955c83 1556yystpcpy (char *yydest, const char *yysrc)
e9955c83 1557{
b4fb989f
PE
1558 char *yyd = yydest;
1559 const char *yys = yysrc;
e9955c83
AD
1560
1561 while ((*yyd++ = *yys++) != '\0')
1562 continue;
1563
1564 return yyd - 1;
1565}
1566# endif
1567# endif
0c15323d 1568
9cbfdc9e
PE
1569# ifndef yytnamerr
1570/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1571 quotes and backslashes, so that it's suitable for yyerror. The
1572 heuristic is that double-quoting is unnecessary unless the string
1573 contains an apostrophe, a comma, or backslash (other than
1574 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1575 null, do not copy; instead, return the length of what the result
1576 would have been. */
1577static YYSIZE_T
1578yytnamerr (char *yyres, const char *yystr)
1579{
1580 if (*yystr == '"')
1581 {
d2a1a60a 1582 YYSIZE_T yyn = 0;
9cbfdc9e
PE
1583 char const *yyp = yystr;
1584
1585 for (;;)
e9690142
JD
1586 switch (*++yyp)
1587 {
1588 case '\'':
1589 case ',':
1590 goto do_not_strip_quotes;
1591
1592 case '\\':
1593 if (*++yyp != '\\')
1594 goto do_not_strip_quotes;
1595 /* Fall through. */
1596 default:
1597 if (yyres)
1598 yyres[yyn] = *yyp;
1599 yyn++;
1600 break;
1601
1602 case '"':
1603 if (yyres)
1604 yyres[yyn] = '\0';
1605 return yyn;
1606 }
9cbfdc9e
PE
1607 do_not_strip_quotes: ;
1608 }
1609
1610 if (! yyres)
1611 return yystrlen (yystr);
1612
1613 return yystpcpy (yyres, yystr) - yyres;
1614}
1615# endif
1616
45319f13 1617/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
bf35c71c 1618 about the unexpected token YYTOKEN for the state stack whose top is
107844a3
JD
1619 YYSSP. In order to see if a particular token T is a
1620 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).
45319f13 1621
d2060f06
JD
1622 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1623 not large enough to hold the message. In that case, also set
1624 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
107844a3
JD
1625 required number of bytes is too large to store or if
1626 yy_lac returned 2. */
45319f13
JD
1627static int
1628yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
107844a3
JD
1629 yytype_int16 *yyesa, yytype_int16 **yyes,
1630 YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken)
b4bbc4a0 1631{
398c298c 1632 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
b4bbc4a0
JD
1633 YYSIZE_T yysize = yysize0;
1634 YYSIZE_T yysize1;
1635 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1636 /* Internationalized format string. */
398c298c 1637 const char *yyformat = YY_NULL;
b4bbc4a0
JD
1638 /* Arguments of yyformat. */
1639 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
d2060f06
JD
1640 /* Number of reported tokens (one for the "unexpected", one per
1641 "expected"). */
1642 int yycount = 0;
b4bbc4a0 1643
d2060f06 1644 /* There are many possibilities here to consider:
d2060f06
JD
1645 - If this state is a consistent state with a default action, then
1646 the only way this function was invoked is if the default action
1647 is an error action. In that case, don't check for expected
1648 tokens because there are none.
1649 - The only way there can be no lookahead present (in yychar) is if
1650 this state is a consistent state with a default action. Thus,
1651 detecting the absence of a lookahead is sufficient to determine
1652 that there is no unexpected or expected token to report. In that
1653 case, just report a simple "syntax error".
1654 - Don't assume there isn't a lookahead just because this state is a
1655 consistent state with a default action. There might have been a
1656 previous inconsistent state, consistent state with a non-default
1657 action, or user semantic action that manipulated yychar.
107844a3
JD
1658 In the first two cases, it might appear that the current syntax
1659 error should have been detected in the previous state when yy_lac
1660 was invoked. However, at that time, there might have been a
1661 different syntax error that discarded a different initial context
1662 during error recovery, leaving behind the current lookahead.
d2060f06
JD
1663 */
1664 if (yytoken != YYEMPTY)
1665 {
bf35c71c 1666 int yyn = yypact[*yyssp];
107844a3 1667 YYDPRINTF ((stderr, "Constructing syntax error message\n"));
d2060f06
JD
1668 yyarg[yycount++] = yytname[yytoken];
1669 if (!yypact_value_is_default (yyn))
1670 {
b4bbc4a0 1671 int yyx;
bf35c71c 1672
107844a3
JD
1673 for (yyx = 0; yyx < YYNTOKENS; ++yyx)
1674 if (yyx != YYTERROR && yyx != YYUNDEFTOK)
b4bbc4a0 1675 {
107844a3
JD
1676 {
1677 int yy_lac_status = yy_lac (yyesa, yyes, yyes_capacity,
1678 yyssp, yyx);
1679 if (yy_lac_status == 2)
1680 return 2;
1681 if (yy_lac_status == 1)
1682 continue;
1683 }
b4bbc4a0
JD
1684 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1685 {
1686 yycount = 1;
1687 yysize = yysize0;
1688 break;
1689 }
1690 yyarg[yycount++] = yytname[yyx];
398c298c 1691 yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
d2060f06
JD
1692 if (! (yysize <= yysize1
1693 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1694 return 2;
b4bbc4a0
JD
1695 yysize = yysize1;
1696 }
d2060f06 1697 }
8d9cffff 1698# if GRAM_DEBUG
107844a3
JD
1699 else if (yydebug)
1700 YYFPRINTF (stderr, "No expected tokens.\n");
1701# endif
d2060f06 1702 }
b4bbc4a0
JD
1703
1704 switch (yycount)
2abdfeef 1705 {
bf35c71c 1706# define YYCASE_(N, S) \
b4bbc4a0
JD
1707 case N: \
1708 yyformat = S; \
1709 break
d2060f06 1710 YYCASE_(0, YY_("syntax error"));
b4bbc4a0
JD
1711 YYCASE_(1, YY_("syntax error, unexpected %s"));
1712 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1713 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1714 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1715 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
bf35c71c 1716# undef YYCASE_
b4bbc4a0 1717 }
dc450175 1718
b4bbc4a0
JD
1719 yysize1 = yysize + yystrlen (yyformat);
1720 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
d2060f06 1721 return 2;
b4bbc4a0
JD
1722 yysize = yysize1;
1723
1724 if (*yymsg_alloc < yysize)
1725 {
1726 *yymsg_alloc = 2 * yysize;
1727 if (! (yysize <= *yymsg_alloc
1728 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1729 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
d2060f06 1730 return 1;
b4bbc4a0
JD
1731 }
1732
1733 /* Avoid sprintf, as that infringes on the user's name space.
1734 Don't have undefined behavior even if the translation
1735 produced a string with the wrong number of "%s"s. */
1736 {
1737 char *yyp = *yymsg;
1738 int yyi = 0;
1739 while ((*yyp = *yyformat) != '\0')
1740 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
45319f13 1741 {
b4bbc4a0
JD
1742 yyp += yytnamerr (yyp, yyarg[yyi++]);
1743 yyformat += 2;
45319f13 1744 }
b4bbc4a0 1745 else
45319f13 1746 {
b4bbc4a0
JD
1747 yyp++;
1748 yyformat++;
45319f13 1749 }
b4bbc4a0
JD
1750 }
1751 return 0;
1752}
2abdfeef 1753#endif /* YYERROR_VERBOSE */
e9955c83 1754
04b6e11e
PE
1755/*-----------------------------------------------.
1756| Release the memory associated to this symbol. |
1757`-----------------------------------------------*/
1758
d33cb3ae 1759static void
8a8dc872 1760yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
04b6e11e 1761{
d9b968d8 1762 YYUSE(yyvaluep);
e764d4df 1763 YYUSE (yylocationp);
8a8dc872
AD
1764 if (!yymsg)
1765 yymsg = "Deleting";
1766 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1767
04b6e11e
PE
1768 switch (yytype)
1769 {
1770 default:
e9690142 1771 break;
04b6e11e
PE
1772 }
1773}
04b6e11e 1774
bb31eb56 1775
e776192e 1776
e9955c83 1777
bb31eb56
JD
1778/*----------.
1779| yyparse. |
1780`----------*/
d33cb3ae 1781
d33cb3ae
PE
1782int
1783yyparse (void)
e9955c83 1784{
e021811a 1785/* The lookahead symbol. */
366eea36
AD
1786int yychar;
1787
25b27513 1788
369342dd 1789#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
25b27513
TR
1790/* Suppress an incorrect diagnostic about yylval being uninitialized. */
1791# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1792 _Pragma ("GCC diagnostic push") \
369342dd 1793 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
25b27513
TR
1794 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1795# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1796 _Pragma ("GCC diagnostic pop")
1797#else
1798/* Default value used for initialization, for pacifying older GCCs
1799 or non-GCC compilers. */
1800static YYSTYPE yyval_default;
369342dd 1801# define YY_INITIAL_VALUE(Value) = Value
25b27513
TR
1802#endif
1803#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1804# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1805# define YY_IGNORE_MAYBE_UNINITIALIZED_END
1806#endif
369342dd
AD
1807#ifndef YY_INITIAL_VALUE
1808# define YY_INITIAL_VALUE(Value) /* Nothing. */
1809#endif
25b27513 1810
9bc0dd67 1811/* The semantic value of the lookahead symbol. */
369342dd 1812YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
366eea36 1813
9bc0dd67 1814/* Location data for the lookahead symbol. */
369342dd
AD
1815YYLTYPE yylloc
1816# if defined GRAM_LTYPE_IS_TRIVIAL && GRAM_LTYPE_IS_TRIVIAL
1817 = { 1, 1, 1, 1 }
1818# endif
1819;
1820
e9955c83 1821
e021811a
JD
1822 /* Number of syntax errors so far. */
1823 int yynerrs;
e9955c83 1824
e021811a
JD
1825 int yystate;
1826 /* Number of tokens to shift before error messages enabled. */
1827 int yyerrstatus;
e9955c83 1828
e021811a
JD
1829 /* The stacks and their tools:
1830 `yyss': related to states.
1831 `yyvs': related to semantic values.
1832 `yyls': related to locations.
e9955c83 1833
cbdb6d91 1834 Refer to the stacks through separate pointers, to allow yyoverflow
e021811a 1835 to reallocate them elsewhere. */
e9955c83 1836
e021811a
JD
1837 /* The state stack. */
1838 yytype_int16 yyssa[YYINITDEPTH];
1839 yytype_int16 *yyss;
1840 yytype_int16 *yyssp;
e9955c83 1841
e021811a
JD
1842 /* The semantic value stack. */
1843 YYSTYPE yyvsa[YYINITDEPTH];
1844 YYSTYPE *yyvs;
1845 YYSTYPE *yyvsp;
e9955c83 1846
e021811a
JD
1847 /* The location stack. */
1848 YYLTYPE yylsa[YYINITDEPTH];
1849 YYLTYPE *yyls;
1850 YYLTYPE *yylsp;
1851
1852 /* The locations where the error started and ended. */
44c2b42d 1853 YYLTYPE yyerror_range[3];
e9955c83 1854
e021811a 1855 YYSIZE_T yystacksize;
e9955c83 1856
107844a3
JD
1857 yytype_int16 yyesa[20];
1858 yytype_int16 *yyes;
1859 YYSIZE_T yyes_capacity;
1860
1861 int yy_lac_established = 0;
e021811a
JD
1862 int yyn;
1863 int yyresult;
1864 /* Lookahead token as an internal (translated) token number. */
47f6a236 1865 int yytoken = 0;
e9955c83
AD
1866 /* The variables used to return semantic value and location from the
1867 action routines. */
1868 YYSTYPE yyval;
e9955c83 1869 YYLTYPE yyloc;
e9955c83 1870
e021811a
JD
1871#if YYERROR_VERBOSE
1872 /* Buffer for error messages, and its allocated size. */
1873 char yymsgbuf[128];
1874 char *yymsg = yymsgbuf;
1875 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1876#endif
1877
1878#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1879
3b0ffc7e
PE
1880 /* The number of symbols on the RHS of the reduced rule.
1881 Keep to zero when no symbol should be popped. */
1882 int yylen = 0;
e9955c83 1883
369342dd
AD
1884 yyssp = yyss = yyssa;
1885 yyvsp = yyvs = yyvsa;
1886 yylsp = yyls = yylsa;
e021811a
JD
1887 yystacksize = YYINITDEPTH;
1888
107844a3
JD
1889 yyes = yyesa;
1890 yyes_capacity = sizeof yyesa / sizeof *yyes;
1891 if (YYMAXDEPTH < yyes_capacity)
1892 yyes_capacity = YYMAXDEPTH;
1893
74e543d2 1894 YYDPRINTF ((stderr, "Starting parse\n"));
e9955c83
AD
1895
1896 yystate = 0;
1897 yyerrstatus = 0;
1898 yynerrs = 0;
e021811a 1899 yychar = YYEMPTY; /* Cause a token to be read. */
e9955c83 1900
e021811a 1901/* User initialization code. */
369342dd 1902/* Line 1452 of yacc.c */
47f6a236 1903#line 101 "src/parse-gram.y"
cd3684cf
AD
1904{
1905 /* Bison's grammar can initial empty locations, hence a default
1906 location is needed. */
4a678af8
JD
1907 boundary_set (&yylloc.start, current_file, 1, 1);
1908 boundary_set (&yylloc.end, current_file, 1, 1);
cd3684cf 1909}
369342dd
AD
1910/* Line 1452 of yacc.c */
1911#line 1912 "src/parse-gram.c"
5f6da1c0 1912 yylsp[0] = yylloc;
e9955c83
AD
1913 goto yysetstate;
1914
1915/*------------------------------------------------------------.
1916| yynewstate -- Push a new state, which is found in yystate. |
1917`------------------------------------------------------------*/
1918 yynewstate:
1919 /* In all cases, when you get here, the value and location stacks
3b0ffc7e 1920 have just been pushed. So pushing a state here evens the stacks. */
e9955c83
AD
1921 yyssp++;
1922
1923 yysetstate:
1924 *yyssp = yystate;
1925
d33cb3ae 1926 if (yyss + yystacksize - 1 <= yyssp)
e9955c83
AD
1927 {
1928 /* Get the current used size of the three stacks, in elements. */
1929 YYSIZE_T yysize = yyssp - yyss + 1;
1930
1931#ifdef yyoverflow
1932 {
e9690142
JD
1933 /* Give user a chance to reallocate the stack. Use copies of
1934 these so that the &'s don't force the real ones into
1935 memory. */
1936 YYSTYPE *yyvs1 = yyvs;
1937 yytype_int16 *yyss1 = yyss;
1938 YYLTYPE *yyls1 = yyls;
1939
1940 /* Each stack pointer address is followed by the size of the
1941 data in use in that stack, in bytes. This used to be a
1942 conditional around just the two extra args, but that might
1943 be undefined if yyoverflow is a macro. */
1944 yyoverflow (YY_("memory exhausted"),
1945 &yyss1, yysize * sizeof (*yyssp),
1946 &yyvs1, yysize * sizeof (*yyvsp),
1947 &yyls1, yysize * sizeof (*yylsp),
1948 &yystacksize);
1949
1950 yyls = yyls1;
1951 yyss = yyss1;
1952 yyvs = yyvs1;
e9955c83
AD
1953 }
1954#else /* no yyoverflow */
1955# ifndef YYSTACK_RELOCATE
6088a2a0 1956 goto yyexhaustedlab;
e9955c83
AD
1957# else
1958 /* Extend the stack our own way. */
d33cb3ae 1959 if (YYMAXDEPTH <= yystacksize)
e9690142 1960 goto yyexhaustedlab;
e9955c83 1961 yystacksize *= 2;
d33cb3ae 1962 if (YYMAXDEPTH < yystacksize)
e9690142 1963 yystacksize = YYMAXDEPTH;
e9955c83
AD
1964
1965 {
e9690142
JD
1966 yytype_int16 *yyss1 = yyss;
1967 union yyalloc *yyptr =
1968 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1969 if (! yyptr)
1970 goto yyexhaustedlab;
1971 YYSTACK_RELOCATE (yyss_alloc, yyss);
1972 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1973 YYSTACK_RELOCATE (yyls_alloc, yyls);
1921f1d7 1974# undef YYSTACK_RELOCATE
e9690142
JD
1975 if (yyss1 != yyssa)
1976 YYSTACK_FREE (yyss1);
e9955c83
AD
1977 }
1978# endif
1979#endif /* no yyoverflow */
1980
1981 yyssp = yyss + yysize - 1;
1982 yyvsp = yyvs + yysize - 1;
e9955c83 1983 yylsp = yyls + yysize - 1;
e9955c83 1984
6088a2a0 1985 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
e9690142 1986 (unsigned long int) yystacksize));
e9955c83 1987
d33cb3ae 1988 if (yyss + yystacksize - 1 <= yyssp)
e9690142 1989 YYABORT;
e9955c83
AD
1990 }
1991
6088a2a0 1992 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
e9955c83 1993
ec5479ce
JD
1994 if (yystate == YYFINAL)
1995 YYACCEPT;
1996
e9955c83
AD
1997 goto yybackup;
1998
1999/*-----------.
2000| yybackup. |
2001`-----------*/
2002yybackup:
2003
3b0ffc7e 2004 /* Do appropriate processing given the current state. Read a
9bc0dd67 2005 lookahead token if we need one and don't already have one. */
e9955c83 2006
9bc0dd67 2007 /* First try to decide what to do without reference to lookahead token. */
e9955c83 2008 yyn = yypact[yystate];
f2b30bdf 2009 if (yypact_value_is_default (yyn))
e9955c83
AD
2010 goto yydefault;
2011
9bc0dd67 2012 /* Not known => get a lookahead token if don't already have one. */
e9955c83 2013
9bc0dd67 2014 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
73521d9f 2015 if (yychar == YYEMPTY)
e9955c83 2016 {
74e543d2 2017 YYDPRINTF ((stderr, "Reading a token: "));
e9955c83
AD
2018 yychar = YYLEX;
2019 }
2020
73521d9f 2021 if (yychar <= YYEOF)
e9955c83 2022 {
73521d9f 2023 yychar = yytoken = YYEOF;
74e543d2 2024 YYDPRINTF ((stderr, "Now at end of input.\n"));
e9955c83
AD
2025 }
2026 else
2027 {
73521d9f 2028 yytoken = YYTRANSLATE (yychar);
6088a2a0 2029 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
e9955c83
AD
2030 }
2031
886b69d1 2032 /* If the proper action on seeing token YYTOKEN is to reduce or to
ae7453f2 2033 detect an error, take that action. */
886b69d1 2034 yyn += yytoken;
219741d8 2035 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
107844a3
JD
2036 {
2037 YY_LAC_ESTABLISH;
2038 goto yydefault;
2039 }
e9955c83 2040 yyn = yytable[yyn];
ae7453f2 2041 if (yyn <= 0)
e9955c83 2042 {
f2b30bdf 2043 if (yytable_value_is_error (yyn))
bf35c71c 2044 goto yyerrlab;
107844a3 2045 YY_LAC_ESTABLISH;
e9955c83
AD
2046 yyn = -yyn;
2047 goto yyreduce;
2048 }
e9955c83 2049
3b0ffc7e
PE
2050 /* Count tokens shifted since error; after three, turn off error
2051 status. */
2052 if (yyerrstatus)
2053 yyerrstatus--;
2054
9bc0dd67 2055 /* Shift the lookahead token. */
6088a2a0 2056 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
e9955c83 2057
ec5479ce
JD
2058 /* Discard the shifted token. */
2059 yychar = YYEMPTY;
107844a3 2060 YY_LAC_DISCARD ("shift");
e9955c83 2061
3b0ffc7e 2062 yystate = yyn;
25b27513 2063 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
e9955c83 2064 *++yyvsp = yylval;
25b27513 2065 YY_IGNORE_MAYBE_UNINITIALIZED_END
e9955c83 2066 *++yylsp = yylloc;
e9955c83
AD
2067 goto yynewstate;
2068
2069
2070/*-----------------------------------------------------------.
2071| yydefault -- do the default action for the current state. |
2072`-----------------------------------------------------------*/
2073yydefault:
2074 yyn = yydefact[yystate];
2075 if (yyn == 0)
2076 goto yyerrlab;
2077 goto yyreduce;
2078
2079
2080/*-----------------------------.
2081| yyreduce -- Do a reduction. |
2082`-----------------------------*/
2083yyreduce:
2084 /* yyn is the number of a rule to reduce with. */
2085 yylen = yyr2[yyn];
2086
2087 /* If YYLEN is nonzero, implement the default value of the action:
2088 `$$ = $1'.
2089
04b6e11e
PE
2090 Otherwise, the following line sets YYVAL to garbage.
2091 This behavior is undocumented and Bison
e9955c83
AD
2092 users should not rely upon it. Assigning to YYVAL
2093 unconditionally makes the parser a bit smaller, and it avoids a
2094 GCC warning that YYVAL may be used uninitialized. */
2095 yyval = yyvsp[1-yylen];
2096
3b0ffc7e 2097 /* Default location. */
bf8b3d98 2098 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
05d18c24 2099 YY_REDUCE_PRINT (yyn);
107844a3
JD
2100 {
2101 int yychar_backup = yychar;
2102 switch (yyn)
2103 {
2104 case 6:
369342dd 2105/* Line 1670 of yacc.c */
47f6a236 2106#line 288 "src/parse-gram.y"
7c0c6181
JD
2107 {
2108 code_props plain_code;
e3dda35c 2109 code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
7c0c6181
JD
2110 code_props_translate_code (&plain_code);
2111 gram_scanner_last_string_free ();
7ecec4dd 2112 muscle_code_grow (union_seen ? "post_prologue" : "pre_prologue",
e3dda35c 2113 plain_code.code, (yylsp[0]));
7c0c6181
JD
2114 code_scanner_last_string_free ();
2115 }
369342dd
AD
2116/* Line 1670 of yacc.c */
2117#line 2118 "src/parse-gram.c"
1921f1d7
AD
2118 break;
2119
8efe435c 2120 case 7:
369342dd 2121/* Line 1670 of yacc.c */
47f6a236 2122#line 298 "src/parse-gram.y"
b19ebeb3 2123 {
697c912f 2124 muscle_percent_define_ensure ((yyvsp[0].uniqstr), (yylsp[0]), true);
b19ebeb3 2125 }
369342dd
AD
2126/* Line 1670 of yacc.c */
2127#line 2128 "src/parse-gram.c"
9bc0dd67
JD
2128 break;
2129
2cbe6b7f 2130 case 8:
369342dd 2131/* Line 1670 of yacc.c */
47f6a236 2132#line 302 "src/parse-gram.y"
7eb8a0bc 2133 {
de5ab940
JD
2134 muscle_percent_define_insert ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars),
2135 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
7eb8a0bc 2136 }
369342dd
AD
2137/* Line 1670 of yacc.c */
2138#line 2139 "src/parse-gram.c"
1921f1d7
AD
2139 break;
2140
2cbe6b7f 2141 case 9:
369342dd 2142/* Line 1670 of yacc.c */
47f6a236 2143#line 306 "src/parse-gram.y"
2ce4ed68 2144 { defines_flag = true; }
369342dd
AD
2145/* Line 1670 of yacc.c */
2146#line 2147 "src/parse-gram.c"
e9955c83 2147 break;
1921f1d7 2148
2cbe6b7f 2149 case 10:
369342dd 2150/* Line 1670 of yacc.c */
47f6a236 2151#line 308 "src/parse-gram.y"
02975b9a
JD
2152 {
2153 defines_flag = true;
e3dda35c 2154 spec_defines_file = xstrdup ((yyvsp[0].chars));
02975b9a 2155 }
369342dd
AD
2156/* Line 1670 of yacc.c */
2157#line 2158 "src/parse-gram.c"
e9955c83 2158 break;
1921f1d7 2159
2cbe6b7f 2160 case 11:
369342dd 2161/* Line 1670 of yacc.c */
47f6a236 2162#line 313 "src/parse-gram.y"
2f5b478e
AD
2163 {
2164 muscle_percent_define_insert ("parse.error", (yylsp[0]), "verbose",
2165 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
2166 }
369342dd
AD
2167/* Line 1670 of yacc.c */
2168#line 2169 "src/parse-gram.c"
d6328241
PH
2169 break;
2170
2cbe6b7f 2171 case 12:
369342dd 2172/* Line 1670 of yacc.c */
47f6a236 2173#line 317 "src/parse-gram.y"
2f5b478e 2174 { expected_sr_conflicts = (yyvsp[0].integer); }
369342dd
AD
2175/* Line 1670 of yacc.c */
2176#line 2177 "src/parse-gram.c"
fb9712a9
AD
2177 break;
2178
2cbe6b7f 2179 case 13:
369342dd 2180/* Line 1670 of yacc.c */
47f6a236 2181#line 318 "src/parse-gram.y"
2f5b478e 2182 { expected_rr_conflicts = (yyvsp[0].integer); }
369342dd
AD
2183/* Line 1670 of yacc.c */
2184#line 2185 "src/parse-gram.c"
34f98f46
JD
2185 break;
2186
2cbe6b7f 2187 case 14:
369342dd 2188/* Line 1670 of yacc.c */
47f6a236 2189#line 319 "src/parse-gram.y"
e3dda35c 2190 { spec_file_prefix = (yyvsp[0].chars); }
369342dd
AD
2191/* Line 1670 of yacc.c */
2192#line 2193 "src/parse-gram.c"
02975b9a
JD
2193 break;
2194
2195 case 15:
369342dd 2196/* Line 1670 of yacc.c */
25b27513 2197#line 321 "src/parse-gram.y"
cd3684cf 2198 {
bf8b3d98
PE
2199 nondeterministic_parser = true;
2200 glr_parser = true;
2201 }
369342dd
AD
2202/* Line 1670 of yacc.c */
2203#line 2204 "src/parse-gram.c"
e9955c83 2204 break;
1921f1d7 2205
25b27513 2206 case 16:
369342dd 2207/* Line 1670 of yacc.c */
25b27513 2208#line 326 "src/parse-gram.y"
cd3684cf 2209 {
7c0c6181 2210 code_props action;
e3dda35c 2211 code_props_symbol_action_init (&action, (yyvsp[0].code), (yylsp[0]));
7c0c6181
JD
2212 code_props_translate_code (&action);
2213 gram_scanner_last_string_free ();
e3dda35c 2214 muscle_code_grow ("initial_action", action.code, (yylsp[0]));
7c0c6181 2215 code_scanner_last_string_free ();
bf8b3d98 2216 }
369342dd
AD
2217/* Line 1670 of yacc.c */
2218#line 2219 "src/parse-gram.c"
25b27513
TR
2219 break;
2220
2221 case 17:
369342dd 2222/* Line 1670 of yacc.c */
25b27513
TR
2223#line 334 "src/parse-gram.y"
2224 { language_argmatch ((yyvsp[0].chars), grammar_prio, (yylsp[-1])); }
369342dd
AD
2225/* Line 1670 of yacc.c */
2226#line 2227 "src/parse-gram.c"
e9955c83 2227 break;
1921f1d7 2228
2f5b478e 2229 case 18:
369342dd 2230/* Line 1670 of yacc.c */
47f6a236 2231#line 335 "src/parse-gram.y"
25b27513 2232 { spec_name_prefix = (yyvsp[0].chars); }
369342dd
AD
2233/* Line 1670 of yacc.c */
2234#line 2235 "src/parse-gram.c"
e9955c83 2235 break;
1921f1d7 2236
2f5b478e 2237 case 19:
369342dd 2238/* Line 1670 of yacc.c */
47f6a236 2239#line 336 "src/parse-gram.y"
25b27513 2240 { no_lines_flag = true; }
369342dd
AD
2241/* Line 1670 of yacc.c */
2242#line 2243 "src/parse-gram.c"
e9955c83 2243 break;
1921f1d7 2244
2f5b478e 2245 case 20:
369342dd 2246/* Line 1670 of yacc.c */
47f6a236 2247#line 337 "src/parse-gram.y"
25b27513 2248 { nondeterministic_parser = true; }
369342dd
AD
2249/* Line 1670 of yacc.c */
2250#line 2251 "src/parse-gram.c"
02975b9a
JD
2251 break;
2252
2f5b478e 2253 case 21:
369342dd 2254/* Line 1670 of yacc.c */
47f6a236 2255#line 338 "src/parse-gram.y"
25b27513 2256 { spec_outfile = (yyvsp[0].chars); }
369342dd
AD
2257/* Line 1670 of yacc.c */
2258#line 2259 "src/parse-gram.c"
e9955c83 2259 break;
1921f1d7 2260
2f5b478e 2261 case 22:
369342dd 2262/* Line 1670 of yacc.c */
47f6a236 2263#line 339 "src/parse-gram.y"
25b27513 2264 { current_param = (yyvsp[0].param); }
369342dd
AD
2265/* Line 1670 of yacc.c */
2266#line 2267 "src/parse-gram.c"
4cdb01db 2267 break;
1921f1d7 2268
2f5b478e 2269 case 23:
369342dd 2270/* Line 1670 of yacc.c */
25b27513
TR
2271#line 339 "src/parse-gram.y"
2272 { current_param = param_none; }
369342dd
AD
2273/* Line 1670 of yacc.c */
2274#line 2275 "src/parse-gram.c"
4cdb01db 2275 break;
1921f1d7 2276
2f5b478e 2277 case 24:
369342dd 2278/* Line 1670 of yacc.c */
25b27513
TR
2279#line 340 "src/parse-gram.y"
2280 { version_check (&(yylsp[0]), (yyvsp[0].chars)); }
369342dd
AD
2281/* Line 1670 of yacc.c */
2282#line 2283 "src/parse-gram.c"
02975b9a
JD
2283 break;
2284
2f5b478e 2285 case 25:
369342dd 2286/* Line 1670 of yacc.c */
47f6a236 2287#line 342 "src/parse-gram.y"
a7867f53 2288 {
e3dda35c 2289 char const *skeleton_user = (yyvsp[0].chars);
84526bf3 2290 if (strchr (skeleton_user, '/'))
a7867f53
JD
2291 {
2292 size_t dir_length = strlen (current_file);
2293 char *skeleton_build;
2294 while (dir_length && current_file[dir_length - 1] != '/')
2295 --dir_length;
2296 while (dir_length && current_file[dir_length - 1] == '/')
2297 --dir_length;
2298 skeleton_build =
2299 xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
2300 if (dir_length > 0)
2301 {
398c298c 2302 memcpy (skeleton_build, current_file, dir_length);
a7867f53
JD
2303 skeleton_build[dir_length++] = '/';
2304 }
2305 strcpy (skeleton_build + dir_length, skeleton_user);
2306 skeleton_user = uniqstr_new (skeleton_build);
2307 free (skeleton_build);
2308 }
e3dda35c 2309 skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1]));
a7867f53 2310 }
369342dd
AD
2311/* Line 1670 of yacc.c */
2312#line 2313 "src/parse-gram.c"
3fa3725a
PE
2313 break;
2314
25b27513 2315 case 26:
369342dd 2316/* Line 1670 of yacc.c */
25b27513 2317#line 365 "src/parse-gram.y"
7172e23e 2318 { token_table_flag = true; }
369342dd
AD
2319/* Line 1670 of yacc.c */
2320#line 2321 "src/parse-gram.c"
5e6feb86
PE
2321 break;
2322
25b27513 2323 case 27:
369342dd 2324/* Line 1670 of yacc.c */
25b27513 2325#line 366 "src/parse-gram.y"
ef1b4273 2326 { report_flag |= report_states; }
369342dd
AD
2327/* Line 1670 of yacc.c */
2328#line 2329 "src/parse-gram.c"
7172e23e
JD
2329 break;
2330
25b27513 2331 case 28:
369342dd 2332/* Line 1670 of yacc.c */
25b27513 2333#line 367 "src/parse-gram.y"
83a457be 2334 { yacc_flag = true; }
369342dd
AD
2335/* Line 1670 of yacc.c */
2336#line 2337 "src/parse-gram.c"
dd875058
AD
2337 break;
2338
25b27513 2339 case 30:
369342dd 2340/* Line 1670 of yacc.c */
25b27513 2341#line 372 "src/parse-gram.y"
dd875058 2342 { add_param (current_param, (yyvsp[0].code), (yylsp[0])); }
369342dd
AD
2343/* Line 1670 of yacc.c */
2344#line 2345 "src/parse-gram.c"
4cdb01db 2345 break;
1921f1d7 2346
25b27513 2347 case 31:
369342dd 2348/* Line 1670 of yacc.c */
25b27513 2349#line 373 "src/parse-gram.y"
dd875058 2350 { add_param (current_param, (yyvsp[0].code), (yylsp[0])); }
369342dd
AD
2351/* Line 1670 of yacc.c */
2352#line 2353 "src/parse-gram.c"
dd875058
AD
2353 break;
2354
25b27513 2355 case 34:
369342dd 2356/* Line 1670 of yacc.c */
25b27513 2357#line 385 "src/parse-gram.y"
1921f1d7 2358 {
e3dda35c 2359 grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0]));
4cdb01db 2360 }
369342dd
AD
2361/* Line 1670 of yacc.c */
2362#line 2363 "src/parse-gram.c"
e9955c83 2363 break;
1921f1d7 2364
25b27513 2365 case 35:
369342dd 2366/* Line 1670 of yacc.c */
25b27513 2367#line 389 "src/parse-gram.y"
1921f1d7 2368 {
7cb40fd2
AD
2369 code_props code;
2370 code_props_symbol_action_init (&code, (yyvsp[-1].code), (yylsp[-1]));
2371 code_props_translate_code (&code);
2372 {
2373 symbol_list *list;
2374 for (list = (yyvsp[0].list); list; list = list->next)
2375 symbol_list_code_props_set (list, (yyvsp[-2].code_type), &code);
2376 symbol_list_free ((yyvsp[0].list));
2377 }
4cdb01db 2378 }
369342dd
AD
2379/* Line 1670 of yacc.c */
2380#line 2381 "src/parse-gram.c"
e9955c83 2381 break;
1921f1d7 2382
25b27513 2383 case 36:
369342dd 2384/* Line 1670 of yacc.c */
25b27513 2385#line 401 "src/parse-gram.y"
1921f1d7 2386 {
0294b130 2387 default_prec = true;
4cdb01db 2388 }
369342dd
AD
2389/* Line 1670 of yacc.c */
2390#line 2391 "src/parse-gram.c"
e9955c83 2391 break;
1921f1d7 2392
25b27513 2393 case 37:
369342dd 2394/* Line 1670 of yacc.c */
25b27513 2395#line 405 "src/parse-gram.y"
92f5e991 2396 {
0294b130 2397 default_prec = false;
92f5e991 2398 }
369342dd
AD
2399/* Line 1670 of yacc.c */
2400#line 2401 "src/parse-gram.c"
9280d3ef
AD
2401 break;
2402
25b27513 2403 case 38:
369342dd 2404/* Line 1670 of yacc.c */
25b27513 2405#line 409 "src/parse-gram.y"
66ef8b9d 2406 {
0294b130
AD
2407 /* Do not invoke muscle_percent_code_grow here since it invokes
2408 muscle_user_name_list_grow. */
2409 muscle_code_grow ("percent_code()", (yyvsp[0].chars), (yylsp[0]));
2410 code_scanner_last_string_free ();
66ef8b9d 2411 }
369342dd
AD
2412/* Line 1670 of yacc.c */
2413#line 2414 "src/parse-gram.c"
92f5e991
AD
2414 break;
2415
25b27513 2416 case 39:
369342dd 2417/* Line 1670 of yacc.c */
25b27513 2418#line 416 "src/parse-gram.y"
8e0a5e9e 2419 {
0294b130 2420 muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), (yylsp[0]));
8e0a5e9e
JD
2421 code_scanner_last_string_free ();
2422 }
369342dd
AD
2423/* Line 1670 of yacc.c */
2424#line 2425 "src/parse-gram.c"
2cbe6b7f
JD
2425 break;
2426
25b27513 2427 case 40:
369342dd 2428/* Line 1670 of yacc.c */
25b27513 2429#line 426 "src/parse-gram.y"
0294b130 2430 { (yyval.code_type) = destructor; }
369342dd
AD
2431/* Line 1670 of yacc.c */
2432#line 2433 "src/parse-gram.c"
58d7a1a1
AD
2433 break;
2434
25b27513 2435 case 41:
369342dd 2436/* Line 1670 of yacc.c */
25b27513 2437#line 427 "src/parse-gram.y"
0294b130 2438 { (yyval.code_type) = printer; }
369342dd
AD
2439/* Line 1670 of yacc.c */
2440#line 2441 "src/parse-gram.c"
66ef8b9d
PE
2441 break;
2442
25b27513 2443 case 42:
369342dd 2444/* Line 1670 of yacc.c */
25b27513 2445#line 437 "src/parse-gram.y"
0294b130 2446 {}
369342dd
AD
2447/* Line 1670 of yacc.c */
2448#line 2449 "src/parse-gram.c"
2cbe6b7f
JD
2449 break;
2450
25b27513 2451 case 43:
369342dd 2452/* Line 1670 of yacc.c */
25b27513 2453#line 438 "src/parse-gram.y"
0294b130 2454 { muscle_code_grow ("union_name", (yyvsp[0].uniqstr), (yylsp[0])); }
369342dd
AD
2455/* Line 1670 of yacc.c */
2456#line 2457 "src/parse-gram.c"
0294b130
AD
2457 break;
2458
25b27513 2459 case 44:
369342dd 2460/* Line 1670 of yacc.c */
25b27513 2461#line 443 "src/parse-gram.y"
9280d3ef 2462 {
1f4cc0f4 2463 union_seen = true;
e3dda35c 2464 muscle_code_grow ("stype", (yyvsp[0].chars), (yylsp[0]));
7ecec4dd 2465 code_scanner_last_string_free ();
9280d3ef 2466 }
369342dd
AD
2467/* Line 1670 of yacc.c */
2468#line 2469 "src/parse-gram.c"
9280d3ef
AD
2469 break;
2470
25b27513 2471 case 45:
369342dd 2472/* Line 1670 of yacc.c */
25b27513 2473#line 454 "src/parse-gram.y"
58d7a1a1 2474 { current_class = nterm_sym; }
369342dd
AD
2475/* Line 1670 of yacc.c */
2476#line 2477 "src/parse-gram.c"
366eea36
AD
2477 break;
2478
25b27513 2479 case 46:
369342dd 2480/* Line 1670 of yacc.c */
25b27513 2481#line 455 "src/parse-gram.y"
366eea36
AD
2482 {
2483 current_class = unknown_sym;
2484 current_type = NULL;
2485 }
369342dd
AD
2486/* Line 1670 of yacc.c */
2487#line 2488 "src/parse-gram.c"
366eea36
AD
2488 break;
2489
25b27513 2490 case 47:
369342dd 2491/* Line 1670 of yacc.c */
25b27513 2492#line 459 "src/parse-gram.y"
58d7a1a1 2493 { current_class = token_sym; }
369342dd
AD
2494/* Line 1670 of yacc.c */
2495#line 2496 "src/parse-gram.c"
58d7a1a1
AD
2496 break;
2497
25b27513 2498 case 48:
369342dd 2499/* Line 1670 of yacc.c */
25b27513 2500#line 460 "src/parse-gram.y"
58d7a1a1
AD
2501 {
2502 current_class = unknown_sym;
2503 current_type = NULL;
2504 }
369342dd
AD
2505/* Line 1670 of yacc.c */
2506#line 2507 "src/parse-gram.c"
58d7a1a1
AD
2507 break;
2508
25b27513 2509 case 49:
369342dd 2510/* Line 1670 of yacc.c */
25b27513 2511#line 465 "src/parse-gram.y"
1e0bab92 2512 {
05d18c24 2513 symbol_list *list;
3acc0308 2514 tag_seen = true;
e3dda35c 2515 for (list = (yyvsp[0].list); list; list = list->next)
e9690142 2516 symbol_type_set (list->content.sym, (yyvsp[-1].uniqstr), (yylsp[-1]));
e3dda35c 2517 symbol_list_free ((yyvsp[0].list));
1e0bab92 2518 }
369342dd
AD
2519/* Line 1670 of yacc.c */
2520#line 2521 "src/parse-gram.c"
e9955c83 2521 break;
1921f1d7 2522
25b27513 2523 case 50:
369342dd 2524/* Line 1670 of yacc.c */
25b27513 2525#line 476 "src/parse-gram.y"
1921f1d7 2526 {
05d18c24 2527 symbol_list *list;
1e0bab92 2528 ++current_prec;
e3dda35c 2529 for (list = (yyvsp[0].list); list; list = list->next)
e9690142
JD
2530 {
2531 symbol_type_set (list->content.sym, current_type, (yylsp[-1]));
2532 symbol_precedence_set (list->content.sym, current_prec, (yyvsp[-2].assoc), (yylsp[-2]));
2533 }
e3dda35c 2534 symbol_list_free ((yyvsp[0].list));
2c569025
AD
2535 current_type = NULL;
2536 }
369342dd
AD
2537/* Line 1670 of yacc.c */
2538#line 2539 "src/parse-gram.c"
e9955c83 2539 break;
1921f1d7 2540
25b27513 2541 case 51:
369342dd 2542/* Line 1670 of yacc.c */
25b27513 2543#line 490 "src/parse-gram.y"
0294b130 2544 { (yyval.assoc) = left_assoc; }
369342dd
AD
2545/* Line 1670 of yacc.c */
2546#line 2547 "src/parse-gram.c"
e9955c83 2547 break;
1921f1d7 2548
25b27513 2549 case 52:
369342dd 2550/* Line 1670 of yacc.c */
25b27513 2551#line 491 "src/parse-gram.y"
0294b130 2552 { (yyval.assoc) = right_assoc; }
369342dd
AD
2553/* Line 1670 of yacc.c */
2554#line 2555 "src/parse-gram.c"
4cdb01db 2555 break;
1921f1d7 2556
25b27513 2557 case 53:
369342dd 2558/* Line 1670 of yacc.c */
25b27513 2559#line 492 "src/parse-gram.y"
0294b130 2560 { (yyval.assoc) = non_assoc; }
369342dd
AD
2561/* Line 1670 of yacc.c */
2562#line 2563 "src/parse-gram.c"
e9955c83 2563 break;
1921f1d7 2564
25b27513 2565 case 54:
369342dd 2566/* Line 1670 of yacc.c */
25b27513 2567#line 493 "src/parse-gram.y"
0294b130 2568 { (yyval.assoc) = precedence_assoc; }
369342dd
AD
2569/* Line 1670 of yacc.c */
2570#line 2571 "src/parse-gram.c"
e9955c83 2571 break;
1921f1d7 2572
25b27513 2573 case 55:
369342dd 2574/* Line 1670 of yacc.c */
25b27513 2575#line 497 "src/parse-gram.y"
0294b130 2576 { current_type = NULL; }
369342dd
AD
2577/* Line 1670 of yacc.c */
2578#line 2579 "src/parse-gram.c"
3be03b13
JD
2579 break;
2580
25b27513 2581 case 56:
369342dd 2582/* Line 1670 of yacc.c */
25b27513 2583#line 498 "src/parse-gram.y"
0294b130 2584 { current_type = (yyvsp[0].uniqstr); tag_seen = true; }
369342dd
AD
2585/* Line 1670 of yacc.c */
2586#line 2587 "src/parse-gram.c"
3be03b13
JD
2587 break;
2588
25b27513 2589 case 57:
369342dd 2590/* Line 1670 of yacc.c */
25b27513 2591#line 504 "src/parse-gram.y"
0294b130 2592 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
369342dd
AD
2593/* Line 1670 of yacc.c */
2594#line 2595 "src/parse-gram.c"
4cdb01db 2595 break;
1921f1d7 2596
25b27513 2597 case 58:
369342dd 2598/* Line 1670 of yacc.c */
25b27513 2599#line 506 "src/parse-gram.y"
0294b130 2600 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
369342dd
AD
2601/* Line 1670 of yacc.c */
2602#line 2603 "src/parse-gram.c"
4cdb01db 2603 break;
1921f1d7 2604
25b27513 2605 case 59:
369342dd 2606/* Line 1670 of yacc.c */
25b27513 2607#line 510 "src/parse-gram.y"
0294b130 2608 { (yyval.symbol) = (yyvsp[0].symbol); }
369342dd
AD
2609/* Line 1670 of yacc.c */
2610#line 2611 "src/parse-gram.c"
3be03b13
JD
2611 break;
2612
25b27513 2613 case 60:
369342dd 2614/* Line 1670 of yacc.c */
25b27513 2615#line 511 "src/parse-gram.y"
0294b130 2616 { (yyval.symbol) = (yyvsp[-1].symbol); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); }
369342dd
AD
2617/* Line 1670 of yacc.c */
2618#line 2619 "src/parse-gram.c"
3be03b13
JD
2619 break;
2620
25b27513 2621 case 61:
369342dd 2622/* Line 1670 of yacc.c */
25b27513 2623#line 517 "src/parse-gram.y"
0294b130 2624 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
369342dd
AD
2625/* Line 1670 of yacc.c */
2626#line 2627 "src/parse-gram.c"
3be03b13
JD
2627 break;
2628
25b27513 2629 case 62:
369342dd 2630/* Line 1670 of yacc.c */
25b27513 2631#line 519 "src/parse-gram.y"
0294b130 2632 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
369342dd
AD
2633/* Line 1670 of yacc.c */
2634#line 2635 "src/parse-gram.c"
12e35840
JD
2635 break;
2636
25b27513 2637 case 63:
369342dd 2638/* Line 1670 of yacc.c */
25b27513 2639#line 523 "src/parse-gram.y"
0294b130 2640 { (yyval.list) = (yyvsp[0].list); }
369342dd
AD
2641/* Line 1670 of yacc.c */
2642#line 2643 "src/parse-gram.c"
ab7f29f8
JD
2643 break;
2644
25b27513 2645 case 64:
369342dd 2646/* Line 1670 of yacc.c */
25b27513 2647#line 524 "src/parse-gram.y"
0294b130 2648 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), (yyvsp[0].list)); }
369342dd
AD
2649/* Line 1670 of yacc.c */
2650#line 2651 "src/parse-gram.c"
ab7f29f8
JD
2651 break;
2652
25b27513 2653 case 65:
369342dd 2654/* Line 1670 of yacc.c */
25b27513 2655#line 528 "src/parse-gram.y"
0294b130 2656 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
369342dd
AD
2657/* Line 1670 of yacc.c */
2658#line 2659 "src/parse-gram.c"
ab7f29f8
JD
2659 break;
2660
25b27513 2661 case 66:
369342dd 2662/* Line 1670 of yacc.c */
25b27513 2663#line 529 "src/parse-gram.y"
0294b130 2664 { (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); }
369342dd
AD
2665/* Line 1670 of yacc.c */
2666#line 2667 "src/parse-gram.c"
ab7f29f8
JD
2667 break;
2668
25b27513 2669 case 68:
369342dd 2670/* Line 1670 of yacc.c */
25b27513 2671#line 534 "src/parse-gram.y"
0294b130 2672 { (yyval.uniqstr) = uniqstr_new ("*"); }
369342dd
AD
2673/* Line 1670 of yacc.c */
2674#line 2675 "src/parse-gram.c"
f7398526
AD
2675 break;
2676
25b27513 2677 case 69:
369342dd 2678/* Line 1670 of yacc.c */
25b27513 2679#line 535 "src/parse-gram.y"
0294b130 2680 { (yyval.uniqstr) = uniqstr_new (""); }
369342dd
AD
2681/* Line 1670 of yacc.c */
2682#line 2683 "src/parse-gram.c"
0294b130
AD
2683 break;
2684
25b27513 2685 case 70:
369342dd 2686/* Line 1670 of yacc.c */
25b27513 2687#line 541 "src/parse-gram.y"
1921f1d7 2688 {
e3dda35c 2689 current_type = (yyvsp[0].uniqstr);
1f4cc0f4 2690 tag_seen = true;
4cdb01db 2691 }
369342dd
AD
2692/* Line 1670 of yacc.c */
2693#line 2694 "src/parse-gram.c"
e9955c83 2694 break;
1921f1d7 2695
25b27513 2696 case 71:
369342dd 2697/* Line 1670 of yacc.c */
25b27513 2698#line 546 "src/parse-gram.y"
1921f1d7 2699 {
e3dda35c
AD
2700 symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true);
2701 symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0]));
4cdb01db 2702 }
369342dd
AD
2703/* Line 1670 of yacc.c */
2704#line 2705 "src/parse-gram.c"
e9955c83 2705 break;
1921f1d7 2706
25b27513 2707 case 72:
369342dd 2708/* Line 1670 of yacc.c */
25b27513 2709#line 551 "src/parse-gram.y"
1921f1d7 2710 {
e3dda35c
AD
2711 symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
2712 symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
2713 symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0]));
4cdb01db 2714 }
369342dd
AD
2715/* Line 1670 of yacc.c */
2716#line 2717 "src/parse-gram.c"
e9955c83 2717 break;
1921f1d7 2718
25b27513 2719 case 73:
369342dd 2720/* Line 1670 of yacc.c */
25b27513 2721#line 557 "src/parse-gram.y"
1921f1d7 2722 {
e3dda35c
AD
2723 symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
2724 symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
2725 symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc));
4cdb01db 2726 }
369342dd
AD
2727/* Line 1670 of yacc.c */
2728#line 2729 "src/parse-gram.c"
e9955c83 2729 break;
1921f1d7 2730
25b27513 2731 case 74:
369342dd 2732/* Line 1670 of yacc.c */
25b27513 2733#line 563 "src/parse-gram.y"
1921f1d7 2734 {
e3dda35c
AD
2735 symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true);
2736 symbol_type_set ((yyvsp[-2].symbol), current_type, (yylsp[-2]));
2737 symbol_user_token_number_set ((yyvsp[-2].symbol), (yyvsp[-1].integer), (yylsp[-1]));
2738 symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc));
4cdb01db 2739 }
369342dd
AD
2740/* Line 1670 of yacc.c */
2741#line 2742 "src/parse-gram.c"
e9955c83 2742 break;
1921f1d7 2743
25b27513 2744 case 81:
369342dd 2745/* Line 1670 of yacc.c */
25b27513 2746#line 593 "src/parse-gram.y"
b275314e
AD
2747 {
2748 yyerrok;
2749 }
369342dd
AD
2750/* Line 1670 of yacc.c */
2751#line 2752 "src/parse-gram.c"
e9955c83 2752 break;
1921f1d7 2753
25b27513 2754 case 82:
369342dd 2755/* Line 1670 of yacc.c */
25b27513 2756#line 599 "src/parse-gram.y"
f9d52903 2757 { current_lhs ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); }
369342dd
AD
2758/* Line 1670 of yacc.c */
2759#line 2760 "src/parse-gram.c"
f9d52903
JD
2760 break;
2761
25b27513 2762 case 83:
369342dd 2763/* Line 1670 of yacc.c */
25b27513 2764#line 600 "src/parse-gram.y"
f9d52903
JD
2765 {
2766 /* Free the current lhs. */
2767 current_lhs (0, (yylsp[-3]), 0);
2768 }
369342dd
AD
2769/* Line 1670 of yacc.c */
2770#line 2771 "src/parse-gram.c"
e9955c83 2771 break;
1921f1d7 2772
25b27513 2773 case 84:
369342dd 2774/* Line 1670 of yacc.c */
25b27513 2775#line 607 "src/parse-gram.y"
e3dda35c 2776 { grammar_current_rule_end ((yylsp[0])); }
369342dd
AD
2777/* Line 1670 of yacc.c */
2778#line 2779 "src/parse-gram.c"
4cdb01db 2779 break;
1921f1d7 2780
25b27513 2781 case 85:
369342dd 2782/* Line 1670 of yacc.c */
25b27513 2783#line 608 "src/parse-gram.y"
e3dda35c 2784 { grammar_current_rule_end ((yylsp[0])); }
369342dd
AD
2785/* Line 1670 of yacc.c */
2786#line 2787 "src/parse-gram.c"
e9955c83 2787 break;
1921f1d7 2788
25b27513 2789 case 87:
369342dd 2790/* Line 1670 of yacc.c */
25b27513 2791#line 614 "src/parse-gram.y"
f9d52903 2792 { grammar_current_rule_begin (current_lhs_symbol, current_lhs_location,
e9690142 2793 current_lhs_named_ref); }
369342dd
AD
2794/* Line 1670 of yacc.c */
2795#line 2796 "src/parse-gram.c"
e9071366
AD
2796 break;
2797
25b27513 2798 case 88:
369342dd 2799/* Line 1670 of yacc.c */
25b27513 2800#line 617 "src/parse-gram.y"
d70059ec 2801 { grammar_current_rule_symbol_append ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); }
369342dd
AD
2802/* Line 1670 of yacc.c */
2803#line 2804 "src/parse-gram.c"
676385e2
PH
2804 break;
2805
25b27513 2806 case 89:
369342dd 2807/* Line 1670 of yacc.c */
25b27513 2808#line 619 "src/parse-gram.y"
ca2a6d15 2809 { grammar_current_rule_action_append ((yyvsp[-1].code), (yylsp[-1]), (yyvsp[0].named_ref), false); }
369342dd
AD
2810/* Line 1670 of yacc.c */
2811#line 2812 "src/parse-gram.c"
676385e2
PH
2812 break;
2813
25b27513 2814 case 90:
369342dd 2815/* Line 1670 of yacc.c */
25b27513 2816#line 621 "src/parse-gram.y"
ca2a6d15 2817 { grammar_current_rule_action_append ((yyvsp[0].code), (yylsp[0]), NULL, true); }
369342dd
AD
2818/* Line 1670 of yacc.c */
2819#line 2820 "src/parse-gram.c"
3fa3725a
PE
2820 break;
2821
25b27513 2822 case 91:
369342dd 2823/* Line 1670 of yacc.c */
25b27513 2824#line 623 "src/parse-gram.y"
ca2a6d15 2825 { grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); }
369342dd
AD
2826/* Line 1670 of yacc.c */
2827#line 2828 "src/parse-gram.c"
5e6feb86
PE
2828 break;
2829
25b27513 2830 case 92:
369342dd 2831/* Line 1670 of yacc.c */
25b27513 2832#line 625 "src/parse-gram.y"
ca2a6d15 2833 { grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); }
369342dd
AD
2834/* Line 1670 of yacc.c */
2835#line 2836 "src/parse-gram.c"
b275314e
AD
2836 break;
2837
25b27513 2838 case 93:
369342dd 2839/* Line 1670 of yacc.c */
25b27513 2840#line 627 "src/parse-gram.y"
ca2a6d15 2841 { grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); }
369342dd
AD
2842/* Line 1670 of yacc.c */
2843#line 2844 "src/parse-gram.c"
d70059ec
AR
2844 break;
2845
25b27513 2846 case 94:
369342dd 2847/* Line 1670 of yacc.c */
25b27513 2848#line 631 "src/parse-gram.y"
ca2a6d15 2849 { (yyval.named_ref) = 0; }
369342dd
AD
2850/* Line 1670 of yacc.c */
2851#line 2852 "src/parse-gram.c"
ca2a6d15
PH
2852 break;
2853
25b27513 2854 case 95:
369342dd 2855/* Line 1670 of yacc.c */
25b27513 2856#line 633 "src/parse-gram.y"
d70059ec 2857 { (yyval.named_ref) = named_ref_new((yyvsp[0].uniqstr), (yylsp[0])); }
369342dd
AD
2858/* Line 1670 of yacc.c */
2859#line 2860 "src/parse-gram.c"
d70059ec
AR
2860 break;
2861
25b27513 2862 case 97:
369342dd 2863/* Line 1670 of yacc.c */
25b27513 2864#line 644 "src/parse-gram.y"
e3dda35c 2865 { (yyval.uniqstr) = uniqstr_new ((yyvsp[0].chars)); }
369342dd
AD
2866/* Line 1670 of yacc.c */
2867#line 2868 "src/parse-gram.c"
16dc6a9e
JD
2868 break;
2869
25b27513 2870 case 98:
369342dd 2871/* Line 1670 of yacc.c */
25b27513 2872#line 649 "src/parse-gram.y"
1c729058 2873 { (yyval.chars) = ""; }
369342dd
AD
2874/* Line 1670 of yacc.c */
2875#line 2876 "src/parse-gram.c"
2ce4ed68
AD
2876 break;
2877
25b27513 2878 case 99:
369342dd 2879/* Line 1670 of yacc.c */
25b27513 2880#line 650 "src/parse-gram.y"
cf499cff 2881 { (yyval.chars) = (yyvsp[0].uniqstr); }
369342dd
AD
2882/* Line 1670 of yacc.c */
2883#line 2884 "src/parse-gram.c"
cf499cff
JD
2884 break;
2885
25b27513 2886 case 101:
369342dd 2887/* Line 1670 of yacc.c */
25b27513 2888#line 661 "src/parse-gram.y"
2ce4ed68 2889 {
7c0c6181 2890 code_props plain_code;
e3dda35c
AD
2891 (yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n';
2892 code_props_plain_init (&plain_code, (yyvsp[0].code)+1, (yylsp[0]));
7c0c6181
JD
2893 code_props_translate_code (&plain_code);
2894 gram_scanner_last_string_free ();
2895 (yyval.chars) = plain_code.code;
2ce4ed68 2896 }
369342dd
AD
2897/* Line 1670 of yacc.c */
2898#line 2899 "src/parse-gram.c"
2ce4ed68
AD
2899 break;
2900
25b27513 2901 case 102:
369342dd 2902/* Line 1670 of yacc.c */
25b27513 2903#line 681 "src/parse-gram.y"
e3dda35c 2904 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
369342dd
AD
2905/* Line 1670 of yacc.c */
2906#line 2907 "src/parse-gram.c"
916708d5
AD
2907 break;
2908
25b27513 2909 case 103:
369342dd 2910/* Line 1670 of yacc.c */
25b27513 2911#line 683 "src/parse-gram.y"
d2a1a60a 2912 {
e3dda35c
AD
2913 (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0]));
2914 symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
2915 symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0]));
d2a1a60a 2916 }
369342dd
AD
2917/* Line 1670 of yacc.c */
2918#line 2919 "src/parse-gram.c"
66ef8b9d
PE
2919 break;
2920
25b27513 2921 case 104:
369342dd 2922/* Line 1670 of yacc.c */
25b27513 2923#line 691 "src/parse-gram.y"
e3dda35c 2924 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
369342dd
AD
2925/* Line 1670 of yacc.c */
2926#line 2927 "src/parse-gram.c"
58d7a1a1
AD
2927 break;
2928
25b27513 2929 case 107:
369342dd 2930/* Line 1670 of yacc.c */
25b27513 2931#line 703 "src/parse-gram.y"
1921f1d7 2932 {
e3dda35c
AD
2933 (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0]));
2934 symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
4cdb01db 2935 }
369342dd
AD
2936/* Line 1670 of yacc.c */
2937#line 2938 "src/parse-gram.c"
e9955c83 2938 break;
1921f1d7 2939
25b27513 2940 case 109:
369342dd 2941/* Line 1670 of yacc.c */
25b27513 2942#line 712 "src/parse-gram.y"
1921f1d7 2943 {
7c0c6181 2944 code_props plain_code;
e3dda35c 2945 code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
7c0c6181 2946 code_props_translate_code (&plain_code);
e9071366 2947 gram_scanner_last_string_free ();
e3dda35c 2948 muscle_code_grow ("epilogue", plain_code.code, (yylsp[0]));
7c0c6181 2949 code_scanner_last_string_free ();
4cdb01db 2950 }
369342dd
AD
2951/* Line 1670 of yacc.c */
2952#line 2953 "src/parse-gram.c"
e9955c83
AD
2953 break;
2954
2955
369342dd
AD
2956/* Line 1670 of yacc.c */
2957#line 2958 "src/parse-gram.c"
107844a3
JD
2958 default: break;
2959 }
2960 if (yychar_backup != yychar)
2961 YY_LAC_DISCARD ("yychar change");
2962 }
df222dfa
JD
2963 /* User semantic actions sometimes alter yychar, and that requires
2964 that yytoken be updated with the new translation. We take the
2965 approach of translating immediately before every use of yytoken.
2966 One alternative is translating here after every semantic action,
2967 but that translation would be missed if the semantic action invokes
2968 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2969 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2970 incorrect destructor might then be invoked immediately. In the
2971 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2972 to an incorrect destructor call or verbose syntax error message
2973 before the lookahead is translated. */
66809587 2974 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1921f1d7 2975
3b0ffc7e
PE
2976 YYPOPSTACK (yylen);
2977 yylen = 0;
05d18c24 2978 YY_STACK_PRINT (yyss, yyssp);
e9955c83
AD
2979
2980 *++yyvsp = yyval;
e9955c83 2981 *++yylsp = yyloc;
e9955c83
AD
2982
2983 /* Now `shift' the result of the reduction. Determine what state
2984 that goes to, based on the state we popped back to and the rule
2985 number reduced by. */
2986
2987 yyn = yyr1[yyn];
2988
1921f1d7 2989 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
219741d8 2990 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
e9955c83
AD
2991 yystate = yytable[yystate];
2992 else
1921f1d7 2993 yystate = yydefgoto[yyn - YYNTOKENS];
e9955c83
AD
2994
2995 goto yynewstate;
2996
2997
007c5908
AD
2998/*--------------------------------------.
2999| yyerrlab -- here on detecting error. |
3000`--------------------------------------*/
e9955c83 3001yyerrlab:
df222dfa
JD
3002 /* Make sure we have latest lookahead translation. See comments at
3003 user semantic actions for why this is necessary. */
d2060f06 3004 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
df222dfa 3005
e9955c83
AD
3006 /* If not already recovering from an error, report this error. */
3007 if (!yyerrstatus)
3008 {
3009 ++yynerrs;
2abdfeef
PE
3010#if ! YYERROR_VERBOSE
3011 yyerror (YY_("syntax error"));
3012#else
107844a3
JD
3013# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3014 yyesa, &yyes, &yyes_capacity, \
3015 yyssp, yytoken)
b4bbc4a0
JD
3016 {
3017 char const *yymsgp = YY_("syntax error");
bf35c71c 3018 int yysyntax_error_status;
107844a3
JD
3019 if (yychar != YYEMPTY)
3020 YY_LAC_ESTABLISH;
bf35c71c 3021 yysyntax_error_status = YYSYNTAX_ERROR;
b4bbc4a0
JD
3022 if (yysyntax_error_status == 0)
3023 yymsgp = yymsg;
d2060f06 3024 else if (yysyntax_error_status == 1)
b4bbc4a0
JD
3025 {
3026 if (yymsg != yymsgbuf)
3027 YYSTACK_FREE (yymsg);
3028 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3029 if (!yymsg)
3030 {
3031 yymsg = yymsgbuf;
3032 yymsg_alloc = sizeof yymsgbuf;
d2060f06 3033 yysyntax_error_status = 2;
b4bbc4a0
JD
3034 }
3035 else
3036 {
3037 yysyntax_error_status = YYSYNTAX_ERROR;
3038 yymsgp = yymsg;
3039 }
3040 }
3041 yyerror (yymsgp);
3042 if (yysyntax_error_status == 2)
3043 goto yyexhaustedlab;
3044 }
3045# undef YYSYNTAX_ERROR
2abdfeef 3046#endif
e9955c83 3047 }
e9955c83 3048
44c2b42d 3049 yyerror_range[1] = yylloc;
78a00b7d 3050
e9955c83
AD
3051 if (yyerrstatus == 3)
3052 {
9bc0dd67 3053 /* If just tried and failed to reuse lookahead token after an
e9690142 3054 error, discard it. */
e9955c83 3055
465b4444 3056 if (yychar <= YYEOF)
e9690142
JD
3057 {
3058 /* Return failure if at end of input. */
3059 if (yychar == YYEOF)
3060 YYABORT;
3061 }
465b4444 3062 else
e9690142
JD
3063 {
3064 yydestruct ("Error: discarding",
3065 yytoken, &yylval, &yylloc);
3066 yychar = YYEMPTY;
3067 }
e9955c83
AD
3068 }
3069
9bc0dd67 3070 /* Else will try to reuse lookahead token after shifting the error
e9955c83 3071 token. */
6d5aa694 3072 goto yyerrlab1;
e9955c83 3073
05d18c24 3074
465b4444
PE
3075/*---------------------------------------------------.
3076| yyerrorlab -- error raised explicitly by YYERROR. |
3077`---------------------------------------------------*/
3078yyerrorlab:
3079
e1054895
PE
3080 /* Pacify compilers like GCC when the user code never invokes
3081 YYERROR and the label yyerrorlab therefore never appears in user
3082 code. */
e764d4df 3083 if (/*CONSTCOND*/ 0)
465b4444 3084 goto yyerrorlab;
465b4444 3085
44c2b42d 3086 yyerror_range[1] = yylsp[1-yylen];
3b0ffc7e
PE
3087 /* Do not reclaim the symbols of the rule which action triggered
3088 this YYERROR. */
3089 YYPOPSTACK (yylen);
3090 yylen = 0;
3091 YY_STACK_PRINT (yyss, yyssp);
465b4444 3092 yystate = *yyssp;
465b4444
PE
3093 goto yyerrlab1;
3094
3095
3096/*-------------------------------------------------------------.
3097| yyerrlab1 -- common code for both syntax error and YYERROR. |
3098`-------------------------------------------------------------*/
05d18c24 3099yyerrlab1:
e9690142 3100 yyerrstatus = 3; /* Each real token shifted decrements this. */
e9955c83 3101
1921f1d7
AD
3102 for (;;)
3103 {
3104 yyn = yypact[yystate];
f2b30bdf 3105 if (!yypact_value_is_default (yyn))
e9690142
JD
3106 {
3107 yyn += YYTERROR;
3108 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3109 {
3110 yyn = yytable[yyn];
3111 if (0 < yyn)
3112 break;
3113 }
3114 }
4cdb01db 3115
1921f1d7
AD
3116 /* Pop the current state because it cannot handle the error token. */
3117 if (yyssp == yyss)
e9690142 3118 YYABORT;
0c15323d 3119
44c2b42d 3120 yyerror_range[1] = *yylsp;
4b367315 3121 yydestruct ("Error: popping",
e9690142 3122 yystos[yystate], yyvsp, yylsp);
3b0ffc7e 3123 YYPOPSTACK (1);
465b4444 3124 yystate = *yyssp;
05d18c24 3125 YY_STACK_PRINT (yyss, yyssp);
e9955c83
AD
3126 }
3127
107844a3
JD
3128 /* If the stack popping above didn't lose the initial context for the
3129 current lookahead token, the shift below will for sure. */
3130 YY_LAC_DISCARD ("error recovery");
3131
25b27513 3132 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
e9955c83 3133 *++yyvsp = yylval;
25b27513 3134 YY_IGNORE_MAYBE_UNINITIALIZED_END
8a8dc872 3135
44c2b42d 3136 yyerror_range[2] = yylloc;
8a8dc872 3137 /* Using YYLLOC is tempting, but would change the location of
9bc0dd67 3138 the lookahead. YYLOC is available though. */
44c2b42d 3139 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
78a00b7d 3140 *++yylsp = yyloc;
e9955c83 3141
3b0ffc7e 3142 /* Shift the error token. */
6088a2a0 3143 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8a8dc872 3144
e9955c83
AD
3145 yystate = yyn;
3146 goto yynewstate;
3147
3148
3149/*-------------------------------------.
3150| yyacceptlab -- YYACCEPT comes here. |
3151`-------------------------------------*/
3152yyacceptlab:
3153 yyresult = 0;
3154 goto yyreturn;
3155
3156/*-----------------------------------.
3157| yyabortlab -- YYABORT comes here. |
3158`-----------------------------------*/
3159yyabortlab:
3160 yyresult = 1;
3161 goto yyreturn;
3162
107844a3 3163#if 1
6088a2a0
PE
3164/*-------------------------------------------------.
3165| yyexhaustedlab -- memory exhaustion comes here. |
3166`-------------------------------------------------*/
3167yyexhaustedlab:
3168 yyerror (YY_("memory exhausted"));
e9955c83
AD
3169 yyresult = 2;
3170 /* Fall through. */
366eea36 3171#endif
e9955c83
AD
3172
3173yyreturn:
ec5479ce 3174 if (yychar != YYEMPTY)
df222dfa
JD
3175 {
3176 /* Make sure we have latest lookahead translation. See comments at
3177 user semantic actions for why this is necessary. */
3178 yytoken = YYTRANSLATE (yychar);
3179 yydestruct ("Cleanup: discarding lookahead",
3180 yytoken, &yylval, &yylloc);
3181 }
3b0ffc7e
PE
3182 /* Do not reclaim the symbols of the rule which action triggered
3183 this YYABORT or YYACCEPT. */
3184 YYPOPSTACK (yylen);
3185 YY_STACK_PRINT (yyss, yyssp);
d11e0cfa
PE
3186 while (yyssp != yyss)
3187 {
ec5d1a8a 3188 yydestruct ("Cleanup: popping",
e9690142 3189 yystos[*yyssp], yyvsp, yylsp);
3b0ffc7e 3190 YYPOPSTACK (1);
d11e0cfa 3191 }
e9955c83
AD
3192#ifndef yyoverflow
3193 if (yyss != yyssa)
3194 YYSTACK_FREE (yyss);
2abdfeef 3195#endif
107844a3
JD
3196 if (yyes != yyesa)
3197 YYSTACK_FREE (yyes);
2abdfeef
PE
3198#if YYERROR_VERBOSE
3199 if (yymsg != yymsgbuf)
3200 YYSTACK_FREE (yymsg);
e9955c83 3201#endif
95dbea81 3202 return yyresult;
e9955c83 3203}
369342dd 3204/* Line 1930 of yacc.c */
25b27513 3205#line 722 "src/parse-gram.y"
05d18c24
PE
3206
3207
3208/* Return the location of the left-hand side of a rule whose
3209 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3210 the right-hand side, and return an empty location equal to the end
3211 boundary of RHS[0] if the right-hand side is empty. */
3212
3213static YYLTYPE
3214lloc_default (YYLTYPE const *rhs, int n)
3215{
3216 int i;
1d64f0ba 3217 YYLTYPE loc;
329d23c5
PE
3218
3219 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3220 The bug is fixed in 7.4.2m, but play it safe for now. */
3221 loc.start = rhs[n].end;
3222 loc.end = rhs[n].end;
05d18c24 3223
59420cd7 3224 /* Ignore empty nonterminals the start of the right-hand side.
73521d9f
PE
3225 Do not bother to ignore them at the end of the right-hand side,
3226 since empty nonterminals have the same end as their predecessors. */
05d18c24
PE
3227 for (i = 1; i <= n; i++)
3228 if (! equal_boundaries (rhs[i].start, rhs[i].end))
3229 {
e9690142
JD
3230 loc.start = rhs[i].start;
3231 break;
05d18c24
PE
3232 }
3233
1d64f0ba 3234 return loc;
05d18c24
PE
3235}
3236
3237
05d18c24 3238static void
b18cdd91 3239add_param (param_type type, char *decl, location loc)
05d18c24 3240{
8a8dc872 3241 static char const alphanum[26 + 26 + 1 + 10] =
05d18c24
PE
3242 "abcdefghijklmnopqrstuvwxyz"
3243 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
8a8dc872
AD
3244 "_"
3245 "0123456789";
dd875058 3246
05d18c24 3247 char const *name_start = NULL;
dd875058
AD
3248 {
3249 char *p;
3250 /* Stop on last actual character. */
3251 for (p = decl; p[1]; p++)
3252 if ((p == decl
3253 || ! memchr (alphanum, p[-1], sizeof alphanum))
3254 && memchr (alphanum, p[0], sizeof alphanum - 10))
3255 name_start = p;
3256
3257 /* Strip the surrounding '{' and '}', and any blanks just inside
3258 the braces. */
52cc1ebd 3259 --p;
6b5a7489 3260 while (c_isspace ((unsigned char) *p))
52cc1ebd 3261 --p;
dd875058 3262 p[1] = '\0';
52cc1ebd 3263 ++decl;
6b5a7489 3264 while (c_isspace ((unsigned char) *decl))
52cc1ebd 3265 ++decl;
dd875058 3266 }
73521d9f 3267
05d18c24 3268 if (! name_start)
bb8e56ff 3269 complain (&loc, complaint, _("missing identifier in parameter declaration"));
05d18c24
PE
3270 else
3271 {
398c298c 3272 char *name = xmemdup0 (name_start, strspn (name_start, alphanum));
b18cdd91
AD
3273 if (type & param_lex)
3274 muscle_pair_list_grow ("lex_param", decl, name);
3275 if (type & param_parse)
3276 muscle_pair_list_grow ("parse_param", decl, name);
05d18c24
PE
3277 free (name);
3278 }
3279
e9071366 3280 gram_scanner_last_string_free ();
05d18c24 3281}
e9955c83 3282
2ce4ed68 3283
b50d2359
AD
3284static void
3285version_check (location const *loc, char const *version)
3286{
3287 if (strverscmp (version, PACKAGE_VERSION) > 0)
9b8a5ce0 3288 {
bb8e56ff
TR
3289 complain (loc, complaint, "require bison %s, but have %s",
3290 version, PACKAGE_VERSION);
6f8f253b 3291 exit (EX_MISMATCH);
9b8a5ce0 3292 }
b50d2359
AD
3293}
3294
05d18c24
PE
3295static void
3296gram_error (location const *loc, char const *msg)
e9955c83 3297{
bb8e56ff 3298 complain (loc, complaint, "%s", msg);
e9955c83 3299}
1921f1d7 3300
73521d9f
PE
3301char const *
3302token_name (int type)
3303{
e0045d49 3304 return yytname[YYTRANSLATE (type)];
73521d9f
PE
3305}
3306
d2a1a60a
PE
3307static char const *
3308char_name (char c)
3309{
3310 if (c == '\'')
3311 return "'\\''";
3312 else
3313 {
3314 char buf[4];
3315 buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0';
3316 return quotearg_style (escape_quoting_style, buf);
3317 }
3318}