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