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