compiler/TMetaDefinition.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 25 Sep 2015 21:58:10 +0100
changeset 17 ee807ff2f897
parent 16 17a2d1d9f205
permissions -rw-r--r--
Removed dependency on SUnit
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
     1
"
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
     2
    Copyright (C) 2015-now Jan Vrany
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
     3
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
     4
    This code is not an open-source (yet). You may use this code
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
     5
    for your own experiments and projects, given that:
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
     6
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
     7
    * all modification to the code will be sent to the
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
     8
      original author for inclusion in future releases
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
     9
    * this is not used in any commercial software
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    10
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    11
    This license is provisional and may (will) change in
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    12
    a future.
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    13
"
3
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
"{ 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
    15
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
"{ NameSpace: Smalltalk }"
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
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
RGMetaclassDefinition subclass:#TMetaDefinition
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    19
	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
    20
	classVariableNames:''
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
	poolDictionaries:''
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
	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
    23
!
97ee341d3e9f Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
16
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    25
!TMetaDefinition class methodsFor:'documentation'!
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    26
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    27
copyright
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    28
"
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    29
    Copyright (C) 2015-now Jan Vrany
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    30
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    31
    This code is not an open-source (yet). You may use this code
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    32
    for your own experiments and projects, given that:
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    33
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    34
    * all modification to the code will be sent to the
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    35
      original author for inclusion in future releases
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    36
    * this is not used in any commercial software
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    37
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    38
    This license is provisional and may (will) change in
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    39
    a future.
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    40
"
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    41
! !
17a2d1d9f205 Added standalone Tea compiler - teak
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7
diff changeset
    42
4
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    43
!TMetaDefinition methodsFor:'accessing'!
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    44
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    45
binding
7
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    46
    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
    47
        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
    48
    ].
4
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    49
    ^ binding
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    50
7
7556e3d41d80 Make 3 + 4 working, though the code is rather messy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    51
    "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
    52
! !
3d80069ea3e2 More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3
diff changeset
    53
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
    54
!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
    55
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    56
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
    57
    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
    58
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    59
    "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
    60
!
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    61
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    62
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
    63
    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
    64
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    65
    "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
    66
!
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    67
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    68
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
    69
    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
    70
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    71
    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
    72
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    73
    "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
    74
! !
976f21e29d37 Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4
diff changeset
    75