CodeGeneratorTool.st
changeset 9236 3559b8aad270
parent 9232 e16232d1a1dc
child 9261 5d817a638b5d
equal deleted inserted replaced
9235:fdcf1d96cdfe 9236:3559b8aad270
  2482 !
  2482 !
  2483 
  2483 
  2484 createInstanceCreationMethodWithSetupFor:selector category:category in:aMetaClass
  2484 createInstanceCreationMethodWithSetupFor:selector category:category in:aMetaClass
  2485     "add an inst-creation method"
  2485     "add an inst-creation method"
  2486 
  2486 
  2487     |template|
  2487     |template instMthd argNames|
  2488 
  2488 
  2489     (aMetaClass includesSelector:selector) ifFalse:[
  2489     (aMetaClass includesSelector:selector) ifFalse:[
  2490         template := Parser methodSpecificationForSelector:selector.
  2490         instMthd := aMetaClass theNonMetaclass compiledMethodAt:selector.
       
  2491         (instMthd notNil     
       
  2492         and:[  (argNames := instMthd methodArgNames) notEmptyOrNil ])
       
  2493         ifTrue:[
       
  2494             template := Parser methodSpecificationForSelector:selector argNames:argNames.
       
  2495         ] ifFalse:[
       
  2496             template := Parser methodSpecificationForSelector:selector.
       
  2497         ].
       
  2498 
  2491         self 
  2499         self 
  2492             compile:
  2500             compile:
  2493 template , '
  2501 template , '
  2494     ^ self new ' , template , '
  2502     ^ self new ' , template , '
  2495 '                   
  2503 '                   
  3151 ! !
  3159 ! !
  3152 
  3160 
  3153 !CodeGeneratorTool class methodsFor:'documentation'!
  3161 !CodeGeneratorTool class methodsFor:'documentation'!
  3154 
  3162 
  3155 version
  3163 version
  3156     ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.79 2009-11-10 19:40:12 cg Exp $'
  3164     ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.80 2009-11-11 11:46:32 cg Exp $'
  3157 !
  3165 !
  3158 
  3166 
  3159 version_CVS
  3167 version_CVS
  3160     ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.79 2009-11-10 19:40:12 cg Exp $'
  3168     ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.80 2009-11-11 11:46:32 cg Exp $'
  3161 ! !
  3169 ! !