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