[antlr-interest] The filter option
Terence Parr
parrt at cs.usfca.edu
Mon Aug 6 07:30:15 PDT 2007
On Aug 6, 2007, at 2:28 AM, Wincent Colaiuta wrote:
> El 3/8/2007, a las 1:30, Marcos Marín escribió:
>
>> 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.
>
> For reference, this has come up in the past. In my opinion this is
> a bug in ANTLR, so I sent in a patch for this back in June but
> nobody replied:
>
> http://www.antlr.org/pipermail/antlr-interest/2007-June/
> 021243.html
From your post:
2. "filter = true" doesn't work for lexer grammars which are declared
in a separate file as "lexer grammars"
That is strange as that is the only place they work for me: n the
lexer alone.
See the fuzzyjava example.
Ter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070806/3d1b9e2f/attachment.html
More information about the antlr-interest
mailing list