|
Class: RBSequenceNode
Object
|
+--RBProgramNode
|
+--RBSequenceNode
- Package:
- stx:goodies/refactoryBrowser/parser
- Category:
- Refactory-AST-Nodes
- Version:
- rev:
1.40
date: 2023/09/07 21:50:48
- user: stefan
- file: RBSequenceNode.st directory: goodies/refactoryBrowser/parser
- module: stx stc-classLibrary: parser
BRSequenceNode is an AST node that represents a sequence of statements. Both BRBlockNodes and BRMethodNodes contain these.
Instance Variables:
leftBar <Integer | nil> the position of the left | in the temporaries definition
periods <SequenceableCollection of: Integer> the positions of all the periods that separate the statements
rightBar <Integer | nil> the position of the right | in the temporaries definition
statements <SequenceableCollection of: BRStatementNode> the statement nodes
temporaries <SequenceableCollection of: BRVariableNode> the temporaries defined
instance creation
-
leftBar: leftInteger temporaries: variableNodes rightBar: rightInteger
-
-
new
-
return an initialized instance
-
statements: statementNodes
-
-
temporaries: variableNodes statements: statementNodes
-
accessing
-
addNode: aNode
-
-
addReturn
-
-
allDefinedVariables
-
-
allTemporaryVariables
-
-
allVariablesOnScope
-
-
children
-
-
commentsAfterRightBar
-
-
commentsAfterRightBar: something
-
-
leftBar
-
-
periods
-
-
periods: anObject
-
-
removeTemporaryNamed: aName
-
-
rightBar
-
-
start
-
-
statements
-
-
statements: stmtCollection
-
-
stop
-
-
temporaries
-
-
temporaries: tempCollection
-
-
temporaryNames
-
-
temporaryVariables
-
-
whichNodeIsContainedBy: anInterval
-
adding nodes
-
addNode: aNode before: anotherNode
-
-
addNodeFirst: aNode
-
-
addNodes: aCollection
-
-
addNodes: aCollection before: anotherNode
-
-
addNodesFirst: aCollection
-
-
addSelfReturn
-
-
addTemporariesNamed: aCollection
-
-
addTemporaryNamed: aString
-
comparing
-
= anObject
-
Can't send = to the temporaries and statements collection since they might change from arrays to OCs
-
careForTemporariesWhenComaringWith: anObject andMapping: aDictionary
-
after processing statements,
all temporaries here must be mapped to temporaries there;
but not to any other variable.
if so, some value was shadowed in one version but not in the other!
And the code is not equivalent.
Return true if ok, false if not.
-
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)
-
needToCareForTemporariesWhenComparingWith: anObject andMapping: aDictionary
-
if any temporary shadows a mapping,
remove it from aDictionary.
returns the removed associations (for restoring)
or nil, if no special care is
-
semanticallyEqualTo: anObject withMapping: aDictionary
-
return true, if I am semantically 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)
copying-private
-
postCopy
-
enumeration
-
variableNodesDo: aBlock
-
evaluate a Block for all variable nodes
initialization & release
-
initialize
-
(comment from inherited method)
just to ignore initialize to objects which do not need it
-
leftBar: leftInteger temporaries: variableNodes rightBar: rightInteger
-
matching
-
copyInContext: aDictionary
-
-
match: aNode inContext: aDictionary
-
private
-
indexOfNode: aNode
-
Try to find the node by first looking for ==, and then for =
queries
-
bestNodeFor: anInterval
-
-
defines: aName
-
-
directlyUses: aNode
-
-
hasFalseValue
-
-
hasStatements
-
-
hasTrueValue
-
-
isLast: aNode
-
-
lastHasPeriod
-
-
lastIsLoop
-
-
lastIsReturn
-
-
reads: aVariableName
-
-
references: aVariableName
-
-
uses: aNode
-
replacing
-
removeDeadCode
-
-
removeNode: aNode
-
-
replaceNode: aNode withNode: anotherNode
-
-
replaceNode: aNode withNodes: aCollection
-
testing
-
isSequence
-
visitor
-
acceptCommentsBeforeVisitor: aVisitor
-
-
acceptVisitor: aProgramNodeVisitor
-
|