Visitor class abstract
Visitor interface for traversing and processing Smalltalk AST Node hierarchies.
Implements default recursive traversal across all AST nodes. Subclasses
can override specific visit* methods to perform custom analysis or transformations.
For example:
class VariableCollector extends Visitor {
final names = <String>[];
@override
void visitVariableNode(VariableNode node) {
names.add(node.name);
}
}
Constructors
- Visitor()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
visit(
Node node) → void -
Visits
nodeby dispatching to itsacceptmethod. -
visitArrayNode(
ArrayNode node) → void - Visits an ArrayNode and traverses its statements.
-
visitAssignmentNode(
AssignmentNode node) → void - Visits an AssignmentNode and traverses its variable and value expressions.
-
visitBlockNode(
BlockNode node) → void - Visits a BlockNode and traverses its arguments and body.
-
visitCascadeNode(
CascadeNode node) → void - Visits a CascadeNode and traverses its cascaded messages.
-
visitLiteralArrayNode(
LiteralArrayNode node) → void - Visits a LiteralArrayNode and traverses its element values.
-
visitLiteralValueNode(
LiteralValueNode node) → void - Visits a LiteralValueNode.
-
visitMessageNode(
MessageNode node) → void - Visits a MessageNode and traverses its receiver and argument expressions.
-
visitMethodNode(
MethodNode node) → void - Visits a MethodNode and traverses its arguments, pragmas, and body.
-
visitPragmaNode(
PragmaNode node) → void - Visits a PragmaNode and traverses its arguments.
-
visitReturnNode(
ReturnNode node) → void - Visits a ReturnNode and traverses its value expression.
-
visitSequenceNode(
SequenceNode node) → void - Visits a SequenceNode and traverses its temporaries and statements.
-
visitVariableNode(
VariableNode node) → void - Visits a VariableNode.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited