[antlr-interest] Search free text form for special tags grammar

Ronald Haring ronald.haring at gmail.com
Mon Sep 10 02:45:07 PDT 2007


Ok, now if only I knew how to do that :)

Could you enlighten me a bit. What is a lexer only rules grammar? And how
can I filter this?

Regards
Ronald

On 9/10/07, Gavin Lambert <antlr at mirality.co.nz> wrote:
>
> At 20:50 10/09/2007, Ronald Haring wrote:
> >thx for your time Michael, unfortunately that didnt work
> >completely as needed. If I only have a hrefs in the text then it
> >works, however if there are more words in front of it or between
> >(as I might expect from the input) then it doesnt work anymore.
> >
> >I think my main problem is how do I tell the parser to search for
> >anyword but href or href where the anyword but href can be savely
> >discarded.
>
> Probably the easiest thing to do would be to convert the whole
> thing into lexer-only rules and then turn it into a "filter"ed
> lexer.
>
> Failing that, you'll have to come up with some rule that can match
> all your "don't care" tokens and then do something like this:
>
> file: (href | dontcare)* EOF;
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070910/d1b656a5/attachment.html 


More information about the antlr-interest mailing list