Class FunctionCall
- java.lang.Object
-
- org.protelis.lang.interpreter.impl.AbstractProtelisAST<java.lang.Object>
-
- org.protelis.lang.interpreter.impl.FunctionCall
-
- All Implemented Interfaces:
java.io.Serializable,ProtelisAST<java.lang.Object>,WithBytecode
public final class FunctionCall extends AbstractProtelisAST<java.lang.Object>
Call a Protelis function.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FunctionCall(Metadata metadata, FunctionDefinition functionDefinition, java.util.List<ProtelisAST<?>> args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectevaluate(ExecutionContext context)Evaluates this AST node.BytecodegetBytecode()FunctionDefinitiongetFunctionDefinition()java.lang.StringgetName()-
Methods inherited from class org.protelis.lang.interpreter.impl.AbstractProtelisAST
branchesToString, branchesToString, eval, forEach, forEachWithIndex, getBranch, getBranches, getBranchesNumber, getMetadata, isNullable, stringFor, toString
-
-
-
-
Constructor Detail
-
FunctionCall
public FunctionCall(Metadata metadata, FunctionDefinition functionDefinition, java.util.List<ProtelisAST<?>> args)
- Parameters:
metadata- AMetadataobject containing information about the code that generated this AST node.functionDefinition- the definition of the functionargs- the arguments. Must be in the same number of theFunctionDefinition's expected arguments
-
-
Method Detail
-
evaluate
public java.lang.Object evaluate(ExecutionContext context)
Description copied from class:AbstractProtelisASTEvaluates this AST node. This method can throw any exception,AbstractProtelisASTtakes care of storing the necessary metadata.- Specified by:
evaluatein classAbstractProtelisAST<java.lang.Object>- Parameters:
context- the execution context- Returns:
- the result of the evaluation
-
getFunctionDefinition
public FunctionDefinition getFunctionDefinition()
- Returns:
- the
FunctionDefinition
-
getName
public java.lang.String getName()
Description copied from class:AbstractProtelisAST- Specified by:
getNamein interfaceProtelisAST<java.lang.Object>- Overrides:
getNamein classAbstractProtelisAST<java.lang.Object>- Returns:
- The name of the operation
-
-