Next: 4. PROMIS-NT
Up: 3. The Model Definition
Previous: 3.10 Accessing the Model and
3.11 Error Recovery
The error handling mechanisms of the Algorithm Library implies three different types
of errors:
- syntax errors in MDL files are resolved by the MDL parser
which is implemented by using the Bison [13,30]
LALR(1) parser generation tool. A verbose description of the
error is written to an ANSI C++ stream provided by the application
which defaults to the Posix stderr stream, including the
line number range of the incorrect statements. Any syntax error
recognized within an MDL statement invalidates the complete statement
and the parsing process is continued right after the faulty definitions.
In case errors occurred during the parsing process, the application is
notified by the return status of the function call to the MDL parser.
Subsequent parser evaluations are not affected by such errors despite the
unavailability of the incorrect definitions.
- initialization errors: MDL class instances are created
dynamically at runtime of the application implying rigorous type checks
in all involved MDL expressions. Since Parameter types and
operators are added by user supplied MDL extension libraries, also the
availability of operators in the involved MDL expressions is checked
during the instantiation process. Similar to the procedure in case of
syntax errors, initialization errors result in a verbose error message
forwarded to an error stream and an invalid handle (NULL Pointer)
to the requested MDL class.
- runtime errors resulting from incorrect parameter values supplied
to methods of an MDL object should be detected within the MDL
definitions of the affected MDL classes and signaled to the
application with a return false; statement. Since the Algorithm Library
delegates the actual execution of MDL expressions consequently to
binary instances of user supplied C++ classes and data types,
remaining errors will result in either Posix signals or C++
exceptions if they are available for the underlying C++ compiler
system. Both are ignored by the Algorithm Library and forwarded to the application.
Next: 4. PROMIS-NT
Up: 3. The Model Definition
Previous: 3.10 Accessing the Model and
Robert Mlekus
1999-11-14