antlrbisonflex-lexerjflex

What are the disadvantages of using ANTLR compared to Flex/Bison?


I've worked on Flex, Bison few years ago during my undergraduate studies. However, I don't remember much about it now. Recently, I have come to hear about ANTLR.


Solution

  • ANTLRv3 is LL(k), and can be configured to be LL(*). The latter in particular is ridiculously easy to write parsers in, as you can essentially use EBNF as-is.

    Also, ANTLR generates code that is quite a lot like recursive descent parser you'd write from scratch. It's very readable and easy to debug to see why the parse doesn't work, or works wrong.

    The advantage of Flex/Bison (or any other LALR parser) is that it's faster.