[stringtemplate-interest] StringTemplateGroup multiple inheritance diff
Zenaan Harkness
zen at freedbms.net
Mon Dec 10 18:08:46 PST 2007
On Mon, Dec 10, 2007 at 04:50:05PM -0800, Terence Parr wrote:
>
> 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?
Librifaction.
Simply size of templates - to break my 'lib' into more than one parent.
Simply chaining (single inheritance) works, but it's nice to be able to
group templates into logically consistent units, and then 'pull in' the
ones that are needed, explicitly.
I'm not quite there yet with my current project, but I can see I want it
:)
cheers
zen
--
Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.
More information about the stringtemplate-interest
mailing list