author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 22 Sep 2015 17:43:38 +0100 | |
changeset 14 | fa42d3f1a578 |
parent 9 | 569bf5707c7e |
child 16 | 17a2d1d9f205 |
permissions | -rw-r--r-- |
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 |
RBProgramNodeVisitor subclass:#TProgramNodeVisitor |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
6 |
instanceVariableNames:'' |
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-AST' |
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 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
13 |
!TProgramNodeVisitor methodsFor:'visiting'! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
15 |
visitArgument: anRBVariableNode |
6
0c806a7f1888
Initial support for inline assembly
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
16 |
| typeSpec | |
0c806a7f1888
Initial support for inline assembly
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
17 |
|
3
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
18 |
super visitArgument: anRBVariableNode. |
6
0c806a7f1888
Initial support for inline assembly
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
19 |
typeSpec := anRBVariableNode typeSpec. |
0c806a7f1888
Initial support for inline assembly
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
20 |
typeSpec notNil ifTrue:[ self visitNode: typeSpec ] |
3
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
21 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
"Created: / 25-08-2015 / 19:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6
0c806a7f1888
Initial support for inline assembly
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
23 |
"Modified: / 02-09-2015 / 06:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
24 |
! ! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
25 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
26 |
!TProgramNodeVisitor methodsFor:'visitor-double dispatching'! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
27 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
28 |
acceptMethodNode: aMethodNode |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
29 |
super acceptMethodNode: aMethodNode. |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
30 |
self visitNode: aMethodNode returnTypeSpec |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
31 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
32 |
"Created: / 25-08-2015 / 19:53:04 / 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:
diff
changeset
|
33 |
! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
34 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
35 |
acceptSimpleTypeNode: aTSimpleTypeNode |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
36 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
37 |
"Created: / 21-08-2015 / 22:20:26 / 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:
diff
changeset
|
38 |
"Modified: / 25-08-2015 / 19:54:21 / 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:
diff
changeset
|
39 |
! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
40 |
|
9
569bf5707c7e
Added support for special forms to parser and typechecker (somewhat)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
41 |
acceptSpecialFormNode: aTSpecialFormNode |
569bf5707c7e
Added support for special forms to parser and typechecker (somewhat)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
42 |
self acceptMessageNode: aTSpecialFormNode |
569bf5707c7e
Added support for special forms to parser and typechecker (somewhat)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
43 |
|
569bf5707c7e
Added support for special forms to parser and typechecker (somewhat)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
44 |
"Created: / 14-09-2015 / 12:10:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
569bf5707c7e
Added support for special forms to parser and typechecker (somewhat)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
45 |
! |
569bf5707c7e
Added support for special forms to parser and typechecker (somewhat)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
46 |
|
3
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
47 |
acceptTypeSpecNode: aTTypeSpecNode |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
48 |
self visitNode: aTTypeSpecNode type. |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
49 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
50 |
"Created: / 21-08-2015 / 22:18:08 / 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:
diff
changeset
|
51 |
"Modified: / 25-08-2015 / 19:54:47 / 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:
diff
changeset
|
52 |
! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
53 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
54 |
acceptUnionTypeNode: aTUnionTypeNode |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
55 |
aTUnionTypeNode types do:[:type | self visitNode: type ] |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
"Created: / 21-08-2015 / 22:21: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:
diff
changeset
|
58 |
"Modified (format): / 25-08-2015 / 19:54:40 / 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:
diff
changeset
|
59 |
! ! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
60 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
61 |
!TProgramNodeVisitor class methodsFor:'documentation'! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
62 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
63 |
version |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
64 |
^ 'Path: jv/tea/compiler/TProgramNodeVisitor.st, Version: 1.0, User: jv, Time: 2015-08-25T19:55:02.763+01' |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
65 |
! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
66 |
|
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
67 |
version_HG |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
68 |
^ 'Path: jv/tea/compiler/TProgramNodeVisitor.st, Version: 1.0, User: jv, Time: 2015-08-25T19:55:02.763+01' |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
69 |
! ! |
97ee341d3e9f
Initial shot of scopes & bindings and type checking. Must be rethought.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
70 |