[cfe-dev] Using clang to translate a program in c++ to C or other languages

Miguel Aguilar miguel.aguilar at ice.rwth-aachen.de
Fri Jan 18 02:29:37 PST 2013


Manuel,

Is there any class of clang to be used in order to prepare and emit the 
code, such as the Rewriter class or this one does not apply in this case?

Thanks,

Miguel

On 01/18/2013 11:00 AM, Manuel Klimek wrote:
> +cfe-dev
>
> On Fri, Jan 18, 2013 at 10:56 AM, Miguel Aguilar 
> <miguel.aguilar at ice.rwth-aachen.de 
> <mailto:miguel.aguilar at ice.rwth-aachen.de>> wrote:
>
>     Hi Manuel,
>
>     Is it possible to build a new AST while you walk the original AST?
>
>
> Well, technically it is, but I think emitting code in your other 
> language will be easier and more maintainable...
>
> Cheers,
> /Manuel
>
>
>     Thanks,
>
>     Miguel
>
>
>     On 01/18/2013 08:26 AM, Manuel Klimek wrote:
>>     On Thu, Jan 17, 2013 at 2:58 PM, Miguel Aguilar
>>     <miguel.aguilar at ice.rwth-aachen.de
>>     <mailto:miguel.aguilar at ice.rwth-aachen.de>> wrote:
>>
>>         Hi,
>>
>>         I would like to know the possible approaches to translate a
>>         program in C++ to another language such as C using Clang.
>>         Should I walk in the AST and emit the code or should I create
>>         a new AST in the other language for example?.
>>
>>
>>     The general advice I've seen given most often on this list is to
>>     walk the AST and emit the code.
>>
>>     Cheers,
>>     /Manuel
>>
>>
>>         Thanks in advanced,
>>
>>         Miguel
>>         _______________________________________________
>>         cfe-dev mailing list
>>         cfe-dev at cs.uiuc.edu <mailto:cfe-dev at cs.uiuc.edu>
>>         http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>>
>>
>>     _______________________________________________
>>     cfe-dev mailing list
>>     cfe-dev at cs.uiuc.edu  <mailto:cfe-dev at cs.uiuc.edu>
>>     http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130118/3c1f3047/attachment.html>


More information about the cfe-dev mailing list