author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 28 Sep 2015 14:39:57 +0100 | |
changeset 20 | 2f28df70181a |
parent 16 | 17a2d1d9f205 |
permissions | -rw-r--r-- |
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 |
" |
4
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
"{ Package: 'jv:tea/compiler' }" |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
15 |
|
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
16 |
"{ NameSpace: Smalltalk }" |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
17 |
|
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
18 |
RGClassDefinition subclass:#TClassDefinition |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
instanceVariableNames:'binding' |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
20 |
classVariableNames:'' |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
21 |
poolDictionaries:'' |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
category:'Languages-Tea-Compiler-Model' |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
23 |
! |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
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 |
!TClassDefinition 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:
diff
changeset
|
43 |
!TClassDefinition methodsFor:'accessing'! |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
44 |
|
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
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:
diff
changeset
|
49 |
^ binding |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
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:
diff
changeset
|
52 |
! ! |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
53 |
|
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
54 |
!TClassDefinition methodsFor:'behavior'! |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
55 |
|
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
withMetaclass |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
"Registers explicitly the metaclass of a class" |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
58 |
|
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
59 |
metaClass:= TMetaDefinition class: self |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
60 |
|
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
61 |
"Modified: / 31-08-2015 / 11:53:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
62 |
! ! |
3d80069ea3e2
More work on basic infrastructure - types, bindings & compilation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
63 |
|
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
|
64 |
!TClassDefinition methodsFor:'class 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
|
65 |
|
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 |
addClassVarNamed: 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
|
67 |
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
|
68 |
|
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 |
"Created: / 31-08-2015 / 15:40:01 / 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
|
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 |
|
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 |
addClassVariables: 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
|
73 |
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
|
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 |
"Created: / 31-08-2015 / 15:38:57 / 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
|
76 |
! ! |
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
77 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
78 |
!TClassDefinition 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
|
79 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
80 |
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
|
81 |
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
|
82 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
83 |
"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
|
84 |
! |
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
85 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
86 |
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
|
87 |
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
|
88 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
89 |
"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
|
90 |
! |
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
91 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
92 |
classVariableNames: 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
|
93 |
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
|
94 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
95 |
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
|
96 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
97 |
"Created: / 31-08-2015 / 15:41:22 / 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
|
98 |
! |
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
99 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
100 |
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
|
101 |
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
|
102 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
103 |
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
|
104 |
|
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
105 |
"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
|
106 |
! ! |
976f21e29d37
Added TSourceReader to allow reading source files. Initial work on T environment...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
107 |