1. Program overview

The C++ producer is a large program (over 200000 lines, including automatically generated code) written in C. A description of the program structure and the basic organisation of the source code are described in the first section.

One of the design methods used in the C++ producer is the extensive use of automatic code generation tools. The type system is based around the calculus tool, which allows complex type systems to be described in a simple format. The interface generated by calculus allows for rigorous static type checking, generic type constructors for lists, stacks etc., encapsulation of the operations on the types within the system, and optional run-time checking for null pointers and discriminated union tags. An overview is given of the type system used as the basis of the C++ producer design. Also see the Calculus Users' Guide.

The other general purpose code generation tool used in the C++ producer is the parser generator, sid. A brief description of the problems in writing a C++ parser is given. Also see the SID Users' Guide.

The other code generation tools used were written specifically for the C++ producer. The error reporting routines within the producer are based on an error catalogue, from which code for constructing and printing errors is generated. The TDF output routines are based on primitives automatically generated from a standard database describing the TDF specification.

The program itself is well commented, so no lower level program documentation has been provided. When performing development work the producer should be compiled without the NDEBUG macro defined. This enables the calculus run-time checks, along with other assertions, and makes available the debugging routines, DEBUG_type, which can be used to print an object from the internal type system.