llex.h 955 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. ** $Id: llex.h,v 1.6 1997/12/17 20:48:58 roberto Exp roberto $
  3. ** Lexical Analizer
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef llex_h
  7. #define llex_h
  8. #include "lobject.h"
  9. #include "lzio.h"
  10. #define MAX_IFS 5
  11. /* "ifstate" keeps the state of each nested $if the lexical is dealing with. */
  12. struct ifState {
  13. int elsepart; /* true if its in the $else part */
  14. int condition; /* true if $if condition is true */
  15. int skip; /* true if part must be skiped */
  16. };
  17. typedef struct LexState {
  18. int current; /* look ahead character */
  19. struct zio *lex_z; /* input stream */
  20. int linenumber; /* input line counter */
  21. int linelasttoken; /* line where last token was read */
  22. int lastline; /* last line wherein a SETLINE was generated */
  23. int iflevel; /* level of nested $if's (for lexical analysis) */
  24. struct ifState ifstate[MAX_IFS];
  25. } LexState;
  26. void luaX_init (void);
  27. void luaX_setinput (ZIO *z);
  28. char *luaX_lasttoken (void);
  29. #endif