BlockNode class
Represents a block of statements in Balbismo.
A block node contains a sequence of statements or expressions that are executed in order. Blocks create a new scope for variable declarations, allowing local variables that are only accessible within the block.
In LLVM IR, blocks are translated to a sequence of instructions within the current function or scope. Each child node generates its own IR instructions in the order they appear.
Example Balbismo code:
{
int x = 5;
printf("Value: %d", x);
}
This creates a new scope where x
is only accessible within the braces.
Constructors
-
BlockNode.new(List<
Node> children) - Constructs a block node with the given child statements.
Properties
-
children
→ List<
Node> -
Child nodes that form the structure of this node.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ int
-
Unique identifier for this node, used for LLVM register naming.
getter/setter pairinherited
- nodeValue → void
-
The primary value associated with this node (varies by node type).
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
evaluate(
SymbolTable table) → void -
Evaluates all child nodes in order within a new scope.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited