# include "stdio.h" # define U(x) x # define NLSTATE yyprevious=YYNEWLINE # define BEGIN yybgin = yysvec + 1 + # define INITIAL 0 # define YYLERR yysvec # define YYSTATE (yyestate-yysvec-1) # define YYOPTIM 1 # define YYLMAX BUFSIZ # define output(c) putc(c,yyout) # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar) # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;} # define yymore() (yymorfg=1) # define ECHO fprintf(yyout, "%s",yytext) # define REJECT { nstr = yyreject(); goto yyfussy;} int yyleng; extern char yytext[]; int yymorfg; extern char *yysptr, yysbuf[]; int yytchar; FILE *yyin = {stdin}, *yyout = {stdout}; extern int yylineno; struct yysvf { struct yywork *yystoff; struct yysvf *yyother; int *yystops;}; struct yysvf *yyestate; extern struct yysvf yysvec[], *yybgin; /* chef.x - convert English on stdin to Mock Swedish on stdout * * The WC definition matches any word character, and the NW definition matches * any non-word character. Two start conditions are maintained: INW (in word) * and NIW (not in word). The first rule passes TeX commands without change. * * HOW TO COMPILE * * 1. Save this file as chef.l * 2. lex chef.l This will produce a file called lex.yy.c * 3. cc -o chef lex.yy.c -ll This will produce a file called chef. * 4. chef outfile to translate the text of infile and * save it to outfile. chef = 0) yyfussy: switch(nstr){ case 0: if(yywrap()) return(0); break; case 1: ECHO; break; case 2: { BEGIN NIW; i_seen = 0; ECHO; } break; case 3: { BEGIN NIW; i_seen = 0; printf(".\nBork Bork Bork!"); } break; case 4: ECHO; break; case 5: ECHO; break; case 6: { BEGIN INW; printf("un"); } break; case 7: { BEGIN INW; printf("Un"); } break; case 8: { BEGIN INW; printf("oo"); } break; case 9: { BEGIN INW; printf("Oo"); } break; case 10: { BEGIN INW; printf("e"); } break; case 11: { BEGIN INW; printf("E"); } break; case 12: { BEGIN INW; printf("ee"); } break; case 13: { BEGIN INW; printf("oo"); } break; case 14: { BEGIN INW; printf("e-a"); } break; case 15: { BEGIN INW; printf("i"); } break; case 16: { BEGIN INW; printf("I"); } break; case 17: { BEGIN INW; printf("ff"); } break; case 18: { BEGIN INW; printf("ur"); } break; case 19: { BEGIN INW; printf(i_seen ? "i" : "ee"); } break; case 20: { BEGIN INW; printf("oo"); } break; case 21: { BEGIN INW; printf("oo"); } break; case 22: { BEGIN INW; printf("Oo"); } break; case 23: { BEGIN INW; printf("u"); } break; case 24: { BEGIN INW; printf("zee"); } break; case 25: { BEGIN INW; printf("Zee"); } break; case 26: { BEGIN INW; printf("t"); } break; case 27: { BEGIN INW; printf("shun"); } break; case 28: { BEGIN INW; printf("oo"); } break; case 29: { BEGIN INW; printf("Oo"); } break; case 30: { BEGIN INW; printf("f"); } break; case 31: { BEGIN INW; printf("F"); } break; case 32: { BEGIN INW; printf("v"); } break; case 33: { BEGIN INW; printf("V"); } break; case 34: { BEGIN INW; ECHO; } break; case -1: break; default: fprintf(yyout,"bad switch yylook %d",nstr); } return(0); } /* end of yylex */ int yyvstop[] = { 0, 2, 34, 0, 2, 0, 34, 0, 2, 34, -3, 0, 34, -11, 0, 34, 0, 31, 34, 0, 33, 34, 0, 2, 34, 0, 34, -10, 0, 34, 0, 34, 0, 30, 34, 0, 32, 34, 0, 29, 34, 0, 34, -14, 0, 17, 34, 0, 19, 34, 0, 23, 34, 0, 34, 0, 28, 34, 0, 34, 0, 16, 34, 0, 22, 34, 0, 34, 0, 15, 34, 0, 21, 34, 0, 3, 0, 11, 0, 7, 11, 0, 9, 11, 0, 1, 0, 10, 0, 6, 10, 0, 8, 10, 0, -12, 0, -26, 0, 14, 0, 13, 0, 18, 0, 20, 0, 25, 0, 12, 0, 26, 0, 24, 0, 27, 0, -5, 0, -4, 0, 5, 0, 4, 0, 0}; # define YYTYPE char struct yywork { YYTYPE verify, advance; } yycrank[] = { 0,0, 0,0, 1,7, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 1,8, 10,34, 15,39, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 1,7, 0,0, 15,39, 0,0, 0,0, 0,0, 0,0, 1,9, 0,0, 0,0, 0,0, 0,0, 1,10, 3,7, 0,0, 0,0, 0,0, 0,0, 0,0, 2,10, 0,0, 0,0, 3,8, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 1,11, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 2,11, 0,0, 0,0, 0,0, 3,7, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 3,9, 1,12, 0,0, 1,13, 1,14, 3,10, 0,0, 0,0, 2,12, 1,15, 2,13, 2,14, 0,0, 0,0, 1,16, 0,0, 2,15, 0,0, 1,17, 38,52, 0,0, 2,16, 12,38, 18,44, 0,0, 2,17, 3,11, 17,43, 4,10, 26,44, 26,49, 24,47, 28,50, 1,18, 31,51, 1,19, 1,20, 25,48, 49,56, 50,57, 2,18, 51,58, 2,19, 2,20, 56,59, 3,12, 3,21, 3,13, 3,14, 4,11, 57,60, 58,61, 0,0, 3,15, 0,0, 0,0, 5,7, 0,0, 3,16, 0,0, 0,0, 0,0, 3,22, 3,23, 0,0, 5,8, 3,24, 0,0, 4,12, 4,21, 4,13, 4,14, 3,25, 0,0, 0,0, 0,0, 4,15, 3,26, 3,27, 3,19, 3,20, 4,16, 0,0, 6,10, 0,0, 4,22, 4,23, 5,7, 0,0, 4,24, 0,0, 0,0, 0,0, 0,0, 5,9, 4,25, 0,0, 0,0, 0,0, 5,10, 4,26, 4,27, 4,19, 4,20, 6,11, 6,28, 0,0, 0,0, 6,29, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 6,30, 0,0, 5,11, 5,28, 0,0, 6,12, 5,29, 6,13, 6,14, 0,0, 0,0, 0,0, 0,0, 6,15, 0,0, 0,0, 5,30, 0,0, 6,16, 6,31, 0,0, 5,12, 6,32, 5,13, 5,14, 0,0, 0,0, 0,0, 0,0, 5,15, 0,0, 11,35, 6,33, 0,0, 5,16, 5,31, 0,0, 6,18, 5,32, 6,19, 6,20, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 5,33, 0,0, 0,0, 0,0, 0,0, 5,18, 0,0, 5,19, 5,20, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,36, 11,35, 11,35, 11,35, 11,35, 11,35, 11,35, 11,37, 11,35, 11,35, 11,35, 11,35, 11,35, 16,40, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,41, 16,40, 16,40, 16,40, 16,40, 16,40, 16,40, 16,42, 16,40, 16,40, 16,40, 16,40, 16,40, 22,45, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 22,45, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 22,45, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 22,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,43, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,0, 22,46, 22,0, 22,0, 22,0, 43,53, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 43,53, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 43,53, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 43,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 43,0, 44,54, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 44,54, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 44,54, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 44,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 44,0, 44,0, 44,0, 44,0, 44,55, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 44,0, 60,62, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 60,62, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 60,62, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 60,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 60,0, 61,63, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 61,63, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 61,63, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 61,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 0,0, 0,0}; struct yysvf yysvec[] = { 0, 0, 0, yycrank+-1, 0, 0, yycrank+-8, yysvec+1, 0, yycrank+-45, 0, 0, yycrank+-68, yysvec+3, 0, yycrank+-139, 0, 0, yycrank+-123, yysvec+5, 0, yycrank+0, 0, yyvstop+1, yycrank+0, 0, yyvstop+4, yycrank+0, 0, yyvstop+6, yycrank+2, 0, yyvstop+8, yycrank+194, 0, yyvstop+12, yycrank+2, 0, yyvstop+15, yycrank+0, 0, yyvstop+17, yycrank+0, 0, yyvstop+20, yycrank+3, 0, yyvstop+23, yycrank+278, 0, yyvstop+26, yycrank+1, 0, yyvstop+29, yycrank+3, 0, yyvstop+31, yycrank+0, 0, yyvstop+33, yycrank+0, 0, yyvstop+36, yycrank+0, 0, yyvstop+39, yycrank+-400, 0, yyvstop+42, yycrank+0, 0, yyvstop+45, yycrank+1, 0, yyvstop+48, yycrank+2, 0, yyvstop+51, yycrank+9, 0, yyvstop+54, yycrank+0, 0, yyvstop+56, yycrank+5, 0, yyvstop+59, yycrank+0, 0, yyvstop+61, yycrank+0, 0, yyvstop+64, yycrank+7, 0, yyvstop+67, yycrank+0, yysvec+17, yyvstop+69, yycrank+0, 0, yyvstop+72, yycrank+0, 0, yyvstop+75, yycrank+0, 0, yyvstop+77, yycrank+0, 0, yyvstop+79, yycrank+0, 0, yyvstop+82, yycrank+2, 0, 0, yycrank+0, yysvec+15, yyvstop+85, yycrank+0, 0, yyvstop+87, yycrank+0, 0, yyvstop+89, yycrank+0, 0, yyvstop+92, yycrank+-522, 0, yyvstop+95, yycrank+-644, 0, yyvstop+97, yycrank+0, 0, yyvstop+99, yycrank+0, 0, yyvstop+101, yycrank+0, 0, yyvstop+103, yycrank+0, 0, yyvstop+105, yycrank+11, 0, 0, yycrank+9, 0, 0, yycrank+11, 0, 0, yycrank+0, 0, yyvstop+107, yycrank+0, 0, yyvstop+109, yycrank+0, 0, yyvstop+111, yycrank+0, 0, yyvstop+113, yycrank+18, 0, 0, yycrank+27, 0, 0, yycrank+28, 0, 0, yycrank+0, 0, yyvstop+115, yycrank+-766, 0, yyvstop+117, yycrank+-888, 0, yyvstop+119, yycrank+0, 0, yyvstop+121, yycrank+0, 0, yyvstop+123, 0, 0, 0}; struct yywork *yytop = yycrank+1010; struct yysvf *yybgin = yysvec+1; char yymatch[] = { 00 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 01 ,01 ,012 ,01 ,01 ,01 ,01 ,01 , 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 040 ,01 ,01 ,01 ,01 ,01 ,01 ,047 , 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 01 ,047 ,047 ,047 ,047 ,047 ,047 ,047 , 047 ,047 ,047 ,047 ,047 ,047 ,047 ,047 , 047 ,047 ,047 ,047 ,047 ,047 ,047 ,047 , 047 ,047 ,047 ,01 ,01 ,01 ,01 ,01 , 01 ,047 ,047 ,047 ,047 ,047 ,047 ,047 , 047 ,047 ,047 ,047 ,047 ,047 ,047 ,047 , 047 ,047 ,047 ,047 ,047 ,047 ,047 ,047 , 047 ,047 ,047 ,01 ,01 ,01 ,01 ,01 , 0}; char yyextra[] = { 0,0,0,1,1,1,0,0, 0,0,1,1,1,0,1,0, 0,0,0,0,0,0,0,0, 0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0}; #ifndef lint static char ncform_sccsid[] = "@(#)ncform 1.6 88/02/08 SMI"; /* from S5R2 1.2 */ #endif int yylineno =1; # define YYU(x) x # define NLSTATE yyprevious=YYNEWLINE char yytext[YYLMAX]; struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp; char yysbuf[YYLMAX]; char *yysptr = yysbuf; int *yyfnd; extern struct yysvf *yyestate; int yyprevious = YYNEWLINE; yylook(){ register struct yysvf *yystate, **lsp; register struct yywork *yyt; struct yysvf *yyz; int yych, yyfirst; struct yywork *yyr; # ifdef LEXDEBUG int debug; # endif char *yylastch; /* start off machines */ # ifdef LEXDEBUG debug = 0; # endif yyfirst=1; if (!yymorfg) yylastch = yytext; else { yymorfg=0; yylastch = yytext+yyleng; } for(;;){ lsp = yylstate; yyestate = yystate = yybgin; if (yyprevious==YYNEWLINE) yystate++; for (;;){ # ifdef LEXDEBUG if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1); # endif yyt = yystate->yystoff; if(yyt == yycrank && !yyfirst){ /* may not be any transitions */ yyz = yystate->yyother; if(yyz == 0)break; if(yyz->yystoff == yycrank)break; } *yylastch++ = yych = input(); yyfirst=0; tryagain: # ifdef LEXDEBUG if(debug){ fprintf(yyout,"char "); allprint(yych); putchar('\n'); } # endif yyr = yyt; if ( (int)yyt > (int)yycrank){ yyt = yyr + yych; if (yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transitions */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; goto contin; } } # ifdef YYOPTIM else if((int)yyt < (int)yycrank) { /* r < yycrank */ yyt = yyr = yycrank+(yycrank-yyt); # ifdef LEXDEBUG if(debug)fprintf(yyout,"compressed state\n"); # endif yyt = yyt + yych; if(yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transitions */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; goto contin; } yyt = yyr + YYU(yymatch[yych]); # ifdef LEXDEBUG if(debug){ fprintf(yyout,"try fall back character "); allprint(YYU(yymatch[yych])); putchar('\n'); } # endif if(yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transition */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; goto contin; } } if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){ # ifdef LEXDEBUG if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1); # endif goto tryagain; } # endif else {unput(*--yylastch);break;} contin: # ifdef LEXDEBUG if(debug){ fprintf(yyout,"state %d char ",yystate-yysvec-1); allprint(yych); putchar('\n'); } # endif ; } # ifdef LEXDEBUG if(debug){ fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1); allprint(yych); putchar('\n'); } # endif while (lsp-- > yylstate){ *yylastch-- = 0; if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){ yyolsp = lsp; if(yyextra[*yyfnd]){ /* must backup */ while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){ lsp--; unput(*yylastch--); } } yyprevious = YYU(*yylastch); yylsp = lsp; yyleng = yylastch-yytext+1; yytext[yyleng] = 0; # ifdef LEXDEBUG if(debug){ fprintf(yyout,"\nmatch "); sprint(yytext); fprintf(yyout," action %d\n",*yyfnd); } # endif return(*yyfnd++); } unput(*yylastch); } if (yytext[0] == 0 /* && feof(yyin) */) { yysptr=yysbuf; return(0); } yyprevious = yytext[0] = input(); if (yyprevious>0) output(yyprevious); yylastch=yytext; # ifdef LEXDEBUG if(debug)putchar('\n'); # endif } } yyback(p, m) int *p; { if (p==0) return(0); while (*p) { if (*p++ == m) return(1); } return(0); } /* the following are only used in the lex library */ yyinput(){ return(input()); } yyoutput(c) int c; { output(c); } yyunput(c) int c; { unput(c); }