From 0e6e7cffc6232cb8003406e9cda6337542494fdc Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Tue, 21 Apr 2015 16:24:18 -0400 Subject: [PATCH] model: add missing service to retrieve a AClassDef from a MClassDef. Signed-off-by: Alexandre Terrasa --- src/modelize/modelize_class.nit | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modelize/modelize_class.nit b/src/modelize/modelize_class.nit index 3503bd0..5fd0381 100644 --- a/src/modelize/modelize_class.nit +++ b/src/modelize/modelize_class.nit @@ -448,6 +448,14 @@ redef class ModelBuilder # Registration of the nclassdef associated to each mclassdef private var mclassdef2nclassdef = new HashMap[MClassDef, AClassdef] + + # Retrieve the associated AST node of a mclassdef. + # + # This method is used to associate model entity with syntactic entities. + # If the class definition is not associated with a node, returns `null`. + fun mclassdef2node(mclassdef: MClassDef): nullable AClassdef do + return mclassdef2nclassdef.get_or_null(mclassdef) + end end redef class AModule -- 1.7.9.5