Removing Left Recursion in ANTLR
Posted
by prosseek
on Stack Overflow
See other posts from Stack Overflow
or by prosseek
Published on 2010-06-08T17:34:29Z
Indexed on
2010/06/08
17:42 UTC
Read the original article
Hit count: 832
antlr
|compiler-theory
As is explained in http://stackoverflow.com/questions/2652060/removing-left-recursion , there are two ways to remove the left recursion.
- Modify the original grammar to remove the left recursion using some procedure
- Write the grammar originally not to have the left recursion
What people normally use for removing (not having) the left recursion with ANTLR? I've used flex/bison for parser, but I need to use ANTLR. The only thing I'm concerned about using ANTLR (or LL parser in genearal) is left recursion removal.
- In practical sense, how serious of removing left recursion in ANTLR? Is this a showstopper in using ANTLR? Or, nobody cares about it in ANTLR community?
- I like the idea of AST generation of ANTLR. In terms of getting AST quick and easy way, which method (out of the 2 removing left recursion methods) is preferable?
© Stack Overflow or respective owner