summaryrefslogtreecommitdiff
path: root/lcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'lcode.h')
-rw-r--r--lcode.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/lcode.h b/lcode.h
index f7cf5e2c..c0f3392a 100644
--- a/lcode.h
+++ b/lcode.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.h,v 1.14 2000/06/16 17:51:40 roberto Exp roberto $ 2** $Id: lcode.h,v 1.15 2000/06/28 20:20:36 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -20,6 +20,20 @@
20#define NO_JUMP (-1) 20#define NO_JUMP (-1)
21 21
22 22
23/*
24** grep "ORDER OPR" if you change these enums
25*/
26typedef enum BinOpr {
27 OPR_ADD, OPR_SUB, OPR_MULT, OPR_DIV, OPR_POW,
28 OPR_CONCAT,
29 OPR_NE, OPR_EQ, OPR_LT, OPR_LE, OPR_GT, OPR_GE,
30 OPR_AND, OPR_OR,
31 OPR_NOBINOPR
32} BinOpr;
33
34typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_NOUNOPR } UnOpr;
35
36
23enum Mode {iO, iU, iS, iAB}; /* instruction format */ 37enum Mode {iO, iU, iS, iAB}; /* instruction format */
24 38
25#define VD 100 /* flag for variable delta */ 39#define VD 100 /* flag for variable delta */
@@ -48,9 +62,9 @@ int luaK_lastisopen (FuncState *fs);
48void luaK_setcallreturns (FuncState *fs, int nresults); 62void luaK_setcallreturns (FuncState *fs, int nresults);
49void luaK_tostack (LexState *ls, expdesc *v, int onlyone); 63void luaK_tostack (LexState *ls, expdesc *v, int onlyone);
50void luaK_storevar (LexState *ls, const expdesc *var); 64void luaK_storevar (LexState *ls, const expdesc *var);
51void luaK_prefix (LexState *ls, int op, expdesc *v); 65void luaK_prefix (LexState *ls, UnOpr op, expdesc *v);
52void luaK_infix (LexState *ls, int op, expdesc *v); 66void luaK_infix (LexState *ls, BinOpr op, expdesc *v);
53void luaK_posfix (LexState *ls, int op, expdesc *v1, expdesc *v2); 67void luaK_posfix (LexState *ls, BinOpr op, expdesc *v1, expdesc *v2);
54 68
55 69
56#endif 70#endif