IdentifierNode class
Represents a variable identifier reference in Balbismo.
An identifier node represents a reference to a variable by name. When evaluated, it looks up the variable in the symbol table and generates the appropriate LLVM IR to load the variable's value.
For regular variables, this generates a load
instruction to get the value
from memory. For arrays, it returns the array pointer directly since arrays
are accessed via indexing operations.
Example Balbismo code:
int x = 5;
printf("%d", x); // 'x' is an IdentifierNode
This generates LLVM IR like:
%var0 = load i64, ptr %ptr.x.0
Constructors
- IdentifierNode.new(String value)
- Constructs an identifier node with the variable name.
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 → String
-
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) → LangVal< LangType> -
Evaluates the identifier by looking up and loading the variable's value.
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