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
This commit is contained in:
parent
6caca2abbe
commit
6258ccfe1f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue