eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RBSequenceNode':

Home

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

Class: RBSequenceNode


Inheritance:

   Object
   |
   +--RBProgramNode
      |
      +--RBSequenceNode

Package:
stx:goodies/refactoryBrowser/parser
Category:
Refactory-AST-Nodes
Version:
rev: 1.36 date: 2018/05/24 19:01:10
user: cg
file: RBSequenceNode.st directory: goodies/refactoryBrowser/parser
module: stx stc-classLibrary: parser

Description:


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


Class protocol:

instance creation
o  leftBar: leftInteger temporaries: variableNodes rightBar: rightInteger

o  new
return an initialized instance

o  statements: statementNodes

o  temporaries: variableNodes statements: statementNodes


Instance protocol:

accessing
o  addNode: aNode

o  addReturn

o  allDefinedVariables

o  allTemporaryVariables

o  allVariablesOnScope

o  children

o  commentsAfterRightBar

o  commentsAfterRightBar: something

o  leftBar

o  periods

o  periods: anObject

o  removeTemporaryNamed: aName

o  rightBar

o  start

o  statements

o  statements: stmtCollection

o  stop

o  temporaries

o  temporaries: tempCollection

o  temporaryNames

o  temporaryVariables

o  whichNodeIsContainedBy: anInterval

adding nodes
o  addNode: aNode before: anotherNode

o  addNodeFirst: aNode

o  addNodes: aCollection

o  addNodes: aCollection before: anotherNode

o  addNodesFirst: aCollection

o  addSelfReturn

o  addTemporariesNamed: aCollection

o  addTemporaryNamed: aString

comparing
o  = anObject
Can't send = to the temporaries and statements collection since they might change from arrays to OCs

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

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

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

enumeration
o  variableNodesDo: aBlock
evaluate a Block for all variable nodes

initialization & release
o  initialize
(comment from inherited method)
just to ignore initialize to objects which do not need it

o  leftBar: leftInteger temporaries: variableNodes rightBar: rightInteger

matching
o  copyInContext: aDictionary

o  match: aNode inContext: aDictionary

private
o  indexOfNode: aNode
Try to find the node by first looking for ==, and then for =

queries
o  bestNodeFor: anInterval

o  defines: aName

o  directlyUses: aNode

o  hasFalseValue

o  hasStatements

o  hasTrueValue

o  isLast: aNode

o  lastHasPeriod

o  lastIsLoop

o  lastIsReturn

o  reads: aVariableName

o  references: aVariableName

o  uses: aNode

replacing
o  removeDeadCode

o  removeNode: aNode

o  replaceNode: aNode withNode: anotherNode

o  replaceNode: aNode withNodes: aCollection

testing
o  isSequence

visitor
o  acceptCommentsBeforeVisitor: aVisitor

o  acceptVisitor: aProgramNodeVisitor



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Sat, 17 Nov 2018 09:31:07 GMT