author | Claus Gittinger <cg@exept.de> |
Fri, 20 Jun 1997 12:06:27 +0200 | |
changeset 543 | de47f8969fd9 |
parent 135 | aa4f7b8f121e |
child 1105 | b743f8f5ca66 |
permissions | -rw-r--r-- |
98 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
ParseNode subclass:#MethodNode |
|
14 |
instanceVariableNames:'selector arguments locals statements' |
|
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
111 | 17 |
category:'System-Compiler ST-80-compatibility' |
98 | 18 |
! |
19 |
||
20 |
!MethodNode class methodsFor:'documentation'! |
|
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
25 |
All Rights Reserved |
|
26 |
||
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
version |
|
135
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
111
diff
changeset
|
37 |
^ '$Header: /cvs/stx/stx/libcomp/MethodNode.st,v 1.7 1995-11-11 15:30:39 cg Exp $' |
98 | 38 |
! |
39 |
||
40 |
documentation |
|
41 |
" |
|
42 |
This is a pure mimicri class. |
|
43 |
It is not used by ST/X, but provided to support limited |
|
44 |
compatibility for applications which build up codetrees, |
|
45 |
knowing internals of ST-80's compiler class hierarchy. |
|
46 |
This classes protocol is not (not meant to be) fully covering |
|
47 |
the corresponding ST-80's classes protocol. It maps ST-80 messages |
|
48 |
to corresponding ST/X messages (as far as possible). |
|
49 |
||
50 |
NO WARRANTY and GUARANTEE; this class may be removed without notice. |
|
51 |
" |
|
52 |
! ! |
|
53 |
||
54 |
!MethodNode methodsFor:'accessing'! |
|
55 |
||
56 |
selector:sel arguments:argVars locals:localVars statements:stats |
|
57 |
selector := sel. |
|
58 |
arguments := argVars. |
|
59 |
locals := localVars. |
|
60 |
statements := stats. |
|
61 |
! |
|
62 |
||
63 |
selector |
|
64 |
^ selector |
|
65 |
! ! |
|
66 |
||
67 |
!MethodNode methodsFor:'code generation'! |
|
68 |
||
106 | 69 |
emitEffect:aStream |
98 | 70 |
statements do:[:stat | |
106 | 71 |
stat codeForSideEffectOn:aStream inBlock:nil for:nil |
98 | 72 |
]. |
73 |
! ! |
|
74 |
||
75 |
!MethodNode methodsFor:'printing'! |
|
76 |
||
77 |
printOn:aStream indent:i |
|
78 |
|n parts| |
|
79 |
||
80 |
n := selector numArgs. |
|
81 |
n == 0 ifTrue:[ |
|
82 |
aStream nextPutAll:selector printString. |
|
83 |
] ifFalse:[ |
|
84 |
parts := selector partsIfSelector. |
|
85 |
parts with:arguments do:[:part :arg | |
|
86 |
aStream nextPutAll:part. |
|
87 |
aStream space. |
|
88 |
aStream nextPutAll:arg name |
|
89 |
] |
|
90 |
]. |
|
91 |
aStream cr. |
|
92 |
||
93 |
statements do:[:stat | |
|
94 |
aStream spaces:i+4. |
|
95 |
stat printOn:aStream indent:i+4. |
|
96 |
aStream nextPut:$.. |
|
97 |
aStream cr. |
|
98 |
]. |
|
99 |
! ! |