--- a/CodeGeneratorTool.st Tue Sep 22 22:31:26 2009 +0200
+++ b/CodeGeneratorTool.st Wed Sep 23 17:13:08 2009 +0200
@@ -1622,7 +1622,7 @@
classesClassVars := aClass theNonMetaclass allClassVarNames.
aCollectionOfVarNames do:[:name |
- |source varType methodName defaultMethodName|
+ |source varType methodName defaultMethodName argName|
varType := (classesClassVars includes:name)
ifTrue:['static']
@@ -1633,6 +1633,7 @@
name isUppercaseFirst ifTrue:[
methodName := methodName asLowercaseFirst.
].
+ argName := 'something'.
"/ the GETTER
writersOnly ifFalse:[
@@ -1707,8 +1708,12 @@
"/ 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 , ':something\'.
+ source := methodName , ':%3\'. "/ argName
generateComments ifTrue:[
source := source , ' "set the ''%2'' value holder' , ' (automatically generated)"\\'.
].
@@ -1719,7 +1724,7 @@
, ' oldValue := %2 value.\'
, ' %2 removeDependent:self.\'
, ' ].\'
- , ' %2 := something.\'
+ , ' %2 := %3.\' "/ argName
, ' %2 notNil ifTrue:[\'
, ' %2 addDependent:self.\'
, ' ].\'
@@ -1729,18 +1734,18 @@
, ' ].\'
] ifFalse:[
source := source
- , ' %2 := something.'.
+ , ' %2 := %3.'. "/ argName
].
] ifFalse:[
- source := methodName , ':something\'.
+ 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 ~~ something) ifTrue:[\'
- , ' %2 := something.\'
+ , ' (%2 ~~ %3) ifTrue:[\'
+ , ' %2 := %3.\' "/ argName
, ' self changed:#%2.\'
, ' ].\'.
] ifFalse:[
@@ -1749,10 +1754,10 @@
source := source , ' (automatically generated)"\\'.
].
source := source
- , ' %2 := something.'.
+ , ' %2 := %3.'. "/ argName
].
].
- source := (source bindWith:varType with:name) withCRs.
+ source := (source bindWith:varType with:name with:argName) withCRs.
self
compile:source
forClass:aClass
@@ -2765,5 +2770,5 @@
!CodeGeneratorTool class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.61 2009-03-07 11:16:31 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.62 2009-09-23 15:13:08 cg Exp $'
! !