|
Class: RBMessageNode
Object
|
+--RBProgramNode
|
+--RBStatementNode
|
+--RBValueNode
|
+--RBMessageNode
|
+--RBMetaMessageNode
|
+--RBPatternMessageNode
|
+--RBSyntheticMessageNode
- Package:
- stx:goodies/refactoryBrowser/parser
- Category:
- Refactory-AST-Nodes
- Version:
- rev:
1.60
date: 2023/09/07 21:49:21
- user: stefan
- file: RBMessageNode.st directory: goodies/refactoryBrowser/parser
- module: stx stc-classLibrary: parser
BRMessageNode is an AST node that represents a message send.
Instance Variables:
arguments <SequenceableCollection of: BRValueNode> our argument nodes
receiver <BRValueNode> the receiver's node
selector <Symbol | nil> the selector we're sending (cached)
selectorParts <SequenceableCollection of: BRValueToken> the tokens for each keyword
instance creation
-
receiver: aValueNode selector: aSymbol
-
-
receiver: aValueNode selector: aSymbol arguments: valueNodes
-
-
receiver: aValueNode selectorParts: keywordTokens arguments: valueNodes
-
accessing
-
allMessageNodes
-
-
arg1
-
-
arg1: aNode
-
-
arg2
-
-
arg3
-
-
arg: n
-
-
argumentCount
-
-
arguments
-
-
arguments: argCollection
-
-
children
-
-
leftMostReceiver
-
-
precedence
-
-
receiver
-
-
receiver: aValueNode
-
-
selector
-
notice: the selector is no longer always made a symbol,
and the selector instVar is lazy.
This was done to allow parsing huge amounts of code without automatically
creating symbols
-
selector: aSelector
-
self assert:(selector isNil or:[selector partsIfSelector asArray = keywords]).
-
selectorString
-
-
sentMessages
-
warning: returns a string collection because we avoid creating symbols when parsing
-
startWithoutParentheses
-
-
stopWithoutParentheses
-
comparing
-
= anObject
-
(comment from inherited method)
return true if the receiver and the arg have the same structure.
Notice:
This method is partially open coded (inlined) by the compiler(s)
identical objects are always considered equal.
redefining it may not work as expected.
-
equalTo: anObject withMapping: aDictionary
-
return true, if I am equal to another node, with a given variable name mapping.
Side effect: update the mapping dictionary as required to reflect a matching mapping (if possible)
-
equalTo: anObject withSelectorMapping: aDictionary
-
return true, if I am equal to another node, with a given selector name mapping.
Side effect: update the mapping dictionary as required to reflect a matching mapping (if possible)
-
hash
-
(comment from inherited method)
return an Integer useful as a hash key for the receiver.
This hash should return same values for objects with same
contents (i.e. use this to hash on structure)
-
semanticallyEqualTo: aNode withMapping: aDictionary
-
return true, if I am semantically equal to another node, with a given variable name mapping.
Semantical equalTo: is defined slightly less strict, than equalTo:.
Both check the parsetree, ignoring formatting and comments.
However, in some situations, semanticallyEqualTo: detects the same intention,
(which is mostly heuristic and builtin knowledge).
For example:
foo isNil ifTrue:e1 ifFalse:e2
is semantcallyEqualTo:
foo notNil ifTrue:e2 ifFalse:e1
and also to:
foo isNil ifFalse:e2 ifTrue:e1
The fallback implemented here is to ask for the regular equality.
Side effect: update the mapping dictionary as required to reflect a matching mapping (if possible)
-
semanticallyEqualToNegated: expr2 withMapping: mappingDict
-
return true,
copying-private
-
postCopy
-
enumeration
-
allMessageNodesDo: aBlock
-
-
allNonPatternMessageNodesDo: aBlock
-
-
variableNodesDo: aBlock
-
evaluate a Block for all variable nodes
initialization & release
-
receiver: aValueNode selectorParts: keywordTokens arguments: valueNodes
-
libtool3 support
-
highlightInCodeView: aCodeView
-
-
leftClickMenuInCodeView: aCodeView
-
-
middleClickMenuInCodeView: aCodeView
-
-
rightClickMenuInCodeView: aCodeView
-
matching
-
copyInContext: aDictionary
-
-
match: aNode inContext: aDictionary
-
Modified (format): / 19-11-2016 / 16:01:23 / cg
private
-
buildSelector
-
concatenate the selector parts, and intern as a symbol
-
buildSelectorString
-
concatenate the selector parts, but do not intern
-
selectorParts
-
-
selectorParts: tokenCollection
-
querying
-
bestNodeFor: anInterval
-
-
firstLineNumber
-
-
isReferringToAnExceptionInContext: aSearchDictionary
-
true iff:
(node contains a ref to a global variable or node is a class variable)
and the variable refers to an Exception class (but not a Notification)
-
lastLineNumber
-
^ lineNumber.
replacing
-
replaceNode: aNode withNode: anotherNode
-
If we're inside a cascade node and are changing the receiver, change all the receiver's
testing
-
isBinary
-
-
isCascaded
-
-
isFirstCascaded
-
-
isKeyword
-
-
isKeywordMessage
-
-
isLoop
-
-
isMessage
-
-
isMessageWithSelector: aStringOrSymbol
-
-
isUnary
-
-
lastIsReturn
-
-
testLoop1
-
self assert:( (RBMessageNode compiledMethodAt:#testLoop1) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop2) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop3) parseTree lastIsLoop )
-
testLoop2
-
self assert:( (RBMessageNode compiledMethodAt:#testLoop1) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop2) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop3) parseTree lastIsLoop )
-
testLoop3
-
self assert:( (RBMessageNode compiledMethodAt:#testLoop1) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop2) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop3) parseTree lastIsLoop )
visitor
-
acceptVisitor: aProgramNodeVisitor
-
|