]> git.saurik.com Git - bison.git/blame - src/bison.simple
* src/nullable.c (set_nullable): Useless rules must be skipped,
[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
7093d0f5
AD
34/* Identify Bison output. */
35#define YYBISON 1
fd51e5ff 36
7093d0f5
AD
37/* Pure parsers. */
38#define YYPURE %%pure
39
40/* Using locations. */
41#define YYLSP_NEEDED %%locations-flag
42
43/* Enabling traces. */
44#ifndef YYDEBUG
45# define YYDEBUG %%debug
46#endif
47
48/* Enabling verbose error messages. */
49#undef YYERROR_VERBOSE
50#define YYERROR_VERBOSE %%error-verbose
a8289c62 51
17da6427
PB
52/* If name_prefix is specify substitute the variables and functions
53 names. */
54#define yyparse %%prefix##parse
fd51e5ff 55#define yylex %%prefix##lex
17da6427 56#define yyerror %%prefix##error
fd51e5ff
AD
57#define yylval %%prefix##lval
58#define yychar %%prefix##char
17da6427
PB
59#define yydebug %%prefix##debug
60#define yynerrs %%prefix##nerrs
61
fd51e5ff
AD
62#ifndef YYSTYPE
63typedef %%stype yystype;
64# define YYSTYPE yystype
65#endif
66
67#ifndef YYLTYPE
68typedef struct yyltype
69{
70 int first_line;
71 int first_column;
72 int last_line;
73 int last_column;
74} yyltype;
75# define YYLTYPE %%ltype
76#endif
77
7093d0f5 78/* Copy the user declarations. */
7093d0f5
AD
79%%prologue
80
fd51e5ff 81#line %%line "%%skeleton"
7093d0f5
AD
82
83#include <stdio.h>
84
7093d0f5
AD
85/* All symbols defined below should begin with yy or YY, to avoid
86 infringing on user name space. This should be done even for local
87 variables, as they might otherwise be expanded by user macros.
88 There are some unavoidable exceptions within include files to
b7575ffe 89 define necessary library symbols; they are noted "INFRINGES ON
7093d0f5
AD
90 USER NAME SPACE" below. */
91
92#if ! defined (yyoverflow) || YYERROR_VERBOSE
93
94/* The parser invokes alloca or malloc; define the necessary symbols. */
95
96# if YYSTACK_USE_ALLOCA
97# define YYSTACK_ALLOC alloca
98# define YYSIZE_T size_t
99# else
100# ifndef YYSTACK_USE_ALLOCA
101# if defined (alloca) || defined (_ALLOCA_H)
102# define YYSTACK_ALLOC alloca
103# define YYSIZE_T size_t
104# else
105# if defined (__GNUC__) || defined (_AIX) || defined (__hpux)
106# define YYSTACK_ALLOC __builtin_alloca
107# endif
108# ifndef __GNUC__
109# ifdef _AIX
110 # pragma alloca
111# endif
112# if defined (__sgi) || defined (__sparc__) || defined (__sparc) || defined (__sun)
113# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
114# define YYSTACK_ALLOC alloca
115# define YYSIZE_T size_t
116# endif
117# endif
118# endif
119# endif
120# endif
121
122# ifdef YYSTACK_ALLOC
123 /* Pacify GCC's `empty if-body' warning. */
124# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
125# else
b7575ffe
PE
126# ifdef __cplusplus
127# include <cstdlib> /* INFRINGES ON USER NAME SPACE */
128# define YYSIZE_T std::size_t
129# define YYSTACK_ALLOC std::malloc
130# define YYSTACK_FREE std::free
131# else
132# ifdef __STDC__
133# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
134# define YYSIZE_T size_t
135# endif
136# define YYSTACK_ALLOC malloc
137# define YYSTACK_FREE free
7093d0f5
AD
138# endif
139# endif
140
600f9b0c
PE
141/* A type that is properly aligned for any stack member. */
142union yyalloc
143{
2729e106
PE
144 short yyss;
145 YYSTYPE yyvs;
7093d0f5 146# if YYLSP_NEEDED
2729e106 147 YYLTYPE yyls;
7093d0f5 148# endif
600f9b0c
PE
149};
150
151/* The size of the maximum gap between one aligned stack and the next. */
7093d0f5 152# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
600f9b0c
PE
153
154/* The size of an array large to enough to hold all stacks, each with
155 N elements. */
7093d0f5
AD
156# if YYLSP_NEEDED
157# define YYSTACK_BYTES(N) \
600f9b0c
PE
158 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
159 + 2 * YYSTACK_GAP_MAX)
7093d0f5
AD
160# else
161# define YYSTACK_BYTES(N) \
600f9b0c
PE
162 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
163 + YYSTACK_GAP_MAX)
7093d0f5 164# endif
600f9b0c
PE
165
166/* Relocate the TYPE STACK from its old location to the new one. The
7093d0f5 167 local variables YYSIZE and YYSTACKSIZE give the old and new number of
600f9b0c
PE
168 elements in the stack, and YYPTR gives the new location of the
169 stack. Advance YYPTR to a properly aligned location for the next
170 stack. */
7093d0f5
AD
171# define YYSTACK_RELOCATE(Type, Stack) \
172 do \
173 { \
174 YYSIZE_T yynewbytes; \
2729e106 175 yymemcpy ((char *) yyptr, (char *) (Stack), \
7093d0f5 176 yysize * (YYSIZE_T) sizeof (Type)); \
2729e106 177 Stack = &yyptr->Stack; \
7093d0f5 178 yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
2729e106 179 yyptr += yynewbytes / sizeof (*yyptr); \
7093d0f5
AD
180 } \
181 while (0)
182
183#endif /* ! defined (yyoverflow) || YYERROR_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
7093d0f5
AD
285
286#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
287# define YYSIZE_T __SIZE_TYPE__
288#endif
289#if ! defined (YYSIZE_T) && defined (size_t)
290# define YYSIZE_T size_t
291#endif
b7575ffe
PE
292#if ! defined (YYSIZE_T)
293# ifdef __cplusplus
294# include <cstddef> /* INFRINGES ON USER NAME SPACE */
295# define YYSIZE_T std::size_t
296# else
297# ifdef __STDC__
298# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
299# define YYSIZE_T size_t
300# endif
301# endif
7093d0f5
AD
302#endif
303#if ! defined (YYSIZE_T)
304# define YYSIZE_T unsigned int
305#endif
306
10fa2066 307#define yyerrok (yyerrstatus = 0)
17da6427 308#define yyclearin (yychar = YYEMPTY)
10fa2066
RS
309#define YYEMPTY -2
310#define YYEOF 0
a8289c62 311
70ddf897 312#define YYACCEPT goto yyacceptlab
a8289c62 313#define YYABORT goto yyabortlab
10fa2066 314#define YYERROR goto yyerrlab1
a8289c62 315
71da9eea
AD
316/* Like YYERROR except do call yyerror. This remains here temporarily
317 to ease the transition to the new meaning of YYERROR, for GCC.
10fa2066 318 Once GCC version 2 has supplanted version 1, this can go. */
a8289c62 319
10fa2066 320#define YYFAIL goto yyerrlab
a8289c62 321
10fa2066 322#define YYRECOVERING() (!!yyerrstatus)
a8289c62 323
69b4e0c5 324#define YYBACKUP(Token, Value) \
10fa2066 325do \
17da6427 326 if (yychar == YYEMPTY && yylen == 1) \
71da9eea 327 { \
17da6427
PB
328 yychar = (Token); \
329 yylval = (Value); \
330 yychar1 = YYTRANSLATE (yychar); \
10fa2066
RS
331 YYPOPSTACK; \
332 goto yybackup; \
333 } \
334 else \
71da9eea 335 { \
17da6427 336 yyerror ("syntax error: cannot back up"); \
71da9eea
AD
337 YYERROR; \
338 } \
10fa2066
RS
339while (0)
340
341#define YYTERROR 1
342#define YYERRCODE 256
343
3abcd459
AD
344/* YYLLOC_DEFAULT -- Compute the default location (before the actions
345 are run).
346
347 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
348 first token. By default, to implement support for ranges, extend
349 its range to the last symbol. */
350
351#ifndef YYLLOC_DEFAULT
ca96bc2d
MA
352# define YYLLOC_DEFAULT(Current, Rhs, N) \
353 Current.last_line = Rhs[N].last_line; \
354 Current.last_column = Rhs[N].last_column;
3abcd459
AD
355#endif
356
3abcd459 357/* YYLEX -- calling `yylex' with the right arguments. */
553e2b22
AD
358
359#if YYPURE
5af1f549 360# if YYLSP_NEEDED
b07b484a 361# ifdef YYLEX_PARAM
17da6427 362# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
b07b484a 363# else
17da6427 364# define YYLEX yylex (&yylval, &yylloc)
b07b484a 365# endif
71da9eea 366# else /* !YYLSP_NEEDED */
b07b484a 367# ifdef YYLEX_PARAM
17da6427 368# define YYLEX yylex (&yylval, YYLEX_PARAM)
b07b484a 369# else
17da6427 370# define YYLEX yylex (&yylval)
b07b484a 371# endif
71da9eea 372# endif /* !YYLSP_NEEDED */
553e2b22 373#else /* !YYPURE */
17da6427 374# define YYLEX yylex ()
553e2b22
AD
375#endif /* !YYPURE */
376
5a35a6cb 377/* Enable debugging if requested. */
0d533154 378#if YYDEBUG
b7575ffe
PE
379
380# ifndef YYFPRINTF
381# ifdef __cplusplus
382# include <cstdio.h> /* INFRINGES ON USER NAME SPACE */
383# define YYFPRINTF std::fprintf
384# define YYSTDERR std::stderr
385# else
386# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
387# define YYFPRINTF fprintf
388# define YYSTDERR stderr
389# endif
390# endif
391
5a35a6cb
AD
392# define YYDPRINTF(Args) \
393do { \
17da6427 394 if (yydebug) \
b7575ffe 395 YYFPRINTF Args; \
5a35a6cb
AD
396} while (0)
397/* Nonzero means print parse trace. [The following comment makes no
398 sense to me. Could someone clarify it? --akim] Since this is
399 uninitialized, it does not stop multiple parsers from coexisting.
400 */
17da6427 401int yydebug;
5a35a6cb
AD
402#else /* !YYDEBUG */
403# define YYDPRINTF(Args)
404#endif /* !YYDEBUG */
405
406/* YYINITDEPTH -- initial size of the parser's stacks. */
10fa2066 407#ifndef YYINITDEPTH
a8289c62 408# define YYINITDEPTH %%initdepth
10fa2066
RS
409#endif
410
5a35a6cb 411/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
600f9b0c
PE
412 if the built-in stack extension method is used).
413
414 Do not make this value too large; the results are undefined if
415 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
416 evaluated with infinite-precision integer arithmetic. */
417
10fa2066 418#if YYMAXDEPTH == 0
b07b484a 419# undef YYMAXDEPTH
10fa2066
RS
420#endif
421
422#ifndef YYMAXDEPTH
a8289c62 423# define YYMAXDEPTH %%maxdepth
10fa2066 424#endif
a8289c62 425
10fa2066 426\f
a8289c62 427
7093d0f5
AD
428#if ! defined (yyoverflow) && ! defined (yymemcpy)
429# if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
430# define yymemcpy __builtin_memcpy
431# else /* not GNU C or C++ */
10fa2066
RS
432
433/* This is the most reliable way to avoid incompatibilities
434 in available built-in functions on various systems. */
435static void
7093d0f5
AD
436# if defined (__STDC__) || defined (__cplusplus)
437yymemcpy (char *yyto, const char *yyfrom, YYSIZE_T yycount)
438# else
439yymemcpy (yyto, yyfrom, yycount)
440 char *yyto;
441 const char *yyfrom;
442 YYSIZE_T yycount;
443# endif
10fa2066 444{
7093d0f5
AD
445 register const char *yyf = yyfrom;
446 register char *yyt = yyto;
447 register YYSIZE_T yyi = yycount;
10fa2066 448
7093d0f5
AD
449 while (yyi-- != 0)
450 *yyt++ = *yyf++;
10fa2066 451}
7093d0f5 452# endif
bbb5bcc6 453#endif
a8289c62 454
7093d0f5
AD
455#if YYERROR_VERBOSE
456
457# ifndef yystrlen
458# if defined (__GLIBC__) && defined (_STRING_H)
459# define yystrlen strlen
460# else
461/* Return the length of YYSTR. */
462static YYSIZE_T
463# if defined (__STDC__) || defined (__cplusplus)
464yystrlen (const char *yystr)
465# else
466yystrlen (yystr)
467 const char *yystr;
468# endif
469{
470 register const char *yys = yystr;
471
472 while (*yys++ != '\0')
473 continue;
474
475 return yys - yystr - 1;
476}
477# endif
478# endif
479
480# ifndef yystpcpy
481# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
482# define yystpcpy stpcpy
483# else
484/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
485 YYDEST. */
486static char *
f11966ff
PE
487# if defined (__STDC__) || defined (__cplusplus)
488yystpcpy (char *yydest, const char *yysrc)
489# else
7093d0f5
AD
490yystpcpy (yydest, yysrc)
491 char *yydest;
492 const char *yysrc;
7093d0f5
AD
493# endif
494{
495 register char *yyd = yydest;
496 register const char *yys = yysrc;
497
498 while ((*yyd++ = *yys++) != '\0')
499 continue;
500
501 return yyd - 1;
502}
503# endif
504# endif
505
506#endif /* !YYERROR_VERBOSE */
507
10fa2066 508\f
a8289c62 509
f508cb0a 510#line %%line "%%skeleton"
b658bf92
RS
511
512/* The user can define YYPARSE_PARAM as the name of an argument to be passed
513 into yyparse. The argument should have type void *.
514 It should actually point to an object.
515 Grammar actions can access the variable by casting it
516 to the proper pointer type. */
517
518#ifdef YYPARSE_PARAM
b07b484a
AD
519# ifdef __cplusplus
520# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
521# define YYPARSE_PARAM_DECL
71da9eea 522# else /* !__cplusplus */
b07b484a
AD
523# define YYPARSE_PARAM_ARG YYPARSE_PARAM
524# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
71da9eea
AD
525# endif /* !__cplusplus */
526#else /* !YYPARSE_PARAM */
b07b484a
AD
527# define YYPARSE_PARAM_ARG
528# define YYPARSE_PARAM_DECL
71da9eea 529#endif /* !YYPARSE_PARAM */
b658bf92 530
1b181651
PE
531/* Prevent warning if -Wstrict-prototypes. */
532#ifdef __GNUC__
b07b484a 533# ifdef YYPARSE_PARAM
17da6427 534int yyparse (void *);
b07b484a 535# else
17da6427 536int yyparse (void);
b07b484a 537# endif
1b181651
PE
538#endif
539
a35f64ea
AD
540/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
541 variables are global, or local to YYPARSE. */
542
7093d0f5 543#define YY_DECL_NON_LSP_VARIABLES \
a35f64ea 544/* The lookahead symbol. */ \
17da6427 545int yychar; \
a35f64ea 546 \
e8cb70b9 547/* The semantic value of the lookahead symbol. */ \
17da6427 548YYSTYPE yylval; \
a35f64ea
AD
549 \
550/* Number of parse errors so far. */ \
17da6427 551int yynerrs;
a35f64ea
AD
552
553#if YYLSP_NEEDED
554# define YY_DECL_VARIABLES \
7093d0f5 555YY_DECL_NON_LSP_VARIABLES \
a35f64ea
AD
556 \
557/* Location data for the lookahead symbol. */ \
558YYLTYPE yylloc;
559#else
560# define YY_DECL_VARIABLES \
7093d0f5 561YY_DECL_NON_LSP_VARIABLES
a35f64ea
AD
562#endif
563
e8cb70b9 564/* If nonreentrant, generate the variables here. */
a35f64ea
AD
565
566#if !YYPURE
567YY_DECL_VARIABLES
568#endif /* !YYPURE */
569
10fa2066 570int
17da6427 571yyparse (YYPARSE_PARAM_ARG)
b658bf92 572 YYPARSE_PARAM_DECL
10fa2066 573{
e8cb70b9 574 /* If reentrant, generate the variables here. */
a35f64ea
AD
575#if YYPURE
576 YY_DECL_VARIABLES
577#endif /* !YYPURE */
578
10fa2066
RS
579 register int yystate;
580 register int yyn;
600f9b0c 581 int yyresult;
b07b484a
AD
582 /* Number of tokens to shift before error messages enabled. */
583 int yyerrstatus;
584 /* Lookahead token as an internal (translated) token number. */
585 int yychar1 = 0;
10fa2066 586
bb10be54
AD
587 /* Three stacks and their tools:
588 `yyss': related to states,
e9e4c321 589 `yyvs': related to semantic values,
bb10be54
AD
590 `yyls': related to locations.
591
592 Refer to the stacks thru separate pointers, to allow yyoverflow
593 to reallocate them elsewhere. */
594
e8cb70b9 595 /* The state stack. */
b07b484a 596 short yyssa[YYINITDEPTH];
bb10be54
AD
597 short *yyss = yyssa;
598 register short *yyssp;
599
b07b484a
AD
600 /* The semantic value stack. */
601 YYSTYPE yyvsa[YYINITDEPTH];
b07b484a 602 YYSTYPE *yyvs = yyvsa;
bb10be54 603 register YYSTYPE *yyvsp;
10fa2066 604
5af1f549 605#if YYLSP_NEEDED
b07b484a
AD
606 /* The location stack. */
607 YYLTYPE yylsa[YYINITDEPTH];
10fa2066
RS
608 YYLTYPE *yyls = yylsa;
609 YYLTYPE *yylsp;
bb10be54 610#endif
10fa2066 611
5af1f549 612#if YYLSP_NEEDED
b07b484a 613# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
10fa2066 614#else
b07b484a 615# define YYPOPSTACK (yyvsp--, yyssp--)
10fa2066
RS
616#endif
617
7093d0f5 618 YYSIZE_T yystacksize = YYINITDEPTH;
10fa2066 619
6666f98f
AD
620 /* The variables used to return semantic value and location from the
621 action routines. */
bb10be54 622 YYSTYPE yyval;
7093d0f5 623#if YYLSP_NEEDED
6666f98f 624 YYLTYPE yyloc;
7093d0f5 625#endif
10fa2066 626
6666f98f 627 /* When reducing, the number of symbols on the RHS of the reduced
e8cb70b9 628 rule. */
10fa2066
RS
629 int yylen;
630
b7575ffe 631 YYDPRINTF ((YYSTDERR, "Starting parse\n"));
10fa2066
RS
632
633 yystate = 0;
634 yyerrstatus = 0;
17da6427
PB
635 yynerrs = 0;
636 yychar = YYEMPTY; /* Cause a token to be read. */
10fa2066
RS
637
638 /* Initialize stack pointers.
639 Waste one element of value and location stack
640 so that they stay on the same level as the state stack.
641 The wasted elements are never initialized. */
642
cbd89906 643 yyssp = yyss;
10fa2066 644 yyvsp = yyvs;
5af1f549 645#if YYLSP_NEEDED
10fa2066
RS
646 yylsp = yyls;
647#endif
cbd89906 648 goto yysetstate;
10fa2066 649
71da9eea
AD
650/*------------------------------------------------------------.
651| yynewstate -- Push a new state, which is found in yystate. |
652`------------------------------------------------------------*/
342b8b6e 653 yynewstate:
71da9eea
AD
654 /* In all cases, when you get here, the value and location stacks
655 have just been pushed. so pushing a state here evens the stacks.
656 */
cbd89906
PE
657 yyssp++;
658
342b8b6e 659 yysetstate:
cbd89906 660 *yyssp = yystate;
10fa2066
RS
661
662 if (yyssp >= yyss + yystacksize - 1)
663 {
10fa2066 664 /* Get the current used size of the three stacks, in elements. */
7093d0f5 665 YYSIZE_T yysize = yyssp - yyss + 1;
10fa2066
RS
666
667#ifdef yyoverflow
3d76b07d
AD
668 {
669 /* Give user a chance to reallocate the stack. Use copies of
670 these so that the &'s don't force the real ones into
671 memory. */
672 YYSTYPE *yyvs1 = yyvs;
673 short *yyss1 = yyss;
674
675 /* Each stack pointer address is followed by the size of the
676 data in use in that stack, in bytes. */
5af1f549 677# if YYLSP_NEEDED
3d76b07d
AD
678 YYLTYPE *yyls1 = yyls;
679 /* This used to be a conditional around just the two extra args,
680 but that might be undefined if yyoverflow is a macro. */
681 yyoverflow ("parser stack overflow",
7093d0f5
AD
682 &yyss1, yysize * sizeof (*yyssp),
683 &yyvs1, yysize * sizeof (*yyvsp),
684 &yyls1, yysize * sizeof (*yylsp),
3d76b07d
AD
685 &yystacksize);
686 yyls = yyls1;
b07b484a 687# else
3d76b07d 688 yyoverflow ("parser stack overflow",
7093d0f5
AD
689 &yyss1, yysize * sizeof (*yyssp),
690 &yyvs1, yysize * sizeof (*yyvsp),
3d76b07d 691 &yystacksize);
b07b484a 692# endif
3d76b07d
AD
693 yyss = yyss1;
694 yyvs = yyvs1;
695 }
10fa2066
RS
696#else /* no yyoverflow */
697 /* Extend the stack our own way. */
698 if (yystacksize >= YYMAXDEPTH)
600f9b0c 699 goto yyoverflowlab;
10fa2066
RS
700 yystacksize *= 2;
701 if (yystacksize > YYMAXDEPTH)
702 yystacksize = YYMAXDEPTH;
e9e4c321 703
600f9b0c
PE
704 {
705 short *yyss1 = yyss;
2729e106
PE
706 union yyalloc *yyptr =
707 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
600f9b0c
PE
708 if (! yyptr)
709 goto yyoverflowlab;
710 YYSTACK_RELOCATE (short, yyss);
711 YYSTACK_RELOCATE (YYSTYPE, yyvs);
5af1f549 712# if YYLSP_NEEDED
600f9b0c 713 YYSTACK_RELOCATE (YYLTYPE, yyls);
b07b484a 714# endif
600f9b0c
PE
715# undef YYSTACK_RELOCATE
716 if (yyss1 != yyssa)
717 YYSTACK_FREE (yyss1);
718 }
10fa2066
RS
719#endif /* no yyoverflow */
720
7093d0f5
AD
721 yyssp = yyss + yysize - 1;
722 yyvsp = yyvs + yysize - 1;
5af1f549 723#if YYLSP_NEEDED
7093d0f5 724 yylsp = yyls + yysize - 1;
10fa2066
RS
725#endif
726
b7575ffe 727 YYDPRINTF ((YYSTDERR, "Stack size increased to %lu\n",
600f9b0c 728 (unsigned long int) yystacksize));
10fa2066
RS
729
730 if (yyssp >= yyss + yystacksize - 1)
731 YYABORT;
732 }
733
b7575ffe 734 YYDPRINTF ((YYSTDERR, "Entering state %d\n", yystate));
10fa2066
RS
735
736 goto yybackup;
71da9eea 737
71da9eea
AD
738/*-----------.
739| yybackup. |
740`-----------*/
741yybackup:
10fa2066
RS
742
743/* Do appropriate processing given the current state. */
744/* Read a lookahead token if we need one and don't already have one. */
745/* yyresume: */
746
747 /* First try to decide what to do without reference to lookahead token. */
748
749 yyn = yypact[yystate];
750 if (yyn == YYFLAG)
751 goto yydefault;
752
753 /* Not known => get a lookahead token if don't already have one. */
754
755 /* yychar is either YYEMPTY or YYEOF
756 or a valid token in external form. */
757
17da6427 758 if (yychar == YYEMPTY)
10fa2066 759 {
b7575ffe 760 YYDPRINTF ((YYSTDERR, "Reading a token: "));
17da6427 761 yychar = YYLEX;
10fa2066
RS
762 }
763
e8cb70b9 764 /* Convert token to internal form (in yychar1) for indexing tables with. */
10fa2066 765
17da6427 766 if (yychar <= 0) /* This means end of input. */
10fa2066
RS
767 {
768 yychar1 = 0;
17da6427 769 yychar = YYEOF; /* Don't call YYLEX any more. */
10fa2066 770
b7575ffe 771 YYDPRINTF ((YYSTDERR, "Now at end of input.\n"));
10fa2066
RS
772 }
773 else
774 {
17da6427 775 yychar1 = YYTRANSLATE (yychar);
10fa2066 776
0d533154
AD
777#if YYDEBUG
778 /* We have to keep this `#if YYDEBUG', since we use variables
779 which are defined only if `YYDEBUG' is set. */
17da6427 780 if (yydebug)
10fa2066 781 {
b7575ffe
PE
782 YYFPRINTF (YYSTDERR, "Next token is %d (%s",
783 yychar, yytname[yychar1]);
0d533154
AD
784 /* Give the individual parser a way to print the precise
785 meaning of a token, for further debugging info. */
b07b484a 786# ifdef YYPRINT
b7575ffe 787 YYPRINT (YYSTDERR, yychar, yylval);
b07b484a 788# endif
b7575ffe 789 YYFPRINTF (YYSTDERR, ")\n");
10fa2066 790 }
0d533154 791#endif
10fa2066
RS
792 }
793
794 yyn += yychar1;
795 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
796 goto yydefault;
797
798 yyn = yytable[yyn];
799
800 /* yyn is what to do for this token type in this state.
801 Negative => reduce, -yyn is rule number.
802 Positive => shift, yyn is new state.
803 New state is final state => don't bother to shift,
804 just return success.
805 0, or most negative number => error. */
806
807 if (yyn < 0)
808 {
809 if (yyn == YYFLAG)
810 goto yyerrlab;
811 yyn = -yyn;
812 goto yyreduce;
813 }
814 else if (yyn == 0)
815 goto yyerrlab;
816
817 if (yyn == YYFINAL)
818 YYACCEPT;
819
820 /* Shift the lookahead token. */
b7575ffe
PE
821 YYDPRINTF ((YYSTDERR, "Shifting token %d (%s), ",
822 yychar, yytname[yychar1]));
10fa2066
RS
823
824 /* Discard the token being shifted unless it is eof. */
17da6427
PB
825 if (yychar != YYEOF)
826 yychar = YYEMPTY;
10fa2066 827
17da6427 828 *++yyvsp = yylval;
5af1f549 829#if YYLSP_NEEDED
10fa2066
RS
830 *++yylsp = yylloc;
831#endif
832
71da9eea
AD
833 /* Count tokens shifted since error; after three, turn off error
834 status. */
835 if (yyerrstatus)
836 yyerrstatus--;
10fa2066
RS
837
838 yystate = yyn;
839 goto yynewstate;
840
10fa2066 841
71da9eea
AD
842/*-----------------------------------------------------------.
843| yydefault -- do the default action for the current state. |
844`-----------------------------------------------------------*/
845yydefault:
10fa2066
RS
846 yyn = yydefact[yystate];
847 if (yyn == 0)
848 goto yyerrlab;
71da9eea 849 goto yyreduce;
10fa2066 850
71da9eea
AD
851
852/*-----------------------------.
853| yyreduce -- Do a reduction. |
854`-----------------------------*/
10fa2066 855yyreduce:
71da9eea 856 /* yyn is the number of a rule to reduce with. */
10fa2066 857 yylen = yyr2[yyn];
da9abf43
AD
858
859 /* If YYLEN is nonzero, implement the default value of the action:
573c1d9f 860 `$$ = $1'.
da9abf43
AD
861
862 Otherwise, the following line sets YYVAL to the semantic value of
863 the lookahead token. This behavior is undocumented and Bison
864 users should not rely upon it. Assigning to YYVAL
865 unconditionally makes the parser a bit smaller, and it avoids a
866 GCC warning that YYVAL may be used uninitialized. */
867 yyval = yyvsp[1-yylen];
3abcd459 868
5af1f549 869#if YYLSP_NEEDED
3abcd459
AD
870 /* Similarly for the default location. Let the user run additional
871 commands if for instance locations are ranges. */
872 yyloc = yylsp[1-yylen];
ca96bc2d 873 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
6666f98f 874#endif
10fa2066 875
0de741ca
AD
876#if YYDEBUG
877 /* We have to keep this `#if YYDEBUG', since we use variables which
878 are defined only if `YYDEBUG' is set. */
17da6427 879 if (yydebug)
10fa2066 880 {
7093d0f5 881 int yyi;
10fa2066 882
b7575ffe
PE
883 YYFPRINTF (YYSTDERR, "Reducing via rule %d (line %d), ",
884 yyn, yyrline[yyn]);
10fa2066
RS
885
886 /* Print the symbols being reduced, and their result. */
7093d0f5 887 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
b7575ffe
PE
888 YYFPRINTF (YYSTDERR, "%s ", yytname[yyrhs[yyi]]);
889 YYFPRINTF (YYSTDERR, " -> %s\n", yytname[yyr1[yyn]]);
10fa2066
RS
890 }
891#endif
a8289c62
RA
892 switch (yyn)
893 {
3f96f4dc 894%%actions
a8289c62 895 }
f508cb0a 896#line %%line "%%skeleton"
10fa2066
RS
897\f
898 yyvsp -= yylen;
899 yyssp -= yylen;
5af1f549 900#if YYLSP_NEEDED
10fa2066
RS
901 yylsp -= yylen;
902#endif
903
5a35a6cb 904#if YYDEBUG
17da6427 905 if (yydebug)
10fa2066 906 {
7093d0f5 907 short *yyssp1 = yyss - 1;
b7575ffe 908 YYFPRINTF (YYSTDERR, "state stack now");
7093d0f5 909 while (yyssp1 != yyssp)
b7575ffe
PE
910 YYFPRINTF (YYSTDERR, " %d", *++yyssp1);
911 YYFPRINTF (YYSTDERR, "\n");
10fa2066 912 }
5a35a6cb 913#endif
10fa2066
RS
914
915 *++yyvsp = yyval;
5af1f549 916#if YYLSP_NEEDED
6666f98f 917 *++yylsp = yyloc;
10fa2066
RS
918#endif
919
41aca2e0
AD
920 /* Now `shift' the result of the reduction. Determine what state
921 that goes to, based on the state we popped back to and the rule
922 number reduced by. */
10fa2066
RS
923
924 yyn = yyr1[yyn];
925
926 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
927 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
928 yystate = yytable[yystate];
929 else
930 yystate = yydefgoto[yyn - YYNTBASE];
931
932 goto yynewstate;
933
10fa2066 934
71da9eea
AD
935/*------------------------------------.
936| yyerrlab -- here on detecting error |
937`------------------------------------*/
938yyerrlab:
939 /* If not already recovering from an error, report this error. */
940 if (!yyerrstatus)
10fa2066 941 {
17da6427 942 ++yynerrs;
10fa2066 943
8850be4b 944#if YYERROR_VERBOSE
10fa2066
RS
945 yyn = yypact[yystate];
946
947 if (yyn > YYFLAG && yyn < YYLAST)
948 {
7093d0f5
AD
949 YYSIZE_T yysize = 0;
950 char *yymsg;
951 int yyx, yycount;
10fa2066 952
7093d0f5
AD
953 yycount = 0;
954 /* Start YYX at -YYN if negative to avoid negative indexes in
f0473484 955 YYCHECK. */
7093d0f5
AD
956 for (yyx = yyn < 0 ? -yyn : 0;
957 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
958 if (yycheck[yyx + yyn] == yyx)
959 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
960 yysize += yystrlen ("parse error, unexpected ") + 1;
961 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
962 yymsg = (char *) YYSTACK_ALLOC (yysize);
963 if (yymsg != 0)
10fa2066 964 {
7093d0f5
AD
965 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
966 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
10fa2066 967
7093d0f5 968 if (yycount < 5)
10fa2066 969 {
7093d0f5
AD
970 yycount = 0;
971 for (yyx = yyn < 0 ? -yyn : 0;
972 yyx < (int) (sizeof (yytname) / sizeof (char *));
973 yyx++)
974 if (yycheck[yyx + yyn] == yyx)
10fa2066 975 {
7093d0f5
AD
976 const char *yyq = ! yycount ? ", expecting " : " or ";
977 yyp = yystpcpy (yyp, yyq);
978 yyp = yystpcpy (yyp, yytname[yyx]);
979 yycount++;
10fa2066
RS
980 }
981 }
7093d0f5
AD
982 yyerror (yymsg);
983 YYSTACK_FREE (yymsg);
984 }
985 else
986 yyerror ("parse error; also virtual memory exhausted");
a8289c62 987 }
10fa2066 988 else
b7575ffe 989#endif /* YYERROR_VERBOSE */
17da6427 990 yyerror ("parse error");
10fa2066 991 }
10fa2066 992 goto yyerrlab1;
10fa2066 993
71da9eea 994
e8cb70b9
PB
995/*----------------------------------------------------.
996| yyerrlab1 -- error raised explicitly by an action. |
997`----------------------------------------------------*/
71da9eea 998yyerrlab1:
10fa2066
RS
999 if (yyerrstatus == 3)
1000 {
71da9eea
AD
1001 /* If just tried and failed to reuse lookahead token after an
1002 error, discard it. */
10fa2066 1003
e8cb70b9 1004 /* Return failure if at end of input. */
17da6427 1005 if (yychar == YYEOF)
10fa2066 1006 YYABORT;
b7575ffe 1007 YYDPRINTF ((YYSTDERR, "Discarding token %d (%s).\n",
17da6427
PB
1008 yychar, yytname[yychar1]));
1009 yychar = YYEMPTY;
10fa2066
RS
1010 }
1011
71da9eea
AD
1012 /* Else will try to reuse lookahead token after shifting the error
1013 token. */
10fa2066 1014
e8cb70b9 1015 yyerrstatus = 3; /* Each real token shifted decrements this. */
10fa2066
RS
1016
1017 goto yyerrhandle;
1018
10fa2066 1019
71da9eea
AD
1020/*-------------------------------------------------------------------.
1021| yyerrdefault -- current state does not do anything special for the |
1022| error token. |
1023`-------------------------------------------------------------------*/
1024yyerrdefault:
10fa2066
RS
1025#if 0
1026 /* This is wrong; only states that explicitly want error tokens
1027 should shift them. */
71da9eea
AD
1028
1029 /* If its default is to accept any token, ok. Otherwise pop it. */
1030 yyn = yydefact[yystate];
1031 if (yyn)
1032 goto yydefault;
10fa2066
RS
1033#endif
1034
10fa2066 1035
71da9eea
AD
1036/*---------------------------------------------------------------.
1037| yyerrpop -- pop the current state because it cannot handle the |
e8cb70b9 1038| error token. |
71da9eea
AD
1039`---------------------------------------------------------------*/
1040yyerrpop:
1041 if (yyssp == yyss)
1042 YYABORT;
10fa2066
RS
1043 yyvsp--;
1044 yystate = *--yyssp;
5af1f549 1045#if YYLSP_NEEDED
10fa2066
RS
1046 yylsp--;
1047#endif
1048
5a35a6cb 1049#if YYDEBUG
17da6427 1050 if (yydebug)
10fa2066 1051 {
7093d0f5 1052 short *yyssp1 = yyss - 1;
b7575ffe 1053 YYFPRINTF (YYSTDERR, "Error: state stack now");
7093d0f5 1054 while (yyssp1 != yyssp)
b7575ffe
PE
1055 YYFPRINTF (YYSTDERR, " %d", *++yyssp1);
1056 YYFPRINTF (YYSTDERR, "\n");
10fa2066 1057 }
5a35a6cb 1058#endif
10fa2066 1059
71da9eea
AD
1060/*--------------.
1061| yyerrhandle. |
1062`--------------*/
1063yyerrhandle:
10fa2066
RS
1064 yyn = yypact[yystate];
1065 if (yyn == YYFLAG)
1066 goto yyerrdefault;
1067
1068 yyn += YYTERROR;
1069 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1070 goto yyerrdefault;
1071
1072 yyn = yytable[yyn];
1073 if (yyn < 0)
1074 {
1075 if (yyn == YYFLAG)
1076 goto yyerrpop;
1077 yyn = -yyn;
1078 goto yyreduce;
1079 }
1080 else if (yyn == 0)
1081 goto yyerrpop;
1082
1083 if (yyn == YYFINAL)
1084 YYACCEPT;
1085
b7575ffe 1086 YYDPRINTF ((YYSTDERR, "Shifting error token, "));
10fa2066 1087
17da6427 1088 *++yyvsp = yylval;
5af1f549 1089#if YYLSP_NEEDED
10fa2066
RS
1090 *++yylsp = yylloc;
1091#endif
1092
1093 yystate = yyn;
1094 goto yynewstate;
70ddf897 1095
71da9eea
AD
1096
1097/*-------------------------------------.
1098| yyacceptlab -- YYACCEPT comes here. |
1099`-------------------------------------*/
1100yyacceptlab:
600f9b0c
PE
1101 yyresult = 0;
1102 goto yyreturn;
71da9eea
AD
1103
1104/*-----------------------------------.
1105| yyabortlab -- YYABORT comes here. |
1106`-----------------------------------*/
1107yyabortlab:
600f9b0c
PE
1108 yyresult = 1;
1109 goto yyreturn;
1110
1111/*---------------------------------------------.
1112| yyoverflowab -- parser overflow comes here. |
1113`---------------------------------------------*/
1114yyoverflowlab:
1115 yyerror ("parser stack overflow");
1116 yyresult = 2;
1117 /* Fall through. */
1118
1119yyreturn:
1120#ifndef yyoverflow
1121 if (yyss != yyssa)
1122 YYSTACK_FREE (yyss);
70ddf897 1123#endif
600f9b0c 1124 return yyresult;
10fa2066 1125}
ff48177d 1126
63c2d5de 1127%%epilogue