[stringtemplate-interest] StringTemplateGroup multiple inheritance diff

Terence Parr parrt at cs.usfca.edu
Tue Dec 11 11:58:37 PST 2007


On Dec 10, 2007, at 6:08 PM, Zenaan Harkness wrote:
>>
>> 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
> :)

Yes, this makes sense. Like grammar composition in new ANTLR 3.1.   
Hmm...I can't see a problem with this.  We'd need to use order to  
resolve duplicate template names and other look up stuff.  E.g., if a  
writer is not set for a group, it looks to it's super.  Would that  
still work in your world?
Ter


More information about the stringtemplate-interest mailing list