home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / LEX.ZIP / LMOVI.C < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-01  |  748 b   |  29 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. _lmovi(lp, c, st)
  9. register int    c;
  10. register int    st;
  11. register struct lextab *lp;
  12. {
  13.         int base;
  14.  
  15.         while ((base = lp->llbase[st]+c) > lp->llnxtmax ||
  16.                         (int *)(lp->llcheck)[base]!=st)
  17.                 if (st != lp->llendst) {
  18. /*
  19.  * This miscompiled on Decus C many years ago
  20.  *                      st = ((int *)lp->lldefault)[st];
  21.  */
  22.                         base = ((int *)lp->lldefault)[st];
  23.                         st = base;
  24.                 }
  25.                 else
  26.                         return(-1);
  27.         return(((int *)lp->llnext)[base]);
  28. }
  29.