]>
git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/src/third_party/lua-5.3.3/src/llex.h
2 ** $Id: llex.h,v 1.79 2016/05/02 14:02:12 roberto Exp $
4 ** See Copyright Notice in lua.h
14 #define FIRST_RESERVED 257
18 #define LUA_ENV "_ENV"
23 * WARNING: if you change the order of this enumeration,
24 * grep "ORDER RESERVED"
27 /* terminal symbols denoted by reserved words */
28 TK_AND
= FIRST_RESERVED
, TK_BREAK
,
29 TK_DO
, TK_ELSE
, TK_ELSEIF
, TK_END
, TK_FALSE
, TK_FOR
, TK_FUNCTION
,
30 TK_GOTO
, TK_IF
, TK_IN
, TK_LOCAL
, TK_NIL
, TK_NOT
, TK_OR
, TK_REPEAT
,
31 TK_RETURN
, TK_THEN
, TK_TRUE
, TK_UNTIL
, TK_WHILE
,
32 /* other terminal symbols */
33 TK_IDIV
, TK_CONCAT
, TK_DOTS
, TK_EQ
, TK_GE
, TK_LE
, TK_NE
,
36 TK_FLT
, TK_INT
, TK_NAME
, TK_STRING
39 /* number of reserved words */
40 #define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1))
47 } SemInfo
; /* semantics information */
50 typedef struct Token
{
56 /* state of the lexer plus state of the parser when shared by all
58 typedef struct LexState
{
59 int current
; /* current character (charint) */
60 int linenumber
; /* input line counter */
61 int lastline
; /* line of last token 'consumed' */
62 Token t
; /* current token */
63 Token lookahead
; /* look ahead token */
64 struct FuncState
*fs
; /* current function (parser) */
66 ZIO
*z
; /* input stream */
67 Mbuffer
*buff
; /* buffer for tokens */
68 Table
*h
; /* to avoid collection/reuse strings */
69 struct Dyndata
*dyd
; /* dynamic structures used by the parser */
70 TString
*source
; /* current source name */
71 TString
*envn
; /* environment variable name */
75 LUAI_FUNC
void luaX_init (lua_State
*L
);
76 LUAI_FUNC
void luaX_setinput (lua_State
*L
, LexState
*ls
, ZIO
*z
,
77 TString
*source
, int firstchar
);
78 LUAI_FUNC TString
*luaX_newstring (LexState
*ls
, const char *str
, size_t l
);
79 LUAI_FUNC
void luaX_next (LexState
*ls
);
80 LUAI_FUNC
int luaX_lookahead (LexState
*ls
);
81 LUAI_FUNC l_noret
luaX_syntaxerror (LexState
*ls
, const char *s
);
82 LUAI_FUNC
const char *luaX_token2str (LexState
*ls
, int token
);