compiler/TCompilerContext.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 20 Sep 2015 12:01:42 +0100
changeset 13 97090c2baa33
parent 9 569bf5707c7e
child 16 17a2d1d9f205
permissions -rw-r--r--
Fixes/refactoring of scopes and bindings. Fixed initialization of scopes and bindings. Make typechecker to seed types.

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

"{ NameSpace: Smalltalk }"

Object subclass:#TCompilerContext
	instanceVariableNames:'environment unit module'
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Tea-Compiler'
!

!TCompilerContext methodsFor:'accessing'!

environment
    ^ environment
!

environment:aTNamespaceDefinition
    environment := aTNamespaceDefinition.
!

module
    module isNil ifTrue:[ 
        module := LLVMModule newWithName: unit name.
    ].
    ^ module

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

unit
    ^ unit
!

unit:aTCompilationUnit
    unit := aTCompilationUnit.
! !

!TCompilerContext methodsFor:'error reporting'!

reportSemanticError: message

    TCompilerError raiseErrorString: message

    "Created: / 20-09-2015 / 06:13:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

reportTypeError: message

    TCompilerError raiseErrorString: message

    "Created: / 14-09-2015 / 14:20:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !