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