model_ext: Add a way to represent inner classes.
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Mon, 1 Dec 2014 18:54:40 +0000 (13:54 -0500)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Tue, 2 Dec 2014 15:19:59 +0000 (10:19 -0500)
Add adapters to wrap classes as properties.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

src/doc/model_ext.nit

index fe74325..2adc9fd 100644 (file)
@@ -88,6 +88,28 @@ class MTypePart
        end
 end
 
+# An inner class.
+class MInnerClass
+       super MProperty
+
+       redef type MPROPDEF: MInnerClassDef
+
+       # The actual class.
+       var inner: MClass
+end
+
+# An inner class definition.
+class MInnerClassDef
+       super MPropDef
+
+       redef type MPROPDEF: MInnerClassDef
+       redef type MPROPERTY: MInnerClass
+
+       # The actual class definition.
+       var inner: MClassDef
+end
+
+
 # The “package” visiblity.
 #
 # Any visibility roughly equivalent to the default visibility of Java, that is