There’s no place like ::1

ANTLR2 Sucks… ANTLR3 Forever

| Comments

This weekend I was trying to implement a simple PHP parser for my WebAppViewer project (more on that later).

Since the project is written in Java, we decided to use ANTLR2 for parsing purposes. After messing around with it (and being used to LR parsers), I went nuts because every single line of grammar I wrote had conflicts.

Just before going completely crazy, I decided to give ANTLR3 a try.

The real difference is that ANTLR2 is a LL(k) parser. On the other hand, ANTLR3 is a LL(*) parser. This means that the parser may do infinite LookAheads to do the disambiguation, and therefore, my grammar started working :)

So for you that don’t like LL grammars, dump ANTLR2, and adopt ANTLR3.

More info on ANTLR3 here

Comments