[stringtemplate-interest] Setting the default lexer on the common group loader

Terence Parr parrt at cs.usfca.edu
Sun Jul 19 15:04:01 PDT 2009


On Jul 19, 2009, at 3:02 PM, ed ed wrote:

> Terence,
> You are a scholar and a gent!

Well, I may be a scholar but hardly a gentleman ;)

> For the record here is what I have now:
> StringTemplateGroupLoader loader = new CommonGroupLoader(FOLDER, new  
> ErrorListener() );
> StringTemplateGroup.registerGroupLoader(loader);
> StringTemplateGroup group =  
> StringTemplateGroup.loadGroup("classgroup",  
> DefaultTemplateLexer.class, new StringTemplateGroup("super") );
> StringTemplate template = group.getInstanceOf("classGenerator");
> template.setAttribute("config", "config" );
> log.info(template.toString() );

hooray!
T


More information about the stringtemplate-interest mailing list