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 , VKNUM , VNONRELOC , VLOCAL ,
  VUPVAL , VINDEXED , VJMP , VRELOCABLE ,
  VCALL , VVARARG
}
 

Functions

LUAI_FUNC ClosureluaY_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 38 of file lua-5.2.4/src/lparser.h.

Referenced by luaK_indexed().

◆ vkisvar

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

Definition at line 37 of file lua-5.2.4/src/lparser.h.

Referenced by assignment(), assignment(), and restassign().

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 
VKNUM 
VNONRELOC 
VLOCAL 
VUPVAL 
VINDEXED 
VJMP 
VRELOCABLE 
VCALL 
VVARARG 

Definition at line 19 of file lua-5.2.4/src/lparser.h.

19 {
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;

Function Documentation

◆ luaY_parser()

LUAI_FUNC Closure * 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