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