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

Ronald Haring ronald.haring at gmail.com
Mon Sep 10 01:50:50 PDT 2007


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.

Regards
Ronald

On 9/10/07, Michael Mosmann <michael at mosmann.de> wrote:
>
> Am Montag, den 10.09.2007, 09:59 +0200 schrieb Ronald Haring:
> > Hello all,
> >
> > Here is my grammar so far
> >
> > grammar AHrefFinder;
> > @header {
> > import java.util.HashMap;
> > import java.util.Map;
> > }
> > href  returns [Map map]
> > @init {
> >     map = new HashMap();
> > }
> >     :
> >      lt (WS)* 'a' (attr[map])* '>' (.)* '</a>';
> >
> > how do I find all the others???
>
> i think
>
> href_all
>    : href*;
>
> should do it..
>
> mm:)
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070910/3d52a06e/attachment.html 


More information about the antlr-interest mailing list