[antlr-interest] StringTemplate + ANTLR

Sohail Somani sohail at taggedtype.net
Thu Oct 20 22:15:17 PDT 2005


Hi all,

So I'm at the point where I need to start generating the target code. I
came across an article that uses ANTLR + StringTemplate by manually
creating the StringTemplates. While this is all fine and dandy, it
crossed my mind that perhaps ANTLR can actually create the
StringTemplate for me.

Then I googled for CommonAST to StringTemplate and I came across
http://www.stringtemplate.org/doc/api/org/antlr/stringtemplate/language/StringTemplateAST.html

Before I get too excited, is it possible for ANTLR to generate the
StringTemplate for me using the above without embedding too many manual
actions in the parser? I've tried a syntax directed translation and its
just fugly. I've also read Terence's article about translators using
tree parsers instead of manually walking/using classes, but I don't
think that seems to apply to me and I'd like to see if I can use
StringTemplate.

Thanks in advance!

Sohail



More information about the antlr-interest mailing list