DartBlockArbiter class abstract
The executor for DartBlock programs.Serves for executing and keeping track of the execution of a NeoTechCore.
The DartBlockArbiter runs a given DartBlock program, keeps track of its DartBlockEnvironment and any potentially thrown DartBlockException.
The output of the executed program is not tracked by this abstract class. A concrete implementation has to implement the printToConsole()
function, which is used by DartBlock PrintStatements.
A concrete implementation for this class is provided via DartBlockExecutor.
- Implementers
Constructors
- DartBlockArbiter(DartBlockProgram program)
Properties
- environment → DartBlockEnvironment
-
The root environment.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- program → DartBlockProgram
-
The DartBlockProgram which should be executed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- thrownException → DartBlockException?
-
Get the DartBlockException thrown during the last execution of the DartBlockProgram.
no setter
Methods
-
assignValueToVariable(
String name, DartBlockValue? value) → void - Used by VariableAssignmentStatement to update an existing (declared) variable's value.
-
beginScope(
int key, {dynamic isIsolated = false}) → void - Begin a new scope for variables, represented by a DartBlockEnvironment object.
-
declareVariable(
DartBlockDataType dataType, String name, DartBlockValue? value) → void - Used by VariableDeclarationStatement to declare a new variable with an optional initial value, i.e., its initial value can be null.
-
endScope(
int key) → void -
End the current scope (DartBlockEnvironment) and return to the previous ('higher-up' or parent) scope.
This is done by retrieving and removing the last element in the
_blockHistory
list. -
getVariableValue(
String name) → DartBlockValue? - Retrieve the value assigned to the given variable in the current scope (DartBlockEnvironment), based on its unique name.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
printToConsole(
String message) → void - Print a message to the console.
-
retrieveCustomFunction(
String name) → DartBlockFunction? - Retrieve a DartBlockFunction based on its unique name.
-
toString(
) → String -
A string representation of this object.
inherited
-
verifyDataTypeOfConcreteValue(
DartBlockDataType expectedType, dynamic value) → (bool, Type?) -
Whether a given value's type matches
expectedType
. -
verifyDataTypeOfNeoValue(
DartBlockDataType expectedType, DartBlockValue value) → (bool, Type?) -
Whether a given value's type matches
expectedType
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited