author | Claus Gittinger <cg@exept.de> |
Sat, 09 Dec 1995 22:34:58 +0100 | |
changeset 726 | 997e30ef8423 |
parent 722 | 921a95dee8f2 |
child 733 | 983d045c17f5 |
permissions | -rw-r--r-- |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
153 | 3 |
All Rights Reserved |
1 | 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 |
||
719
c557a530f971
dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
13 |
ClassDescription subclass:#Class |
453 | 14 |
instanceVariableNames:'classvars comment subclasses classFilename package revision |
707
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
15 |
history' |
555 | 16 |
classVariableNames:'UpdatingChanges LockChangesFile FileOutErrorSignal |
707
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
17 |
CatchMethodRedefinitions MethodRedefinitionSignal |
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
18 |
UpdateChangeFileQuerySignal' |
453 | 19 |
poolDictionaries:'' |
20 |
category:'Kernel-Classes' |
|
1 | 21 |
! |
22 |
||
68 | 23 |
!Class class methodsFor:'documentation'! |
24 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
25 |
copyright |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
26 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
27 |
COPYRIGHT (c) 1989 by Claus Gittinger |
527
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
28 |
All Rights Reserved |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
29 |
|
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
30 |
This software is furnished under a license and may be used |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
31 |
only in accordance with the terms of that license and with the |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
32 |
inclusion of the above copyright notice. This software may not |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
33 |
be provided or otherwise made available to, or used by, any |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
34 |
other person. No title to or ownership of the software is |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
35 |
hereby transferred. |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
36 |
" |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
37 |
! |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
38 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
39 |
documentation |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
40 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
41 |
Class adds more functionality to classes; minimum stuff has already |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
42 |
been defined in Behavior and ClassDescription; this adds naming, categories etc. |
68 | 43 |
|
44 |
Also change management and recompilation is defined here (since the superclasses |
|
45 |
do not have enough symbolic information to support compilation). |
|
46 |
||
168 | 47 |
For production code, the stc compiler is planned to (optionally) generate classes |
48 |
as subclasses of Behavior - to excludes all name, source info etc., |
|
68 | 49 |
however, normally all classes are subclasses of Class. |
50 |
||
51 |
Instance variables: |
|
52 |
||
153 | 53 |
classvars <String> the names of the class variables |
168 | 54 |
|
55 |
comment <String> the classes comment; either a string, |
|
56 |
a number specifying the offset in classFilename, or nil |
|
57 |
||
153 | 58 |
subclasses <Collection> cached collection of subclasses |
59 |
(currently unused - but will be soon) |
|
168 | 60 |
|
61 |
classFilename <String> the file (or nil) where the classes |
|
62 |
sources are found |
|
63 |
||
153 | 64 |
package <Symbol> the package, in which the class was defined |
385 | 65 |
(inserted by compilers) |
66 |
||
391 | 67 |
revision <String> revision string - inserted by stc |
168 | 68 |
|
69 |
history <any> a place for a history string (not currently used) |
|
68 | 70 |
|
71 |
Class variables: |
|
72 |
||
153 | 73 |
UpdatingChanges <Boolean> true if the changes-file shall be updated |
74 |
(except during startup and when filing in, this flag |
|
75 |
is usually true) |
|
68 | 76 |
|
488
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
77 |
LockChangesFile <Boolean> if true, the change file is locked for updates. |
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
78 |
Required when multiple users operate on a common |
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
79 |
change file. |
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
80 |
This is an experimental new feature, being evaluated. |
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
81 |
|
421 | 82 |
UpdateChangeFileQuerySignal used as an upQuery from the change management. |
83 |
Whenever a changeRecord is to be written, |
|
84 |
this signal is raised and a handler (if present) |
|
85 |
is supposed to return true or false. |
|
86 |
If unhandled, the value of the global |
|
87 |
UpdatingChanges is returned for backward |
|
88 |
compatibility (which means that the old |
|
89 |
mechanism is used if no query-handler |
|
90 |
is present). |
|
91 |
||
168 | 92 |
FileOutErrorSignal raised when an error occurs during fileOut |
93 |
||
362 | 94 |
CatchMethodRedefinitions if true, classes protect themself |
95 |
MethodRedefinitionSignal (by raising MethodRedefinitionSignal) |
|
96 |
from redefining any existing methods, |
|
97 |
which are defined in another package. |
|
98 |
(i.e. a signal will be raised, if you |
|
99 |
fileIn something which redefines an |
|
100 |
existing method and the packages do not |
|
101 |
match). |
|
102 |
The default is (currently) true. |
|
103 |
||
68 | 104 |
WARNING: layout known by compiler and runtime system |
105 |
" |
|
662 | 106 |
! ! |
68 | 107 |
|
1 | 108 |
!Class class methodsFor:'initialization'! |
109 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
110 |
initialize |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
111 |
"the classvariable 'UpdatingChanges' controls if changes are put |
1 | 112 |
into the changes-file; normally this variable is set to true, but |
68 | 113 |
(for example) during fileIn or when changes are applied, it is set to false |
114 |
to avoid putting too much junk into the changes-file." |
|
1 | 115 |
|
153 | 116 |
UpdatingChanges := true. |
488
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
117 |
LockChangesFile := false. |
362 | 118 |
CatchMethodRedefinitions := true. |
119 |
||
153 | 120 |
FileOutErrorSignal isNil ifTrue:[ |
421 | 121 |
FileOutErrorSignal := ErrorSignal newSignalMayProceed:false. |
153 | 122 |
FileOutErrorSignal nameClass:self message:#fileOutErrorSignal. |
123 |
FileOutErrorSignal notifierString:'error during fileOut'. |
|
362 | 124 |
|
421 | 125 |
MethodRedefinitionSignal := ErrorSignal newSignalMayProceed:true. |
362 | 126 |
MethodRedefinitionSignal nameClass:self message:#methodRedefinitionSignal. |
127 |
MethodRedefinitionSignal notifierString:'attempt to redefine method from different package'. |
|
421 | 128 |
|
129 |
UpdateChangeFileQuerySignal := QuerySignal new mayProceed:true. |
|
130 |
UpdateChangeFileQuerySignal nameClass:self message:#updateChangeFileQuerySignal. |
|
131 |
UpdateChangeFileQuerySignal notifierString:'asking if changeFile update is wanted'. |
|
132 |
UpdateChangeFileQuerySignal handlerBlock:[:ex | ex proceedWith:UpdatingChanges]. |
|
153 | 133 |
] |
134 |
! ! |
|
135 |
||
345 | 136 |
!Class class methodsFor:'Signal constants'! |
153 | 137 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
138 |
fileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
139 |
"return the signal raised when an error occurs while fileing out. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
140 |
This is signalled to allow browsers some user feed back in case |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
141 |
a fileout fails (for example due to disk-full errors)" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
142 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
143 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
144 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
145 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
146 |
methodRedefinitionSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
147 |
"return the signal raised when a method is about to be installed |
362 | 148 |
which redefines an existing method and the methods packages are not |
149 |
equal. This helps when filing in alien code, to prevent existing |
|
150 |
methods to be overwritten or redefined by incompatible methods" |
|
151 |
||
152 |
^ MethodRedefinitionSignal |
|
555 | 153 |
! |
154 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
155 |
updateChangeFileQuerySignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
156 |
"return the signal used as an upQuery if the changeFile should be updated. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
157 |
If unhandled, the value of UpdatingChanges is returned by the signals |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
158 |
static handler." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
159 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
160 |
^ UpdateChangeFileQuerySignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
161 |
|
362 | 162 |
! ! |
163 |
||
164 |
!Class class methodsFor:'accessing - flags'! |
|
165 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
166 |
catchMethodRedefinitions |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
167 |
"return the redefinition catching flag." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
168 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
169 |
^ CatchMethodRedefinitions |
556 | 170 |
! |
171 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
172 |
catchMethodRedefinitions:aBoolean |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
173 |
"turn on/off redefinition catching. Return the prior value of the flag." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
174 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
175 |
|prev| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
176 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
177 |
prev := CatchMethodRedefinitions. |
556 | 178 |
CatchMethodRedefinitions := aBoolean. |
179 |
^ prev |
|
180 |
! |
|
181 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
182 |
lockChangesFile |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
183 |
"return true, if the change file is locked during update" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
184 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
185 |
^ LockChangesFile |
555 | 186 |
! |
187 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
188 |
lockChangesFile:aBoolean |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
189 |
"turn on/off change-file-locking. Return the previous value of the flag." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
190 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
191 |
|prev| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
192 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
193 |
prev := LockChangesFile. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
194 |
LockChangesFile := aBoolean. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
195 |
^ prev |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
196 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
197 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
198 |
updateChanges:aBoolean |
555 | 199 |
"turn on/off changes management. Return the prior value of the flag." |
362 | 200 |
|
201 |
|prev| |
|
202 |
||
555 | 203 |
prev := UpdatingChanges. |
204 |
UpdatingChanges := aBoolean. |
|
362 | 205 |
^ prev |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
206 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
207 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
208 |
updatingChanges |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
209 |
"return true if changes are recorded" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
210 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
211 |
^ UpdatingChanges |
1 | 212 |
! ! |
213 |
||
193 | 214 |
!Class class methodsFor:'enumeration '! |
215 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
216 |
allClassesInCategory:aCategory do:aBlock |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
217 |
"evaluate aBlock for all classes in aCategory; |
193 | 218 |
no specific order is defined." |
219 |
||
199 | 220 |
Smalltalk allBehaviorsDo:[:aClass | |
193 | 221 |
aClass isMeta ifFalse:[ |
222 |
(aClass category = aCategory) ifTrue:[ |
|
223 |
aBlock value:aClass |
|
224 |
] |
|
225 |
]. |
|
226 |
] |
|
227 |
||
228 |
" |
|
229 |
Class allClassesInCategory:'Kernel-Classes' |
|
230 |
do:[:class |Transcript showCr:class name] |
|
231 |
" |
|
232 |
! |
|
233 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
234 |
allClassesInCategory:aCategory inOrderDo:aBlock |
193 | 235 |
"evaluate aBlock for all classes in aCategory; |
236 |
superclasses come first - then subclasses." |
|
237 |
||
238 |
|classes| |
|
239 |
||
240 |
classes := OrderedCollection new. |
|
199 | 241 |
Smalltalk allBehaviorsDo:[:aClass | |
193 | 242 |
aClass isMeta ifFalse:[ |
243 |
(aClass category = aCategory) ifTrue:[ |
|
244 |
classes add:aClass |
|
245 |
] |
|
246 |
] |
|
247 |
]. |
|
248 |
classes topologicalSort:[:a :b | b isSubclassOf:a]. |
|
249 |
classes do:aBlock |
|
250 |
! ! |
|
251 |
||
620 | 252 |
!Class class methodsFor:'helpers'! |
253 |
||
254 |
revisionInfoFromString:aString |
|
255 |
"return a dictionary filled with revision info. |
|
256 |
This extracts the relevant info from aString." |
|
257 |
||
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
258 |
|words info nm mgr| |
620 | 259 |
|
260 |
info := IdentityDictionary new. |
|
261 |
words := aString asCollectionOfWords. |
|
262 |
||
263 |
"/ |
|
264 |
"/ supported formats: |
|
265 |
"/ |
|
266 |
"/ $-Header: pathName rev date time user state $ |
|
267 |
"/ $-Revision: rev $ |
|
268 |
"/ $-Id: fileName rev date time user state $ |
|
269 |
"/ |
|
270 |
||
271 |
((words at:1) = '$Header:') ifTrue:[ |
|
272 |
nm := words at:2. |
|
273 |
info at:#repositoryPathName put:nm. |
|
274 |
(nm endsWith:',v') ifTrue:[ |
|
275 |
nm := nm copyWithoutLast:2 |
|
276 |
]. |
|
277 |
info at:#fileName put:nm asFilename baseName. |
|
278 |
info at:#revision put:(words at:3). |
|
279 |
info at:#date put:(words at:4). |
|
280 |
info at:#time put:(words at:5). |
|
281 |
info at:#user put:(words at:6). |
|
282 |
info at:#state put:(words at:7). |
|
283 |
^ info |
|
284 |
]. |
|
285 |
((words at:1) = '$Revision:') ifTrue:[ |
|
286 |
info at:#revision put:(words at:2). |
|
287 |
^ info |
|
288 |
]. |
|
289 |
((words at:1) = '$Id:') ifTrue:[ |
|
290 |
info at:#fileName put:(words at:2). |
|
291 |
info at:#revision put:(words at:3). |
|
292 |
info at:#date put:(words at:4). |
|
293 |
info at:#time put:(words at:5). |
|
294 |
info at:#user put:(words at:6). |
|
295 |
info at:#state put:(words at:7). |
|
296 |
^ info |
|
297 |
]. |
|
298 |
||
299 |
"/ |
|
300 |
"/ mhmh - maybe its some other source code system |
|
301 |
"/ |
|
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
302 |
(mgr := Smalltalk at:SourceCodeManager) notNil ifTrue:[ |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
303 |
^ mgr revisionInfoFromString:aString |
620 | 304 |
]. |
305 |
^ nil |
|
306 |
||
307 |
"Created: 15.11.1995 / 14:58:35 / cg" |
|
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
308 |
"Modified: 7.12.1995 / 13:21:40 / cg" |
620 | 309 |
! ! |
310 |
||
1 | 311 |
!Class methodsFor:'ST/V subclass creation'! |
312 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
313 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
37 | 314 |
"this method allows fileIn of ST/V classes |
1 | 315 |
(which seem to have no category)" |
316 |
||
317 |
^ self subclass:t |
|
153 | 318 |
instanceVariableNames:f |
319 |
classVariableNames:d |
|
320 |
poolDictionaries:s |
|
321 |
category:'ST/V classes' |
|
1 | 322 |
! |
323 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
324 |
variableByteSubclass:t classVariableNames:d poolDictionaries:s |
37 | 325 |
"this method allows fileIn of ST/V variable byte classes |
1 | 326 |
(which seem to have no category and no instvars)" |
327 |
||
328 |
^ self variableByteSubclass:t |
|
153 | 329 |
instanceVariableNames:'' |
330 |
classVariableNames:d |
|
331 |
poolDictionaries:s |
|
332 |
category:'ST/V classes' |
|
1 | 333 |
! |
334 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
335 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
37 | 336 |
"this method allows fileIn of ST/V variable pointer classes |
1 | 337 |
(which seem to have no category)" |
338 |
||
339 |
^ self variableSubclass:t |
|
153 | 340 |
instanceVariableNames:f |
341 |
classVariableNames:d |
|
342 |
poolDictionaries:s |
|
343 |
category:'ST/V classes' |
|
1 | 344 |
! ! |
345 |
||
346 |
!Class methodsFor:'accessing'! |
|
347 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
348 |
addClassVarName:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
349 |
"add a class variable if not already there and initialize it with nil. |
555 | 350 |
Also writes a change record and notifies dependents. |
351 |
BUG: Currently, no recompilation is done - this will change." |
|
352 |
||
353 |
(self classVarNames includes:aString) ifFalse:[ |
|
354 |
self classVariableString:(self classVariableString , ' ' , aString). |
|
355 |
self addChangeRecordForClass:self. |
|
356 |
self changed:#definition. |
|
357 |
] |
|
358 |
||
359 |
"Created: 29.10.1995 / 19:40:51 / cg" |
|
360 |
! |
|
361 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
362 |
allClassVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
363 |
"return a collection of all the class variable name-strings |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
364 |
this includes all superclass-class variables" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
365 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
366 |
^ self addAllClassVarNamesTo:(OrderedCollection new) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
367 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
368 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
369 |
Float allClassVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
370 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
371 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
372 |
|
686 | 373 |
binaryRevision |
374 |
"return the revision-ID from which the class was stc-compiled; |
|
375 |
nil if its an autoloaded or filedIn class. |
|
376 |
If a classes binary is up-to-date w.r.t. the source repository, |
|
377 |
the returned string is the same as the one returned by #revision." |
|
378 |
||
379 |
^ revision |
|
380 |
||
381 |
" |
|
382 |
Object binaryRevision |
|
383 |
" |
|
384 |
||
385 |
" |
|
386 |
to find all classes which are not up-to-date: |
|
387 |
||
388 |
|classes| |
|
389 |
||
390 |
classes := Smalltalk allClasses |
|
391 |
select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]]. |
|
392 |
SystemBrowser browseClasses:classes title:'classes which are not up-to-date' |
|
393 |
" |
|
394 |
||
395 |
"Created: 7.12.1995 / 10:58:47 / cg" |
|
396 |
! |
|
397 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
398 |
classFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
399 |
"return the name of the file from which the class was compiled. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
400 |
This is currently NOT used." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
401 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
402 |
^ classFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
403 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
404 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
405 |
classVarAt:aSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
406 |
"return the value of a class variable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
407 |
Currently, this returns nil if there is no such classvar - |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
408 |
this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
409 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
410 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
411 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
412 |
from the outside world. Currently, classvars are stored in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
413 |
the Smalltalk dictionary with a funny name, since there are |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
414 |
no classPools yet. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
415 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
416 |
^ Smalltalk at:(self name , ':' , aSymbol) asSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
417 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
418 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
419 |
classVarAt:aSymbol put:something |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
420 |
"store something in a classvariable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
421 |
Currently this creates a global with a funny name if no such |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
422 |
classVar exists - this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
423 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
424 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
425 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
426 |
from the outside world. Currently, classvars are stored in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
427 |
the Smalltalk dictionary with a funny name, since there are |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
428 |
no classPools yet. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
429 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
430 |
Smalltalk at:(self name , ':' , aSymbol) asSymbol put:something. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
431 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
432 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
433 |
classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
434 |
"return a collection of the class variable name-strings. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
435 |
Only names of class variables defined in this class are included |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
436 |
in the returned collection - use allClassVarNames, to get all known names." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
437 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
438 |
classvars isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
439 |
^ OrderedCollection new |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
440 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
441 |
^ classvars asCollectionOfWords |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
442 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
443 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
444 |
Object classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
445 |
Float classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
446 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
447 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
448 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
449 |
classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
450 |
"return a string of the class variables names. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
451 |
Only names of class variables defined in this class are in the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
452 |
returned string." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
453 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
454 |
classvars isNil ifTrue:[^ '']. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
455 |
^ classvars |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
456 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
457 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
458 |
Object classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
459 |
Float classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
460 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
461 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
462 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
463 |
classVariableString:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
464 |
"set the classes classvarnames string; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
465 |
Initialize new class variables with nil, clear and remove old ones. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
466 |
No change record is written and no classes are recompiled." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
467 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
468 |
|prevVarNames varNames any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
469 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
470 |
"ignore for metaclasses except the one" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
471 |
(self isMeta) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
472 |
(self == Metaclass) ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
473 |
^ self |
556 | 474 |
] |
475 |
]. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
476 |
(classvars = aString) ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
477 |
prevVarNames := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
478 |
classvars := aString. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
479 |
varNames := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
480 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
481 |
"new ones get initialized to nil; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
482 |
- old ones are nilled and removed from Smalltalk" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
483 |
any := false. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
484 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
485 |
varNames do:[:aName | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
486 |
(prevVarNames includes:aName) ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
487 |
"a new one" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
488 |
self classVarAt:aName put:nil. |
453 | 489 |
any := true. |
490 |
] ifTrue:[ |
|
491 |
prevVarNames remove:aName |
|
492 |
] |
|
493 |
]. |
|
494 |
"left overs are gone" |
|
495 |
prevVarNames do:[:aName | |
|
496 |
self classVarAt:aName put:nil. |
|
497 |
Smalltalk removeKey:(self name , ':' , aName) asSymbol. |
|
498 |
]. |
|
499 |
any ifTrue:[ |
|
500 |
Smalltalk changed:#classVariables with:self |
|
501 |
]. |
|
502 |
] |
|
503 |
! |
|
504 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
505 |
comment |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
506 |
"return the comment (aString) of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
507 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
508 |
|stream string| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
509 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
510 |
"the comment is either a string, or an integer specifying the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
511 |
position within the classes sourcefile ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
512 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
513 |
comment isNumber ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
514 |
classFilename notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
515 |
stream := self sourceStream. "/ Smalltalk sourceFileStreamFor:classFilename. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
516 |
stream notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
517 |
stream position:comment. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
518 |
string := String readFrom:stream onError:''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
519 |
stream close. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
520 |
^ string |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
521 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
522 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
523 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
524 |
^ comment |
555 | 525 |
|
526 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
527 |
Object comment |
555 | 528 |
" |
529 |
! |
|
530 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
531 |
comment:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
532 |
"set the comment of the class to be the argument, aString; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
533 |
create a change record and notify dependents." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
534 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
535 |
|oldComment| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
536 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
537 |
comment ~= aString ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
538 |
oldComment := self comment. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
539 |
comment := aString. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
540 |
self changed:#comment with:oldComment. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
541 |
self addChangeRecordForClassComment:self. |
555 | 542 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
543 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
544 |
"Created: 29.10.1995 / 19:41:24 / cg" |
555 | 545 |
! |
546 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
547 |
definition |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
548 |
"return an expression-string to define myself" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
549 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
550 |
|s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
551 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
552 |
s := WriteStream on:(String new). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
553 |
self fileOutDefinitionOn:s. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
554 |
^ s contents |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
555 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
556 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
557 |
Object definition |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
558 |
Point definition |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
559 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
560 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
561 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
562 |
history |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
563 |
"return the history of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
564 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
565 |
^ history |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
566 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
567 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
568 |
Object history |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
569 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
570 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
571 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
572 |
history:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
573 |
"set the history of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
574 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
575 |
history := aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
576 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
577 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
578 |
package |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
579 |
"return the package of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
580 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
581 |
^ package |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
582 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
583 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
584 |
Object package |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
585 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
586 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
587 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
588 |
package:aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
589 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
590 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
591 |
package := aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
592 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
593 |
|
662 | 594 |
packageSourceCodeInfo |
595 |
"return the sourceCodeInfo, which defines the module and the subdirectory |
|
596 |
in which the receiver class was built. |
|
597 |
This info is extracted from the package id (which is added to stc-compiled classes). |
|
598 |
This method is to be obsoleted soon, since the same info is now found |
|
599 |
in the versionString. |
|
600 |
||
601 |
The info returned consists of a dictionary |
|
602 |
filled with (at least) values at: #module, #directory and #library. |
|
603 |
If no such info is present in the class, nil is returned. |
|
604 |
(this happens with autoloaded and filed0in classes) |
|
605 |
||
606 |
By convention, this info is encoded in the classes package |
|
607 |
string (which is given as argument to stc) as the last word in parenthesis. |
|
608 |
The info consists of 1 to 3 subcomponents, separated by colons. |
|
609 |
The first defines the classes module (i.e. some application identifier), |
|
610 |
the second defines the subdirectory within that module, the third |
|
611 |
defines the name of the class library. |
|
612 |
If left blank, the module info defaults to 'stx', |
|
613 |
the directory info defaults to library name. |
|
614 |
The library name may not be left blank. |
|
615 |
(this is done for backward compatibility,) |
|
616 |
||
617 |
For example: |
|
618 |
'....(libbasic)' -> module: stx directory: libbasic library: libbasic |
|
619 |
'....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic |
|
620 |
'....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface |
|
621 |
'....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase |
|
622 |
||
623 |
The way how the sourceCodeManager uses this to find the source location |
|
624 |
depends on the scheme used. For CVS, the module is taken as the -d arg, |
|
625 |
while the directory is prepended to the file name. |
|
626 |
Other schemes may do things differently - these are not yet specified. |
|
627 |
||
628 |
Caveat: |
|
629 |
Encoding this info in the package string seems somewhat kludgy. |
|
630 |
" |
|
631 |
||
632 |
|sourceInfo packageString idx1 idx2 |
|
633 |
moduleString directoryString libraryString components| |
|
634 |
||
635 |
package isNil ifTrue:[^ nil]. |
|
636 |
||
637 |
packageString := package asString. |
|
638 |
idx1 := packageString lastIndexOf:$(. |
|
639 |
idx1 ~~ 0 ifTrue:[ |
|
640 |
idx2 := packageString indexOf:$) startingAt:idx1+1. |
|
641 |
idx2 ~~ 0 ifTrue:[ |
|
642 |
sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1 |
|
643 |
] |
|
644 |
]. |
|
645 |
sourceInfo isNil ifTrue:[^ nil]. |
|
646 |
components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:. |
|
647 |
components size == 0 ifTrue:[ |
|
648 |
moduleString := 'stx'. |
|
649 |
directoryString := libraryString := ''. |
|
650 |
^ nil |
|
651 |
] ifFalse:[ |
|
652 |
components size == 1 ifTrue:[ |
|
653 |
"/ a single name given - the module becomes 'stx', |
|
654 |
"/ if the component includes slashes, its the directory |
|
655 |
"/ otherwise the library |
|
656 |
"/ |
|
657 |
moduleString := 'stx'. |
|
658 |
directoryString := libraryString := components at:1. |
|
659 |
(libraryString includes:$/) ifTrue:[ |
|
660 |
libraryString := libraryString asFilename baseName |
|
661 |
] |
|
662 |
] ifFalse:[ |
|
663 |
components size == 2 ifTrue:[ |
|
664 |
"/ two components - assume its the directory and the library |
|
665 |
moduleString := 'stx'. |
|
666 |
directoryString := components at:1. |
|
667 |
libraryString := components at:2. |
|
668 |
] ifFalse:[ |
|
669 |
"/ all components given |
|
670 |
moduleString := components at:1. |
|
671 |
directoryString := components at:2. |
|
672 |
libraryString := components at:3. |
|
673 |
] |
|
674 |
] |
|
675 |
]. |
|
676 |
libraryString isEmpty ifTrue:[ |
|
677 |
directoryString notEmpty ifTrue:[ |
|
678 |
libraryString := directoryString asFilename baseName |
|
679 |
]. |
|
680 |
libraryString isEmpty ifTrue:[ |
|
681 |
"/ lets extract the library from the liblist file ... |
|
682 |
libraryString := Smalltalk libraryFileNameOfClass:self. |
|
683 |
libraryString isNil ifTrue:[^ nil]. |
|
684 |
] |
|
685 |
]. |
|
686 |
||
687 |
moduleString isEmpty ifTrue:[ |
|
688 |
moduleString := 'stx'. |
|
689 |
]. |
|
690 |
directoryString isEmpty ifTrue:[ |
|
691 |
directoryString := libraryString. |
|
692 |
]. |
|
693 |
||
694 |
^ IdentityDictionary |
|
695 |
with:(#module->moduleString) |
|
696 |
with:(#directory->directoryString) |
|
697 |
with:(#library->libraryString) |
|
698 |
||
699 |
" |
|
700 |
Object packageSourceCodeInfo |
|
701 |
View packageSourceCodeInfo |
|
702 |
Model packageSourceCodeInfo |
|
703 |
BinaryObjectStorage packageSourceCodeInfo |
|
704 |
MemoryMonitor packageSourceCodeInfo |
|
705 |
ClockView packageSourceCodeInfo |
|
706 |
" |
|
707 |
||
708 |
"Created: 4.11.1995 / 20:36:53 / cg" |
|
709 |
"Modified: 25.11.1995 / 18:29:31 / cg" |
|
710 |
! |
|
711 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
712 |
primitiveDefinitions:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
713 |
"set the primitiveDefinition string" |
555 | 714 |
|
715 |
self setPrimitiveSpecsAt:1 to:aString. |
|
716 |
self addChangeRecordForPrimitiveDefinitions:self. |
|
717 |
||
718 |
"Created: 29.10.1995 / 19:41:39 / cg" |
|
719 |
! |
|
720 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
721 |
primitiveDefinitionsString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
722 |
"return the primitiveDefinition string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
723 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
724 |
^ self getPrimitiveSpecsAt:1 |
555 | 725 |
|
726 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
727 |
Object primitiveDefinitionsString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
728 |
String primitiveDefinitionsString |
555 | 729 |
" |
730 |
! |
|
731 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
732 |
primitiveFunctions:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
733 |
"set the primitiveFunction string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
734 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
735 |
self setPrimitiveSpecsAt:3 to:aString. |
555 | 736 |
self addChangeRecordForPrimitiveFunctions:self. |
737 |
||
738 |
"Created: 29.10.1995 / 19:41:48 / cg" |
|
739 |
! |
|
740 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
741 |
primitiveFunctionsString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
742 |
"return the primitiveFunctions string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
743 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
744 |
^ self getPrimitiveSpecsAt:3 |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
745 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
746 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
747 |
primitiveSpec |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
748 |
"return the primitiveSpec or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
749 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
750 |
^ primitiveSpec |
555 | 751 |
! |
752 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
753 |
primitiveSpec:anArrayOf3ElementsOrNil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
754 |
"set the primitiveSpec or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
755 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
756 |
primitiveSpec := anArrayOf3ElementsOrNil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
757 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
758 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
759 |
primitiveVariables:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
760 |
"set the primitiveVariable string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
761 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
762 |
self setPrimitiveSpecsAt:2 to:aString. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
763 |
self addChangeRecordForPrimitiveVariables:self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
764 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
765 |
"Created: 29.10.1995 / 19:41:58 / cg" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
766 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
767 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
768 |
primitiveVariablesString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
769 |
"return the primitiveVariables string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
770 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
771 |
^ self getPrimitiveSpecsAt:2 |
555 | 772 |
! |
773 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
774 |
removeClassVarName:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
775 |
"remove a class variable if not already there. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
776 |
Also writes a change record and notifies dependents. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
777 |
BUG: Currently, no recompilation is done - this will change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
778 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
779 |
|names newNames| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
780 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
781 |
names := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
782 |
(names includes:aString) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
783 |
newNames := ''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
784 |
names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
785 |
self classVariableString:newNames withoutSpaces. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
786 |
self addChangeRecordForClass:self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
787 |
self changed:#definition. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
788 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
789 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
790 |
"Created: 29.10.1995 / 19:42:08 / cg" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
791 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
792 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
793 |
renameCategory:oldCategory to:newCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
794 |
"rename a category (changes category of those methods). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
795 |
Appends a change record and notifies dependents." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
796 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
797 |
|any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
798 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
799 |
any := false. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
800 |
methodArray do:[:aMethod | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
801 |
aMethod category = oldCategory ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
802 |
aMethod category:newCategory. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
803 |
any := true. |
555 | 804 |
] |
805 |
]. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
806 |
any ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
807 |
self addChangeRecordForRenameCategory:oldCategory to:newCategory. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
808 |
self changed:#methodCategory. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
809 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
810 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
811 |
"Created: 29.10.1995 / 19:42:15 / cg" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
812 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
813 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
814 |
revision |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
815 |
"return the revision-ID of the class which corresponds to the |
685
626b477e5be3
binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents:
671
diff
changeset
|
816 |
rcs-id of the source to which this class is equivalent. |
626b477e5be3
binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents:
671
diff
changeset
|
817 |
Initially, this is the same as #binaryRevision; however, once changes have |
626b477e5be3
binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents:
671
diff
changeset
|
818 |
been checked into a source repository, the binary continues to remain based upon |
626b477e5be3
binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents:
671
diff
changeset
|
819 |
the old revision, while logically, the class has the new (checked-in) revision. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
820 |
To check if a source corresponds to a compiled binary, compare this |
685
626b477e5be3
binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents:
671
diff
changeset
|
821 |
ID with the one returned by #binaryRevision." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
822 |
|
562 | 823 |
|info| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
824 |
|
562 | 825 |
info := self revisionInfo. |
826 |
info notNil ifTrue:[ |
|
827 |
^ info at:#revision |
|
556 | 828 |
]. |
685
626b477e5be3
binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents:
671
diff
changeset
|
829 |
^ revision |
453 | 830 |
|
831 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
832 |
Object revision |
453 | 833 |
" |
527
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
834 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
835 |
"Created: 11.11.1995 / 14:27:20 / cg" |
685
626b477e5be3
binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents:
671
diff
changeset
|
836 |
"Modified: 7.12.1995 / 10:54:53 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
837 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
838 |
|
722
921a95dee8f2
renamed #revision: to #setBinaryRevision (not for public use)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
839 |
setBinaryRevision:aString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
840 |
"set the revision-ID. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
841 |
This should normally not be done in the running system, as the source-manager |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
842 |
will need this to validate sourcefiles being correct for a given binary |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
843 |
(and optionally: extracting the required sourcefile from the rcs source)" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
844 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
845 |
revision := aString |
722
921a95dee8f2
renamed #revision: to #setBinaryRevision (not for public use)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
846 |
|
921a95dee8f2
renamed #revision: to #setBinaryRevision (not for public use)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
847 |
"Created: 9.12.1995 / 17:05:17 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
848 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
849 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
850 |
setClassFilename:aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
851 |
"set the classes filename. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
852 |
This is a dangerous (low level) operation, since the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
853 |
comment and primitiveSpecs may no longer be accessable, if a wrong filename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
854 |
is set here." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
855 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
856 |
classFilename := aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
857 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
858 |
"Modified: 8.9.1995 / 14:16:48 / claus" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
859 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
860 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
861 |
setClassVariableString:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
862 |
"set the classes classvarnames string. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
863 |
This is a dangerous (low level) operation, since the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
864 |
classvariables are not really created or updated. Also, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
865 |
NO change record is written." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
866 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
867 |
classvars := aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
868 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
869 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
870 |
setComment:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
871 |
"set the comment of the class to be the argument, aString; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
872 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
873 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
874 |
comment := aString |
1 | 875 |
! |
876 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
877 |
setComment:com category:categoryStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
878 |
"set the comment and category of the class; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
879 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
880 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
881 |
|cat| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
882 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
883 |
comment := com. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
884 |
categoryStringOrSymbol isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
885 |
cat := '' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
886 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
887 |
cat := categoryStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
888 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
889 |
category := cat asSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
890 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
891 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
892 |
setHistory:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
893 |
"set the history of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
894 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
895 |
history := aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
896 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
897 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
898 |
setPackage:aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
899 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
900 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
901 |
package := aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
902 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
903 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
904 |
sharedPools |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
905 |
"ST/X does not (currently) support pools" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
906 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
907 |
^ #() |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
908 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
909 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
910 |
source |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
911 |
"return the classes full source code" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
912 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
913 |
|code aStream| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
914 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
915 |
" this is too slow for big classes ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
916 |
code := String new:1000. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
917 |
aStream := WriteStream on:code. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
918 |
self fileOutOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
919 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
920 |
aStream := FileStream newFileNamed:'__temp'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
921 |
aStream isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
922 |
self notify:'cannot create temporary file.'. |
555 | 923 |
^ nil |
924 |
]. |
|
925 |
FileOutErrorSignal handle:[:ex | |
|
926 |
aStream nextPutAll:'"no source available"'. |
|
927 |
] do:[ |
|
928 |
self fileOutOn:aStream. |
|
929 |
]. |
|
930 |
aStream close. |
|
931 |
aStream := FileStream oldFileNamed:'__temp'. |
|
932 |
aStream isNil ifTrue:[ |
|
933 |
self notify:'oops - cannot reopen temp file'. |
|
934 |
^ nil |
|
935 |
]. |
|
936 |
code := aStream contents. |
|
937 |
aStream close. |
|
938 |
OperatingSystem removeFile:'__temp'. |
|
939 |
^ code |
|
385 | 940 |
! |
941 |
||
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
942 |
sourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
943 |
"return my source code manager. |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
944 |
For now, all classes return the same global manager. |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
945 |
But future versions may support mixed reporitories" |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
946 |
|
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
947 |
^ Smalltalk at:#SourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
948 |
|
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
949 |
"Created: 7.12.1995 / 13:16:46 / cg" |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
950 |
! |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
951 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
952 |
sourceStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
953 |
"return an open stream on my sourcefile, nil if that is not available" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
954 |
|
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
955 |
|source fileName aStream cls mgr| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
956 |
|
653 | 957 |
self isMeta ifTrue:[ |
958 |
cls := self soleInstance |
|
959 |
] ifFalse:[ |
|
960 |
cls := self |
|
961 |
]. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
962 |
classFilename notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
963 |
source := classFilename |
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
964 |
] ifFalse:[ |
524 | 965 |
source := (Smalltalk fileNameForClass:cls) , '.st' |
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
966 |
]. |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
967 |
|
625
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
968 |
"/ |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
969 |
"/ if there is no SourceCodeManager, look in |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
970 |
"/ standard places first |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
971 |
"/ |
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
972 |
(mgr := self sourceCodeManager) isNil ifTrue:[ |
625
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
973 |
fileName := Smalltalk getSourceFileName:source. |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
974 |
fileName notNil ifTrue:[ |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
975 |
aStream := fileName asFilename readStream. |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
976 |
] |
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
977 |
]. |
625
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
978 |
|
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
979 |
aStream isNil ifTrue:[ |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
980 |
"/ |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
981 |
"/ hard case - there is no source file for this class |
601
338404aae5ec
take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents:
600
diff
changeset
|
982 |
"/ (in the source-dir-path). |
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
983 |
"/ |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
984 |
|
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
985 |
"/ |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
986 |
"/ look if my binary is from a dynamically loaded module, |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
987 |
"/ and, if so, look in the modules directory for the |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
988 |
"/ source file. |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
989 |
"/ |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
990 |
ObjectFileLoader notNil ifTrue:[ |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
991 |
ObjectFileLoader loadedObjectHandlesDo:[:h | |
584 | 992 |
|f classes| |
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
993 |
|
524 | 994 |
aStream isNil ifTrue:[ |
584 | 995 |
(classes := h classes) notNil ifTrue:[ |
996 |
(classes includes:self) ifTrue:[ |
|
997 |
f := h pathName. |
|
998 |
f := f asFilename directory. |
|
999 |
f := f construct:source. |
|
1000 |
f exists ifTrue:[ |
|
1001 |
aStream := f readStream. |
|
1002 |
]. |
|
524 | 1003 |
]. |
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1004 |
]. |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1005 |
] |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1006 |
]. |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1007 |
]. |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1008 |
]. |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1009 |
|
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1010 |
aStream isNil ifTrue:[ |
524 | 1011 |
|
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1012 |
"/ mhmh - still no source file. |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1013 |
"/ If there is a SourceCodeManager, ask it to aquire the |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1014 |
"/ the source for my class, and return an open stream on it. |
625
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
1015 |
"/ if that one does not know about the source, look in |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
1016 |
"/ standard places |
524 | 1017 |
|
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1018 |
mgr notNil ifTrue:[ |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1019 |
aStream := mgr sourceStreamFor:cls. |
625
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
1020 |
aStream isNil ifTrue:[ |
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1021 |
fileName := Smalltalk getSourceFileName:cls name. |
625
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
1022 |
fileName notNil ifTrue:[ |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
1023 |
aStream := fileName asFilename readStream. |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
1024 |
] |
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
1025 |
]. |
601
338404aae5ec
take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents:
600
diff
changeset
|
1026 |
]. |
338404aae5ec
take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents:
600
diff
changeset
|
1027 |
|
338404aae5ec
take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents:
600
diff
changeset
|
1028 |
"/ |
338404aae5ec
take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents:
600
diff
changeset
|
1029 |
"/ final chance: try current directory |
338404aae5ec
take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents:
600
diff
changeset
|
1030 |
"/ |
338404aae5ec
take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents:
600
diff
changeset
|
1031 |
aStream isNil ifTrue:[ |
338404aae5ec
take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents:
600
diff
changeset
|
1032 |
aStream := source asFilename readStream. |
338404aae5ec
take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents:
600
diff
changeset
|
1033 |
]. |
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1034 |
]. |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1035 |
|
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1036 |
^ aStream |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1037 |
|
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1038 |
" |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1039 |
Object sourceStream |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1040 |
Clock sourceStream |
625
5f45ffc4cdd4
if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
1041 |
Autoload sourceStream |
523
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1042 |
" |
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1043 |
|
27e13690f124
sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1044 |
"Created: 10.11.1995 / 21:05:13 / cg" |
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1045 |
"Modified: 7.12.1995 / 13:21:16 / cg" |
1 | 1046 |
! ! |
1047 |
||
1048 |
!Class methodsFor:'adding/removing'! |
|
1049 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1050 |
addSelector:newSelector withMethod:newMethod |
68 | 1051 |
"add the method given by 2nd argument under the selector given by |
92 | 1052 |
1st argument to the methodDictionary. |
153 | 1053 |
Append a change record to the changes file and tell dependents." |
1 | 1054 |
|
362 | 1055 |
|oldMethod| |
1056 |
||
1057 |
CatchMethodRedefinitions ifTrue:[ |
|
1058 |
"check for attempts to redefine a method |
|
1059 |
in a different package. Signal a resumable error if so. |
|
1060 |
This allows tracing redefinitions of existing system methods |
|
1061 |
when filing in alien code .... |
|
1062 |
(which we may want to forbit sometimes) |
|
1063 |
" |
|
1064 |
oldMethod := self compiledMethodAt:newSelector. |
|
1065 |
oldMethod notNil ifTrue:[ |
|
1066 |
oldMethod package ~= newMethod package ifTrue:[ |
|
1067 |
" |
|
1068 |
attempt to redefine an existing method, which was |
|
1069 |
defined in another package. |
|
1070 |
If you continue in the debugger, the new method gets installed. |
|
1071 |
Otherwise, the existing (old) method remains valid. |
|
1072 |
||
1073 |
You can turn of the catching of redefinitions by setting |
|
1074 |
CatchMethodRedefinitions to false |
|
1075 |
(also found in the NewLaunchers 'settings-misc' menu) |
|
1076 |
" |
|
406 | 1077 |
MethodRedefinitionSignal |
1078 |
raiseErrorString:(' ' , name , '>>' , newSelector) |
|
362 | 1079 |
] |
1080 |
] |
|
1081 |
]. |
|
92 | 1082 |
(super addSelector:newSelector withMethod:newMethod) ifTrue:[ |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1083 |
self addChangeRecordForMethod:newMethod. |
92 | 1084 |
] |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1085 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1086 |
"Created: 29.10.1995 / 19:42:42 / cg" |
1 | 1087 |
! |
1088 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1089 |
removeSelector:aSelector |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1090 |
"remove the selector, aSelector and its associated method |
92 | 1091 |
from the methodDictionary. |
153 | 1092 |
Append a change record to the changes file and tell dependents." |
1 | 1093 |
|
92 | 1094 |
(super removeSelector:aSelector) ifTrue:[ |
153 | 1095 |
self addChangeRecordForRemoveSelector:aSelector. |
1096 |
self changed:#methodDictionary with:aSelector. |
|
1 | 1097 |
] |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1098 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1099 |
"Created: 29.10.1995 / 19:42:47 / cg" |
216 | 1100 |
! |
1101 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1102 |
unload |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1103 |
"if the receiver was autoloaded, unload and reinstall it as |
293 | 1104 |
autoloaded. Can be used to get rid of no longer needed autoloaded |
328 | 1105 |
classes. |
1106 |
(maybe, autoloaded classes should unload themselfes when no |
|
1107 |
longer needed - for example, after some delay when the last instance |
|
1108 |
is gone ...)" |
|
293 | 1109 |
|
1110 |
|nm| |
|
1111 |
||
216 | 1112 |
self wasAutoloaded ifFalse:[ |
1113 |
||
1114 |
" |
|
1115 |
can it be done ? |
|
1116 |
" |
|
1117 |
self methodArray do:[:aMethod | |
|
1118 |
aMethod source isNil ifTrue:[^false]. |
|
1119 |
aMethod hasPrimitiveCode ifTrue:[^ false]. |
|
1120 |
]. |
|
1121 |
]. |
|
1122 |
||
283 | 1123 |
self allSubclassesDo:[:aClass | |
1124 |
aClass unload |
|
1125 |
]. |
|
1126 |
Transcript showCr:'unloading ' , name. |
|
1127 |
||
359 | 1128 |
Autoload removeClass:self. |
293 | 1129 |
nm := name. |
1130 |
Smalltalk at:nm put:nil. |
|
1131 |
name := nm , ' (leftover)'. |
|
288 | 1132 |
ObjectMemory flushInlineCaches. |
1133 |
ObjectMemory flushMethodCache. |
|
293 | 1134 |
Autoload addClass:nm inCategory:category. |
216 | 1135 |
^ true |
1136 |
||
1137 |
" |
|
1138 |
Clock open. |
|
1139 |
Clock unload. |
|
1140 |
ClockView unload. |
|
1141 |
Clock open |
|
1142 |
" |
|
1 | 1143 |
! ! |
1144 |
||
453 | 1145 |
!Class methodsFor:'binary storage'! |
1146 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1147 |
addGlobalsTo: globalDictionary manager: manager |
453 | 1148 |
" |
1149 |
classPool == nil ifFalse: [ |
|
1150 |
classPool associationsDo: [:assoc| |
|
1151 |
globalDictionary at: assoc put: self |
|
1152 |
] |
|
1153 |
] |
|
1154 |
" |
|
1155 |
! |
|
1156 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1157 |
storeBinaryDefinitionOf: anAssociation on: stream manager: manager |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1158 |
"not usable at the moment - there are no classpools currently" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1159 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1160 |
| string | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1161 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1162 |
string := self name, ' classPool at: ', anAssociation key storeString. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1163 |
stream nextNumber: 2 put: string size. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1164 |
string do: [:char| stream nextPut: char asciiValue] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1165 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1166 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1167 |
storeBinaryDefinitionOn: stream manager: manager |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1168 |
"classes will store the name, signature and instvar names. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1169 |
They restore by looking for that name in the Smalltalk dictionary. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1170 |
However, using the signature, a check for being valid is made at |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1171 |
restore time." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1172 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1173 |
|varnames n sz| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1174 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1175 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1176 |
output the signature |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1177 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1178 |
stream nextNumber:4 put:self signature. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1179 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1180 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1181 |
output the instance variable name string |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1182 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1183 |
varnames := self allInstVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1184 |
n := varnames size. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1185 |
n == 0 ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1186 |
sz := 0 |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1187 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1188 |
sz := varnames inject:0 into:[:sum :nm | sum + nm size]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1189 |
sz := sz + n - 1. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1190 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1191 |
stream nextNumber:2 put:sz. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1192 |
varnames keysAndValuesDo:[:i :nm | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1193 |
nm do:[:c | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1194 |
stream nextPut:c asciiValue |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1195 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1196 |
i ~~ n ifTrue:[stream nextPut:(Character space asciiValue)] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1197 |
]. |
453 | 1198 |
|
1199 |
" |
|
1200 |
output my name |
|
1201 |
" |
|
1202 |
stream nextNumber:2 put:name size. |
|
1203 |
name do:[:c| |
|
1204 |
stream nextPut:c asciiValue |
|
1205 |
] |
|
1206 |
||
1207 |
" |
|
1208 |
|s| |
|
1209 |
s := WriteStream on:ByteArray new. |
|
1210 |
Rectangle storeBinaryOn:s. |
|
1211 |
Object readBinaryFrom:(ReadStream on:s contents) |
|
1212 |
" |
|
1213 |
! ! |
|
1214 |
||
1215 |
!Class methodsFor:'c function interfacing'! |
|
1216 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1217 |
cInterfaceFunction:selector calling:cFunctionNameString args:argTypeArray returning:returnType |
453 | 1218 |
"create an interface to an existing (i.e. already linked in) c function. |
1219 |
The function can be called by sending selector to the receiver class. |
|
1220 |
The c-function has the name cFunctionNameString, and expects parameters as specified in |
|
1221 |
argTypeArray. The functions return value has a type as specified by returnType. |
|
1222 |
WARNING: |
|
1223 |
this interface is EXPERIMENTAL - it may change or even be removed." |
|
1224 |
||
1225 |
StubGenerator isNil ifTrue:[ |
|
1226 |
^ self error:'this system does not support dynamic C Interface functions'. |
|
1227 |
]. |
|
1228 |
||
1229 |
StubGenerator |
|
1230 |
createStubFor:selector |
|
1231 |
calling:cFunctionNameString |
|
1232 |
args:argTypeArray |
|
1233 |
returning:returnType |
|
1234 |
in:self |
|
1235 |
||
1236 |
" |
|
1237 |
Object subclass:#CInterface |
|
1238 |
instanceVariableNames:'' |
|
1239 |
classVariableNames:'' |
|
1240 |
poolDictionaries:'' |
|
1241 |
category:'Examples'. |
|
1242 |
||
1243 |
CInterface cInterfaceFunction:#printfOn:format:withFloat: |
|
1244 |
calling:'fprintf' |
|
1245 |
args:#(ExternalStream String Float) |
|
1246 |
returning:#SmallInteger. |
|
1247 |
||
1248 |
CInterface printfOn:Stdout format:'this is a float: %g' withFloat:(Float pi). Stdout cr |
|
1249 |
" |
|
1250 |
! ! |
|
1251 |
||
1 | 1252 |
!Class methodsFor:'changes management'! |
1253 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1254 |
addChangeRecordForChangeCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1255 |
"add a category change record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1256 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1257 |
self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1258 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1259 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1260 |
addChangeRecordForChangeCategory:category to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1261 |
"append a category change record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1262 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1263 |
self printClassNameOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1264 |
aStream nextPutAll:(' category:' , category storeString). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1265 |
aStream nextPutChunkSeparator. |
663 | 1266 |
|
1267 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1268 |
Project notNil ifTrue:[ |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1269 |
Project addClassDefinitionChangeFor:self |
663 | 1270 |
] |
1271 |
||
1272 |
"Created: 3.12.1995 / 13:43:33 / cg" |
|
1273 |
"Modified: 3.12.1995 / 14:10:34 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1274 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1275 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1276 |
addChangeRecordForClass:aClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1277 |
"add a class-definition-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1278 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1279 |
self writingChangePerform:#addChangeRecordForClass:to: with:aClass. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1280 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1281 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1282 |
addChangeRecordForClass:aClass to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1283 |
"append a class-definition-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1284 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1285 |
aClass isLoaded ifTrue:[ |
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1286 |
aClass fileOutDefinitionOn:aStream. |
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1287 |
aStream nextPutChunkSeparator. |
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1288 |
Project notNil ifTrue:[ |
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1289 |
Project addClassDefinitionChangeFor:aClass |
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1290 |
] |
555 | 1291 |
] |
663 | 1292 |
|
1293 |
"Created: 3.12.1995 / 13:57:44 / cg" |
|
1294 |
"Modified: 3.12.1995 / 14:11:26 / cg" |
|
555 | 1295 |
! |
1296 |
||
620 | 1297 |
addChangeRecordForClassCheckIn:aClass |
1298 |
"append a class-was-checkedIn-record to the changes file" |
|
1299 |
||
708
ba92b2a8477d
include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents:
707
diff
changeset
|
1300 |
self addInfoRecord:('checkin ' , aClass name , ' (' , aClass revision , ')') |
620 | 1301 |
|
1302 |
"Created: 18.11.1995 / 17:04:58 / cg" |
|
708
ba92b2a8477d
include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents:
707
diff
changeset
|
1303 |
"Modified: 7.12.1995 / 23:45:01 / cg" |
620 | 1304 |
! |
1305 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1306 |
addChangeRecordForClassComment:aClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1307 |
"add a class-comment-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1308 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1309 |
self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1310 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1311 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1312 |
addChangeRecordForClassComment:aClass to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1313 |
"append a class-comment-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1314 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1315 |
aClass fileOutCommentOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1316 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1317 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1318 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1319 |
addChangeRecordForClassFileOut:aClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1320 |
"append a class-was-filedOut-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1321 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1322 |
self addInfoRecord:('fileOut ' , aClass name) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1323 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1324 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1325 |
addChangeRecordForClassInstvars:aClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1326 |
"add a class-instvars-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1327 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1328 |
self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1329 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1330 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1331 |
addChangeRecordForClassInstvars:aClass to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1332 |
"append a class-instvars-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1333 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1334 |
aClass fileOutClassInstVarDefinitionOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1335 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1336 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1337 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1338 |
addChangeRecordForClassRemove:oldName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1339 |
"add a class-remove-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1340 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1341 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1342 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1343 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1344 |
addChangeRecordForClassRemove:oldName to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1345 |
"append a class-remove-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1346 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1347 |
aStream nextPutAll:('Smalltalk removeClass:' , oldName). |
555 | 1348 |
aStream nextPutChunkSeparator. |
1349 |
! |
|
1350 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1351 |
addChangeRecordForClassRename:oldName to:newName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1352 |
"add a class-rename-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1353 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1354 |
self writingChangeDo:[:aStream | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1355 |
self addChangeRecordForClassRename:oldName to:newName to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1356 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1357 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1358 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1359 |
addChangeRecordForClassRename:oldName to:newName to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1360 |
"append a class-rename-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1361 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1362 |
aStream nextPutAll:('Smalltalk renameClass:' , oldName , ' to:''' , newName , ''''). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1363 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1364 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1365 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1366 |
addChangeRecordForMethod:aMethod |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1367 |
"add a method-change-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1368 |
|
669
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1369 |
(UpdateChangeFileQuerySignal raise) ifTrue:[ |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1370 |
self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1371 |
"this test allows a smalltalk without Projects/ChangeSets" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1372 |
Project notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1373 |
Project addMethodChange:aMethod in:self |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1374 |
] |
555 | 1375 |
] |
1376 |
! |
|
1377 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1378 |
addChangeRecordForMethod:aMethod to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1379 |
"append a method-change-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1380 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1381 |
self fileOutMethod:aMethod on:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1382 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1383 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1384 |
addChangeRecordForMethodCategory:aMethod category:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1385 |
"add a methodCategory-change-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1386 |
|
669
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1387 |
(UpdateChangeFileQuerySignal raise) ifTrue:[ |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1388 |
self writingChangeDo:[:aStream | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1389 |
self addChangeRecordForMethodCategory:aMethod category:aString to:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1390 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1391 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1392 |
"this test allows a smalltalk without Projects/ChangeSets" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1393 |
Project notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1394 |
Project addMethodCategoryChange:aMethod category:aString in:self |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1395 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1396 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1397 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1398 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1399 |
addChangeRecordForMethodCategory:aMethod category:newCategory to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1400 |
"append a methodCategory-change-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1401 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1402 |
|selector| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1403 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1404 |
selector := aMethod selector. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1405 |
selector notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1406 |
aStream nextPutAll:'('. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1407 |
self printClassNameOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1408 |
aStream nextPutAll:(' compiledMethodAt:' , selector storeString). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1409 |
aStream nextPutAll:(') category:' , newCategory storeString). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1410 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1411 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1412 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1413 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1414 |
addChangeRecordForMethodPrivacy:aMethod |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1415 |
"add a method-privacy-change-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1416 |
|
669
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1417 |
(UpdateChangeFileQuerySignal raise) ifTrue:[ |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1418 |
self writingChangePerform:#addChangeRecordForMethodPrivacy:to: with:aMethod. |
555 | 1419 |
"this test allows a smalltalk without Projects/ChangeSets" |
1420 |
Project notNil ifTrue:[ |
|
1421 |
Project addMethodPrivacyChange:aMethod in:self |
|
1422 |
] |
|
1423 |
] |
|
1424 |
||
1425 |
"Modified: 27.8.1995 / 22:47:32 / claus" |
|
1426 |
! |
|
1427 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1428 |
addChangeRecordForMethodPrivacy:aMethod to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1429 |
"append a method-privacy-change-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1430 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1431 |
|selector| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1432 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1433 |
selector := aMethod selector. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1434 |
selector notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1435 |
aStream nextPutAll:'('. |
555 | 1436 |
self printClassNameOn:aStream. |
1437 |
aStream nextPutAll:(' compiledMethodAt:' , selector storeString). |
|
1438 |
aStream nextPutAll:(') privacy:' , aMethod privacy storeString). |
|
1439 |
aStream nextPutChunkSeparator. |
|
1440 |
] |
|
1441 |
||
1442 |
"Modified: 27.8.1995 / 22:59:56 / claus" |
|
1443 |
! |
|
1444 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1445 |
addChangeRecordForPrimitiveDefinitions:aClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1446 |
"add a primitiveDefinitions-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1447 |
|
669
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1448 |
(UpdateChangeFileQuerySignal raise) ifTrue:[ |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1449 |
self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass. |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1450 |
Project notNil ifTrue:[ |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1451 |
Project addPrimitiveDefinitionsChangeFor:aClass |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1452 |
] |
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1453 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1454 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1455 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1456 |
addChangeRecordForPrimitiveDefinitions:aClass to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1457 |
"append a primitiveDefinitions-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1458 |
|
667
3b1e83ecf6d5
save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1459 |
aStream nextPutAll:aClass name; nextPutAll:' primitiveDefinitions:'''; cr; |
3b1e83ecf6d5
save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1460 |
nextPutAll:(aClass primitiveDefinitionsString storeString copyFrom:2). |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1461 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1462 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1463 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1464 |
addChangeRecordForPrimitiveFunctions:aClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1465 |
"add a primitiveFunctions-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1466 |
|
669
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1467 |
(UpdateChangeFileQuerySignal raise) ifTrue:[ |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1468 |
self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass. |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1469 |
Project notNil ifTrue:[ |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1470 |
Project addPrimitiveFunctionsChangeFor:aClass |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1471 |
] |
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1472 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1473 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1474 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1475 |
addChangeRecordForPrimitiveFunctions:aClass to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1476 |
"append a primitiveFunctions-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1477 |
|
667
3b1e83ecf6d5
save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1478 |
aStream nextPutAll:aClass name; nextPutAll:' primitiveFunctions:'''; cr; |
3b1e83ecf6d5
save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1479 |
nextPutAll:(aClass primitiveFunctionsString storeString copyFrom:2). |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1480 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1481 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1482 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1483 |
addChangeRecordForPrimitiveVariables:aClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1484 |
"add a primitiveVariables-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1485 |
|
669
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1486 |
(UpdateChangeFileQuerySignal raise) ifTrue:[ |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1487 |
self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass. |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1488 |
Project notNil ifTrue:[ |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1489 |
Project addPrimitiveVariablesChangeFor:aClass |
62784300daa6
oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1490 |
] |
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1491 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1492 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1493 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1494 |
addChangeRecordForPrimitiveVariables:aClass to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1495 |
"append a primitiveVariables-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1496 |
|
667
3b1e83ecf6d5
save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1497 |
aStream nextPutAll:aClass name; nextPutAll:' primitiveVariables:'''; cr; |
3b1e83ecf6d5
save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1498 |
nextPutAll:(aClass primitiveVariablesString storeString copyFrom:2). |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1499 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1500 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1501 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1502 |
addChangeRecordForRemoveSelector:aSelector |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1503 |
"add a method-remove-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1504 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1505 |
self writingChangePerform:#addChangeRecordForRemoveSelector:to: with:aSelector. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1506 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1507 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1508 |
addChangeRecordForRemoveSelector:aSelector to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1509 |
"append a method-remove-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1510 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1511 |
self printClassNameOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1512 |
aStream nextPutAll:(' removeSelector:#' , aSelector). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1513 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1514 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1515 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1516 |
addChangeRecordForRenameCategory:oldCategory to:newCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1517 |
"add a category-rename record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1518 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1519 |
self writingChangeDo:[:aStream | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1520 |
self addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream. |
555 | 1521 |
] |
1522 |
! |
|
1523 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1524 |
addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1525 |
"append a category-rename record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1526 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1527 |
self printClassNameOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1528 |
aStream nextPutAll:(' renameCategory:' , oldCategory storeString). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1529 |
aStream nextPutAll:(' to:' , newCategory storeString). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1530 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1531 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1532 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1533 |
addChangeRecordForSnapshot:aFileName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1534 |
"add a snapshot-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1535 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1536 |
self addInfoRecord:('snapshot ' , aFileName) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1537 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1538 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1539 |
addChangeRecordForSnapshot:aFileName to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1540 |
"add a snapshot-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1541 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1542 |
self addInfoRecord:('snapshot ' , aFileName) to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1543 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1544 |
|
620 | 1545 |
addChangeTimeStampTo:aStream |
1546 |
"a timestamp - prepended to any change, except infoRecords" |
|
1547 |
||
1548 |
|info| |
|
1549 |
||
1550 |
info := 'timestamp ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName. |
|
1551 |
self addInfoRecord:info to:aStream. aStream cr. |
|
1552 |
||
1553 |
"Created: 18.11.1995 / 15:41:01 / cg" |
|
1554 |
! |
|
1555 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1556 |
addInfoRecord:aMessage |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1557 |
"add an info-record (snapshot, class fileOut etc.) to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1558 |
|
576
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1559 |
self writingChangeWithTimeStamp:false perform:#addInfoRecord:to: with:aMessage. |
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1560 |
|
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1561 |
"Modified: 18.11.1995 / 15:45:10 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1562 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1563 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1564 |
addInfoRecord:aMessage to:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1565 |
"append an info-record (snapshot, class fileOut etc.) to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1566 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1567 |
aStream nextPutAll:('''---- ' , aMessage , ' ', |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1568 |
Date today printString , ' ' , |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1569 |
Time now printString , |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1570 |
' ----'''). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1571 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1572 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1573 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1574 |
changesStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1575 |
"return a Stream for the writing changes file - or nil if no update is wanted" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1576 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1577 |
|streamType aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1578 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1579 |
(UpdateChangeFileQuerySignal raise) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1580 |
fileName := ObjectMemory nameForChanges. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1581 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1582 |
LockChangesFile ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1583 |
streamType := LockedFileStream. |
488
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
1584 |
] ifFalse:[ |
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
1585 |
streamType := FileStream. |
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
1586 |
]. |
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
1587 |
aStream := streamType oldFileNamed:fileName. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1588 |
aStream isNil ifTrue:[ |
488
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
1589 |
aStream := streamType newFileNamed:fileName. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1590 |
aStream isNil ifTrue:[ |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1591 |
self warn:'cannot create/update the changes file'. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1592 |
^ nil |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1593 |
] |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1594 |
]. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1595 |
aStream setToEnd |
92 | 1596 |
]. |
1597 |
^ aStream |
|
453 | 1598 |
|
1599 |
"Created: 28.10.1995 / 16:53:43 / cg" |
|
1600 |
"Modified: 28.10.1995 / 16:55:03 / cg" |
|
92 | 1601 |
! |
1602 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1603 |
sourcesStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1604 |
"return a stream for writing the sources file. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1605 |
Notice, in ST/X, it is noncommon to use a single |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1606 |
source file; typically each classes source is kept |
555 | 1607 |
in a separate file." |
1608 |
||
1609 |
|aStream fileName| |
|
1610 |
||
1611 |
fileName := ObjectMemory nameForSources. |
|
1612 |
aStream := FileStream oldFileNamed:fileName. |
|
1613 |
aStream isNil ifTrue:[ |
|
1614 |
aStream := FileStream newFileNamed:fileName. |
|
1615 |
aStream isNil ifTrue:[ |
|
1616 |
Transcript showCr:'cannot update sources file'. |
|
1617 |
^ nil |
|
1618 |
] |
|
1619 |
]. |
|
1620 |
aStream setToEnd. |
|
1621 |
^ aStream |
|
1622 |
||
1623 |
"Created: 28.10.1995 / 16:53:17 / cg" |
|
1624 |
! |
|
1625 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1626 |
withoutUpdatingChangesDo:aBlock |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1627 |
"turn off change file update while evaluating aBlock. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1628 |
This method makes sure, that the update-flag is correctly restored |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1629 |
in case of an abort or other error." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1630 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1631 |
UpdateChangeFileQuerySignal handle:[:ex | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1632 |
ex proceedWith:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1633 |
] do:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1634 |
aBlock value |
555 | 1635 |
]. |
556 | 1636 |
! |
1637 |
||
620 | 1638 |
writingChangeDo:aBlock |
1639 |
"common helper to write a change record. |
|
1640 |
Opens the changefile and executes aBlock passing the stream |
|
1641 |
as argument. WriteErrors are cought and will lead to a warning. |
|
1642 |
The changefile is not kept open, to force the change to go to disk |
|
1643 |
as soon as possible - thus, in case of a crash, no changes should |
|
1644 |
be lost due to buffering." |
|
1645 |
||
1646 |
self writingChangeWithTimeStamp:true do:aBlock |
|
1647 |
||
1648 |
"Modified: 18.11.1995 / 15:43:36 / cg" |
|
1649 |
! |
|
1650 |
||
1651 |
writingChangePerform:aSelector with:anArgument |
|
1652 |
self writingChangeWithTimeStamp:true perform:aSelector with:anArgument |
|
1653 |
||
1654 |
"Created: 28.10.1995 / 16:50:48 / cg" |
|
1655 |
"Modified: 18.11.1995 / 15:44:53 / cg" |
|
1656 |
! |
|
1657 |
||
576
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1658 |
writingChangeWithTimeStamp:doStampIt do:aBlock |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1659 |
"common helper to write a change record. |
155 | 1660 |
Opens the changefile and executes aBlock passing the stream |
168 | 1661 |
as argument. WriteErrors are cought and will lead to a warning. |
1662 |
The changefile is not kept open, to force the change to go to disk |
|
1663 |
as soon as possible - thus, in case of a crash, no changes should |
|
1664 |
be lost due to buffering." |
|
1 | 1665 |
|
139 | 1666 |
|aStream| |
1 | 1667 |
|
1668 |
aStream := self changesStream. |
|
1669 |
aStream notNil ifTrue:[ |
|
155 | 1670 |
FileStream writeErrorSignal handle:[:ex | |
355 | 1671 |
self warn:('could not update the changes-file\\' , ex errorString) withCRs. |
155 | 1672 |
ex return |
1673 |
] do:[ |
|
576
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1674 |
doStampIt ifTrue:[self addChangeTimeStampTo:aStream]. |
199 | 1675 |
aBlock value:aStream. |
1676 |
aStream cr. |
|
155 | 1677 |
]. |
1678 |
aStream close |
|
1679 |
] |
|
576
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1680 |
|
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1681 |
"Created: 18.11.1995 / 15:36:02 / cg" |
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1682 |
! |
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1683 |
|
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1684 |
writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument |
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1685 |
self writingChangeWithTimeStamp:stampIt do:[:stream | |
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1686 |
self perform:aSelector with:anArgument with:stream. |
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1687 |
] |
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1688 |
|
b9f067c9814c
change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents:
562
diff
changeset
|
1689 |
"Created: 18.11.1995 / 15:44:28 / cg" |
1 | 1690 |
! ! |
1691 |
||
1692 |
!Class methodsFor:'compiling'! |
|
1693 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1694 |
compile:code |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1695 |
"compile code, aString for this class; |
671 | 1696 |
if successful update the method dictionary." |
328 | 1697 |
|
1698 |
self compilerClass |
|
1699 |
compile:code |
|
1700 |
forClass:self |
|
1701 |
! |
|
1702 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1703 |
compile:code classified:category |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1704 |
"compile code, aString for this class; |
671 | 1705 |
if successful update the method dictionary. |
328 | 1706 |
The method is classified under category." |
1707 |
||
1708 |
self compilerClass |
|
1709 |
compile:code |
|
1710 |
forClass:self |
|
1711 |
inCategory:category |
|
1 | 1712 |
! |
1713 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1714 |
compile:code notifying:requestor |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1715 |
"compile code, aString for this class; on any error, notify |
328 | 1716 |
requestor, anObject with the error reason." |
1717 |
||
1718 |
self compilerClass |
|
1719 |
compile:code |
|
1720 |
forClass:self |
|
1721 |
notifying:requestor |
|
1 | 1722 |
! |
1723 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1724 |
recompile |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1725 |
"recompile all methods |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1726 |
used when a class changes instances and therefore all methods |
555 | 1727 |
have to be recompiled" |
2 | 1728 |
|
92 | 1729 |
selectorArray do:[:aSelector | |
555 | 1730 |
self recompile:aSelector |
2 | 1731 |
] |
1732 |
! |
|
1733 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1734 |
recompile:aSelector |
1 | 1735 |
"recompile the method associated with the argument, aSelector; |
1736 |
used when a superclass changes instances and we have to recompile |
|
1737 |
subclasses" |
|
1738 |
||
199 | 1739 |
|cat code| |
1 | 1740 |
|
199 | 1741 |
Class withoutUpdatingChangesDo:[ |
362 | 1742 |
Class methodRedefinitionSignal handle:[:ex | |
1743 |
ex proceed |
|
1744 |
] do:[ |
|
1745 |
cat := (self compiledMethodAt:aSelector) category. |
|
1746 |
code := self sourceCodeAt:aSelector. |
|
1747 |
self compilerClass compile:code forClass:self inCategory:cat |
|
1748 |
] |
|
2 | 1749 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1750 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1751 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1752 |
recompileAll |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1753 |
"recompile this class and all subclasses" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1754 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1755 |
|classes| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1756 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1757 |
classes := self subclasses. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1758 |
self recompile. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1759 |
classes do:[:aClass | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1760 |
aClass recompileAll |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1761 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1762 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1763 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1764 |
recompileInvalidatedMethods:trap |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1765 |
"recompile all invalidated methods" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1766 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1767 |
|trapCode trapByteCode| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1768 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1769 |
trapCode := trap code. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1770 |
trapByteCode := trap byteCode. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1771 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1772 |
selectorArray do:[:aSelector | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1773 |
|m| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1774 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1775 |
m := self compiledMethodAt:aSelector. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1776 |
((m code = trapCode) and:[m byteCode == trapByteCode]) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1777 |
self recompile:aSelector |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1778 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1779 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1780 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1781 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1782 |
recompileMethodsAccessingAny:setOfNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1783 |
"recompile all methods accessing a variable from setOfNames" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1784 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1785 |
self recompileMethodsAccessingAny:setOfNames orSuper:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1786 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1787 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1788 |
recompileMethodsAccessingAny:setOfNames orSuper:superBoolean |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1789 |
"recompile all methods accessing a variable from setOfNames, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1790 |
or super (if superBoolean is true)" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1791 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1792 |
|p| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1793 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1794 |
selectorArray do:[:aSelector | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1795 |
|m| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1796 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1797 |
m := self compiledMethodAt:aSelector. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1798 |
p := Parser parseMethod:(m source) in:self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1799 |
(p isNil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1800 |
or:[(p usedVars notNil and:[p usedVars includesAny:setOfNames]) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1801 |
or:[superBoolean and:[p usesSuper]]]) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1802 |
self recompile:aSelector |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1803 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1804 |
] |
1 | 1805 |
! ! |
1806 |
||
1807 |
!Class methodsFor:'fileIn interface'! |
|
1808 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1809 |
ignoredMethodsFor:aCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1810 |
"this is a speciality of ST/X - it allows quick commenting of methods |
555 | 1811 |
from a source-file by replacing the 'methodsFor:' by 'ignoredMethodsFor'. |
1812 |
Returns a ClassCategoryReader to read in and skip methods." |
|
1813 |
||
1814 |
^ ClassCategoryReader skippingChunks |
|
1815 |
! |
|
1816 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1817 |
methods |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1818 |
"this method allows fileIn of ST/V methods - |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1819 |
return a ClassCategoryReader to read in and compile methods for me." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1820 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1821 |
^ ClassCategoryReader class:self category:'ST/V methods' |
555 | 1822 |
! |
1823 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1824 |
methodsFor:aCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1825 |
"return a ClassCategoryReader to read in and compile methods for me. |
10 | 1826 |
This one actually creates the ClassReader when code is filed-in." |
1 | 1827 |
|
1828 |
^ ClassCategoryReader class:self category:aCategory |
|
1829 |
! |
|
1830 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1831 |
methodsForUndefined:categoryString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1832 |
"ST-80 compatibility. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1833 |
I dont yet know what this does - it was encountered by some tester. |
555 | 1834 |
For now, simply forward it." |
1835 |
||
1836 |
^ self methodsFor:categoryString |
|
1837 |
! |
|
1838 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1839 |
primitiveDefinitions |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1840 |
"this method allows fileIn of classes with primitive code |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1841 |
outside of methods - it returns a CCReader which skips the next chunks" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1842 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1843 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions: |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1844 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1845 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1846 |
primitiveFunctions |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1847 |
"this method allows fileIn of classes with primitive code |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1848 |
outside of methods - it returns a CCReader which skips the next chunks" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1849 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1850 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions: |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1851 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1852 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1853 |
primitiveVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1854 |
"this method allows fileIn of classes with primitive code |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1855 |
outside of methods - it returns a CCReader which skips the next chunks" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1856 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1857 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables: |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1858 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1859 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1860 |
privateMethodsFor:aCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1861 |
"this method allows fileIn of ENVY methods |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1862 |
(although ST/X currently does NOT really enforce method visibility yet). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1863 |
Returns a ClassCategoryReader to read in and compile methods for me." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1864 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1865 |
^ (self methodsFor:aCategory) privateProtocol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1866 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1867 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1868 |
protectedMethodsFor:aCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1869 |
"this method allows fileIn of ENVY methods |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1870 |
(although ST/X currently does NOT really enforce method visibility yet). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1871 |
Returns a ClassCategoryReader to read in and compile methods for me." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1872 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1873 |
^ (self methodsFor:aCategory) protectedProtocol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1874 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1875 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1876 |
publicMethodsFor:aCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1877 |
"this method allows fileIn of ENVY methods |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1878 |
(although ST/X currently does NOT support method visibility). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1879 |
Returns a ClassCategoryReader to read in and compile methods for me." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1880 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1881 |
^ self methodsFor:aCategory |
1 | 1882 |
! ! |
1883 |
||
1884 |
!Class methodsFor:'fileOut'! |
|
1885 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1886 |
basicFileOutDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1887 |
"append an expression on aStream, which defines myself." |
238 | 1888 |
|
293 | 1889 |
|isVar line s| |
1 | 1890 |
|
68 | 1891 |
"take care of nil-superclass" |
1 | 1892 |
superclass isNil ifTrue:[ |
92 | 1893 |
"/ previous versions of stc were not able to compile nil-subclasses; |
1894 |
"/ after 2.10, it can ... |
|
1895 |
"/ line := 'Object "nil"'. |
|
153 | 1896 |
line := 'nil' |
1 | 1897 |
] ifFalse:[ |
153 | 1898 |
line := (superclass name) |
1 | 1899 |
]. |
1900 |
superclass isNil ifTrue:[ |
|
153 | 1901 |
isVar := self isVariable |
1 | 1902 |
] ifFalse:[ |
153 | 1903 |
"I cant remember what this is for ?" |
1904 |
isVar := (self isVariable and:[superclass isVariable not]) |
|
1 | 1905 |
]. |
293 | 1906 |
|
1 | 1907 |
isVar ifTrue:[ |
153 | 1908 |
self isBytes ifTrue:[ |
293 | 1909 |
s := ' variableByteSubclass:#' |
153 | 1910 |
] ifFalse:[ |
1911 |
self isWords ifTrue:[ |
|
293 | 1912 |
s := ' variableWordSubclass:#' |
153 | 1913 |
] ifFalse:[ |
1914 |
self isLongs ifTrue:[ |
|
293 | 1915 |
s := ' variableLongSubclass:#' |
153 | 1916 |
] ifFalse:[ |
1917 |
self isFloats ifTrue:[ |
|
293 | 1918 |
s := ' variableFloatSubclass:#' |
153 | 1919 |
] ifFalse:[ |
1920 |
self isDoubles ifTrue:[ |
|
293 | 1921 |
s := ' variableDoubleSubclass:#' |
153 | 1922 |
] ifFalse:[ |
293 | 1923 |
s := ' variableSubclass:#' |
153 | 1924 |
] |
1925 |
] |
|
1926 |
] |
|
1927 |
] |
|
1928 |
] |
|
1 | 1929 |
] ifFalse:[ |
293 | 1930 |
s := ' subclass:#' |
1 | 1931 |
]. |
293 | 1932 |
line := line , s , name. |
1 | 1933 |
aStream nextPutAll:line. |
1934 |
||
345 | 1935 |
aStream crtab. |
1 | 1936 |
aStream nextPutAll:' instanceVariableNames:'''. |
1937 |
self printInstVarNamesOn:aStream indent:16. |
|
1938 |
aStream nextPutAll:''''. |
|
1939 |
||
345 | 1940 |
aStream crtab. |
1 | 1941 |
aStream nextPutAll:' classVariableNames:'''. |
1942 |
self printClassVarNamesOn:aStream indent:16. |
|
1943 |
aStream nextPutAll:''''. |
|
1944 |
||
345 | 1945 |
aStream crtab. |
1 | 1946 |
aStream nextPutAll:' poolDictionaries:'''''. |
1947 |
||
345 | 1948 |
aStream crtab. |
1 | 1949 |
aStream nextPutAll:' category:'. |
1950 |
category isNil ifTrue:[ |
|
333 | 1951 |
s := '''''' |
1 | 1952 |
] ifFalse:[ |
333 | 1953 |
s := category asString storeString |
1 | 1954 |
]. |
333 | 1955 |
aStream nextPutAll:s. |
1 | 1956 |
aStream cr |
1957 |
! |
|
1958 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1959 |
fileOut |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1960 |
"create a file 'class.st' consisting of all methods in myself. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1961 |
If the current project is not nil, create the file in the projects |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1962 |
directory. Care is taken, to not clobber any existing file in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1963 |
case of errors (for example: disk full). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1964 |
Also, since the classes methods need a valid sourcefile, the current |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1965 |
sourceFile may not be rewritten." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1966 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1967 |
|aStream baseName dirName fileName newFileName needRename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1968 |
mySourceFileName sameFile| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1969 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1970 |
baseName := (Smalltalk fileNameForClass:self name). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1971 |
fileName := baseName , '.st'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1972 |
|
139 | 1973 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1974 |
this test allows a smalltalk to be built without Projects/ChangeSets |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1975 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1976 |
Project notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1977 |
dirName := Project currentProjectDirectory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1978 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1979 |
dirName := '' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1980 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1981 |
fileName := dirName , fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1982 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1983 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1984 |
if file exists, copy the existing to a .sav-file, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1985 |
create the new file as XXX.new-file, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1986 |
and, if that worked rename afterwards ... |
153 | 1987 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1988 |
(fileName asFilename exists |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1989 |
and:[classFilename notNil]) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1990 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1991 |
check for overwriting my current source file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1992 |
this is not allowed, since it would clobber my methods source |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1993 |
file ... you have to save it to some other place. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1994 |
This happens if you ask for a fileOut into the source-directory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1995 |
(from which my methods get their source) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1996 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1997 |
mySourceFileName := Smalltalk getSourceFileName:classFilename. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1998 |
sameFile := (fileName = mySourceFileName). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1999 |
sameFile ifFalse:[ |
600 | 2000 |
mySourceFileName notNil ifTrue:[ |
2001 |
sameFile := (fileName asFilename info at:#id) == (mySourceFileName asFilename info at:#id) |
|
2002 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2003 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2004 |
sameFile ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2005 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2006 |
raiseRequestWith:fileName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2007 |
errorString:('may not overwrite sourcefile:', fileName) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2008 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2009 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2010 |
fileName asFilename copyTo:('/tmp/' , baseName , '.sav'). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2011 |
newFileName := dirName , baseName , '.new'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2012 |
needRename := true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2013 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2014 |
newFileName := fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2015 |
needRename := false |
1 | 2016 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2017 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2018 |
aStream := FileStream newFileNamed:newFileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2019 |
aStream isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2020 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2021 |
raiseRequestWith:newFileName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2022 |
errorString:('cannot create file:', newFileName) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2023 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2024 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2025 |
aStream close. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2026 |
|
199 | 2027 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2028 |
finally, replace the old-file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2029 |
be careful, if the old one is a symbolic link; in this case, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2030 |
we have to do a copy ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2031 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2032 |
needRename ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2033 |
newFileName asFilename copyTo:fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2034 |
newFileName asFilename delete |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2035 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2036 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2037 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2038 |
add a change record; that way, administration is much easier, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2039 |
since we can see in that changeBrowser, which changes have |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2040 |
already found their way into a sourceFile and which must be |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2041 |
applied again |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2042 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2043 |
self addChangeRecordForClassFileOut:self |
1 | 2044 |
! |
2045 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2046 |
fileOutCategory:aCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2047 |
"create a file 'class-category.st' consisting of all methods in aCategory. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2048 |
If the current project is not nil, create the file in the projects |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2049 |
directory." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2050 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2051 |
|aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2052 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2053 |
fileName := name , '-' , aCategory , '.st'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2054 |
fileName replaceAll:(Character space) by:$_. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2055 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2056 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2057 |
this test allows a smalltalk to be built without Projects/ChangeSets |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2058 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2059 |
Project notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2060 |
fileName := Project currentProjectDirectory , fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2061 |
]. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
2062 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
2063 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2064 |
if file exists, save original in a .sav file |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
2065 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2066 |
fileName asFilename exists ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2067 |
fileName asFilename copyTo:(fileName , '.sav') |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2068 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2069 |
aStream := FileStream newFileNamed:fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2070 |
aStream isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2071 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2072 |
raiseRequestWith:fileName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2073 |
errorString:('cannot create file:', fileName) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2074 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2075 |
self fileOutCategory:aCategory on:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2076 |
aStream close |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2077 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2078 |
|
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2079 |
fileOutCategory:aCategory except:skippedMethods only:savedMethods on:aStream |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2080 |
"file out all methods belonging to aCategory, aString onto aStream. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2081 |
If skippedMethods is nonNil, those are not saved. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2082 |
If savedMethods is nonNil, only those are saved. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2083 |
If both are nil, all are saved. See version-method handling in |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2084 |
fileOut for what this is needed." |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2085 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2086 |
|source sortedSelectors first privacy interrestingMethods| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2087 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2088 |
methodArray notNil ifTrue:[ |
562 | 2089 |
interrestingMethods := OrderedCollection new. |
2090 |
methodArray do:[:aMethod | |
|
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2091 |
|wanted| |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2092 |
|
562 | 2093 |
(aCategory = aMethod category) ifTrue:[ |
649
6a2a1eec91fe
more revision stuff for sourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
638
diff
changeset
|
2094 |
skippedMethods notNil ifTrue:[ |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2095 |
wanted := (skippedMethods includesIdentical:aMethod) not |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2096 |
] ifFalse:[ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2097 |
savedMethods notNil ifTrue:[ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2098 |
wanted := (savedMethods includesIdentical:aMethod). |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2099 |
] ifFalse:[ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2100 |
wanted := true |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2101 |
] |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2102 |
]. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2103 |
wanted ifTrue:[interrestingMethods add:aMethod]. |
562 | 2104 |
] |
2105 |
]. |
|
2106 |
interrestingMethods notEmpty ifTrue:[ |
|
2107 |
first := true. |
|
2108 |
privacy := nil. |
|
2109 |
||
2110 |
"/ |
|
2111 |
"/ sort by selector |
|
2112 |
"/ |
|
2113 |
sortedSelectors := interrestingMethods collect:[:m | self selectorAtMethod:m]. |
|
2114 |
sortedSelectors sortWith:interrestingMethods. |
|
2115 |
||
2116 |
interrestingMethods do:[:aMethod | |
|
2117 |
first ifFalse:[ |
|
2118 |
privacy ~~ aMethod privacy ifTrue:[ |
|
2119 |
first := true. |
|
2120 |
aStream space. |
|
2121 |
aStream nextPutChunkSeparator. |
|
2122 |
]. |
|
2123 |
aStream cr; cr |
|
2124 |
]. |
|
2125 |
||
2126 |
privacy := aMethod privacy. |
|
2127 |
||
2128 |
first ifTrue:[ |
|
2129 |
aStream nextPutChunkSeparator. |
|
2130 |
self printClassNameOn:aStream. |
|
2131 |
privacy ~~ #public ifTrue:[ |
|
2132 |
aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'''. |
|
2133 |
] ifFalse:[ |
|
2134 |
aStream nextPutAll:' methodsFor:'''. |
|
2135 |
]. |
|
2136 |
aCategory notNil ifTrue:[ |
|
2137 |
aStream nextPutAll:aCategory |
|
2138 |
]. |
|
2139 |
aStream nextPut:$'; nextPutChunkSeparator; cr; cr. |
|
2140 |
first := false. |
|
2141 |
]. |
|
2142 |
source := aMethod source. |
|
2143 |
source isNil ifTrue:[ |
|
2144 |
FileOutErrorSignal raiseRequestWith:'no source for method' |
|
2145 |
] ifFalse:[ |
|
2146 |
aStream nextChunkPut:source. |
|
2147 |
]. |
|
2148 |
]. |
|
2149 |
aStream space. |
|
2150 |
aStream nextPutChunkSeparator. |
|
2151 |
aStream cr |
|
2152 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2153 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2154 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2155 |
"Modified: 28.8.1995 / 14:30:41 / claus" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2156 |
"Modified: 15.11.1995 / 12:45:54 / cg" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2157 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2158 |
|
662 | 2159 |
fileOutCategory:aCategory on:aStream |
2160 |
"file out all methods belonging to aCategory, aString onto aStream" |
|
2161 |
||
2162 |
self fileOutCategory:aCategory except:nil only:nil on:aStream |
|
2163 |
! |
|
2164 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2165 |
fileOutClassInstVarDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2166 |
"append an expression to define my classInstanceVariables on aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2167 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2168 |
aStream nextPutAll:(name , ' class instanceVariableNames:'''). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2169 |
self class printInstVarNamesOn:aStream indent:8. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2170 |
aStream nextPutAll:''''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2171 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2172 |
"mhmh - good idea; saw this in SmallDraw sourcecode ..." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2173 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2174 |
aStream cr; cr; nextPut:(Character doubleQuote); cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2175 |
aStream space; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2176 |
nextPutAll:'The following class instance variables are inherited by this class:'; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2177 |
cr; cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2178 |
self allSuperclassesDo:[:aSuperClass | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2179 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2180 |
aStream nextPutAll:(aSuperClass class instanceVariableString); cr. |
556 | 2181 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2182 |
aStream nextPut:(Character doubleQuote); cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2183 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2184 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2185 |
fileOutCommentOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2186 |
"append an expression on aStream, which defines my comment" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2187 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2188 |
|comment s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2189 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2190 |
aStream nextPutAll:name; nextPutAll:' comment:'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2191 |
(comment := self comment) isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2192 |
s := '''''' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2193 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2194 |
s := comment storeString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2195 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2196 |
aStream nextPutAll:s. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2197 |
aStream cr |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2198 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2199 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2200 |
fileOutDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2201 |
"append an expression on aStream, which defines myself." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2202 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2203 |
^ self basicFileOutDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2204 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2205 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2206 |
fileOutIn:aFileDirectory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2207 |
"create a file 'class.st' consisting of all methods in self in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2208 |
directory aFileDirectory (ignoring any directory setting in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2209 |
the current porject). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2210 |
This is not logged in that change file (should it be ?)." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2211 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2212 |
|aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2213 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2214 |
fileName := (Smalltalk fileNameForClass:self name) , '.st'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2215 |
aStream := FileStream newFileNamed:fileName in:aFileDirectory. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2216 |
aStream isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2217 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2218 |
raiseRequestWith:fileName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2219 |
errorString:('cannot create file:', fileName) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2220 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2221 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2222 |
aStream close |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2223 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2224 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2225 |
fileOutMethod:aMethod |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2226 |
"create a file 'class-method.st' consisting of the method, aMethod. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2227 |
If the current project is not nil, create the file in the projects |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2228 |
directory." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2229 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2230 |
|aStream fileName selector| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2231 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2232 |
selector := self selectorAtMethod:aMethod. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2233 |
selector notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2234 |
fileName := name , '-' , selector, '.st'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2235 |
fileName replaceAll:$: by:$_. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2236 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2237 |
this test allows a smalltalk to be built without Projects/ChangeSets |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2238 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2239 |
Project notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2240 |
fileName := Project currentProjectDirectory , fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2241 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2242 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2243 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2244 |
if file exists, save original in a .sav file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2245 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2246 |
fileName asFilename exists ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2247 |
fileName asFilename copyTo:(fileName , '.sav') |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2248 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2249 |
aStream := FileStream newFileNamed:fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2250 |
aStream isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2251 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2252 |
raiseRequestWith:fileName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2253 |
errorString:('cannot create file:', fileName) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2254 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2255 |
self fileOutMethod:aMethod on:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2256 |
aStream close |
555 | 2257 |
] |
2258 |
! |
|
2259 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2260 |
fileOutMethod:aMethod on:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2261 |
"file out the method, aMethod onto aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2262 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2263 |
|cat source privacy| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2264 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2265 |
methodArray notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2266 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2267 |
self printClassNameOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2268 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2269 |
(privacy := aMethod privacy) ~~ #public ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2270 |
aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2271 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2272 |
aStream nextPutAll:' methodsFor:'''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2273 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2274 |
cat := aMethod category. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2275 |
cat notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2276 |
aStream nextPutAll:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2277 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2278 |
aStream nextPut:$'; nextPutChunkSeparator; cr; cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2279 |
source := aMethod source. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2280 |
source isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2281 |
FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2282 |
raiseRequestWith:self |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2283 |
errorString:('no source for method: ' , |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2284 |
self name , '>>' , |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2285 |
(self selectorAtMethod:aMethod)) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2286 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2287 |
aStream nextChunkPut:source. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2288 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2289 |
aStream space. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2290 |
aStream nextPutChunkSeparator. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2291 |
aStream cr |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2292 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2293 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2294 |
"Modified: 27.8.1995 / 01:23:19 / claus" |
555 | 2295 |
! |
2296 |
||
2297 |
fileOutOn:aStream |
|
2298 |
"file out my definition and all methods onto aStream" |
|
2299 |
||
2300 |
^ self fileOutOn:aStream withTimeStamp:true |
|
2301 |
||
2302 |
"Created: 15.11.1995 / 12:53:32 / cg" |
|
2303 |
! |
|
2304 |
||
2305 |
fileOutOn:aStream withTimeStamp:stampIt |
|
2306 |
"file out my definition and all methods onto aStream" |
|
2307 |
||
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2308 |
|collectionOfCategories copyrightMethod copyrightText comment cls versionMethod skippedMethods| |
555 | 2309 |
|
2310 |
self isLoaded ifFalse:[ |
|
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2311 |
^ FileOutErrorSignal |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2312 |
raiseRequestWith:self |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2313 |
errorString:'will not fileOut unloaded classes' |
555 | 2314 |
]. |
2315 |
||
2316 |
" |
|
2317 |
if there is a copyright method, add a copyright comment |
|
2318 |
at the beginning, taking the string from the copyright method. |
|
2319 |
We cannot do this unconditionally - that would lead to my copyrights |
|
2320 |
being put on your code ;-). |
|
2321 |
On the other hand: I want every file created by myself to have the |
|
2322 |
copyright string at the beginning be preserved .... even if the |
|
2323 |
code was edited in the browser and filedOut. |
|
2324 |
" |
|
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2325 |
(copyrightMethod := self class compiledMethodAt:#copyright) notNil ifTrue:[ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2326 |
" |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2327 |
get the copyright methods source, |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2328 |
and insert at beginning. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2329 |
" |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2330 |
copyrightText := copyrightMethod source. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2331 |
copyrightText isNil ifTrue:[ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2332 |
" |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2333 |
no source available - trigger an error |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2334 |
" |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2335 |
FileOutErrorSignal |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2336 |
raiseRequestWith:'no source for class ' , name , ' available. Cannot fileOut'. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2337 |
^ self |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2338 |
]. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2339 |
" |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2340 |
strip off the selector-line |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2341 |
" |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2342 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2343 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size). |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2344 |
"/ copyrightText do:[:line | aStream nextPutAll:line. aStream cr.]. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2345 |
copyrightText := copyrightText asString. |
719
c557a530f971
dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2346 |
aStream nextPutAllAsChunk:copyrightText. |
555 | 2347 |
]. |
2348 |
||
2349 |
stampIt ifTrue:[ |
|
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2350 |
"/ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2351 |
"/ first, a timestamp |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2352 |
"/ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2353 |
aStream nextPutAll:(Smalltalk timeStamp). |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2354 |
aStream nextPutChunkSeparator. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2355 |
aStream cr; cr. |
555 | 2356 |
]. |
2357 |
||
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2358 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2359 |
"/ then the definition |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2360 |
"/ |
555 | 2361 |
self fileOutDefinitionOn:aStream. |
2362 |
aStream nextPutChunkSeparator. |
|
2363 |
aStream cr; cr. |
|
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2364 |
|
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2365 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2366 |
"/ optional classInstanceVariables |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2367 |
"/ |
555 | 2368 |
self class instanceVariableString isBlank ifFalse:[ |
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2369 |
self fileOutClassInstVarDefinitionOn:aStream. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2370 |
aStream nextPutChunkSeparator. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2371 |
aStream cr; cr |
1 | 2372 |
]. |
555 | 2373 |
|
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2374 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2375 |
"/ a comment - if any |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2376 |
"/ |
555 | 2377 |
(comment := self comment) notNil ifTrue:[ |
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2378 |
aStream nextPutAll:name; nextPutAll:' comment:'. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2379 |
aStream nextPutAll:(comment storeString). |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2380 |
aStream nextPutChunkSeparator. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2381 |
aStream cr; cr |
555 | 2382 |
]. |
2383 |
||
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2384 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2385 |
"/ primitive definitions - if any |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2386 |
"/ |
555 | 2387 |
self fileOutPrimitiveSpecsOn:aStream. |
2388 |
||
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2389 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2390 |
"/ methods from all categories in metaclass (i.e. class methods) |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2391 |
"/ EXCEPT: the version method is placed at the very end, to |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2392 |
"/ avoid sourcePosition-shifts when checked out later. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2393 |
"/ |
555 | 2394 |
collectionOfCategories := self class categories asSortedCollection. |
2395 |
collectionOfCategories notNil ifTrue:[ |
|
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2396 |
"/ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2397 |
"/ documentation first (if any), but not the version method |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2398 |
"/ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2399 |
(collectionOfCategories includes:'documentation') ifTrue:[ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2400 |
versionMethod := self class compiledMethodAt:#version. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2401 |
versionMethod notNil ifTrue:[ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2402 |
skippedMethods := Array with:versionMethod |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2403 |
]. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2404 |
self class fileOutCategory:'documentation' except:skippedMethods only:nil on:aStream. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2405 |
aStream cr. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2406 |
]. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2407 |
|
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2408 |
"/ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2409 |
"/ initialization next (if any) |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2410 |
"/ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2411 |
(collectionOfCategories includes:'initialization') ifTrue:[ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2412 |
self class fileOutCategory:'initialization' on:aStream. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2413 |
aStream cr. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2414 |
]. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2415 |
|
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2416 |
"/ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2417 |
"/ instance creation next (if any) |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2418 |
"/ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2419 |
(collectionOfCategories includes:'instance creation') ifTrue:[ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2420 |
self class fileOutCategory:'instance creation' on:aStream. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2421 |
aStream cr. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2422 |
]. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2423 |
collectionOfCategories do:[:aCategory | |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2424 |
((aCategory ~= 'documentation') |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2425 |
and:[(aCategory ~= 'initialization') |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2426 |
and:[aCategory ~= 'instance creation']]) ifTrue:[ |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2427 |
self class fileOutCategory:aCategory on:aStream. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2428 |
aStream cr |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2429 |
] |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2430 |
] |
555 | 2431 |
]. |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2432 |
|
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2433 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2434 |
"/ methods from all categories in myself |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2435 |
"/ |
555 | 2436 |
collectionOfCategories := self categories asSortedCollection. |
2437 |
collectionOfCategories notNil ifTrue:[ |
|
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2438 |
collectionOfCategories do:[:aCategory | |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2439 |
self fileOutCategory:aCategory on:aStream. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2440 |
aStream cr |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2441 |
] |
555 | 2442 |
]. |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2443 |
|
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2444 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2445 |
"/ finally, the previously skipped version method |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2446 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2447 |
versionMethod notNil ifTrue:[ |
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2448 |
self class fileOutCategory:'documentation' except:nil only:skippedMethods on:aStream. |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2449 |
]. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2450 |
|
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2451 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2452 |
"/ optionally an initialize message |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2453 |
"/ |
555 | 2454 |
(self class implements:#initialize) ifTrue:[ |
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2455 |
aStream nextPutAll:(name , ' initialize'). |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2456 |
aStream nextPutChunkSeparator. |
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2457 |
aStream cr |
555 | 2458 |
] |
2459 |
||
2460 |
"Created: 15.11.1995 / 12:53:06 / cg" |
|
719
c557a530f971
dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2461 |
"Modified: 9.12.1995 / 15:54:40 / cg" |
555 | 2462 |
! |
2463 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2464 |
fileOutPrimitiveDefinitionsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2465 |
"append primitive defs (if any) to aStream." |
555 | 2466 |
|
2467 |
|s| |
|
2468 |
||
2469 |
" |
|
2470 |
primitive definitions - if any |
|
2471 |
" |
|
2472 |
(s := self primitiveDefinitionsString) notNil ifTrue:[ |
|
2473 |
aStream nextPutChunkSeparator; |
|
2474 |
nextPutAll:name; nextPutAll:' primitiveDefinitions'; |
|
2475 |
nextPutChunkSeparator; |
|
2476 |
cr. |
|
2477 |
aStream nextPutAll:s. |
|
2478 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
2479 |
]. |
|
2480 |
(s := self primitiveVariablesString) notNil ifTrue:[ |
|
2481 |
aStream nextPutChunkSeparator; |
|
2482 |
nextPutAll:name; nextPutAll:' primitiveVariables'; |
|
2483 |
nextPutChunkSeparator; |
|
2484 |
cr. |
|
2485 |
aStream nextPutAll:s. |
|
2486 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
2487 |
]. |
|
2488 |
! |
|
2489 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2490 |
fileOutPrimitiveSpecsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2491 |
"append primitive defs (if any) to aStream." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2492 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2493 |
|s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2494 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2495 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2496 |
primitive definitions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2497 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2498 |
self fileOutPrimitiveDefinitionsOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2499 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2500 |
primitive functions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2501 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2502 |
(s := self primitiveFunctionsString) notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2503 |
aStream nextPutChunkSeparator; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2504 |
nextPutAll:name; nextPutAll:' primitiveFunctions'; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2505 |
nextPutChunkSeparator; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2506 |
cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2507 |
aStream nextPutAll:s. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2508 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2509 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2510 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2511 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2512 |
!Class methodsFor:'printOut'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2513 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2514 |
printClassNameOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2515 |
"helper for fileOut - print my name if I am not a Metaclass; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2516 |
otherwise my name without -class followed by space-class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2517 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2518 |
self isMeta ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2519 |
aStream nextPutAll:(name copyTo:(name size - 5)); nextPutAll:' class' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2520 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2521 |
name printOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2522 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2523 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2524 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2525 |
printClassVarNamesOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2526 |
"print the class variable names indented and breaking at line end" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2527 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2528 |
self printNameArray:(self classVarNames) on:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2529 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2530 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2531 |
printFullHierarchyOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2532 |
"print myself and all subclasses on aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2533 |
recursively calls itself to print subclasses. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2534 |
Can be used to print hierarchy on the printer." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2535 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2536 |
aStream spaces:indent; bold; nextPutAll:name; normal; nextPutAll:' ('. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2537 |
self printInstVarNamesOn:aStream indent:(indent + name size + 2). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2538 |
aStream nextPutAll:')'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2539 |
aStream cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2540 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2541 |
(self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2542 |
aSubclass printFullHierarchyOn:aStream indent:(indent + 2) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2543 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2544 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2545 |
"|printStream| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2546 |
printStream := Printer new. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2547 |
Object printFullHierarchyOn:printStream indent:0. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2548 |
printStream close" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2549 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2550 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2551 |
printHierarchyAnswerIndentOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2552 |
"print my class hierarchy on aStream - return indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2553 |
recursively calls itself to print superclass and use returned indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2554 |
for my description - used in the browser" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2555 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2556 |
|indent| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2557 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2558 |
indent := 0. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2559 |
(superclass notNil) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2560 |
indent := (superclass printHierarchyAnswerIndentOn:aStream) + 2 |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2561 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2562 |
aStream spaces:indent. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2563 |
aStream nextPutAll:name; nextPutAll:' ('. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2564 |
self printInstVarNamesOn:aStream indent:(indent + name size + 2). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2565 |
aStream nextPutAll:')'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2566 |
aStream cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2567 |
^ indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2568 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2569 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2570 |
printHierarchyOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2571 |
"print my class hierarchy on aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2572 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2573 |
self printHierarchyAnswerIndentOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2574 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2575 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2576 |
printInstVarNamesOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2577 |
"print the instance variable names indented and breaking at line end" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2578 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2579 |
self printNameArray:(self instVarNames) on:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2580 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2581 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2582 |
printNameArray:anArray on:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2583 |
"print an array of strings separated by spaces; when the stream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2584 |
defines a lineLength, break when this limit is reached; indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2585 |
every line; used to printOut instance variable names" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2586 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2587 |
|thisName nextName arraySize lenMax pos mustBreak line spaces| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2588 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2589 |
arraySize := anArray size. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2590 |
arraySize ~~ 0 ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2591 |
pos := indent. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2592 |
lenMax := aStream lineLength. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2593 |
thisName := anArray at:1. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2594 |
line := ''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2595 |
1 to:arraySize do:[:index | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2596 |
line := line , thisName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2597 |
pos := pos + thisName size. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2598 |
(index == arraySize) ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2599 |
nextName := anArray at:(index + 1). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2600 |
mustBreak := false. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2601 |
(lenMax > 0) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2602 |
((pos + nextName size) > lenMax) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2603 |
mustBreak := true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2604 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2605 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2606 |
mustBreak ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2607 |
aStream nextPutAll:line. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2608 |
aStream cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2609 |
spaces isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2610 |
spaces := String new:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2611 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2612 |
line := spaces. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2613 |
pos := indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2614 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2615 |
line := line , ' '. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2616 |
pos := pos + 1 |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2617 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2618 |
thisName := nextName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2619 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2620 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2621 |
aStream nextPutAll:line |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2622 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2623 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2624 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2625 |
printOutCategory:aCategory on:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2626 |
"print out all methods in aCategory on aPrintStream should be a PrintStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2627 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2628 |
|any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2629 |
methodArray notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2630 |
any := false. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2631 |
methodArray do:[:aMethod | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2632 |
(aCategory = aMethod category) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2633 |
any := true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2634 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2635 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2636 |
any ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2637 |
aPrintStream italic. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2638 |
aPrintStream nextPutAll:aCategory. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2639 |
aPrintStream normal. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2640 |
aPrintStream cr; cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2641 |
methodArray do:[:aMethod | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2642 |
(aCategory = aMethod category) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2643 |
self printOutSource:(aMethod source) on:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2644 |
aPrintStream cr; cr |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2645 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2646 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2647 |
aPrintStream cr |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2648 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2649 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2650 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2651 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2652 |
printOutCategoryProtocol:aCategory on:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2653 |
|any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2654 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2655 |
methodArray notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2656 |
any := false. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2657 |
methodArray do:[:aMethod | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2658 |
(aCategory = aMethod category) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2659 |
any := true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2660 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2661 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2662 |
any ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2663 |
aPrintStream italic. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2664 |
aPrintStream nextPutAll:aCategory. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2665 |
aPrintStream normal. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2666 |
aPrintStream cr; cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2667 |
methodArray do:[:aMethod | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2668 |
(aCategory = aMethod category) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2669 |
self printOutSourceProtocol:aMethod |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2670 |
on:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2671 |
aPrintStream cr; cr |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2672 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2673 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2674 |
aPrintStream cr |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2675 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2676 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2677 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2678 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2679 |
printOutDefinitionOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2680 |
"print out my definition" |
1 | 2681 |
|
333 | 2682 |
|comment s| |
2683 |
||
2684 |
aPrintStream nextPutAll:'class '; bold; nextPutAll:name; normal; cr. |
|
1 | 2685 |
aPrintStream nextPutAll:'superclass '. |
2686 |
superclass isNil ifTrue:[ |
|
333 | 2687 |
s := 'Object' |
1 | 2688 |
] ifFalse:[ |
333 | 2689 |
s := superclass name |
1 | 2690 |
]. |
333 | 2691 |
aPrintStream nextPutAll:s. |
1 | 2692 |
aPrintStream cr. |
2693 |
||
2694 |
aPrintStream nextPutAll:'instance Variables '. |
|
2695 |
self printInstVarNamesOn:aPrintStream indent:21. |
|
2696 |
aPrintStream cr. |
|
2697 |
||
2698 |
aPrintStream nextPutAll:'class Variables '. |
|
2699 |
self printClassVarNamesOn:aPrintStream indent:21. |
|
2700 |
aPrintStream cr. |
|
2701 |
||
2702 |
category notNil ifTrue:[ |
|
333 | 2703 |
aPrintStream nextPutAll:'category '; nextPutAll:(category printString). |
153 | 2704 |
aPrintStream cr |
1 | 2705 |
]. |
2706 |
||
193 | 2707 |
(comment := self comment) notNil ifTrue:[ |
333 | 2708 |
aPrintStream cr; nextPutAll:'comment:'; cr; italic; nextPutAll:comment; normal; cr |
1 | 2709 |
] |
2710 |
! |
|
2711 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2712 |
printOutOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2713 |
"print out all methods on aPrintStream which should be a printStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2714 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2715 |
|collectionOfCategories| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2716 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2717 |
self printOutDefinitionOn:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2718 |
aPrintStream cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2719 |
collectionOfCategories := self class categories. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2720 |
collectionOfCategories notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2721 |
aPrintStream nextPutAll:'class protocol'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2722 |
aPrintStream cr; cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2723 |
collectionOfCategories do:[:aCategory | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2724 |
self class printOutCategory:aCategory on:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2725 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2726 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2727 |
collectionOfCategories := self categories. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2728 |
collectionOfCategories notNil ifTrue:[ |
555 | 2729 |
aPrintStream nextPutAll:'instance protocol'. |
2730 |
aPrintStream cr; cr. |
|
2731 |
collectionOfCategories do:[:aCategory | |
|
2732 |
self printOutCategory:aCategory on:aPrintStream |
|
2733 |
] |
|
2734 |
] |
|
2735 |
! |
|
2736 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2737 |
printOutProtocolOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2738 |
|collectionOfCategories| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2739 |
self printOutDefinitionOn:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2740 |
aPrintStream cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2741 |
collectionOfCategories := self class categories. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2742 |
collectionOfCategories notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2743 |
aPrintStream nextPutAll:'class protocol'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2744 |
aPrintStream cr; cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2745 |
collectionOfCategories do:[:aCategory | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2746 |
self class printOutCategoryProtocol:aCategory on:aPrintStream |
555 | 2747 |
] |
2748 |
]. |
|
2749 |
collectionOfCategories := self categories. |
|
2750 |
collectionOfCategories notNil ifTrue:[ |
|
2751 |
aPrintStream nextPutAll:'instance protocol'. |
|
2752 |
aPrintStream cr; cr. |
|
2753 |
collectionOfCategories do:[:aCategory | |
|
2754 |
self printOutCategoryProtocol:aCategory on:aPrintStream |
|
2755 |
] |
|
2756 |
] |
|
1 | 2757 |
! |
2758 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2759 |
printOutSource:aString on:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2760 |
"print out a source-string; the message-specification is printed bold, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2761 |
comments are printed italic" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2762 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2763 |
|text textIndex textSize line lineIndex lineSize inComment aCharacter| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2764 |
text := aString asStringCollection. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2765 |
aPrintStream bold. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2766 |
aPrintStream nextPutAll:(text at:1). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2767 |
aPrintStream normal. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2768 |
aPrintStream cr. |
1 | 2769 |
inComment := false. |
2770 |
textSize := text size. |
|
2771 |
textIndex := 2. |
|
2772 |
[textIndex <= textSize] whileTrue:[ |
|
153 | 2773 |
line := text at:textIndex. |
2774 |
((line occurrencesOf:Character doubleQuote) == 0) ifTrue:[ |
|
2775 |
aPrintStream nextPutAll:line |
|
2776 |
] ifFalse:[ |
|
2777 |
lineSize := line size. |
|
2778 |
lineIndex := 1. |
|
2779 |
[lineIndex <= lineSize] whileTrue:[ |
|
2780 |
aCharacter := line at:lineIndex. |
|
2781 |
(aCharacter == Character doubleQuote) ifTrue:[ |
|
2782 |
inComment ifTrue:[ |
|
2783 |
aPrintStream normal. |
|
2784 |
aPrintStream nextPut:aCharacter. |
|
2785 |
inComment := false |
|
2786 |
] ifFalse:[ |
|
2787 |
aPrintStream nextPut:aCharacter. |
|
2788 |
aPrintStream italic. |
|
2789 |
inComment := true |
|
2790 |
] |
|
2791 |
] ifFalse:[ |
|
2792 |
aPrintStream nextPut:aCharacter |
|
2793 |
]. |
|
2794 |
lineIndex := lineIndex + 1 |
|
2795 |
] |
|
2796 |
]. |
|
2797 |
aPrintStream cr. |
|
2798 |
textIndex := textIndex + 1 |
|
1 | 2799 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2800 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2801 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2802 |
printOutSourceProtocol:aMethod on:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2803 |
"given the source in aString, print the methods message specification |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2804 |
and any method comments - without source; used to generate documentation |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2805 |
pages" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2806 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2807 |
|text| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2808 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2809 |
text := aMethod source asStringCollection. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2810 |
(text size < 1) ifTrue:[^self]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2811 |
aPrintStream bold. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2812 |
aPrintStream nextPutAll:(text at:1). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2813 |
aPrintStream cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2814 |
(text size >= 2) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2815 |
aPrintStream italic. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2816 |
aPrintStream spaces:((text at:2) indexOfNonSeparatorStartingAt:1). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2817 |
aPrintStream nextPutAll:aMethod comment. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2818 |
aPrintStream cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2819 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2820 |
aPrintStream normal |
555 | 2821 |
|
2822 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2823 |
Float printOutProtocolOn:Stdout |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
2824 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2825 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2826 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2827 |
!Class methodsFor:'private'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2828 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2829 |
addAllCategoriesTo:aCollection |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2830 |
"helper - add categories and all superclasses categories |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2831 |
to the argument, aCollection" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2832 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2833 |
(superclass notNil) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2834 |
superclass addAllCategoriesTo:aCollection |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2835 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2836 |
self addCategoriesTo:aCollection |
556 | 2837 |
! |
2838 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2839 |
addAllClassVarNamesTo:aCollection |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2840 |
"helper - add the name-strings of the class variables and of the class-vars |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2841 |
of all superclasses to the argument, aCollection. Return aCollection" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2842 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2843 |
(superclass notNil) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2844 |
superclass addAllClassVarNamesTo:aCollection |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2845 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2846 |
classvars notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2847 |
aCollection addAll:(classvars asCollectionOfWords). |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
2848 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2849 |
^ aCollection |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2850 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2851 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2852 |
addCategoriesTo:aCollection |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2853 |
"helper - add categories to the argument, aCollection" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2854 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2855 |
methodArray do:[:aMethod | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2856 |
|cat| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2857 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2858 |
cat := aMethod category. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2859 |
(aCollection includes:cat) ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2860 |
aCollection add:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2861 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2862 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2863 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2864 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2865 |
getPrimitiveSpecsAt:index |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2866 |
"return a primitiveSpecification component as string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2867 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2868 |
|pos stream string| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2869 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2870 |
primitiveSpec isNil ifTrue:[^ nil]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2871 |
pos := primitiveSpec at:index. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2872 |
pos isNil ifTrue:[^ nil]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2873 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2874 |
"the primitiveSpec is either a string, or an integer specifying the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2875 |
position within the classes sourcefile ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2876 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2877 |
pos isNumber ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2878 |
classFilename notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2879 |
stream := self sourceStream. "/ Smalltalk sourceFileStreamFor:classFilename. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2880 |
stream notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2881 |
stream position:pos+1. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2882 |
string := stream nextChunk. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2883 |
stream close. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2884 |
^ string |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2885 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2886 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2887 |
^ nil |
544 | 2888 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2889 |
^ pos |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2890 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2891 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2892 |
revisionInfo |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2893 |
"return a dictionary filled with revision info. |
686 | 2894 |
This extracts the relevant info from the revisionString. |
2895 |
The revisionInfo contains all or a subset of: |
|
726
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2896 |
#binaryRevision - the revision upon which the binary of this class is based |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2897 |
#revision - the revision upon which the class is based logically |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2898 |
(different, if a changed class was checked in, but not yet recompiled) |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2899 |
#user - the user who checked in the logical revision |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2900 |
#date - the date when the logical revision was checked in |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2901 |
#time - the time when the logical revision was checked in |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2902 |
#fileName - the classes source file name |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2903 |
#repositoryPath - the classes source container |
686 | 2904 |
" |
2905 |
||
2906 |
|vsnString info| |
|
562 | 2907 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2908 |
vsnString := self revisionString. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2909 |
vsnString notNil ifTrue:[ |
726
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2910 |
info := Class revisionInfoFromString:vsnString. |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2911 |
info notNil ifTrue:[ |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2912 |
info at:#binaryRevision put:revision. |
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2913 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2914 |
]. |
686 | 2915 |
^ info |
544 | 2916 |
|
2917 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2918 |
Object revisionString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2919 |
Object revisionInfo |
686 | 2920 |
Image revisionInfo |
544 | 2921 |
" |
2922 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2923 |
"Created: 11.11.1995 / 14:27:20 / cg" |
726
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
2924 |
"Modified: 9.12.1995 / 21:35:26 / cg" |
562 | 2925 |
! |
2926 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2927 |
revisionString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2928 |
"return my revision string; that one is extracted from the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2929 |
classes #version method. Either this is a method returning that string, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2930 |
or its a comment-only method and the comment defines the version. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2931 |
If the source is not accessable or no such method exists, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2932 |
nil is returned." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2933 |
|
562 | 2934 |
|cls meta m src val| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2935 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2936 |
self isMeta ifTrue:[ |
656 | 2937 |
meta := self. cls := self soleInstance |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2938 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2939 |
cls := self. meta := self class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2940 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2941 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2942 |
m := meta compiledMethodAt:#version. |
656 | 2943 |
m isNil ifTrue:[ |
2944 |
m := cls compiledMethodAt:#version. |
|
2945 |
m isNil ifTrue:[^ nil]. |
|
2946 |
]. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2947 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2948 |
"/ if its a method returning the string, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2949 |
val := cls version. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2950 |
val isString ifTrue:[^ val]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2951 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2952 |
src := m source. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2953 |
src isNil ifTrue:[^ nil]. |
562 | 2954 |
^ self revisionStringFromSource:src |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2955 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2956 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2957 |
Smalltalk allClassesDo:[:cls | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2958 |
Transcript showCr:cls revisionString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2959 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2960 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2961 |
Number revisionString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2962 |
FileDirectory revisionString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2963 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2964 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2965 |
"Created: 29.10.1995 / 19:28:03 / cg" |
562 | 2966 |
"Modified: 15.11.1995 / 15:01:54 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2967 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2968 |
|
620 | 2969 |
revisionStringFromSource:aMethodSourceString |
2970 |
"extract a revision string from a methods source string" |
|
2971 |
||
2972 |
|lines idx val| |
|
2973 |
||
2974 |
lines := aMethodSourceString asCollectionOfLines. |
|
656 | 2975 |
lines do:[:l | |
2976 |
|i| |
|
2977 |
||
2978 |
i := l indexOfSubCollection:'$Header: '. |
|
2979 |
i ~~ 0 ifTrue:[ |
|
2980 |
^ l copyFrom:i |
|
2981 |
] |
|
620 | 2982 |
]. |
656 | 2983 |
^ nil |
620 | 2984 |
! |
2985 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2986 |
setPrimitiveSpecsAt:index to:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2987 |
"set a primitiveSpecification component to aString" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2988 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2989 |
primitiveSpec isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2990 |
primitiveSpec := Array new:3 |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2991 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2992 |
primitiveSpec at:index put:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2993 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2994 |
|
702
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
2995 |
updateVersionMethodFor:newRevisionString |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
2996 |
"helper for the checkin procedure. |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
2997 |
Update my #version method, to now return newRevisionString." |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
2998 |
|
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
2999 |
|cls vs m mgr| |
555 | 3000 |
|
3001 |
cls := self. |
|
3002 |
self isMeta ifFalse:[ |
|
707
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
3003 |
cls := self class |
555 | 3004 |
]. |
702
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3005 |
"/ m := cls compiledMethodAt:#version. |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3006 |
"/ m isNil ifTrue:[^ false]. |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3007 |
"/ vs := self revisionString. |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3008 |
"/ vs isNil ifTrue:[^ false]. |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3009 |
"/ |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3010 |
"/ (mgr := self sourceCodeManager) isNil ifTrue:[^ false]. |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3011 |
"/ newString := mgr updatedRevisionStringOf:cls forRevision:newRevision with:vs. |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3012 |
"/ newString isNil ifTrue:[^ false]. |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3013 |
|
707
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
3014 |
Class withoutUpdatingChangesDo:[ |
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
3015 |
Compiler compile:'version |
702
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3016 |
^ ''' , newRevisionString , ''' |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3017 |
' |
707
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
3018 |
forClass:cls inCategory:#documentation notifying:nil |
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
3019 |
install:true skipIfSame:false silent:true. |
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
3020 |
]. |
702
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3021 |
"/ ('updated to :' , newRevisionString) printNL. |
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3022 |
|
686 | 3023 |
^ true |
555 | 3024 |
|
702
6a5a2ebff51b
need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents:
689
diff
changeset
|
3025 |
"Created: 7.12.1995 / 20:42:22 / cg" |
707
9b3d61b411b0
dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents:
702
diff
changeset
|
3026 |
"Modified: 7.12.1995 / 23:34:43 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3027 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3028 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3029 |
!Class methodsFor:'queries'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3030 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3031 |
allCategories |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3032 |
"Return a Collection of all method-category strings known in class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3033 |
and all superclasses. The returned collection is not sorted by any order." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3034 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3035 |
|coll| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3036 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3037 |
coll := OrderedCollection new. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3038 |
self addAllCategoriesTo:coll. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3039 |
^ coll |
453 | 3040 |
|
3041 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3042 |
Point categories |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3043 |
Point allCategories |
453 | 3044 |
" |
3045 |
! |
|
3046 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3047 |
categories |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3048 |
"Return a Collection of all method-category strings known in class. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3049 |
The returned collection is not sorted by any order." |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
3050 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
3051 |
|newList cat| |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
3052 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
3053 |
newList := OrderedCollection new. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
3054 |
methodArray do:[:aMethod | |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
3055 |
cat := aMethod category. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
3056 |
newList indexOf:cat ifAbsent:[newList add:cat] |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
3057 |
]. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
3058 |
^ newList |
453 | 3059 |
|
3060 |
" |
|
3061 |
Point categories |
|
293 | 3062 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3063 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3064 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3065 |
isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3066 |
"return true, if the receiver is some kind of class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3067 |
(a real class, not just behavior); |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3068 |
true is returned here - the method is redefined from Object. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3069 |
See also Behavior>>isBehavior." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3070 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3071 |
^ true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3072 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3073 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3074 |
Point isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3075 |
1 isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3076 |
Behavior new isBehavior |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3077 |
Behavior new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3078 |
Class new isBehavior |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3079 |
Class new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3080 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3081 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3082 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3083 |
wasAutoloaded |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3084 |
"return true, if this class came into the system via an |
555 | 3085 |
autoload; false otherwise. |
3086 |
This is not an attribute of the class, but instead remembered in |
|
3087 |
Autoload. The interface here is for covenience." |
|
3088 |
||
3089 |
^ Autoload wasAutoloaded:self |
|
3090 |
! |
|
3091 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3092 |
whichClassDefinesClassVar:aVariableName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3093 |
"return the class which defines the class variable |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3094 |
named aVariableName. This method should not be used for |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3095 |
repeated searches (i.e. in the compiler/parser), since it creates |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3096 |
many throw away intermediate objects." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3097 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3098 |
|cls| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3099 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3100 |
cls := self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3101 |
[cls notNil] whileTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3102 |
(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3103 |
cls := cls superclass |
556 | 3104 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3105 |
^ nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3106 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3107 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3108 |
StandardSystemView whichClassDefinesClassVar:'ErrorSignal' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3109 |
StandardSystemView whichClassDefinesClassVar:'Foo' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3110 |
" |
556 | 3111 |
! |
3112 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3113 |
whichClassDefinesInstVar:aVariableName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3114 |
"return the class which defines the instance variable |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3115 |
named aVariableName. This method should not be used for |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3116 |
repeated searches (i.e. in the compiler/parser), since it creates |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3117 |
many throw away intermediate objects." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3118 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3119 |
|cls| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3120 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3121 |
cls := self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3122 |
[cls notNil] whileTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3123 |
(cls instVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3124 |
cls := cls superclass |
453 | 3125 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3126 |
^ nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3127 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3128 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3129 |
StandardSystemView whichClassDefinesInstVar:'label' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3130 |
StandardSystemView whichClassDefinesInstVar:'paint' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3131 |
StandardSystemView whichClassDefinesInstVar:'foo' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3132 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3133 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3134 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3135 |
!Class methodsFor:'subclass creation'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3136 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3137 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat |
453 | 3138 |
"create a new class as a subclass of an existing class (the receiver). |
3139 |
The subclass will have indexed variables if the receiving-class has." |
|
3140 |
||
3141 |
self isVariable ifFalse:[ |
|
3142 |
^ self class |
|
3143 |
name:t |
|
3144 |
inEnvironment:Smalltalk |
|
3145 |
subclassOf:self |
|
3146 |
instanceVariableNames:f |
|
3147 |
variable:false |
|
3148 |
words:true |
|
3149 |
pointers:true |
|
3150 |
classVariableNames:d |
|
3151 |
poolDictionaries:s |
|
3152 |
category:cat |
|
3153 |
comment:nil |
|
3154 |
changed:false |
|
3155 |
]. |
|
3156 |
self isBytes ifTrue:[ |
|
3157 |
^ self |
|
3158 |
variableByteSubclass:t |
|
3159 |
instanceVariableNames:f |
|
3160 |
classVariableNames:d |
|
3161 |
poolDictionaries:s |
|
3162 |
category:cat |
|
3163 |
]. |
|
3164 |
self isLongs ifTrue:[ |
|
3165 |
^ self |
|
3166 |
variableLongSubclass:t |
|
3167 |
instanceVariableNames:f |
|
3168 |
classVariableNames:d |
|
3169 |
poolDictionaries:s |
|
3170 |
category:cat |
|
3171 |
]. |
|
3172 |
self isFloats ifTrue:[ |
|
3173 |
^ self |
|
3174 |
variableFloatSubclass:t |
|
3175 |
instanceVariableNames:f |
|
3176 |
classVariableNames:d |
|
3177 |
poolDictionaries:s |
|
3178 |
category:cat |
|
3179 |
]. |
|
3180 |
self isDoubles ifTrue:[ |
|
3181 |
^ self |
|
3182 |
variableDoubleSubclass:t |
|
3183 |
instanceVariableNames:f |
|
3184 |
classVariableNames:d |
|
3185 |
poolDictionaries:s |
|
3186 |
category:cat |
|
3187 |
]. |
|
3188 |
self isWords ifTrue:[ |
|
3189 |
^ self |
|
3190 |
variableWordSubclass:t |
|
3191 |
instanceVariableNames:f |
|
3192 |
classVariableNames:d |
|
3193 |
poolDictionaries:s |
|
3194 |
category:cat |
|
3195 |
]. |
|
3196 |
^ self |
|
3197 |
variableSubclass:t |
|
3198 |
instanceVariableNames:f |
|
3199 |
classVariableNames:d |
|
3200 |
poolDictionaries:s |
|
3201 |
category:cat |
|
3202 |
! |
|
3203 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3204 |
variableByteSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3205 |
"create a new class as a subclass of an existing class (the receiver) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3206 |
in which the subclass has indexable byte-sized nonpointer variables" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3207 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3208 |
self isVariable ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3209 |
self isBytes ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3210 |
^ self error: |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3211 |
'cannot make a variable byte subclass of a variable non-byte class' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3212 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3213 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3214 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3215 |
^ self class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3216 |
name:t |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3217 |
inEnvironment:Smalltalk |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3218 |
subclassOf:self |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3219 |
instanceVariableNames:f |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3220 |
variable:true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3221 |
words:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3222 |
pointers:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3223 |
classVariableNames:d |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3224 |
poolDictionaries:s |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3225 |
category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3226 |
comment:nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3227 |
changed:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3228 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3229 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3230 |
variableDoubleSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3231 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3232 |
"create a new class as a subclass of an existing class (the receiver) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3233 |
in which the subclass has indexable double-sized nonpointer variables" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3234 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3235 |
self isVariable ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3236 |
self isDoubles ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3237 |
^ self error: |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3238 |
'cannot make a variable double subclass of a variable non-double class' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3239 |
]. |
453 | 3240 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3241 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3242 |
^ self class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3243 |
name:t |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3244 |
inEnvironment:Smalltalk |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3245 |
subclassOf:self |
453 | 3246 |
instanceVariableNames:f |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3247 |
variable:#double |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3248 |
words:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3249 |
pointers:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3250 |
classVariableNames:d |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3251 |
poolDictionaries:s |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3252 |
category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3253 |
comment:nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3254 |
changed:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3255 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3256 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3257 |
variableFloatSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3258 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3259 |
"create a new class as a subclass of an existing class (the receiver) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3260 |
in which the subclass has indexable float-sized nonpointer variables" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3261 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3262 |
self isVariable ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3263 |
self isFloats ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3264 |
^ self error: |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3265 |
'cannot make a variable float subclass of a variable non-float class' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3266 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3267 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3268 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3269 |
^ self class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3270 |
name:t |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3271 |
inEnvironment:Smalltalk |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3272 |
subclassOf:self |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3273 |
instanceVariableNames:f |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3274 |
variable:#float |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3275 |
words:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3276 |
pointers:false |
453 | 3277 |
classVariableNames:d |
3278 |
poolDictionaries:s |
|
3279 |
category:cat |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3280 |
comment:nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3281 |
changed:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3282 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3283 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3284 |
variableLongSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3285 |
"create a new class as a subclass of an existing class (the receiver) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3286 |
in which the subclass has indexable long-sized nonpointer variables" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3287 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3288 |
self isVariable ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3289 |
self isLongs ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3290 |
^ self error: |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3291 |
'cannot make a variable long subclass of a variable non-long class' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3292 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3293 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3294 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3295 |
^ self class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3296 |
name:t |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3297 |
inEnvironment:Smalltalk |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3298 |
subclassOf:self |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3299 |
instanceVariableNames:f |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3300 |
variable:#long |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3301 |
words:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3302 |
pointers:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3303 |
classVariableNames:d |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3304 |
poolDictionaries:s |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3305 |
category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3306 |
comment:nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3307 |
changed:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3308 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3309 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3310 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3311 |
"create a new class as a subclass of an existing class (the receiver) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3312 |
in which the subclass has indexable pointer variables" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3313 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3314 |
self isVariable ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3315 |
self isPointers ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3316 |
^ self error: |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3317 |
'cannot make a variable pointer subclass of a variable non-pointer class' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3318 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3319 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3320 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3321 |
^ self class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3322 |
name:t |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3323 |
inEnvironment:Smalltalk |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3324 |
subclassOf:self |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3325 |
instanceVariableNames:f |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3326 |
variable:true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3327 |
words:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3328 |
pointers:true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3329 |
classVariableNames:d |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3330 |
poolDictionaries:s |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3331 |
category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3332 |
comment:nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3333 |
changed:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3334 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3335 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3336 |
variableWordSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3337 |
"create a new class as a subclass of an existing class (the receiver) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3338 |
in which the subclass has indexable word-sized nonpointer variables" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3339 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3340 |
self isVariable ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3341 |
self isWords ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3342 |
^ self error: |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3343 |
'cannot make a variable word subclass of a variable non-word class' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3344 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3345 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3346 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3347 |
^ self class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3348 |
name:t |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3349 |
inEnvironment:Smalltalk |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3350 |
subclassOf:self |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3351 |
instanceVariableNames:f |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3352 |
variable:true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3353 |
words:true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3354 |
pointers:false |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3355 |
classVariableNames:d |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3356 |
poolDictionaries:s |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3357 |
category:cat |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3358 |
comment:nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3359 |
changed:false |
2 | 3360 |
! ! |
453 | 3361 |
|
662 | 3362 |
!Class class methodsFor:'documentation'! |
3363 |
||
3364 |
version |
|
726
997e30ef8423
careful with empty revision strings
Claus Gittinger <cg@exept.de>
parents:
722
diff
changeset
|
3365 |
^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.104 1995-12-09 21:34:58 cg Exp $' |
708
ba92b2a8477d
include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents:
707
diff
changeset
|
3366 |
! ! |
453 | 3367 |
Class initialize! |