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