Additional syntax tree node and annotation types used by the actions plugin.

§1. There is just one additional node type, but it can take four new annotations:

enum ACTION_NT   "taking something closed"

enum action_meaning_ANNOT  action_pattern: meaning in parse tree when used as noun
enum constant_action_name_ANNOT  action_name: for constant values
enum constant_action_pattern_ANNOT  action_pattern: for constant values
enum constant_named_action_pattern_ANNOT  named_action_pattern: for constant values
enum constant_explicit_action_ANNOT  explicit_action: for constant values
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_explicit_action, explicit_action)
DECLARE_ANNOTATION_FUNCTIONS(constant_named_action_pattern, named_action_pattern)

§2.

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_explicit_action, explicit_action)
MAKE_ANNOTATION_FUNCTIONS(constant_named_action_pattern, named_action_pattern)

void ActionsNodes::nodes_and_annotations(void) {
    NodeType::new(ACTION_NT, I"ACTION_NT", 0, INFTY, L3_NCAT, ASSERT_NFLAG);

    Annotations::declare_type(action_meaning_ANNOT,
        ActionsNodes::write_action_meaning_ANNOT);
    Annotations::declare_type(constant_action_name_ANNOT,
        ActionsNodes::write_constant_action_name_ANNOT);
    Annotations::declare_type(constant_action_pattern_ANNOT,
        ActionsNodes::write_constant_action_pattern_ANNOT);
    Annotations::declare_type(constant_explicit_action_ANNOT,
        ActionsNodes::write_constant_explicit_action_ANNOT);
    Annotations::declare_type(constant_named_action_pattern_ANNOT,
        ActionsNodes::write_constant_named_action_pattern_ANNOT);

    Annotations::allow(ACTION_NT, action_meaning_ANNOT);
    Annotations::allow(COMMON_NOUN_NT, action_meaning_ANNOT);
    Annotations::allow(CONSTANT_NT, constant_action_name_ANNOT);
    Annotations::allow(CONSTANT_NT, constant_action_pattern_ANNOT);
    Annotations::allow(CONSTANT_NT, constant_named_action_pattern_ANNOT);
    Annotations::allow(CONSTANT_NT, constant_explicit_action_ANNOT);
}

§3. And for the debugging log:

void ActionsNodes::write_action_meaning_ANNOT(text_stream *OUT, parse_node *p) {
    if (Node::get_action_meaning(p)) {
        WRITE(" {action meaning: ");
        ActionPatterns::write(OUT, Node::get_action_meaning(p));
        WRITE("}");
    }
}
void ActionsNodes::write_constant_action_name_ANNOT(text_stream *OUT, parse_node *p) {
    if (Node::get_constant_action_name(p))
        WRITE(" {action name: %W}", ActionNameNames::tensed(Node::get_constant_action_name(p), IS_TENSE));
}
void ActionsNodes::write_constant_action_pattern_ANNOT(text_stream *OUT, parse_node *p) {
    if (Node::get_constant_action_pattern(p)) {
        WRITE(" {action pattern: ");
        ActionPatterns::write(OUT, Node::get_constant_action_pattern(p));
        WRITE("}");
    }
}
void ActionsNodes::write_constant_explicit_action_ANNOT(text_stream *OUT, parse_node *p) {
    if (Node::get_constant_explicit_action(p)) {
        WRITE(" {explicit action: ");
        ActionPatterns::write(OUT, Node::get_constant_explicit_action(p)->as_described);
        WRITE("}");
    }
}
void ActionsNodes::write_constant_named_action_pattern_ANNOT(text_stream *OUT,
    parse_node *p) {
    if (Node::get_constant_named_action_pattern(p)) {
        WRITE(" {named action pattern: ");
        Nouns::write(OUT, Node::get_constant_named_action_pattern(p)->as_noun);
        WRITE("}");
    }
}