2 ** $Id: lparser.h,v 1.47 2003/02/11 10:46:24 roberto Exp $
4 ** See Copyright Notice in lua.h
17 ** Expression descriptor
25 VK
, /* info = index of constant in `k' */
26 VLOCAL
, /* info = local register */
27 VUPVAL
, /* info = index of upvalue in `upvalues' */
28 VGLOBAL
, /* info = index of table; aux = index of global name in `k' */
29 VINDEXED
, /* info = table register; aux = index register (or `k') */
30 VJMP
, /* info = instruction pc */
31 VRELOCABLE
, /* info = instruction pc */
32 VNONRELOC
, /* info = result register */
33 VCALL
/* info = result register */
36 typedef struct expdesc
{
39 int t
; /* patch list of `exit when true' */
40 int f
; /* patch list of `exit when false' */
44 struct BlockCnt
; /* defined in lparser.c */
47 /* state needed to generate code for a given function */
48 typedef struct FuncState
{
49 Proto
*f
; /* current function header */
50 Table
*h
; /* table to find (and reuse) elements in `k' */
51 struct FuncState
*prev
; /* enclosing function */
52 struct LexState
*ls
; /* lexical state */
53 struct lua_State
*L
; /* copy of the Lua state */
54 struct BlockCnt
*bl
; /* chain of current blocks */
55 int pc
; /* next position to code (equivalent to `ncode') */
56 int lasttarget
; /* `pc' of last `jump target' */
57 int jpc
; /* list of pending jumps to `pc' */
58 int freereg
; /* first free register */
59 int nk
; /* number of elements in `k' */
60 int np
; /* number of elements in `p' */
61 int nlocvars
; /* number of elements in `locvars' */
62 int nactvar
; /* number of active local variables */
63 expdesc upvalues
[MAXUPVALUES
]; /* upvalues */
64 int actvar
[MAXVARS
]; /* declared-variable stack */
68 Proto
*luaY_parser (lua_State
*L
, ZIO
*z
, Mbuffer
*buff
);