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

"
 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.
"

!

documentation
"
    I represent a doIt (typically #initialize-messages) within a changeSet
"
! !

!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:'printing & storing'!

printOn:aStream
    aStream nextPutAll:'DoIt: '.
    aStream nextPutAll:source.
! !

!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 methodsFor:'visiting'!

acceptChangeVisitor:aVisitor
    ^ aVisitor visitDoItChange:self.

    "Created: / 25-11-2011 / 17:15:07 / cg"
! !

!DoItChange class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic3/DoItChange.st,v 1.12 2011/11/25 16:45:23 cg Exp $'
! !