Setting up the use of this module.


§1. Introduction.

define BUILDING_MODULE TRUE

§2. Setting up the memory manager. We need to itemise the structures we'll want to allocate:

enum inter_name_CLASS
enum inter_name_generator_CLASS
enum package_request_CLASS
enum hierarchy_location_CLASS
enum hierarchy_attachment_point_CLASS
enum hierarchy_metadatum_CLASS
enum module_package_CLASS
enum submodule_identity_CLASS
enum submodule_request_CLASS
enum compilation_unit_CLASS
enum inter_schema_CLASS
enum inter_schema_node_CLASS
enum inter_schema_token_CLASS

§3. With allocation functions:

DECLARE_CLASS(hierarchy_location)
DECLARE_CLASS(hierarchy_attachment_point)
DECLARE_CLASS(hierarchy_metadatum)
DECLARE_CLASS(package_request)
DECLARE_CLASS(module_package)
DECLARE_CLASS(submodule_identity)
DECLARE_CLASS(submodule_request)
DECLARE_CLASS(compilation_unit)
DECLARE_CLASS(inter_schema)
DECLARE_CLASS(inter_schema_node)
DECLARE_CLASS(inter_schema_token)

DECLARE_CLASS_ALLOCATED_IN_ARRAYS(inter_name, 1000)
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(inter_name_generator, 1000)

#ifdef CORE_MODULE
MAKE_ANNOTATION_FUNCTIONS(explicit_iname, inter_name)
MAKE_ANNOTATION_FUNCTIONS(unit, compilation_unit)
#endif

§4. The beginning. (The client doesn't need to call the start and end routines, because the foundation module does that automatically.)

void BuildingModule::start(void) {
    Register this module's memory allocation reasons4.1;
    Register this module's stream writers4.2;
    Register this module's debugging log aspects4.4;
    Register this module's debugging log writers4.5;
    Register this module's command line switches4.6;
}

§4.1. Register this module's memory allocation reasons4.1 =

    ;

§4.2. Register this module's stream writers4.2 =

    Writers::register_writer('n', &InterNames::writer);

§4.3.

enum SCHEMA_COMPILATION_DA
enum SCHEMA_COMPILATION_DETAILS_DA
enum PACKAGING_DA

§4.4. Register this module's debugging log aspects4.4 =

    Log::declare_aspect(SCHEMA_COMPILATION_DA, L"schema compilation", FALSE, FALSE);
    Log::declare_aspect(SCHEMA_COMPILATION_DETAILS_DA, L"schema compilation details", FALSE, FALSE);
    Log::declare_aspect(PACKAGING_DA, L"packaging", FALSE, FALSE);

§4.5. Register this module's debugging log writers4.5 =

    Writers::register_logger('1', InterSchemas::log);
    Writers::register_logger('X', Packaging::log);

§4.6. Register this module's command line switches4.6 =

    ;

§5. The end.

void BuildingModule::end(void) {
}