[antlr-interest] How to handle multicharacter delimiters?

Jim Idle jimi at temporal-wave.com
Wed Jul 25 18:40:49 PDT 2007


I see you sorted this out, but for clarification for others, in the C target you use LA(nnn) and in Java input.LA(nnn). I forgot what language I was in ;-)

Jim 

> -----Original Message-----
> From: Andrew Lentvorski [mailto:bsder at allcaps.org]
> 
> Jim Idle wrote:
> > FREETEXT:	{flgFreeText}?=> ( { ! (LA(1) == '$' && LA(2) == 'e' &&
> LA(3) == 'n' && LA(4) == 'd') }?=> .)+;
> >
> > Should do it I think?
> 
> WHOA!  That rocks.  I need to go check that out.
> 
> However, it doesn't compile.
> 
> I get:
> vcdfile2Lexer.java:82: cannot find symbol
> symbol  : method LA(int)
> location: class vcdfile2Lexer
>                 if ( ((LA1_0>='\u0000' && LA1_0<='\uFFFE')) && ( !
> (LA(1) == '$' && LA(2) == 'e' && LA(3) == 'n' && LA(4) == 'd') )) {



More information about the antlr-interest mailing list