Doc review on newmodel.
authorAlexandre Terrasa <alexandre@moz-concept.com>
Thu, 19 Apr 2012 19:20:06 +0000 (15:20 -0400)
committerAlexandre Terrasa <alexandre@moz-concept.com>
Thu, 19 Apr 2012 19:20:06 +0000 (15:20 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>

src/modelbuilder.nit
src/naive_interpreter.nit [moved from src/naiveinterpreter.nit with 99% similarity]
src/nit.nit
src/nitstats.nit
src/runtime_type.nit
src/scope.nit
src/toolcontext.nit
src/typing.nit

index 752fa6a..f37a940 100644 (file)
@@ -47,7 +47,7 @@ redef class ToolContext
        end
 end
 
-# A model builder know how to load nit source files and build the associated model
+# A model builder knows how to load nit source files and build the associated model
 # The important function is `parse_and_build' that does all the job.
 # The others function can be used for specific tasks
 class ModelBuilder
similarity index 99%
rename from src/naiveinterpreter.nit
rename to src/naive_interpreter.nit
index cb2e61b..e06cd6f 100644 (file)
@@ -15,7 +15,7 @@
 # limitations under the License.
 
 # Interpretation of a Nit program directly on the AST
-module naiveinterpreter
+module naive_interpreter
 
 import literal
 import typing
index 5fbefd5..611da1a 100644 (file)
@@ -19,7 +19,7 @@ module nit
 
 import modelbuilder
 import exprbuilder
-import naiveinterpreter
+import naive_interpreter
 
 # Create a tool context to handle options and paths
 var toolcontext = new ToolContext
index 24bafd2..60e6631 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Program that collect various data about nit programs and libraries
+# A program that collects various data about nit programs and libraries
 module nitstats
+# Collected datas are :
+#  * number of modules
+#  * number of classes  (interface, class, enum, extern, abstract)
+#  * number of class definitions and refinments
+#  * number of properties
+#  * number of used types and runtime classes
 
 import modelbuilder
 import exprbuilder
index 2616edf..ff99f60 100644 (file)
 # Rapid type analysis is an analyse that aproximates the set of live classes
 # and the set of live methods starting from the entry point of the program.
 # These two sets are interdependant and computed together.
-# It is quite efficient but the type set is global such pollute each call site.
+# It is quite efficient but the type set is global and pollutes each call site.
 #
 # Heterogenous generics means that each intancied generic class is associated
 # to a distinct runtime type.
-# Heterogenous generics has the advantage to resolve the the formal generic
+# Heterogenous generics has the advantage to resolve the formal generic
 # parameters types but increase the number of types.
 # More important, heterogenous generics cannot deal with infinite number of runtime
 # types since the analyse tries to list them all (so some programs will be badly refused)
@@ -35,7 +35,7 @@
 #  * `self' is monomorphic
 #  * virtual types are all resolved
 #  * live attributes can be determined on each class
-# But the big disavantage to explode the number of runtime method: each method
+# But has the disadvantage to explode the number of runtime method: each method
 # definition for each runtime type that need it
 module runtime_type
 
@@ -82,6 +82,8 @@ redef class ModelBuilder
        end
 end
 
+# RuntimeTypeAnalysis looks for alive runtime types in application.
+# The entry point of the analysis is the mainmodule of the application.
 class RuntimeTypeAnalysis
        var modelbuilder: ModelBuilder
        var mainmodule: MModule
@@ -152,6 +154,7 @@ class RuntimeTypeAnalysis
                self.live_cast_types.add(mtype)
        end
 
+       # Start the analysis.
        fun run_analysis
        do
                while not todo.is_empty do
index 8914b31..a88496a 100644 (file)
@@ -35,7 +35,7 @@ class ClosureVariable
 end
 
 # Mark where break and continue will branch.
-# marks are either associated with a label of with a for_loop structure
+# Marks are either associated with a label of with a for_loop structure
 class EscapeMark
        # The name of the label (unless the mark is an anonymous loop mark)
        var name: nullable String
index e78ec77..5cdea5d 100644 (file)
@@ -29,6 +29,7 @@ class Message
        readable var _location: nullable Location
        readable var _text: String
 
+       # Comparisons are made on message locations.
        redef fun <(other: OTHER): Bool do
                if location == null then return true
                if other.location == null then return false
index 836a82b..e73cb9e 100644 (file)
@@ -431,7 +431,7 @@ redef class AExpr
        # null if self is a statement of in case of error
        var mtype: nullable MType = null
 
-       # Is the statement correctly typed.
+       # Is the statement correctly typed?
        # Used to distinguish errors and statements when `mtype' == null
        var is_typed: Bool = false