Lua 5.1.4: lcode.h


L0001    /*
L0002    ** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $
L0003    ** Code generator for Lua
L0004    ** See Copyright Notice in lua.h
L0005    */
L0006    
L0007    #ifndef lcode_h
L0008    #define lcode_h
L0009    
L0010    #include "llex.h"
L0011    #include "lobject.h"
L0012    #include "lopcodes.h"
L0013    #include "lparser.h"
L0014    
L0015    
L0016    /*
L0017    ** Marks the end of a patch list. It is an invalid value both as an absolute
L0018    ** address, and as a list link (would link an element to itself).
L0019    */
L0020    #define NO_JUMP (-1)
L0021    
L0022    
L0023    /*
L0024    ** grep "ORDER OPR" if you change these enums
L0025    */
L0026    typedef enum BinOpr {
L0027      OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW,
L0028      OPR_CONCAT,
L0029      OPR_NE, OPR_EQ,
L0030      OPR_LT, OPR_LE, OPR_GT, OPR_GE,
L0031      OPR_AND, OPR_OR,
L0032      OPR_NOBINOPR
L0033    } BinOpr;
L0034    
L0035    
L0036    typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr;
L0037    
L0038    
L0039    #define getcode(fs,e)	((fs)->f->code[(e)->u.s.info])
FuncState*, expdesc* -> int
L0040 L0041
#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx) L0042 L0043 #define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET) L0044 L0045 LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); L0046 LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); L0047 LUAI_FUNC void luaK_fixline (FuncState *fs, int line); L0048 LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); L0049 LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); L0050 LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); L0051 LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); L0052 LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r); L0053 LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); L0054 LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); L0055 LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); L0056 LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); L0057 LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); L0058 LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); L0059 LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); L0060 LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); L0061 LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); L0062 LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); L0063 LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e); L0064 LUAI_FUNC int luaK_jump (FuncState *fs); L0065 LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret); L0066 LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target); L0067 LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list); L0068 LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2); L0069 LUAI_FUNC int luaK_getlabel (FuncState *fs); L0070 LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v); L0071 LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); L0072 LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2); L0073 LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); L0074 L0075 L0076 #endif

Generated by pretty.lua