author | mawalch |
Wed, 17 May 2017 12:52:38 +0200 | |
changeset 4238 | e3824d6ddfb7 |
parent 3492 | 4e0c2be67618 |
child 3838 | 474d8ec95b33 |
child 4482 | 96ecc9e89d37 |
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 |
" |
|
957 | 12 |
"{ Package: 'stx:libbasic3' }" |
13 |
||
653 | 14 |
Change subclass:#DoItChange |
15 |
instanceVariableNames:'' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'System-Changes' |
|
19 |
! |
|
20 |
||
21 |
!DoItChange class methodsFor:'documentation'! |
|
22 |
||
798 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
26 |
All Rights Reserved |
|
653 | 27 |
|
798 | 28 |
This software is furnished under a license and may be used |
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
||
2126 | 36 |
! |
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
I represent a doIt (typically #initialize-messages) within a changeSet |
|
41 |
" |
|
653 | 42 |
! ! |
43 |
||
1132 | 44 |
!DoItChange methodsFor:'applying'! |
45 |
||
46 |
apply |
|
47 |
"apply the change" |
|
48 |
||
49 |
Compiler evaluate:source. |
|
50 |
! ! |
|
51 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
52 |
!DoItChange methodsFor:'comparing'! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
53 |
|
1039 | 54 |
isInitialize |
55 |
"return true, if the given change represents a #initialize message." |
|
56 |
||
57 |
|tree| |
|
58 |
||
59 |
tree := Parser parseExpression:source. |
|
60 |
^ tree isMessage and:[tree selector == #initialize] |
|
61 |
! |
|
62 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
63 |
sameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
64 |
"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
|
65 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
66 |
changeB isDoIt ifFalse:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
67 |
^ self sameSourceAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
68 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
69 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
70 |
! ! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
773
diff
changeset
|
71 |
|
1297 | 72 |
!DoItChange methodsFor:'printing & storing'! |
73 |
||
1394 | 74 |
printOn:aStream |
1297 | 75 |
aStream nextPutAll:'DoIt: '. |
76 |
aStream nextPutAll:source. |
|
77 |
! ! |
|
78 |
||
773 | 79 |
!DoItChange methodsFor:'queries'! |
80 |
||
1154
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 |
||
3492
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
91 |
!DoItChange methodsFor:'testing'! |
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
92 |
|
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
93 |
isDoIt |
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
94 |
^ true |
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
95 |
! ! |
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
96 |
|
2620
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
97 |
!DoItChange methodsFor:'visiting'! |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
98 |
|
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
99 |
acceptChangeVisitor:aVisitor |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
100 |
^ aVisitor visitDoItChange:self. |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
101 |
|
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
102 |
"Created: / 25-11-2011 / 17:15:07 / cg" |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
103 |
! ! |
bd9f1ebdaf44
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
104 |
|
653 | 105 |
!DoItChange class methodsFor:'documentation'! |
106 |
||
107 |
version |
|
3492
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
108 |
^ '$Header: /cvs/stx/stx/libbasic3/DoItChange.st,v 1.13 2014-02-19 13:05:08 cg Exp $' |
653 | 109 |
! ! |
3492
4e0c2be67618
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
2620
diff
changeset
|
110 |