author | Claus Gittinger <cg@exept.de> |
Sun, 23 Feb 2020 16:35:34 +0100 | |
changeset 4557 | 069040b49bec |
parent 4482 | 96ecc9e89d37 |
permissions | -rw-r--r-- |
4482 | 1 |
"{ Encoding: utf8 }" |
2 |
||
798 | 3 |
" |
4 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
957 | 14 |
"{ Package: 'stx:libbasic3' }" |
15 |
||
4482 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
653 | 18 |
Change subclass:#DoItChange |
19 |
instanceVariableNames:'' |
|
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'System-Changes' |
|
23 |
! |
|
24 |
||
25 |
!DoItChange class methodsFor:'documentation'! |
|
26 |
||
798 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
30 |
All Rights Reserved |
|
653 | 31 |
|
798 | 32 |
This software is furnished under a license and may be used |
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
||
2126 | 40 |
! |
41 |
||
42 |
documentation |
|
43 |
" |
|
44 |
I represent a doIt (typically #initialize-messages) within a changeSet |
|
45 |
" |
|
653 | 46 |
! ! |
47 |
||
1132 | 48 |
!DoItChange methodsFor:'applying'! |
49 |
||
50 |
apply |
|
51 |
"apply the change" |
|
52 |
||
53 |
Compiler evaluate:source. |
|
54 |
! ! |
|
55 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
56 |
!DoItChange methodsFor:'comparing'! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
57 |
|
1039 | 58 |
isInitialize |
59 |
"return true, if the given change represents a #initialize message." |
|
60 |
||
61 |
|tree| |
|
62 |
||
4482 | 63 |
tree := Parser parseExpression:source onError:nil. |
64 |
^ tree notNil |
|
65 |
and:[ tree isMessage |
|
66 |
and:[ tree selector == #initialize ]] |
|
1039 | 67 |
! |
68 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
69 |
sameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
70 |
"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
|
71 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
72 |
changeB isDoIt ifFalse:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
73 |
^ self sameSourceAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
74 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
75 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
76 |
! ! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
77 |
|
1297 | 78 |
!DoItChange methodsFor:'printing & storing'! |
79 |
||
1394 | 80 |
printOn:aStream |
1297 | 81 |
aStream nextPutAll:'DoIt: '. |
82 |
aStream nextPutAll:source. |
|
83 |
! ! |
|
84 |
||
773 | 85 |
!DoItChange methodsFor:'queries'! |
86 |
||
1154
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
87 |
receiverClassName |
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
88 |
|tree| |
1c2809b4abc2
+receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents:
1132
diff
changeset
|
89 |
|
4482 | 90 |
tree := Parser parseExpression:source onError:nil. |
91 |
(tree notNil |
|
92 |
and:[ tree isMessage |
|
93 |
and:[ tree receiver isVariable |
|
94 |
]]) ifTrue:[ |
|
95 |
^ tree receiver name |
|
96 |
]. |
|
97 |
^ nil |
|
773 | 98 |
! ! |
99 |
||
3492
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
100 |
!DoItChange methodsFor:'testing'! |
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
101 |
|
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
102 |
isDoIt |
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
103 |
^ true |
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
104 |
! ! |
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
105 |
|
2620
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
106 |
!DoItChange methodsFor:'visiting'! |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
107 |
|
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
108 |
acceptChangeVisitor:aVisitor |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
109 |
^ aVisitor visitDoItChange:self. |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
110 |
|
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
111 |
"Created: / 25-11-2011 / 17:15:07 / cg" |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
112 |
! ! |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
113 |
|
653 | 114 |
!DoItChange class methodsFor:'documentation'! |
115 |
||
116 |
version |
|
4482 | 117 |
^ '$Header$' |
653 | 118 |
! ! |
3492
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
119 |