source: heimdal/trunk/lib/hx509/sel-gram.c@ 4

Last change on this file since 4 was 4, checked in by Paul Smedley, 10 years ago

heimdal: applied os2 patches, added conf.cmd

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