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