BinOp class

Represents a mathematical binary operation in Balbismo.

A binary operation applies a mathematical operator to two operands. Supports all basic arithmetic operations: addition, subtraction, multiplication, division, and modulo. The operation handles type promotion automatically when mixing int and float operands.

Example Balbismo code:

int a = 10;
int b = 3;
int result = a + b * 2 - b / 2 % 3;  // Multiple BinOp nodes

This generates LLVM IR like:

%binOp.0 = add i64 %a, %b
%binOp.1 = mul i64 %binOp.0, 2
; ... etc for other operations
Inheritance

Constructors

BinOp.new(String value, Node left, Node right)
Constructs a binary mathematical operation with the operator and operands.

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
left → Node<dynamic, LangVal<LangType>>
no setter
nodeValue → MathOp
The primary value associated with this node (varies by node type).
finalinherited
no setter
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