aboutsummaryrefslogtreecommitdiff
path: root/llex.h
diff options
context:
space:
mode:
Diffstat (limited to 'llex.h')
-rw-r--r--llex.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/llex.h b/llex.h
index f6f7c18e..4f28cc24 100644
--- a/llex.h
+++ b/llex.h
@@ -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
18struct 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
24struct textBuff {
25 char *text;
26 int tokensize;
27 int buffsize;
28};
29
30
31typedef 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
14extern int luaX_linenumber; 43extern int luaX_linenumber;
15 44
16 45
17void luaX_init (void); 46void luaX_init (void);
18int luaY_lex (void);
19void luaX_setinput (ZIO *z); 47void luaX_setinput (ZIO *z);
20char *luaX_lasttoken (void); 48char *luaX_lasttoken (void);
21 49