diff src/lua/src/lcode.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/lua/src/lcode.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,76 @@
     1.4 +/*
     1.5 +** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $
     1.6 +** Code generator for Lua
     1.7 +** See Copyright Notice in lua.h
     1.8 +*/
     1.9 +
    1.10 +#ifndef lcode_h
    1.11 +#define lcode_h
    1.12 +
    1.13 +#include "llex.h"
    1.14 +#include "lobject.h"
    1.15 +#include "lopcodes.h"
    1.16 +#include "lparser.h"
    1.17 +
    1.18 +
    1.19 +/*
    1.20 +** Marks the end of a patch list. It is an invalid value both as an absolute
    1.21 +** address, and as a list link (would link an element to itself).
    1.22 +*/
    1.23 +#define NO_JUMP (-1)
    1.24 +
    1.25 +
    1.26 +/*
    1.27 +** grep "ORDER OPR" if you change these enums
    1.28 +*/
    1.29 +typedef enum BinOpr {
    1.30 +  OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW,
    1.31 +  OPR_CONCAT,
    1.32 +  OPR_NE, OPR_EQ,
    1.33 +  OPR_LT, OPR_LE, OPR_GT, OPR_GE,
    1.34 +  OPR_AND, OPR_OR,
    1.35 +  OPR_NOBINOPR
    1.36 +} BinOpr;
    1.37 +
    1.38 +
    1.39 +typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr;
    1.40 +
    1.41 +
    1.42 +#define getcode(fs,e)	((fs)->f->code[(e)->u.s.info])
    1.43 +
    1.44 +#define luaK_codeAsBx(fs,o,A,sBx)	luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)
    1.45 +
    1.46 +#define luaK_setmultret(fs,e)	luaK_setreturns(fs, e, LUA_MULTRET)
    1.47 +
    1.48 +LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
    1.49 +LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
    1.50 +LUAI_FUNC void luaK_fixline (FuncState *fs, int line);
    1.51 +LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);
    1.52 +LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n);
    1.53 +LUAI_FUNC void luaK_checkstack (FuncState *fs, int n);
    1.54 +LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s);
    1.55 +LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r);
    1.56 +LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e);
    1.57 +LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e);
    1.58 +LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e);
    1.59 +LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);
    1.60 +LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e);
    1.61 +LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
    1.62 +LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
    1.63 +LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);
    1.64 +LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);
    1.65 +LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
    1.66 +LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e);
    1.67 +LUAI_FUNC int luaK_jump (FuncState *fs);
    1.68 +LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret);
    1.69 +LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target);
    1.70 +LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list);
    1.71 +LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2);
    1.72 +LUAI_FUNC int luaK_getlabel (FuncState *fs);
    1.73 +LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v);
    1.74 +LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);
    1.75 +LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2);
    1.76 +LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);
    1.77 +
    1.78 +
    1.79 +#endif