LEX.H 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Bob Denny 28-Aug-82 Remove reference to FILE *lexin to
  3. * eliminate dependency on standard I/O library. Only
  4. * lexgetc() used it, and it's there now.
  5. * Add EOF definition for standalone uses.
  6. * Corrected comment for llnxtmax.
  7. *
  8. * Scott Guthery 20-Nov-83 Adapt for IBM PC & DeSmet C. Removed
  9. * equivalence of yylval and lexval since
  10. * a multi-typed parser wants yylval to be
  11. * typed to be the union of the types (YYSTYPE).
  12. */
  13. /*
  14. * lex library header file -- accessed through
  15. * #include <lex.h>
  16. */
  17. #include <stdio.h>
  18. /*
  19. * Description of scanning tables. The entries at the front of
  20. * the struct must remain in place for the assembler routines to find.
  21. */
  22. struct lextab {
  23. int llendst; /* Last state number */
  24. char *lldefault; /* Default state table */
  25. char *llnext; /* Next state table */
  26. char *llcheck; /* Check table */
  27. int *llbase; /* Base table */
  28. int llnxtmax; /* Last in next table */
  29. int (*llmove)(); /* Move between states */
  30. char *llfinal; /* Final state descriptions */
  31. int (*llactr)(); /* Action routine */
  32. int *lllook; /* Look ahead vector if != NULL */
  33. char *llign; /* Ignore char vec if != NULL */
  34. char *llbrk; /* Break char vec if != NULL */
  35. char *llill; /* Illegal char vec if != NULL */
  36. };
  37. #define NBPW 16
  38. #define LEXERR 256
  39. #define LEXSKIP (-1)
  40. #define EOF (-1)
  41. //#define NULL (0)
  42. #define LEXECHO(fp) {lexecho((fp));}
  43. #define lextext llbuf
  44. #define lexlast llend
  45. extern FILE *lexin;
  46. extern llstin();