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

Package:
stx:goodies/refactoryBrowser/parser
Category:
Refactory-AST-Nodes
Version:
rev: 1.52 date: 2019/05/27 13:11:51
user: cg
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

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

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  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.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sat, 27 Apr 2024 01:30:42 GMT