[antlr-interest] Filtering

Serafettin Senturk serafettin_sentuerk at intergral.com
Wed Aug 24 01:17:51 PDT 2005


  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




-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org]On Behalf Of Micheal J
Sent: 29 April 2005 10:03
To: antlr-interest at antlr.org
Subject: RE: [antlr-interest] Case sensitivity


>  Hello everbody,
>
>   Does anybody know if we can apply the case sensitivity to
> Parser grammar. Actually, I write "caseSensitive=false" in my
> lexer grammar, then it works. But when i do it in my parser,
> it does not work. Is there any one who knows how to make it
> in another way in Parser grammar?

Parsers deal with TokenStreams (not CharacterStreams). Tokens have no "case"
as such since there are essentially just codes (int codes).

The lexemes attached to a token (e.g. the text of an IDENT token)would have
been dealt with - case-wise - in the lexer.

Cheers,

Micheal





More information about the antlr-interest mailing list