Setting up the use of this module.


§1. This section simoly 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 IF_MODULE TRUE

§2. To begin with, this module needs to allocate memory:

enum action_name_CLASS
enum auxiliary_file_CLASS
enum backdrop_found_in_notice_CLASS
enum cached_understanding_CLASS
enum command_index_entry_CLASS
enum connected_submap_CLASS
enum door_dir_notice_CLASS
enum door_to_notice_CLASS
enum EPS_map_level_CLASS
enum grammar_line_CLASS
enum grammar_verb_CLASS
enum loop_over_scope_CLASS
enum map_data_CLASS
enum named_action_pattern_CLASS
enum noun_filter_token_CLASS
enum parse_name_notice_CLASS
enum parsing_data_CLASS
enum parsing_pp_data_CLASS
enum regions_data_CLASS
enum reserved_command_verb_CLASS
enum rubric_holder_CLASS
enum scene_CLASS
enum short_name_notice_CLASS
enum slash_gpr_CLASS
enum spatial_data_CLASS
enum action_name_list_array_CLASS
enum action_pattern_array_CLASS
enum ap_optional_clause_array_CLASS
enum scene_connector_array_CLASS
enum understanding_item_array_CLASS
enum understanding_reference_array_CLASS
DECLARE_CLASS(action_name)
DECLARE_CLASS(auxiliary_file)
DECLARE_CLASS(backdrop_found_in_notice)
DECLARE_CLASS(cached_understanding)
DECLARE_CLASS(command_index_entry)
DECLARE_CLASS(connected_submap)
DECLARE_CLASS(door_dir_notice)
DECLARE_CLASS(door_to_notice)
DECLARE_CLASS(EPS_map_level)
DECLARE_CLASS(grammar_line)
DECLARE_CLASS(grammar_verb)
DECLARE_CLASS(loop_over_scope)
DECLARE_CLASS(map_data)
DECLARE_CLASS(named_action_pattern)
DECLARE_CLASS(noun_filter_token)
DECLARE_CLASS(parse_name_notice)
DECLARE_CLASS(parsing_data)
DECLARE_CLASS(parsing_pp_data)
DECLARE_CLASS(regions_data)
DECLARE_CLASS(reserved_command_verb)
DECLARE_CLASS(rubric_holder)
DECLARE_CLASS(scene)
DECLARE_CLASS(short_name_notice)
DECLARE_CLASS(slash_gpr)
DECLARE_CLASS(spatial_data)

DECLARE_CLASS_ALLOCATED_IN_ARRAYS(action_name_list, 1000)
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(action_pattern, 100)
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(ap_optional_clause, 400)
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(scene_connector, 1000)
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(understanding_item, 100)
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(understanding_reference, 100)

MAKE_ANNOTATION_FUNCTIONS(action_meaning, action_pattern)
MAKE_ANNOTATION_FUNCTIONS(constant_action_name, action_name)
MAKE_ANNOTATION_FUNCTIONS(constant_action_pattern, action_pattern)
MAKE_ANNOTATION_FUNCTIONS(constant_grammar_verb, grammar_verb)
MAKE_ANNOTATION_FUNCTIONS(constant_named_action_pattern, named_action_pattern)
MAKE_ANNOTATION_FUNCTIONS(constant_scene, scene)

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

COMPILE_WRITER(action_pattern *, PL::Actions::Patterns::log)
COMPILE_WRITER(grammar_verb *, PL::Parsing::Verbs::log)
COMPILE_WRITER(grammar_line *, PL::Parsing::Lines::log)
COMPILE_WRITER(action_name_list *, PL::Actions::Lists::log)
COMPILE_WRITER(action_name *, PL::Actions::log)

void IFModule::start(void) {
    Register this module's memory allocation reasons3.1;
    Register this module's stream writers3.2;
    Register this module's debugging log aspects3.4;
    Register this module's debugging log writers3.5;
}
void IFModule::end(void) {
}

§3.1. Register this module's memory allocation reasons3.1 =

    ;

§3.2. Register this module's stream writers3.2 =

    ;

§3.3.

enum GRAMMAR_DA
enum GRAMMAR_CONSTRUCTION_DA

§3.4. Register this module's debugging log aspects3.4 =

    Log::declare_aspect(GRAMMAR_DA, L"grammar", FALSE, FALSE);
    Log::declare_aspect(GRAMMAR_CONSTRUCTION_DA, L"grammar construction", FALSE, FALSE);

§3.5. Register this module's debugging log writers3.5 =

    REGISTER_WRITER('A', PL::Actions::Patterns::log);
    REGISTER_WRITER('G', PL::Parsing::Verbs::log);
    REGISTER_WRITER('g', PL::Parsing::Lines::log);
    REGISTER_WRITER('L', PL::Actions::Lists::log);
    REGISTER_WRITER('l', PL::Actions::log);

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

DECLARE_ANNOTATION_FUNCTIONS(action_meaning, action_pattern)
DECLARE_ANNOTATION_FUNCTIONS(constant_action_name, action_name)
DECLARE_ANNOTATION_FUNCTIONS(constant_action_pattern, action_pattern)
DECLARE_ANNOTATION_FUNCTIONS(constant_grammar_verb, grammar_verb)
DECLARE_ANNOTATION_FUNCTIONS(constant_named_action_pattern, named_action_pattern)
DECLARE_ANNOTATION_FUNCTIONS(constant_scene, scene)