[cfe-dev] Source to source transformation : objc to c#

Jacob Carlborg doob at me.com
Sun Jul 14 02:38:19 PDT 2013


On 2013-07-13 01:57, Vincent R. wrote:
> Hi,
>
> Before spending some money I would like to know if what I want to do is
> possible or not.
> I would need a tool to transform some objc code into c#, for instance
> let's consider the following dummy objc class :
>
> Do you think llvm/clang/rewrite is appropriate to do that or am I asking
> too much ?

Yes. I have written a tool using libclang that translate C and 
Objective-C header files to D modules. This only translate the 
declarations and not the implementation.

It's written in D, but it's similar enough to C# to not be a problem to 
read it.

https://github.com/jacob-carlborg/dstep

libclang has functions for comment AST introspection so it should be 
possible to keep the comments, or even translate them to C# comments.

http://clang.llvm.org/doxygen/group__CINDEX__COMMENT.html

-- 
/Jacob Carlborg




More information about the cfe-dev mailing list