339
|
1 |
"{ Package: 'stx:goodies/petitparser/gui' }"
|
|
2 |
|
|
3 |
RBRefactoring subclass:#PPRemoveProdcutionRefactoring
|
|
4 |
instanceVariableNames:'production class'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'PetitGui-Refactoring'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!PPRemoveProdcutionRefactoring class methodsFor:'instance creation'!
|
|
12 |
|
|
13 |
onClass: aClass production: aSelector
|
|
14 |
^ self new
|
|
15 |
setClass: aClass;
|
|
16 |
setProduction: aSelector;
|
|
17 |
yourself
|
|
18 |
! !
|
|
19 |
|
|
20 |
!PPRemoveProdcutionRefactoring methodsFor:'initialization'!
|
|
21 |
|
|
22 |
setClass: aClass
|
|
23 |
class := self classObjectFor: aClass
|
|
24 |
!
|
|
25 |
|
|
26 |
setProduction: aSymbol
|
|
27 |
production := aSymbol
|
|
28 |
! !
|
|
29 |
|
|
30 |
!PPRemoveProdcutionRefactoring methodsFor:'preconditions'!
|
|
31 |
|
|
32 |
preconditions
|
|
33 |
^ (self checkCompositeParser: class)
|
|
34 |
& (RBCondition definesSelector: production asSymbol in: class)
|
|
35 |
& (RBCondition definesInstanceVariable: production asString in: class)
|
|
36 |
! !
|
|
37 |
|
|
38 |
!PPRemoveProdcutionRefactoring methodsFor:'transforming'!
|
|
39 |
|
|
40 |
transform
|
|
41 |
class removeMethod: production asSymbol.
|
|
42 |
class removeInstanceVariable: production asString
|
|
43 |
! !
|
|
44 |
|
|
45 |
!PPRemoveProdcutionRefactoring class methodsFor:'documentation'!
|
|
46 |
|
|
47 |
version
|
|
48 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/PPRemoveProdcutionRefactoring.st,v 1.1 2014-03-04 21:15:48 cg Exp $'
|
|
49 |
!
|
|
50 |
|
|
51 |
version_CVS
|
|
52 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/PPRemoveProdcutionRefactoring.st,v 1.1 2014-03-04 21:15:48 cg Exp $'
|
|
53 |
! !
|
|
54 |
|