smalltalk library

Smalltalk grammar, strongly typed AST models, and visitor traversal.

For example:

final parser = SmalltalkParserDefinition().build();
final result = parser.parse('example ^ 1 + 2');
print(result.value);

Classes

ArrayNode
An AST node representing a runtime dynamic array expression ({ 1 + 2. 'hello' }).
AssignmentNode
An AST node representing variable assignment (variable := value).
BlockNode
An AST node representing a Smalltalk block closure ([ :arg | arg + 1 ]).
CascadeNode
An AST node representing a message cascade (receiver msg1; msg2).
LiteralArrayNode<T>
An AST node representing a literal array constant (#(1 2 'three') or #[1 2 3]).
LiteralNode<T>
Base class for literal constants in Smalltalk.
LiteralValueNode<T>
An AST node representing an atomic literal value (numbers, strings, booleans, symbols, nil).
MessageNode
An AST node representing a message send to receiver.
MethodNode
An AST node representing a Smalltalk method declaration.
Node
Abstract base class for all Smalltalk Abstract Syntax Tree (AST) nodes.
PragmaNode
An AST node representing a method annotation or compiler pragma (<primitive: 123>).
ReturnNode
An AST node representing a method return statement (^ value).
SequenceNode
An AST node representing a block or method body containing temporaries and statements.
SmalltalkParserDefinition
Smalltalk parser definition producing strongly typed Node AST nodes.
ValueNode
Abstract base class for AST expressions that produce a value.
VariableNode
An AST node representing a variable reference.
Visitor
Visitor interface for traversing and processing Smalltalk AST Node hierarchies.

Enums

SelectorType
The dispatch type of a Smalltalk message selector.

Mixins

HasSelector
Mixin for AST nodes that have a message or method selector.
HasStatements
Mixin for AST nodes that contain a sequence of statements and separator periods.
IsStatement
Marker mixin for AST nodes that can appear as statements.
IsSurrounded
Mixin for AST nodes delimited by enclosing opening and closing tokens.