[antlr-interest] Problems with " and/or ""

matthew ford Matthew.Ford at forward.com.au
Wed Dec 15 11:06:09 PST 2004


Sounds great Ter,
just to clarify does

('"' | """ | "&) (greedy=false : . )*  ('"' | """) ;

work also and also does

('"' | """ | "“" | "”" ) (greedy=false : . )*  ('"' ! |
""" ! | "“" ! | "”" ! ) ;

work?
Looking forward to 3.0 !!! :-)
matthew

----- Original Message ----- 
From: "Terence Parr" <parrt at cs.usfca.edu>
To: <antlr-interest at yahoogroups.com>
Sent: Thursday, December 16, 2004 4:51 AM
Subject: Re: [antlr-interest] Problems with " and/or &quot;"


>
>
> On Dec 14, 2004, at 11:16 PM, matthew ford wrote:
> > There should be an easier (and more strightforward) way to do this.
> > But if there is I have not found it yet.
> > Ter can you get greedy = false to work for this case?
>
> The unfortunate truth is that greedy=false was an afterthought and
> apparently not properly integrated.
>
> You'll note in 3.0 that this plain works:
>
> Q : "&quot;" (greedy=false : . )* "&quot;" ;
>
> I just verified the generated Java (no bytecodes in this case) and the
> DFA.  Everything is cool.  It will terminate on "&quot;" and more
> importantly, it figured out the k=6 lookahead depth out all by itself.
> :)  Hooray.  Believe me when I say that I've actually gotten time to
> think before coding this time around.  1.x was a prototype.  2.x was
> done in a hurry to shut out JavaCC and was done while I was in a
> start-up working like mad.  I've been working on just the parsing
> algorithm and code generator for 1.5 years now. :)  I should have the
> error handling done in a month or two.  Then I clean up the tool and by
> May we may have a parser/lexer combo that works with no support for
> trees etc...  We may also have a prototype gui.
>
> Ter
> --
> CS Professor & Grad Director, University of San Francisco
> Creator, ANTLR Parser Generator, http://www.antlr.org
> Cofounder, http://www.jguru.com
> Cofounder, http://www.knowspam.net enjoy email again!
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list