author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 08 Sep 2015 02:23:45 +0100 | |
changeset 540 | 694ad2f97c65 |
parent 363 | ee34d5fd575a |
permissions | -rw-r--r-- |
339 | 1 |
"{ Package: 'stx:goodies/petitparser/gui' }" |
2 |
||
363
ee34d5fd575a
class: PPRemoveProdcutionRefactoring
Claus Gittinger <cg@exept.de>
parents:
339
diff
changeset
|
3 |
Refactoring subclass:#PPRemoveProdcutionRefactoring |
339 | 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 |
|
363
ee34d5fd575a
class: PPRemoveProdcutionRefactoring
Claus Gittinger <cg@exept.de>
parents:
339
diff
changeset
|
48 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/PPRemoveProdcutionRefactoring.st,v 1.2 2014-03-04 23:33:59 cg Exp $' |
339 | 49 |
! |
50 |
||
51 |
version_CVS |
|
363
ee34d5fd575a
class: PPRemoveProdcutionRefactoring
Claus Gittinger <cg@exept.de>
parents:
339
diff
changeset
|
52 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/PPRemoveProdcutionRefactoring.st,v 1.2 2014-03-04 23:33:59 cg Exp $' |
339 | 53 |
! ! |
54 |