[stringtemplate-interest] ST4 inheritance without a group header?
Terence Parr
parrt at cs.usfca.edu
Tue Feb 23 10:48:59 PST 2010
On Feb 23, 2010, at 9:00 AM, Gerald Rosenberg wrote:
> Dropping the group statement creates an interesting conundrum. Since
> STv3 and v4 both use .stg files, no way for a tool to know whether to
> mark existence or absence of the group statement as an error.
a very interesting problem. shoot.
> Perhaps more significant, static analysis of ST4 template files becomes
> problematic since there is no way to automatically evaluate inheritance
> - no way for a tool to know what the chain of dynamic imports will be
> for a particular template.
That was also true with the previous version because you could do dynamic inheritance.
> Are you aware of any other languages with
> this type of dynamic inheritance?
no doubt Ruby and Python can do that ;)
> Would be interesting to see how their
> tools handle the issue.
True. Yeah, I was wondering about the static inheritance feature. First issue is the problem that we have to create group loaders because it has to know how to find the supergroup. With dynamic inheritance the programmer simply finds it themselves. The other issue is that a directory of templates really should be the same as a file of templates. I really like the consistency.
as for static analysis, I'm not sure what to do. It would be annoying to highlight template references that don't exist simply because they are from an inherited group. :(
> 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? It still brings up the question of how do you know where the supergroup lives on the disk.
Ter
More information about the stringtemplate-interest
mailing list