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

Gavin Lambert antlr at mirality.co.nz
Mon Sep 10 02:28:55 PDT 2007


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;



More information about the antlr-interest mailing list