[antlr-interest] Performance of ANTLR-generated lexer/parsers

Bryan Ewbank ewbank at gmail.com
Thu Aug 31 05:00:58 PDT 2006


Wanted to echo and reinforce Ric's statement here.  We're using 2.7.6 and C++,
and had to purge all "=>" before performance was anywhere near acceptable.

Another way to improve performance is to have any and all TreeParser's be tree
walkers, rather than tree generators -- in the options section of the
TreeParser, add "buildAST=false;". You can still manipulate the AST, but any
transformations are IN PLACE, meaning you need to be aware that there is only
one tree.

We've found that "buildAST=true" is a good place to establish a working
prototype, then use "buildAST=false" and make it work.

- Bryan Ewbank


On 8/27/06, Ric Klaren <ric.klaren at gmail.com> wrote:
> The most important rule of thumb is to shun syntactic predicates like the
> plague (the construct with the '=>'). If you have one of these in the lexer
> in the wrong spot then you can forget about any performance.
>
> Cheers,
>
> Ric


More information about the antlr-interest mailing list