Rewrite : Modify RewriteModernObjC::SynthMessageExpr

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Rewrite : Modify RewriteModernObjC::SynthMessageExpr

Vincent R.
Hi,

So I am progressing slowly with my rewriting project to convert objc to
c# but now I am able at least
to transform method declaration from this

- (void) setAlternateTitle: (NSString *)aString
{
   [_cell setAlternateTitle: aString];
   [self setNeedsDisplay: YES];
}

to this:

public virtual void setAlternateTitle_(NSString *aString) {
   [self->_cell setAlternateTitle:aString];
   [self setNeedsDisplay:((BOOL)1)];
}

there is still the * after NSString after the parameter but I think I
will manage to remove it.
However rewrite the objc syntax for function call is a lot tricky
because in the original implementation
that I have disabled it was generating something like :

static void _I_NSButton_setAlternateTitle_(NSButton * self, SEL _cmd,
NSString *aString) {
   ((void (*)(id, SEL, NSString *))(void *)objc_msgSend)((id)(*(id
*)((char *)self + OBJC_IVAR_$_NSControl$_cell)),
sel_registerName("setAlternateTitle:"), (NSString *)aString);
   ((void (*)(id, SEL, BOOL))(void *)objc_msgSend)((id)self,
sel_registerName("setNeedsDisplay:"), ((BOOL)1));
}

The method that rewrite this part is located inside
RewriteModernObjC::SynthMessageExpr but it's a presently a bit too
tricky for
me to understand how to change it to obtain :

_cell.setAlternateTitle(aString);
this.setNeedsDisplay(true);


I am also ready to hire someone just for this task, if this is
something that can interest you please contact me at vrichomme A.T
smartmobili D.O.T com.
Please note that I might not be able to answer you during the next 10
days.

Thanks




_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev