[stringtemplate-interest] Default delimiters in group files.

Terence Parr parrt at cs.usfca.edu
Thu Oct 19 09:47:20 PDT 2006


On Oct 19, 2006, at 2:03 AM, John Stovin wrote:

> Hi,
>
> Is there any way to change the default delimiter used in group  
> files to be
> anything other than '<', '>', '<<', and '>>'?
>
> I'm trying to templatize a big XML file, and it's a pain having to  
> escape
> all the XML angle bracket delimiters. I would love to be able to  
> prevent
> StringTemplate from recognizing those sequences, and use something  
> else
> instead.

Unfortunately, the syntax of the group file is fixed.  Note that  
"..." works also but I think it has to be one line then.

You should only need to escape >> not << and not single angles.   
Inside of course, you can use $...$ for tags, which is perhaps what  
you want.  Change the default lexer using one of the STG methods and  
then load the templates I think...

Ter


More information about the stringtemplate-interest mailing list