nitg: adds process_nclassdef to Phase
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 31 Aug 2013 14:55:46 +0000 (10:55 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 30 Oct 2013 17:33:50 +0000 (13:33 -0400)
Will be used by FFI's language visitors.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/phase.nit

index 70d3a71..2ce4187 100644 (file)
@@ -60,6 +60,9 @@ redef class ToolContext
                                end
                                errcount = self.error_count
                                for nclassdef in nmodule.n_classdefs do
+                                       self.info(" phase: {phase.class_name} for {nclassdef.location}", 3)
+                                       assert phase.toolcontext == self
+                                       phase.process_nclassdef(nclassdef)
                                        for npropdef in nclassdef.n_propdefs do
                                                self.info(" phase: {phase.class_name} for {npropdef.location}", 4)
                                                assert phase.toolcontext == self
@@ -124,6 +127,11 @@ abstract class Phase
        # @toimplement
        fun process_nmodule(nmodule: AModule) do end
 
+       # Specific actions to execute on the tree of a class definition
+       # Note that the order of the visit is the one of the file
+       # @toimplement
+       fun process_nclassdef(nclassdef: AClassdef) do end
+
        # Specific actions to execute on the tree of a property
        # Note that the order of the visit is the one of the file
        # @toimplement