1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-08 18:14:21 +03:00
inform7/shared/syntax-module/Chapter 1/Syntax Module.w

53 lines
1.4 KiB
OpenEdge ABL
Raw Normal View History

2019-02-05 02:44:07 +02:00
[SyntaxModule::] Syntax Module.
Setting up the use of this module.
@ 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:
2019-02-05 02:44:07 +02:00
@d SYNTAX_MODULE TRUE
@ To begin with, this module needs to allocate memory:
2020-05-09 15:07:39 +03:00
@e parse_node_CLASS
@e parse_node_tree_CLASS
@e parse_node_annotation_array_CLASS
2019-02-05 02:44:07 +02:00
=
2020-05-09 15:07:39 +03:00
DECLARE_CLASS(parse_node)
DECLARE_CLASS(parse_node_tree)
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(parse_node_annotation, 500)
2019-02-05 02:44:07 +02:00
@ Like all modules, this one must define a |start| and |end| function:
2019-02-05 02:44:07 +02:00
=
void SyntaxModule::start(void) {
@<Register this module's memory allocation reasons@>;
2019-02-05 02:44:07 +02:00
@<Register this module's stream writers@>;
@<Register this module's debugging log aspects@>;
@<Register this module's debugging log writers@>;
ParseTree::metadata_setup();
}
void SyntaxModule::end(void) {
}
@<Register this module's memory allocation reasons@> =
;
2019-02-05 02:44:07 +02:00
@<Register this module's stream writers@> =
;
@
@e VERIFICATIONS_DA
@<Register this module's debugging log aspects@> =
Log::declare_aspect(VERIFICATIONS_DA, L"verifications", FALSE, FALSE);
@<Register this module's debugging log writers@> =
Writers::register_logger('m', ParseTree::log_tree);
Writers::register_logger_I('N', ParseTree::log_type);
Writers::register_logger('P', ParseTree::log_node);
Writers::register_logger('T', ParseTree::log_subtree);