Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
VariableNode
Last updated at 11:26 am UTC on 8 March 2017
I am a parse tree leaf representing a variable. Note that my name and key are different for pool variables: the key is the Object Reference.


initialize "VariableNode initialize. Decompiler initialize"
| encoder |
encoder := Encoder new.
StdVariables := Dictionary new: 16.
encoder
fillDict: StdVariables
with: VariableNode
mapping: #('self' 'thisContext' 'super' 'nil' 'false' 'true' )
to: (Array with: LdSelf with: LdThisContext with: LdSuper)
, (Array with: LdNil with: LdFalse with: LdTrue).
StdSelectors := Dictionary new: 64.
encoder
fillDict: StdSelectors
with: SpecialSelectorNode
mapping: ((1 to: Smalltalk specialSelectorSize) collect:
[:i | Smalltalk specialSelectorAt: i])
to: (1 to: Smalltalk specialSelectorSize) asArray.
StdLiterals := PluggableDictionary new equalBlock: [ :x :y | x literalEqual: y ].
encoder
fillDict: StdLiterals
with: LiteralNode
mapping: #(-1 0 1 2 )
to: (LdMinus1 to: LdMinus1 + 3).
encoder initScopeAndLiteralTables.

NodeNil := encoder encodeVariable: 'nil'.
NodeTrue := encoder encodeVariable: 'true'.
NodeFalse := encoder encodeVariable: 'false'.
NodeSelf := encoder encodeVariable: 'self'.
NodeThisContext := encoder encodeVariable: 'thisContext'.
NodeSuper := encoder encodeVariable: 'super'