Github User Fetcher
1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
lua-5.2.4/src/lparser.h
Go to the documentation of this file.
1
/*
2
** $Id: lparser.h,v 1.70.1.1 2013/04/12 18:48:47 roberto Exp $
3
** Lua Parser
4
** See Copyright Notice in lua.h
5
*/
6
7
#ifndef lparser_h
8
#define lparser_h
9
10
#include "
llimits.h
"
11
#include "
lobject.h
"
12
#include "
lzio.h
"
13
14
15
/*
16
** Expression descriptor
17
*/
18
19
typedef
enum
{
20
VVOID
,
/* no value */
21
VNIL
,
22
VTRUE
,
23
VFALSE
,
24
VK
,
/* info = index of constant in `k' */
25
VKNUM
,
/* nval = numerical value */
26
VNONRELOC
,
/* info = result register */
27
VLOCAL
,
/* info = local register */
28
VUPVAL
,
/* info = index of upvalue in 'upvalues' */
29
VINDEXED
,
/* t = table register/upvalue; idx = index R/K */
30
VJMP
,
/* info = instruction pc */
31
VRELOCABLE
,
/* info = instruction pc */
32
VCALL
,
/* info = instruction pc */
33
VVARARG
/* info = instruction pc */
34
}
expkind
;
35
36
37
#define vkisvar(k) (VLOCAL <= (k) && (k) <= VINDEXED)
38
#define vkisinreg(k) ((k) == VNONRELOC || (k) == VLOCAL)
39
40
typedef
struct
expdesc
{
41
expkind
k
;
42
union
{
43
struct
{
/* for indexed variables (VINDEXED) */
44
short
idx
;
/* index (R/K) */
45
lu_byte
t
;
/* table (register or upvalue) */
46
lu_byte
vt
;
/* whether 't' is register (VLOCAL) or upvalue (VUPVAL) */
47
}
ind
;
48
int
info
;
/* for generic use */
49
lua_Number
nval
;
/* for VKNUM */
50
}
u
;
51
int
t
;
/* patch list of `exit when true' */
52
int
f
;
/* patch list of `exit when false' */
53
}
expdesc
;
54
55
56
/* description of active local variable */
57
typedef
struct
Vardesc
{
58
short
idx
;
/* variable index in stack */
59
}
Vardesc
;
60
61
62
/* description of pending goto statements and label statements */
63
typedef
struct
Labeldesc
{
64
TString
*
name
;
/* label identifier */
65
int
pc
;
/* position in code */
66
int
line
;
/* line where it appeared */
67
lu_byte
nactvar
;
/* local level where it appears in current block */
68
}
Labeldesc
;
69
70
71
/* list of labels or gotos */
72
typedef
struct
Labellist
{
73
Labeldesc
*
arr
;
/* array */
74
int
n
;
/* number of entries in use */
75
int
size
;
/* array size */
76
}
Labellist
;
77
78
79
/* dynamic structures used by the parser */
80
typedef
struct
Dyndata
{
81
struct
{
/* list of active local variables */
82
Vardesc
*
arr
;
83
int
n
;
84
int
size
;
85
}
actvar
;
86
Labellist
gt
;
/* list of pending gotos */
87
Labellist
label
;
/* list of active labels */
88
}
Dyndata
;
89
90
91
/* control of blocks */
92
struct
BlockCnt
;
/* defined in lparser.c */
93
94
95
/* state needed to generate code for a given function */
96
typedef
struct
FuncState
{
97
Proto
*
f
;
/* current function header */
98
Table
*
h
;
/* table to find (and reuse) elements in `k' */
99
struct
FuncState
*
prev
;
/* enclosing function */
100
struct
LexState
*
ls
;
/* lexical state */
101
struct
BlockCnt
*
bl
;
/* chain of current blocks */
102
int
pc
;
/* next position to code (equivalent to `ncode') */
103
int
lasttarget
;
/* 'label' of last 'jump label' */
104
int
jpc
;
/* list of pending jumps to `pc' */
105
int
nk
;
/* number of elements in `k' */
106
int
np
;
/* number of elements in `p' */
107
int
firstlocal
;
/* index of first local var (in Dyndata array) */
108
short
nlocvars
;
/* number of elements in 'f->locvars' */
109
lu_byte
nactvar
;
/* number of active local variables */
110
lu_byte
nups
;
/* number of upvalues */
111
lu_byte
freereg
;
/* first free register */
112
}
FuncState
;
113
114
115
LUAI_FUNC
Closure
*
luaY_parser
(
lua_State
*L,
ZIO
*z,
Mbuffer
*buff,
116
Dyndata
*dyd,
const
char
*
name
,
int
firstchar);
117
118
119
#endif
name
const char * name
Definition
lsqlite3.c:2154
lu_byte
unsigned char lu_byte
Definition
lua-5.1.5/src/llimits.h:27
expkind
expkind
Definition
lua-5.1.5/src/lparser.h:19
lua_Number
LUA_NUMBER lua_Number
Definition
lua-5.1.5/src/lua.h:99
LUAI_FUNC
#define LUAI_FUNC
Definition
lua-5.1.5/src/luaconf.h:191
llimits.h
lobject.h
FuncState
struct FuncState FuncState
expdesc
struct expdesc expdesc
Vardesc
struct Vardesc Vardesc
Labeldesc
struct Labeldesc Labeldesc
Labellist
struct Labellist Labellist
luaY_parser
LUAI_FUNC Closure * luaY_parser(lua_State *L, ZIO *z, Mbuffer *buff, Dyndata *dyd, const char *name, int firstchar)
Definition
lua-5.2.4/src/lparser.c:1618
Dyndata
struct Dyndata Dyndata
expkind
expkind
Definition
lua-5.2.4/src/lparser.h:19
VKNUM
@ VKNUM
Definition
lua-5.2.4/src/lparser.h:25
VTRUE
@ VTRUE
Definition
lua-5.2.4/src/lparser.h:22
VFALSE
@ VFALSE
Definition
lua-5.2.4/src/lparser.h:23
VVARARG
@ VVARARG
Definition
lua-5.2.4/src/lparser.h:33
VNIL
@ VNIL
Definition
lua-5.2.4/src/lparser.h:21
VUPVAL
@ VUPVAL
Definition
lua-5.2.4/src/lparser.h:28
VNONRELOC
@ VNONRELOC
Definition
lua-5.2.4/src/lparser.h:26
VINDEXED
@ VINDEXED
Definition
lua-5.2.4/src/lparser.h:29
VRELOCABLE
@ VRELOCABLE
Definition
lua-5.2.4/src/lparser.h:31
VJMP
@ VJMP
Definition
lua-5.2.4/src/lparser.h:30
VLOCAL
@ VLOCAL
Definition
lua-5.2.4/src/lparser.h:27
VVOID
@ VVOID
Definition
lua-5.2.4/src/lparser.h:20
VCALL
@ VCALL
Definition
lua-5.2.4/src/lparser.h:32
VK
@ VK
Definition
lua-5.2.4/src/lparser.h:24
lzio.h
BlockCnt
Definition
lua-5.1.5/src/lparser.c:40
Dyndata
Definition
lua-5.2.4/src/lparser.h:80
Dyndata::gt
Labellist gt
Definition
lua-5.2.4/src/lparser.h:86
Dyndata::actvar
struct Dyndata::@63 actvar
Dyndata::size
int size
Definition
lua-5.2.4/src/lparser.h:84
Dyndata::label
Labellist label
Definition
lua-5.2.4/src/lparser.h:87
Dyndata::arr
Vardesc * arr
Definition
lua-5.2.4/src/lparser.h:82
Dyndata::n
int n
Definition
lua-5.2.4/src/lparser.h:83
FuncState
Definition
lua-5.1.5/src/lparser.h:58
FuncState::h
Table * h
Definition
lua-5.1.5/src/lparser.h:60
FuncState::nactvar
lu_byte nactvar
Definition
lua-5.1.5/src/lparser.h:72
FuncState::jpc
int jpc
Definition
lua-5.1.5/src/lparser.h:67
FuncState::prev
struct FuncState * prev
Definition
lua-5.1.5/src/lparser.h:61
FuncState::bl
struct BlockCnt * bl
Definition
lua-5.1.5/src/lparser.h:64
FuncState::nk
int nk
Definition
lua-5.1.5/src/lparser.h:69
FuncState::f
Proto * f
Definition
lua-5.1.5/src/lparser.h:59
FuncState::nlocvars
short nlocvars
Definition
lua-5.1.5/src/lparser.h:71
FuncState::firstlocal
int firstlocal
Definition
lua-5.2.4/src/lparser.h:107
FuncState::freereg
lu_byte freereg
Definition
lua-5.2.4/src/lparser.h:111
FuncState::nups
lu_byte nups
Definition
lua-5.2.4/src/lparser.h:110
FuncState::np
int np
Definition
lua-5.1.5/src/lparser.h:70
FuncState::pc
int pc
Definition
lua-5.1.5/src/lparser.h:65
FuncState::ls
struct LexState * ls
Definition
lua-5.1.5/src/lparser.h:62
FuncState::lasttarget
int lasttarget
Definition
lua-5.1.5/src/lparser.h:66
Labeldesc
Definition
lua-5.2.4/src/lparser.h:63
Labeldesc::pc
int pc
Definition
lua-5.2.4/src/lparser.h:65
Labeldesc::nactvar
lu_byte nactvar
Definition
lua-5.2.4/src/lparser.h:67
Labeldesc::name
TString * name
Definition
lua-5.2.4/src/lparser.h:64
Labeldesc::line
int line
Definition
lua-5.2.4/src/lparser.h:66
Labellist
Definition
lua-5.2.4/src/lparser.h:72
Labellist::size
int size
Definition
lua-5.2.4/src/lparser.h:75
Labellist::n
int n
Definition
lua-5.2.4/src/lparser.h:74
Labellist::arr
Labeldesc * arr
Definition
lua-5.2.4/src/lparser.h:73
LexState
Definition
lua-5.1.5/src/llex.h:55
Mbuffer
Definition
lua-5.1.5/src/lzio.h:24
Proto
Definition
lua-5.1.5/src/lobject.h:231
Table
Definition
lua-5.1.5/src/lobject.h:338
Vardesc
Definition
lua-5.2.4/src/lparser.h:57
Vardesc::idx
short idx
Definition
lua-5.2.4/src/lparser.h:58
Zio
Definition
lua-5.1.5/src/lzio.h:56
expdesc
Definition
lua-5.1.5/src/lparser.h:37
expdesc::info
int info
Definition
lua-5.1.5/src/lparser.h:40
expdesc::idx
short idx
Definition
lua-5.2.4/src/lparser.h:44
expdesc::t
int t
Definition
lua-5.1.5/src/lparser.h:43
expdesc::u
union expdesc::@52 u
expdesc::vt
lu_byte vt
Definition
lua-5.2.4/src/lparser.h:46
expdesc::nval
lua_Number nval
Definition
lua-5.1.5/src/lparser.h:41
expdesc::k
expkind k
Definition
lua-5.1.5/src/lparser.h:38
expdesc::ind
struct expdesc::@61::@62 ind
expdesc::f
int f
Definition
lua-5.1.5/src/lparser.h:44
expdesc::t
lu_byte t
Definition
lua-5.2.4/src/lparser.h:45
lua_State
Definition
lua-5.1.5/src/lstate.h:100
Closure
Definition
lua-5.1.5/src/lobject.h:309
TString
Definition
lua-5.1.5/src/lobject.h:199
vendor
civetweb
third_party
lua-5.2.4
src
lparser.h
Generated by
1.10.0