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