StringLiteral class

Represents a string literal constant in Balbismo.

A string literal node represents a constant string value in the source code. When evaluated, it adds the string to the LLVM IR as a global constant and returns the LLVM global variable name for use in other operations.

Example Balbismo code:

printf("Hello World\n");  // '"Hello World\n"' is a StringLiteral

This generates LLVM IR like:

@str.0 = private constant [13 x i8] c"Hello World\0A\00"

The string is stored as a null-terminated byte array in LLVM IR.

Inheritance

Constructors

StringLiteral.new(String value)
Constructs a string literal with the string content.

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) String
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