[antlr-interest] ANTLR Kudos...

Gavin Lambert antlr at mirality.co.nz
Thu Aug 14 14:48:05 PDT 2008


At 15:04 14/08/2008, Ian Kaplan wrote:
>   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 most cases v3 performance is significantly superior to v2 
performance, since v3 does less copying of token text.

And AFAIK backtracking is done in the order that the alternatives 
are listed, so it's not necessarily longest-match-wins.

(The lexer does do longest-match-wins for the most part, but then 
it also doesn't do backtracking.)



More information about the antlr-interest mailing list