diff --git a/docs/syntax-module/1-sm.html b/docs/syntax-module/1-sm.html index 4683f65f3..606d7d51f 100644 --- a/docs/syntax-module/1-sm.html +++ b/docs/syntax-module/1-sm.html @@ -87,7 +87,7 @@ all we need do is set up some debugging log facilities. NodeType::metadata_setup(); Annotations::make_annotation_allowed_table(); Writers::register_logger('m', Node::log_tree); /* |$m| = log syntax tree from node */ - Writers::register_logger_I('N', NodeType::log); /* |$N| = log individual node type */ + Writers::register_logger_I('N', NodeType::log); /* |$N| = log individual node type */ Writers::register_logger('P', Node::log_node); /* |$P| = log individual parse node */ Writers::register_logger('T', Node::log_subtree); /* |$T| = log tree under node */ } diff --git a/docs/words-module/1-wm.html b/docs/words-module/1-wm.html index a7ac2b85c..1e6e53d29 100644 --- a/docs/words-module/1-wm.html +++ b/docs/words-module/1-wm.html @@ -58,8 +58,8 @@

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 +

§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:

@@ -68,9 +68,7 @@ which use this module:

§2. This module defines the following classes:

-
enum LEXER_TEXT_MREASON
-enum LEXER_WORDS_MREASON
-enum source_file_CLASS
+
enum source_file_CLASS
 enum vocabulary_entry_CLASS
 enum nonterminal_CLASS
 enum production_CLASS
@@ -88,59 +86,35 @@ which use this module:
 

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

+
enum LEXER_TEXT_MREASON
+enum LEXER_WORDS_MREASON
+enum LEXICAL_OUTPUT_DA
+enum VOCABULARY_DA
+
 void WordsModule::start(void) {
-    Memory::reason_name(LEXER_TEXT_MREASON, "source text");
+    Memory::reason_name(LEXER_TEXT_MREASON, "source text");  ho hum
     Memory::reason_name(LEXER_WORDS_MREASON, "source text details");
-    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;
+
+    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 */
+
     Lexer::start();
     Vocabulary::create_punctuation();
     Preform::begin();
 }
+
 void WordsModule::end(void) {
 }
 
-

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

- -
-    ;
-
- -

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

- -
-    Writers::register_writer('A', &WordAssemblages::writer);
-    Writers::register_writer_I('N', &Lexer::writer);
-    Writers::register_writer('V', &Vocabulary::writer);
-    Writers::register_writer_W('W', &Wordings::writer);
-
- -

§3.3.

- -
enum LEXICAL_OUTPUT_DA
-enum VOCABULARY_DA
-
-

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

- -
-    Log::declare_aspect(LEXICAL_OUTPUT_DA, L"lexical output", FALSE, FALSE);
-    Log::declare_aspect(VOCABULARY_DA, L"vocabulary", FALSE, FALSE);
-
- -

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

