date and time created 83/12/05 16:21:09 by ralph
[unix-history] / usr / src / old / lex / libln / reject.c
CommitLineData
e833799c
SL
1/* @(#)reject.c 4.1 %G% */
2
3# include <stdio.h>
4extern struct {int *yyaa, *yybb; int *yystops;} *yylstate [], **yylsp, **yyolsp;
5yyreject ()
6{
7extern FILE *yyout, *yyin;
8extern int yyprevious , *yyfnd;
9extern char yyextra[];
10extern char yytext[];
11extern int yyleng;
12for( ; yylsp < yyolsp; yylsp++)
13 yytext[yyleng++] = yyinput();
14if (*yyfnd > 0)
15 return(yyracc(*yyfnd++));
16while (yylsp-- > yylstate)
17 {
18 yyunput(yytext[yyleng-1]);
19 yytext[--yyleng] = 0;
20 if (*yylsp != 0 && (yyfnd= (*yylsp)->yystops) && *yyfnd > 0)
21 return(yyracc(*yyfnd++));
22 }
23if (yytext[0] == 0)
24 return(0);
25yyoutput(yyprevious = yyinput());
26yyleng=0;
27return(-1);
28}
29yyracc(m)
30{
31yyolsp = yylsp;
32if (yyextra[m])
33 {
34 while (yyback((*yylsp)->yystops, -m) != 1 && yylsp>yylstate)
35 {
36 yylsp--;
37 yyunput(yytext[--yyleng]);
38 }
39 }
40yyprevious = yytext[yyleng-1];
41yytext[yyleng] = 0;
42return(m);
43}