The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
lcode.h
Go to the documentation of this file.
1 /*
2 ** Code generator for Lua
3 ** See Copyright Notice in lua.h
4 */
5 
6 #ifndef lcode_h
7 #define lcode_h
8 
9 #include "llex.h"
10 #include "lobject.h"
11 #include "lopcodes.h"
12 #include "lparser.h"
13 
14 
15 /*
16 ** Marks the end of a patch list. It is an invalid value both as an absolute
17 ** address, and as a list link (would link an element to itself).
18 */
19 #define NO_JUMP (-1)
20 
21 
22 /*
23 ** grep "ORDER OPR" if you change these enums (ORDER OP)
24 */
25 typedef enum BinOpr {
32 } BinOpr;
33 
34 
36 
37 
38 #define getcode(fs,e) ((fs)->f->code[(e)->u.info])
39 
40 #define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)
41 
42 #define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET)
43 
44 #define luaK_jumpto(fs,t) luaK_patchlist(fs, luaK_jump(fs), t)
45 
46 LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
47 LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
48 LUAI_FUNC int luaK_codek (FuncState *fs, int reg, int k);
49 LUAI_FUNC void luaK_fixline (FuncState *fs, int line);
50 LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);
51 LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n);
52 LUAI_FUNC void luaK_checkstack (FuncState *fs, int n);
61 LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
66 LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
68 LUAI_FUNC int luaK_jump (FuncState *fs);
69 LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret);
70 LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target);
71 LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list);
72 LUAI_FUNC void luaK_patchclose (FuncState *fs, int list, int level);
73 LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2);
75 LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v, int line);
76 LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);
78  expdesc *v2, int line);
79 LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);
80 
81 
82 #endif
Definition: lcode.h:29
Definition: lcode.h:26
Definition: lcode.h:28
GLint level
Definition: glew.h:1220
#define LUAI_FUNC
Definition: luaconf.h:187
LUAI_FUNC void luaK_exp2val(FuncState *fs, expdesc *e)
Definition: lcode.cpp:519
LUAI_FUNC void luaK_checkstack(FuncState *fs, int n)
Definition: lcode.cpp:260
GLfloat GLfloat v1
Definition: glew.h:1820
LUAI_FUNC void luaK_fixline(FuncState *fs, int line)
Definition: lcode.cpp:861
GLfloat GLfloat GLfloat v2
Definition: glew.h:1824
LUAI_FUNC void luaK_exp2nextreg(FuncState *fs, expdesc *e)
Definition: lcode.cpp:491
LUAI_FUNC void luaK_infix(FuncState *fs, BinOpr op, expdesc *v)
Definition: lcode.cpp:785
LUAI_FUNC int luaK_exp2RK(FuncState *fs, expdesc *e)
Definition: lcode.cpp:527
LUAI_FUNC void luaK_dischargevars(FuncState *fs, expdesc *e)
Definition: lcode.cpp:382
LUAI_FUNC int luaK_codeABC(FuncState *fs, OpCode o, int A, int B, int C)
Definition: lcode.cpp:226
Definition: lcode.h:30
LUAI_FUNC int luaK_stringK(FuncState *fs, TString *s)
Definition: lcode.cpp:318
LUAI_FUNC void luaK_storevar(FuncState *fs, expdesc *var, expdesc *e)
Definition: lcode.cpp:557
GLdouble GLdouble t
Definition: glew.h:1366
LUAI_FUNC int luaK_codeABx(FuncState *fs, OpCode o, int A, unsigned int Bx)
Definition: lcode.cpp:235
OpCode
Definition: lopcodes.h:164
Definition: lcode.h:28
LUAI_FUNC int luaK_codek(FuncState *fs, int reg, int k)
Definition: lcode.cpp:249
LUAI_FUNC void luaK_patchtohere(FuncState *fs, int list)
Definition: lcode.cpp:191
LUAI_FUNC void luaK_self(FuncState *fs, expdesc *e, expdesc *key)
Definition: lcode.cpp:584
UnOpr
Definition: lcode.h:35
LUAI_FUNC void luaK_patchclose(FuncState *fs, int list, int level)
Definition: lcode.cpp:178
const GLdouble * v
Definition: glew.h:1359
Definition: lcode.h:28
LUAI_FUNC void luaK_exp2anyregup(FuncState *fs, expdesc *e)
Definition: lcode.cpp:513
LUAI_FUNC void luaK_setreturns(FuncState *fs, expdesc *e, int nresults)
Definition: lcode.cpp:358
LUAI_FUNC void luaK_posfix(FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2, int line)
Definition: lcode.cpp:812
LUAI_FUNC void luaK_ret(FuncState *fs, int first, int nret)
Definition: lcode.cpp:68
LUAI_FUNC int luaK_exp2anyreg(FuncState *fs, expdesc *e)
Definition: lcode.cpp:499
LUAI_FUNC void luaK_indexed(FuncState *fs, expdesc *t, expdesc *k)
Definition: lcode.cpp:702
BinOpr
Definition: lcode.h:25
Definition: lcode.h:26
LUAI_FUNC void luaK_patchlist(FuncState *fs, int list, int target)
Definition: lcode.cpp:168
Definition: lcode.h:35
Definition: lcode.h:26
Definition: lcode.h:26
LUAI_FUNC void luaK_prefix(FuncState *fs, UnOpr op, expdesc *v, int line)
Definition: lcode.cpp:761
LUAI_FUNC void luaK_goiffalse(FuncState *fs, expdesc *e)
Definition: lcode.cpp:644
Definition: lcode.h:30
LUAI_FUNC void luaK_setlist(FuncState *fs, int base, int nelems, int tostore)
Definition: lcode.cpp:866
LUAI_FUNC void luaK_setoneret(FuncState *fs, expdesc *e)
Definition: lcode.cpp:370
Definition: lcode.h:26
Definition: lcode.h:26
LUAI_FUNC int luaK_numberK(FuncState *fs, lua_Number r)
Definition: lcode.cpp:325
GLdouble GLdouble GLdouble r
Definition: glew.h:1374
Definition: lcode.h:35
Definition: lcode.h:29
LUAI_FUNC void luaK_concat(FuncState *fs, int *l1, int l2)
Definition: lcode.cpp:197
GLclampd n
Definition: glew.h:5903
Definition: lcode.h:29
LUAI_FUNC void luaK_nil(FuncState *fs, int from, int n)
Definition: lcode.cpp:36
LUAI_FUNC void luaK_goiftrue(FuncState *fs, expdesc *e)
Definition: lcode.cpp:620
LUAI_FUNC int luaK_getlabel(FuncState *fs)
Definition: lcode.cpp:93
GLint * first
Definition: glew.h:1496
#define e
GLdouble s
Definition: glew.h:1358
LUAI_FUNC void luaK_reserveregs(FuncState *fs, int n)
Definition: lcode.cpp:270
LUA_NUMBER lua_Number
Definition: lua.h:102
GLenum target
Definition: glew.h:5190
LUAI_FUNC int luaK_jump(FuncState *fs)
Definition: lcode.cpp:58