eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RBVariableNode':

Home

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

Class: RBVariableNode


Inheritance:

   Object
   |
   +--RBProgramNode
      |
      +--RBStatementNode
         |
         +--RBValueNode
            |
            +--RBVariableNode
               |
               +--RBMetaVariableNode
               |
               +--RBPatternVariableNode
               |
               +--RBSyntheticVariableNode

Package:
stx:goodies/refactoryBrowser/parser
Category:
Refactory-AST-Nodes
Version:
rev: 1.41 date: 2023/09/10 09:14:52
user: cg
file: RBVariableNode.st directory: goodies/refactoryBrowser/parser
module: stx stc-classLibrary: parser

Description:


BRVariableNode is an AST node that represent a variable (global, inst var, temp, etc.).

Instance Variables:
	token	<BRValueToken>	the token that contains our name and position


Class protocol:

instance creation
o  identifierToken: anIdentifierToken

o  named: aString


Instance protocol:

accessing
o  addReferencedVariablesTo: aCollection

o  definingScope
Return the sequenceNode, blockNode or MethodNode (i.e. the scope)
that defines this variable or argument.
Return nil, if none does

o  definingSequence
Return the sequenceNode (i.e. the scope) that defines this variable
or nil, if no sequenceNode does.
WARNING: this seems to be misused (or misdefined), in that it will only
look for sequenceNode scopes (i.e. temporary variables),
NOT for arguments.
Use definingScope to get to those as well.
(I am not sure, if this should be fixed here,
or not, to prevent breaking existing code.
Therefore this remains as is)

o  lineNumber
(comment from inherited method)
lineNumber isNil ifTrue:[

o  name

o  precedence

o  startWithoutParentheses

o  stopWithoutParentheses

o  token

o  tokenPosition

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)

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

initialization & release
o  identifierToken: anIdentifierToken

libtool3 support
o  highlightInCodeView: aCodeView

o  leftClickMenuInCodeView: aCodeView

o  rightClickMenuInCodeView: aCodeView

matching
o  copyInContext: aDictionary

queries
o  isReferringToAnExceptionInContext: aSearchDictionary
true iff:
(node is a global variable or node is a class variable)
and the variable refers to an Exception class (but not a Notification)

testing
o  isClassVariableInContext: aSearchDictionary

o  isGlobal
Return true if the variable node is for
a non-local (not really global), false otherwise.
Actually wrong: also returns true for inst- and class variables
(i.e. anything that is not a block- or method local)

o  isImmediate

o  isInstanceVariable
not true - also returns true for class vars and globals

o  isLocal
Return true if the variable node is for
a local variable, false otherwise.
Returns true for anything that is a block- or method local

o  isRead
Return true, if the variable is read

o  isSelf
true if I am the self-variable node

o  isSuper

o  isTemporary
Return true if the variable node is for
a temporary variable, false otherwise

o  isVariable

o  isVariableNotInLeftHandSideOfAssignment
Returns true iff receiver is a variable node but not
in left-hand side of assignment

o  isWrite
Same as isWritten - bad naming here

o  isWritten
Return true, if the variable is written

o  reads: variableName

o  references: aVariableName

visitor
o  acceptVisitor: aProgramNodeVisitor



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