Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
lua-5.1.5/src/llex.h
Go to the documentation of this file.
1/*
2** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $
3** Lexical Analyzer
4** See Copyright Notice in lua.h
5*/
6
7#ifndef llex_h
8#define llex_h
9
10#include "lobject.h"
11#include "lzio.h"
12
13
14#define FIRST_RESERVED 257
15
16/* maximum length of a reserved word */
17#define TOKEN_LEN (sizeof("function")/sizeof(char))
18
19
20/*
21* WARNING: if you change the order of this enumeration,
22* grep "ORDER RESERVED"
23*/
34
35/* number of reserved words */
36#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1))
37
38
39/* array with token `names' */
40LUAI_DATA const char *const luaX_tokens [];
41
42
43typedef union {
46} SemInfo; /* semantics information */
47
48
49typedef struct Token {
50 int token;
53
54
55typedef struct LexState {
56 int current; /* current character (charint) */
57 int linenumber; /* input line counter */
58 int lastline; /* line of last token `consumed' */
59 Token t; /* current token */
60 Token lookahead; /* look ahead token */
61 struct FuncState *fs; /* `FuncState' is private to the parser */
62 struct lua_State *L;
63 ZIO *z; /* input stream */
64 Mbuffer *buff; /* buffer for tokens */
65 TString *source; /* current source name */
66 char decpoint; /* locale decimal point */
68
69
72 TString *source);
73LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l);
76LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token);
77LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);
78LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
79
80
81#endif
LUAI_FUNC void luaX_lookahead(LexState *ls)
LUAI_FUNC TString * luaX_newstring(LexState *ls, const char *str, size_t l)
LUAI_FUNC void luaX_init(lua_State *L)
Definition noparser.c:21
LUAI_FUNC void luaX_next(LexState *ls)
#define FIRST_RESERVED
LUAI_FUNC void luaX_lexerror(LexState *ls, const char *msg, int token)
LUAI_FUNC const char * luaX_token2str(LexState *ls, int token)
struct LexState LexState
LUAI_FUNC void luaX_setinput(lua_State *L, LexState *ls, ZIO *z, TString *source)
LUAI_FUNC void luaX_syntaxerror(LexState *ls, const char *s)
LUAI_DATA const char *const luaX_tokens[]
@ TK_FALSE
@ TK_NUMBER
@ TK_STRING
@ TK_BREAK
@ TK_ELSE
@ TK_DOTS
@ TK_WHILE
@ TK_LOCAL
@ TK_TRUE
@ TK_THEN
@ TK_CONCAT
@ TK_NAME
@ TK_REPEAT
@ TK_FUNCTION
@ TK_UNTIL
@ TK_RETURN
@ TK_ELSEIF
struct Token Token
LUA_NUMBER lua_Number
#define LUAI_DATA
#define LUAI_FUNC
CURL_EXTERN CURLMcode curl_socket_t s
Definition multi.h:318
struct lua_State * L
TString * source
struct FuncState * fs
Mbuffer * buff
SemInfo seminfo
lua_Number r
TString * ts