DoItChange.st
changeset 4482 96ecc9e89d37
parent 3492 4e0c2be67618
equal deleted inserted replaced
4481:270f28476380 4482:96ecc9e89d37
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1998 by eXept Software AG
     4  COPYRIGHT (c) 1998 by eXept Software AG
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
     8  be provided or otherwise made available to, or used by, any
    10  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
    11  other person.  No title to or ownership of the software is
    10  hereby transferred.
    12  hereby transferred.
    11 "
    13 "
    12 "{ Package: 'stx:libbasic3' }"
    14 "{ Package: 'stx:libbasic3' }"
       
    15 
       
    16 "{ NameSpace: Smalltalk }"
    13 
    17 
    14 Change subclass:#DoItChange
    18 Change subclass:#DoItChange
    15 	instanceVariableNames:''
    19 	instanceVariableNames:''
    16 	classVariableNames:''
    20 	classVariableNames:''
    17 	poolDictionaries:''
    21 	poolDictionaries:''
    54 isInitialize
    58 isInitialize
    55     "return true, if the given change represents a #initialize message."
    59     "return true, if the given change represents a #initialize message."
    56 
    60 
    57     |tree|
    61     |tree|
    58 
    62 
    59     tree := Parser parseExpression:source.
    63     tree := Parser parseExpression:source onError:nil.
    60     ^ tree isMessage and:[tree selector == #initialize]
    64     ^ tree notNil
       
    65       and:[ tree isMessage 
       
    66       and:[ tree selector == #initialize ]]
    61 !
    67 !
    62 
    68 
    63 sameAs:changeB
    69 sameAs:changeB
    64     "return true, if the given change represents the same change as the receiver."
    70     "return true, if the given change represents the same change as the receiver."
    65 
    71 
    79 !DoItChange methodsFor:'queries'!
    85 !DoItChange methodsFor:'queries'!
    80 
    86 
    81 receiverClassName
    87 receiverClassName
    82     |tree|
    88     |tree|
    83 
    89 
    84     tree := Parser parseExpression:source.
    90     tree := Parser parseExpression:source onError:nil.
    85     (tree isNil or:[tree isSymbol]) ifTrue:[^ nil].
    91     (tree notNil 
    86     tree isMessage ifFalse:[^ nil].
    92       and:[ tree isMessage 
    87     tree receiver isVariable ifFalse:[^ nil].
    93       and:[ tree receiver isVariable 
    88     ^ tree receiver name
    94     ]]) ifTrue:[
       
    95         ^ tree receiver name
       
    96     ].
       
    97     ^ nil
    89 ! !
    98 ! !
    90 
    99 
    91 !DoItChange methodsFor:'testing'!
   100 !DoItChange methodsFor:'testing'!
    92 
   101 
    93 isDoIt
   102 isDoIt
   103 ! !
   112 ! !
   104 
   113 
   105 !DoItChange class methodsFor:'documentation'!
   114 !DoItChange class methodsFor:'documentation'!
   106 
   115 
   107 version
   116 version
   108     ^ '$Header: /cvs/stx/stx/libbasic3/DoItChange.st,v 1.13 2014-02-19 13:05:08 cg Exp $'
   117     ^ '$Header$'
   109 ! !
   118 ! !
   110 
   119