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

60 lines
1.7 KiB
OpenEdge ABL
Raw Normal View History

2019-02-05 02:44:07 +02:00
[WordsModule::] Words Module.
Setting up the use of this module.
2022-05-01 16:25:26 +03:00
@ This section simply sets up the module in ways expected by //foundation//,
2020-05-12 00:33:22 +03:00
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 WORDS_MODULE TRUE
@ This module defines the following classes:
2019-02-05 02:44:07 +02:00
2020-05-09 15:07:39 +03:00
@e source_file_CLASS
2020-05-09 16:15:42 +03:00
@e vocabulary_entry_CLASS
2020-05-09 15:07:39 +03:00
@e nonterminal_CLASS
@e production_CLASS
@e production_list_CLASS
@e ptoken_CLASS
2019-02-05 02:44:07 +02:00
=
2020-05-09 15:07:39 +03:00
DECLARE_CLASS(source_file)
DECLARE_CLASS_ALLOCATED_IN_ARRAYS(vocabulary_entry, 100)
DECLARE_CLASS(nonterminal)
DECLARE_CLASS(production_list)
DECLARE_CLASS(production)
DECLARE_CLASS(ptoken)
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
2020-05-12 00:33:22 +03:00
@e LEXER_TEXT_MREASON
@e LEXER_WORDS_MREASON
@e LEXICAL_OUTPUT_DA
@e VOCABULARY_DA
2019-02-05 02:44:07 +02:00
=
void WordsModule::start(void) {
2020-05-12 00:58:36 +03:00
Memory::reason_name(LEXER_TEXT_MREASON, "source text");
2019-02-05 02:44:07 +02:00
Memory::reason_name(LEXER_WORDS_MREASON, "source text details");
2020-05-12 00:33:22 +03:00
Writers::register_writer('A', &WordAssemblages::writer); /* |%A| = write word assemblage */
Writers::register_writer_I('N', &Lexer::writer); /* |%N| = write word with this number */
Writers::register_writer('V', &Vocabulary::writer); /* |%V| = write vocabulary entry */
Writers::register_writer_W('W', &Wordings::writer); /* |%W| = write wording */
Log::declare_aspect(LEXICAL_OUTPUT_DA, L"lexical output", FALSE, FALSE);
Log::declare_aspect(VOCABULARY_DA, L"vocabulary", FALSE, FALSE);
Writers::register_logger('f', WordAssemblages::log); /* |$f| = log word assemblage */
Writers::register_logger('v', Vocabulary::log); /* |$v| = log vocabulary entry */
2019-02-05 02:44:07 +02:00
Lexer::start();
Vocabulary::create_punctuation();
2020-05-17 02:20:21 +03:00
LoadPreform::create_punctuation();
Nonterminals::register();
2019-02-05 02:44:07 +02:00
}
2020-05-12 00:33:22 +03:00
void WordsModule::end(void) {
}