Package org.protelis.lang.interpreter
Interface ProtelisAST<T>
-
- Type Parameters:
T
- return type of this sub-program
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
AbstractPersistedTree
,AbstractProtelisAST
,AlignedMap
,All
,AssignmentOp
,BinaryOp
,ConditionalSideEffect
,Constant
,CreateTuple
,Env
,Eval
,FunctionCall
,GenericHoodCall
,HoodCall
,If
,Invoke
,JvmConstant
,NBRCall
,NumericConstant
,Self
,ShareCall
,TernaryOp
,UnaryOp
,Variable
public interface ProtelisAST<T> extends java.io.Serializable
Data structure representing the field calculus semantics of annotating expressions with their evaluated values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
eval(ExecutionContext context)
Evaluates the program using the passedExecutionContext
.ProtelisAST<?>
getBranch(int i)
java.util.List<ProtelisAST<?>>
getBranches()
Metadata
getMetadata()
java.lang.String
getName()
-
-
-
Method Detail
-
eval
T eval(ExecutionContext context)
Evaluates the program using the passedExecutionContext
.- Parameters:
context
- the execution context- Returns:
- the AST evaluation
-
getBranch
ProtelisAST<?> getBranch(int i)
- Parameters:
i
- the index- Returns:
- the i-th branch of the evaluation tree
-
getBranches
java.util.List<ProtelisAST<?>> getBranches()
- Returns:
- a view of the branches of the tree
-
getMetadata
Metadata getMetadata()
- Returns:
- A
Metadata
object containing information about the code that generated this AST node.
-
getName
java.lang.String getName()
- Returns:
- The name of the operation
-
-