Flex and Bison tools

I want know which is best whether compiler design using either tools like Flex & Bison or C/C++. Because I've heard that developing with tools is not worthy at all. I'm a beginner to compiler design so I need clarification about this. And other thing that I want to ask you is which of those two ways as I said above expected by a company in compiler design. Please help me!!!


This depends on complexity of your syntax you want to parse. It is not hard to implement simple grammar by hand but without experience it is hard for complex grammars.

If you don't have any experience with lexers and parsers, it would be better to start with other tools not using LR (LALR) parser but LL because they are much more intuitive for starters.

I have very good experience with ANTLR. It generates Java code but it has also C++ backend and nice grammar development tools (ANTLRWorks).

So my advice is none of those two you have chosen but start with ANTLR.


If you are not constrained by C/C++, I would recommend Eclipse Xtext. It is simple to learn, has great documentation, and has the added benefit of automatically generating an Eclipse-based IDE that supports your language, with syntax-highlighting, content assist, and other powerful features.

Xtext has its own programming language (Xtend) which is a more powerful version of Java (in a way, it is similar to Scala). Xtext uses ANTLR internally.

链接地址: http://www.djcxy.com/p/41744.html

上一篇: Flex&Bison Segmenation故障

下一篇: Flex和Bison工具