@Immutable public final class Program extends Object implements Serializable
A ZEL program (function)
This is a Turing machine a Program will always be pretty much an array of operations (instructions).| Modifier and Type | Class and Description |
|---|---|
static class |
Program.ExecutionType |
static class |
Program.HasClass |
static class |
Program.Type |
| Modifier and Type | Method and Description |
|---|---|
static void |
addValue(Map mem,
String name,
Object value)
Load a value into memory Have to go through the VM so that the assignement is acurate
|
static Program |
compile(String zExpr,
String... varNames) |
boolean |
contains(Class<? extends Instruction> instr) |
static String |
dumpCore(String name,
Object mem,
int indent,
int maxIndent)
Output Core, in hierarchical tab indented mode
|
boolean |
equals(Object obj) |
Object |
execute() |
static Object |
execute(ExecutionContext ectx) |
Object |
execute(ExecutorService execService,
Object... args) |
Object |
execute(Object... args) |
Object |
execute(ProcessIO io,
Object... args) |
Object |
execute(VMExecutor execService,
ProcessIO io,
Object... args) |
Pair<Object,ExecutionContext> |
execute(VMExecutor execService,
ProcessIO io,
ResultCache resultCache,
Object... args) |
Object |
executeSingleThreaded(Object... args) |
static Object |
executeSync(ExecutionContext ectx) |
Instruction |
get(int i) |
Instruction[] |
getCode() |
ParsingContext.Location[] |
getDebugInfo() |
Program.ExecutionType |
getExecType() |
Map<String,Integer> |
getGlobalSymbolTable() |
int |
getLocalMemSize() |
Map<String,Integer> |
getLocalSymbolTable() |
String |
getName() |
String |
getSource() |
Program.Type |
getType() |
static Object |
getValue(Map mem,
String name)
get a value of a variable from memory, this function is syntax safe
|
boolean |
hasDeterministicFunctions() |
int |
hashCode() |
<T> T |
itterate(com.google.common.base.Function<Object,T> func) |
static void |
main(String[] args)
*
This allows to run ZEL in an interactive mode
|
int |
size() |
String |
toAssemblyString() |
String |
toString() |
public String getSource()
public String getName()
public int getLocalMemSize()
@CheckReturnValue public boolean equals(Object obj)
@CheckReturnValue public int hashCode()
public boolean hasDeterministicFunctions()
@CheckReturnValue public Instruction get(int i)
i - - inst address.@CheckReturnValue public Instruction[] getCode()
@CheckReturnValue public ParsingContext.Location[] getDebugInfo()
@CheckReturnValue public int size()
public Program.ExecutionType getExecType()
@Nonnull public static Program compile(@Nonnull String zExpr, @Nonnull String... varNames) throws CompileException
CompileExceptionpublic Object execute() throws ExecutionException, InterruptedException
public Object execute(Object... args) throws ExecutionException, InterruptedException
public Object execute(@Nonnull ExecutorService execService, Object... args) throws ExecutionException, InterruptedException
public Object executeSingleThreaded(Object... args) throws ExecutionException, InterruptedException
public Object execute(@Nullable VMExecutor execService, @Nullable ProcessIO io, Object... args) throws ExecutionException, InterruptedException
public Pair<Object,ExecutionContext> execute(@Nullable VMExecutor execService, @Nullable ProcessIO io, ResultCache resultCache, Object... args) throws ExecutionException, InterruptedException
public static Object executeSync(@Nonnull ExecutionContext ectx) throws ExecutionException, InterruptedException
public static Object execute(@Nonnull ExecutionContext ectx) throws ExecutionException, InterruptedException
public Object execute(ProcessIO io, Object... args) throws ExecutionException, InterruptedException
public static Object getValue(@Nonnull Map mem, @Nonnull String name) throws CompileException, InterruptedException, ExecutionException
mem - Mapname - StringExceptionCompileExceptionInterruptedExceptionExecutionExceptionpublic static void addValue(@Nonnull Map mem, @Nonnull String name, Object value) throws CompileException, InterruptedException, ExecutionException
mem - name - Stringvalue - ObjectInterruptedExceptionCompileExceptionExecutionException@CheckReturnValue public static String dumpCore(String name, Object mem, int indent, int maxIndent)
name - mem - indent - maxIndent - public static void main(String[] args) throws IOException, InterruptedException
args - IOExceptionInterruptedExceptionpublic String toAssemblyString()
public Program.Type getType()
public boolean contains(Class<? extends Instruction> instr)
Copyright © 2017. All rights reserved.