Class to manage loading of {@link Prototype} instances.
The {@link LoadState} class exposes one main function, namely {@link #load(InputStream,String,LuaValue)}, to be used to load code from a particular input stream.
A simple pattern for loading and executing code is
{@code LuaValue _G = JsePlatform.standardGlobals(); LoadState.load( new FileInputStream("main.lua"), "main.lua", _G ).call();}
This should work regardless of which {@link LuaCompiler}has been installed.
Prior to loading code, a compiler should be installed.
By default, when using {@link JsePlatform} or {@JmePlatform}to construct globals, the {@link LuaC} compiler is installed.
To override the default compiler with, say, the {@link LuaJC}lua-to-java bytecode compiler, install it before loading, for example:
{@code LuaValue _G = JsePlatform.standardGlobals(); LuaJC.install(); LoadState.load( new FileInputStream("main.lua"), "main.lua", _G ).call();}
@see LuaCompiler
@see LuaClosure
@see LuaFunction
@see LoadState#compiler
@see LoadState#load(InputStream,String,LuaValue)
@see LuaC
@see LuaJC