Question

What should I expect from ANTLR 4?

Is it faster ANTLR 3? I mean the parsing speed.
Note code generation speed would be interesting too.

For design reasons?

Was it helpful?

Solution

First the easy part - the ANTLR 4 tool performs only minimal analysis of the grammar, and in particular does not need to statically compute the DFA tables like ANTLR 3 did. As such, it's much, much faster than ANTLR 3 for generating parsers.

The initial 4.0 release of ANTLR 4 varies from slightly faster than ANTLR 3 to much slower than it, depending on the grammar and input. However, ANTLR 4 is able to handle many grammars and inputs that ANTLR 3 simply cannot handle at all. In addition, an optimized version of the ANTLR 4 runtime which substantially outperforms ANTLR 3 is already in development.

Debugging aids and how-to documentation is coming which helps users find and correct (or avoid) performance problems related to grammar design. I believe some of this is available in the ANTLR 4 book as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top