pending changes from uml2cdl to add tagged values to XMI.Primitive
git-svn-id: https://projects.brucker.ch/su4sml/svn/infsec-import/trunk/src/su4sml@6215 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
parent
97936e32a5
commit
dc64206316
|
@ -386,20 +386,20 @@ fun transform_classifier t (XMI.Class {xmiid,name,isActive,visibility,isLeaf,
|
||||||
thyname = NONE}
|
thyname = NONE}
|
||||||
end
|
end
|
||||||
| transform_classifier t (XMI.Primitive {xmiid,name,generalizations,
|
| transform_classifier t (XMI.Primitive {xmiid,name,generalizations,
|
||||||
operations,invariant}) =
|
operations,invariant,taggedValue}) =
|
||||||
let val checked_invariants = filter_exists t invariant
|
let val checked_invariants = filter_exists t invariant
|
||||||
in
|
in
|
||||||
Rep.Primitive {name = (* case *) find_classifier_type t xmiid (*of Rep_OclType.Classifier x => x
|
Rep.Primitive {name = (* case *) find_classifier_type t xmiid (*of Rep_OclType.Classifier x => x
|
||||||
| _ => raise Option*) ,
|
| _ => raise Option*) ,
|
||||||
parent = NONE, (* FIX *)
|
parent = NONE, (* FIX *)
|
||||||
operations = map (transform_operation t) operations,
|
operations = map (transform_operation t) operations,
|
||||||
associationends = map (transform_aend t)
|
associationends = map (transform_aend t)
|
||||||
(find_aends t xmiid),
|
(find_aends t xmiid),
|
||||||
invariant = map ((transform_constraint t) o
|
invariant = map ((transform_constraint t) o
|
||||||
(find_constraint t)) checked_invariants,
|
(find_constraint t)) checked_invariants,
|
||||||
stereotypes = nil, (*FIX *)
|
stereotypes = nil, (*FIX *)
|
||||||
interfaces = nil, (* FIX *)
|
interfaces = nil, (* FIX *)
|
||||||
thyname = NONE}
|
thyname = NONE}
|
||||||
end
|
end
|
||||||
| transform_classifier t (XMI.Enumeration {xmiid,name,generalizations,
|
| transform_classifier t (XMI.Enumeration {xmiid,name,generalizations,
|
||||||
operations,literals,invariant}) =
|
operations,literals,invariant}) =
|
||||||
|
@ -474,7 +474,8 @@ fun transformXMI ({classifiers,constraints,packages,
|
||||||
xmiid="DummyT",
|
xmiid="DummyT",
|
||||||
operations=[],
|
operations=[],
|
||||||
generalizations=[],
|
generalizations=[],
|
||||||
invariant=[]},
|
invariant=[],
|
||||||
|
taggedValue=[]},
|
||||||
nil))
|
nil))
|
||||||
(* for some reasons, there are model elements outside of the top-level *)
|
(* for some reasons, there are model elements outside of the top-level *)
|
||||||
(* model the xmi-file. So we have to handle them here seperately: *)
|
(* model the xmi-file. So we have to handle them here seperately: *)
|
||||||
|
|
|
@ -185,7 +185,9 @@ type Primitive = { xmiid: string,
|
||||||
name: string,
|
name: string,
|
||||||
operations: Operation list,
|
operations: Operation list,
|
||||||
generalizations: string list,
|
generalizations: string list,
|
||||||
invariant: string list}
|
invariant: string list,
|
||||||
|
taggedValue: TaggedValue list
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
|
|
|
@ -373,6 +373,9 @@ fun class_taggedvalues_of table (XMI.Class c) =
|
||||||
| class_taggedvalues_of table (XMI.AssociationClass c) =
|
| class_taggedvalues_of table (XMI.AssociationClass c) =
|
||||||
map (fn x => (find_tagdefinition table (#tag_type x),#dataValue x))
|
map (fn x => (find_tagdefinition table (#tag_type x),#dataValue x))
|
||||||
(#taggedValue c)
|
(#taggedValue c)
|
||||||
|
| class_taggedvalues_of table (XMI.Primitive c) =
|
||||||
|
map (fn x => (find_tagdefinition table (#tag_type x),#dataValue x))
|
||||||
|
(#taggedValue c)
|
||||||
| class_taggedvalues_of table _ = error "in class_taggedvalues_of: \
|
| class_taggedvalues_of table _ = error "in class_taggedvalues_of: \
|
||||||
\argument doesn't support tagged values"
|
\argument doesn't support tagged values"
|
||||||
|
|
||||||
|
@ -384,6 +387,9 @@ fun class_taggedvalue_of table tag (XMI.Class c) =
|
||||||
| class_taggedvalue_of table tag (XMI.AssociationClass c) =
|
| class_taggedvalue_of table tag (XMI.AssociationClass c) =
|
||||||
Option.map #2 ((List.find (fn (x,y) => x=tag))
|
Option.map #2 ((List.find (fn (x,y) => x=tag))
|
||||||
(class_taggedvalues_of table (XMI.AssociationClass c)))
|
(class_taggedvalues_of table (XMI.AssociationClass c)))
|
||||||
|
| class_taggedvalue_of table tag (XMI.Primitive c) =
|
||||||
|
Option.map #2 ((List.find (fn (x,y) => x=tag))
|
||||||
|
(class_taggedvalues_of table (XMI.Primitive c)))
|
||||||
| class_taggedvalue_of table tag _ = error "in class_taggedvalues_of: \
|
| class_taggedvalue_of table tag _ = error "in class_taggedvalues_of: \
|
||||||
\argument doesn't support tagged values"
|
\argument doesn't support tagged values"
|
||||||
|
|
||||||
|
|
|
@ -819,15 +819,17 @@ fun mkAssociationClass atts tree
|
||||||
fun mkPrimitive atts tree
|
fun mkPrimitive atts tree
|
||||||
= XMI.Primitive
|
= XMI.Primitive
|
||||||
{ xmiid = atts |> xmiid,
|
{ xmiid = atts |> xmiid,
|
||||||
name = atts |> name,
|
name = atts |> name,
|
||||||
operations = tree |> get "UML:Classifier.feature"
|
operations = tree |> get "UML:Classifier.feature"
|
||||||
|> filter "UML:Operation"
|
|> filter "UML:Operation"
|
||||||
|> map mkOperation,
|
|> map mkOperation,
|
||||||
generalizations = tree |> get "UML:GeneralizableElement.generalization"
|
generalizations = tree |> get "UML:GeneralizableElement.generalization"
|
||||||
|> map xmiidref,
|
|> map xmiidref,
|
||||||
invariant = tree |> get "UML:ModelElement.constraint"
|
invariant = tree |> get "UML:ModelElement.constraint"
|
||||||
|> map xmiidref
|
|> map xmiidref,
|
||||||
}
|
taggedValue = tree |> get "UML:ModelElement.taggedValue"
|
||||||
|
|> map mkTaggedValue
|
||||||
|
}
|
||||||
(* handle IllFormed msg => error ("in mkPrimitive: "^msg)*)
|
(* handle IllFormed msg => error ("in mkPrimitive: "^msg)*)
|
||||||
|
|
||||||
fun mkInterface atts tree
|
fun mkInterface atts tree
|
||||||
|
|
Loading…
Reference in New Issue