[antlr-interest] The filter option

Marcos Marín marcosmarin at gmail.com
Thu Aug 2 16:30:24 PDT 2007


On 8/2/07, Jim Idle <jimi at temporal-wave.com> wrote:
>
>  As the last rule in your lexer you could use:
>
>
>
> ANY : . { $channel = HIDDEN; }
>


Actually, after testing more this does not work, it no longer complains
about curly braces but it does complain about anything else that is not one
of my rules. My guess is it does not complain about curly braces and it does
of other things because curly braces is only one char, so I tried ANY: .+
{$channel = HIDDEN;} ; but it gave me a warning of the rule being
unreachable.

I'm going to try creating a standalone lexer and parser.

Which preserves the text but the parser won't see it. You can also use
> skip(); (Java target, I think).
>
>
>
> Jim
>
>
>
> *From:* Marcos Marín [mailto:marcosmarin at gmail.com]
> *Sent:* Thursday, August 02, 2007 1:24 PM
> *To:* Jim Idle
> *Cc:* antlr-interest at antlr.org
> *Subject:* Re: [antlr-interest] The filter option
>
>
>
>
>
> On 8/2/07, *Jim Idle* <jimi at temporal-wave.com> wrote:
>
> You are probably missing something but were you trying to use a filtering
> lexer with a parser? A filtering lexer is currently stand alone.
>
>
> So you mean that I can't use a parser if I specify the filter option? if
> this is the case, is there any way I can ignore everything else without the
> filter option?
>
> I'm sorry, this is all very new and confusing to me.
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070802/fa3e6881/attachment-0001.html 


More information about the antlr-interest mailing list