From 6258ccfe1ff587f26f90a53d04e734b973103415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Doser?= Date: Fri, 14 Sep 2007 12:10:21 +0000 Subject: [PATCH] issue a warning when a class has more than one parent git-svn-id: https://projects.brucker.ch/su4sml/svn/su4sml/trunk@6847 3260e6d1-4efc-4170-b0a7-36055960796d --- su4sml/src/rep_parser.sml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/su4sml/src/rep_parser.sml b/su4sml/src/rep_parser.sml index bf8d81c..995cb08 100644 --- a/su4sml/src/rep_parser.sml +++ b/su4sml/src/rep_parser.sml @@ -370,13 +370,18 @@ fun transform_classifier t (XMI.Class {xmiid,name,isActive,visibility,isLeaf, let val parents = map ((find_classifier_type t) o (find_parent t)) generalizations val filtered_parents = filter (fn x => x <> Rep_OclType.OclAny) parents + val filtered_parent = case filtered_parents + of [] => NONE + | [x] => SOME x + | x::y::_ => (warn ("Class '"^name^"' has multiple parents."^ + " Using only '"^ + (Rep_OclType.string_of_OclType x)^"'."); + SOME x) val checked_invariants = filter_exists t invariant val navigable_aends = filter #isNavigable (find_aends t xmiid) in Rep.Class {name = (* path_of_classifier *) (find_classifier_type t xmiid), - parent = case filtered_parents - of [] => NONE - | xs => SOME ((* path_of_classifier *) (hd xs)), + parent = filtered_parent, attributes = map (transform_attribute t) attributes, operations = map (transform_operation t) operations, invariant = map ((transform_constraint t) o