compiler/TConstantBinding.st
changeset 3 97ee341d3e9f
child 4 3d80069ea3e2
equal deleted inserted replaced
2:2a3e47c13905 3:97ee341d3e9f
       
     1 "{ Package: 'jv:tea/compiler' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
       
     4 
       
     5 TValueBinding subclass:#TConstantBinding
       
     6 	instanceVariableNames:'value'
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'Languages-Tea-Compiler-Bindings'
       
    10 !
       
    11 
       
    12 !TConstantBinding class methodsFor:'instance creation'!
       
    13 
       
    14 value: anObject
       
    15     ^ self new initializeWithValue: anObject
       
    16 
       
    17     "Created: / 25-08-2015 / 23:14:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    18 ! !
       
    19 
       
    20 !TConstantBinding methodsFor:'accessing'!
       
    21 
       
    22 value
       
    23     ^ value
       
    24 ! !
       
    25 
       
    26 !TConstantBinding methodsFor:'initialization'!
       
    27 
       
    28 initializeWithValue: anObject
       
    29     value := anObject.
       
    30     value class == SmallInteger ifTrue:[ 
       
    31         type := TSimpleType named: 'TSmallInteger'.
       
    32         ^ self.
       
    33     ].
       
    34     self error: 'Unsupported constant'
       
    35 
       
    36     "Created: / 25-08-2015 / 23:15:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    37 ! !
       
    38