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