MethodNode class
An AST node representing a Smalltalk method declaration.
Contains method arguments, compiler pragmas, and executable body.
For example:
final parser = SmalltalkParserDefinition().build();
final method = parser.parse('factorial ^ self <= 1 ifTrue: [ 1 ] ifFalse: [ self * (self - 1) factorial ]').value;
print(method.selector); // 'factorial'
- Inheritance
- Mixed-in types
Constructors
- MethodNode()
- Creates a method node.
Properties
-
arguments
→ List<
VariableNode> -
The arguments associated with this selector.
final
- body → SequenceNode
-
The method body sequence.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
pragmas
→ List<
PragmaNode> -
Compiler pragmas defined on the method.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selector → String
-
The full selector string combined from selectorToken.
no setterinherited
-
selectorToken
→ List<
Token> -
Tokens comprising the selector name.
finalinherited
- selectorType → SelectorType
-
The dispatch category of this selector.
no setterinherited
Methods
-
accept(
Visitor visitor) → void -
Dispatches execution to
visitorbased on concrete node type.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