Because we compile with "-Werror" each warning is an error. In this
parser an implicit fall-through is used in a switch() statement, which
is typically a bad thing, but not unheard of.
In this code it was checked + verified that it was the intent to fall
through. So the warning was disabled.
The configuration now builds a shared library and links FLEX libraries with
it.
Cranking up the compiler warnings to close to insane:
- in "static struct llist *lit()" fix a classic!
single "&" where "&&" meant:
inch=input();
- while(inch !=EOF & inch != ';' && inch != '\0') {
+ while(inch !=EOF && inch != ';' && inch != '\0') {
- removed unused variables
- renamed shadowed variable/function parameter
- fix function prototype/function not returning a value
prototype:
"char* <function>"
implementation:
no return statement at all!
The source code relied on including y.tab.h (the generated header file).
When adding an installable target - such that other projects could (re)use
the vex parser, installing a non-descript file like "y.tab.h" is
undesirable.
To that effect: the generated parser file(s) will now be:
vex_parser.c vex_parser.h
the generated lexer file will now be:
vex.yy.c
Use -DCMAKE_INSTALL_DIR=<path> to set desired installation location.
Will install:
${CMAKE_INSTALL_DIR}/lib/libvex.a
... /include/vex.h
vex++.h
vex_parser.h
All code now includes "vex_parser.h" in stead of "y.tab.h"