Related articles |
---|
Source to Source compilation - targeting C? marktxx@yahoo.com (Mark Txx) (2009-12-28) |
Re: Source to Source compilation - targeting C? idbaxter@semdesigns.com (Ira Baxter) (2009-12-30) |
Re: Source to Source compilation - targeting C? cr88192@hotmail.com (BGB / cr88192) (2009-12-30) |
Re: Source to Source compilation - targeting C? Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2009-12-31) |
From: | Detlef Meyer-Eltz <Meyer-Eltz@t-online.de> |
Newsgroups: | comp.compilers |
Date: | Thu, 31 Dec 2009 15:49:28 +0100 |
Organization: | Compilers Central |
References: | 09-12-043 |
Keywords: | translator, tools |
Posted-Date: | 01 Jan 2010 11:43:28 EST |
>Anyone have suggestions for a way to take a fairly simple "custom"
>high level language (syntax and semantics) to target C as the output?
I suggest the parser generator IDE "TextTransformer":
http://www.TextTransformer.com
By this program you can create a parser for your custom language as
well as the translator inside of a single visual user interface
(Windows). The Source to Source compilation can be done either with
TextTransformer itself as standalone application or by means of
C++-code, which can be generated from the TextTransformer project.
I am the author of TextTransformer and I just have made such a
converter from Delphi to C++
http://www.texttransformer.com/Delphi2Cpp_en.html
>The "tool" must be relatively easy to use assuming ...
>but not much in the way of code generation knowledge.
My method is to construct a tree in the form of the target language
just while the source code is parsed. This tree finally has to be
written top down with some pretty-printing manipulations at the end.
So the most important you have to know is how to combine tree nodes
and branches in the right order. The greatest difficulty is to manage
type information.
I'm still busy to improve Delphi2Cpp and you could profit from my
experiences if you like to use TextTransformer.
--
Detlef Meyer-Eltz
Return to the
comp.compilers page.
Search the
comp.compilers archives again.