ReturnStatement class

Represents a return statement in Balbismo.

A return statement terminates function execution and optionally returns a value to the caller. The return value expression is evaluated and then a ret instruction is generated in LLVM IR.

Example Balbismo code:

int add(int x, int y) {
  return x + y;  // This is a ReturnStatement
}

void printHello() {
  return;        // This is a ReturnStatement with no value
}

Generates LLVM IR like:

ret i64 %result
Inheritance

Constructors

ReturnStatement.new(Node<dynamic, LangVal<LangType>> value)
Constructs a return statement with an optional return value.

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
value Node<dynamic, LangVal<LangType>>
Gets the return value expression.
no setter

Methods

evaluate(SymbolTable table) → void
Evaluates the return statement by generating a ret instruction.
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