diff options
Diffstat (limited to 'llex.h')
-rw-r--r-- | llex.h | 32 |
1 files changed, 30 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.h,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $ | 2 | ** $Id: llex.h,v 1.2 1997/11/04 15:27:53 roberto Exp roberto $ |
3 | ** Lexical Analizer | 3 | ** Lexical Analizer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -11,11 +11,39 @@ | |||
11 | #include "lzio.h" | 11 | #include "lzio.h" |
12 | 12 | ||
13 | 13 | ||
14 | #define MAX_IFS 5 | ||
15 | |||
16 | /* "ifstate" keeps the state of each nested $if the lexical is dealing with. */ | ||
17 | |||
18 | struct ifState { | ||
19 | int elsepart; /* true if its in the $else part */ | ||
20 | int condition; /* true if $if condition is true */ | ||
21 | int skip; /* true if part must be skiped */ | ||
22 | }; | ||
23 | |||
24 | struct textBuff { | ||
25 | char *text; | ||
26 | int tokensize; | ||
27 | int buffsize; | ||
28 | }; | ||
29 | |||
30 | |||
31 | typedef struct LexState { | ||
32 | int current; /* look ahead character */ | ||
33 | struct zio *lex_z; | ||
34 | int linenumber; | ||
35 | struct ifState ifstate[MAX_IFS]; | ||
36 | int iflevel; /* level of nested $if's (for lexical analysis) */ | ||
37 | struct textBuff textbuff; | ||
38 | int linelasttoken; | ||
39 | int lastline; | ||
40 | } LexState; | ||
41 | |||
42 | |||
14 | extern int luaX_linenumber; | 43 | extern int luaX_linenumber; |
15 | 44 | ||
16 | 45 | ||
17 | void luaX_init (void); | 46 | void luaX_init (void); |
18 | int luaY_lex (void); | ||
19 | void luaX_setinput (ZIO *z); | 47 | void luaX_setinput (ZIO *z); |
20 | char *luaX_lasttoken (void); | 48 | char *luaX_lasttoken (void); |
21 | 49 | ||