refactoring: split XMI_UML into an increasing sequence of smaller structures, roughly following UML 1.5 packages: OCL -> DataTypes -> Extension Mechanismes -> Core -> Model Management -> ...
removed some redundant "UML" prefixes in datatypes git-svn-id: https://projects.brucker.ch/su4sml/svn/infsec-import/trunk/src/su4sml@2952 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
parent
3e22dc7585
commit
1b5c0e69e1
|
@ -46,11 +46,11 @@ fun getBoolAtt string atts =
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
fun getIntegerAtt string atts =
|
fun getIntAtt string atts =
|
||||||
let val att = getAttValue string atts
|
let val att = getAttValue string atts
|
||||||
in
|
in
|
||||||
(valOf o Int.fromString) att
|
(valOf o Int.fromString) att
|
||||||
handle Option => raise IllFormed ("in getIntegerAtt: found attribute "^string^
|
handle Option => raise IllFormed ("in getIntAtt: found attribute "^string^
|
||||||
" with unexpected value "^att)
|
" with unexpected value "^att)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -61,11 +61,11 @@ fun getXmiIdref a = getAttValue "xmi.idref" a
|
||||||
fun getVisibility atts =
|
fun getVisibility atts =
|
||||||
let val att = getAttValueMaybe "visibility" atts
|
let val att = getAttValueMaybe "visibility" atts
|
||||||
in
|
in
|
||||||
case att of SOME "public" => XMI_UML.Public
|
case att of SOME "public" => XMI_UML.public
|
||||||
| SOME "private" => XMI_UML.Private
|
| SOME "private" => XMI_UML.private
|
||||||
| SOME "protected" => XMI_UML.Protected
|
| SOME "protected" => XMI_UML.protected
|
||||||
| SOME "package" => XMI_UML.Package
|
| SOME "package" => XMI_UML.package
|
||||||
| NONE => XMI_UML.Public
|
| NONE => XMI_UML.public
|
||||||
| SOME string => raise IllFormed ("in getVisibility: found unexpected attribute value "^string)
|
| SOME string => raise IllFormed ("in getVisibility: found unexpected attribute value "^string)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ fun mkAttribute atts trees =
|
||||||
|
|
||||||
fun tree2attribute tree = generic_tree2xmi "UML:Attribute" mkAttribute tree
|
fun tree2attribute tree = generic_tree2xmi "UML:Attribute" mkAttribute tree
|
||||||
|
|
||||||
fun mkUMLClass atts trees
|
fun mkClass atts trees
|
||||||
= XMI_UML.Class { xmiid = getXmiId atts,
|
= XMI_UML.Class { xmiid = getXmiId atts,
|
||||||
name = getName atts,
|
name = getName atts,
|
||||||
isActive = getBoolAtt "isActive" atts,
|
isActive = getBoolAtt "isActive" atts,
|
||||||
|
@ -382,7 +382,7 @@ fun mkUMLClass atts trees
|
||||||
trees)
|
trees)
|
||||||
else nil}
|
else nil}
|
||||||
|
|
||||||
fun mkUMLPrimitive atts trees
|
fun mkPrimitive atts trees
|
||||||
= XMI_UML.Primitive { xmiid = getXmiId atts,
|
= XMI_UML.Primitive { xmiid = getXmiId atts,
|
||||||
name = getName atts,
|
name = getName atts,
|
||||||
operations = if existsByName "UML:Classifier.feature" trees
|
operations = if existsByName "UML:Classifier.feature" trees
|
||||||
|
@ -403,7 +403,7 @@ fun mkUMLPrimitive atts trees
|
||||||
}
|
}
|
||||||
handle IllFormed msg => raise IllFormed ("in mkPrimitive: "^msg)
|
handle IllFormed msg => raise IllFormed ("in mkPrimitive: "^msg)
|
||||||
|
|
||||||
fun mkUMLEnumeration atts trees
|
fun mkEnumeration atts trees
|
||||||
= XMI_UML.Enumeration { xmiid = getXmiId atts,
|
= XMI_UML.Enumeration { xmiid = getXmiId atts,
|
||||||
name = getName atts,
|
name = getName atts,
|
||||||
operations = if existsByName "UML:Classifier.feature" trees
|
operations = if existsByName "UML:Classifier.feature" trees
|
||||||
|
@ -423,11 +423,11 @@ fun mkUMLEnumeration atts trees
|
||||||
trees)
|
trees)
|
||||||
else nil
|
else nil
|
||||||
}
|
}
|
||||||
handle IllFormed msg => raise IllFormed ("in mkUMLEnumeration: "^msg)
|
handle IllFormed msg => raise IllFormed ("in mkEnumeration: "^msg)
|
||||||
|
|
||||||
fun mkUMLVoid atts trees = XMI_UML.Void { xmiid = getXmiId atts,
|
fun mkVoid atts trees = XMI_UML.Void { xmiid = getXmiId atts,
|
||||||
name = getName atts }
|
name = getName atts }
|
||||||
handle IllFormed msg => raise IllFormed ("in mkUMLVoid: "^msg)
|
handle IllFormed msg => raise IllFormed ("in mkVoid: "^msg)
|
||||||
|
|
||||||
|
|
||||||
fun mkGenericCollection atts trees =
|
fun mkGenericCollection atts trees =
|
||||||
|
@ -451,29 +451,29 @@ fun mkGenericCollection atts trees =
|
||||||
handle IllFormed msg => raise IllFormed ("in mkGenericCollection: "^msg)
|
handle IllFormed msg => raise IllFormed ("in mkGenericCollection: "^msg)
|
||||||
|
|
||||||
|
|
||||||
fun mkUMLCollection atts trees = XMI_UML.Collection (mkGenericCollection atts trees)
|
fun mkCollection atts trees = XMI_UML.Collection (mkGenericCollection atts trees)
|
||||||
fun mkUMLSequence atts trees = XMI_UML.Sequence (mkGenericCollection atts trees)
|
fun mkSequence atts trees = XMI_UML.Sequence (mkGenericCollection atts trees)
|
||||||
fun mkUMLSet atts trees = XMI_UML.Set (mkGenericCollection atts trees)
|
fun mkSet atts trees = XMI_UML.Set (mkGenericCollection atts trees)
|
||||||
fun mkUMLBag atts trees = XMI_UML.Bag (mkGenericCollection atts trees)
|
fun mkBag atts trees = XMI_UML.Bag (mkGenericCollection atts trees)
|
||||||
fun mkUMLOrderedSet atts trees = XMI_UML.OrderedSet (mkGenericCollection atts trees)
|
fun mkOrderedSet atts trees = XMI_UML.OrderedSet (mkGenericCollection atts trees)
|
||||||
|
|
||||||
fun tree2classifier tree =
|
fun tree2classifier tree =
|
||||||
let val elem = XmlTreeData.getElem tree
|
let val elem = XmlTreeData.getElem tree
|
||||||
val atts = XmlTreeData.getAtts tree
|
val atts = XmlTreeData.getAtts tree
|
||||||
val trees = XmlTreeData.getTrees tree
|
val trees = XmlTreeData.getTrees tree
|
||||||
in
|
in
|
||||||
if elem = "UML:Class" then mkUMLClass atts trees
|
if elem = "UML:Class" then mkClass atts trees
|
||||||
else if elem = "UML:Primitive" orelse
|
else if elem = "UML:Primitive" orelse
|
||||||
elem = "UML:DataType" then mkUMLPrimitive atts trees
|
elem = "UML:DataType" then mkPrimitive atts trees
|
||||||
else if elem = "UML:Enumeration" then mkUMLEnumeration atts trees
|
else if elem = "UML:Enumeration" then mkEnumeration atts trees
|
||||||
else if elem = "UML15OCL.Types.VoidType" then mkUMLVoid atts trees
|
else if elem = "UML15OCL.Types.VoidType" then mkVoid atts trees
|
||||||
else if elem = "UML15OCL.Types.CollectionType" then
|
else if elem = "UML15OCL.Types.CollectionType" then
|
||||||
mkUMLCollection atts trees
|
mkCollection atts trees
|
||||||
else if elem = "UML15OCL.Types.SequenceType" then mkUMLSequence atts trees
|
else if elem = "UML15OCL.Types.SequenceType" then mkSequence atts trees
|
||||||
else if elem = "UML15OCL.Types.SetType" then mkUMLSet atts trees
|
else if elem = "UML15OCL.Types.SetType" then mkSet atts trees
|
||||||
else if elem = "UML15OCL.Types.BagType" then mkUMLBag atts trees
|
else if elem = "UML15OCL.Types.BagType" then mkBag atts trees
|
||||||
else if elem = "UML15OCL.Types.OrderedSetType" then
|
else if elem = "UML15OCL.Types.OrderedSetType" then
|
||||||
mkUMLOrderedSet atts trees
|
mkOrderedSet atts trees
|
||||||
else raise IllFormed ("in tree2classifier: found unexpected element "^elem)
|
else raise IllFormed ("in tree2classifier: found unexpected element "^elem)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -498,7 +498,7 @@ fun tree2package tree =
|
||||||
let val trees = skipOver "UML:Namespace.ownedElement"
|
let val trees = skipOver "UML:Namespace.ownedElement"
|
||||||
((hd o XmlTreeData.getTrees) tree)
|
((hd o XmlTreeData.getTrees) tree)
|
||||||
val atts = XmlTreeData.getAtts tree in
|
val atts = XmlTreeData.getAtts tree in
|
||||||
XMI_UML.UMLPackage { xmiid = getXmiId atts,
|
XMI_UML.Package { xmiid = getXmiId atts,
|
||||||
name = getName atts,
|
name = getName atts,
|
||||||
visibility = getVisibility atts,
|
visibility = getVisibility atts,
|
||||||
packages = (map tree2package
|
packages = (map tree2package
|
||||||
|
@ -564,7 +564,7 @@ fun parseXMI filename =
|
||||||
in
|
in
|
||||||
tree2xmicontent (hd trees)
|
tree2xmicontent (hd trees)
|
||||||
end
|
end
|
||||||
handle IllFormed msg => error msg
|
handle IllFormed msg => error msg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,11 @@ exception IllFormed
|
||||||
|
|
||||||
datatype HashTableEntry = Package of ocl_type.Path
|
datatype HashTableEntry = Package of ocl_type.Path
|
||||||
| Type of (ocl_type.OclType *
|
| Type of (ocl_type.OclType *
|
||||||
(XMI_UML.UMLAssociationEnd list))
|
(XMI_UML.AssociationEnd list))
|
||||||
| Generalization of (string * string)
|
| Generalization of (string * string)
|
||||||
| Constraint of XMI_OCL.OCLConstraint
|
| Constraint of XMI_UML.Constraint
|
||||||
| Stereotype of string
|
| Stereotype of string
|
||||||
| Variable of XMI_OCL.VariableDeclaration
|
| Variable of XMI_UML.VariableDeclaration
|
||||||
| Attribute of ocl_type.Path
|
| Attribute of ocl_type.Path
|
||||||
| Operation of ocl_type.Path
|
| Operation of ocl_type.Path
|
||||||
|
|
||||||
|
@ -127,22 +127,22 @@ fun find_classifier_type t xmiid
|
||||||
handle Option => error ("expected Classifier "^xmiid^" in table")
|
handle Option => error ("expected Classifier "^xmiid^" in table")
|
||||||
|
|
||||||
|
|
||||||
fun insert_constraint table (c:XMI_OCL.OCLConstraint) =
|
fun insert_constraint table (c:XMI_UML.Constraint) =
|
||||||
HashTable.insert table (#xmiid c, Constraint c)
|
HashTable.insert table (#xmiid c, Constraint c)
|
||||||
|
|
||||||
fun insert_variable_dec table (v:XMI_OCL.VariableDeclaration) =
|
fun insert_variable_dec table (v:XMI_UML.VariableDeclaration) =
|
||||||
HashTable.insert table (#xmiid v, Variable v)
|
HashTable.insert table (#xmiid v, Variable v)
|
||||||
|
|
||||||
fun insert_stereotype table (s:XMI_UML.UMLStereotype) =
|
fun insert_stereotype table (s:XMI_UML.Stereotype) =
|
||||||
HashTable.insert table (#xmiid s, Stereotype (#name s))
|
HashTable.insert table (#xmiid s, Stereotype (#name s))
|
||||||
|
|
||||||
fun insert_generalization table (g:XMI_UML.UMLGeneralization) =
|
fun insert_generalization table (g:XMI_UML.Generalization) =
|
||||||
HashTable.insert table (#xmiid g, Generalization (#child_id g, #parent_id g))
|
HashTable.insert table (#xmiid g, Generalization (#child_id g, #parent_id g))
|
||||||
|
|
||||||
fun insert_attribute table path_prefix (a:XMI_UML.UMLAttribute) =
|
fun insert_attribute table path_prefix (a:XMI_UML.Attribute) =
|
||||||
HashTable.insert table (#xmiid a, Attribute (path_prefix @ [#name a]))
|
HashTable.insert table (#xmiid a, Attribute (path_prefix @ [#name a]))
|
||||||
|
|
||||||
fun insert_operation table path_prefix (a:XMI_UML.UMLOperation) =
|
fun insert_operation table path_prefix (a:XMI_UML.Operation) =
|
||||||
HashTable.insert table (#xmiid a, Operation (path_prefix @ [#name a]))
|
HashTable.insert table (#xmiid a, Operation (path_prefix @ [#name a]))
|
||||||
|
|
||||||
fun add_aend table xmiid (aend:mdr_core.associationend) = () (* FIX *)
|
fun add_aend table xmiid (aend:mdr_core.associationend) = () (* FIX *)
|
||||||
|
@ -188,42 +188,42 @@ fun insert_classifier table package_prefix class =
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
fun transform_expression t (XMI_OCL.LiteralExp {symbol,expression_type}) =
|
fun transform_expression t (XMI_UML.LiteralExp {symbol,expression_type}) =
|
||||||
ocl_term.Literal (symbol,find_classifier_type t expression_type)
|
ocl_term.Literal (symbol,find_classifier_type t expression_type)
|
||||||
| transform_expression t (XMI_OCL.IfExp {condition,thenExpression,
|
| transform_expression t (XMI_UML.IfExp {condition,thenExpression,
|
||||||
elseExpression,expression_type}) =
|
elseExpression,expression_type}) =
|
||||||
ocl_term.If (transform_expression t condition,
|
ocl_term.If (transform_expression t condition,
|
||||||
find_classifier_type t (XMI_OCL.expression_type_of condition),
|
find_classifier_type t (XMI_UML.expression_type_of condition),
|
||||||
transform_expression t thenExpression,
|
transform_expression t thenExpression,
|
||||||
find_classifier_type t (XMI_OCL.expression_type_of thenExpression),
|
find_classifier_type t (XMI_UML.expression_type_of thenExpression),
|
||||||
transform_expression t elseExpression,
|
transform_expression t elseExpression,
|
||||||
find_classifier_type t (XMI_OCL.expression_type_of elseExpression),
|
find_classifier_type t (XMI_UML.expression_type_of elseExpression),
|
||||||
find_classifier_type t expression_type)
|
find_classifier_type t expression_type)
|
||||||
| transform_expression t (XMI_OCL.AttributeCallExp {source,referredAttribute,
|
| transform_expression t (XMI_UML.AttributeCallExp {source,referredAttribute,
|
||||||
expression_type}) =
|
expression_type}) =
|
||||||
ocl_term.AttributeCall (transform_expression t source,
|
ocl_term.AttributeCall (transform_expression t source,
|
||||||
find_classifier_type t (XMI_OCL.expression_type_of source),
|
find_classifier_type t (XMI_UML.expression_type_of source),
|
||||||
find_attribute t referredAttribute,
|
find_attribute t referredAttribute,
|
||||||
find_classifier_type t expression_type)
|
find_classifier_type t expression_type)
|
||||||
| transform_expression t (XMI_OCL.OperationCallExp {source,arguments,
|
| transform_expression t (XMI_UML.OperationCallExp {source,arguments,
|
||||||
referredOperation,
|
referredOperation,
|
||||||
expression_type}) =
|
expression_type}) =
|
||||||
let val arglist = map (transform_expression t) arguments
|
let val arglist = map (transform_expression t) arguments
|
||||||
val argtyplist = map ((find_classifier_type t) o XMI_UML.expression_type_of) arguments
|
val argtyplist = map ((find_classifier_type t) o XMI_UML.expression_type_of) arguments
|
||||||
in
|
in
|
||||||
ocl_term.OperationCall (transform_expression t source,
|
ocl_term.OperationCall (transform_expression t source,
|
||||||
find_classifier_type t (XMI_OCL.expression_type_of source),
|
find_classifier_type t (XMI_UML.expression_type_of source),
|
||||||
find_operation t referredOperation,
|
find_operation t referredOperation,
|
||||||
ListPair.zip (arglist, argtyplist),
|
ListPair.zip (arglist, argtyplist),
|
||||||
find_classifier_type t expression_type)
|
find_classifier_type t expression_type)
|
||||||
end
|
end
|
||||||
| transform_expression t (XMI_OCL.VariableExp {referredVariable,expression_type})=
|
| transform_expression t (XMI_UML.VariableExp {referredVariable,expression_type})=
|
||||||
let val var_dec = find_variable_dec t referredVariable
|
let val var_dec = find_variable_dec t referredVariable
|
||||||
in
|
in
|
||||||
ocl_term.Variable (#name var_dec,find_classifier_type t expression_type)
|
ocl_term.Variable (#name var_dec,find_classifier_type t expression_type)
|
||||||
end
|
end
|
||||||
|
|
||||||
fun transform_constraint t ({xmiid,name,body,...}:XMI_OCL.OCLConstraint) =
|
fun transform_constraint t ({xmiid,name,body,...}:XMI_UML.Constraint) =
|
||||||
(name,transform_expression t body)
|
(name,transform_expression t body)
|
||||||
|
|
||||||
|
|
||||||
|
@ -305,10 +305,10 @@ fun transform_classifier t (XMI_UML.Class {xmiid,name,isActive,visibility,isLeaf
|
||||||
|
|
||||||
|
|
||||||
(* recursively transform all classes in the package *)
|
(* recursively transform all classes in the package *)
|
||||||
fun transform_package t (XMI_UML.UMLPackage p) =
|
fun transform_package t (XMI_UML.Package p) =
|
||||||
let (* we do not transform the ocl library *)
|
let (* we do not transform the ocl library *)
|
||||||
val filteredPackages =
|
val filteredPackages =
|
||||||
filter (fn (XMI_UML.UMLPackage x) =>
|
filter (fn (XMI_UML.Package x) =>
|
||||||
((#name x <> "oclLib") andalso (#name x <> "UML_OCL")))
|
((#name x <> "oclLib") andalso (#name x <> "UML_OCL")))
|
||||||
(#packages p)
|
(#packages p)
|
||||||
in
|
in
|
||||||
|
@ -317,7 +317,7 @@ fun transform_package t (XMI_UML.UMLPackage p) =
|
||||||
end
|
end
|
||||||
|
|
||||||
(* recursively insert mapping of xmi.id's to model elements into Hashtable *)
|
(* recursively insert mapping of xmi.id's to model elements into Hashtable *)
|
||||||
fun insert_package table package_prefix (XMI_UML.UMLPackage p) =
|
fun insert_package table package_prefix (XMI_UML.Package p) =
|
||||||
let val full_name = package_prefix @ [#name p]
|
let val full_name = package_prefix @ [#name p]
|
||||||
in
|
in
|
||||||
map (insert_generalization table) (#generalizations p);
|
map (insert_generalization table) (#generalizations p);
|
||||||
|
@ -329,7 +329,7 @@ fun insert_package table package_prefix (XMI_UML.UMLPackage p) =
|
||||||
|
|
||||||
(* We do not want the name of the model to be part of the package hierarchy, *)
|
(* We do not want the name of the model to be part of the package hierarchy, *)
|
||||||
(* therefore we handle the top-level model seperately *)
|
(* therefore we handle the top-level model seperately *)
|
||||||
fun insert_model table (XMI_UML.UMLPackage p) =
|
fun insert_model table (XMI_UML.Package p) =
|
||||||
let val full_name = nil
|
let val full_name = nil
|
||||||
in
|
in
|
||||||
map (insert_generalization table) (#generalizations p);
|
map (insert_generalization table) (#generalizations p);
|
||||||
|
@ -349,11 +349,11 @@ fun insert_model table (XMI_UML.UMLPackage p) =
|
||||||
(* this association end is a feature of all _other_ participants in the *)
|
(* this association end is a feature of all _other_ participants in the *)
|
||||||
(* association *)
|
(* association *)
|
||||||
(* 3. insert the mapping xmi.id to association end into the hashtable *)
|
(* 3. insert the mapping xmi.id to association end into the hashtable *)
|
||||||
fun transform_assocation t (assoc:XMI_UML.UMLAssociation) =
|
fun transform_assocation t (assoc:XMI_UML.Association) =
|
||||||
let val aends = #connection assoc
|
let val aends = #connection assoc
|
||||||
fun all_others x xs = List.filter (fn y => y <> x) xs
|
fun all_others x xs = List.filter (fn y => y <> x) xs
|
||||||
fun pair_with ae aes =
|
fun pair_with ae aes =
|
||||||
map (fn (x:XMI_UML.UMLAssociationEnd) => (#participant_id x, ae)) aes
|
map (fn (x:XMI_UML.AssociationEnd) => (#participant_id x, ae)) aes
|
||||||
val mappings = List.concat (map (fn x => pair_with x (all_others x aends)) aends)
|
val mappings = List.concat (map (fn x => pair_with x (all_others x aends)) aends)
|
||||||
fun add_aend_to_type (id,ae) =
|
fun add_aend_to_type (id,ae) =
|
||||||
HashTable.insert t (id,Type (find_classifier_type t id,
|
HashTable.insert t (id,Type (find_classifier_type t id,
|
||||||
|
@ -363,7 +363,7 @@ fun transform_assocation t (assoc:XMI_UML.UMLAssociation) =
|
||||||
end
|
end
|
||||||
|
|
||||||
(* recursively transforms all associations in the package p, *)
|
(* recursively transforms all associations in the package p, *)
|
||||||
fun transform_associations t (XMI_UML.UMLPackage p) =
|
fun transform_associations t (XMI_UML.Package p) =
|
||||||
(map (transform_associations t) (#packages p);
|
(map (transform_associations t) (#packages p);
|
||||||
List.app (transform_assocation t) (#associations p))
|
List.app (transform_assocation t) (#associations p))
|
||||||
|
|
||||||
|
|
491
src/xmi_uml.sml
491
src/xmi_uml.sml
|
@ -23,7 +23,14 @@
|
||||||
******************************************************************************)
|
******************************************************************************)
|
||||||
|
|
||||||
|
|
||||||
structure XMI_OCL =
|
(* ---------------------------------------------------------------------------
|
||||||
|
* The types in these structures are supposed to define a representation of
|
||||||
|
* the XML elements found in UML-XMI files. It is reasonably close to the UML
|
||||||
|
* metamodel and the XMI representation of it, while simplifying some kinds
|
||||||
|
* of references.
|
||||||
|
* --------------------------------------------------------------------------*)
|
||||||
|
|
||||||
|
structure UML_OCL =
|
||||||
struct
|
struct
|
||||||
(* from OCL 2.0 Expressions: -------------------------------------------------
|
(* from OCL 2.0 Expressions: -------------------------------------------------
|
||||||
* A VariableDeclaration declares a variable name and binds it to a type. The
|
* A VariableDeclaration declares a variable name and binds it to a type. The
|
||||||
|
@ -88,90 +95,54 @@ fun expression_type_of (LiteralExp{expression_type,...}) = expression_
|
||||||
* A constraint is a semantic condition or restriction expressed in text.
|
* A constraint is a semantic condition or restriction expressed in text.
|
||||||
* not supported:
|
* not supported:
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
|
|
||||||
datatype ConstraintType = Inv | Pre | Post | Def | Body
|
datatype ConstraintType = Inv | Pre | Post | Def | Body
|
||||||
|
|
||||||
type OCLConstraint = { xmiid : string,
|
(* We put Constraint into OCL, not into UML_Core because we only use *)
|
||||||
name : string option,
|
(* OCL Constraints. *)
|
||||||
constraint_type : string, (*xmi.idref*)
|
type Constraint = { xmiid : string,
|
||||||
body : OCLExpression }
|
name : string option,
|
||||||
|
constraint_type : string, (* xmi.idref to stereotype *)
|
||||||
|
body : OCLExpression }
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
(* ---------------------------------------------------------------------------
|
|
||||||
* The types in this signature are supposed to define a representation of the
|
|
||||||
* XML elements found in UML-XMI files for UML-Core constructs. It is
|
|
||||||
* reasonably close to the UML metamodel and the XMI representation of it,
|
|
||||||
* while simplifying some kinds of references.
|
|
||||||
*
|
|
||||||
* represented constructs are: Association, AssociationClass?, AssociationEnd,
|
|
||||||
* Attribute, Class, Classifier?, Constraint, DataType, Generalization,
|
|
||||||
* Interface, Operation, Parameter
|
|
||||||
*
|
|
||||||
* the following constructs are not represented: Abstraction, Artifact,
|
|
||||||
* BehavioralFeature, Binding, Comment, Component, Dependency, Element,
|
|
||||||
* ElementOwnership, ElementResidence, Enumeration?, EnumerationLiteral?
|
|
||||||
* Feature, Flow, GeneralizableElement, Method, ModelElement, Namespace,
|
|
||||||
* Node, Permission, PresentationElement, Primitive?,
|
|
||||||
* ProgrammingLanguageDataType, Relationship, StructuralFeature,
|
|
||||||
* TemplateArgument, TemplateParameter, Usage
|
|
||||||
* --------------------------------------------------------------------------*)
|
|
||||||
|
|
||||||
structure XMI_UML =
|
|
||||||
struct
|
|
||||||
open XMI_OCL
|
|
||||||
|
|
||||||
|
|
||||||
|
structure UML_DataTypes =
|
||||||
(* from UML 1.5 Core Overview: ----------------------------------------------
|
(* from UML 1.5 Core Overview: ----------------------------------------------
|
||||||
* The Core package is the most fundamental of the subpackages that compose
|
* The Data Types package is the subpackage that specifies the different data
|
||||||
* the UML Foundation package. It defines the basic abstract and concrete
|
* types that are used to define UML.
|
||||||
* metamodel constructs needed for the development of object models.
|
*
|
||||||
* Abstract constructs are not instantiable and are commonly used to reify
|
* the following constructs are currently not represented: ArgListsExpression,
|
||||||
* key constructs, share structure, and organize the UML metamodel. Concrete
|
* Boolean, BooleanExpression, CallConcurrencyKind, Expression, Geometry,
|
||||||
* metamodel constructs are instantiable and reflect the modeling constructs
|
* Integer, LocationReference, Mapping, MappingExpression, Name,
|
||||||
* used by object modelers (cf. metamodelers). Abstract constructs defined
|
* ProcedureExpression, PseudostateKind, ScopeKind, String, TimeExpression,
|
||||||
* in the Core include ModelElement, GeneralizableElement, and Classifier.
|
* TypeExpression, UnlimitedInteger
|
||||||
* Concrete constructs specified in the Core include Class, Attribute,
|
|
||||||
* Operation, and Association.
|
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
|
struct
|
||||||
|
open UML_OCL
|
||||||
|
|
||||||
(* ---------------------------------------------------------------------------
|
|
||||||
* First some "simple" types that are used as attributes for the modeling
|
|
||||||
* constructs below.
|
|
||||||
* --------------------------------------------------------------------------*)
|
|
||||||
datatype ParameterDirectionKind = In | Out | Inout | Return
|
|
||||||
datatype OrderingKind = Unordered | Ordered
|
|
||||||
datatype AggregationKind = NoAggregation | Aggregate | Composite
|
datatype AggregationKind = NoAggregation | Aggregate | Composite
|
||||||
|
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
* ChangeableKind defines an enumeration that denotes how an AttributeLink or
|
* ChangeableKind defines an enumeration that denotes how an AttributeLink or
|
||||||
* LinkEnd may be modified.
|
* LinkEnd may be modified.
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
datatype ChangeabilityKind = Changeable (* No restrictions on modification. *)
|
datatype ChangeableKind = Changeable (* No restrictions on modification. *)
|
||||||
| Frozen (* The value may not be changed from the *)
|
| Frozen (* The value may not be changed from the*)
|
||||||
(* source end after the creation and *)
|
(* source end after the creation and *)
|
||||||
(* initialization of the source object. *)
|
(* initialization of the source object. *)
|
||||||
(* Operations on the other end may change *)
|
(* Operations on the other end may *)
|
||||||
(* a value. *)
|
(* change a value. *)
|
||||||
| AddOnly (* If the multiplicity is not fixed, *)
|
| AddOnly (* If the multiplicity is not fixed, *)
|
||||||
(* values may be added at any time from *)
|
(* values may be added at any time from *)
|
||||||
(* the source object, but once created a *)
|
(* the source object, but once created a*)
|
||||||
(* value may not be removed from the *)
|
(* value may not be removed from the *)
|
||||||
(* source end. Operations on the other *)
|
(* source end. Operations on the other *)
|
||||||
(* end may change a value. *)
|
(* end may change a value. *)
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
|
||||||
* VisibilityKind defines an enumeration that denotes how the element to which
|
|
||||||
* it refers is seen outside the enclosing name space.
|
|
||||||
* --------------------------------------------------------------------------*)
|
|
||||||
datatype VisibilityKind = Public (* Other elements may see and use the target*)
|
|
||||||
(* element. *)
|
|
||||||
| Private (* Only the source element may see and use *)
|
|
||||||
(* the target element. *)
|
|
||||||
| Protected (* Descendants of the source element may see *)
|
|
||||||
(* and use the target element. *)
|
|
||||||
| Package (* Elements declared in the same package as *)
|
|
||||||
(* the target element may see and use the *)
|
|
||||||
(* target *)
|
|
||||||
|
|
||||||
(* from UML 1.5 Data Types: --------------------------------------------------
|
(* from UML 1.5 Data Types: --------------------------------------------------
|
||||||
* a Multiplicity [consists of a list of MultiplicityRanges and] defines a
|
* a Multiplicity [consists of a list of MultiplicityRanges and] defines a
|
||||||
|
@ -185,6 +156,106 @@ datatype VisibilityKind = Public (* Other elements may see and use the target*)
|
||||||
(* provisionally, we denote the upper bound 'unlimited' by "-1" *)
|
(* provisionally, we denote the upper bound 'unlimited' by "-1" *)
|
||||||
type Multiplicity = (int * int) list
|
type Multiplicity = (int * int) list
|
||||||
|
|
||||||
|
datatype OrderingKind = Unordered | Ordered
|
||||||
|
datatype ParameterDirectionKind = In | Out | Inout | Return
|
||||||
|
|
||||||
|
|
||||||
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
|
* VisibilityKind defines an enumeration that denotes how the element to which
|
||||||
|
* it refers is seen outside the enclosing name space.
|
||||||
|
* --------------------------------------------------------------------------*)
|
||||||
|
datatype VisibilityKind = public (* Other elements may see and use the target*)
|
||||||
|
(* element. *)
|
||||||
|
| private (* Only the source element may see and use *)
|
||||||
|
(* the target element. *)
|
||||||
|
| protected (* Descendants of the source element may see *)
|
||||||
|
(* and use the target element. *)
|
||||||
|
| package (* Elements declared in the same package as *)
|
||||||
|
(* the target element may see and use the *)
|
||||||
|
(* target *)
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
structure UML_ExtensionMechanisms =
|
||||||
|
(* from UML 1.5 Extension Mechanisms Overview:--------------------------------
|
||||||
|
* The Extension Mechanisms package is the subpackage that specifies how
|
||||||
|
* specific UML model elements are customized and extended with new semantics
|
||||||
|
* by using stereotypes, constraints, tag definitions, and tagged values.
|
||||||
|
* A coherent set of such extensions, defined for specific purposes,
|
||||||
|
* constitutes a UML profile.
|
||||||
|
* --------------------------------------------------------------------------*)
|
||||||
|
struct
|
||||||
|
open UML_DataTypes
|
||||||
|
|
||||||
|
(* from UML 1.5 Extension Mechanisms:-----------------------------------------
|
||||||
|
* The stereotype concept provides a way of branding (classifying) model
|
||||||
|
* elements so that they behave in some respects as if they were instances of
|
||||||
|
* new virtual metamodel constructs. These model elements have the same
|
||||||
|
* structure (attributes, associations, operations) as similar non-stereotyped
|
||||||
|
* model elements of the same kind. The stereotype may specify additional
|
||||||
|
* constraints and tag definitions that apply to model elements. In addition,
|
||||||
|
* a stereotype may be used to indicate a difference in meaning or usage
|
||||||
|
* between two model elements with identical structure.
|
||||||
|
* --------------------------------------------------------------------------*)
|
||||||
|
type Stereotype = {xmiid: string,
|
||||||
|
name: string,
|
||||||
|
(* extendedElement: string list *)
|
||||||
|
(* definedTag: string list *)
|
||||||
|
stereotypeConstraint: Constraint option,
|
||||||
|
baseClass: string}
|
||||||
|
|
||||||
|
(* from UML 1.5 Extension Mechanisms:-----------------------------------------
|
||||||
|
* A tag definition specifies the tagged values that can be attached to a kind
|
||||||
|
* of model element.
|
||||||
|
* --------------------------------------------------------------------------*)
|
||||||
|
type TagDefinition = {xmiid: string,
|
||||||
|
name: string,
|
||||||
|
multiplicity: Multiplicity}
|
||||||
|
|
||||||
|
(* from UML 1.5 Extension Mechanisms:-----------------------------------------
|
||||||
|
* A tagged value allows information to be attached to any model element in
|
||||||
|
* conformance with its tag definition. Although a tagged value, being an
|
||||||
|
* instance of a kind of ModelElement, automatically inherits the name
|
||||||
|
* attribute, the name that is actually used in the tagged value is the name
|
||||||
|
* of the associated tag definition.
|
||||||
|
* --------------------------------------------------------------------------*)
|
||||||
|
type TaggedValue = {xmiid: string,
|
||||||
|
dataValue: string, (* the value of the tag *)
|
||||||
|
tag_type: string (* xmi.idref to TagDefinition *)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
structure UML_Core =
|
||||||
|
(* from UML 1.5 Core Overview: ----------------------------------------------
|
||||||
|
* The Core package is the most fundamental of the subpackages that compose
|
||||||
|
* the UML Foundation package. It defines the basic abstract and concrete
|
||||||
|
* metamodel constructs needed for the development of object models.
|
||||||
|
* Abstract constructs are not instantiable and are commonly used to reify
|
||||||
|
* key constructs, share structure, and organize the UML metamodel. Concrete
|
||||||
|
* metamodel constructs are instantiable and reflect the modeling constructs
|
||||||
|
* used by object modelers (cf. metamodelers). Abstract constructs defined
|
||||||
|
* in the Core include ModelElement, GeneralizableElement, and Classifier.
|
||||||
|
* Concrete constructs specified in the Core include Class, Attribute,
|
||||||
|
* Operation, and Association.
|
||||||
|
* --------------------------------------------------------------------------*
|
||||||
|
* represented constructs are: Association, AssociationClass?, AssociationEnd,
|
||||||
|
* Attribute, Class, Classifier?, Constraint, DataType, Generalization,
|
||||||
|
* Interface, Operation, Parameter
|
||||||
|
*
|
||||||
|
* the following constructs are not represented: Abstraction, Artifact,
|
||||||
|
* BehavioralFeature, Binding, Comment, Component, Dependency, Element,
|
||||||
|
* ElementOwnership, ElementResidence, Enumeration?, EnumerationLiteral?
|
||||||
|
* Feature, Flow, GeneralizableElement, Method, ModelElement, Namespace,
|
||||||
|
* Node, Permission, PresentationElement, Primitive?,
|
||||||
|
* ProgrammingLanguageDataType, Relationship, StructuralFeature,
|
||||||
|
* TemplateArgument, TemplateParameter, Usage
|
||||||
|
* --------------------------------------------------------------------------*)
|
||||||
|
struct
|
||||||
|
open UML_ExtensionMechanisms
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
* A generalization is a taxonomic relationship between a more general
|
* A generalization is a taxonomic relationship between a more general
|
||||||
|
@ -197,9 +268,9 @@ type Multiplicity = (int * int) list
|
||||||
* constraints 'complete', 'disjoint',
|
* constraints 'complete', 'disjoint',
|
||||||
* 'incomplete', 'overlapping'
|
* 'incomplete', 'overlapping'
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
type UMLGeneralization = { xmiid: string,
|
type Generalization = { xmiid: string,
|
||||||
child_id : string,
|
child_id : string,
|
||||||
parent_id : string }
|
parent_id : string }
|
||||||
|
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
|
@ -207,19 +278,19 @@ type UMLGeneralization = { xmiid: string,
|
||||||
* of values that instances of the classifier may hold.
|
* of values that instances of the classifier may hold.
|
||||||
* not supported: association associationEnd
|
* not supported: association associationEnd
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
type UMLAttribute = { xmiid : string,
|
type Attribute = { xmiid : string,
|
||||||
name : string,
|
name : string,
|
||||||
type_id : string, (* xmi.idref to type *)
|
type_id : string, (* xmi.idref to type *)
|
||||||
(* initialValue : ..., *)
|
(* initialValue : ..., *)
|
||||||
(* inherited from StructuralFeature: *)
|
(* inherited from StructuralFeature: *)
|
||||||
(* multiplicity : (int * int) list, *)
|
(* multiplicity : (int * int) list, *)
|
||||||
(* ordering : OrderingKind *)
|
(* ordering : OrderingKind *)
|
||||||
(* targetScope : ScopeKind *)
|
(* targetScope : ScopeKind *)
|
||||||
changeability : ChangeabilityKind,
|
changeability : ChangeableKind,
|
||||||
(* inherited from Feature: *)
|
(* inherited from Feature: *)
|
||||||
(* ownerScope : ... , *)
|
(* ownerScope : ... , *)
|
||||||
visibility : VisibilityKind
|
visibility : VisibilityKind
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
|
@ -229,35 +300,35 @@ type UMLAttribute = { xmiid : string,
|
||||||
* messages and events, templates, etc.
|
* messages and events, templates, etc.
|
||||||
* not supported: attribute defaultValue
|
* not supported: attribute defaultValue
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
type UMLParameter = { xmiid : string,
|
type Parameter = { xmiid : string,
|
||||||
name : string,
|
name : string,
|
||||||
kind : ParameterDirectionKind,
|
kind : ParameterDirectionKind,
|
||||||
(* defaultValue : ..., *)
|
(* defaultValue : ..., *)
|
||||||
type_id : string (* xmi.idref to type *)}
|
type_id : string (* xmi.idref to type *)}
|
||||||
|
|
||||||
(* fom UML 1.5 Core: ---------------------------------------------------------
|
(* fom UML 1.5 Core: ---------------------------------------------------------
|
||||||
* An operation is a service that can be requested from an object to effect
|
* An operation is a service that can be requested from an object to effect
|
||||||
* behavior. An operation has a signature, which describes the actual
|
* behavior. An operation has a signature, which describes the actual
|
||||||
* parameters that are possible (including possible return values).
|
* parameters that are possible (including possible return values).
|
||||||
* not supported: taggedValue "semantics"
|
* not supported: taggedValue "semantics"
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
type UMLOperation = { xmiid : string,
|
type Operation = { xmiid : string,
|
||||||
name : string,
|
name : string,
|
||||||
(* concurrency : CallConcurrencyKind, *)
|
(* concurrency : CallConcurrencyKind, *)
|
||||||
(* isRoot : bool, *)
|
(* isRoot : bool, *)
|
||||||
(* isLeaf : bool, *)
|
(* isLeaf : bool, *)
|
||||||
(* isAbstract : bool, *)
|
(* isAbstract : bool, *)
|
||||||
(* specification : string, *)
|
(* specification : string, *)
|
||||||
(* methods: UMLMethod list, *)
|
(* methods: UMLMethod list, *)
|
||||||
(* inherited from BehavioralFeature: *)
|
(* inherited from BehavioralFeature: *)
|
||||||
isQuery : bool,
|
isQuery : bool,
|
||||||
parameter : UMLParameter list,
|
parameter : Parameter list,
|
||||||
(* inherited from Feature: *)
|
(* inherited from Feature: *)
|
||||||
(* ownerScope : ScopeKind, *)
|
(* ownerScope : ScopeKind, *)
|
||||||
visibility : VisibilityKind,
|
visibility : VisibilityKind,
|
||||||
(* inherited from ModelElemt: *)
|
(* inherited from ModelElemt: *)
|
||||||
(* xmi.idref to UMLConstraint *)
|
(* xmi.idref to UMLConstraint *)
|
||||||
constraints : string list }
|
constraints : string list }
|
||||||
|
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
|
@ -268,22 +339,22 @@ type UMLOperation = { xmiid : string,
|
||||||
* not supported: stereotypes <<auxiliary>>, <<focus>>,
|
* not supported: stereotypes <<auxiliary>>, <<focus>>,
|
||||||
* <<implementation>>, <<type>>
|
* <<implementation>>, <<type>>
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
type UMLClass = { xmiid : string,
|
type Class = { xmiid : string,
|
||||||
name : string,
|
name : string,
|
||||||
isActive : bool,
|
isActive : bool,
|
||||||
visibility : VisibilityKind,
|
visibility : VisibilityKind,
|
||||||
(* inherited from GeneralizableElement: *)
|
(* inherited from GeneralizableElement: *)
|
||||||
(* isRoot : bool, *)
|
(* isRoot : bool, *)
|
||||||
(* isAbstract : bool, *)
|
(* isAbstract : bool, *)
|
||||||
isLeaf : bool,
|
isLeaf : bool,
|
||||||
(* xmi.idref to UMLGeneralization *)
|
(* xmi.idref to Generalization *)
|
||||||
generalizations: string list,
|
generalizations: string list,
|
||||||
(* inherited from Classifier: *)
|
(* inherited from Classifier: *)
|
||||||
attributes : UMLAttribute list,
|
attributes : Attribute list,
|
||||||
operations: UMLOperation list,
|
operations: Operation list,
|
||||||
(* inherited from ModelElement: *)
|
(* inherited from ModelElement: *)
|
||||||
(* xmi.idref to UMLConstraint *)
|
(* xmi.idref to Constraint *)
|
||||||
invariant: string list }
|
invariant: string list }
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
* A data type is a type whose values have no identity (i.e., they are
|
* A data type is a type whose values have no identity (i.e., they are
|
||||||
|
@ -302,18 +373,18 @@ type UMLClass = { xmiid : string,
|
||||||
* Primitive datatypes used in UML itself include Integer, UnlimitedInteger,
|
* Primitive datatypes used in UML itself include Integer, UnlimitedInteger,
|
||||||
* and String.
|
* and String.
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
type UMLPrimitive = { xmiid : string,
|
type Primitive = { xmiid: string,
|
||||||
name : string,
|
name: string,
|
||||||
operations: UMLOperation list,
|
operations: Operation list,
|
||||||
generalizations: string list,
|
generalizations: string list,
|
||||||
invariant: string list}
|
invariant: string list}
|
||||||
|
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
* Enumeration defines a kind of DataType whose range is a list of predefined
|
* Enumeration defines a kind of DataType whose range is a list of predefined
|
||||||
* values, called enumeration literals.
|
* values, called enumeration literals.
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
(*type UMLEnumeration = { xmiid : string,
|
(*type Enumeration = { xmiid : string,
|
||||||
name: string,
|
name: string,
|
||||||
literal : string list,
|
literal : string list,
|
||||||
(* inherited from GeneralizableElement: *)
|
(* inherited from GeneralizableElement: *)
|
||||||
|
@ -321,39 +392,39 @@ type UMLPrimitive = { xmiid : string,
|
||||||
(* isAbstract : bool, *)
|
(* isAbstract : bool, *)
|
||||||
(* isLeaf : bool, *)
|
(* isLeaf : bool, *)
|
||||||
(* inherited from Feature: *)
|
(* inherited from Feature: *)
|
||||||
operations: UMLOperation list } *)
|
operations: Operation list } *)
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
* An interface is a named set of operations that characterize the
|
* An interface is a named set of operations that characterize the
|
||||||
* behavior of an element.
|
* behavior of an element.
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
type UMLInterface = { xmiid : string,
|
type Interface = { xmiid : string,
|
||||||
name: string,
|
name: string,
|
||||||
generalizations: string list,
|
generalizations: string list,
|
||||||
operations : UMLOperation list,
|
operations : Operation list,
|
||||||
invariant: string list}
|
invariant: string list}
|
||||||
|
|
||||||
|
|
||||||
type UMLCollection = { xmiid : string,
|
type Collection = { xmiid : string,
|
||||||
name : string,
|
name : string,
|
||||||
operations: UMLOperation list,
|
operations: Operation list,
|
||||||
generalizations: string list,
|
generalizations: string list,
|
||||||
elementtype: string (* xmi.idref to classifier *)}
|
elementtype: string (* xmi.idref to classifier *)}
|
||||||
|
|
||||||
type UMLSequence = UMLCollection
|
type Sequence = Collection
|
||||||
type UMLSet = UMLCollection
|
type Set = Collection
|
||||||
type UMLBag = UMLCollection
|
type Bag = Collection
|
||||||
type UMLOrderedSet = UMLCollection
|
type OrderedSet = Collection
|
||||||
|
|
||||||
type UMLEnumeration = { xmiid : string,
|
type Enumeration = { xmiid : string,
|
||||||
name : string,
|
name : string,
|
||||||
operations: UMLOperation list,
|
operations: Operation list,
|
||||||
generalizations: string list,
|
generalizations: string list,
|
||||||
literals: string list, (* names of literals *)
|
literals: string list, (* names of literals *)
|
||||||
invariant: string list}
|
invariant: string list}
|
||||||
|
|
||||||
type UMLVoid = {xmiid: string,
|
type Void = {xmiid: string,
|
||||||
name : string }
|
name : string }
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
* An association end is an endpoint of an association, which connects
|
* An association end is an endpoint of an association, which connects
|
||||||
|
@ -363,16 +434,16 @@ type UMLVoid = {xmiid: string,
|
||||||
* stereotypes <<association>>, <<global>>, <<local>>,
|
* stereotypes <<association>>, <<global>>, <<local>>,
|
||||||
* <<parameter>>, <<self>>
|
* <<parameter>>, <<self>>
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
type UMLAssociationEnd = { xmiid : string,
|
type AssociationEnd = { xmiid : string,
|
||||||
name : string,
|
name : string,
|
||||||
isNavigable: bool,
|
isNavigable: bool,
|
||||||
ordering : OrderingKind,
|
ordering : OrderingKind,
|
||||||
aggregation : AggregationKind,
|
aggregation : AggregationKind,
|
||||||
(* targetScope: ScopeKind, *)
|
(* targetScope: ScopeKind, *)
|
||||||
multiplicity : Multiplicity,
|
multiplicity : Multiplicity,
|
||||||
changeability: ChangeabilityKind,
|
changeability: ChangeableKind,
|
||||||
visibility : VisibilityKind,
|
visibility : VisibilityKind,
|
||||||
participant_id : string (* xmi.idref to class *) }
|
participant_id : string (* xmi.idref to class *) }
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
* An association defines a semantic relationship between classifiers.
|
* An association defines a semantic relationship between classifiers.
|
||||||
|
@ -383,10 +454,10 @@ type UMLAssociationEnd = { xmiid : string,
|
||||||
* tagged value "persistence"
|
* tagged value "persistence"
|
||||||
* generalization of associations
|
* generalization of associations
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
type UMLAssociation = { xmiid : string,
|
type Association = { xmiid : string,
|
||||||
name : string,
|
name : string,
|
||||||
connection: UMLAssociationEnd list }
|
connection: AssociationEnd list }
|
||||||
|
|
||||||
(* from UML 1.5 Core: --------------------------------------------------------
|
(* from UML 1.5 Core: --------------------------------------------------------
|
||||||
* An association class is an association that is also a class. It not
|
* An association class is an association that is also a class. It not
|
||||||
* only connects a set of classifiers but also defines a set of features
|
* only connects a set of classifiers but also defines a set of features
|
||||||
|
@ -406,16 +477,16 @@ type UMLAssociation = { xmiid : string,
|
||||||
* <<thread>>, <<utility>>
|
* <<thread>>, <<utility>>
|
||||||
* taggedValues persistence, semantics
|
* taggedValues persistence, semantics
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
datatype UMLClassifier = Primitive of UMLPrimitive
|
datatype Classifier = Primitive of Primitive
|
||||||
| Class of UMLClass
|
| Class of Class
|
||||||
| Interface of UMLInterface
|
| Interface of Interface
|
||||||
| Enumeration of UMLEnumeration
|
| Enumeration of Enumeration
|
||||||
| Collection of UMLCollection
|
| Collection of Collection
|
||||||
| Sequence of UMLSequence
|
| Sequence of Sequence
|
||||||
| Set of UMLSet
|
| Set of Set
|
||||||
| Bag of UMLBag
|
| Bag of Bag
|
||||||
| OrderedSet of UMLOrderedSet
|
| OrderedSet of OrderedSet
|
||||||
| Void of UMLVoid
|
| Void of Void
|
||||||
|
|
||||||
fun classifier_name_of (Primitive{name,...}) = name
|
fun classifier_name_of (Primitive{name,...}) = name
|
||||||
| classifier_name_of (Class{name,...}) = name
|
| classifier_name_of (Class{name,...}) = name
|
||||||
|
@ -456,8 +527,25 @@ fun classifier_elementtype_of (Collection{elementtype,...}) = elementtype
|
||||||
| classifier_elementtype_of (Bag{elementtype,...}) = elementtype
|
| classifier_elementtype_of (Bag{elementtype,...}) = elementtype
|
||||||
| classifier_elementtype_of (OrderedSet{elementtype,...}) = elementtype
|
| classifier_elementtype_of (OrderedSet{elementtype,...}) = elementtype
|
||||||
|
|
||||||
type UMLStereotype = {xmiid: string, name: string}
|
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
structure UML_ModelManagement =
|
||||||
|
(* from UML 1.5 Model Management Overview: ------------------------------------
|
||||||
|
* The Model Management package is dependent on the Foundation package. It
|
||||||
|
* defines Model, Package, and Subsystem, which all serve as grouping units
|
||||||
|
* for other ModelElements.
|
||||||
|
* Models are used to capture different views of a physical system. Packages
|
||||||
|
* are used within a Model to group ModelElements. A Subsystem represents a
|
||||||
|
* behavioral unit in the physical system. UML Profiles are packages
|
||||||
|
* dedicated to group UML extensions.
|
||||||
|
* --------------------------------------------------------------------------*)
|
||||||
|
struct
|
||||||
|
open UML_Core
|
||||||
(* from UML 1.5 Model Management: --------------------------------------------
|
(* from UML 1.5 Model Management: --------------------------------------------
|
||||||
* A package is a grouping of model elements.
|
* A package is a grouping of model elements.
|
||||||
* [...]
|
* [...]
|
||||||
|
@ -466,22 +554,43 @@ type UMLStereotype = {xmiid: string, name: string}
|
||||||
* StateMachines, Stereotypes, and TaggedValues.
|
* StateMachines, Stereotypes, and TaggedValues.
|
||||||
* --------------------------------------------------------------------------*)
|
* --------------------------------------------------------------------------*)
|
||||||
(* We treat "Model" the same way as a "Package". *)
|
(* We treat "Model" the same way as a "Package". *)
|
||||||
datatype UMLPackage = UMLPackage of { xmiid: string,
|
datatype Package = Package of { xmiid: string,
|
||||||
name: string,
|
name: string,
|
||||||
visibility: VisibilityKind,
|
visibility: VisibilityKind,
|
||||||
packages: UMLPackage list,
|
packages: Package list,
|
||||||
classifiers: UMLClassifier list,
|
classifiers: Classifier list,
|
||||||
associations: UMLAssociation list,
|
associations: Association list,
|
||||||
generalizations: UMLGeneralization list,
|
generalizations: Generalization list,
|
||||||
constraints: OCLConstraint list }
|
constraints: Constraint list }
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
structure UML_CommonBehavior =
|
||||||
|
struct
|
||||||
|
open UML_ModelManagement
|
||||||
|
end
|
||||||
|
|
||||||
|
structure UML_StateMachines =
|
||||||
|
struct
|
||||||
|
open UML_CommonBehavior
|
||||||
|
end
|
||||||
|
|
||||||
|
structure UML_ActivityGraphs =
|
||||||
|
struct
|
||||||
|
open UML_StateMachines
|
||||||
|
end
|
||||||
|
|
||||||
|
structure XMI_UML =
|
||||||
|
struct
|
||||||
|
open UML_ActivityGraphs
|
||||||
|
|
||||||
(* There may be (are) model elements outside of the UML model *)
|
(* There may be (are) model elements outside of the UML model *)
|
||||||
type XmiContent = {classifiers: UMLClassifier list,
|
type XmiContent = {classifiers: Classifier list,
|
||||||
constraints: OCLConstraint list,
|
constraints: Constraint list,
|
||||||
packages: UMLPackage list,
|
packages: Package list,
|
||||||
stereotypes: UMLStereotype list,
|
stereotypes: Stereotype list,
|
||||||
variable_declarations: VariableDeclaration list
|
variable_declarations: VariableDeclaration list
|
||||||
}
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue