1 /* #pragma lib "libl.a" */
5 struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
7 Uchar *yysptr = yysbuf;
9 extern struct yysvf *yyestate;
10 int yyprevious = YYNEWLINE;
12 extern void allprint(char);
16 struct yysvf *yystate, **lsp;
25 /* start off machines */
30 yylastch = (Uchar*)yytext;
33 yylastch = (Uchar*)yytext+yyleng;
37 yyestate = yystate = yybgin;
38 if (yyprevious==YYNEWLINE) yystate++;
41 if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
43 yyt = yystate->yystoff;
44 if(yyt == yycrank){ /* may not be any transitions */
45 yyz = yystate->yyother;
47 if(yyz->yystoff == yycrank)break;
49 *yylastch++ = yych = input();
53 fprintf(yyout,"char ");
61 if (yyt <= yytop && yyt->verify+yysvec == yystate){
62 if(yyt->advance+yysvec == YYLERR) /* error transitions */
63 {unput(*--yylastch);break;}
64 *lsp++ = yystate = yyt->advance+yysvec;
69 else if(yyt < yycrank) { /* r < yycrank */
70 yyt = yyr = yycrank+(yycrank-yyt);
72 if(debug)fprintf(yyout,"compressed state\n");
75 if(yyt <= yytop && yyt->verify+yysvec == yystate){
76 if(yyt->advance+yysvec == YYLERR) /* error transitions */
77 {unput(*--yylastch);break;}
78 *lsp++ = yystate = yyt->advance+yysvec;
81 yyt = yyr + YYU(yymatch[yych]);
84 fprintf(yyout,"try fall back character ");
85 allprint(YYU(yymatch[yych]));
89 if(yyt <= yytop && yyt->verify+yysvec == yystate){
90 if(yyt->advance+yysvec == YYLERR) /* error transition */
91 {unput(*--yylastch);break;}
92 *lsp++ = yystate = yyt->advance+yysvec;
96 if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
98 if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
104 {unput(*--yylastch);break;}
108 fprintf(yyout,"state %d char ",yystate-yysvec-1);
117 fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
122 while (lsp-- > yylstate){
124 if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
126 if(yyextra[*yyfnd]){ /* must backup */
127 while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
132 yyprevious = YYU(*yylastch);
134 yyleng = yylastch-(Uchar*)yytext+1;
138 fprintf(yyout,"\nmatch '%s'", yytext);
139 fprintf(yyout," action %d\n",*yyfnd);
146 if (yytext[0] == 0 /* && feof(yyin) */)
151 yyprevious = input();
152 yytext[0] = yyprevious;
155 yylastch = (Uchar*)yytext;
157 if(debug)putchar('\n');
160 return(0); /* shut up the compiler; i have no idea what should be returned */
163 yyback(int *p, int m)
173 /* the following are only used in the lex library */
176 if(yyin == ((void*)0))
183 if(yyout == ((void*)0))