compiler/TTypeChecker.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 26 Aug 2015 07:51:18 +0100
changeset 3 97ee341d3e9f
permissions -rw-r--r--
Initial shot of scopes & bindings and type checking. Must be rethought.

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

"{ NameSpace: Smalltalk }"

TProgramNodeVisitor subclass:#TTypeChecker
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Tea-Compiler-Analysis'
!

!TTypeChecker methodsFor:'visitor-double dispatching'!

acceptReturnNode: aReturnNode 
    aReturnNode binding type = aReturnNode topNode binding type returnType ifFalse:[ 
        self error: 'Type mismatch'.
    ].

    "Created: / 25-08-2015 / 23:40:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !