home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / alde_c / misc / comm / yaccunx / yyless.c < prev    next >
Encoding:
C/C++ Source or Header  |  1983-12-25  |  387 b   |  20 lines

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