Why you should not use (f)lex, yacc and bison - Federico Tomassetti - Software Architect

#artificialintelligence 

In the field of parsing Lex and Yacc, as well as their respective successors flex and GNU Bison, have a sort of venerable status. And you could still use them today. But you should not do that. In this article will explain why they have problems and show you some alternatives. Lex and Yacc were the first popular and efficient lexers and parsers generators, flex and Bison were the first widespread open-source versions compatible with the original software. Each of these software has more than 30 years of history, which is an achievement in itself. For some people these are still the first software they think about when talking about parsing. So, why you should avoid them? Well, we found a few reasons based in our experience developing parsers for our clients. For example, we had to worked with existing lexers in flex and found difficult adding modern features, like Unicode support or making the lexer re-entrant (i.e., usable in many threads). With Bison our clients had trouble organizing large codebases and we found difficult improving the efficiency of a parser without rewriting large part of the grammar. The short version is that there are tools that are more flexible and productive, like ANTLR.