home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / cmd / lex / lib / yyless.c < prev    next >
Encoding:
C/C++ Source or Header  |  1979-01-10  |  308 b   |  19 lines

  1. yyless(x)
  2. {
  3. extern char yytext[];
  4. register char *lastch, *ptr;
  5. extern int yyleng;
  6. extern int yyprevious;
  7. lastch = yytext+yyleng;
  8. if (x>=0 && x <= yyleng)
  9.     ptr = x + yytext;
  10. else
  11.     ptr = x;
  12. while (lastch > ptr)
  13.     yyunput(*--lastch);
  14. *lastch = 0;
  15. if (ptr >yytext)
  16.     yyprevious = *--lastch;
  17. yyleng = ptr-yytext;
  18. }
  19.