Lua 5.1.4: lparser.h


L0001    /*
L0002    ** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $
L0003    ** Lua Parser
L0004    ** See Copyright Notice in lua.h
L0005    */
L0006    
L0007    #ifndef lparser_h
L0008    #define lparser_h
L0009    
L0010    #include "llimits.h"
L0011    #include "lobject.h"
L0012    #include "lzio.h"
L0013    
L0014    
L0015    /*
L0016    ** Expression descriptor
L0017    */
L0018    
L0019    typedef enum {
L0020      VVOID,	/* no value */
L0021      VNIL,
L0022      VTRUE,
L0023      VFALSE,
L0024      VK,		/* info = index of constant in `k' */
L0025      VKNUM,	/* nval = numerical value */
L0026      VLOCAL,	/* info = local register */
L0027      VUPVAL,       /* info = index of upvalue in `upvalues' */
L0028      VGLOBAL,	/* info = index of table; aux = index of global name in `k' */
L0029      VINDEXED,	/* info = table register; aux = index register (or `k') */
L0030      VJMP,		/* info = instruction pc */
L0031      VRELOCABLE,	/* info = instruction pc */
L0032      VNONRELOC,	/* info = result register */
L0033      VCALL,	/* info = instruction pc */
L0034      VVARARG	/* info = instruction pc */
L0035    } expkind;
L0036    
L0037    typedef struct expdesc {
L0038      expkind k;
L0039      union {
L0040        struct { int info, aux; } s;
L0041        lua_Number nval;
L0042      } u;
L0043      int t;  /* patch list of `exit when true' */
L0044      int f;  /* patch list of `exit when false' */
L0045    } expdesc;
L0046    
L0047    
L0048    typedef struct upvaldesc {
L0049      lu_byte k;
L0050      lu_byte info;
L0051    } upvaldesc;
L0052    
L0053    
L0054    struct BlockCnt;  /* defined in lparser.c */
L0055    
L0056    
L0057    /* state needed to generate code for a given function */
L0058    typedef struct FuncState {
L0059      Proto *f;  /* current function header */
L0060      Table *h;  /* table to find (and reuse) elements in `k' */
L0061      struct FuncState *prev;  /* enclosing function */
L0062      struct LexState *ls;  /* lexical state */
L0063      struct lua_State *L;  /* copy of the Lua state */
L0064      struct BlockCnt *bl;  /* chain of current blocks */
L0065      int pc;  /* next position to code (equivalent to `ncode') */
L0066      int lasttarget;   /* `pc' of last `jump target' */
L0067      int jpc;  /* list of pending jumps to `pc' */
L0068      int freereg;  /* first free register */
L0069      int nk;  /* number of elements in `k' */
L0070      int np;  /* number of elements in `p' */
L0071      short nlocvars;  /* number of elements in `locvars' */
L0072      lu_byte nactvar;  /* number of active local variables */
L0073      upvaldesc upvalues[LUAI_MAXUPVALUES];  /* upvalues */
L0074      unsigned short actvar[LUAI_MAXVARS];  /* declared-variable stack */
L0075    } FuncState;
L0076    
L0077    
L0078    LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
L0079                                                const char *name);
L0080    
L0081    
L0082    #endif

Generated by pretty.lua