[stringtemplate-interest] ST4 inheritance without a group header?
Gerald Rosenberg
gerald at certiv.net
Tue Feb 23 13:07:20 PST 2010
On 2/23/2010 10:48 AM, Terence Parr wrote:
>> Are you aware of any other languages with
>> this type of dynamic inheritance?
>>
> no doubt Ruby and Python can do that ;)
>
Don't Ruby and Python use source statements to specify the import.
Thus, the import statement is in the file being parsed. No problem then
for static analysis to actually trace it.
For ST4, the import statement is in the controller's glue and invisible
to any parse of a template.
>> Wonder if makes sense to require, or at least allow, an ST4 template to
>> statically inherit an .sti interface? Cannot make this change just in
>> the tool - the templates would not be portable.
>>
> Interesting. perhaps making the group header optional...or introduce an option?
You mean a grammar file option? Won't that make templates dependent on
being driven from Antlr? What about standalone use of ST?
> It still brings up the question of how do you know where the supergroup lives on the disk.
>
Not sure the problem. You already impose a directory structure - could
just pass the template root path as a parameter to STGroupFile and
STGroupDir and support relative paths in the templates, right?
More information about the stringtemplate-interest
mailing list