Re: ANTLR
Andrew Oliver <[email protected]>
| Newsgroups | gmane.org.user-groups.trijug.juglist |
|---|---|
| Message-ID | <[email protected]> |
Nevermind, I figured it out. changes are in CVS to anyone who is
interested in seeing the deltas.
Andrew Oliver wrote:
> I discovered that it is even more complicated than I realized.
> Apparently the grammar treats the period as some kind of
> token terminator or separate token (partially because of the lexer
> definition) and thus hates all types of email addresses or other things
> containing periods. Not sure what the quick fix is. Have to think this
> through.
>
> -Andy
>
> Andrew Oliver wrote:
>> 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
>>>
>>
>>
>> _______________________________________________
>> Juglist mailing list
>> [email protected]
>> http://trijug.org/mailman/listinfo/juglist_trijug.org
>>
>
>
>
> _______________________________________________
> Juglist mailing list
> [email protected]
> http://trijug.org/mailman/listinfo/juglist_trijug.org
>