|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.luaj.vm2.luajc.LuaJC
public class LuaJC
Implementation of LoadState.LuaCompiler
which does direct
lua-to-java-bytecode compiling.
This requires the bcel library to be on the class path to work as expected.
If the library is not found, the default LuaC
lua-to-lua-bytecode
compiler will be used.
The compiler should be installed as part of globals initialization, and before any scripts or lua code is executed. A typical example is to install it following the globals creation, as in the following:
LuaValue _G = JsePlatform.standardGlobals();
LuaJC.install();
LoadState.load( new ByteArrayInputStream("print 'hello'".getBytes()), "main.lua", _G ).call();
LoadState.LuaCompiler
,
LuaC
,
JsePlatform
,
JmePlatform
,
BaseLib
,
LuaValue
Constructor Summary | |
---|---|
LuaJC()
|
Method Summary | |
---|---|
java.util.Hashtable |
compileAll(java.io.InputStream script,
java.lang.String chunkname,
java.lang.String filename)
|
static LuaJC |
getInstance()
|
static void |
install()
Install the compiler as the main compiler to use. |
LuaFunction |
load(java.io.InputStream stream,
java.lang.String name,
LuaValue env)
Load into a Closure or LuaFunction from a Stream and initializes the environment |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LuaJC()
Method Detail |
---|
public static LuaJC getInstance()
public static final void install()
public java.util.Hashtable compileAll(java.io.InputStream script, java.lang.String chunkname, java.lang.String filename) throws java.io.IOException
java.io.IOException
public LuaFunction load(java.io.InputStream stream, java.lang.String name, LuaValue env) throws java.io.IOException
LoadState.LuaCompiler
load
in interface LoadState.LuaCompiler
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |