DoItChange.st
author Claus Gittinger <cg@exept.de>
Wed, 17 Jul 2002 15:54:44 +0200
changeset 1154 1c2809b4abc2
parent 1132 f8b195e81f85
child 1297 9425303f1061
permissions -rw-r--r--
+receiverClassName (to extract the classes name of a Foo initialize doIt)

"
 COPYRIGHT (c) 1998 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"


"{ Package: 'stx:libbasic3' }"

Change subclass:#DoItChange
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'System-Changes'
!

!DoItChange class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1998 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

! !

!DoItChange methodsFor:'applying'!

apply
    "apply the change"

    Compiler evaluate:source.
! !

!DoItChange methodsFor:'comparing'!

isInitialize
    "return true, if the given change represents a #initialize message."

    |tree|

    tree := Parser parseExpression:source.
    ^ tree isMessage and:[tree selector == #initialize]
!

sameAs:changeB
    "return true, if the given change represents the same change as the receiver."

    changeB isDoIt ifFalse:[^ false].
    ^ self sameSourceAs:changeB


! !

!DoItChange methodsFor:'queries'!

isDoIt
    ^ true
!

receiverClassName
    |tree|

    tree := Parser parseExpression:source.
    (tree isNil or:[tree isSymbol]) ifTrue:[^ nil].
    tree isMessage ifFalse:[^ nil].
    tree receiver isVariable ifFalse:[^ nil].
    ^ tree receiver name
! !

!DoItChange class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic3/DoItChange.st,v 1.8 2002-07-17 13:54:44 cg Exp $'
! !