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