1570
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2004 by eXept Software AG
|
|
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 |
"
|
1146
|
12 |
"{ Package: 'stx:libcomp' }"
|
|
13 |
|
3837
|
14 |
"{ NameSpace: Smalltalk }"
|
|
15 |
|
538
|
16 |
Object subclass:#ProgramNodeEnumerator
|
|
17 |
instanceVariableNames:''
|
|
18 |
classVariableNames:''
|
|
19 |
poolDictionaries:''
|
568
|
20 |
category:'System-Compiler'
|
538
|
21 |
!
|
|
22 |
|
|
23 |
!ProgramNodeEnumerator class methodsFor:'documentation'!
|
|
24 |
|
1570
|
25 |
copyright
|
|
26 |
"
|
|
27 |
COPYRIGHT (c) 2004 by eXept Software AG
|
|
28 |
All Rights Reserved
|
|
29 |
|
|
30 |
This software is furnished under a license and may be used
|
|
31 |
only in accordance with the terms of that license and with the
|
|
32 |
inclusion of the above copyright notice. This software may not
|
|
33 |
be provided or otherwise made available to, or used by, any
|
|
34 |
other person. No title to or ownership of the software is
|
|
35 |
hereby transferred.
|
|
36 |
"
|
|
37 |
!
|
|
38 |
|
538
|
39 |
documentation
|
|
40 |
"
|
|
41 |
This is a pure mimicri class.
|
|
42 |
It is not used by ST/X, but provided to support limited
|
|
43 |
compatibility for applications which walk codetrees,
|
|
44 |
knowing internals of ST-80's compiler class hierarchy.
|
|
45 |
This classes protocol is not (not meant to be) fully covering
|
|
46 |
the corresponding ST-80's classes protocol. It maps ST-80 messages
|
|
47 |
to corresponding ST/X messages (as far as possible).
|
|
48 |
|
|
49 |
This class was added to allow for the PD goody CodeReview to be filed
|
|
50 |
into ST/X.
|
|
51 |
|
|
52 |
NO WARRANTY and GUARANTEE; this class may be removed without notice.
|
|
53 |
"
|
|
54 |
|
|
55 |
! !
|
|
56 |
|
|
57 |
!ProgramNodeEnumerator class methodsFor:'instance creation'!
|
|
58 |
|
|
59 |
new
|
1623
|
60 |
^ self basicNew initialize
|
538
|
61 |
|
|
62 |
"Created: 19.6.1997 / 16:52:06 / cg"
|
|
63 |
! !
|
|
64 |
|
1591
|
65 |
!ProgramNodeEnumerator methodsFor:'enumeration callbacks'!
|
538
|
66 |
|
|
67 |
doAssignment:aNode variable:var value:val
|
1591
|
68 |
self doNode:val.
|
538
|
69 |
!
|
|
70 |
|
|
71 |
doBlock:aNode arguments:args body:seq
|
1591
|
72 |
seq notNil ifTrue:[
|
|
73 |
self doNode:seq.
|
|
74 |
]
|
538
|
75 |
!
|
|
76 |
|
|
77 |
doCascade:aNode receiver:rcvr messages:msgs
|
1591
|
78 |
msgs do:[:eachMessage |
|
|
79 |
self doNode:eachMessage
|
|
80 |
].
|
538
|
81 |
!
|
|
82 |
|
|
83 |
doLiteral:aNode value:lit
|
|
84 |
!
|
|
85 |
|
|
86 |
doMessage:aNode receiver:rcvr selector:sel arguments:args
|
1591
|
87 |
self doNode:rcvr.
|
|
88 |
args do:[:eachArg |
|
|
89 |
self doNode:eachArg
|
|
90 |
].
|
538
|
91 |
!
|
|
92 |
|
|
93 |
doMethod:aNode selector:sel primitive:prim block:block
|
|
94 |
^ self subclassResponsibility
|
|
95 |
|
|
96 |
"Created: 19.6.1997 / 16:50:45 / cg"
|
|
97 |
"Modified: 19.6.1997 / 16:52:54 / cg"
|
|
98 |
!
|
|
99 |
|
|
100 |
doParameter:aNode variable:var type:type
|
|
101 |
^ self subclassResponsibility
|
|
102 |
|
|
103 |
"Created: 19.6.1997 / 16:50:50 / cg"
|
|
104 |
"Modified: 19.6.1997 / 16:53:01 / cg"
|
|
105 |
!
|
|
106 |
|
1585
|
107 |
doPrimitive:aNode code:code primitiveIndex:primNumber
|
|
108 |
!
|
|
109 |
|
538
|
110 |
doReturn:aNode value:value
|
1591
|
111 |
self doNode:value
|
538
|
112 |
!
|
|
113 |
|
|
114 |
doSequence:aNode temporaries:temps statements:stats
|
1591
|
115 |
stats do:[:each | self doNode:each ].
|
538
|
116 |
!
|
|
117 |
|
|
118 |
doVariable:aNode name:nameString
|
|
119 |
! !
|
|
120 |
|
|
121 |
!ProgramNodeEnumerator methodsFor:'private'!
|
|
122 |
|
|
123 |
collectNodes:nodeList
|
|
124 |
^ nodeList collect:[:node | self doNode:node]
|
|
125 |
|
|
126 |
"Created: 19.6.1997 / 16:51:31 / cg"
|
|
127 |
"Modified: 19.6.1997 / 16:53:32 / cg"
|
|
128 |
!
|
|
129 |
|
|
130 |
doNode:aNode
|
|
131 |
^ aNode nodeDo:self
|
|
132 |
|
|
133 |
"Modified: 19.6.1997 / 16:53:47 / cg"
|
|
134 |
!
|
|
135 |
|
1591
|
136 |
doNodeList:firstNode
|
|
137 |
|node|
|
|
138 |
|
|
139 |
node := firstNode.
|
|
140 |
[ node notNil ] whileTrue:[
|
|
141 |
self doNode:node.
|
|
142 |
node := node nextStatement.
|
|
143 |
]
|
|
144 |
!
|
|
145 |
|
538
|
146 |
doNodes:nodeList
|
|
147 |
^ nodeList do:[:node | self doNode:node]
|
|
148 |
|
|
149 |
"Created: 19.6.1997 / 16:51:41 / cg"
|
|
150 |
"Modified: 19.6.1997 / 16:53:55 / cg"
|
|
151 |
!
|
|
152 |
|
|
153 |
doType:aType
|
|
154 |
^ aType
|
|
155 |
|
|
156 |
"Modified: 19.6.1997 / 16:54:05 / cg"
|
|
157 |
! !
|
|
158 |
|
|
159 |
!ProgramNodeEnumerator class methodsFor:'documentation'!
|
|
160 |
|
|
161 |
version
|
3837
|
162 |
^ '$Header$'
|
|
163 |
!
|
|
164 |
|
|
165 |
version_CVS
|
|
166 |
^ '$Header$'
|
538
|
167 |
! !
|
3837
|
168 |
|