[stringtemplate-interest] Indirect template references

Christophe PARIS christophe.paris at free.fr
Thu Nov 17 13:23:33 PST 2005


Hi,

I was wondering if it's possible to call a template which name is
composed of a prefix and a variable part ?

For example :

-----

group simple;

main(objects) ::= <<
$objects:print(); separator="\n"$
>>

print() ::= "$(print$it.type$)()$"

printObjectA() ::= "I'm A"

printObjectB() ::= "I'm B"

-----

Where "objects" is a collection of object having a geType() method
returning "ObjectA", "ObjectB" ...

The "print" template would "call" the printObjectA() printObjectB() template.


Regards,
Christophe


More information about the stringtemplate-interest mailing list