]> git.saurik.com Git - bison.git/blame - src/bison.simple
Instead of mapping the LHS of unused rules to -1, keep the LHS
[bison.git] / src / bison.simple
CommitLineData
a8289c62
RA
1/* -*- C -*- */
2
3/* A Bison parser, made from %%filename
4 by GNU bison %%version. */
5
10fa2066 6/* Skeleton output parser for bison,
fabd3b43 7 Copyright 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc.
10fa2066
RS
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
21b14802 11 the Free Software Foundation; either version 2, or (at your option)
10fa2066
RS
12 any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
c49a8e71
JT
21 Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
10fa2066 23
c71f8bba
RS
24/* As a special exception, when this file is copied by Bison into a
25 Bison output file, you may use that output file without restriction.
26 This special exception was added by the Free Software Foundation
cfeaeb52 27 in version 1.24 of Bison. */
10fa2066 28
71da9eea
AD
29/* This is the parser code that is written into each bison parser when
30 the %semantic_parser declaration is not specified in the grammar.
31 It was written by Richard Stallman by simplifying the hairy parser
32 used when %semantic_parser is specified. */
444fbf65 33
a8289c62
RA
34#include <stdio.h>
35
17da6427
PB
36/* If name_prefix is specify substitute the variables and functions
37 names. */
38#define yyparse %%prefix##parse
39#define yylex %%prefix##lex
40#define yyerror %%prefix##error
41#define yylval %%prefix##lval
42#define yychar %%prefix##char
43#define yydebug %%prefix##debug
44#define yynerrs %%prefix##nerrs
45
d1a2daf7 46/* Copy the user declarations. */
5b5d1929 47#line %%input-line "%%filename"
63c2d5de 48%%prologue
d1a2daf7 49
c51d1a19 50#line %%line "%%skeleton"
a8289c62
RA
51#ifndef __cplusplus
52# ifndef __STDC__
53# define const
54# endif
55#endif
56
70ddf897 57#ifndef YYSTACK_USE_ALLOCA
361f60b3 58# ifdef alloca
78d09da9 59# define YYSTACK_USE_ALLOCA 1
361f60b3
AD
60# else /* alloca not defined */
61# ifdef __GNUC__
78d09da9 62# define YYSTACK_USE_ALLOCA 1
361f60b3
AD
63# define alloca __builtin_alloca
64# else /* not GNU C. */
65# if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
78d09da9 66# define YYSTACK_USE_ALLOCA 1
361f60b3
AD
67# include <alloca.h>
68# else /* not sparc */
69 /* We think this test detects Watcom and Microsoft C. */
70 /* This used to test MSDOS, but that is a bad idea since that
71 symbol is in the user namespace. */
72# if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
73# if 0
74 /* No need for malloc.h, which pollutes the namespace; instead,
75 just don't use alloca. */
76# include <malloc.h>
77# endif
78# else /* not MSDOS, or __TURBOC__ */
79# if defined(_AIX)
80 /* I don't know what this was needed for, but it pollutes the
81 namespace. So I turned it off. rms, 2 May 1997. */
82 /* #include <malloc.h> */
bbb5bcc6 83 #pragma alloca
78d09da9 84# define YYSTACK_USE_ALLOCA 1
361f60b3
AD
85# else /* not MSDOS, or __TURBOC__, or _AIX */
86# if 0
87 /* haible@ilog.fr says this works for HPUX 9.05 and up, and on
88 HPUX 10. Eventually we can turn this on. */
89# ifdef __hpux
78d09da9 90# define YYSTACK_USE_ALLOCA 1
361f60b3
AD
91# define alloca __builtin_alloca
92# endif /* __hpux */
93# endif
94# endif /* not _AIX */
95# endif /* not MSDOS, or __TURBOC__ */
96# endif /* not sparc */
97# endif /* not GNU C */
98# endif /* alloca not defined */
70ddf897
RS
99#endif /* YYSTACK_USE_ALLOCA not defined */
100
631aa1d3
AD
101#ifndef YYSTACK_USE_ALLOCA
102# define YYSTACK_USE_ALLOCA 0
103#endif
104
78d09da9 105#if YYSTACK_USE_ALLOCA
600f9b0c
PE
106# define YYSTACK_ALLOC alloca
107# define YYSTACK_FREE(Ptr) /* empty */
70ddf897 108#else
600f9b0c
PE
109# define YYSTACK_ALLOC malloc
110# define YYSTACK_FREE(Ptr) free (Ptr)
70ddf897 111#endif
10fa2066 112
600f9b0c
PE
113/* A type that is properly aligned for any stack member. */
114union yyalloc
115{
116 short yys;
117 YYSTYPE yyv;
118#if YYLSP_NEEDED
119 YYLTYPE yyl;
120#endif
121};
122
123/* The size of the maximum gap between one aligned stack and the next. */
124#define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
125
126/* The size of an array large to enough to hold all stacks, each with
127 N elements. */
128#if YYLSP_NEEDED
129# define YYSTACK_BYTES(N) \
130 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
131 + 2 * YYSTACK_GAP_MAX)
132#else
133# define YYSTACK_BYTES(N) \
134 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
135 + YYSTACK_GAP_MAX)
136#endif
137
138/* Relocate the TYPE STACK from its old location to the new one. The
139 local variables SIZE and YYSTACKSIZE give the old and new number of
140 elements in the stack, and YYPTR gives the new location of the
141 stack. Advance YYPTR to a properly aligned location for the next
142 stack. */
143#define YYSTACK_RELOCATE(Type, Stack) \
144do \
145 { \
146 size_t yynewbytes; \
147 __yy_memcpy (yyptr, (char *) (Stack), size * sizeof (Type)); \
148 (Stack) = (Type *) yyptr; \
149 yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
150 yynewbytes -= yynewbytes % sizeof (union yyalloc); \
151 yyptr += yynewbytes; \
152 } \
153while (0)
154
a8289c62
RA
155#define YYBISON 1 /* Identify Bison output. */
156#define YYPURE %%pure /* Identify pure parsers. */
157
158#ifndef YYDEBUG
159# define YYDEBUG %%debug
160#endif
161
5b5d1929 162#line %%input-line "%%filename"
a8289c62 163#ifndef YYSTYPE
5f7e0832
AD
164typedef %%stype yystype;
165# define YYSTYPE yystype
a8289c62
RA
166#endif
167
168#ifndef YYLTYPE
169typedef struct yyltype
170{
171 int first_line;
172 int first_column;
173 int last_line;
174 int last_column;
175} yyltype;
176# define YYLTYPE %%ltype
177#endif
178
8850be4b
MA
179#ifdef YYERROR_VERBOSE
180# undef YYERROR_VERBOSE
181#endif
182
5b5d1929 183#define YYERROR_VERBOSE %%error-verbose
8850be4b 184
e8cb70b9 185/* Tokens. */
a8289c62
RA
186%%tokendef
187
188#define YYFINAL %%final
189#define YYFLAG %%flag
190#define YYNTBASE %%ntbase
191#define YYLAST %%last
192
193#define YYNTOKENS %%ntokens
194#define YYNNTS %%nnts
195#define YYNRULES %%nrules
196#define YYNSTATES %%nstates
197#define YYMAXUTOK %%maxtok
198
199/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
200#define YYTRANSLATE(x) ((unsigned)(x) <= %%maxtok ? yytranslate[x] : %%nsym)
201
202/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
203static const char yytranslate[] =
204{
205 %%translate
206};
207
208#if YYDEBUG
209static const short yyprhs[] =
210{
211 %%prhs
212};
213
214static const short yyrhs[] =
215{
216 %%rhs
217};
218
219/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
220static const short yyrline[] =
221{
222 %%rline
223};
224#endif
225
8850be4b 226#if YYDEBUG || YYERROR_VERBOSE
e8cb70b9
PB
227/* YYTNME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
228static const char *const yytname[] =
a8289c62
RA
229{
230 %%tname
231};
232#endif
233
234/* YYTOKNUM[YYN] -- Index in YYTNAME corresponding to YYLEX. */
235static const short yytoknum[] =
236{
237 %%toknum
238};
239
240/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
241static const short yyr1[] =
242{
243 %%r1
244};
245
246/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
247static const short yyr2[] =
248{
249 %%r2
250};
251
252/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
253 doesn't specify something else to do. Zero means the default is an
254 error. */
255static const short yydefact[] =
256{
257 %%defact
258};
259
260static const short yydefgoto[] =
261{
262 %%defgoto
263};
264
265static const short yypact[] =
266{
267 %%pact
268};
269
270static const short yypgoto[] =
271{
272 %%pgoto
273};
274
275static const short yytable[] =
276{
277 %%table
278};
279
280static const short yycheck[] =
281{
282 %%check
283};
284
10fa2066 285#define yyerrok (yyerrstatus = 0)
17da6427 286#define yyclearin (yychar = YYEMPTY)
10fa2066
RS
287#define YYEMPTY -2
288#define YYEOF 0
a8289c62 289
70ddf897 290#define YYACCEPT goto yyacceptlab
a8289c62 291#define YYABORT goto yyabortlab
10fa2066 292#define YYERROR goto yyerrlab1
a8289c62 293
71da9eea
AD
294/* Like YYERROR except do call yyerror. This remains here temporarily
295 to ease the transition to the new meaning of YYERROR, for GCC.
10fa2066 296 Once GCC version 2 has supplanted version 1, this can go. */
a8289c62 297
10fa2066 298#define YYFAIL goto yyerrlab
a8289c62 299
10fa2066 300#define YYRECOVERING() (!!yyerrstatus)
a8289c62 301
69b4e0c5 302#define YYBACKUP(Token, Value) \
10fa2066 303do \
17da6427 304 if (yychar == YYEMPTY && yylen == 1) \
71da9eea 305 { \
17da6427
PB
306 yychar = (Token); \
307 yylval = (Value); \
308 yychar1 = YYTRANSLATE (yychar); \
10fa2066
RS
309 YYPOPSTACK; \
310 goto yybackup; \
311 } \
312 else \
71da9eea 313 { \
17da6427 314 yyerror ("syntax error: cannot back up"); \
71da9eea
AD
315 YYERROR; \
316 } \
10fa2066
RS
317while (0)
318
319#define YYTERROR 1
320#define YYERRCODE 256
321
3abcd459
AD
322/* YYLLOC_DEFAULT -- Compute the default location (before the actions
323 are run).
324
325 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
326 first token. By default, to implement support for ranges, extend
327 its range to the last symbol. */
328
329#ifndef YYLLOC_DEFAULT
ca96bc2d
MA
330# define YYLLOC_DEFAULT(Current, Rhs, N) \
331 Current.last_line = Rhs[N].last_line; \
332 Current.last_column = Rhs[N].last_column;
3abcd459
AD
333#endif
334
9e644e64 335/* Definition of YYLSP_NEEDED. */
5b5d1929 336#define YYLSP_NEEDED %%locations-flag
9e644e64 337
3abcd459 338/* YYLEX -- calling `yylex' with the right arguments. */
553e2b22
AD
339
340#if YYPURE
5af1f549 341# if YYLSP_NEEDED
b07b484a 342# ifdef YYLEX_PARAM
17da6427 343# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
b07b484a 344# else
17da6427 345# define YYLEX yylex (&yylval, &yylloc)
b07b484a 346# endif
71da9eea 347# else /* !YYLSP_NEEDED */
b07b484a 348# ifdef YYLEX_PARAM
17da6427 349# define YYLEX yylex (&yylval, YYLEX_PARAM)
b07b484a 350# else
17da6427 351# define YYLEX yylex (&yylval)
b07b484a 352# endif
71da9eea 353# endif /* !YYLSP_NEEDED */
553e2b22 354#else /* !YYPURE */
17da6427 355# define YYLEX yylex ()
553e2b22
AD
356#endif /* !YYPURE */
357
5a35a6cb 358/* Enable debugging if requested. */
0d533154 359#if YYDEBUG
5a35a6cb
AD
360# define YYDPRINTF(Args) \
361do { \
17da6427 362 if (yydebug) \
5a35a6cb
AD
363 fprintf Args; \
364} while (0)
365/* Nonzero means print parse trace. [The following comment makes no
366 sense to me. Could someone clarify it? --akim] Since this is
367 uninitialized, it does not stop multiple parsers from coexisting.
368 */
17da6427 369int yydebug;
5a35a6cb
AD
370#else /* !YYDEBUG */
371# define YYDPRINTF(Args)
372#endif /* !YYDEBUG */
373
374/* YYINITDEPTH -- initial size of the parser's stacks. */
10fa2066 375#ifndef YYINITDEPTH
a8289c62 376# define YYINITDEPTH %%initdepth
10fa2066
RS
377#endif
378
5a35a6cb 379/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
600f9b0c
PE
380 if the built-in stack extension method is used).
381
382 Do not make this value too large; the results are undefined if
383 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
384 evaluated with infinite-precision integer arithmetic. */
385
10fa2066 386#if YYMAXDEPTH == 0
b07b484a 387# undef YYMAXDEPTH
10fa2066
RS
388#endif
389
390#ifndef YYMAXDEPTH
a8289c62 391# define YYMAXDEPTH %%maxdepth
10fa2066 392#endif
a8289c62 393
10fa2066 394\f
a8289c62 395
10fa2066 396#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
5a35a6cb 397# define __yy_memcpy(To, From, Count) __builtin_memcpy (To, From, Count)
10fa2066 398#else /* not GNU C or C++ */
10fa2066
RS
399
400/* This is the most reliable way to avoid incompatibilities
401 in available built-in functions on various systems. */
402static void
5a009f2c 403# ifndef __cplusplus
c245d0d3 404__yy_memcpy (to, from, count)
10fa2066 405 char *to;
5a009f2c 406 const char *from;
600f9b0c 407 size_t count;
b07b484a 408# else /* __cplusplus */
600f9b0c 409__yy_memcpy (char *to, const char *from, size_t count)
5a009f2c 410# endif
10fa2066 411{
5a009f2c 412 register const char *f = from;
10fa2066 413 register char *t = to;
600f9b0c 414 register size_t i = count;
10fa2066 415
600f9b0c 416 while (i-- != 0)
10fa2066
RS
417 *t++ = *f++;
418}
bbb5bcc6 419#endif
a8289c62 420
10fa2066 421\f
a8289c62 422
f508cb0a 423#line %%line "%%skeleton"
b658bf92
RS
424
425/* The user can define YYPARSE_PARAM as the name of an argument to be passed
426 into yyparse. The argument should have type void *.
427 It should actually point to an object.
428 Grammar actions can access the variable by casting it
429 to the proper pointer type. */
430
431#ifdef YYPARSE_PARAM
b07b484a
AD
432# ifdef __cplusplus
433# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
434# define YYPARSE_PARAM_DECL
71da9eea 435# else /* !__cplusplus */
b07b484a
AD
436# define YYPARSE_PARAM_ARG YYPARSE_PARAM
437# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
71da9eea
AD
438# endif /* !__cplusplus */
439#else /* !YYPARSE_PARAM */
b07b484a
AD
440# define YYPARSE_PARAM_ARG
441# define YYPARSE_PARAM_DECL
71da9eea 442#endif /* !YYPARSE_PARAM */
b658bf92 443
1b181651
PE
444/* Prevent warning if -Wstrict-prototypes. */
445#ifdef __GNUC__
b07b484a 446# ifdef YYPARSE_PARAM
17da6427 447int yyparse (void *);
b07b484a 448# else
17da6427 449int yyparse (void);
b07b484a 450# endif
1b181651
PE
451#endif
452
a35f64ea
AD
453/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
454 variables are global, or local to YYPARSE. */
455
456#define _YY_DECL_VARIABLES \
457/* The lookahead symbol. */ \
17da6427 458int yychar; \
a35f64ea 459 \
e8cb70b9 460/* The semantic value of the lookahead symbol. */ \
17da6427 461YYSTYPE yylval; \
a35f64ea
AD
462 \
463/* Number of parse errors so far. */ \
17da6427 464int yynerrs;
a35f64ea
AD
465
466#if YYLSP_NEEDED
467# define YY_DECL_VARIABLES \
468_YY_DECL_VARIABLES \
469 \
470/* Location data for the lookahead symbol. */ \
471YYLTYPE yylloc;
472#else
473# define YY_DECL_VARIABLES \
474_YY_DECL_VARIABLES
475#endif
476
e8cb70b9 477/* If nonreentrant, generate the variables here. */
a35f64ea
AD
478
479#if !YYPURE
480YY_DECL_VARIABLES
481#endif /* !YYPURE */
482
10fa2066 483int
17da6427 484yyparse (YYPARSE_PARAM_ARG)
b658bf92 485 YYPARSE_PARAM_DECL
10fa2066 486{
e8cb70b9 487 /* If reentrant, generate the variables here. */
a35f64ea
AD
488#if YYPURE
489 YY_DECL_VARIABLES
490#endif /* !YYPURE */
491
10fa2066
RS
492 register int yystate;
493 register int yyn;
600f9b0c 494 int yyresult;
b07b484a
AD
495 /* Number of tokens to shift before error messages enabled. */
496 int yyerrstatus;
497 /* Lookahead token as an internal (translated) token number. */
498 int yychar1 = 0;
10fa2066 499
bb10be54
AD
500 /* Three stacks and their tools:
501 `yyss': related to states,
e9e4c321 502 `yyvs': related to semantic values,
bb10be54
AD
503 `yyls': related to locations.
504
505 Refer to the stacks thru separate pointers, to allow yyoverflow
506 to reallocate them elsewhere. */
507
e8cb70b9 508 /* The state stack. */
b07b484a 509 short yyssa[YYINITDEPTH];
bb10be54
AD
510 short *yyss = yyssa;
511 register short *yyssp;
512
b07b484a
AD
513 /* The semantic value stack. */
514 YYSTYPE yyvsa[YYINITDEPTH];
b07b484a 515 YYSTYPE *yyvs = yyvsa;
bb10be54 516 register YYSTYPE *yyvsp;
10fa2066 517
5af1f549 518#if YYLSP_NEEDED
b07b484a
AD
519 /* The location stack. */
520 YYLTYPE yylsa[YYINITDEPTH];
10fa2066
RS
521 YYLTYPE *yyls = yylsa;
522 YYLTYPE *yylsp;
bb10be54 523#endif
10fa2066 524
5af1f549 525#if YYLSP_NEEDED
b07b484a 526# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
10fa2066 527#else
b07b484a 528# define YYPOPSTACK (yyvsp--, yyssp--)
10fa2066
RS
529#endif
530
600f9b0c 531 size_t yystacksize = YYINITDEPTH;
10fa2066 532
6666f98f
AD
533 /* The variables used to return semantic value and location from the
534 action routines. */
bb10be54 535 YYSTYPE yyval;
5af1f549 536# if YYLSP_NEEDED
6666f98f
AD
537 YYLTYPE yyloc;
538# endif
10fa2066 539
6666f98f 540 /* When reducing, the number of symbols on the RHS of the reduced
e8cb70b9 541 rule. */
10fa2066
RS
542 int yylen;
543
5a35a6cb 544 YYDPRINTF ((stderr, "Starting parse\n"));
10fa2066
RS
545
546 yystate = 0;
547 yyerrstatus = 0;
17da6427
PB
548 yynerrs = 0;
549 yychar = YYEMPTY; /* Cause a token to be read. */
10fa2066
RS
550
551 /* Initialize stack pointers.
552 Waste one element of value and location stack
553 so that they stay on the same level as the state stack.
554 The wasted elements are never initialized. */
555
cbd89906 556 yyssp = yyss;
10fa2066 557 yyvsp = yyvs;
5af1f549 558#if YYLSP_NEEDED
10fa2066
RS
559 yylsp = yyls;
560#endif
cbd89906 561 goto yysetstate;
10fa2066 562
71da9eea
AD
563/*------------------------------------------------------------.
564| yynewstate -- Push a new state, which is found in yystate. |
565`------------------------------------------------------------*/
342b8b6e 566 yynewstate:
71da9eea
AD
567 /* In all cases, when you get here, the value and location stacks
568 have just been pushed. so pushing a state here evens the stacks.
569 */
cbd89906
PE
570 yyssp++;
571
342b8b6e 572 yysetstate:
cbd89906 573 *yyssp = yystate;
10fa2066
RS
574
575 if (yyssp >= yyss + yystacksize - 1)
576 {
10fa2066 577 /* Get the current used size of the three stacks, in elements. */
600f9b0c 578 size_t size = yyssp - yyss + 1;
10fa2066
RS
579
580#ifdef yyoverflow
3d76b07d
AD
581 {
582 /* Give user a chance to reallocate the stack. Use copies of
583 these so that the &'s don't force the real ones into
584 memory. */
585 YYSTYPE *yyvs1 = yyvs;
586 short *yyss1 = yyss;
587
588 /* Each stack pointer address is followed by the size of the
589 data in use in that stack, in bytes. */
5af1f549 590# if YYLSP_NEEDED
3d76b07d
AD
591 YYLTYPE *yyls1 = yyls;
592 /* This used to be a conditional around just the two extra args,
593 but that might be undefined if yyoverflow is a macro. */
594 yyoverflow ("parser stack overflow",
595 &yyss1, size * sizeof (*yyssp),
596 &yyvs1, size * sizeof (*yyvsp),
597 &yyls1, size * sizeof (*yylsp),
598 &yystacksize);
599 yyls = yyls1;
b07b484a 600# else
3d76b07d
AD
601 yyoverflow ("parser stack overflow",
602 &yyss1, size * sizeof (*yyssp),
603 &yyvs1, size * sizeof (*yyvsp),
604 &yystacksize);
b07b484a 605# endif
3d76b07d
AD
606 yyss = yyss1;
607 yyvs = yyvs1;
608 }
10fa2066
RS
609#else /* no yyoverflow */
610 /* Extend the stack our own way. */
611 if (yystacksize >= YYMAXDEPTH)
600f9b0c 612 goto yyoverflowlab;
10fa2066
RS
613 yystacksize *= 2;
614 if (yystacksize > YYMAXDEPTH)
615 yystacksize = YYMAXDEPTH;
e9e4c321 616
600f9b0c
PE
617 {
618 short *yyss1 = yyss;
619 char *yyptr = (char *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
620 if (! yyptr)
621 goto yyoverflowlab;
622 YYSTACK_RELOCATE (short, yyss);
623 YYSTACK_RELOCATE (YYSTYPE, yyvs);
5af1f549 624# if YYLSP_NEEDED
600f9b0c 625 YYSTACK_RELOCATE (YYLTYPE, yyls);
b07b484a 626# endif
600f9b0c
PE
627# undef YYSTACK_RELOCATE
628 if (yyss1 != yyssa)
629 YYSTACK_FREE (yyss1);
630 }
10fa2066
RS
631#endif /* no yyoverflow */
632
633 yyssp = yyss + size - 1;
634 yyvsp = yyvs + size - 1;
5af1f549 635#if YYLSP_NEEDED
10fa2066
RS
636 yylsp = yyls + size - 1;
637#endif
638
600f9b0c
PE
639 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
640 (unsigned long int) yystacksize));
10fa2066
RS
641
642 if (yyssp >= yyss + yystacksize - 1)
643 YYABORT;
644 }
645
5a35a6cb 646 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
10fa2066
RS
647
648 goto yybackup;
71da9eea 649
71da9eea
AD
650/*-----------.
651| yybackup. |
652`-----------*/
653yybackup:
10fa2066
RS
654
655/* Do appropriate processing given the current state. */
656/* Read a lookahead token if we need one and don't already have one. */
657/* yyresume: */
658
659 /* First try to decide what to do without reference to lookahead token. */
660
661 yyn = yypact[yystate];
662 if (yyn == YYFLAG)
663 goto yydefault;
664
665 /* Not known => get a lookahead token if don't already have one. */
666
667 /* yychar is either YYEMPTY or YYEOF
668 or a valid token in external form. */
669
17da6427 670 if (yychar == YYEMPTY)
10fa2066 671 {
5a35a6cb 672 YYDPRINTF ((stderr, "Reading a token: "));
17da6427 673 yychar = YYLEX;
10fa2066
RS
674 }
675
e8cb70b9 676 /* Convert token to internal form (in yychar1) for indexing tables with. */
10fa2066 677
17da6427 678 if (yychar <= 0) /* This means end of input. */
10fa2066
RS
679 {
680 yychar1 = 0;
17da6427 681 yychar = YYEOF; /* Don't call YYLEX any more. */
10fa2066 682
5a35a6cb 683 YYDPRINTF ((stderr, "Now at end of input.\n"));
10fa2066
RS
684 }
685 else
686 {
17da6427 687 yychar1 = YYTRANSLATE (yychar);
10fa2066 688
0d533154
AD
689#if YYDEBUG
690 /* We have to keep this `#if YYDEBUG', since we use variables
691 which are defined only if `YYDEBUG' is set. */
17da6427 692 if (yydebug)
10fa2066 693 {
17da6427 694 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
0d533154
AD
695 /* Give the individual parser a way to print the precise
696 meaning of a token, for further debugging info. */
b07b484a 697# ifdef YYPRINT
17da6427 698 YYPRINT (stderr, yychar, yylval);
b07b484a 699# endif
10fa2066
RS
700 fprintf (stderr, ")\n");
701 }
0d533154 702#endif
10fa2066
RS
703 }
704
705 yyn += yychar1;
706 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
707 goto yydefault;
708
709 yyn = yytable[yyn];
710
711 /* yyn is what to do for this token type in this state.
712 Negative => reduce, -yyn is rule number.
713 Positive => shift, yyn is new state.
714 New state is final state => don't bother to shift,
715 just return success.
716 0, or most negative number => error. */
717
718 if (yyn < 0)
719 {
720 if (yyn == YYFLAG)
721 goto yyerrlab;
722 yyn = -yyn;
723 goto yyreduce;
724 }
725 else if (yyn == 0)
726 goto yyerrlab;
727
728 if (yyn == YYFINAL)
729 YYACCEPT;
730
731 /* Shift the lookahead token. */
17da6427 732 YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]));
10fa2066
RS
733
734 /* Discard the token being shifted unless it is eof. */
17da6427
PB
735 if (yychar != YYEOF)
736 yychar = YYEMPTY;
10fa2066 737
17da6427 738 *++yyvsp = yylval;
5af1f549 739#if YYLSP_NEEDED
10fa2066
RS
740 *++yylsp = yylloc;
741#endif
742
71da9eea
AD
743 /* Count tokens shifted since error; after three, turn off error
744 status. */
745 if (yyerrstatus)
746 yyerrstatus--;
10fa2066
RS
747
748 yystate = yyn;
749 goto yynewstate;
750
10fa2066 751
71da9eea
AD
752/*-----------------------------------------------------------.
753| yydefault -- do the default action for the current state. |
754`-----------------------------------------------------------*/
755yydefault:
10fa2066
RS
756 yyn = yydefact[yystate];
757 if (yyn == 0)
758 goto yyerrlab;
71da9eea 759 goto yyreduce;
10fa2066 760
71da9eea
AD
761
762/*-----------------------------.
763| yyreduce -- Do a reduction. |
764`-----------------------------*/
10fa2066 765yyreduce:
71da9eea 766 /* yyn is the number of a rule to reduce with. */
10fa2066 767 yylen = yyr2[yyn];
da9abf43
AD
768
769 /* If YYLEN is nonzero, implement the default value of the action:
573c1d9f 770 `$$ = $1'.
da9abf43
AD
771
772 Otherwise, the following line sets YYVAL to the semantic value of
773 the lookahead token. This behavior is undocumented and Bison
774 users should not rely upon it. Assigning to YYVAL
775 unconditionally makes the parser a bit smaller, and it avoids a
776 GCC warning that YYVAL may be used uninitialized. */
777 yyval = yyvsp[1-yylen];
3abcd459 778
5af1f549 779#if YYLSP_NEEDED
3abcd459
AD
780 /* Similarly for the default location. Let the user run additional
781 commands if for instance locations are ranges. */
782 yyloc = yylsp[1-yylen];
ca96bc2d 783 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
6666f98f 784#endif
10fa2066 785
0de741ca
AD
786#if YYDEBUG
787 /* We have to keep this `#if YYDEBUG', since we use variables which
788 are defined only if `YYDEBUG' is set. */
17da6427 789 if (yydebug)
10fa2066
RS
790 {
791 int i;
792
793 fprintf (stderr, "Reducing via rule %d (line %d), ",
794 yyn, yyrline[yyn]);
795
796 /* Print the symbols being reduced, and their result. */
797 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
798 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
799 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
800 }
801#endif
a8289c62
RA
802 switch (yyn)
803 {
1c8c2190 804 %%action
a8289c62 805 }
f508cb0a 806#line %%line "%%skeleton"
10fa2066
RS
807\f
808 yyvsp -= yylen;
809 yyssp -= yylen;
5af1f549 810#if YYLSP_NEEDED
10fa2066
RS
811 yylsp -= yylen;
812#endif
813
5a35a6cb 814#if YYDEBUG
17da6427 815 if (yydebug)
10fa2066
RS
816 {
817 short *ssp1 = yyss - 1;
818 fprintf (stderr, "state stack now");
819 while (ssp1 != yyssp)
820 fprintf (stderr, " %d", *++ssp1);
821 fprintf (stderr, "\n");
822 }
5a35a6cb 823#endif
10fa2066
RS
824
825 *++yyvsp = yyval;
5af1f549 826#if YYLSP_NEEDED
6666f98f 827 *++yylsp = yyloc;
10fa2066
RS
828#endif
829
41aca2e0
AD
830 /* Now `shift' the result of the reduction. Determine what state
831 that goes to, based on the state we popped back to and the rule
832 number reduced by. */
10fa2066
RS
833
834 yyn = yyr1[yyn];
835
836 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
837 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
838 yystate = yytable[yystate];
839 else
840 yystate = yydefgoto[yyn - YYNTBASE];
841
842 goto yynewstate;
843
10fa2066 844
71da9eea
AD
845/*------------------------------------.
846| yyerrlab -- here on detecting error |
847`------------------------------------*/
848yyerrlab:
849 /* If not already recovering from an error, report this error. */
850 if (!yyerrstatus)
10fa2066 851 {
17da6427 852 ++yynerrs;
10fa2066 853
8850be4b 854#if YYERROR_VERBOSE
10fa2066
RS
855 yyn = yypact[yystate];
856
857 if (yyn > YYFLAG && yyn < YYLAST)
858 {
600f9b0c 859 size_t size = 0;
10fa2066
RS
860 char *msg;
861 int x, count;
862
863 count = 0;
f0473484
AD
864 /* Start X at -YYN if negative to avoid negative indexes in
865 YYCHECK. */
866 for (x = yyn < 0 ? -yyn : 0;
3419715d 867 x < (int) (sizeof (yytname) / sizeof (char *)); x++)
10fa2066 868 if (yycheck[x + yyn] == x)
71da9eea 869 size += strlen (yytname[x]) + 15, count++;
f0473484 870 size += strlen ("parse error, unexpected ") + 1;
17da6427 871 size += strlen (yytname[YYTRANSLATE (yychar)]);
75bbe78d 872 msg = (char *) malloc (size);
10fa2066
RS
873 if (msg != 0)
874 {
f0473484 875 strcpy (msg, "parse error, unexpected ");
17da6427 876 strcat (msg, yytname[YYTRANSLATE (yychar)]);
10fa2066
RS
877
878 if (count < 5)
879 {
880 count = 0;
f0473484 881 for (x = yyn < 0 ? -yyn : 0;
a8289c62 882 x < (int) (sizeof (yytname) / sizeof (char *)); x++)
10fa2066
RS
883 if (yycheck[x + yyn] == x)
884 {
f0473484 885 strcat (msg, count == 0 ? ", expecting " : " or ");
a8289c62 886 strcat (msg, yytname[x]);
10fa2066
RS
887 count++;
888 }
889 }
17da6427 890 yyerror (msg);
75bbe78d 891 free (msg);
10fa2066 892 }
a8289c62 893 else
f0473484 894 yyerror ("parse error; also virtual memory exhausted");
a8289c62 895 }
10fa2066 896 else
8850be4b 897#endif /* YYERROR_VERBOSE */
17da6427 898 yyerror ("parse error");
10fa2066 899 }
10fa2066 900 goto yyerrlab1;
10fa2066 901
71da9eea 902
e8cb70b9
PB
903/*----------------------------------------------------.
904| yyerrlab1 -- error raised explicitly by an action. |
905`----------------------------------------------------*/
71da9eea 906yyerrlab1:
10fa2066
RS
907 if (yyerrstatus == 3)
908 {
71da9eea
AD
909 /* If just tried and failed to reuse lookahead token after an
910 error, discard it. */
10fa2066 911
e8cb70b9 912 /* Return failure if at end of input. */
17da6427 913 if (yychar == YYEOF)
10fa2066 914 YYABORT;
5a35a6cb 915 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
17da6427
PB
916 yychar, yytname[yychar1]));
917 yychar = YYEMPTY;
10fa2066
RS
918 }
919
71da9eea
AD
920 /* Else will try to reuse lookahead token after shifting the error
921 token. */
10fa2066 922
e8cb70b9 923 yyerrstatus = 3; /* Each real token shifted decrements this. */
10fa2066
RS
924
925 goto yyerrhandle;
926
10fa2066 927
71da9eea
AD
928/*-------------------------------------------------------------------.
929| yyerrdefault -- current state does not do anything special for the |
930| error token. |
931`-------------------------------------------------------------------*/
932yyerrdefault:
10fa2066
RS
933#if 0
934 /* This is wrong; only states that explicitly want error tokens
935 should shift them. */
71da9eea
AD
936
937 /* If its default is to accept any token, ok. Otherwise pop it. */
938 yyn = yydefact[yystate];
939 if (yyn)
940 goto yydefault;
10fa2066
RS
941#endif
942
10fa2066 943
71da9eea
AD
944/*---------------------------------------------------------------.
945| yyerrpop -- pop the current state because it cannot handle the |
e8cb70b9 946| error token. |
71da9eea
AD
947`---------------------------------------------------------------*/
948yyerrpop:
949 if (yyssp == yyss)
950 YYABORT;
10fa2066
RS
951 yyvsp--;
952 yystate = *--yyssp;
5af1f549 953#if YYLSP_NEEDED
10fa2066
RS
954 yylsp--;
955#endif
956
5a35a6cb 957#if YYDEBUG
17da6427 958 if (yydebug)
10fa2066
RS
959 {
960 short *ssp1 = yyss - 1;
961 fprintf (stderr, "Error: state stack now");
962 while (ssp1 != yyssp)
963 fprintf (stderr, " %d", *++ssp1);
964 fprintf (stderr, "\n");
965 }
5a35a6cb 966#endif
10fa2066 967
71da9eea
AD
968/*--------------.
969| yyerrhandle. |
970`--------------*/
971yyerrhandle:
10fa2066
RS
972 yyn = yypact[yystate];
973 if (yyn == YYFLAG)
974 goto yyerrdefault;
975
976 yyn += YYTERROR;
977 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
978 goto yyerrdefault;
979
980 yyn = yytable[yyn];
981 if (yyn < 0)
982 {
983 if (yyn == YYFLAG)
984 goto yyerrpop;
985 yyn = -yyn;
986 goto yyreduce;
987 }
988 else if (yyn == 0)
989 goto yyerrpop;
990
991 if (yyn == YYFINAL)
992 YYACCEPT;
993
5a35a6cb 994 YYDPRINTF ((stderr, "Shifting error token, "));
10fa2066 995
17da6427 996 *++yyvsp = yylval;
5af1f549 997#if YYLSP_NEEDED
10fa2066
RS
998 *++yylsp = yylloc;
999#endif
1000
1001 yystate = yyn;
1002 goto yynewstate;
70ddf897 1003
71da9eea
AD
1004
1005/*-------------------------------------.
1006| yyacceptlab -- YYACCEPT comes here. |
1007`-------------------------------------*/
1008yyacceptlab:
600f9b0c
PE
1009 yyresult = 0;
1010 goto yyreturn;
71da9eea
AD
1011
1012/*-----------------------------------.
1013| yyabortlab -- YYABORT comes here. |
1014`-----------------------------------*/
1015yyabortlab:
600f9b0c
PE
1016 yyresult = 1;
1017 goto yyreturn;
1018
1019/*---------------------------------------------.
1020| yyoverflowab -- parser overflow comes here. |
1021`---------------------------------------------*/
1022yyoverflowlab:
1023 yyerror ("parser stack overflow");
1024 yyresult = 2;
1025 /* Fall through. */
1026
1027yyreturn:
1028#ifndef yyoverflow
1029 if (yyss != yyssa)
1030 YYSTACK_FREE (yyss);
70ddf897 1031#endif
600f9b0c 1032 return yyresult;
10fa2066 1033}
ff48177d 1034
5b5d1929 1035#line %%input-line "%%filename"
63c2d5de 1036%%epilogue