2 ** $Id: llex.h,v 1.12 1999/06/17 17:04:03 roberto Exp $
4 ** See Copyright Notice in lua.h
14 #define FIRST_RESERVED 260
16 /* maximum length of a reserved word (+1 for terminal 0) */
20 /* terminal symbols denoted by reserved words */
22 DO
, ELSE
, ELSEIF
, END
, FUNCTION
, IF
, LOCAL
, NIL
, NOT
, OR
,
23 REPEAT
, RETURN
, THEN
, UNTIL
, WHILE
,
24 /* other terminal symbols */
25 NAME
, CONC
, DOTS
, EQ
, GE
, LE
, NE
, NUMBER
, STRING
, EOS
};
29 #define MAX_IFS 5 /* arbitrary limit */
32 /* "ifstate" keeps the state of each nested $if the lexical is dealing with. */
35 int elsepart
; /* true if it's in the $else part */
36 int condition
; /* true if $if condition is true */
37 int skip
; /* true if part must be skipped */
41 typedef struct LexState
{
42 int current
; /* look ahead character */
43 int token
; /* look ahead token */
44 struct FuncState
*fs
; /* 'FuncState' is private for the parser */
48 } seminfo
; /* semantics information */
49 struct zio
*lex_z
; /* input stream */
50 int linenumber
; /* input line counter */
51 int iflevel
; /* level of nested $if's (for lexical analysis) */
52 struct ifState ifstate
[MAX_IFS
];
56 void luaX_init (void);
57 void luaX_setinput (LexState
*LS
, ZIO
*z
);
58 int luaX_lex (LexState
*LS
);
59 void luaX_syntaxerror (LexState
*ls
, char *s
, char *token
);
60 void luaX_error (LexState
*ls
, char *s
);
61 void luaX_token2str (int token
, char *s
);