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 |
|
1208
|
13 |
"{ Package: 'stx:libcomp' }"
|
|
14 |
|
1106
|
15 |
ParseNode subclass:#MethodNode
|
1208
|
16 |
instanceVariableNames:'selector arguments locals statements'
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'System-Compiler ST-80-compatibility'
|
98
|
20 |
!
|
|
21 |
|
1106
|
22 |
!MethodNode class methodsFor:'documentation'!
|
98
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
!
|
|
37 |
|
|
38 |
documentation
|
|
39 |
"
|
|
40 |
This is a pure mimicri class.
|
|
41 |
It is not used by ST/X, but provided to support limited
|
|
42 |
compatibility for applications which build up codetrees,
|
|
43 |
knowing internals of ST-80's compiler class hierarchy.
|
|
44 |
This classes protocol is not (not meant to be) fully covering
|
|
45 |
the corresponding ST-80's classes protocol. It maps ST-80 messages
|
|
46 |
to corresponding ST/X messages (as far as possible).
|
|
47 |
|
|
48 |
NO WARRANTY and GUARANTEE; this class may be removed without notice.
|
|
49 |
"
|
|
50 |
! !
|
|
51 |
|
1106
|
52 |
!MethodNode methodsFor:'accessing'!
|
|
53 |
|
1208
|
54 |
selector
|
|
55 |
^ selector
|
|
56 |
!
|
|
57 |
|
1106
|
58 |
selector:sel arguments:argVars locals:localVars statements:stats
|
|
59 |
selector := sel.
|
|
60 |
arguments := argVars.
|
|
61 |
locals := localVars.
|
|
62 |
statements := stats.
|
|
63 |
!
|
98
|
64 |
|
1208
|
65 |
statementCollection
|
|
66 |
"returns an orderedColl for my linked statement list"
|
|
67 |
|
|
68 |
|coll stat|
|
|
69 |
|
|
70 |
coll := OrderedCollection new.
|
|
71 |
stat := statements.
|
|
72 |
[stat notNil] whileTrue:[
|
|
73 |
coll add:stat.
|
|
74 |
stat := stat nextStatement.
|
|
75 |
].
|
|
76 |
^ coll
|
|
77 |
!
|
|
78 |
|
|
79 |
statements
|
|
80 |
^ statements
|
98
|
81 |
! !
|
|
82 |
|
1106
|
83 |
!MethodNode methodsFor:'code generation'!
|
98
|
84 |
|
106
|
85 |
emitEffect:aStream
|
98
|
86 |
statements do:[:stat |
|
106
|
87 |
stat codeForSideEffectOn:aStream inBlock:nil for:nil
|
98
|
88 |
].
|
|
89 |
! !
|
|
90 |
|
1106
|
91 |
!MethodNode methodsFor:'printing'!
|
98
|
92 |
|
|
93 |
printOn:aStream indent:i
|
|
94 |
|n parts|
|
|
95 |
|
|
96 |
n := selector numArgs.
|
|
97 |
n == 0 ifTrue:[
|
1106
|
98 |
aStream nextPutAll:selector printString.
|
98
|
99 |
] ifFalse:[
|
1106
|
100 |
parts := selector partsIfSelector.
|
|
101 |
parts with:arguments do:[:part :arg |
|
|
102 |
aStream nextPutAll:part.
|
|
103 |
aStream space.
|
|
104 |
aStream nextPutAll:arg name
|
|
105 |
]
|
98
|
106 |
].
|
|
107 |
aStream cr.
|
|
108 |
|
1106
|
109 |
statements do:[:stat |
|
|
110 |
aStream spaces:i+4.
|
|
111 |
stat printOn:aStream indent:i+4.
|
|
112 |
aStream nextPut:$..
|
|
113 |
aStream cr.
|
|
114 |
].
|
98
|
115 |
! !
|
1208
|
116 |
|
|
117 |
!MethodNode class methodsFor:'documentation'!
|
|
118 |
|
|
119 |
version
|
|
120 |
^ '$Header: /cvs/stx/stx/libcomp/MethodNode.st,v 1.10 2001-11-05 15:37:44 james Exp $'
|
|
121 |
! !
|