48
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCDefinition subclass:#MCClassDefinition
|
214
|
4 |
instanceVariableNames:'name superclassName variables category type comment commentStamp
|
470
|
5 |
traitComposition classTraitComposition installedClassName'
|
48
|
6 |
classVariableNames:''
|
|
7 |
poolDictionaries:''
|
|
8 |
category:'Monticello-Modeling'
|
|
9 |
!
|
|
10 |
|
|
11 |
|
|
12 |
!MCClassDefinition class methodsFor:'instance creation'!
|
|
13 |
|
|
14 |
name: nameString
|
|
15 |
superclassName: superclassString
|
|
16 |
category: categoryString
|
|
17 |
instVarNames: ivarArray
|
|
18 |
classVarNames: cvarArray
|
|
19 |
poolDictionaryNames: poolArray
|
|
20 |
classInstVarNames: civarArray
|
|
21 |
type: typeSymbol
|
|
22 |
comment: commentString
|
|
23 |
commentStamp: stampString
|
|
24 |
^ self instanceLike:
|
|
25 |
(self new initializeWithName: nameString
|
|
26 |
superclassName: superclassString
|
214
|
27 |
traitComposition: '{}'
|
|
28 |
classTraitComposition: '{}'
|
|
29 |
category: categoryString
|
|
30 |
instVarNames: ivarArray
|
|
31 |
classVarNames: cvarArray
|
|
32 |
poolDictionaryNames: poolArray
|
|
33 |
classInstVarNames: civarArray
|
|
34 |
type: typeSymbol
|
|
35 |
comment: commentString
|
|
36 |
commentStamp: stampString)
|
|
37 |
!
|
|
38 |
|
|
39 |
name: nameString
|
|
40 |
superclassName: superclassString
|
|
41 |
traitComposition: traitCompositionString
|
|
42 |
classTraitComposition: classTraitCompositionString
|
|
43 |
category: categoryString
|
|
44 |
instVarNames: ivarArray
|
|
45 |
classVarNames: cvarArray
|
|
46 |
poolDictionaryNames: poolArray
|
|
47 |
classInstVarNames: civarArray
|
|
48 |
type: typeSymbol
|
|
49 |
comment: commentString
|
|
50 |
commentStamp: stampString
|
|
51 |
|
|
52 |
^ self instanceLike:
|
|
53 |
(self new initializeWithName: nameString
|
|
54 |
superclassName: superclassString
|
|
55 |
traitComposition: traitCompositionString
|
|
56 |
classTraitComposition: classTraitCompositionString
|
48
|
57 |
category: categoryString
|
|
58 |
instVarNames: ivarArray
|
|
59 |
classVarNames: cvarArray
|
|
60 |
poolDictionaryNames: poolArray
|
|
61 |
classInstVarNames: civarArray
|
|
62 |
type: typeSymbol
|
|
63 |
comment: commentString
|
|
64 |
commentStamp: stampString)
|
|
65 |
! !
|
|
66 |
|
|
67 |
!MCClassDefinition class methodsFor:'obsolete'!
|
|
68 |
|
|
69 |
name: nameString
|
|
70 |
superclassName: superclassString
|
|
71 |
category: categoryString
|
|
72 |
instVarNames: ivarArray
|
|
73 |
classVarNames: cvarArray
|
|
74 |
poolDictionaryNames: poolArray
|
|
75 |
classInstVarNames: civarArray
|
|
76 |
comment: commentString
|
|
77 |
^ self name: nameString
|
|
78 |
superclassName: superclassString
|
|
79 |
category: categoryString
|
|
80 |
instVarNames: ivarArray
|
|
81 |
classVarNames: cvarArray
|
|
82 |
poolDictionaryNames: poolArray
|
|
83 |
classInstVarNames: civarArray
|
|
84 |
type: #normal
|
|
85 |
comment: commentString
|
214
|
86 |
|
48
|
87 |
!
|
|
88 |
|
|
89 |
name: nameString
|
|
90 |
superclassName: superclassString
|
|
91 |
category: categoryString
|
|
92 |
instVarNames: ivarArray
|
|
93 |
classVarNames: cvarArray
|
|
94 |
poolDictionaryNames: poolArray
|
|
95 |
classInstVarNames: civarArray
|
|
96 |
type: typeSymbol
|
|
97 |
comment: commentString
|
|
98 |
^ self
|
|
99 |
name: nameString
|
|
100 |
superclassName: superclassString
|
|
101 |
category: categoryString
|
|
102 |
instVarNames: ivarArray
|
|
103 |
classVarNames: cvarArray
|
|
104 |
poolDictionaryNames: poolArray
|
|
105 |
classInstVarNames: civarArray
|
|
106 |
type: typeSymbol
|
|
107 |
comment: commentString
|
|
108 |
commentStamp: nil
|
|
109 |
!
|
|
110 |
|
|
111 |
name: nameString
|
|
112 |
superclassName: superclassString
|
|
113 |
category: categoryString
|
|
114 |
instVarNames: ivarArray
|
|
115 |
comment: commentString
|
|
116 |
^ self name: nameString
|
|
117 |
superclassName: superclassString
|
|
118 |
category: categoryString
|
|
119 |
instVarNames: ivarArray
|
|
120 |
classVarNames: #()
|
|
121 |
poolDictionaryNames: #()
|
|
122 |
classInstVarNames: #()
|
|
123 |
comment: commentString
|
214
|
124 |
|
48
|
125 |
! !
|
|
126 |
|
|
127 |
!MCClassDefinition methodsFor:'accessing'!
|
|
128 |
|
|
129 |
actualClass
|
|
130 |
^Smalltalk classNamed: self className
|
|
131 |
!
|
|
132 |
|
|
133 |
category
|
|
134 |
^ category
|
|
135 |
!
|
|
136 |
|
|
137 |
classInstVarNames
|
|
138 |
^ self selectVariables: #isClassInstanceVariable
|
|
139 |
!
|
|
140 |
|
521
|
141 |
classInstVarNames:civarArray
|
|
142 |
self addVariables: civarArray ofType: MCClassInstanceVariableDefinition.
|
|
143 |
|
|
144 |
"Created: / 25-11-2011 / 17:42:34 / cg"
|
|
145 |
!
|
|
146 |
|
48
|
147 |
className
|
|
148 |
^ name
|
|
149 |
!
|
|
150 |
|
214
|
151 |
classTraitComposition
|
|
152 |
^classTraitComposition
|
|
153 |
!
|
|
154 |
|
|
155 |
classTraitCompositionString
|
|
156 |
^self classTraitComposition ifNil: ['{}'].
|
|
157 |
!
|
|
158 |
|
48
|
159 |
classVarNames
|
|
160 |
^ self selectVariables: #isClassVariable
|
|
161 |
!
|
|
162 |
|
|
163 |
comment
|
214
|
164 |
^ comment ? ''
|
|
165 |
|
|
166 |
"Modified: / 12-09-2010 / 17:07:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
48
|
167 |
!
|
|
168 |
|
|
169 |
commentStamp
|
|
170 |
^ commentStamp
|
|
171 |
!
|
|
172 |
|
|
173 |
description
|
|
174 |
^ Array with: name
|
214
|
175 |
|
48
|
176 |
!
|
|
177 |
|
|
178 |
instVarNames
|
|
179 |
^ self selectVariables: #isInstanceVariable
|
|
180 |
!
|
|
181 |
|
470
|
182 |
installedClass
|
|
183 |
^Smalltalk classNamed: self installedClassName
|
|
184 |
|
|
185 |
"Created: / 07-09-2011 / 13:33:10 / cg"
|
|
186 |
!
|
|
187 |
|
|
188 |
installedClassName
|
|
189 |
"if there was a namespace override, the installedClassName might be different
|
|
190 |
from the class name"
|
|
191 |
|
|
192 |
^ installedClassName ? name
|
|
193 |
|
|
194 |
"Created: / 07-09-2011 / 13:29:21 / cg"
|
|
195 |
!
|
|
196 |
|
48
|
197 |
poolDictionaries
|
|
198 |
^ self selectVariables: #isPoolImport
|
|
199 |
!
|
|
200 |
|
|
201 |
selectVariables: aSelector
|
|
202 |
^ variables select: [:v | v perform: aSelector] thenCollect: [:v | v name]
|
|
203 |
!
|
|
204 |
|
|
205 |
sortKey
|
|
206 |
^ self className
|
|
207 |
!
|
|
208 |
|
|
209 |
superclassName
|
|
210 |
^ superclassName
|
|
211 |
!
|
|
212 |
|
214
|
213 |
traitComposition
|
|
214 |
^traitComposition
|
|
215 |
!
|
|
216 |
|
|
217 |
traitCompositionString
|
|
218 |
^self traitComposition ifNil: ['{}'].
|
|
219 |
!
|
|
220 |
|
48
|
221 |
type
|
|
222 |
^ type
|
|
223 |
!
|
|
224 |
|
|
225 |
variables
|
|
226 |
^ variables
|
|
227 |
! !
|
|
228 |
|
|
229 |
!MCClassDefinition methodsFor:'annotations'!
|
|
230 |
|
|
231 |
printAnnotations: requests on: aStream
|
|
232 |
"Add a string for an annotation pane, trying to fulfill the annotation requests.
|
|
233 |
These might include anything that
|
|
234 |
Preferences defaultAnnotationRequests
|
|
235 |
might return. Which includes anything in
|
|
236 |
Preferences annotationInfo
|
|
237 |
To edit these, use:"
|
|
238 |
"Preferences editAnnotations"
|
|
239 |
|
|
240 |
requests do: [ :aRequest |
|
|
241 |
aRequest == #requirements ifTrue: [
|
|
242 |
self requirements do: [ :req | aStream nextPutAll: req ] separatedBy: [ aStream space ]]
|
|
243 |
] separatedBy: [ aStream space ].
|
|
244 |
! !
|
|
245 |
|
|
246 |
!MCClassDefinition methodsFor:'comparing'!
|
|
247 |
|
|
248 |
hash
|
|
249 |
| hash |
|
214
|
250 |
hash := String stringHash: name initialHash: 0.
|
|
251 |
hash := String stringHash: superclassName initialHash: hash.
|
|
252 |
hash := String stringHash: self traitCompositionString initialHash: hash.
|
|
253 |
hash := String stringHash: self classTraitComposition asString initialHash: hash.
|
|
254 |
hash := String stringHash: (category ifNil: ['']) initialHash: hash.
|
|
255 |
hash := String stringHash: type initialHash: hash.
|
48
|
256 |
variables do: [
|
|
257 |
:v |
|
214
|
258 |
hash := String stringHash: v name initialHash: hash.
|
48
|
259 |
].
|
|
260 |
^ hash
|
|
261 |
!
|
|
262 |
|
|
263 |
provisions
|
|
264 |
^ Array with: name
|
|
265 |
!
|
|
266 |
|
|
267 |
requirements
|
|
268 |
^ (Array with: superclassName), self poolDictionaries
|
|
269 |
! !
|
|
270 |
|
214
|
271 |
!MCClassDefinition methodsFor:'converting'!
|
|
272 |
|
|
273 |
asChange
|
|
274 |
|
|
275 |
^ClassDefinitionChange new
|
|
276 |
mcDefinition: self;
|
|
277 |
className: name;
|
|
278 |
superClassName: superclassName;
|
464
|
279 |
instanceVariableNames: (String streamContents: [:s|self instVarNames do:[:nm|s nextPutAll: nm; space]]) ;
|
|
280 |
classVariableNames: (String streamContents: [:s|self classVarNames do:[:nm|s nextPutAll: nm; space]]) ;
|
|
281 |
classInstanceVariableNames: (String streamContents: [:s|self classInstVarNames do:[:nm|s nextPutAll: nm; space]]) ;
|
214
|
282 |
category: category;
|
|
283 |
yourself
|
|
284 |
|
|
285 |
"Created: / 13-10-2010 / 17:11:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
286 |
"Modified: / 08-11-2010 / 17:56:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
464
|
287 |
"Modified: / 04-09-2011 / 19:50:56 / cg"
|
214
|
288 |
! !
|
|
289 |
|
48
|
290 |
!MCClassDefinition methodsFor:'initializing'!
|
|
291 |
|
|
292 |
addVariables: aCollection ofType: aClass
|
|
293 |
variables addAll: (aCollection collect: [:var | aClass name: var asString]).
|
|
294 |
!
|
|
295 |
|
|
296 |
defaultCommentStamp
|
|
297 |
^ String new
|
|
298 |
|
|
299 |
"The version below avoids stomping on stamps already in the image
|
|
300 |
|
|
301 |
^ (Smalltalk at: name ifPresent: [:c | c organization commentStamp])
|
|
302 |
ifNil: ['']
|
|
303 |
"
|
214
|
304 |
|
48
|
305 |
! !
|
|
306 |
|
|
307 |
!MCClassDefinition methodsFor:'installing'!
|
|
308 |
|
|
309 |
createClass
|
470
|
310 |
"cg: changed to honor any nameSpace query override"
|
|
311 |
|
|
312 |
| env superClass class installedSuperclassName|
|
|
313 |
|
|
314 |
env := MCStXNamespaceQuery query ? Smalltalk.
|
|
315 |
superClass := env at: superclassName.
|
|
316 |
(superClass isNil and:[env ~~ Smalltalk]) ifTrue:[
|
|
317 |
superClass := Smalltalk at: superclassName.
|
|
318 |
].
|
|
319 |
|
214
|
320 |
"Create class if not exists"
|
470
|
321 |
superClass isNil ifTrue:[
|
|
322 |
installedSuperclassName := (env == Smalltalk)
|
|
323 |
ifTrue:[ superclassName ]
|
|
324 |
ifFalse:[ env name ,'::',superclassName].
|
|
325 |
superClass := Class undeclared: installedSuperclassName
|
|
326 |
].
|
|
327 |
|
|
328 |
"/ env := superClass environment.
|
214
|
329 |
|
|
330 |
class := (ClassBuilder new)
|
156
|
331 |
name: name
|
470
|
332 |
inEnvironment: env
|
156
|
333 |
subclassOf: superClass
|
|
334 |
type: type
|
|
335 |
instanceVariableNames: self instanceVariablesString
|
|
336 |
classVariableNames: self classVariablesString
|
|
337 |
poolDictionaries: self sharedPoolsString
|
|
338 |
category: category.
|
470
|
339 |
|
|
340 |
installedClassName := class name.
|
|
341 |
|
214
|
342 |
self traitComposition ifNotNil: [
|
|
343 |
class setTraitComposition: (Compiler
|
|
344 |
evaluate: self traitComposition) asTraitComposition ].
|
|
345 |
self classTraitComposition ifNotNil: [
|
|
346 |
class class setTraitComposition: (Compiler
|
|
347 |
evaluate: self classTraitComposition) asTraitComposition ].
|
|
348 |
^class.
|
156
|
349 |
|
214
|
350 |
"Modified: / 09-11-2010 / 08:30:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
470
|
351 |
"Modified (comment): / 07-09-2011 / 13:32:38 / cg"
|
48
|
352 |
!
|
|
353 |
|
|
354 |
load
|
214
|
355 |
| class |
|
|
356 |
|
470
|
357 |
(class := self createClass) notNil ifTrue:[
|
|
358 |
class class instanceVariableNames: self classInstanceVariablesString.
|
|
359 |
self hasComment ifTrue: [class classComment: comment stamp: commentStamp]
|
|
360 |
].
|
214
|
361 |
class package: MCStXPackageQuery query.
|
|
362 |
|
|
363 |
"Modified: / 14-09-2010 / 22:10:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
470
|
364 |
"Modified: / 07-09-2011 / 13:01:53 / cg"
|
214
|
365 |
!
|
|
366 |
|
|
367 |
stringForSortedVariablesOfType: aSymbol
|
|
368 |
^ String streamContents:
|
|
369 |
[:stream |
|
|
370 |
(self selectVariables: aSymbol) asSortedCollection
|
|
371 |
do: [:ea | stream nextPutAll: ea]
|
|
372 |
separatedBy: [stream space]]
|
48
|
373 |
!
|
|
374 |
|
|
375 |
stringForVariablesOfType: aSymbol
|
|
376 |
^ String streamContents:
|
|
377 |
[:stream |
|
|
378 |
(self selectVariables: aSymbol)
|
|
379 |
do: [:ea | stream nextPutAll: ea]
|
|
380 |
separatedBy: [stream space]]
|
|
381 |
!
|
|
382 |
|
|
383 |
unload
|
|
384 |
Smalltalk removeClassNamed: name
|
|
385 |
! !
|
|
386 |
|
|
387 |
!MCClassDefinition methodsFor:'printing'!
|
|
388 |
|
|
389 |
classInstanceVariablesString
|
|
390 |
^ self stringForVariablesOfType: #isClassInstanceVariable
|
|
391 |
!
|
|
392 |
|
|
393 |
classVariablesString
|
214
|
394 |
^ self stringForSortedVariablesOfType: #isClassVariable
|
48
|
395 |
!
|
|
396 |
|
|
397 |
definitionString
|
|
398 |
^ String streamContents: [:stream | self printDefinitionOn: stream]
|
|
399 |
!
|
|
400 |
|
|
401 |
instanceVariablesString
|
|
402 |
^ self stringForVariablesOfType: #isInstanceVariable
|
|
403 |
!
|
|
404 |
|
|
405 |
kindOfSubclass
|
214
|
406 |
type = #normal ifTrue: [^ ' subclass:'].
|
|
407 |
type = #words ifTrue: [^ ' variableWordSubclass:'].
|
|
408 |
type = #variable ifTrue: [^ ' variableSubclass:'].
|
|
409 |
type = #bytes ifTrue: [^ ' variableByteSubclass:'].
|
|
410 |
type = #weak ifTrue: [^ ' weakSubclass:' ].
|
|
411 |
type = #compiledMethod ifTrue: [^ ' variableByteSubclass:' ].
|
|
412 |
self error: 'Unrecognized class type'
|
|
413 |
|
|
414 |
"Modified: / 11-09-2010 / 18:13:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
48
|
415 |
!
|
|
416 |
|
|
417 |
printDefinitionOn: stream
|
214
|
418 |
stream
|
|
419 |
nextPutAll: self superclassName;
|
|
420 |
nextPutAll: self kindOfSubclass;
|
|
421 |
nextPut: $# ;
|
|
422 |
nextPutAll: self className;
|
|
423 |
cr; tab.
|
|
424 |
self hasTraitComposition ifTrue: [
|
|
425 |
stream
|
|
426 |
nextPutAll: 'uses: ';
|
|
427 |
nextPutAll: self traitCompositionString;
|
|
428 |
cr; tab ].
|
|
429 |
stream
|
|
430 |
nextPutAll: 'instanceVariableNames:';
|
|
431 |
store: self instanceVariablesString;
|
|
432 |
cr; tab;
|
|
433 |
nextPutAll: 'classVariableNames:';
|
|
434 |
store: self classVariablesString;
|
|
435 |
cr; tab;
|
|
436 |
nextPutAll: 'poolDictionaries:';
|
|
437 |
store: self sharedPoolsString;
|
|
438 |
cr; tab;
|
|
439 |
nextPutAll: 'category:';
|
|
440 |
store: self category asString
|
|
441 |
|
|
442 |
"Modified: / 11-09-2010 / 18:11:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
48
|
443 |
!
|
|
444 |
|
|
445 |
sharedPoolsString
|
214
|
446 |
^ self stringForSortedVariablesOfType: #isPoolImport
|
48
|
447 |
!
|
|
448 |
|
|
449 |
source
|
|
450 |
^ self definitionString
|
|
451 |
!
|
|
452 |
|
|
453 |
summary
|
|
454 |
^ name
|
|
455 |
! !
|
|
456 |
|
|
457 |
!MCClassDefinition methodsFor:'serializing'!
|
|
458 |
|
|
459 |
initializeWithName: nameString
|
|
460 |
superclassName: superclassString
|
|
461 |
category: categoryString
|
|
462 |
instVarNames: ivarArray
|
|
463 |
classVarNames: cvarArray
|
|
464 |
poolDictionaryNames: poolArray
|
|
465 |
classInstVarNames: civarArray
|
|
466 |
type: typeSymbol
|
|
467 |
comment: commentString
|
|
468 |
commentStamp: stampStringOrNil
|
214
|
469 |
name := nameString asSymbol.
|
|
470 |
superclassName := superclassString ifNil: ['nil'] ifNotNil: [superclassString asSymbol].
|
|
471 |
category := categoryString.
|
|
472 |
name = #CompiledMethod ifTrue: [type := #compiledMethod] ifFalse: [type := typeSymbol].
|
|
473 |
comment := (commentString ? '') asStringWithSqueakLineEndings.
|
|
474 |
commentStamp := stampStringOrNil ifNil: [self defaultCommentStamp].
|
|
475 |
variables := OrderedCollection new.
|
156
|
476 |
self addVariables: ivarArray ofType: MCInstanceVariableDefinition.
|
|
477 |
self addVariables: cvarArray ofType: MCClassVariableDefinition.
|
|
478 |
self addVariables: poolArray ofType: MCPoolImportDefinition.
|
|
479 |
self addVariables: civarArray ofType: MCClassInstanceVariableDefinition.
|
214
|
480 |
|
|
481 |
"Modified: / 12-09-2010 / 17:09:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
482 |
!
|
|
483 |
|
|
484 |
storeDataOn: aDataStream
|
|
485 |
| instVarSize |
|
|
486 |
instVarSize := (self hasTraitComposition or: [ self hasClassTraitComposition ])
|
|
487 |
ifTrue: [ self class instSize ]
|
|
488 |
ifFalse: [ self class instSize - 2 ].
|
|
489 |
aDataStream
|
|
490 |
beginInstance: self class
|
|
491 |
size: instVarSize.
|
|
492 |
1 to: instVarSize do: [ :index |
|
|
493 |
aDataStream nextPut: (self instVarAt: index) ].
|
48
|
494 |
! !
|
|
495 |
|
|
496 |
!MCClassDefinition methodsFor:'testing'!
|
|
497 |
|
|
498 |
hasClassInstanceVariables
|
|
499 |
^ (self selectVariables: #isClassInstanceVariable) isEmpty not
|
|
500 |
!
|
|
501 |
|
214
|
502 |
hasClassTraitComposition
|
|
503 |
^self classTraitCompositionString ~= '{}'
|
|
504 |
!
|
|
505 |
|
48
|
506 |
hasComment
|
214
|
507 |
^ comment isEmptyOrNil not
|
|
508 |
!
|
|
509 |
|
|
510 |
hasTraitComposition
|
|
511 |
^self traitCompositionString ~= '{}'
|
48
|
512 |
!
|
|
513 |
|
|
514 |
isClassDefinition
|
|
515 |
^ true
|
|
516 |
!
|
|
517 |
|
|
518 |
isCodeDefinition
|
|
519 |
^ true
|
|
520 |
! !
|
|
521 |
|
|
522 |
!MCClassDefinition methodsFor:'visiting'!
|
|
523 |
|
214
|
524 |
= aDefinition
|
|
525 |
^super = aDefinition
|
|
526 |
and: [superclassName = aDefinition superclassName
|
|
527 |
and: [self traitCompositionString = aDefinition traitCompositionString
|
|
528 |
and: [self classTraitCompositionString = aDefinition classTraitCompositionString
|
|
529 |
and: [category = aDefinition category
|
|
530 |
and: [type = aDefinition type
|
|
531 |
and: [variables = aDefinition variables
|
|
532 |
and: [comment = aDefinition comment]]]]]]]
|
|
533 |
|
|
534 |
"Modified: / 18-08-2009 / 10:19:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
535 |
!
|
|
536 |
|
48
|
537 |
accept: aVisitor
|
214
|
538 |
aVisitor visitClassDefinition: self.
|
|
539 |
(self hasClassInstanceVariables or: [self hasClassTraitComposition])
|
|
540 |
ifTrue: [aVisitor visitMetaclassDefinition: self].
|
|
541 |
|
|
542 |
!
|
|
543 |
|
|
544 |
initializeWithName: nameString
|
|
545 |
superclassName: superclassString
|
|
546 |
traitComposition: traitCompositionString
|
|
547 |
classTraitComposition: classTraitCompositionString
|
|
548 |
category: categoryString
|
|
549 |
instVarNames: ivarArray
|
|
550 |
classVarNames: cvarArray
|
|
551 |
poolDictionaryNames: poolArray
|
|
552 |
classInstVarNames: civarArray
|
|
553 |
type: typeSymbol
|
|
554 |
comment: commentString
|
|
555 |
commentStamp: stampStringOrNil
|
|
556 |
name := nameString asSymbol.
|
|
557 |
superclassName := superclassString ifNil: ['nil'] ifNotNil: [superclassString asSymbol].
|
|
558 |
traitComposition := traitCompositionString.
|
|
559 |
classTraitComposition := classTraitCompositionString.
|
|
560 |
category := categoryString.
|
|
561 |
name = #CompiledMethod ifTrue: [type := #compiledMethod] ifFalse: [type := typeSymbol].
|
521
|
562 |
comment := commentString isNil ifTrue:[ nil] ifFalse:[ commentString asStringWithSqueakLineEndings].
|
214
|
563 |
commentStamp := stampStringOrNil ifNil: [self defaultCommentStamp].
|
|
564 |
variables := OrderedCollection new.
|
|
565 |
self addVariables: ivarArray ofType: MCInstanceVariableDefinition.
|
|
566 |
self addVariables: cvarArray ofType: MCClassVariableDefinition.
|
|
567 |
self addVariables: poolArray ofType: MCPoolImportDefinition.
|
|
568 |
self addVariables: civarArray ofType: MCClassInstanceVariableDefinition.
|
|
569 |
|
|
570 |
"Modified: / 12-09-2010 / 16:05:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
521
|
571 |
"Modified: / 25-11-2011 / 17:30:38 / cg"
|
48
|
572 |
! !
|
|
573 |
|
|
574 |
!MCClassDefinition class methodsFor:'documentation'!
|
|
575 |
|
|
576 |
version
|
521
|
577 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCClassDefinition.st,v 1.7 2011-11-25 16:46:22 cg Exp $'
|
156
|
578 |
!
|
|
579 |
|
|
580 |
version_CVS
|
521
|
581 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCClassDefinition.st,v 1.7 2011-11-25 16:46:22 cg Exp $'
|
214
|
582 |
!
|
|
583 |
|
|
584 |
version_SVN
|
|
585 |
^ '§Id: MCClassDefinition.st 24 2010-11-09 14:00:17Z vranyj1 §'
|
48
|
586 |
! !
|