[antlr-interest] string template bug?

Gavin Lambert antlr at mirality.co.nz
Mon Apr 14 05:16:39 PDT 2008

At 14:49 14/04/2008, Sean Proctor wrote:
>This is the line in my lexer: | ('%%')=> '%%' { setText("%"); }
>I get this message: WSL.g3:371:19: invalid StringTemplate % 
>shorthand syntax: '%")'
>I'm not really sure what to do here. This is with 3.1b1 from 4/9.

Try $setText("\%").

If that doesn't work, try two or three backslashes (sometimes 
things need to be double-escaped because they're being converted 

You shouldn't need to change the other references, it's only in 
code where the % is treated as significant.

More information about the antlr-interest mailing list