work in progress - remove duplicate code in code generation methods
- CustomRefactoring
class: CustomRefactoring
- CustomContext
class: CustomContext
- CustomDummyTests
class: CustomDummyTests
- TestClass
class: TestClass
added: #inst:
- CustomCodeGeneratorOrRefactoring
class: CustomCodeGeneratorOrRefactoring
- CustomPerspective
class: CustomPerspective
- CustomManager
class: CustomManager
- jn_refactoring_custom
class: jn_refactoring_custom
comment/format in:
#excludedFromPreRequisites
#extensionMethodNames
#referencedPreRequisites
changed:
#classNamesAndAttributes
#mandatoryPreRequisites
- CustomFooBarBazCodeGenerator
class: CustomFooBarBazCodeGenerator
- CustomCodeGenerator
class: CustomCodeGenerator
class definition
added:
#addMethod
#initialize
- MockCustomContext
class: MockCustomContext
- CustomSourceCodeBuilder
class: CustomSourceCodeBuilder
added:
#buildedMethod
#method
comment/format in: #source:
- CustomVisitorCodeGeneratorTests
class: CustomVisitorCodeGeneratorTests
changed: #test_dummy
- CustomMenuBuilder
class: CustomMenuBuilder
- CustomAccessMethodsCodeGeneratorTests
class: CustomAccessMethodsCodeGeneratorTests
added:
#test_dummy
#test_getter_method_source_created
- CustomVisitorCodeGenerator
class: CustomVisitorCodeGenerator
changed: #createAcceptVisitorMethod:in:withParameter:
- CustomVisitorCodeGeneratorAcceptVisitor
class: CustomVisitorCodeGeneratorAcceptVisitor
- CustomAccessMethodsCodeGenerator
class: CustomAccessMethodsCodeGenerator
class definition
added:9 methods
- extensions
...
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/CustomAccessMethodsCodeGenerator.st Mon Mar 17 23:45:05 2014 +0100
@@ -0,0 +1,291 @@
+"{ Package: 'jn:refactoring_custom' }"
+
+CustomCodeGenerator subclass:#CustomAccessMethodsCodeGenerator
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Interface-Refactoring-Custom'
+!
+
+
+!CustomAccessMethodsCodeGenerator class methodsFor:'accessing-presentation'!
+
+description
+ "Returns more detailed description of the receiver"
+
+ ^ 'Generates three bogus methods - foo, bar and baz'
+
+ "Modified: / 26-01-2014 / 21:46:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+label
+ "Returns show label describing the receiver. This label
+ is used in UI as menu item/tree item label."
+
+ ^ 'foo, bar, baz...'
+
+ "Modified: / 26-01-2014 / 21:45:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CustomAccessMethodsCodeGenerator class methodsFor:'queries'!
+
+availableInContext: aCustomContext
+ "Returns true if the generator/refactoring is available in given
+ context, false otherwise.
+
+ Called by the UI to figure out what generators / refactorings
+ are available at given point. See class CustomContext for details."
+
+ ^ aCustomContext selectedClasses notEmptyOrNil
+
+ "Created: / 26-01-2014 / 21:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 26-01-2014 / 23:39:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 04-03-2014 / 22:34:19 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+!
+
+availableInPerspective:aCustomPerspective
+ "Returns true if the generator/refactoring is available in given
+ perspective, false otherwise.
+
+ Called by the UI to figure out what generators / refactorings
+ to show"
+
+ ^ aCustomPerspective isClassPerspective
+
+ "Created: / 26-01-2014 / 21:40:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 04-03-2014 / 21:41:34 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
+!CustomAccessMethodsCodeGenerator methodsFor:'code generation-individual methods'!
+
+createAccessMethodsFor:aCollectionOfVarNames in:aClass withChange:withChange asValueHolder:asValueHolder readersOnly:readersOnly writersOnly:writersOnly lazyInitialization:lazyInitialization
+ "workhorse for creating access methods for instvars."
+
+ |classesClassVars generateCommentsForSetters generateCommentsForGetters|
+
+ self startCollectChanges.
+
+ generateCommentsForSetters := userPreferences generateCommentsForSetters.
+ generateCommentsForGetters := userPreferences generateCommentsForGetters.
+
+ classesClassVars := aClass theNonMetaclass allClassVarNames.
+
+ aCollectionOfVarNames do:[:name |
+ |source varType methodName defaultMethodName argName|
+
+ varType := (classesClassVars includes:name)
+ ifTrue:['static']
+ ifFalse:[
+ (aClass isMeta ifTrue:['classInstVar'] ifFalse:['instance'])].
+
+ methodName := name.
+ name isUppercaseFirst ifTrue:[
+ (name conform:[:ch | ch isLetter not or:[ch isUppercase]]) ifFalse:[ "/ allow all-uppercase for class-vars
+ methodName := methodName asLowercaseFirst.
+ ]
+ ].
+ argName := 'something'.
+
+ "/ the GETTER
+ writersOnly ifFalse:[
+ lazyInitialization ifTrue:[
+ defaultMethodName := 'default' , name asUppercaseFirst.
+ ].
+
+ "check, if method is not already present"
+ (aClass includesSelector:(methodName asSymbol)) ifFalse:[
+ asValueHolder ifTrue:[
+ source := methodName , '\'.
+ generateComments ifTrue:[
+ source := source , ' "return/create the ''%2'' value holder (automatically generated)"\\'.
+ ].
+ source := source , ' %2 isNil ifTrue:[\'.
+ lazyInitialization ifTrue:[
+ source := source
+ , ' %2 := self class %3 asValue.\'.
+ ] ifFalse:[
+ source := source
+ , ' %2 := ValueHolder new.\'.
+ ].
+
+ withChange ifTrue:[
+ source := source
+ , ' %2 addDependent:self.\'.
+ ].
+ source := source
+ , ' ].\'
+ , ' ^ %2'.
+ ] ifFalse:[
+ source := methodName , '\'.
+ lazyInitialization ifTrue:[
+ generateCommentsForGetters ifTrue:[
+ source := source , ' "return the %1 instance variable ''%2'' with lazy instance creation (automatically generated)"\\'.
+ ].
+ source := source
+ , ' %2 isNil ifTrue:[\'
+ , ' %2 := self class %3.\'
+ , ' ].\'
+ , ' ^ %2'.
+ ] ifFalse:[
+ generateCommentsForGetters ifTrue:[
+ source := source , ' "return the %1 instance variable ''%2'' (automatically generated)"\\'.
+ ].
+ source := source
+ , ' ^ %2'.
+ ].
+ ].
+ source := (source bindWith:varType with:name with:defaultMethodName) withCRs.
+ self compile:source forClass:aClass inCategory:(asValueHolder ifTrue:[#aspects] ifFalse:[#accessing]).
+ ] ifTrue:[
+ Transcript showCR:'method ''', methodName , ''' already present'
+ ].
+
+ "/ default for lazy on class side
+ lazyInitialization ifTrue:[
+ (aClass theMetaclass includesSelector:(defaultMethodName asSymbol)) ifFalse:[
+ source := defaultMethodName , '\'.
+ generateComments ifTrue:[
+ source := source , ' "default value for the ''%2'' instance variable (automatically generated)"\\'.
+ ].
+ source := source
+ , ' self shouldImplement.\'
+ , ' ^ nil.'.
+ source := (source bindWith:varType with:name) withCRs.
+ self compile:source forClass:aClass theMetaclass inCategory:#defaults.
+ ].
+ ].
+ ].
+
+ "/ the SETTER
+ readersOnly ifFalse:[
+ (aClass includesSelector:((methodName , ':') asSymbol)) ifFalse:[
+ ((methodName size > 2) and:[ (methodName startsWith:'is') and:[ (methodName at:3) isUppercase ]])
+ ifTrue:[
+ argName := 'aBoolean'
+ ].
+ asValueHolder ifTrue:[
+ source := methodName , ':%3\'. "/ argName
+ generateComments ifTrue:[
+ source := source , ' "set the ''%2'' value holder' , ' (automatically generated)"\\'.
+ ].
+ withChange ifTrue:[
+ source := source
+ , ' |oldValue newValue|\\'
+ , ' %2 notNil ifTrue:[\'
+ , ' oldValue := %2 value.\'
+ , ' %2 removeDependent:self.\'
+ , ' ].\'
+ , ' %2 := %3.\' "/ argName
+ , ' %2 notNil ifTrue:[\'
+ , ' %2 addDependent:self.\'
+ , ' ].\'
+ , ' newValue := %2 value.\'
+ , ' oldValue ~~ newValue ifTrue:[\'
+ , ' self update:#value with:newValue from:%2.\'
+ , ' ].\'
+ ] ifFalse:[
+ source := source
+ , ' %2 := %3.'. "/ argName
+ ].
+ ] ifFalse:[
+ source := methodName , ':%3\'. "/ argName
+ withChange ifTrue:[
+ generateComments ifTrue:[
+ source := source , ' "set the value of the %1 variable ''%2'''.
+ source := source , ' and send a change notification (automatically generated)"\\'.
+ ].
+ source := source
+ , ' (%2 ~~ %3) ifTrue:[\'
+ , ' %2 := %3.\' "/ argName
+ , ' self changed:#%2.\'
+ , ' ].\'.
+ ] ifFalse:[
+ generateCommentsForSetters ifTrue:[
+ source := source , ' "set the value of the %1 variable ''%2'''.
+ source := source , ' (automatically generated)"\\'.
+ ].
+ source := source
+ , ' %2 := %3.'. "/ argName
+ ].
+ ].
+ source := (source bindWith:varType with:name with:argName) withCRs.
+ self
+ compile:source
+ forClass:aClass
+ inCategory:(asValueHolder ifTrue:[#aspects] ifFalse:[#accessing]).
+ ] ifTrue:[
+ Transcript showCR:'method ''', methodName , ':'' already present'
+ ].
+ ].
+ ].
+
+ self executeCollectedChangesNamed:('Add Accessors').
+
+ "Created: / 12-03-2014 / 23:35:18 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+!
+
+createSetterFor:aVarName in:aClass
+ self
+ createAccessMethodsFor:{ aVarName} in:aClass
+ withChange:false asValueHolder:false readersOnly:false writersOnly:true
+ lazyInitialization:false
+
+ "Created: / 14-03-2014 / 23:12:46 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+!
+
+setterMethodFor:aVarName
+ |source methodName argName comment|
+
+ comment := ''.
+ userPreferences generateCommentsForSetters ifTrue:[
+ comment := ' "set the value of the %1 variable ''%2'' (automatically generated)"\\'.
+ ].
+
+ methodName := aVarName.
+ argName := 'something'.
+ source := methodName , ':%3\'. "/ argName
+ source := source , ' %2 := %3.'.
+
+ ^ source
+
+ "Created: / 15-03-2014 / 22:13:00 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
+!CustomAccessMethodsCodeGenerator methodsFor:'executing'!
+
+executeInContext:aCustomContext
+ "Generates the code or perform the refactoring. This method
+ is guaranteed to be called only if #availableInContext: returns
+ true.
+
+ Called by the UI when user want to perform the task"
+
+ | classes |
+
+ classes := aCustomContext selectedClasses.
+ classes do:[:class |
+ (class canUnderstand: #foo) ifFalse:[
+ self compile: 'foo
+ ^ self bar' forClass: class inCategory: 'foo - bar - baz'
+ ].
+ (class canUnderstand: #bar) ifFalse:[
+ self compile: 'bar
+ ^ self baz' forClass: class inCategory: 'foo - bar - baz'
+ ].
+ (class canUnderstand: #baz) ifFalse:[
+ self compile: 'baz
+ ^ 42' forClass: class inCategory: 'foo - bar - baz'
+ ].
+
+ ].
+
+ "Modified: / 26-01-2014 / 23:41:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CustomAccessMethodsCodeGenerator class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/CustomAccessMethodsCodeGeneratorTests.st Mon Mar 17 23:45:05 2014 +0100
@@ -0,0 +1,37 @@
+"{ Package: 'jn:refactoring_custom' }"
+
+TestCase subclass:#CustomAccessMethodsCodeGeneratorTests
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Interface-Refactoring-Custom-Tests'
+!
+
+!CustomAccessMethodsCodeGeneratorTests methodsFor:'tests'!
+
+test_dummy
+
+ self assert: 'ab' = 'ab'.
+
+ "Created: / 16-03-2014 / 19:07:59 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+!
+
+test_getter_method_source_created
+
+ Transcript showCR:(CustomSourceCodeBuilder new
+ source: ('acceptVisitor: visitor forEffect: effect
+ "Double dispatch back to the visitor, passing my type encoded in
+ the selector (visitor pattern) and given effect"
+
+ "stub code automatically generated - please change if required"
+
+ ^visitor `@sel: self forEffect: effect');
+ replace: '`@sel:' with: 'sellll' asSymbol;
+ buildedMethod).
+
+ self assert: 'ab' = 'ab'.
+
+ "Created: / 16-03-2014 / 19:14:18 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+ "Modified: / 17-03-2014 / 09:48:41 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
--- a/CustomCodeGenerator.st Sun Mar 09 21:16:29 2014 +0100
+++ b/CustomCodeGenerator.st Mon Mar 17 23:45:05 2014 +0100
@@ -1,7 +1,7 @@
"{ Package: 'jn:refactoring_custom' }"
CustomCodeGeneratorOrRefactoring subclass:#CustomCodeGenerator
- instanceVariableNames:''
+ instanceVariableNames:'sourcesInBuildProcess'
classVariableNames:''
poolDictionaries:''
category:'Interface-Refactoring-Custom'
@@ -24,6 +24,25 @@
"Created: / 26-01-2014 / 21:38:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!CustomCodeGenerator methodsFor:'code generation'!
+
+addMethod
+
+ sourcesInBuildProcess add: (CustomSourceCodeBuilder method).
+ ^ sourcesInBuildProcess last.
+
+ "Created: / 17-03-2014 / 22:10:10 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
+!CustomCodeGenerator methodsFor:'initialization'!
+
+initialize
+
+ sourcesInBuildProcess := OrderedCollection new
+
+ "Created: / 17-03-2014 / 22:27:32 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
!CustomCodeGenerator class methodsFor:'documentation'!
version_HG
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/CustomSourceCodeBuilder.st Mon Mar 17 23:45:05 2014 +0100
@@ -0,0 +1,37 @@
+"{ Package: 'jn:refactoring_custom' }"
+
+CodeGenerator subclass:#CustomSourceCodeBuilder
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Interface-Refactoring-Custom'
+!
+
+CustomSourceCodeBuilder subclass:#Method
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:CustomSourceCodeBuilder
+!
+
+!CustomSourceCodeBuilder class methodsFor:'instance creation'!
+
+method
+
+ ^ CustomSourceCodeBuilder::Method new
+
+ "Created: / 17-03-2014 / 22:56:01 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
+!CustomSourceCodeBuilder methodsFor:'accessing'!
+
+buildedMethod
+ | method |
+ method := RBParser parseRewriteMethod: source.
+ method source: nil.
+ method acceptVisitor: self.
+ ^ method formattedCode.
+
+ "Created: / 17-03-2014 / 09:24:15 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
--- a/CustomVisitorCodeGenerator.st Sun Mar 09 21:16:29 2014 +0100
+++ b/CustomVisitorCodeGenerator.st Mon Mar 17 23:45:05 2014 +0100
@@ -72,24 +72,26 @@
createAcceptVisitorMethod:selector in:aClass withParameter: withParameter
"create an acceptVisitor: method"
- self assert:( aClass isMeta not ).
+ "/ to be moved to availableInContext
+ "/ self assert:( aClass isMeta not ).
- (aClass includesSelector:#'acceptVisitor:') ifFalse:[
- self
- compile:
-(('acceptVisitor:visitor %2
+ "/ to be extracted from source and moved in executing method
+ "/ (aClass includesSelector:#'acceptVisitor:') ifFalse:[
+ (self addMethod)
+ protocol: 'visiting';
+ source: ('acceptVisitor:visitor `@parameter:
"Double dispatch back to the visitor, passing my type encoded in
- the selector (visitor pattern)"
+ the selector (visitor pattern)"
"stub code automatically generated - please change if required"
- ^ visitor %1self %2
-') bindWith:selector with:(withParameter ifTrue:[' with: parameter'] ifFalse:['']))
- forClass:aClass
- inCategory:#visiting.
- ]
+ ^ visitor `@selector:self `@parameter:
+');
+ replace: '`@selector:' with: selector;
+ replace: '`@parameter:' with: (withParameter ifTrue:[' with: parameter'] ifFalse:['']).
"Created: / 09-03-2014 / 19:02:09 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+ "Modified: / 17-03-2014 / 23:41:07 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
! !
!CustomVisitorCodeGenerator methodsFor:'executing'!
--- a/CustomVisitorCodeGeneratorTests.st Sun Mar 09 21:16:29 2014 +0100
+++ b/CustomVisitorCodeGeneratorTests.st Mon Mar 17 23:45:05 2014 +0100
@@ -11,9 +11,10 @@
test_dummy
- self assert: 'a' = 'a'.
+ self assert: 'ab' = 'ab'.
"Created: / 25-08-2013 / 09:46:14 / user"
+ "Modified: / 16-03-2014 / 19:07:08 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
!
test_visitor_pattern_methods_generated
--- a/Make.proto Sun Mar 09 21:16:29 2014 +0100
+++ b/Make.proto Mon Mar 17 23:45:05 2014 +0100
@@ -34,7 +34,7 @@
# add the path(es) here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libview2
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libview2
# if you need any additional defines for embedded C code,
@@ -137,10 +137,13 @@
$(OUTDIR)CustomManager.$(O) CustomManager.$(H): CustomManager.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)CustomMenuBuilder.$(O) CustomMenuBuilder.$(H): CustomMenuBuilder.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)CustomPerspective.$(O) CustomPerspective.$(H): CustomPerspective.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)CustomSourceCodeBuilder.$(O) CustomSourceCodeBuilder.$(H): CustomSourceCodeBuilder.st $(INCLUDE_TOP)/stx/libtool/CodeGenerator.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TestClass.$(O) TestClass.$(H): TestClass.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)jn_refactoring_custom.$(O) jn_refactoring_custom.$(H): jn_refactoring_custom.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)CustomCodeGenerator.$(O) CustomCodeGenerator.$(H): CustomCodeGenerator.st $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)/stx/libtool/CodeGeneratorTool.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)CustomRefactoring.$(O) CustomRefactoring.$(H): CustomRefactoring.st $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)/stx/libtool/CodeGeneratorTool.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)MockCustomContext.$(O) MockCustomContext.$(H): MockCustomContext.st $(INCLUDE_TOP)/jn/refactoring_custom/CustomContext.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)CustomAccessMethodsCodeGenerator.$(O) CustomAccessMethodsCodeGenerator.$(H): CustomAccessMethodsCodeGenerator.st $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGenerator.$(H) $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)/stx/libtool/CodeGeneratorTool.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)CustomFooBarBazCodeGenerator.$(O) CustomFooBarBazCodeGenerator.$(H): CustomFooBarBazCodeGenerator.st $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGenerator.$(H) $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)/stx/libtool/CodeGeneratorTool.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)CustomVisitorCodeGenerator.$(O) CustomVisitorCodeGenerator.$(H): CustomVisitorCodeGenerator.st $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGenerator.$(H) $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)/stx/libtool/CodeGeneratorTool.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)CustomVisitorCodeGeneratorAcceptVisitor.$(O) CustomVisitorCodeGeneratorAcceptVisitor.$(H): CustomVisitorCodeGeneratorAcceptVisitor.st $(INCLUDE_TOP)/jn/refactoring_custom/CustomVisitorCodeGenerator.$(H) $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGenerator.$(H) $(INCLUDE_TOP)/jn/refactoring_custom/CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)/stx/libtool/CodeGeneratorTool.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
--- a/Make.spec Sun Mar 09 21:16:29 2014 +0100
+++ b/Make.spec Mon Mar 17 23:45:05 2014 +0100
@@ -55,10 +55,13 @@
CustomManager \
CustomMenuBuilder \
CustomPerspective \
+ CustomSourceCodeBuilder \
+ TestClass \
jn_refactoring_custom \
CustomCodeGenerator \
CustomRefactoring \
MockCustomContext \
+ CustomAccessMethodsCodeGenerator \
CustomFooBarBazCodeGenerator \
CustomVisitorCodeGenerator \
CustomVisitorCodeGeneratorAcceptVisitor \
@@ -72,10 +75,13 @@
$(OUTDIR_SLASH)CustomManager.$(O) \
$(OUTDIR_SLASH)CustomMenuBuilder.$(O) \
$(OUTDIR_SLASH)CustomPerspective.$(O) \
+ $(OUTDIR_SLASH)CustomSourceCodeBuilder.$(O) \
+ $(OUTDIR_SLASH)TestClass.$(O) \
$(OUTDIR_SLASH)jn_refactoring_custom.$(O) \
$(OUTDIR_SLASH)CustomCodeGenerator.$(O) \
$(OUTDIR_SLASH)CustomRefactoring.$(O) \
$(OUTDIR_SLASH)MockCustomContext.$(O) \
+ $(OUTDIR_SLASH)CustomAccessMethodsCodeGenerator.$(O) \
$(OUTDIR_SLASH)CustomFooBarBazCodeGenerator.$(O) \
$(OUTDIR_SLASH)CustomVisitorCodeGenerator.$(O) \
$(OUTDIR_SLASH)CustomVisitorCodeGeneratorAcceptVisitor.$(O) \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/TestClass.st Mon Mar 17 23:45:05 2014 +0100
@@ -0,0 +1,22 @@
+"{ Package: 'jn:refactoring_custom' }"
+
+Object subclass:#TestClass
+ instanceVariableNames:'inst'
+ classVariableNames:'Cls'
+ poolDictionaries:''
+ category:'Interface-Refactoring-Custom'
+!
+
+TestClass class instanceVariableNames:'instcc'
+
+"
+ No other class instance variables are inherited by this class.
+"
+!
+
+!TestClass methodsFor:'accessing'!
+
+inst:something
+ inst := something.
+! !
+
--- a/abbrev.stc Sun Mar 09 21:16:29 2014 +0100
+++ b/abbrev.stc Mon Mar 17 23:45:05 2014 +0100
@@ -1,17 +1,21 @@
# automagically generated by the project definition
# this file is needed for stc to be able to compile modules independently.
# it provides information about a classes filename, category and especially namespace.
+CustomAccessMethodsCodeGeneratorTests CustomAccessMethodsCodeGeneratorTests jn:refactoring_custom 'Interface-Refactoring-Custom-Tests' 1
CustomCodeGeneratorOrRefactoring CustomCodeGeneratorOrRefactoring jn:refactoring_custom 'Interface-Refactoring-Custom' 0
CustomContext CustomContext jn:refactoring_custom 'Interface-Refactoring-Custom' 0
CustomDummyTests CustomDummyTests jn:refactoring_custom 'Interface-Refactoring-Custom-Tests' 1
CustomManager CustomManager jn:refactoring_custom 'Interface-Refactoring-Custom' 0
CustomMenuBuilder CustomMenuBuilder jn:refactoring_custom 'Interface-Refactoring-Custom-UI' 0
CustomPerspective CustomPerspective jn:refactoring_custom 'Interface-Refactoring-Custom' 1
+CustomSourceCodeBuilder CustomSourceCodeBuilder jn:refactoring_custom 'Interface-Refactoring-Custom' 0
CustomVisitorCodeGeneratorTests CustomVisitorCodeGeneratorTests jn:refactoring_custom 'Interface-Refactoring-Custom-Tests' 1
+TestClass TestClass jn:refactoring_custom 'Interface-Refactoring-Custom' 1
jn_refactoring_custom jn_refactoring_custom jn:refactoring_custom '* Projects & Packages *' 3
CustomCodeGenerator CustomCodeGenerator jn:refactoring_custom 'Interface-Refactoring-Custom' 0
CustomRefactoring CustomRefactoring jn:refactoring_custom 'Interface-Refactoring-Custom' 0
MockCustomContext MockCustomContext jn:refactoring_custom 'Interface-Refactoring-Custom' 0
+CustomAccessMethodsCodeGenerator CustomAccessMethodsCodeGenerator jn:refactoring_custom 'Interface-Refactoring-Custom' 0
CustomFooBarBazCodeGenerator CustomFooBarBazCodeGenerator jn:refactoring_custom 'Interface-Refactoring-Custom' 0
CustomVisitorCodeGenerator CustomVisitorCodeGenerator jn:refactoring_custom 'Interface-Refactoring-Custom' 0
CustomVisitorCodeGeneratorAcceptVisitor CustomVisitorCodeGeneratorAcceptVisitor jn:refactoring_custom 'Interface-Refactoring-Custom' 0
--- a/bc.mak Sun Mar 09 21:16:29 2014 +0100
+++ b/bc.mak Mon Mar 17 23:45:05 2014 +0100
@@ -34,7 +34,7 @@
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libview2
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libview2
LOCALDEFINES=
STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -varPrefix=$(LIBNAME)
@@ -83,10 +83,13 @@
$(OUTDIR)CustomManager.$(O) CustomManager.$(H): CustomManager.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)CustomMenuBuilder.$(O) CustomMenuBuilder.$(H): CustomMenuBuilder.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)CustomPerspective.$(O) CustomPerspective.$(H): CustomPerspective.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)CustomSourceCodeBuilder.$(O) CustomSourceCodeBuilder.$(H): CustomSourceCodeBuilder.st $(INCLUDE_TOP)\stx\libtool\CodeGenerator.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TestClass.$(O) TestClass.$(H): TestClass.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)jn_refactoring_custom.$(O) jn_refactoring_custom.$(H): jn_refactoring_custom.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)CustomCodeGenerator.$(O) CustomCodeGenerator.$(H): CustomCodeGenerator.st $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)\stx\libtool\CodeGeneratorTool.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)CustomRefactoring.$(O) CustomRefactoring.$(H): CustomRefactoring.st $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)\stx\libtool\CodeGeneratorTool.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)MockCustomContext.$(O) MockCustomContext.$(H): MockCustomContext.st $(INCLUDE_TOP)\jn\refactoring_custom\CustomContext.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)CustomAccessMethodsCodeGenerator.$(O) CustomAccessMethodsCodeGenerator.$(H): CustomAccessMethodsCodeGenerator.st $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGenerator.$(H) $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)\stx\libtool\CodeGeneratorTool.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)CustomFooBarBazCodeGenerator.$(O) CustomFooBarBazCodeGenerator.$(H): CustomFooBarBazCodeGenerator.st $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGenerator.$(H) $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)\stx\libtool\CodeGeneratorTool.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)CustomVisitorCodeGenerator.$(O) CustomVisitorCodeGenerator.$(H): CustomVisitorCodeGenerator.st $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGenerator.$(H) $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)\stx\libtool\CodeGeneratorTool.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)CustomVisitorCodeGeneratorAcceptVisitor.$(O) CustomVisitorCodeGeneratorAcceptVisitor.$(H): CustomVisitorCodeGeneratorAcceptVisitor.st $(INCLUDE_TOP)\jn\refactoring_custom\CustomVisitorCodeGenerator.$(H) $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGenerator.$(H) $(INCLUDE_TOP)\jn\refactoring_custom\CustomCodeGeneratorOrRefactoring.$(H) $(INCLUDE_TOP)\stx\libtool\CodeGeneratorTool.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
--- a/jn_refactoring_custom.st Sun Mar 09 21:16:29 2014 +0100
+++ b/jn_refactoring_custom.st Mon Mar 17 23:45:05 2014 +0100
@@ -27,9 +27,10 @@
(the browser has a menu function for that)"
^ #(
- #'stx:goodies/sunit' "TestAsserter - superclass of CustomDummyTests "
+ #'stx:goodies/refactoryBrowser/parser' "RBProgramNodeVisitor - superclass of CustomSourceCodeBuilder "
+ #'stx:goodies/sunit' "TestAsserter - superclass of CustomAccessMethodsCodeGeneratorTests "
#'stx:libbasic' "LibraryDefinition - superclass of jn_refactoring_custom "
- #'stx:libtool' "CodeGeneratorTool - superclass of CustomCodeGenerator "
+ #'stx:libtool' "CodeGenerator - superclass of CustomSourceCodeBuilder "
#'stx:libview2' "ApplicationModel - extended "
)
!
@@ -66,17 +67,21 @@
^ #(
"<className> or (<className> attributes...) in load order"
+ (CustomAccessMethodsCodeGeneratorTests autoload)
CustomCodeGeneratorOrRefactoring
CustomContext
(CustomDummyTests autoload)
CustomManager
CustomMenuBuilder
CustomPerspective
+ CustomSourceCodeBuilder
(CustomVisitorCodeGeneratorTests autoload)
+ TestClass
#'jn_refactoring_custom'
CustomCodeGenerator
CustomRefactoring
MockCustomContext
+ CustomAccessMethodsCodeGenerator
CustomFooBarBazCodeGenerator
CustomVisitorCodeGenerator
CustomVisitorCodeGeneratorAcceptVisitor
--- a/libInit.cc Sun Mar 09 21:16:29 2014 +0100
+++ b/libInit.cc Mon Mar 17 23:45:05 2014 +0100
@@ -32,10 +32,13 @@
_CustomManager_Init(pass,__pRT__,snd);
_CustomMenuBuilder_Init(pass,__pRT__,snd);
_CustomPerspective_Init(pass,__pRT__,snd);
+_CustomSourceCodeBuilder_Init(pass,__pRT__,snd);
+_TestClass_Init(pass,__pRT__,snd);
_jn_137refactoring_137custom_Init(pass,__pRT__,snd);
_CustomCodeGenerator_Init(pass,__pRT__,snd);
_CustomRefactoring_Init(pass,__pRT__,snd);
_MockCustomContext_Init(pass,__pRT__,snd);
+_CustomAccessMethodsCodeGenerator_Init(pass,__pRT__,snd);
_CustomFooBarBazCodeGenerator_Init(pass,__pRT__,snd);
_CustomVisitorCodeGenerator_Init(pass,__pRT__,snd);
_CustomVisitorCodeGeneratorAcceptVisitor_Init(pass,__pRT__,snd);
--- a/refactoring_custom.rc Sun Mar 09 21:16:29 2014 +0100
+++ b/refactoring_custom.rc Mon Mar 17 23:45:05 2014 +0100
@@ -25,7 +25,7 @@
VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
VALUE "ProductName", "ProductName\0"
VALUE "ProductVersion", "6.2.3.1118\0"
- VALUE "ProductDate", "Sun, 09 Mar 2014 20:12:54 GMT\0"
+ VALUE "ProductDate", "Mon, 17 Mar 2014 22:42:10 GMT\0"
END
END