[antlr-interest] Re: announcing 1.0.2 release of StringTemplate template engine

Mark D. Anderson mda at discerning.com
Thu Oct 16 09:56:12 PDT 2003


--- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...> wrote:
> > In particular, for the cases where StringTemplate is going to be used 
> > on
> > html templates, it'd be nice to be able to be able to offer validation 
> > of
> > the html chunks.
> 
> That sounds like something another program can/should do...

Possibly. But in general, individual chunks won't be valid. And neither
will be a whole file, if validated as xml or html. 
Validation is a problem even with xslt, where it is all xml (you can
easily check well-formedness of course, but validity is hard).

Depending on where the delimeters are placed, and whether things like
less-than and ampersand are used, it might still be possible to validate
the whole file as xml or html.

In general, one needs a grammer that includes the fact that there is switching
going on.

> 
> > I don't see how delimeter escaping is done btw.
> 
> Yeah, sorry about that...a student asked me that yesterday too ;)  I 
> don't know what to do when the delimiters can be *anything*.  Can you 
> suggest something?

You could have two more options, for escaped_open and escaped_close strings.
Or you could have a single option for escaping="double" or escaping="backslash",
those two being the two most common ways to do escaping.

-mda



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list