[antlr-interest] token filtering in C target (antlr 3.0)

Jim Idle jimi at temporal-wave.com
Sat Dec 22 19:18:12 PST 2007


nextToken is there. It is a "method" in the tokSource construct, which 
is contained in the lexer. Write your replacement nextToken by copying 
the one in antlr3Lexer.c, then after you create the lexer and add the 
tokenSource, install your own version.

Jim

> -----Original Message-----
> From: Corno Schraverus [mailto:antlr-interest at schraverus.com]
> Sent: Wednesday, December 19, 2007 5:01 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] token filtering in C target (antlr 3.0)
> 
> Hi all,
> 
> I'm trying to port a whitespace significant grammar from 2.7 to 3.0.
> (It is almost identical to the python parser available for 2.7; 
basically
> all that has to be done is override the 'nextToken' method.)
> I'm going through the sources of the runtime library for the C target 
but
> cannot find the nextToken method(function) and if I'm correct it's 
done
> with
> _LA(). However _LA() is more complex: arbitrary lookahead or lookback. 
Do
> I
> have to implement this functionality to get it working correctly?
> 
> greetings,
> 
> Corno
> 
> 




More information about the antlr-interest mailing list