gui/PPAddParserRefactoring.st
changeset 335 30d654399277
equal deleted inserted replaced
334:1db7e42031c8 335:30d654399277
       
     1 "{ Package: 'stx:goodies/petitparser/gui' }"
       
     2 
       
     3 Refactoring subclass:#PPAddParserRefactoring
       
     4 	instanceVariableNames:'superclass name cateogry'
       
     5 	classVariableNames:''
       
     6 	poolDictionaries:''
       
     7 	category:'PetitGui-Refactoring'
       
     8 !
       
     9 
       
    10 
       
    11 !PPAddParserRefactoring class methodsFor:'instance creation'!
       
    12 
       
    13 name: aString category: aSymbol
       
    14 	^ self name: aString category: aSymbol superclass: PPCompositeParser
       
    15 !
       
    16 
       
    17 name: aString category: aSymbol superclass: aClass
       
    18 	^ self new
       
    19 		setName: aString;
       
    20 		setCategory: aSymbol;
       
    21 		setSuperclass: aClass;
       
    22 		yourself
       
    23 ! !
       
    24 
       
    25 !PPAddParserRefactoring methodsFor:'accessing'!
       
    26 
       
    27 startProductionSource
       
    28 	^ 'start
       
    29 	^ self shouldBeImplemented'
       
    30 ! !
       
    31 
       
    32 !PPAddParserRefactoring methodsFor:'initialization'!
       
    33 
       
    34 setCategory: aSymbol
       
    35 	cateogry := aSymbol asSymbol
       
    36 !
       
    37 
       
    38 setName: aString
       
    39 	name := aString
       
    40 !
       
    41 
       
    42 setSuperclass: aClass
       
    43 	superclass := self classObjectFor: aClass
       
    44 ! !
       
    45 
       
    46 !PPAddParserRefactoring methodsFor:'preconditions'!
       
    47 
       
    48 preconditions
       
    49 	^ self checkCompositeParser: superclass
       
    50 ! !
       
    51 
       
    52 !PPAddParserRefactoring methodsFor:'transforming'!
       
    53 
       
    54 transform
       
    55         self performComponentRefactoring: (AddClassRefactoring
       
    56                 model: self model
       
    57                 addClass: name
       
    58                 superclass: superclass
       
    59                 subclasses: #()
       
    60                 category: cateogry).
       
    61         (self classObjectFor: name)
       
    62                 compile: self startProductionSource
       
    63                 classified: #(accessing)
       
    64 ! !
       
    65 
       
    66 !PPAddParserRefactoring class methodsFor:'documentation'!
       
    67 
       
    68 version
       
    69     ^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/PPAddParserRefactoring.st,v 1.1 2014-03-04 21:15:19 cg Exp $'
       
    70 !
       
    71 
       
    72 version_CVS
       
    73     ^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/PPAddParserRefactoring.st,v 1.1 2014-03-04 21:15:19 cg Exp $'
       
    74 ! !
       
    75