[antlr-interest] ANTLR Kudos...

Terence Parr parrt at cs.usfca.edu
Thu Aug 14 15:31:39 PDT 2008


Hi Ian,

My sentiments exactly re v2 conversion to v3.  That is why v3 is STILL  
written in v2 ;)

Performance is not bad with backtracking and memoization; linear time  
cost.  Still better to let ANTLR predict with a simple DFA rather than  
backtracking.  Also can set backtracking per rule.

Thanks for the kudos, Ian!  Glad to see you using v3, even if painful  
to get there.

Ter
On Aug 13, 2008, at 8:04 PM, Ian Kaplan wrote:

>
>   I'm not very good at suffering in silence and the transition  
> between ANTLR 2.X and ANTLR 3.X has been a painful one.  I have had  
> to more or less rewrite all of the Java code associated with my  
> grammar rules.  But along with the whining it is only reasonable to  
> also talk about the good things.
>
>   The ANTLR backtracking parser is really great.  At least in terms  
> of its accepting grammars.  The back tracking parser gives you the  
> freedom to use a grammar would be difficult in LL(2) (ANTLR 2.X) or  
> even LL(*).  As a result, the grammar is more readable (less left  
> factoring) and the designer has much more freedom to design a  
> language as they want, rather than what can be supported by the  
> parser generator.  Going to ANTLR 3.X has been painful, but in the  
> end, I have to say it is worth it so far.
>
>   I do have a couple of worries.  One is performance.  In my case,  
> unless performance is really terrible should not be too be a problem  
> since the language I'm working on is a graph database query language  
> and the queries are never going to be that big compared to, say,  
> Java or C++ code.  Another worry I have is about the backtracking.   
> I admit that I have not RTFM (e.g., the last chapters of The Book  
> that deal with this topic).  My hope is that the match tries to  
> match the longest sequence first, so that a match is not missed.
>
>    In summary, I send my thanks to Terance and Co. for the great  
> work on ANTLR 3.  It's a tool that has allowed me more freedom than  
> I've ever had before with a parser generator.
>
>   Ian
>



More information about the antlr-interest mailing list