reworked flex YY_FATAL_ERROR to use C++ exceptions
cleaned up validation a bit