UnOp class

Represents a mathematical unary operation in Balbismo.

A unary operation applies a mathematical operator to a single operand. Currently supports unary plus (+) which returns the operand unchanged, and unary minus (-) which negates the operand.

Example Balbismo code:

int x = 5;
int positive = +x;  // '+' is a UnOp (unary plus)
int negative = -x;  // '-' is a UnOp (unary minus)

This generates LLVM IR like:

%unOp.0 = sub i64 0, %x  // For unary minus
Inheritance

Constructors

UnOp.new(String value, Node<dynamic, LangVal<LangType>> child)
Constructs a unary mathematical operation with the operator and operand.

Properties

child Node<dynamic, LangVal<LangType>>
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
nodeValue MathOp
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