compiler/TSimpleType.st
changeset 3 97ee341d3e9f
parent 2 2a3e47c13905
child 4 3d80069ea3e2
equal deleted inserted replaced
2:2a3e47c13905 3:97ee341d3e9f
     6 	instanceVariableNames:'name'
     6 	instanceVariableNames:'name'
     7 	classVariableNames:''
     7 	classVariableNames:''
     8 	poolDictionaries:''
     8 	poolDictionaries:''
     9 	category:'Languages-Tea-Compiler-Types'
     9 	category:'Languages-Tea-Compiler-Types'
    10 !
    10 !
    11 
       
    12 
    11 
    13 !TSimpleType class methodsFor:'instance creation'!
    12 !TSimpleType class methodsFor:'instance creation'!
    14 
    13 
    15 named: aString
    14 named: aString
    16     ^ self new initializeWithName: aString
    15     ^ self new initializeWithName: aString
    22 
    21 
    23 name
    22 name
    24     ^ name
    23     ^ name
    25 ! !
    24 ! !
    26 
    25 
       
    26 !TSimpleType methodsFor:'comparing'!
       
    27 
       
    28 = anotherType
       
    29     ^ self class = anotherType class and:[ self name = anotherType name ]
       
    30 
       
    31     "Created: / 25-08-2015 / 23:36:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    32 !
       
    33 
       
    34 hash
       
    35     ^ name hash
       
    36 
       
    37     "Created: / 25-08-2015 / 23:34:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    38 ! !
       
    39 
    27 !TSimpleType methodsFor:'initialization'!
    40 !TSimpleType methodsFor:'initialization'!
    28 
    41 
    29 initializeWithName: aString
    42 initializeWithName: aString
    30     name := aString
    43     name := aString
    31 
    44 
    32     "Created: / 21-08-2015 / 19:23:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    45     "Created: / 21-08-2015 / 19:23:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    33 ! !
    46 ! !
    34 
    47 
    35 !TSimpleType methodsFor:'printing & storing'!
    48 !TSimpleType methodsFor:'printing & storing'!
       
    49 
       
    50 printOn:aStream
       
    51     aStream nextPut: $<; space.
       
    52     self printWithoutAnglesOn:aStream.
       
    53     aStream space; nextPut: $>.
       
    54 
       
    55     "Created: / 25-08-2015 / 23:22:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    56 !
    36 
    57 
    37 printWithoutAnglesOn:aStream
    58 printWithoutAnglesOn:aStream
    38     aStream nextPutAll: name
    59     aStream nextPutAll: name
    39 
    60 
    40     "Modified: / 21-08-2015 / 17:08:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    61     "Modified: / 21-08-2015 / 17:08:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    44 
    65 
    45 isSimpleType
    66 isSimpleType
    46     ^ true
    67     ^ true
    47 ! !
    68 ! !
    48 
    69 
    49 !TSimpleType class methodsFor:'documentation'!
       
    50 
       
    51 version_HG
       
    52 
       
    53     ^ '$Changeset: <not expanded> $'
       
    54 ! !
       
    55