[antlr-interest] ANTLR3 Converting Java to C++ subset (sorta)

Andy Tripp antlr at jazillian.com
Tue Mar 27 09:13:41 PDT 2007


David Holroyd wrote:
> So, if you're just looking to translate syntax, ANTLR on its own will do
> well.  If you want to translate some (tiny part) of the semantics too,
> consider a framework that 'knows' the code better.
>   
> Finally, even *if* you go for a more complex/capable representation, it
> will still fail to handle the really fiddly cases, like translating
> idioms between languages.
>   
She probably wants to translate more than a "tiny part" of the 
semantics, but I don't think there's
any framework out there that "knows" the Java code better.

In my experience, it's almost *all* fiddly cases. Converting a Java 
main() signature to C++,
System.out.println to printf or "<<", converting collections to the STL, 
mapping primitive types
(e.g. Java int to C++ long), initialization of stack variables, etc.
>
>
> dave
>
>   



More information about the antlr-interest mailing list