previous         next         contents

4. Standard library

The Depot4 standard library consists of a set of modules that are useful in defining translators. They offer services, which for efficiency or convenience, may be better implemented in the host language.

Actual implementations may contain additional procedures. The listed interfaces define only the common core functionality for any Depot4 implementation.

4.1. Dp4OP

This is the Output on Protocol module. For error and warning messages it is preferable to use the intrinsic Ml4 procedures ERROR or WARNING.

4.2. Dp4Messages

Therein, all the messages that may displayed to users are managed. By default, this module contains the system messages. Application specific message texts can be added in different ways. The most general way is deriving a specific subclass of Dp4Messages, which gives one the full power of the host language system. Not that flexible but fairly convenient is the definition of key text pairs in the Ml4 code by means of setErrorTxT procedure.
Error keys should start with a unique identification to avoid overlapping. All system error keys start with "dp4.".

4.3. Dp4List

This module offers a simple symbol management. Together with flexible arrays (FLEX) it supports the construction of symbol tables in Ml4 (without any pointer handling).

The index range of lists starts with one (thus corresponding to FLEX).

4.4. Dp4Util

This module collects some useful functions which were needed by system itself but may also be useful in other projects. There may be slight differences among different Depot4 implementations.
At least, this module contains these functions:

4.5. Dp4Tools

This module is heavily dependent from the implementation language and its runtime system, and thus specified in Appendix D. At least, it contains a procedure to perform a translation.


    previous         next         contents


© J. Lampe 1997-2010