[antlr-interest] Manipulating text in the lexer

Gerald Rosenberg gerald at certiv.net
Thu Feb 26 16:00:07 PST 2009


At 03:06 PM 2/26/2009, Sam Barnett-Cormack wrote:

>Of course, it would be hard to structure, if I have to set the text of
>the whole damn token at once. If we had the old ! operator, it'd be easy
>enough... make the '"' at the beginning and end be missed out, make the
>first of the three choices be ignored, and make the second be !'"' '"'.
>That'd be just grand. However, I can't see an easy way to make the
>resulting token text be what I want it to be with the current system. If
>anyone knows how I can, please let me know.

Rule: A  B {skip();}  C ;

should work as the functional equivalent of

Rule: A !B C ; 



More information about the antlr-interest mailing list