Fixes/refactoring of scopes and bindings.
Fixed initialization of scopes and bindings. Make
typechecker to seed types.
"{ Package: 'jv:tea/compiler' }"
"{ NameSpace: Smalltalk }"
TType subclass:#TSimpleType
instanceVariableNames:'name'
classVariableNames:''
poolDictionaries:''
category:'Languages-Tea-Compiler-Types'
!
!TSimpleType class methodsFor:'instance creation'!
named: aString
^ self new initializeWithName: aString
"Created: / 21-08-2015 / 19:24:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TSimpleType methodsFor:'accessing'!
name
^ name
! !
!TSimpleType methodsFor:'comparing'!
= anotherType
^ self class = anotherType class and:[ self name = anotherType name ]
"Created: / 25-08-2015 / 23:36:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
hash
^ name hash
"Created: / 25-08-2015 / 23:34:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TSimpleType methodsFor:'conversion'!
asLLVMTypeInModule: aLLVMModule
"Return the type as LLVMType"
name = 'tUIntegerW' ifTrue:[
^ LLVMType intptr
].
name = 'tSIntegerW' ifTrue:[
^ LLVMType intptr
].
name = 'tPointer' ifTrue:[
^ LLVMType void pointer
].
name = 'tBoolean' ifTrue:[
^ LLVMType int1
].
^ self notYetImplemented
"Created: / 31-08-2015 / 09:06:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 14-09-2015 / 11:43:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TSimpleType methodsFor:'initialization'!
initializeWithName: aString
name := aString
"Created: / 21-08-2015 / 19:23:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TSimpleType methodsFor:'printing & storing'!
printOn:aStream
aStream nextPut: $<; space.
self printWithoutAnglesOn:aStream.
aStream space; nextPut: $>.
"Created: / 25-08-2015 / 23:22:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
printWithoutAnglesOn:aStream
aStream nextPutAll: name
"Modified: / 21-08-2015 / 17:08:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TSimpleType methodsFor:'testing'!
isSimpleType
^ true
!
isSubtypeOf: anotherType
"/ Hack for now - types must match exactly...
^ anotherType class == self class and:[ anotherType name = name ]
"Created: / 02-09-2015 / 17:11:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !