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