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