1 /* $NetBSD: lparser.h,v 1.1.1.2 2012/03/15 00:08:10 alnsn Exp $ */
4 ** $Id: lparser.h,v 1.1.1.2 2012/03/15 00:08:10 alnsn Exp $
6 ** See Copyright Notice in lua.h
18 ** Expression descriptor
26 VK
, /* info = index of constant in `k' */
27 VKNUM
, /* nval = numerical value */
28 VLOCAL
, /* info = local register */
29 VUPVAL
, /* info = index of upvalue in `upvalues' */
30 VGLOBAL
, /* info = index of table; aux = index of global name in `k' */
31 VINDEXED
, /* info = table register; aux = index register (or `k') */
32 VJMP
, /* info = instruction pc */
33 VRELOCABLE
, /* info = instruction pc */
34 VNONRELOC
, /* info = result register */
35 VCALL
, /* info = instruction pc */
36 VVARARG
/* info = instruction pc */
39 typedef struct expdesc
{
42 struct { int info
, aux
; } s
;
45 int t
; /* patch list of `exit when true' */
46 int f
; /* patch list of `exit when false' */
50 typedef struct upvaldesc
{
56 struct BlockCnt
; /* defined in lparser.c */
59 /* state needed to generate code for a given function */
60 typedef struct FuncState
{
61 Proto
*f
; /* current function header */
62 Table
*h
; /* table to find (and reuse) elements in `k' */
63 struct FuncState
*prev
; /* enclosing function */
64 struct LexState
*ls
; /* lexical state */
65 struct lua_State
*L
; /* copy of the Lua state */
66 struct BlockCnt
*bl
; /* chain of current blocks */
67 int pc
; /* next position to code (equivalent to `ncode') */
68 int lasttarget
; /* `pc' of last `jump target' */
69 int jpc
; /* list of pending jumps to `pc' */
70 int freereg
; /* first free register */
71 int nk
; /* number of elements in `k' */
72 int np
; /* number of elements in `p' */
73 short nlocvars
; /* number of elements in `locvars' */
74 lu_byte nactvar
; /* number of active local variables */
75 upvaldesc upvalues
[LUAI_MAXUPVALUES
]; /* upvalues */
76 unsigned short actvar
[LUAI_MAXVARS
]; /* declared-variable stack */
80 LUAI_FUNC Proto
*luaY_parser (lua_State
*L
, ZIO
*z
, Mbuffer
*buff
,