Re: translating oo features to C

Calin Dumitrescu <calin.dumitrescu@gmail.com>
Tue, 5 Feb 2008 00:15:33 -0800 (PST)

          From comp.compilers

Related articles
translating oo features to C dvanguard@gmail.com (2008-01-31)
Re: translating oo features to C csaavedra@alumnos.utalca.cl (Claudio Saavedra) (2008-02-02)
Re: translating oo features to C DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-02-02)
Re: translating oo features to C calin.dumitrescu@gmail.com (Calin Dumitrescu) (2008-02-05)
| List of all articles for this month |

From: Calin Dumitrescu <calin.dumitrescu@gmail.com>
Newsgroups: comp.compilers
Date: Tue, 5 Feb 2008 00:15:33 -0800 (PST)
Organization: Compilers Central
References: 08-02-006
Keywords: OOP, translator, C
Posted-Date: 06 Feb 2008 21:51:44 EST

On Jan 31, 6:19 pm, dvangu...@gmail.com wrote:
> I was wondering if there are any open source compilers out there to
> translate the C++/Java/C#-like object model to C. Thanks,
>
> David


You can use LLVM for C++ to C translation. The result is not exactly
human readable though. Quoting from the FAQ:


==CUT==


Can I use LLVM to convert C++ code to C code?


Yes, you can use LLVM to convert code from any language LLVM supports
to C. Note that the generated C code will be very low level (all loops
are lowered to gotos, etc) and not very pretty (comments are stripped,
original source formatting is totally lost, variables are renamed,
expressions are regrouped), so this may not be what you're looking
for. However, this is a good way to add C++ support for a processor
that does not otherwise have a C++ compiler. ==CUT==




The good thing is that this is not a shoddy source translator. The
input is compiled with GCC (a real compiler) to intermediate
representation (a virtual instruction set) which is then translated to
C.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.