[stringtemplate-interest] Implements and inherits

Terence Parr parrt at cs.usfca.edu
Wed Jun 9 17:27:19 PDT 2010


On May 31, 2010, at 3:22 AM, Damien Urruty wrote:

> Hello there,
> 
> I would like to organize my template files. I have two different groups, that are doing sometimes the same thing. I want to organize my project as follows : 
> - an interface file, that defines the templates to implement, at the top of my hierarchy
> - a group that implements this interface, and at the same time provides the templates that are repeating in my two original group. (The group is then a kind of abstract class?)
> - the two original groups, inheriting the previous group, and implementing the remaining templates.

inheritance should work for you.

> Is this kind of structure possible ? I didn't achieve to set the second group, which is a sort of interface but with non-empty templates.
> 
> The first is an interface, for sure. The second should be an interface as well, but the ST "compiler" doesn't let me fill the templates I want to regroup.

Leave the abstract group as a group not interface i think.
Ter
> 
> Hope I'm clear.
> 
> Thanks in advance,
> Dam.
> 
> Envie de plus d'originalité dans vos conversations ? Téléchargez gratuitement les Emoch'ticones ! _______________________________________________
> 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