[antlr-interest] How to handle multicharacter delimiters?

Jim Idle jimi at temporal-wave.com
Wed Jul 25 17:57:29 PDT 2007


FREETEXT:	{flgFreeText}?=> ( { ! (LA(1) == '$' && LA(2) == 'e' && LA(3) == 'n' && LA(4) == 'd') }?=> .)+;

Should do it I think?

Jim 

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Andrew Lentvorski
> Sent: Wednesday, July 25, 2007 5:18 PM
> To: antlr-interest Interest


> It bombs since the '$' ceases matching FREETEXT but doesn't match a new
> token (strictly speaking, it matches ANY which then fails in the
> grammar).  Fine.  What I really want is "match any character unless
> it's
> part of the phrase "$end" in that order") a la:



More information about the antlr-interest mailing list