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