- -
-    Writers::register_logger('f', WordAssemblages::log);
-    Writers::register_logger('v', Vocabulary::log);
-
- diff --git a/docs/words-module/2-vcb.html b/docs/words-module/2-vcb.html index 3d488174f..a674480d1 100644 --- a/docs/words-module/2-vcb.html +++ b/docs/words-module/2-vcb.html @@ -228,7 +228,7 @@ creator, and a debugging logger: return ve; } -void Vocabulary::log(OUTPUT_STREAM, void *vve) { +void Vocabulary::log(OUTPUT_STREAM, void *vve) { vocabulary_entry *ve = (vocabulary_entry *) vve; if (ve == NULL) { WRITE("NULL"); return; } if (ve->exemplar == NULL) { WRITE("NULL-EXEMPLAR"); return; } @@ -271,7 +271,7 @@ structure: else return ve->exemplar; } -void Vocabulary::writer(OUTPUT_STREAM, char *format_string, void *vV) { +void Vocabulary::writer(OUTPUT_STREAM, char *format_string, void *vV) { vocabulary_entry *ve = (vocabulary_entry *) vV; if (ve == NULL) internal_error("tried to write null vocabulary"); switch (format_string[0]) { diff --git a/docs/words-module/2-wa.html b/docs/words-module/2-wa.html index 2e058cf0d..e7a2baf59 100644 --- a/docs/words-module/2-wa.html +++ b/docs/words-module/2-wa.html @@ -185,7 +185,7 @@ frequently, since it consumes memory: return FALSE; } -void WordAssemblages::writer(OUTPUT_STREAM, char *format_string, void *vW) { +void WordAssemblages::writer(OUTPUT_STREAM, char *format_string, void *vW) { word_assemblage *wa = (word_assemblage *) vW; if (wa) for (int i=0; i<wa->no_indiv_words; i++) { @@ -298,7 +298,7 @@ frequently, since it consumes memory:

§13.

-void WordAssemblages::log(OUTPUT_STREAM, void *vwa) {
+void WordAssemblages::log(OUTPUT_STREAM, void *vwa) {
     word_assemblage *wa = (word_assemblage *) vwa;
     if (wa == NULL) { WRITE("<null-words>"); return; }
     int i, sp = FALSE;
diff --git a/docs/words-module/3-lxr.html b/docs/words-module/3-lxr.html
index 59914063d..a2a9c0cfc 100644
--- a/docs/words-module/3-lxr.html
+++ b/docs/words-module/3-lxr.html
@@ -533,7 +533,7 @@ distinguished. We'll do this with the letters     lw_array[to] = lw_array[from];
 }
 
-void Lexer::writer(OUTPUT_STREAM, char *format_string, int wn) {
+void Lexer::writer(OUTPUT_STREAM, char *format_string, int wn) {
     if ((wn < 0) || (wn >= lexer_wordcount)) return;
     switch (format_string[0]) {
         case '+': WRITE("%w", lw_array[wn].lw_rawtext); break;
diff --git a/docs/words-module/3-wrd.html b/docs/words-module/3-wrd.html
index 11d56fb36..6915babb6 100644
--- a/docs/words-module/3-wrd.html
+++ b/docs/words-module/3-wrd.html
@@ -423,7 +423,7 @@ and we return w2
 
 
-void Wordings::writer(OUTPUT_STREAM, char *format_string, wording W) {
+void Wordings::writer(OUTPUT_STREAM, char *format_string, wording W) {
     switch (format_string[0]) {
         case 'W': /* bare |%W| means the same as |%-W|, so fall through to... */
         case '-': Write the stream with normalised casing22.1; break;
diff --git a/shared/syntax-module/Chapter 1/Syntax Module.w b/shared/syntax-module/Chapter 1/Syntax Module.w
index 3d59b43eb..d9fed1561 100644
--- a/shared/syntax-module/Chapter 1/Syntax Module.w	
+++ b/shared/syntax-module/Chapter 1/Syntax Module.w	
@@ -28,7 +28,7 @@ void SyntaxModule::start(void) {
 	NodeType::metadata_setup();
 	Annotations::make_annotation_allowed_table();
 	Writers::register_logger('m', Node::log_tree);    /* |$m| = log syntax tree from node */
-	Writers::register_logger_I('N', NodeType::log);  /* |$N| = log individual node type */
+	Writers::register_logger_I('N', NodeType::log);   /* |$N| = log individual node type */
 	Writers::register_logger('P', Node::log_node);    /* |$P| = log individual parse node */
 	Writers::register_logger('T', Node::log_subtree); /* |$T| = log tree under node */
 }
diff --git a/shared/words-module/Chapter 1/Words Module.w b/shared/words-module/Chapter 1/Words Module.w
index 3633abe19..d4f1a6c14 100644
--- a/shared/words-module/Chapter 1/Words Module.w	
+++ b/shared/words-module/Chapter 1/Words Module.w	
@@ -2,17 +2,14 @@
 
 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
+@ 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:
 
 @d WORDS_MODULE TRUE
 
 @ This module defines the following classes:
 
-@e LEXER_TEXT_MREASON
-@e LEXER_WORDS_MREASON
-
 @e source_file_CLASS
 @e vocabulary_entry_CLASS
 @e nonterminal_CLASS
@@ -30,39 +27,32 @@ DECLARE_CLASS(ptoken)
 
 @ Like all modules, this one must define a |start| and |end| function:
 
-=
-void WordsModule::start(void) {
-	Memory::reason_name(LEXER_TEXT_MREASON, "source text");
-	Memory::reason_name(LEXER_WORDS_MREASON, "source text details");
-	@;
-	@;
-	@;
-	@;
-	Lexer::start();
-	Vocabulary::create_punctuation();
-	Preform::begin();
-}
-void WordsModule::end(void) {
-}
-
-@ =
-	;
-
-@ =
-	Writers::register_writer('A', &WordAssemblages::writer);
-	Writers::register_writer_I('N', &Lexer::writer);
-	Writers::register_writer('V', &Vocabulary::writer);
-	Writers::register_writer_W('W', &Wordings::writer);
-
-@
+@e LEXER_TEXT_MREASON
+@e LEXER_WORDS_MREASON
 
 @e LEXICAL_OUTPUT_DA
 @e VOCABULARY_DA
 
-@ =
+=
+void WordsModule::start(void) {
+	Memory::reason_name(LEXER_TEXT_MREASON, "source text"); /* ho hum */
+	Memory::reason_name(LEXER_WORDS_MREASON, "source text details");
+
+	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);
-	Writers::register_logger('v', Vocabulary::log);
+	Writers::register_logger('f', WordAssemblages::log); /* |$f| = log word assemblage */
+	Writers::register_logger('v', Vocabulary::log);      /* |$v| = log vocabulary entry */
+
+	Lexer::start();
+	Vocabulary::create_punctuation();
+	Preform::begin();
+}
+
+void WordsModule::end(void) {
+}