[antlr-interest] StringTemplate v4 and C# fails for me at step zero

Maximilien Colange macolange at gmail.com
Thu Feb 9 04:35:33 PST 2012


Hi,

> I'm using Antlr3 version 3.4.1.9004.
>
> I added a reference to the Antlr4.StringTemplate.dll and set the output option to "output=template" in my (working) tree grammar. Even though I hadn't added any template expansions, a quick verifying-compilation failed because Antlr added the following statements to the source file that it generated:
>
> using Antlr3.ST;
> using Antlr3.ST.Language;
>
> which do not refer to the correct namespaces for the DLL that I downloaded (it should be Antlr4.StringTemplate), and it also has added code like this:
>
>     private StringTemplateGroup _templateGroup = new StringTemplateGroup("PhaseTwoTemplates", typeof(AngleBracketTemplateLexer) );
>
> yet the object browser shows that the DLL contains no such object (it should be called TemplateGroup).
Beware: the StringTemplate4 library is released and (as far as i know) 
running, whereas Antlr4 is still under development.
You can use StringTemplate4 with Antlr3 with a few modifications to your 
code: http://www.antlr.org/wiki/display/ST4/Differences+between+v3+and+v4
> Does this stuff work under C#, or have I got a corrupted setup somehow?
It seems to me that you got confused between StringTemplate4 and Antlr4.
I do not use the C# target, but according to the doc of ST4, it works 
with C#.

Hope this helps.

-- 
Maximilien


More information about the antlr-interest mailing list