lua/llex.h

42 lines
955 B
C
Raw Normal View History

1997-09-17 03:25:59 +08:00
/*
1998-01-09 22:57:43 +08:00
** $Id: llex.h,v 1.6 1997/12/17 20:48:58 roberto Exp roberto $
1997-09-17 03:25:59 +08:00
** Lexical Analizer
** See Copyright Notice in lua.h
*/
#ifndef llex_h
#define llex_h
#include "lobject.h"
#include "lzio.h"
#define MAX_IFS 5
/* "ifstate" keeps the state of each nested $if the lexical is dealing with. */
struct ifState {
int elsepart; /* true if its in the $else part */
int condition; /* true if $if condition is true */
int skip; /* true if part must be skiped */
};
typedef struct LexState {
int current; /* look ahead character */
1997-12-02 20:43:44 +08:00
struct zio *lex_z; /* input stream */
int linenumber; /* input line counter */
int linelasttoken; /* line where last token was read */
int lastline; /* last line wherein a SETLINE was generated */
int iflevel; /* level of nested $if's (for lexical analysis) */
1998-01-09 22:57:43 +08:00
struct ifState ifstate[MAX_IFS];
} LexState;
void luaX_init (void);
1997-09-17 03:25:59 +08:00
void luaX_setinput (ZIO *z);
char *luaX_lasttoken (void);
#endif