FuncDec class

Represents a function declaration in Balbismo.

A function declaration defines a named function with parameters, a return type, and a body. When evaluated, it generates the complete LLVM function definition including parameter handling, local variables, and the function body.

Example Balbismo code:

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

int main() {
  return add(5, 3);
}

This generates LLVM IR like:

define i64 @add(i64 %x, i64 %y) {
entry:
  %ptr.x.0 = alloca i64
  store i64 %x, ptr %ptr.x.0
  ; ... function body ...
  ret i64 %result
}
Inheritance

Constructors

FuncDec.new(TypeNode returnType, IdentifierNode identifier, ParameterList params, BlockNode block)
Constructs a function declaration with all its components.

Properties

block BlockNode
Gets the function body block.
no setter
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
identifier IdentifierNode
Gets the function name identifier.
no setter
nodeValue → void
The primary value associated with this node (varies by node type).
finalinherited
params List<DeclareNode>
Gets the list of function parameters.
no setter
returnType TypeNode
Gets the function's return type.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

evaluate(SymbolTable table) → void
Evaluates the function declaration by generating the complete LLVM function definition.
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