[antlr-interest] Filtering

Stuart Dootson stuart.dootson at gmail.com
Wed Aug 24 02:19:56 PDT 2005


On 8/24/05, Serafettin Senturk <serafettin_sentuerk at intergral.com> wrote:
> 
>   ok, thanks. then, how do i deal with filtering?
> 
>   Specifically, in my work, I have to distinguish between variable names and
> statement names that look like each other.
> 
>   For example, i should make the distinguishment between "for" statement and
> any variable starting with "for" like "foreign".
> 
>   For that reason, in my lexer, I get "for" followed by space(WS) or LPAREN
> with the lexer, then pass it to the parser. Then, in my parser, I have to
> skip that especially LPAREN, a kind of filtering. Is this kind of filtering
> possible? If yes, How can i do this filtering?
> 
>   Regards,
>  Serafettin
> 

Have a look at 'testLiterals' in the manual - that's used in *exactly*
the situation you've described

Stuart Dootson


More information about the antlr-interest mailing list