eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RBMessageNode':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: RBMessageNode


Inheritance:

   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

Description:


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


Class protocol:

instance creation
o  receiver: aValueNode selector: aSymbol

o  receiver: aValueNode selector: aSymbol arguments: valueNodes

o  receiver: aValueNode selectorParts: keywordTokens arguments: valueNodes


Instance protocol:

accessing
o  allMessageNodes

o  arg1

o  arg1: aNode

o  arg2

o  arg3

o  arg: n

o  argumentCount

o  arguments

o  arguments: argCollection

o  children

o  leftMostReceiver

o  precedence

o  receiver

o  receiver: aValueNode

o  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

o  selector: aSelector
self assert:(selector isNil or:[selector partsIfSelector asArray = keywords]).

o  selectorString

o  sentMessages
warning: returns a string collection because we avoid creating symbols when parsing

o  startWithoutParentheses

o  stopWithoutParentheses

comparing
o  = 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.

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

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

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

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

o  semanticallyEqualToNegated: expr2 withMapping: mappingDict
return true,

copying-private
o  postCopy

enumeration
o  allMessageNodesDo: aBlock

o  allNonPatternMessageNodesDo: aBlock

o  variableNodesDo: aBlock
evaluate a Block for all variable nodes

initialization & release
o  receiver: aValueNode selectorParts: keywordTokens arguments: valueNodes

libtool3 support
o  highlightInCodeView: aCodeView

o  leftClickMenuInCodeView: aCodeView

o  middleClickMenuInCodeView: aCodeView

o  rightClickMenuInCodeView: aCodeView

matching
o  copyInContext: aDictionary

o  match: aNode inContext: aDictionary
Modified (format): / 19-11-2016 / 16:01:23 / cg

private
o  buildSelector
concatenate the selector parts, and intern as a symbol

o  buildSelectorString
concatenate the selector parts, but do not intern

o  selectorParts

o  selectorParts: tokenCollection

querying
o  bestNodeFor: anInterval

o  firstLineNumber

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

o  lastLineNumber
^ lineNumber.

replacing
o  replaceNode: aNode withNode: anotherNode
If we're inside a cascade node and are changing the receiver, change all the receiver's

testing
o  isBinary

o  isCascaded

o  isFirstCascaded

o  isKeyword

o  isKeywordMessage

o  isLoop

o  isMessage

o  isMessageWithSelector: aStringOrSymbol

o  isUnary

o  lastIsReturn

o  testLoop1
self assert:( (RBMessageNode compiledMethodAt:#testLoop1) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop2) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop3) parseTree lastIsLoop )

o  testLoop2
self assert:( (RBMessageNode compiledMethodAt:#testLoop1) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop2) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop3) parseTree lastIsLoop )

o  testLoop3
self assert:( (RBMessageNode compiledMethodAt:#testLoop1) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop2) parseTree lastIsLoop )
self assert:( (RBMessageNode compiledMethodAt:#testLoop3) parseTree lastIsLoop )

visitor
o  acceptVisitor: aProgramNodeVisitor



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 10:30:14 GMT