Re: ANTLR
Andrew Oliver <[email protected]>
| Newsgroups | gmane.org.user-groups.trijug.juglist |
|---|---|
| Message-ID | <[email protected]> |
Sorry that was unclear. That was to say that
"6 uid SEARCH UNDELETED HEADER Message-ID 44317CD1.8000407@localhost"
gives me "bad syntax" with this grammer..
-Andy
Andrew Oliver wrote:
> Anyone here a big ANTLR guy/gal?
>
> I'm still wrapping my head around it. I have this grammar (for IMAP):
>
> http://fisheye.labs.jboss.com/viewrep/~raw,r=1.1/JBoss/jboss-mail/src/java/org/jboss/mail/imap4/parser/grammer.g
> "6 uid SEARCH UNDELETED HEADER Message-ID 44317CD1.8000407@localhost"
>
> I think that the problem lies here:
>
> search [boolean isUID]
> {
> SearchCommand cmd = new SearchCommand(isUID);
> AndSearchPart part = new AndSearchPart();
> SearchPart oPart;
> }:
> SEARCH SPACE oPart =search_group[isUID] {part.addArgument(oPart);}
> (SPACE oPart=search_group[isUID]
> {part.addArgument(oPart);})*
> {
> cmd.setPart(part);
> command = cmd;
> }
> ;
>
> search_part [boolean isUID] returns [SearchPart part]
> {
> part = null;
> }
> :
> (part=search_part_no_arg
> |
> part=search_part_str_arg
> |
> part=search_part_num_arg
> |
> part=search_part_date_arg
> |
> part=search_part_other[isUID])
> ;
>
> there is no search part that includes BOTH the UNDELETED (noarg) and the
> HEADER (with arg).
>
> Am I wrong?
>
> -Andy
>
>
> _______________________________________________
> Juglist mailing list
> [email protected]
> http://trijug.org/mailman/listinfo/juglist_trijug.org
>