compiler/TUnionTypeNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 31 Aug 2015 18:37:31 +0100
changeset 5 976f21e29d37
parent 3 97ee341d3e9f
permissions -rw-r--r--
Added TSourceReader to allow reading source files. Initial work on T environment...

"{ Package: 'jv:tea/compiler' }"

"{ NameSpace: Smalltalk }"

TTypeNode subclass:#TUnionTypeNode
	instanceVariableNames:'types'
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Tea-Compiler-AST'
!

!TUnionTypeNode class methodsFor:'instance creation'!

new
    "return an initialized instance"

    ^ self basicNew initialize.
! !

!TUnionTypeNode methodsFor:'accessing'!

start
    ^ types first start

    "Created: / 21-08-2015 / 21:08:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

stop
    ^ types last stop

    "Created: / 21-08-2015 / 21:08:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

types
    ^ types
!

types:something
    types := something.
! !

!TUnionTypeNode methodsFor:'conversion'!

asType
    "superclass TTypeNode says that I am responsible to implement this method"

    ^ TUnionType withAll: (types collect:[:e|e asType])

    "Modified: / 25-08-2015 / 22:51:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!TUnionTypeNode methodsFor:'visitor'!

acceptVisitor: aProgramNodeVisitor 
    ^ aProgramNodeVisitor acceptUnionTypeNode: self

    "Created: / 21-08-2015 / 22:15:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !