Flex and Bison
Dr. Dobb's Journal February 1998
Flex and Bison are the GNU replacements for the venerable UNIX tools lex and yacc. They are a set of converters that let you express input patterns at a higher level of abstraction and convert those patterns into compilable C.
For both Flex and Bison, a source file is created that contains a set of rules for matching the expected input and an associated action for each rule. An action is a set of C statements that are attached to a rule. The file is passed through the tool converting the rules into C. The actions are simply passed through to the C file without change. The resulting file can be compiled using an ANSI compatible compiler.
Flex and Bison are available from the GNU projects web site at http:// www.gnu.ai.mit.edu/. The most recent Flex distribution is in flex-2.5.4a.tar.gz and Bison release is bison-1.25.tar.gz.
Both distributions contain source code that can be compiled on a variety of platforms, including MS-DOS. Excellent documentation is also provided as part of the distribution.
-- R.M.
Copyright © 1998, Dr. Dobb's Journal