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.Object
evaluate(ExecutionContext context)
Evaluates this AST node.Bytecode
getBytecode()
FunctionDefinition
getFunctionDefinition()
java.lang.String
getName()
-
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
- AMetadata
object 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:AbstractProtelisAST
Evaluates this AST node. This method can throw any exception,AbstractProtelisAST
takes care of storing the necessary metadata.- Specified by:
evaluate
in 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:
getName
in interfaceProtelisAST<java.lang.Object>
- Overrides:
getName
in classAbstractProtelisAST<java.lang.Object>
- Returns:
- The name of the operation
-
-