[antlr-interest] Language translation using ANTLR?

foxterri foxterri foxterri2 at hotmail.com
Wed Apr 14 05:48:43 PDT 2010




Hi

I want to make a translator, which can translate Java source code into C++
source code. But I am not sure how to do this using ANTLR.What is the best way
for doing this?


I have looked at an Article written in 2004 by Terence Parr:
http://www.antlr.org/wiki/display/ST/Language+Translation+Using+ANTLR+and+StringTemplate

This article describes how to translate Cminus to either Java, Python or pseudo
bytecodes using string templates. Since this article is from 2004 and that I
cannot find the code example, is this still an efficience way of
translating from source code to source code using ANTLR, even though Java and
C++ are much more complex than the Cminus example?
And can
anyone find the code example? It is mentioned in the article that the software
is compressed in the cminus.tar.gz. But where is the link to this this file, so
I can follow the examples by my self. I managed to find the Cminus grammar at
http://media.pragprog.com/titles/tpantlr/code/trees/CMinus/CMinus.g but the
other files I cannot find.


I hope you guys can help me in the right direction for making such a translator.

Best regards
Glen


 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4


More information about the antlr-interest mailing list