[stringtemplate-interest] StringTemplateGroup multiple inheritance diff

Terence Parr parrt at cs.usfca.edu
Mon Dec 10 16:50:05 PST 2007


On Dec 3, 2007, at 7:13 AM, Zenaan Harkness wrote:

> Hi, the changes required for an immediate testing of group multiple
> inheritance seem fairly straightforward to me.
>
> First, I looked at StringTemplateGroup to find all superGroup refs:
>
> $ grep -n superGroup\\. StringTemplateGroup.java
> 443: superGroup.lookupTemplate(enclosingInstance,name);
> 464: st = superGroup.getInstanceOf(name);
> 876: return superGroup.getAttributeRenderer(attributeClassType);
> 884: renderer = superGroup.getAttributeRenderer(attributeClassType);
> 907: return superGroup.getMap(name);
> 911: m = superGroup.getMap(name);
>
>
> A simple container wrapper (possibly lazily created) can store the  
> parents.
>
> For lookupTemplate(), getMap(), etc, simply iterate through all  
> parents and
> stop at the first one found.
>
> My question is, are there any problems with this?

Hi Zen,

I think we'd need to modify syntax in group file also so you could do:

group T : S1, S2;

I wonder what multiple inheritance means in template group case.   
Probably ok.  What's your use case?

Ter


More information about the stringtemplate-interest mailing list