The following changes were made in the latest version of the parser:
|
Elimination of static data: In the latest version, the parser architecture has changed from C style-based to C++ style-based. In the previous version of the parser, most of the parser data were stored in static variables and the data lifecycle was based on initializers and cleaners. The new architecture places data in data singletons and uses C++ constructors and destructors. The switch to the C++ architecture has improved the parser re-enterability, made the data flow more robust, and helped clean multiple memory leaks in the parser code. |
|
Introduction of parsing sesions: In the previous version, data were stored in static variables and, therefore, were retained across all parsing cycles. This meant that if a property was defined once, it continued to be defined in the next DEF file reads. In some applications, this feature was actively used. In others, it disturbed expected application behavior. To address this issue, the latest version of the parser introduces two modes of files processing - compatibility mode and session-based mode. |
|
|
Compatibility mode (session-less mode) - This mode is compatible with the old parser behavior. You can call the parser initialization once with defrInit(), adjust parsing settings and initialize the parser callbacks any time. The properties in PROPERTYDEFINITIONS sections will be active in all subsequent file reads. |
|
|
Session-based mode - This mode introduces the concept of a parsing session - the parser configuration settings will be active during the session time and will be cleaned on its end. The parsing session also controls PROPERTYDEFINITIONS data. Property definitions remain active throughout the parsing session time and are cleaned at the end of the session. The session-based mode does not require calling callbacks and configuration unset functions - all callbacks and properties will be set to defaults by defrClear() or the next session defrInitSession() call. |
By default, the DEF parser works in the compatibility mode. To activate the session-based mode, you must use defrInitSession() instead of defrInit().
Note: Currently, the compatibility mode is used for all old applications for which code has not been adjusted. The def2oa translator has been adjusted to use the session-based parsing mode.
For more information, see "DEF Reader Working Modes" in the DEF C/C++ Programming Interface (Open Licensing Program).
|
Long DEF Files Support: In this version, the DEF line counter switched to 64-bit integer type, making it possible to process files with more than two billion lines. |
The following reader setup and class routines were added in this release:
For more information, see "DEF Reader Setup and Control Routines" in the DEF C/C++ Programming Interface (Open Licensing Program).
The following writer routies for blockages were added in this release:
For more information, see "DEF Writer Routines" in the DEF C/C++ Programming Interface (Open Licensing Program).
The following reader class routines were added in this release:
For more information, see "DEF Reader Classes" in the DEF C/C++ Programming Interface (Open Licensing Program).
The following reader callback routines were added in this release:
For more information, see "DEF Reader Callback Routines" in the DEF C/C++ Programming Interface (Open Licensing Program).