FloatVal class

Represents a floating-point literal value in Balbismo.

A floating-point value node represents a constant floating-point literal in the source code. When evaluated, it generates LLVM IR to create the floating-point value using an fadd instruction with 0.0 (a common LLVM idiom for creating floating-point constants).

Example Balbismo code:

float x = 3.14;       // '3.14' is a FloatVal node
float y = x + 2.71;   // '2.71' is a FloatVal node

This generates LLVM IR like:

%val0 = fadd double 0.0, 3.14
Inheritance

Constructors

FloatVal.new(String value)
Constructs a floating-point value node by parsing the string representation.

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 → double
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 this AST node and generates corresponding LLVM IR code.
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