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