llex.h 919 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. ** $Id: llex.h,v 1.3 1997/11/19 17:29:23 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. struct textBuff {
  18. char *text;
  19. int tokensize;
  20. int buffsize;
  21. };
  22. typedef struct LexState {
  23. int current; /* look ahead character */
  24. struct zio *lex_z;
  25. int linenumber;
  26. struct ifState ifstate[MAX_IFS];
  27. int iflevel; /* level of nested $if's (for lexical analysis) */
  28. struct textBuff textbuff;
  29. int linelasttoken;
  30. int lastline;
  31. } LexState;
  32. void luaX_init (void);
  33. void luaX_setinput (ZIO *z);
  34. char *luaX_lasttoken (void);
  35. #endif