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.SerializableData 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 Teval(ExecutionContext context)Evaluates the program using the passedExecutionContext.ProtelisAST<?>getBranch(int i)java.util.List<ProtelisAST<?>>getBranches()MetadatagetMetadata()java.lang.StringgetName()
-
-
-
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
Metadataobject containing information about the code that generated this AST node.
-
getName
java.lang.String getName()
- Returns:
- The name of the operation
-
-