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

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

!RBBlockNode methodsFor:'accessing'!

returnTypeSpec
    "Return the TTypeSpecNode describing the return type of the
     block"

    ^ self propertyAt: #returnTypeSpec ifAbsent: nil

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

!RBBlockNode methodsFor:'accessing'!

returnTypeSpec: aTTypeSpecNode
    "Set the TTypeSpecNode describing the return type of the block"

    ^ self propertyAt: #returnTypeSpec put: aTTypeSpecNode

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

!RBBlockNode methodsFor:'accessing'!

scope
    ^ self propertyAt: #scope

    "Created: / 25-08-2015 / 22:14:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!RBBlockNode methodsFor:'accessing'!

scope: aTScope
    ^ self propertyAt: #scope put: aTScope

    "Created: / 25-08-2015 / 22:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!RBMethodNode methodsFor:'accessing'!

returnTypeSpec
    "Return the TTypeSpecNode describing the return type of the
     method"

    ^ self propertyAt: #returnTypeSpec ifAbsent: nil

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

!RBMethodNode methodsFor:'accessing'!

returnTypeSpec: aTTypeSpecNode
    "Set the TTypeSpecNode describing the return type of the method"

    ^ self propertyAt: #returnTypeSpec put: aTTypeSpecNode

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

!RBMethodNode methodsFor:'accessing'!

scope
    ^ self propertyAt: #scope

    "Created: / 25-08-2015 / 22:14:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!RBMethodNode methodsFor:'accessing'!

scope: aTScope
    ^ self propertyAt: #scope put: aTScope

    "Created: / 25-08-2015 / 22:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!RBProgramNode methodsFor:'accessing'!

binding
    ^ self propertyAt: #binding

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

!RBProgramNode methodsFor:'accessing'!

binding: aTBinding
    self propertyAt: #binding put: aTBinding

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

!RBProgramNode methodsFor:'accessing'!

scope
    ^ self parent scope

    "Created: / 25-08-2015 / 22:13:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!RBReturnNode methodsFor:'accessing'!

binding
    ^ value binding

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

!RBReturnNode methodsFor:'accessing'!

binding: aTBinding
    self shouldNotImplement

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

!RBVariableNode methodsFor:'accessing'!

typeSpec
    "Return the TTypeSpecNode associated with this variable node
     (if this node is for variable declaration) or nil (otherwise)"

    ^ self propertyAt: #typeSpec ifAbsent: nil

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

!RBVariableNode methodsFor:'accessing'!

typeSpec: aTTypeSpecNode
    "Associate a TTypeSpecNode this variable node"

    ^ self propertyAt: #typeSpec put: aTTypeSpecNode

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

!jv_tea_compiler class methodsFor:'documentation'!

extensionsVersion_HG

    ^ '$Changeset: <not expanded> $'
! !