Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
lua-5.4.3/src/llex.h
Go to the documentation of this file.
1/*
2** $Id: llex.h $
3** Lexical Analyzer
4** See Copyright Notice in lua.h
5*/
6
7#ifndef llex_h
8#define llex_h
9
10#include <limits.h>
11
12#include "lobject.h"
13#include "lzio.h"
14
15
16/*
17** Single-char tokens (terminal symbols) are represented by their own
18** numeric code. Other tokens start at the following value.
19*/
20#define FIRST_RESERVED (UCHAR_MAX + 1)
21
22
23#if !defined(LUA_ENV)
24#define LUA_ENV "_ENV"
25#endif
26
27
28/*
29* WARNING: if you change the order of this enumeration,
30* grep "ORDER RESERVED"
31*/
44
45/* number of reserved words */
46#define NUM_RESERVED (cast_int(TK_WHILE-FIRST_RESERVED + 1))
47
48
49typedef union {
50 lua_Number r;
52 TString *ts;
53} SemInfo; /* semantics information */
54
55
56typedef struct Token {
57 int token;
60
61
62/* state of the lexer plus state of the parser when shared by all
63 functions */
64typedef struct LexState {
65 int current; /* current character (charint) */
66 int linenumber; /* input line counter */
67 int lastline; /* line of last token 'consumed' */
68 Token t; /* current token */
69 Token lookahead; /* look ahead token */
70 struct FuncState *fs; /* current function (parser) */
71 struct lua_State *L;
72 ZIO *z; /* input stream */
73 Mbuffer *buff; /* buffer for tokens */
74 Table *h; /* to avoid collection/reuse strings */
75 struct Dyndata *dyd; /* dynamic structures used by the parser */
76 TString *source; /* current source name */
77 TString *envn; /* environment variable name */
79
80
83 TString *source, int firstchar);
84LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l);
88LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
89
90
91#endif
LUA_INTEGER lua_Integer
LUA_NUMBER lua_Number
#define LUAI_FUNC
#define l_noret
LUAI_FUNC l_noret luaX_syntaxerror(LexState *ls, const char *s)
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 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, int firstchar)
LUAI_FUNC int luaX_lookahead(LexState *ls)
@ TK_FALSE
@ TK_STRING
@ TK_BREAK
@ TK_DBCOLON
@ TK_ELSE
@ TK_DOTS
@ TK_WHILE
@ TK_LOCAL
@ TK_TRUE
@ TK_THEN
@ TK_IDIV
@ TK_CONCAT
@ TK_NAME
@ TK_REPEAT
@ TK_FUNCTION
@ TK_UNTIL
@ TK_RETURN
@ TK_GOTO
@ TK_ELSEIF
struct Token Token
CURL_EXTERN CURLMcode curl_socket_t s
Definition multi.h:318
struct lua_State * L
TString * source
struct FuncState * fs
struct Dyndata * dyd
Mbuffer * buff
TString * envn
SemInfo seminfo