Setting up the use of this module.

§1. This section simply sets up the module in ways expected by foundation, and contains no code of interest. The following constant exists only in tools which use this module:

define SUPERVISOR_MODULE TRUE

§2. This module defines the following classes:

enum build_methodology_CLASS
enum build_script_CLASS
enum build_skill_CLASS
enum build_step_CLASS
enum build_vertex_CLASS
enum cd_image_CLASS
enum cd_layout_error_CLASS
enum cd_manifest_item_CLASS
enum cd_pageset_CLASS
enum cd_source_file_CLASS
enum cd_volume_CLASS
enum compiled_documentation_CLASS
enum control_structure_phrase_CLASS
enum copy_error_CLASS
enum element_activation_CLASS
enum example_index_data_CLASS
enum extensions_key_item_CLASS
enum heading_CLASS
enum heading_tree_CLASS
enum inbuild_copy_CLASS
enum inbuild_edition_CLASS
enum inbuild_genre_CLASS
enum inbuild_licence_CLASS
enum inbuild_nest_CLASS
enum inbuild_registry_CLASS
enum inbuild_requirement_CLASS
enum inbuild_search_result_CLASS
enum inbuild_work_CLASS
enum index_lemma_CLASS
enum index_reference_CLASS
enum index_cross_reference_CLASS
enum indexing_category_CLASS
enum inform_extension_CLASS
enum inform_kit_CLASS
enum inform_kit_ittt_CLASS
enum inform_language_CLASS
enum inform_pipeline_CLASS
enum inform_project_CLASS
enum inform_template_CLASS
enum kit_configuration_CLASS
enum kit_dependency_CLASS
enum satellite_test_case_CLASS
enum index_markup_notation_CLASS
DECLARE_CLASS(build_methodology)
DECLARE_CLASS(build_script)
DECLARE_CLASS(build_skill)
DECLARE_CLASS(build_step)
DECLARE_CLASS(build_vertex)
DECLARE_CLASS(cd_image)
DECLARE_CLASS(cd_layout_error)
DECLARE_CLASS(cd_manifest_item)
DECLARE_CLASS(cd_pageset)
DECLARE_CLASS(cd_source_file)
DECLARE_CLASS(cd_volume)
DECLARE_CLASS(control_structure_phrase)
DECLARE_CLASS(compiled_documentation)
DECLARE_CLASS(copy_error)
DECLARE_CLASS(element_activation)
DECLARE_CLASS(example_index_data)
DECLARE_CLASS(extensions_key_item)
DECLARE_CLASS(heading_tree)
DECLARE_CLASS(heading)
DECLARE_CLASS(inbuild_copy)
DECLARE_CLASS(inbuild_edition)
DECLARE_CLASS(inbuild_genre)
DECLARE_CLASS(inbuild_licence)
DECLARE_CLASS(inbuild_nest)
DECLARE_CLASS(inbuild_registry)
DECLARE_CLASS(inbuild_requirement)
DECLARE_CLASS(inbuild_search_result)
DECLARE_CLASS(inbuild_work)
DECLARE_CLASS(index_lemma)
DECLARE_CLASS(index_reference)
DECLARE_CLASS(index_cross_reference)
DECLARE_CLASS(indexing_category)
DECLARE_CLASS(inform_extension)
DECLARE_CLASS(inform_kit_ittt)
DECLARE_CLASS(inform_kit)
DECLARE_CLASS(inform_language)
DECLARE_CLASS(inform_pipeline)
DECLARE_CLASS(inform_project)
DECLARE_CLASS(inform_template)
DECLARE_CLASS(kit_configuration)
DECLARE_CLASS(kit_dependency)
DECLARE_CLASS(satellite_test_case)
DECLARE_CLASS(index_markup_notation)

§3. Like all modules, this one must define a start and end function:

enum RESULTS_SORTING_MREASON
enum EXTENSIONS_CENSUS_DA
enum HEADINGS_DA
void SupervisorModule::start(void) {
    Memory::reason_name(RESULTS_SORTING_MREASON, "results sorting");
    Writers::register_writer('X', &Works::writer);
    Writers::register_writer('J', &Languages::log);
    Log::declare_aspect(EXTENSIONS_CENSUS_DA, U"extensions census", FALSE, FALSE);
    Log::declare_aspect(HEADINGS_DA, U"headings", FALSE, FALSE);
    Supervisor::start();
    Declare the tree annotations3.2;
}
void SupervisorModule::end(void) {
}

§3.1. This module uses syntax, and adds the following annotations to the syntax tree.

enum embodying_heading_ANNOT  heading: for parse nodes of headings
enum inclusion_of_extension_ANNOT  inform_extension: for parse nodes of headings
DECLARE_ANNOTATION_FUNCTIONS(embodying_heading, heading)
MAKE_ANNOTATION_FUNCTIONS(embodying_heading, heading)
DECLARE_ANNOTATION_FUNCTIONS(inclusion_of_extension, inform_extension)
MAKE_ANNOTATION_FUNCTIONS(inclusion_of_extension, inform_extension)

§3.2. Declare the tree annotations3.2 =

    Annotations::declare_type(embodying_heading_ANNOT,
        SupervisorModule::write_embodying_heading_ANNOT);
    Annotations::declare_type(inclusion_of_extension_ANNOT,
        SupervisorModule::write_inclusion_of_extension_ANNOT);

§4.

void SupervisorModule::write_embodying_heading_ANNOT(text_stream *OUT, parse_node *p) {
    if (Node::get_embodying_heading(p)) {
        heading *H = Node::get_embodying_heading(p);
        WRITE(" {under: H%d'%W'}", H->level, Node::get_text(H->sentence_declaring));
    }
}
void SupervisorModule::write_inclusion_of_extension_ANNOT(text_stream *OUT, parse_node *p) {
    if (Node::get_inclusion_of_extension(p)) {
        inform_extension *E = Node::get_inclusion_of_extension(p);
        WRITE(" {includes: ");
        Copies::write_copy(OUT, E->as_copy);
        WRITE(" }");
    }
}

define STILL_MORE_ANNOTATION_PERMISSIONS_SYNTAX_CALLBACK SupervisorModule::grant_annotation_permissions
void SupervisorModule::grant_annotation_permissions(void) {
    Annotations::allow(HEADING_NT, embodying_heading_ANNOT);
    Annotations::allow(HEADING_NT, inclusion_of_extension_ANNOT);
}