compiler/TType.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 22 Sep 2015 17:43:38 +0100
changeset 14 fa42d3f1a578
parent 7 7556e3d41d80
child 15 10a95d798b36
permissions -rw-r--r--
Removed syntax for inline assembly, use <primitive: [:asm | ... ]> syntax. This one is easier to implement and less introusive, syntax-wise. And follows Smalltalk tradiiton.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'jv:tea/compiler' }"
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: Smalltalk }"
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
Object subclass:#TType
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	instanceVariableNames:''
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
2
2a3e47c13905 Removed classes meant for hosting Tea within Smalltalk/X.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
     9
	category:'Languages-Tea-Compiler-Types'
1
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
3
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    12
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    13
!TType methodsFor:'comparing'!
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    14
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    15
= anotherType
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    16
    ^ self subclassResponsibility
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    17
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    18
    "Created: / 25-08-2015 / 23:34:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    19
!
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    20
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    21
hash
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    22
    ^ self subclassResponsibility
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    23
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    24
    "Created: / 25-08-2015 / 23:33:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    25
! !
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    26
1
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
!TType methodsFor:'operations'!
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
union: aTType
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
    TUnionType with: self with: aTType
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
    "Created: / 21-08-2015 / 18:36:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
! !
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
!TType methodsFor:'printing & storing'!
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
printOn:aStream
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
    aStream nextPut: $<; space.
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
    self printWithoutAnglesOn:aStream.
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
    aStream nextPut: $>; space.
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
    "Modified: / 21-08-2015 / 13:46:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
!
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
printWithoutAnglesOn:aStream
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
    self subclassResponsibility
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
    "Created: / 21-08-2015 / 13:46:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
! !
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
!TType methodsFor:'testing'!
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
7
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    53
isBlockType
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    54
    ^ false
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    55
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    56
    "Created: / 02-09-2015 / 17:09:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    57
!
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    58
1
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
isSimpleType
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    ^ false
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
!
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
7
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    63
isSubtypeOf: anotherType
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    64
    self subclassResponsibility
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    65
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    66
    "Created: / 02-09-2015 / 17:09:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
! !
18b4a3b98e96 Creates subpackage jv:tea/compiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
3
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    69
!TType class methodsFor:'documentation'!
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    70
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    71
version
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    72
    ^ 'Path: jv/tea/compiler/TType.st, Version: 1.0, User: jv, Time: 2015-08-26T07:46:38.380+01'
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    73
!
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    74
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    75
version_HG
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    76
    ^ 'Path: jv/tea/compiler/TType.st, Version: 1.0, User: jv, Time: 2015-08-26T07:46:38.380+01'
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    77
! !
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    78