[stringtemplate-interest] Two-Character-Bracket.templateLexer

Terence Parr parrt at cs.usfca.edu
Mon Mar 12 13:05:53 PDT 2007


On Mar 9, 2007, at 2:28 AM, Dreyer Ulf (CR/APA3) wrote:

> Hi Everyone,

Howdy.  Note I just submitted the ANTLR book to publisher...i'm now  
going to try to catch up with ANTLR and ST bug reports etc...

>  I think I need to write my own TemplateLexer because neither "$"  
> nor "</>" are
>  acceptable.
>  My first try was to substitute the occurrences  of '<' and '>' in  
> angle.bracket.template.g  (c#-edition)
>  with ACTIONBEGIN and ACTIONEND respectively.
>  This does not work because subrules cannot be inverted.
>
>  Has anybody written a custom templateLexer which uses a two- 
> character delimiter?
>
>  I'd like to try for <$ …$>  as it is not used in my target  
> language AND it is possible to
>  differentiate begin- and end-delimiters.
Hmm...two char, eh?  well, a syntactic predicate ought to work..hang  
on...hmm...grammar doesn't look too hard to change.  Try using  
literals not a rule ref.

Ter



More information about the stringtemplate-interest mailing list