29 lines
674 B
C
29 lines
674 B
C
#ifndef lint
|
|
static char sccsid[] = "@(#)yyless.c 1.1 92/07/30 SMI"; /* from UCB S5R2 1.4 */
|
|
#endif
|
|
|
|
yyless(x)
|
|
{
|
|
extern char yytext[];
|
|
register char *lastch, *ptr;
|
|
extern int yyleng;
|
|
extern int yyprevious;
|
|
lastch = yytext+yyleng;
|
|
if (x>=0 && x <= yyleng)
|
|
ptr = x + yytext;
|
|
else
|
|
/*
|
|
* The cast on the next line papers over an unconscionable nonportable
|
|
* glitch to allow the caller to hand the function a pointer instead of
|
|
* an integer and hope that it gets figured out properly. But it's
|
|
* that way on all systems .
|
|
*/
|
|
ptr = (char *) x;
|
|
while (lastch > ptr)
|
|
yyunput(*--lastch);
|
|
*lastch = 0;
|
|
if (ptr >yytext)
|
|
yyprevious = *--lastch;
|
|
yyleng = ptr-yytext;
|
|
}
|