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