質問

I'm trying to make a source to source converter which translate objective-c code to c source code like valac(which translate vala to c code). I'm not sure if this is objective-c completely but that's how i want it, so it's kind of my own language.

in the start i thought i could just use string.replace but that won't work because one can just create something like this: - (person)myperson {}.

so i thought scanning the text char by char would do it but my code dosen't work for some reason. what is wrong? and can i find a better way of doing it(maybe using regex?). If this way of doing it is right, how can i then convert a char[] array to a string (on line 72)?

So how would i make a objc to c converter? All links and examples are appreciated.

thanks

役に立ちましたか?

解決

LLVM has an Objective-C rewriter and it is open source. Would be a good starting point.

This, btw, is a HUGE undertaking.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top