Current version of YooLex 0.9j. Since 0.9i contained a number of serious bugs, I decided to delay the 1.0 release a little. Please report any bugs that you have found or help me out testing the code. The trouble I am facing is not writing the code, but testing it due to myriad number of combinations of options and optimizations YooLex has. Please email me if you want to help.


Since FLEX is the standard of the lexical code generator, I am comparing YooLex with FLEX throughout the web site. I hope that this approach will not offend anyone.

YooLex is a lexical scanner code generator that generates C++/STL compatible classes. It allows multiple scanner classes and instances to be created and run easily without messing with macros. It is true that the current version (2.5.4a) of FLEX does generate C++ source codes that is reentrant, but there are flaws in the design of FLEX's C++ code generator that makes the process of doing so as painful and ugly as it can be. It does not seem to me that the forth-coming FLEX update will improve it much other than make it compatible with the current C++ standard.

Here is a list of general features of YooLex provides:

Here is an example that I have written to demonstrate the input and output of YooLex.


YooLex is written in standard C++/STL. GCC 2.95/3.0 and Debian 2.2/Redhat 7.0 are used in the development. I tried not to use new features of C++ such as <sstream> which is not present in GCC 2.9. I also tested with Sun Workshop 5.0 and it compiled fine. The only problem is the getopt function. On Unix systems, it is part of the C library (<unistd.h>), but it is not for DOS/Windows compilers other than ported G++ compilers. There are two ways around this problem:

  1. Download Turbo C++ 2.0 from Borland. There is a file called getopt.c which contains the function. You will need to clean it up a little before it can be compiled with your favorite C++ compiler.
  2. Download BSD getopt.c source code. Do a google search on it.

$Id: intro.html,v 1.17 2003/01/20 09:24:14 coconut Exp $