DartBlockExecutor class
A concrete implementation of DartBlockArbiter.
This class keeps track of the console output of the executed DartBlockProgram, as well as the actual execution behavior.
- Inheritance
-
- Object
- DartBlockArbiter
- DartBlockExecutor
Constructors
- DartBlockExecutor(DartBlockProgram program)
Properties
-
consoleOutput
→ List<
String> -
no setter
- environment → DartBlockEnvironment
-
The root environment.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- program → DartBlockProgram
-
The DartBlockProgram which should be executed.
finalinherited
- 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 setterinherited
Methods
-
assignValueToVariable(
String name, DartBlockValue? value) → void -
Used by VariableAssignmentStatement to update an existing (declared) variable's
value.
inherited
-
beginScope(
int key, {dynamic isIsolated = false}) → void -
Begin a new scope for variables, represented by a DartBlockEnvironment object.
inherited
-
copyFrom(
DartBlockExecutor executor) → void - Copy the state of another DartBlockExecutor into this one.
-
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.
inherited
-
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.inherited -
execute(
{Duration duration = const Duration(seconds: 5)}) → Future< void> - Execute the DartBlockProgram.
-
getVariableValue(
String name) → DartBlockValue? -
Retrieve the value assigned to the given variable in the current scope (DartBlockEnvironment), based on its unique name.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
printToConsole(
String message) → void -
Print a message to the console.
override
-
retrieveCustomFunction(
String name) → DartBlockFunction? -
Retrieve a DartBlockFunction based on its unique name.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
verifyDataTypeOfConcreteValue(
DartBlockDataType expectedType, dynamic value) → (bool, Type?) -
Whether a given value's type matches
expectedType
.inherited -
verifyDataTypeOfNeoValue(
DartBlockDataType expectedType, DartBlockValue value) → (bool, Type?) -
Whether a given value's type matches
expectedType
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited