[stringtemplate-interest] ST4 inheritance without a group header?
Terence Parr
parrt at cs.usfca.edu
Wed Feb 24 10:50:48 PST 2010
> FWIW, my preference would be for the old group statement syntax. Not
agreed the group syntax is better.
> sure that the options syntax is clearer, and it does not address the
> ambiguity of whether a group statement is proper or not (and now whether
> an options statement is proper or not). Would have to somehow grep into
> the template to infer whether it is ST3 or 4 and dynamically switch
> parsers, though that still would not be entirely unambiguous - yuk.
Right. I didn't really consider tools that want to handle both. The syntax is identical except for the possibility that we make the group header optional. In that case, a tool wouldn't know. on the other hand, does the tool really care if the syntax is identical except for that first line? If you plan on executing templates or something like that you need to know, but otherwise I think we can do syntax highlighting without it.
>
>>>> 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?
>> well, I was able to rip out all of that STGroupLoader crap from v3 because I didn't have to allow people to give me some kind of a classpath=like mechanism defined supergroups. the supergroup could be from a socket a database another directory etc.
>>
>
> I would think that anything that looks like a file store must support
> URI access by now. Oracle even supports simple URI access (not
> JDBC-based) to its repository, which can be mapped onto a standard
> table. Anyone who insists on a raw socket should be required to provide
> a URI wrapper, etc.
Right. but we need a class path or something so that people can specify the directories to look in. A single file spec is insufficient and we have no place to specify anyway unless you plan on changing the syntax of the group header to specify a file name instead of a simple supergroup name.
Ter
More information about the stringtemplate-interest
mailing list