|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.vm.Engine
public class Engine
This class represents a MillScript engine.
| Constructor Summary | |
|---|---|
Engine(Configuration conf)
Constructs a new engine with a default package. |
|
| Method Summary | |
|---|---|
void |
addInventory(org.millscript.commons.vfs.VFolder f)
Adds the specified location as an inventory. |
void |
addLoader(java.lang.String extension,
Loader loader)
Adds the specified loader for the specified file extension. |
void |
addPackage(Package p)
Adds the specified package to this engine. |
void |
callBinary0(Function f,
java.lang.Object x,
java.lang.Object y)
Calls the specified function with the two specified arguments, returning no results. |
java.lang.Object |
callBinary1(Function f,
java.lang.Object x,
java.lang.Object y)
Calls the specified function with the two specified arguments, returning a single result. |
void |
callNullary0(Function f)
Calls the specified function with no arguments, returning no results. |
java.lang.Object |
callNullary1(Function f)
Calls the specified function with no arguments, returning a single result. |
void |
callTrinary0(Function f,
java.lang.Object x,
java.lang.Object y,
java.lang.Object z)
Calls the specified function with the three specified arguments, returning no results. |
java.lang.Object |
callTrinary1(Function f,
java.lang.Object x,
java.lang.Object y,
java.lang.Object z)
Calls the specified function with the three specified arguments, returning a single result. |
void |
callUnary0(Function f,
java.lang.Object x)
Calls the specified function with the single specified argument, returning no results. |
java.lang.Object |
callUnary1(Function f,
java.lang.Object x)
Calls the specified function with the single specified argument, returning a single result. |
Package |
fetchPackage(java.lang.String fqn)
Returns the requested package, loading it from an inventory if it hasn't been already. |
Configuration |
getConfig()
Returns this engines configuration. |
Machine |
getMachine()
Returns this engines machine, to execute code on. |
Package |
getPackage(java.lang.String fqn)
Gets the requested package. |
FunctionCall |
newFunctionCall()
Returns a new function call object for this engine. |
FunctionCall |
newFunctionCall(Function f)
Returns a new function call object, to invoke the specified functoin on this engine. |
FunctionCall |
newFunctionCall(Package p,
java.lang.String sym)
Returns a new function call object, to invoke the specified functoin on this engine. |
Package |
newPackage(java.lang.String fqn)
Returns a package for the specified fully qualified name and nick-name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Engine(Configuration conf)
conf - the configuration for this engine| Method Detail |
|---|
public void addInventory(org.millscript.commons.vfs.VFolder f)
f - the location of an inventory for this engine.
public void addLoader(java.lang.String extension,
Loader loader)
extension - the file extension this loader handles.loader - the loader for the specified file extension.public void addPackage(Package p)
p - the package to add to this engine.
public void callBinary0(Function f,
java.lang.Object x,
java.lang.Object y)
f - the function to callx - the functions first argumenty - the functions second argument
public java.lang.Object callBinary1(Function f,
java.lang.Object x,
java.lang.Object y)
f - the function to callx - the functions first argumenty - the functions second argument
public void callNullary0(Function f)
f - the function to callpublic java.lang.Object callNullary1(Function f)
f - the function to call
public void callTrinary0(Function f,
java.lang.Object x,
java.lang.Object y,
java.lang.Object z)
f - the function to callx - the functions first argumenty - the functions second argumentz - the functions third argument
public java.lang.Object callTrinary1(Function f,
java.lang.Object x,
java.lang.Object y,
java.lang.Object z)
f - the function to callx - the functions first argumenty - the functions second argumentz - the functions third argument
public void callUnary0(Function f,
java.lang.Object x)
f - the function to callx - the functions single argument
public java.lang.Object callUnary1(Function f,
java.lang.Object x)
f - the function to callx - the functions single argument
public Package fetchPackage(java.lang.String fqn)
fqn - the fully qualified name of the package to fetch
public Configuration getConfig()
public Machine getMachine()
public Package getPackage(java.lang.String fqn)
fqn - the fully qualified name for the package.
public FunctionCall newFunctionCall()
FunctionCall object for this engine.public FunctionCall newFunctionCall(Function f)
f - the function we want to invoke.
FunctionCall object to invoke the specified
function on this machine.
public FunctionCall newFunctionCall(Package p,
java.lang.String sym)
p - the package which contains the function.sym - the symbol of the function to invoke.
FunctionCall object to invoke the specified
function on this machine.public Package newPackage(java.lang.String fqn)
fqn - the fully qualified name for the new package.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||