|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.luaj.vm2.Lua
org.luaj.vm2.compiler.LuaC
public class LuaC
Compiler for Lua
| Field Summary | |
|---|---|
static int |
MAXSTACK
|
int |
nCcalls
|
| Fields inherited from class org.luaj.vm2.Lua |
|---|
_VERSION, BITRK, LFIELDS_PER_FLUSH, LUA_MULTRET, luaP_opmodes, MASK_A, MASK_B, MASK_Bx, MASK_C, MASK_NOT_A, MASK_NOT_B, MASK_NOT_Bx, MASK_NOT_C, MASK_NOT_OP, MASK_OP, MAX_OP, MAXARG_A, MAXARG_B, MAXARG_Bx, MAXARG_C, MAXARG_sBx, MAXINDEXRK, NUM_OPCODES, OP_ADD, OP_CALL, OP_CLOSE, OP_CLOSURE, OP_CONCAT, OP_DIV, OP_EQ, OP_FORLOOP, OP_FORPREP, OP_GETGLOBAL, OP_GETTABLE, OP_GETUPVAL, OP_JMP, OP_LE, OP_LEN, OP_LOADBOOL, OP_LOADK, OP_LOADNIL, OP_LT, OP_MOD, OP_MOVE, OP_MUL, OP_NEWTABLE, OP_NOT, OP_POW, OP_RETURN, OP_SELF, OP_SETGLOBAL, OP_SETLIST, OP_SETTABLE, OP_SETUPVAL, OP_SUB, OP_TAILCALL, OP_TEST, OP_TESTSET, OP_TFORLOOP, OP_UNM, OP_VARARG, POS_A, POS_B, POS_Bx, POS_C, POS_OP, SIZE_A, SIZE_B, SIZE_Bx, SIZE_C, SIZE_OP, VARARG_HASARG, VARARG_ISVARARG, VARARG_NEEDSARG |
| Constructor Summary | |
|---|---|
LuaC()
|
|
| Method Summary | |
|---|---|
protected static void |
_assert(boolean b)
|
static Prototype |
compile(java.io.InputStream is,
java.lang.String name)
Utility method to invoke the compiler for an input stream |
Prototype |
compile(int firstByte,
java.io.InputStream stream,
java.lang.String name)
Compile source bytes into a LPrototype. |
static void |
install()
Install the compiler so that LoadState will first try to use it when handed bytes that are not already a compiled lua chunk. |
static LuaFunction |
load(java.io.InputStream is,
java.lang.String name,
LuaValue env)
Load into a Closure or LuaFunction, with the supplied initial environment |
LuaFunction |
load(int firstByte,
java.io.InputStream stream,
java.lang.String name,
LuaValue env)
Load into a Closure or LuaFunction, with the supplied initial environment |
LuaFunction |
load(Prototype p,
java.lang.String filename,
LuaValue env)
Load into a LuaFunction given a prototype. |
LuaString |
newTString(byte[] bytes,
int offset,
int len)
|
java.lang.String |
pushfstring(java.lang.String string)
|
| Methods inherited from class org.luaj.vm2.Lua |
|---|
GET_OPCODE, GETARG_A, GETARG_B, GETARG_Bx, GETARG_C, GETARG_sBx, getBMode, getCMode, getOpMode, INDEXK, ISK, RKASK, testAMode, testTMode |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAXSTACK
public int nCcalls
| Constructor Detail |
|---|
public LuaC()
| Method Detail |
|---|
public static void install()
protected static void _assert(boolean b)
public static Prototype compile(java.io.InputStream is,
java.lang.String name)
throws java.io.IOException
java.io.IOException
public static LuaFunction load(java.io.InputStream is,
java.lang.String name,
LuaValue env)
throws java.io.IOException
java.io.IOException
public LuaFunction load(int firstByte,
java.io.InputStream stream,
java.lang.String name,
LuaValue env)
throws java.io.IOException
load in interface LoadState.LuaCompilerjava.io.IOException
public Prototype compile(int firstByte,
java.io.InputStream stream,
java.lang.String name)
throws java.io.IOException
compile in interface LoadState.LuaCompilerfirstByte - the first byte from the InputStream.
This can be read by the client and tested to see if it is already a binary chunk.stream - InputStream to read from.name - Name of the chunk
java.io.IOException - if an I/O exception occurs
LuaError - if there is a syntax error.
public LuaString newTString(byte[] bytes,
int offset,
int len)
public java.lang.String pushfstring(java.lang.String string)
public LuaFunction load(Prototype p,
java.lang.String filename,
LuaValue env)
LoadState.LuaCompiler
load in interface LoadState.LuaCompilerfilename - TODO
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||