DoItChange.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 29 Jan 2012 12:51:41 +0000
branchjv
changeset 3011 1997ff6e7e55
parent 2620 bd9f1ebdaf44
child 3012 4f40b8304d54
permissions -rw-r--r--
trunk branched into /branches/jv
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     1
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     2
 COPYRIGHT (c) 1998 by eXept Software AG
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     3
              All Rights Reserved
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     4
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     5
 This software is furnished under a license and may be used
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     6
 only in accordance with the terms of that license and with the
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     8
 be provided or otherwise made available to, or used by, any
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     9
 other person.  No title to or ownership of the software is
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    10
 hereby transferred.
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    11
"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
    13
653
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Change subclass:#DoItChange
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-Changes'
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!DoItChange class methodsFor:'documentation'!
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    23
copyright
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    24
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    25
 COPYRIGHT (c) 1998 by eXept Software AG
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    26
              All Rights Reserved
653
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    28
 This software is furnished under a license and may be used
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    29
 only in accordance with the terms of that license and with the
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    31
 be provided or otherwise made available to, or used by, any
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    32
 other person.  No title to or ownership of the software is
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    33
 hereby transferred.
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    34
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    35
2126
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    36
!
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    37
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    38
documentation
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    39
"
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    40
    I represent a doIt (typically #initialize-messages) within a changeSet
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    41
"
653
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
! !
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
1132
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    44
!DoItChange methodsFor:'applying'!
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    45
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    46
apply
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    47
    "apply the change"
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    48
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    49
    Compiler evaluate:source.
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    50
! !
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    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
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    54
isInitialize
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    55
    "return true, if the given change represents a #initialize message."
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    56
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    57
    |tree|
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    58
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    59
    tree := Parser parseExpression:source.
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    60
    ^ tree isMessage and:[tree selector == #initialize]
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    61
!
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    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
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    72
!DoItChange methodsFor:'printing & storing'!
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    73
1394
392398eeac68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
    74
printOn:aStream
1297
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    75
    aStream nextPutAll:'DoIt: '.
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    76
    aStream nextPutAll:source.
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    77
! !
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    78
773
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    79
!DoItChange methodsFor:'queries'!
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    80
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    81
isDoIt
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    82
    ^ true
1154
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
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    85
receiverClassName
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    86
    |tree|
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    87
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    88
    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
    89
    (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
    90
    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
    91
    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
    92
    ^ tree receiver name
773
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    93
! !
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    94
2620
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
    95
!DoItChange methodsFor:'visiting'!
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
    96
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
    97
acceptChangeVisitor:aVisitor
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
    98
    ^ aVisitor visitDoItChange:self.
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
    99
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   100
    "Created: / 25-11-2011 / 17:15:07 / cg"
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
653
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
!DoItChange class methodsFor:'documentation'!
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
version
3011
1997ff6e7e55 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2620
diff changeset
   106
    ^ '$Header: /cvs/stx/stx/libbasic3/DoItChange.st,v 1.12 2011/11/25 16:45:23 cg Exp $'
1997ff6e7e55 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2620
diff changeset
   107
! !