2
/* A Bison parser, made from cardconstraint.y
3
by GNU Bison version 1.28 */
5
#define YYBISON 1 /* Identify Bison output. */
7
#define yyparse cardconstraintparse
8
#define yylex cardconstraintlex
9
#define yyerror cardconstrainterror
10
#define yylval cardconstraintlval
11
#define yychar cardconstraintchar
12
#define yydebug cardconstraintdebug
13
#define yynerrs cardconstraintnerrs
25
#define GREATEREQUAL 268
27
#line 1 "cardconstraint.y"
31
#define YYERROR_VERBOSE
53
#define YYTRANSLATE(x) ((unsigned)(x) <= 268 ? yytranslate[x] : 18)
55
static const char yytranslate[] = { 0,
56
2, 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, 2, 2, 2, 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, 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, 1, 3, 4, 5, 6,
82
7, 8, 9, 10, 11, 12, 13, 14
86
static const short yyprhs[] = { 0,
87
0, 2, 6, 10, 14, 18, 22, 26, 30, 34,
91
static const short yyrhs[] = { 16,
92
0, 15, 3, 16, 0, 4, 7, 4, 0, 17,
93
9, 4, 0, 17, 10, 4, 0, 17, 11, 4,
94
0, 17, 12, 4, 0, 17, 13, 4, 0, 17,
95
14, 4, 0, 4, 0, 5, 0, 6, 0, 0
101
static const short yyrline[] = { 0,
102
11, 12, 15, 16, 17, 18, 19, 20, 21, 22,
108
#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
110
static const char * const yytname[] = { "$","error","$undefined.","COMMA",
111
"NUMBER","N","M","DOTDOT","UNDEFINED","EQUAL","NOTEQUAL","LESS","LESSEQUAL",
112
"GREATER","GREATEREQUAL","cardconstraint","expr","nletter", NULL
116
static const short yyr1[] = { 0,
117
15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
121
static const short yyr2[] = { 0,
122
1, 3, 3, 3, 3, 3, 3, 3, 3, 1,
126
static const short yydefact[] = { 13,
127
10, 11, 12, 0, 1, 0, 0, 13, 0, 0,
128
0, 0, 0, 0, 3, 2, 4, 5, 6, 7,
132
static const short yydefgoto[] = { 4,
136
static const short yypact[] = { 7,
137
0,-32768,-32768, 6,-32768, -9, 4, 7, 10, 11,
138
12, 13, 14, 15,-32768,-32768,-32768,-32768,-32768,-32768,
139
-32768,-32768, 20,-32768
142
static const short yypgoto[] = {-32768,
150
static const short yytable[] = { 9,
151
10, 11, 12, 13, 14, 23, 7, 15, 8, 16,
152
1, 2, 3, 17, 18, 19, 20, 21, 22, 24
155
static const short yycheck[] = { 9,
156
10, 11, 12, 13, 14, 0, 7, 4, 3, 8,
157
4, 5, 6, 4, 4, 4, 4, 4, 4, 0
159
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
160
#line 3 "/usr/lib/bison.simple"
161
/* This file comes from bison-1.28. */
163
/* Skeleton output parser for bison,
164
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
166
This program is free software; you can redistribute it and/or modify
167
it under the terms of the GNU General Public License as published by
168
the Free Software Foundation; either version 2, or (at your option)
171
This program is distributed in the hope that it will be useful,
172
but WITHOUT ANY WARRANTY; without even the implied warranty of
173
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
174
GNU General Public License for more details.
176
You should have received a copy of the GNU General Public License
177
along with this program; if not, write to the Free Software
178
Foundation, Inc., 59 Temple Place - Suite 330,
179
Boston, MA 02111-1307, USA. */
181
/* As a special exception, when this file is copied by Bison into a
182
Bison output file, you may use that output file without restriction.
183
This special exception was added by the Free Software Foundation
184
in version 1.24 of Bison. */
186
/* This is the parser code that is written into each bison parser
187
when the %semantic_parser declaration is not specified in the grammar.
188
It was written by Richard Stallman by simplifying the hairy parser
189
used when %semantic_parser is specified. */
191
#ifndef YYSTACK_USE_ALLOCA
193
#define YYSTACK_USE_ALLOCA
194
#else /* alloca not defined */
196
#define YYSTACK_USE_ALLOCA
197
#define alloca __builtin_alloca
198
#else /* not GNU C. */
199
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
200
#define YYSTACK_USE_ALLOCA
202
#else /* not sparc */
203
/* We think this test detects Watcom and Microsoft C. */
204
/* This used to test MSDOS, but that is a bad idea
205
since that symbol is in the user namespace. */
206
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
207
#if 0 /* No need for malloc.h, which pollutes the namespace;
208
instead, just don't use alloca. */
211
#else /* not MSDOS, or __TURBOC__ */
213
/* I don't know what this was needed for, but it pollutes the namespace.
214
So I turned it off. rms, 2 May 1997. */
215
/* #include <malloc.h> */
217
#define YYSTACK_USE_ALLOCA
218
#else /* not MSDOS, or __TURBOC__, or _AIX */
220
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
221
and on HPUX 10. Eventually we can turn this on. */
222
#define YYSTACK_USE_ALLOCA
223
#define alloca __builtin_alloca
226
#endif /* not _AIX */
227
#endif /* not MSDOS, or __TURBOC__ */
228
#endif /* not sparc */
229
#endif /* not GNU C */
230
#endif /* alloca not defined */
231
#endif /* YYSTACK_USE_ALLOCA not defined */
233
#ifdef YYSTACK_USE_ALLOCA
234
#define YYSTACK_ALLOC alloca
236
#define YYSTACK_ALLOC malloc
239
/* Note: there must be only one dollar sign in this file.
240
It is replaced by the list of actions, each action
241
as one case of the switch. */
243
#define yyerrok (yyerrstatus = 0)
244
#define yyclearin (yychar = YYEMPTY)
247
#define YYACCEPT goto yyacceptlab
248
#define YYABORT goto yyabortlab
249
#define YYERROR goto yyerrlab1
250
/* Like YYERROR except do call yyerror.
251
This remains here temporarily to ease the
252
transition to the new meaning of YYERROR, for GCC.
253
Once GCC version 2 has supplanted version 1, this can go. */
254
#define YYFAIL goto yyerrlab
255
#define YYRECOVERING() (!!yyerrstatus)
256
#define YYBACKUP(token, value) \
258
if (yychar == YYEMPTY && yylen == 1) \
259
{ yychar = (token), yylval = (value); \
260
yychar1 = YYTRANSLATE (yychar); \
265
{ yyerror ("syntax error: cannot back up"); YYERROR; } \
269
#define YYERRCODE 256
272
#define YYLEX yylex()
278
#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
280
#define YYLEX yylex(&yylval, &yylloc)
282
#else /* not YYLSP_NEEDED */
284
#define YYLEX yylex(&yylval, YYLEX_PARAM)
286
#define YYLEX yylex(&yylval)
288
#endif /* not YYLSP_NEEDED */
291
/* If nonreentrant, generate the variables here */
295
int yychar; /* the lookahead symbol */
296
YYSTYPE yylval; /* the semantic value of the */
297
/* lookahead symbol */
300
YYLTYPE yylloc; /* location data for the lookahead */
304
int yynerrs; /* number of parse errors so far */
305
#endif /* not YYPURE */
308
int yydebug; /* nonzero means print parse trace */
309
/* Since this is uninitialized, it does not stop multiple parsers
313
/* YYINITDEPTH indicates the initial size of the parser's stacks */
316
#define YYINITDEPTH 200
319
/* YYMAXDEPTH is the maximum size the stacks can grow to
320
(effective only if the built-in stack extension method is used). */
327
#define YYMAXDEPTH 10000
330
/* Define __yy_memcpy. Note that the size argument
331
should be passed with type unsigned int, because that is what the non-GCC
332
definitions require. With GCC, __builtin_memcpy takes an arg
333
of type size_t, but it can handle unsigned int. */
335
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
336
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
337
#else /* not GNU C or C++ */
340
/* This is the most reliable way to avoid incompatibilities
341
in available built-in functions on various systems. */
343
__yy_memcpy (to, from, count)
348
register char *f = from;
349
register char *t = to;
350
register int i = count;
356
#else /* __cplusplus */
358
/* This is the most reliable way to avoid incompatibilities
359
in available built-in functions on various systems. */
361
__yy_memcpy (char *to, char *from, unsigned int count)
363
register char *t = to;
364
register char *f = from;
365
register int i = count;
374
#line 217 "/usr/lib/bison.simple"
376
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
377
into yyparse. The argument should have type void *.
378
It should actually point to an object.
379
Grammar actions can access the variable by casting it
380
to the proper pointer type. */
384
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
385
#define YYPARSE_PARAM_DECL
386
#else /* not __cplusplus */
387
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
388
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
389
#endif /* not __cplusplus */
390
#else /* not YYPARSE_PARAM */
391
#define YYPARSE_PARAM_ARG
392
#define YYPARSE_PARAM_DECL
393
#endif /* not YYPARSE_PARAM */
395
/* Prevent warning if -Wstrict-prototypes. */
398
int yyparse (void *);
405
yyparse(YYPARSE_PARAM_ARG)
408
register int yystate;
410
register short *yyssp;
411
register YYSTYPE *yyvsp;
412
int yyerrstatus; /* number of tokens to shift before error messages enabled */
413
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
415
short yyssa[YYINITDEPTH]; /* the state stack */
416
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
418
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
419
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
422
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
423
YYLTYPE *yyls = yylsa;
426
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
428
#define YYPOPSTACK (yyvsp--, yyssp--)
431
int yystacksize = YYINITDEPTH;
432
int yyfree_stacks = 0;
443
YYSTYPE yyval; /* the variable used to return */
444
/* semantic values from the action */
451
fprintf(stderr, "Starting parse\n");
457
yychar = YYEMPTY; /* Cause a token to be read. */
459
/* Initialize stack pointers.
460
Waste one element of value and location stack
461
so that they stay on the same level as the state stack.
462
The wasted elements are never initialized. */
470
/* Push a new state, which is found in yystate . */
471
/* In all cases, when you get here, the value and location stacks
472
have just been pushed. so pushing a state here evens the stacks. */
477
if (yyssp >= yyss + yystacksize - 1)
479
/* Give user a chance to reallocate the stack */
480
/* Use copies of these so that the &'s don't force the real ones into memory. */
481
YYSTYPE *yyvs1 = yyvs;
484
YYLTYPE *yyls1 = yyls;
487
/* Get the current used size of the three stacks, in elements. */
488
int size = yyssp - yyss + 1;
491
/* Each stack pointer address is followed by the size of
492
the data in use in that stack, in bytes. */
494
/* This used to be a conditional around just the two extra args,
495
but that might be undefined if yyoverflow is a macro. */
496
yyoverflow("parser stack overflow",
497
&yyss1, size * sizeof (*yyssp),
498
&yyvs1, size * sizeof (*yyvsp),
499
&yyls1, size * sizeof (*yylsp),
502
yyoverflow("parser stack overflow",
503
&yyss1, size * sizeof (*yyssp),
504
&yyvs1, size * sizeof (*yyvsp),
508
yyss = yyss1; yyvs = yyvs1;
512
#else /* no yyoverflow */
513
/* Extend the stack our own way. */
514
if (yystacksize >= YYMAXDEPTH)
516
yyerror("parser stack overflow");
528
if (yystacksize > YYMAXDEPTH)
529
yystacksize = YYMAXDEPTH;
530
#ifndef YYSTACK_USE_ALLOCA
533
yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
534
__yy_memcpy ((char *)yyss, (char *)yyss1,
535
size * (unsigned int) sizeof (*yyssp));
536
yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
537
__yy_memcpy ((char *)yyvs, (char *)yyvs1,
538
size * (unsigned int) sizeof (*yyvsp));
540
yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
541
__yy_memcpy ((char *)yyls, (char *)yyls1,
542
size * (unsigned int) sizeof (*yylsp));
544
#endif /* no yyoverflow */
546
yyssp = yyss + size - 1;
547
yyvsp = yyvs + size - 1;
549
yylsp = yyls + size - 1;
554
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
557
if (yyssp >= yyss + yystacksize - 1)
563
fprintf(stderr, "Entering state %d\n", yystate);
569
/* Do appropriate processing given the current state. */
570
/* Read a lookahead token if we need one and don't already have one. */
573
/* First try to decide what to do without reference to lookahead token. */
575
yyn = yypact[yystate];
579
/* Not known => get a lookahead token if don't already have one. */
581
/* yychar is either YYEMPTY or YYEOF
582
or a valid token in external form. */
584
if (yychar == YYEMPTY)
588
fprintf(stderr, "Reading a token: ");
593
/* Convert token to internal form (in yychar1) for indexing tables with */
595
if (yychar <= 0) /* This means end of input. */
598
yychar = YYEOF; /* Don't call YYLEX any more */
602
fprintf(stderr, "Now at end of input.\n");
607
yychar1 = YYTRANSLATE(yychar);
612
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
613
/* Give the individual parser a way to print the precise meaning
614
of a token, for further debugging info. */
616
YYPRINT (stderr, yychar, yylval);
618
fprintf (stderr, ")\n");
624
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
629
/* yyn is what to do for this token type in this state.
630
Negative => reduce, -yyn is rule number.
631
Positive => shift, yyn is new state.
632
New state is final state => don't bother to shift,
634
0, or most negative number => error. */
649
/* Shift the lookahead token. */
653
fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
656
/* Discard the token being shifted unless it is eof. */
665
/* count tokens shifted since error; after three, turn off error status. */
666
if (yyerrstatus) yyerrstatus--;
671
/* Do the default action for the current state. */
674
yyn = yydefact[yystate];
678
/* Do a reduction. yyn is the number of a rule to reduce with. */
682
yyval = yyvsp[1-yylen]; /* implement default value of the action */
689
fprintf (stderr, "Reducing via rule %d (line %d), ",
692
/* Print the symbols being reduced, and their result. */
693
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
694
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
695
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
703
/* the action file gets copied in in place of this dollarsign */
704
#line 543 "/usr/lib/bison.simple"
715
short *ssp1 = yyss - 1;
716
fprintf (stderr, "state stack now");
717
while (ssp1 != yyssp)
718
fprintf (stderr, " %d", *++ssp1);
719
fprintf (stderr, "\n");
729
yylsp->first_line = yylloc.first_line;
730
yylsp->first_column = yylloc.first_column;
731
yylsp->last_line = (yylsp-1)->last_line;
732
yylsp->last_column = (yylsp-1)->last_column;
737
yylsp->last_line = (yylsp+yylen-1)->last_line;
738
yylsp->last_column = (yylsp+yylen-1)->last_column;
742
/* Now "shift" the result of the reduction.
743
Determine what state that goes to,
744
based on the state we popped back to
745
and the rule number reduced by. */
749
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
750
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
751
yystate = yytable[yystate];
753
yystate = yydefgoto[yyn - YYNTBASE];
757
yyerrlab: /* here on detecting error */
760
/* If not already recovering from an error, report this error. */
764
#ifdef YYERROR_VERBOSE
765
yyn = yypact[yystate];
767
if (yyn > YYFLAG && yyn < YYLAST)
774
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
775
for (x = (yyn < 0 ? -yyn : 0);
776
x < (sizeof(yytname) / sizeof(char *)); x++)
777
if (yycheck[x + yyn] == x)
778
size += strlen(yytname[x]) + 15, count++;
779
msg = (char *) malloc(size + 15);
782
strcpy(msg, "parse error");
787
for (x = (yyn < 0 ? -yyn : 0);
788
x < (sizeof(yytname) / sizeof(char *)); x++)
789
if (yycheck[x + yyn] == x)
791
strcat(msg, count == 0 ? ", expecting `" : " or `");
792
strcat(msg, yytname[x]);
801
yyerror ("parse error; also virtual memory exceeded");
804
#endif /* YYERROR_VERBOSE */
805
yyerror("parse error");
809
yyerrlab1: /* here on error raised explicitly by an action */
811
if (yyerrstatus == 3)
813
/* if just tried and failed to reuse lookahead token after an error, discard it. */
815
/* return failure if at end of input */
821
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
827
/* Else will try to reuse lookahead token
828
after shifting the error token. */
830
yyerrstatus = 3; /* Each real token shifted decrements this */
834
yyerrdefault: /* current state does not do anything special for the error token. */
837
/* This is wrong; only states that explicitly want error tokens
838
should shift them. */
839
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
840
if (yyn) goto yydefault;
843
yyerrpop: /* pop the current state because it cannot handle the error token */
845
if (yyssp == yyss) YYABORT;
855
short *ssp1 = yyss - 1;
856
fprintf (stderr, "Error: state stack now");
857
while (ssp1 != yyssp)
858
fprintf (stderr, " %d", *++ssp1);
859
fprintf (stderr, "\n");
865
yyn = yypact[yystate];
870
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
889
fprintf(stderr, "Shifting error token, ");
901
/* YYACCEPT comes here. */
913
/* YYABORT comes here. */
924
#line 29 "cardconstraint.y"