Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
lparser.h File Reference
#include "llimits.h"
#include "lobject.h"
#include "lzio.h"

Go to the source code of this file.

Data Structures

struct  expdesc
 
union  Vardesc
 
struct  Labeldesc
 
struct  Labellist
 
struct  Dyndata
 
struct  FuncState
 

Macros

#define vkisvar(k)   (VLOCAL <= (k) && (k) <= VINDEXED)
 
#define vkisinreg(k)   ((k) == VNONRELOC || (k) == VLOCAL)
 

Typedefs

typedef struct expdesc expdesc
 
typedef struct Vardesc Vardesc
 
typedef struct Labeldesc Labeldesc
 
typedef struct Labellist Labellist
 
typedef struct Dyndata Dyndata
 
typedef struct FuncState FuncState
 

Enumerations

enum  expkind {
  VVOID , VNIL , VTRUE , VFALSE ,
  VK , VKFLT , VKINT , VNONRELOC ,
  VLOCAL , VUPVAL , VINDEXED , VJMP ,
  VRELOCABLE , VCALL , VVARARG
}
 

Functions

LUAI_FUNC LClosureluaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, Dyndata *dyd, const char *name, int firstchar)
 

Macro Definition Documentation

◆ vkisinreg

#define vkisinreg ( k)    ((k) == VNONRELOC || (k) == VLOCAL)

Definition at line 52 of file lua-5.3.6/src/lparser.h.

◆ vkisvar

#define vkisvar ( k)    (VLOCAL <= (k) && (k) <= VINDEXED)

Definition at line 51 of file lua-5.3.6/src/lparser.h.

Typedef Documentation

◆ Dyndata

typedef struct Dyndata Dyndata

◆ expdesc

typedef struct expdesc expdesc

◆ FuncState

typedef struct FuncState FuncState

◆ Labeldesc

typedef struct Labeldesc Labeldesc

◆ Labellist

typedef struct Labellist Labellist

◆ Vardesc

typedef struct Vardesc Vardesc

Enumeration Type Documentation

◆ expkind

enum expkind
Enumerator
VVOID 
VNIL 
VTRUE 
VFALSE 
VK 
VKFLT 
VKINT 
VNONRELOC 
VLOCAL 
VUPVAL 
VINDEXED 
VJMP 
VRELOCABLE 
VCALL 
VVARARG 

Definition at line 25 of file lua-5.3.6/src/lparser.h.

25 {
26 VVOID, /* when 'expdesc' describes the last expression a list,
27 this kind means an empty list (so, no expression) */
28 VNIL, /* constant nil */
29 VTRUE, /* constant true */
30 VFALSE, /* constant false */
31 VK, /* constant in 'k'; info = index of constant in 'k' */
32 VKFLT, /* floating constant; nval = numerical float value */
33 VKINT, /* integer constant; nval = numerical integer value */
34 VNONRELOC, /* expression has its value in a fixed register;
35 info = result register */
36 VLOCAL, /* local variable; info = local register */
37 VUPVAL, /* upvalue variable; info = index of upvalue in 'upvalues' */
38 VINDEXED, /* indexed variable;
39 ind.vt = whether 't' is register or upvalue;
40 ind.t = table register or upvalue;
41 ind.idx = key's R/K index */
42 VJMP, /* expression is a test/comparison;
43 info = pc of corresponding jump instruction */
44 VRELOCABLE, /* expression can put result in any register;
45 info = instruction pc */
46 VCALL, /* expression is a function call; info = instruction pc */
47 VVARARG /* vararg expression; info = instruction pc */
48} expkind;

Function Documentation

◆ luaY_parser()

LUAI_FUNC LClosure * luaY_parser ( lua_State * L,
ZIO * z,
Mbuffer * buff,
Dyndata * dyd,
const char * name,
int firstchar )

Definition at line 1618 of file lua-5.2.4/src/lparser.c.

1619 {
1620 LexState lexstate;
1621 FuncState funcstate;
1622 Closure *cl = luaF_newLclosure(L, 1); /* create main closure */
1623 /* anchor closure (to avoid being collected) */
1624 setclLvalue(L, L->top, cl);
1625 incr_top(L);
1626 funcstate.f = cl->l.p = luaF_newproto(L);
1627 funcstate.f->source = luaS_new(L, name); /* create and anchor TString */
1628 lexstate.buff = buff;
1629 lexstate.dyd = dyd;
1630 dyd->actvar.n = dyd->gt.n = dyd->label.n = 0;
1631 luaX_setinput(L, &lexstate, z, funcstate.f->source, firstchar);
1632 mainfunc(&lexstate, &funcstate);
1633 lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs);
1634 /* all scopes should be correctly finished */
1635 lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0);
1636 return cl; /* it's on the stack too */
1637}
const char * name
Definition lsqlite3.c:2154
#define incr_top(L)
Proto * luaF_newproto(lua_State *L)
Closure * luaF_newLclosure(lua_State *L, int nelems, Table *e)
void luaX_setinput(lua_State *L, LexState *ls, ZIO *z, TString *source)
#define lua_assert(c)
#define luaS_new(L, s)
#define setclLvalue(L, obj, x)
static void mainfunc(LexState *ls, FuncState *fs)
struct Dyndata::@63 actvar
struct FuncState * prev
struct Proto * p
struct FuncState * fs
struct Dyndata * dyd
Mbuffer * buff
TString * source