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:
YooLex::_yyText
is an STL container, which can be one of the
following:
std::string
std::vector<char>
yoolex::PseudoVector
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: