[stringtemplate-interest] String template group inheritance

Terence Parr parrt at cs.usfca.edu
Sat Nov 13 13:16:39 PST 2010


Hi. I think you should try loadGroup not loadTemplate.
Ter
On Nov 10, 2010, at 5:19 AM, Davide Poletti wrote:

> 
> Hi, 
> 
> I' ve some problems with String Template Group inheritance.
> 
> I define a super group in one file IOop.stg
> 
> group IOop;
> 
> temp(attr1) ::=<< ....>>
> 
> and the sugroup in file Read.stg:
> 
> group Read : IOop;
> 
> temp2()::=<<....>>
> 
> 
> But when I run 
> 
> StringTemplateGroup stg = StringTemplateUtil.loadTemplate("Read.stg");
> logger.debug(stg.getSuperGroup().toString());
> StringTemplate st = stg.getSuperGroup().getTemplateDefinition("temp");
> 
> I got an error since stg.getSuperGroup() seems to return null, where I
> did wrong???
> 
> Davide
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest



More information about the stringtemplate-interest mailing list