author | Claus Gittinger <cg@exept.de> |
Mon, 19 Jul 2004 13:58:02 +0200 | |
changeset 1394 | 392398eeac68 |
parent 1297 | 9425303f1061 |
child 2126 | d3a862c256c0 |
permissions | -rw-r--r-- |
798 | 1 |
" |
2 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
957 | 14 |
"{ Package: 'stx:libbasic3' }" |
15 |
||
653 | 16 |
Change subclass:#DoItChange |
17 |
instanceVariableNames:'' |
|
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'System-Changes' |
|
21 |
! |
|
22 |
||
23 |
!DoItChange class methodsFor:'documentation'! |
|
24 |
||
798 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
28 |
All Rights Reserved |
|
653 | 29 |
|
798 | 30 |
This software is furnished under a license and may be used |
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
653 | 38 |
! ! |
39 |
||
1132 | 40 |
!DoItChange methodsFor:'applying'! |
41 |
||
42 |
apply |
|
43 |
"apply the change" |
|
44 |
||
45 |
Compiler evaluate:source. |
|
46 |
! ! |
|
47 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
48 |
!DoItChange methodsFor:'comparing'! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
49 |
|
1039 | 50 |
isInitialize |
51 |
"return true, if the given change represents a #initialize message." |
|
52 |
||
53 |
|tree| |
|
54 |
||
55 |
tree := Parser parseExpression:source. |
|
56 |
^ tree isMessage and:[tree selector == #initialize] |
|
57 |
! |
|
58 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
59 |
sameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
60 |
"return true, if the given change represents the same change as the receiver." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
61 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
62 |
changeB isDoIt ifFalse:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
63 |
^ self sameSourceAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
64 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
65 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
66 |
! ! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
67 |
|
1297 | 68 |
!DoItChange methodsFor:'printing & storing'! |
69 |
||
1394 | 70 |
printOn:aStream |
1297 | 71 |
aStream nextPutAll:'DoIt: '. |
72 |
aStream nextPutAll:source. |
|
73 |
! ! |
|
74 |
||
773 | 75 |
!DoItChange methodsFor:'queries'! |
76 |
||
77 |
isDoIt |
|
78 |
^ true |
|
1154
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
79 |
! |
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
80 |
|
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
81 |
receiverClassName |
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
82 |
|tree| |
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
83 |
|
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
84 |
tree := Parser parseExpression:source. |
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
85 |
(tree isNil or:[tree isSymbol]) ifTrue:[^ nil]. |
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
86 |
tree isMessage ifFalse:[^ nil]. |
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
87 |
tree receiver isVariable ifFalse:[^ nil]. |
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
88 |
^ tree receiver name |
773 | 89 |
! ! |
90 |
||
653 | 91 |
!DoItChange class methodsFor:'documentation'! |
92 |
||
93 |
version |
|
1394 | 94 |
^ '$Header: /cvs/stx/stx/libbasic3/DoItChange.st,v 1.10 2004-07-19 11:58:02 cg Exp $' |
653 | 95 |
! ! |