src: complete some missing doc
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 8 Sep 2016 17:31:15 +0000 (13:31 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 14 Oct 2016 19:18:31 +0000 (15:18 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/compiler/abstract_compiler.nit
src/model/model_views.nit

index f310fe2..81c640c 100644 (file)
@@ -1149,25 +1149,41 @@ extern void nitni_global_ref_decr( struct nitni_ref *ref ) {
        fun finalize_ffi_for_module(mmodule: MModule) do mmodule.finalize_ffi(self)
 end
 
-# A file unit (may be more than one file if
-# A file unit aim to be autonomous and is made or one or more `CodeWriter`s
+# C code file generated from the `writers` and the `required_declarations`
+#
+# A file unit aims to be autonomous and is made or one or more `CodeWriter`s.
 class CodeFile
+       # Basename of the file, will be appended by `.h` and `.c`
        var name: String
+
+       # `CodeWriter` used in sequence to fill the top of the body, then the bottom
        var writers = new Array[CodeWriter]
+
+       # Required declarations keys
+       #
+       # See: `provide_declaration`
        var required_declarations = new HashSet[String]
 end
 
-# Where to store generated lines
+# Store generated lines
+#
+# Instances are added to `file.writers` at construction.
 class CodeWriter
+       # Parent `CodeFile`
        var file: CodeFile
+
+       # Main lines of code (written at the bottom of the body)
        var lines = new Array[String]
+
+       # Lines of code for declarations (written at the top of the body)
        var decl_lines = new Array[String]
 
-       # Add a line in the main part of the generated C
+       # Add a line in the main lines of code (to `lines`)
        fun add(s: String) do self.lines.add(s)
 
-       # Add a line in the
-       # (used for local or global declaration)
+       # Add a declaration line (to `decl_lines`)
+       #
+       # Used for local and global declaration.
        fun add_decl(s: String) do self.decl_lines.add(s)
 
        init
index 2eec952..2f0eed5 100644 (file)
@@ -148,7 +148,7 @@ class ModelView
                return model.mmodule_importation_hierarchy.sub(mmodules)
        end
 
-       # Build the POSet of `mmodules` hierarchy.
+       # Build the POSet of `mclasses` hierarchy.
        fun mclasses_poset(mainmodule: MModule, mclasses: Set[MClass]): POSet[MClass] do
                return mainmodule.flatten_mclass_hierarchy.sub(mclasses)
        end