[antlr-interest] Need some advice which ANTLR versions should be used for my project (Target: Java or Python)

Stefan Mätje (d) Stefan.Maetje at esd-electronics.com
Thu Sep 15 06:43:01 PDT 2011


Hi,

I'm facing the task to build a language to language translator that should 
translate the programming language PEARL to C++. The idea is to build a 
combined grammar to build an AST and then output the C++ code using a tree 
grammar with StringTemplate.

At a first glance I picked the Python target to be used as the language the 
translator could be written in. This was because some of my colleagues have 
some experience in Python. Another benefit would be that the translater would 
run unchanged under Windows and Linux because of its "interpreted" nature.

Another usable target language would be Java. Unfortunately I have neither 
experience with Python nor Java except some 100 lines example programs.

With the Python target there seem to be some uncertainties with the tool 
chain. 

From the Python target language page I get the impression that I have 
to stick to ANTLR V3.1.3 if I want to use the Python target. On the other hand 
the current AntlrWorks version 1.4.3 uses an Antlr V3.4.

Is anybody here who could tell me if I must use Antlr 3.1.3 to avoid any 
problems or if I could use Antlr 3.4 (from AntlrWorks) without deeper 
thinking?

Is the Python runtime compatible with Antlr 3.4 output? (Last question already 
answered by Python runtime page 
@http://www.antlr.org/wiki/display/ANTLR3/Python+runtime)


Also in the last stage of my translator I'll need the StringTemplate library. 
Have there been any updates or are the things mentioned on the Python target 
page still valid?
 - Python port of StringTemplate is compatible to V3.1
 - needs Python runtime from antlr-2.7.7


On the other hand the Java target would offer much more example code (from the 
books and the wiki) but if I would use Java I would be on my own (no fellows 
working with Java in my company). Also I could use an up-to-date Antlr 
version, but I don't know what the possible benefits would be.

Any comments and advice to choose the target language and which Antlr / 
Antlrworks / Stringtemplate versions to use appreciated.

Thanks,
	Stefan Mätje




More information about the antlr-interest mailing list