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