[antlr-interest] How can I edit StringTemplate group files in ANTLRWorks ?

Christopher Brown chris77550 at gmail.com
Thu Dec 6 01:10:03 PST 2007


Hi,

I'm using ST# 3, and getting started using group files for generating
HTML.  As such, I prefer to use the default template lexer instead of
the angle bracket lexer.

This is how I'm setting it up in code:

            string templateFolder = Request.PhysicalApplicationPath +
"templates";

            StreamReader reader = new
StreamReader(Path.Combine(templateFolder, "st2.txt"));
            StringTemplateGroup myTemplates = new
StringTemplateGroup(reader,typeof(Antlr.StringTemplate.Language.DefaultTemplateLexer));
            reader.Close();

That works fine.  Now I'd like to use something more sophisticated
than a "stringtemplate-unaware" text editor.  I thought I'd give
ANTLRWorks a try, but I can't figure out how to set it up to load the
grammar files then load my templates, especially give that I'm not
using the angle bracket lexer, which appears to be the default for
group files.

I noticed several ".g" files in the "Antlr.StringTemplate.Language"
source directory, but don't know really how to work with them.

Can anyone advise me?

Thanks in advance,
Christopher


More information about the antlr-interest mailing list