compiler/TMetaDefinition.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 22 Sep 2015 17:43:38 +0100
changeset 14 fa42d3f1a578
parent 7 7556e3d41d80
child 16 17a2d1d9f205
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:
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
4
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
     5
RGMetaclassDefinition subclass:#TMetaDefinition
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
     6
	instanceVariableNames:'binding'
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-Model'
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
4
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    12
!TMetaDefinition methodsFor:'accessing'!
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    13
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    14
binding
7
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    15
    binding isNil ifTrue:[ 
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    16
        binding := TClassBinding clazz: self.
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    17
    ].
4
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    18
    ^ binding
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    19
7
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    20
    "Modified: / 02-09-2015 / 16:02:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    21
! !
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    22
5
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    23
!TMetaDefinition methodsFor:'instance variables'!
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    24
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    25
addInstVarNamed: aString
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    26
    self shouldNotImplement
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    27
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    28
    "Created: / 31-08-2015 / 15:40:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    29
!
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    30
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    31
addInstanceVariables: aCollection
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    32
    self shouldNotImplement
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    33
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    34
    "Created: / 31-08-2015 / 15:40:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    35
!
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    36
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    37
instanceVariableNames: aStringOrCollection
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    38
    aStringOrCollection isEmptyOrNil ifTrue:[ ^ self ].
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    39
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    40
    self notYetImplemented
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    41
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    42
    "Created: / 31-08-2015 / 15:40:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    43
! !
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    44