compiler/TValueBinding.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 23 Sep 2015 22:21:44 +0100
changeset 15 10a95d798b36
parent 4 3d80069ea3e2
child 16 17a2d1d9f205
permissions -rw-r--r--
Added support for local variables and #whileTrue: special form Allocate all local variables in a special basic block named `allocas`. Added support for #whileTrue: special form.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'jv:tea/compiler' }"
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: Smalltalk }"
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
TBinding subclass:#TValueBinding
4
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
     6
	instanceVariableNames:'type'
3
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'Languages-Tea-Compiler-Bindings'
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
!TValueBinding class methodsFor:'queries'!
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
isAbstract
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
    "Return if this class is an abstract class.
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
     True is returned here for myself only; false for subclasses.
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
     Abstract subclasses must redefine again."
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
    ^ self == TValueBinding.
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
! !
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
4
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    22
!TValueBinding methodsFor:'accessing'!
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    23
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    24
type
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    25
    ^ type
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    26
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    27
    "Created: / 31-08-2015 / 11:48:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    28
!
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    29
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    30
type: aTType
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    31
    type := aTType
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    32
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    33
    "Created: / 31-08-2015 / 11:49:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    34
! !
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    35
15
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    36
!TValueBinding methodsFor:'accesssing - llvm'!
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    37
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    38
llvmValue
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    39
    ^ self propertyAt: #llvmValue ifAbsent:[ nil ]
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    40
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    41
    "Created: / 23-09-2015 / 21:14:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    42
!
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    43
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    44
llvmValue: anLLVMValue
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    45
    self propertyAt: #llvmValue put: anLLVMValue
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    46
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    47
    "Created: / 23-09-2015 / 21:14:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    48
! !
10a95d798b36 Added support for local variables and #whileTrue: special form
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    49