home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / C / LEX / LMOVB.C < prev    next >
Text File  |  1993-12-01  |  739b  |  30 lines

  1. /*
  2.  * Bob Denny     28-Aug-82  Remove reference to stdio.h
  3.  * Scott Guthery 20-Nov-83    Adapt for IBM PC & DeSmet C
  4.  */
  5.  
  6. #include <lex.h>
  7.  
  8. _lmovb(lp, c, st)
  9. register int c, st;
  10. register struct lextab *lp;
  11. {
  12.         int base;
  13.  
  14.         while ((base = lp->llbase[st]+c) > lp->llnxtmax ||
  15.                         (lp->llcheck[base] & 0377) != st) {
  16.  
  17.                 if (st != lp->llendst) {
  18. /*
  19.  * This miscompiled on Decus C many years ago:
  20.  *                      st = lp->lldefault[st] & 0377;
  21.  */
  22.                         base = lp->lldefault[st] & 0377;
  23.                         st = base;
  24.                 }
  25.                 else
  26.                         return(-1);
  27.         }
  28.         return(lp->llnext[base]&0377);
  29. }
  30.