On Thursday, 2 May 2013 at 17:13:46 UTC, Russel Winder wrote:
On Thu, 2013-05-02 at 17:44 +0100, Bruno Medeiros wrote:
[…]
To be honest, that's one of the reasons that put me off
working with ANLTR. It seems easy to create a parser with
ANTLR, but to create an efficient, well-behaved parser it
looks quite complicated, in the sense that you can't abstract
yourself from what is happening under the hood... you have to
read a lot of theory and documention to learn the innards of
ANTLR, and understand what kind of code it's actually
generating, and how it processes input. (at moments it feels
like you have to take a degree to learn how to use it
effectively...)
The Groovy parser is an ANTLR 2.7.7 grammar, it works well and
quickly.
I think the trick is to work with the LL(k) idioms and avoid
letting
LALR(1) thoughts creep in.
LALR(1) is O(n) last time I looked. Both Ll(k) and LALR(k) should
never backtrack. Dunno what Antlr is doing.