[antlr-interest] Re: Determinig the real ambiguities

thrutchy eric_mahurin at yahoo.com
Thu Jul 15 15:46:40 PDT 2004


--- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...> wrote:
> It is. ;)  However, the new ANTLR 3.0 prototype handles this situation 
> trivially.  It tries more and more lookahead until it realizes it needs 
> arbitrary lookahead and then it builds a tight little DFA that walks 
> out until it sees the C or D and then it knows which production will 
> succeed using real parsing.

Very nice.  I think this will help out quite a bit.  I assume you will
still be able to have it let you know when it is resorting to this so
that the grammar can be refactored to not do the DFA thing and be
faster.   Or better yet, have ANTLR do the refactoring for at least
simple cases...

How do yo see ANTLR 3.0 comparing to Perl 5.6+ regular expressions? 
If I had to do it again, I may have written the grammar of the
language I'm parsing in Perl because a) I already knew it, b)
backtracking helps resolve issues that ANTLR has (i.e. this thread
topic), c) no separation of lexer and parser.  I think the main thing
in Perl 5.6+ that gives it the parsing capability is the (??{ code }),
where code would be another (or the same - recursion) regular
expression.  But, to do it this way you'd have to read the entire file
into a string first, whereas ANTLR doesn't have to do this.

Do you see the parser and lexer in ANTLR becoming one in the same at
some point?  One could choose what the input (character or token
stream, etc) and output (token stream or AST) would be.

Do you have a feature list of ANTLR 3.0 around somewhere?

Thanks for the tool, Terrance!




 
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