public final class Invoke extends AbstractProtelisAST<java.lang.Object>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APPLY
Special method name, that causes a Protelis function invocation if the
left hand side of the
Invoke is a FunctionDefinition. |
| Constructor and Description |
|---|
Invoke(Metadata metadata,
java.lang.String name,
ProtelisAST<?> target,
java.util.List<ProtelisAST<?>> args) |
Invoke(ProtelisAST<?> target,
java.util.List<ProtelisAST<?>> args)
Builds a new
APPLY. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
evaluate(ExecutionContext context)
Evaluates this AST node.
|
Bytecode |
getBytecode() |
ProtelisAST<?> |
getLeftExpression() |
java.lang.String |
getName() |
protected boolean |
isNullable() |
java.lang.String |
toString() |
branchesToString, branchesToString, eval, forEach, forEachWithIndex, getBranch, getBranches, getBranchesNumber, getMetadata, stringForpublic static final java.lang.String APPLY
Invoke is a FunctionDefinition.public Invoke(Metadata metadata, java.lang.String name, ProtelisAST<?> target, java.util.List<ProtelisAST<?>> args)
metadata - A Metadata object containing information about the code that generated this AST node.name - function (or method) nametarget - Protelis sub-program that annotates itself with the target of
this callargs - arguments of the functionpublic Invoke(ProtelisAST<?> target, java.util.List<ProtelisAST<?>> args)
APPLY.target - the target of the invocation, must evaluate to either a FunctionDefinition
or a @JVMEntity of type Method.args - the argumentspublic java.lang.Object evaluate(ExecutionContext context)
AbstractProtelisASTAbstractProtelisAST takes care of storing the necessary metadata.evaluate in class AbstractProtelisAST<java.lang.Object>context - the execution contextpublic ProtelisAST<?> getLeftExpression()
ProtelisAST representing the invocation receiverpublic java.lang.String getName()
getName in interface ProtelisAST<java.lang.Object>getName in class AbstractProtelisAST<java.lang.Object>public java.lang.String toString()
toString in class AbstractProtelisAST<java.lang.Object>protected boolean isNullable()
isNullable in class AbstractProtelisAST<java.lang.Object>