]> git.saurik.com Git - bison.git/blame - src/bison.s1
* src/bison.s1 (yyparse): Reorganize the definitions of the stacks
[bison.git] / src / bison.s1
CommitLineData
10fa2066
RS
1/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
2#line 3 "bison.simple"
7d369561 3/* This file comes from bison-@bison_version@. */
10fa2066
RS
4
5/* Skeleton output parser for bison,
21b14802 6 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
10fa2066
RS
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
21b14802 10 the Free Software Foundation; either version 2, or (at your option)
10fa2066
RS
11 any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
c49a8e71
JT
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
10fa2066 22
c71f8bba
RS
23/* As a special exception, when this file is copied by Bison into a
24 Bison output file, you may use that output file without restriction.
25 This special exception was added by the Free Software Foundation
cfeaeb52 26 in version 1.24 of Bison. */
10fa2066 27
444fbf65
RS
28/* This is the parser code that is written into each bison parser
29 when the %semantic_parser declaration is not specified in the grammar.
30 It was written by Richard Stallman by simplifying the hairy parser
31 used when %semantic_parser is specified. */
32
70ddf897 33#ifndef YYSTACK_USE_ALLOCA
361f60b3
AD
34# ifdef alloca
35# define YYSTACK_USE_ALLOCA
36# else /* alloca not defined */
37# ifdef __GNUC__
38# define YYSTACK_USE_ALLOCA
39# define alloca __builtin_alloca
40# else /* not GNU C. */
41# if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
42# define YYSTACK_USE_ALLOCA
43# include <alloca.h>
44# else /* not sparc */
45 /* We think this test detects Watcom and Microsoft C. */
46 /* This used to test MSDOS, but that is a bad idea since that
47 symbol is in the user namespace. */
48# if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
49# if 0
50 /* No need for malloc.h, which pollutes the namespace; instead,
51 just don't use alloca. */
52# include <malloc.h>
53# endif
54# else /* not MSDOS, or __TURBOC__ */
55# if defined(_AIX)
56 /* I don't know what this was needed for, but it pollutes the
57 namespace. So I turned it off. rms, 2 May 1997. */
58 /* #include <malloc.h> */
10fa2066 59 #pragma alloca
361f60b3
AD
60# define YYSTACK_USE_ALLOCA
61# else /* not MSDOS, or __TURBOC__, or _AIX */
62# if 0
63 /* haible@ilog.fr says this works for HPUX 9.05 and up, and on
64 HPUX 10. Eventually we can turn this on. */
65# ifdef __hpux
66# define YYSTACK_USE_ALLOCA
67# define alloca __builtin_alloca
68# endif /* __hpux */
69# endif
70# endif /* not _AIX */
71# endif /* not MSDOS, or __TURBOC__ */
72# endif /* not sparc */
73# endif /* not GNU C */
74# endif /* alloca not defined */
70ddf897
RS
75#endif /* YYSTACK_USE_ALLOCA not defined */
76
77#ifdef YYSTACK_USE_ALLOCA
361f60b3 78# define YYSTACK_ALLOC alloca
70ddf897 79#else
361f60b3 80# define YYSTACK_ALLOC malloc
70ddf897 81#endif
10fa2066 82
10fa2066
RS
83/* Note: there must be only one dollar sign in this file.
84 It is replaced by the list of actions, each action
85 as one case of the switch. */
86
87#define yyerrok (yyerrstatus = 0)
88#define yyclearin (yychar = YYEMPTY)
89#define YYEMPTY -2
90#define YYEOF 0
70ddf897
RS
91#define YYACCEPT goto yyacceptlab
92#define YYABORT goto yyabortlab
10fa2066
RS
93#define YYERROR goto yyerrlab1
94/* Like YYERROR except do call yyerror.
95 This remains here temporarily to ease the
96 transition to the new meaning of YYERROR, for GCC.
97 Once GCC version 2 has supplanted version 1, this can go. */
98#define YYFAIL goto yyerrlab
99#define YYRECOVERING() (!!yyerrstatus)
100#define YYBACKUP(token, value) \
101do \
102 if (yychar == YYEMPTY && yylen == 1) \
103 { yychar = (token), yylval = (value); \
104 yychar1 = YYTRANSLATE (yychar); \
105 YYPOPSTACK; \
106 goto yybackup; \
107 } \
108 else \
109 { yyerror ("syntax error: cannot back up"); YYERROR; } \
110while (0)
111
112#define YYTERROR 1
113#define YYERRCODE 256
114
115#ifndef YYPURE
b07b484a 116# define YYLEX yylex()
10fa2066
RS
117#endif
118
119#ifdef YYPURE
b07b484a
AD
120# ifdef YYLSP_NEEDED
121# ifdef YYLEX_PARAM
122# define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
123# else
124# define YYLEX yylex(&yylval, &yylloc)
125# endif
126# else /* not YYLSP_NEEDED */
127# ifdef YYLEX_PARAM
128# define YYLEX yylex(&yylval, YYLEX_PARAM)
129# else
130# define YYLEX yylex(&yylval)
131# endif
132# endif /* not YYLSP_NEEDED */
10fa2066
RS
133#endif
134
135/* If nonreentrant, generate the variables here */
136
137#ifndef YYPURE
138
139int yychar; /* the lookahead symbol */
140YYSTYPE yylval; /* the semantic value of the */
141 /* lookahead symbol */
142
b07b484a 143# ifdef YYLSP_NEEDED
10fa2066
RS
144YYLTYPE yylloc; /* location data for the lookahead */
145 /* symbol */
b07b484a 146# endif
10fa2066
RS
147
148int yynerrs; /* number of parse errors so far */
149#endif /* not YYPURE */
150
151#if YYDEBUG != 0
152int yydebug; /* nonzero means print parse trace */
153/* Since this is uninitialized, it does not stop multiple parsers
154 from coexisting. */
155#endif
156
157/* YYINITDEPTH indicates the initial size of the parser's stacks */
158
159#ifndef YYINITDEPTH
b07b484a 160# define YYINITDEPTH 200
10fa2066
RS
161#endif
162
163/* YYMAXDEPTH is the maximum size the stacks can grow to
164 (effective only if the built-in stack extension method is used). */
165
166#if YYMAXDEPTH == 0
b07b484a 167# undef YYMAXDEPTH
10fa2066
RS
168#endif
169
170#ifndef YYMAXDEPTH
b07b484a 171# define YYMAXDEPTH 10000
10fa2066 172#endif
10fa2066 173\f
5e02f2ad
RS
174/* Define __yy_memcpy. Note that the size argument
175 should be passed with type unsigned int, because that is what the non-GCC
176 definitions require. With GCC, __builtin_memcpy takes an arg
177 of type size_t, but it can handle unsigned int. */
178
10fa2066 179#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
b07b484a 180# define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
10fa2066 181#else /* not GNU C or C++ */
b07b484a 182# ifndef __cplusplus
10fa2066
RS
183
184/* This is the most reliable way to avoid incompatibilities
185 in available built-in functions on various systems. */
186static void
c245d0d3 187__yy_memcpy (to, from, count)
10fa2066 188 char *to;
c245d0d3 189 char *from;
5e02f2ad 190 unsigned int count;
10fa2066
RS
191{
192 register char *f = from;
193 register char *t = to;
194 register int i = count;
195
196 while (i-- > 0)
197 *t++ = *f++;
198}
199
b07b484a 200# else /* __cplusplus */
10fa2066
RS
201
202/* This is the most reliable way to avoid incompatibilities
203 in available built-in functions on various systems. */
204static void
5e02f2ad 205__yy_memcpy (char *to, char *from, unsigned int count)
10fa2066 206{
10fa2066 207 register char *t = to;
4cf401b2 208 register char *f = from;
10fa2066
RS
209 register int i = count;
210
211 while (i-- > 0)
212 *t++ = *f++;
213}
214
b07b484a 215# endif
10fa2066
RS
216#endif
217\f
ca1d9e53 218#line 217 "bison.simple"
b658bf92
RS
219
220/* The user can define YYPARSE_PARAM as the name of an argument to be passed
221 into yyparse. The argument should have type void *.
222 It should actually point to an object.
223 Grammar actions can access the variable by casting it
224 to the proper pointer type. */
225
226#ifdef YYPARSE_PARAM
b07b484a
AD
227# ifdef __cplusplus
228# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
229# define YYPARSE_PARAM_DECL
230# else /* not __cplusplus */
231# define YYPARSE_PARAM_ARG YYPARSE_PARAM
232# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
233# endif /* not __cplusplus */
30f5b1cc 234#else /* not YYPARSE_PARAM */
b07b484a
AD
235# define YYPARSE_PARAM_ARG
236# define YYPARSE_PARAM_DECL
30f5b1cc 237#endif /* not YYPARSE_PARAM */
b658bf92 238
1b181651
PE
239/* Prevent warning if -Wstrict-prototypes. */
240#ifdef __GNUC__
b07b484a 241# ifdef YYPARSE_PARAM
1b181651 242int yyparse (void *);
b07b484a 243# else
1b181651 244int yyparse (void);
b07b484a 245# endif
1b181651
PE
246#endif
247
10fa2066 248int
30f5b1cc 249yyparse(YYPARSE_PARAM_ARG)
b658bf92 250 YYPARSE_PARAM_DECL
10fa2066
RS
251{
252 register int yystate;
253 register int yyn;
b07b484a
AD
254 /* Number of tokens to shift before error messages enabled. */
255 int yyerrstatus;
256 /* Lookahead token as an internal (translated) token number. */
257 int yychar1 = 0;
10fa2066 258
bb10be54
AD
259 /* Three stacks and their tools:
260 `yyss': related to states,
261 `yysv': related to semantic values,
262 `yyls': related to locations.
263
264 Refer to the stacks thru separate pointers, to allow yyoverflow
265 to reallocate them elsewhere. */
266
b07b484a
AD
267 /* The state stack. */
268 short yyssa[YYINITDEPTH];
bb10be54
AD
269 short *yyss = yyssa;
270 register short *yyssp;
271
b07b484a
AD
272 /* The semantic value stack. */
273 YYSTYPE yyvsa[YYINITDEPTH];
b07b484a 274 YYSTYPE *yyvs = yyvsa;
bb10be54 275 register YYSTYPE *yyvsp;
10fa2066
RS
276
277#ifdef YYLSP_NEEDED
b07b484a
AD
278 /* The location stack. */
279 YYLTYPE yylsa[YYINITDEPTH];
10fa2066
RS
280 YYLTYPE *yyls = yylsa;
281 YYLTYPE *yylsp;
bb10be54 282#endif
10fa2066 283
bb10be54 284#ifdef YYLSP_NEEDED
b07b484a 285# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
10fa2066 286#else
b07b484a 287# define YYPOPSTACK (yyvsp--, yyssp--)
10fa2066
RS
288#endif
289
290 int yystacksize = YYINITDEPTH;
70ddf897 291 int yyfree_stacks = 0;
10fa2066
RS
292
293#ifdef YYPURE
294 int yychar;
295 YYSTYPE yylval;
296 int yynerrs;
b07b484a 297# ifdef YYLSP_NEEDED
10fa2066 298 YYLTYPE yylloc;
b07b484a 299# endif
10fa2066
RS
300#endif
301
bb10be54
AD
302
303 /* The variable used to return semantic values from the action
304 routines. */
305 YYSTYPE yyval;
10fa2066
RS
306
307 int yylen;
308
309#if YYDEBUG != 0
310 if (yydebug)
311 fprintf(stderr, "Starting parse\n");
312#endif
313
314 yystate = 0;
315 yyerrstatus = 0;
316 yynerrs = 0;
317 yychar = YYEMPTY; /* Cause a token to be read. */
318
319 /* Initialize stack pointers.
320 Waste one element of value and location stack
321 so that they stay on the same level as the state stack.
322 The wasted elements are never initialized. */
323
324 yyssp = yyss - 1;
325 yyvsp = yyvs;
326#ifdef YYLSP_NEEDED
327 yylsp = yyls;
328#endif
329
330/* Push a new state, which is found in yystate . */
331/* In all cases, when you get here, the value and location stacks
332 have just been pushed. so pushing a state here evens the stacks. */
333yynewstate:
334
335 *++yyssp = yystate;
336
337 if (yyssp >= yyss + yystacksize - 1)
338 {
339 /* Give user a chance to reallocate the stack */
340 /* Use copies of these so that the &'s don't force the real ones into memory. */
341 YYSTYPE *yyvs1 = yyvs;
342 short *yyss1 = yyss;
343#ifdef YYLSP_NEEDED
344 YYLTYPE *yyls1 = yyls;
345#endif
346
347 /* Get the current used size of the three stacks, in elements. */
348 int size = yyssp - yyss + 1;
349
350#ifdef yyoverflow
351 /* Each stack pointer address is followed by the size of
352 the data in use in that stack, in bytes. */
b07b484a 353# ifdef YYLSP_NEEDED
be4bf877
RS
354 /* This used to be a conditional around just the two extra args,
355 but that might be undefined if yyoverflow is a macro. */
bb10be54
AD
356 yyoverflow ("parser stack overflow",
357 &yyss1, size * sizeof (*yyssp),
358 &yyvs1, size * sizeof (*yyvsp),
359 &yyls1, size * sizeof (*yylsp),
360 &yystacksize);
b07b484a 361# else
bb10be54
AD
362 yyoverflow ("parser stack overflow",
363 &yyss1, size * sizeof (*yyssp),
364 &yyvs1, size * sizeof (*yyvsp),
365 &yystacksize);
b07b484a 366# endif
10fa2066
RS
367
368 yyss = yyss1; yyvs = yyvs1;
b07b484a 369# ifdef YYLSP_NEEDED
10fa2066 370 yyls = yyls1;
b07b484a 371# endif
10fa2066
RS
372#else /* no yyoverflow */
373 /* Extend the stack our own way. */
374 if (yystacksize >= YYMAXDEPTH)
375 {
376 yyerror("parser stack overflow");
70ddf897
RS
377 if (yyfree_stacks)
378 {
379 free (yyss);
380 free (yyvs);
b07b484a 381# ifdef YYLSP_NEEDED
70ddf897 382 free (yyls);
b07b484a 383# endif
70ddf897 384 }
10fa2066
RS
385 return 2;
386 }
387 yystacksize *= 2;
388 if (yystacksize > YYMAXDEPTH)
389 yystacksize = YYMAXDEPTH;
b07b484a 390# ifndef YYSTACK_USE_ALLOCA
70ddf897 391 yyfree_stacks = 1;
b07b484a 392# endif
70ddf897 393 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
5e02f2ad
RS
394 __yy_memcpy ((char *)yyss, (char *)yyss1,
395 size * (unsigned int) sizeof (*yyssp));
70ddf897 396 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
5e02f2ad
RS
397 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
398 size * (unsigned int) sizeof (*yyvsp));
b07b484a 399# ifdef YYLSP_NEEDED
70ddf897 400 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
5e02f2ad
RS
401 __yy_memcpy ((char *)yyls, (char *)yyls1,
402 size * (unsigned int) sizeof (*yylsp));
b07b484a 403# endif
10fa2066
RS
404#endif /* no yyoverflow */
405
406 yyssp = yyss + size - 1;
407 yyvsp = yyvs + size - 1;
408#ifdef YYLSP_NEEDED
409 yylsp = yyls + size - 1;
410#endif
411
412#if YYDEBUG != 0
413 if (yydebug)
414 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
415#endif
416
417 if (yyssp >= yyss + yystacksize - 1)
418 YYABORT;
419 }
420
421#if YYDEBUG != 0
422 if (yydebug)
423 fprintf(stderr, "Entering state %d\n", yystate);
424#endif
425
426 goto yybackup;
427 yybackup:
428
429/* Do appropriate processing given the current state. */
430/* Read a lookahead token if we need one and don't already have one. */
431/* yyresume: */
432
433 /* First try to decide what to do without reference to lookahead token. */
434
435 yyn = yypact[yystate];
436 if (yyn == YYFLAG)
437 goto yydefault;
438
439 /* Not known => get a lookahead token if don't already have one. */
440
441 /* yychar is either YYEMPTY or YYEOF
442 or a valid token in external form. */
443
444 if (yychar == YYEMPTY)
445 {
446#if YYDEBUG != 0
447 if (yydebug)
448 fprintf(stderr, "Reading a token: ");
449#endif
450 yychar = YYLEX;
451 }
452
453 /* Convert token to internal form (in yychar1) for indexing tables with */
454
455 if (yychar <= 0) /* This means end of input. */
456 {
457 yychar1 = 0;
458 yychar = YYEOF; /* Don't call YYLEX any more */
459
460#if YYDEBUG != 0
461 if (yydebug)
462 fprintf(stderr, "Now at end of input.\n");
463#endif
464 }
465 else
466 {
467 yychar1 = YYTRANSLATE(yychar);
468
469#if YYDEBUG != 0
470 if (yydebug)
471 {
472 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
473 /* Give the individual parser a way to print the precise meaning
474 of a token, for further debugging info. */
b07b484a 475# ifdef YYPRINT
10fa2066 476 YYPRINT (stderr, yychar, yylval);
b07b484a 477# endif
10fa2066
RS
478 fprintf (stderr, ")\n");
479 }
480#endif
481 }
482
483 yyn += yychar1;
484 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
485 goto yydefault;
486
487 yyn = yytable[yyn];
488
489 /* yyn is what to do for this token type in this state.
490 Negative => reduce, -yyn is rule number.
491 Positive => shift, yyn is new state.
492 New state is final state => don't bother to shift,
493 just return success.
494 0, or most negative number => error. */
495
496 if (yyn < 0)
497 {
498 if (yyn == YYFLAG)
499 goto yyerrlab;
500 yyn = -yyn;
501 goto yyreduce;
502 }
503 else if (yyn == 0)
504 goto yyerrlab;
505
506 if (yyn == YYFINAL)
507 YYACCEPT;
508
509 /* Shift the lookahead token. */
510
511#if YYDEBUG != 0
512 if (yydebug)
513 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
514#endif
515
516 /* Discard the token being shifted unless it is eof. */
517 if (yychar != YYEOF)
518 yychar = YYEMPTY;
519
520 *++yyvsp = yylval;
521#ifdef YYLSP_NEEDED
522 *++yylsp = yylloc;
523#endif
524
525 /* count tokens shifted since error; after three, turn off error status. */
526 if (yyerrstatus) yyerrstatus--;
527
528 yystate = yyn;
529 goto yynewstate;
530
531/* Do the default action for the current state. */
532yydefault:
533
534 yyn = yydefact[yystate];
535 if (yyn == 0)
536 goto yyerrlab;
537
538/* Do a reduction. yyn is the number of a rule to reduce with. */
539yyreduce:
540 yylen = yyr2[yyn];
fb75fa82
RS
541 if (yylen > 0)
542 yyval = yyvsp[1-yylen]; /* implement default value of the action */
10fa2066
RS
543
544#if YYDEBUG != 0
545 if (yydebug)
546 {
547 int i;
548
549 fprintf (stderr, "Reducing via rule %d (line %d), ",
550 yyn, yyrline[yyn]);
551
552 /* Print the symbols being reduced, and their result. */
553 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
554 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
555 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
556 }
557#endif
558
559$ /* the action file gets copied in in place of this dollarsign */
ca1d9e53 560#line 543 "bison.simple"
10fa2066
RS
561\f
562 yyvsp -= yylen;
563 yyssp -= yylen;
564#ifdef YYLSP_NEEDED
565 yylsp -= yylen;
566#endif
567
568#if YYDEBUG != 0
569 if (yydebug)
570 {
571 short *ssp1 = yyss - 1;
572 fprintf (stderr, "state stack now");
573 while (ssp1 != yyssp)
574 fprintf (stderr, " %d", *++ssp1);
575 fprintf (stderr, "\n");
576 }
577#endif
578
579 *++yyvsp = yyval;
580
581#ifdef YYLSP_NEEDED
582 yylsp++;
583 if (yylen == 0)
584 {
585 yylsp->first_line = yylloc.first_line;
586 yylsp->first_column = yylloc.first_column;
587 yylsp->last_line = (yylsp-1)->last_line;
588 yylsp->last_column = (yylsp-1)->last_column;
589 yylsp->text = 0;
590 }
591 else
592 {
593 yylsp->last_line = (yylsp+yylen-1)->last_line;
594 yylsp->last_column = (yylsp+yylen-1)->last_column;
595 }
596#endif
597
598 /* Now "shift" the result of the reduction.
599 Determine what state that goes to,
600 based on the state we popped back to
601 and the rule number reduced by. */
602
603 yyn = yyr1[yyn];
604
605 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
606 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
607 yystate = yytable[yystate];
608 else
609 yystate = yydefgoto[yyn - YYNTBASE];
610
611 goto yynewstate;
612
613yyerrlab: /* here on detecting error */
614
615 if (! yyerrstatus)
616 /* If not already recovering from an error, report this error. */
617 {
618 ++yynerrs;
619
620#ifdef YYERROR_VERBOSE
621 yyn = yypact[yystate];
622
623 if (yyn > YYFLAG && yyn < YYLAST)
624 {
625 int size = 0;
626 char *msg;
627 int x, count;
628
629 count = 0;
630 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
631 for (x = (yyn < 0 ? -yyn : 0);
632 x < (sizeof(yytname) / sizeof(char *)); x++)
633 if (yycheck[x + yyn] == x)
634 size += strlen(yytname[x]) + 15, count++;
635 msg = (char *) malloc(size + 15);
636 if (msg != 0)
637 {
638 strcpy(msg, "parse error");
639
640 if (count < 5)
641 {
642 count = 0;
643 for (x = (yyn < 0 ? -yyn : 0);
644 x < (sizeof(yytname) / sizeof(char *)); x++)
645 if (yycheck[x + yyn] == x)
646 {
647 strcat(msg, count == 0 ? ", expecting `" : " or `");
648 strcat(msg, yytname[x]);
649 strcat(msg, "'");
650 count++;
651 }
652 }
653 yyerror(msg);
654 free(msg);
655 }
656 else
657 yyerror ("parse error; also virtual memory exceeded");
658 }
659 else
660#endif /* YYERROR_VERBOSE */
661 yyerror("parse error");
662 }
663
664 goto yyerrlab1;
665yyerrlab1: /* here on error raised explicitly by an action */
666
667 if (yyerrstatus == 3)
668 {
669 /* if just tried and failed to reuse lookahead token after an error, discard it. */
670
671 /* return failure if at end of input */
672 if (yychar == YYEOF)
673 YYABORT;
674
675#if YYDEBUG != 0
676 if (yydebug)
677 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
678#endif
679
680 yychar = YYEMPTY;
681 }
682
683 /* Else will try to reuse lookahead token
684 after shifting the error token. */
685
686 yyerrstatus = 3; /* Each real token shifted decrements this */
687
688 goto yyerrhandle;
689
690yyerrdefault: /* current state does not do anything special for the error token. */
691
692#if 0
693 /* This is wrong; only states that explicitly want error tokens
694 should shift them. */
695 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
696 if (yyn) goto yydefault;
697#endif
698
699yyerrpop: /* pop the current state because it cannot handle the error token */
700
701 if (yyssp == yyss) YYABORT;
702 yyvsp--;
703 yystate = *--yyssp;
704#ifdef YYLSP_NEEDED
705 yylsp--;
706#endif
707
708#if YYDEBUG != 0
709 if (yydebug)
710 {
711 short *ssp1 = yyss - 1;
712 fprintf (stderr, "Error: state stack now");
713 while (ssp1 != yyssp)
714 fprintf (stderr, " %d", *++ssp1);
715 fprintf (stderr, "\n");
716 }
717#endif
718
719yyerrhandle:
720
721 yyn = yypact[yystate];
722 if (yyn == YYFLAG)
723 goto yyerrdefault;
724
725 yyn += YYTERROR;
726 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
727 goto yyerrdefault;
728
729 yyn = yytable[yyn];
730 if (yyn < 0)
731 {
732 if (yyn == YYFLAG)
733 goto yyerrpop;
734 yyn = -yyn;
735 goto yyreduce;
736 }
737 else if (yyn == 0)
738 goto yyerrpop;
739
740 if (yyn == YYFINAL)
741 YYACCEPT;
742
743#if YYDEBUG != 0
744 if (yydebug)
745 fprintf(stderr, "Shifting error token, ");
746#endif
747
748 *++yyvsp = yylval;
749#ifdef YYLSP_NEEDED
750 *++yylsp = yylloc;
751#endif
752
753 yystate = yyn;
754 goto yynewstate;
70ddf897
RS
755
756 yyacceptlab:
757 /* YYACCEPT comes here. */
758 if (yyfree_stacks)
759 {
760 free (yyss);
761 free (yyvs);
762#ifdef YYLSP_NEEDED
763 free (yyls);
764#endif
765 }
766 return 0;
767
768 yyabortlab:
769 /* YYABORT comes here. */
770 if (yyfree_stacks)
771 {
772 free (yyss);
773 free (yyvs);
774#ifdef YYLSP_NEEDED
775 free (yyls);
776#endif
777 }
778 return 1;
10fa2066 779}