Imagination is more important than knowledge.Knowledge is limited. Imagination encircles the world.—— Einstein
The GNU Project of the Free Software Foundation distributes bison, a yacc replacement; BSD and GNU Project also distribute flex (Fast Lexical Analyzer Generator), “a rewrite of lex intended to right some of that tool’s deficiencies,” according to its reference page.
Lex and yacc help you write programs that transform structured input. This includes an enormous range of applications—anything from a simple text search program that looks for patterns in its input file to a C compiler that transforms a source program into optimized object code.
Lex and yacc are tools designed for writers of compilers and interpreters. Any application that looks for patterns in its input, or has an input or command language is a good candidate for lex and yacc.
Furthermore, they allow for rapid application prototyping, easy modification, and simple maintenance of programs.
When a task involves dividing the input into units and establishing some relationship among those units, you should think of lex and yacc.
《lex and yacc--second edition》 – 作者：John R. Levine
《自制编程语言》 – 前桥和弥