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