diff options
Diffstat (limited to 'scripts/normative-xmi')
-rw-r--r-- | scripts/normative-xmi/MOF-merged.qtxmi.gz | bin | 16095 -> 16115 bytes | |||
-rw-r--r-- | scripts/normative-xmi/MOF-merged.xmi.gz | bin | 31416 -> 31416 bytes | |||
-rw-r--r-- | scripts/normative-xmi/MOF.qtxmi.gz | bin | 1839 -> 0 bytes | |||
-rw-r--r-- | scripts/normative-xmi/MOF.xmi.gz | bin | 3110 -> 0 bytes | |||
-rw-r--r-- | scripts/normative-xmi/UML.qtxmi.gz | bin | 76833 -> 76882 bytes | |||
-rw-r--r-- | scripts/normative-xmi/UML.xmi.gz | bin | 147927 -> 147927 bytes | |||
-rw-r--r-- | scripts/normative-xmi/xmi2qt.xq | 29 |
7 files changed, 16 insertions, 13 deletions
diff --git a/scripts/normative-xmi/MOF-merged.qtxmi.gz b/scripts/normative-xmi/MOF-merged.qtxmi.gz Binary files differindex cdce74c2..869e5aeb 100644 --- a/scripts/normative-xmi/MOF-merged.qtxmi.gz +++ b/scripts/normative-xmi/MOF-merged.qtxmi.gz diff --git a/scripts/normative-xmi/MOF-merged.xmi.gz b/scripts/normative-xmi/MOF-merged.xmi.gz Binary files differindex 3952e921..12477f6c 100644 --- a/scripts/normative-xmi/MOF-merged.xmi.gz +++ b/scripts/normative-xmi/MOF-merged.xmi.gz diff --git a/scripts/normative-xmi/MOF.qtxmi.gz b/scripts/normative-xmi/MOF.qtxmi.gz Binary files differdeleted file mode 100644 index 65b2c646..00000000 --- a/scripts/normative-xmi/MOF.qtxmi.gz +++ /dev/null diff --git a/scripts/normative-xmi/MOF.xmi.gz b/scripts/normative-xmi/MOF.xmi.gz Binary files differdeleted file mode 100644 index 5f2293e9..00000000 --- a/scripts/normative-xmi/MOF.xmi.gz +++ /dev/null diff --git a/scripts/normative-xmi/UML.qtxmi.gz b/scripts/normative-xmi/UML.qtxmi.gz Binary files differindex 4400c005..8d0d0425 100644 --- a/scripts/normative-xmi/UML.qtxmi.gz +++ b/scripts/normative-xmi/UML.qtxmi.gz diff --git a/scripts/normative-xmi/UML.xmi.gz b/scripts/normative-xmi/UML.xmi.gz Binary files differindex 495e3f16..c087c2bf 100644 --- a/scripts/normative-xmi/UML.xmi.gz +++ b/scripts/normative-xmi/UML.xmi.gz diff --git a/scripts/normative-xmi/xmi2qt.xq b/scripts/normative-xmi/xmi2qt.xq index 77841de5..a40801b9 100644 --- a/scripts/normative-xmi/xmi2qt.xq +++ b/scripts/normative-xmi/xmi2qt.xq @@ -13,10 +13,10 @@ declare function qtxmi:typeStringFromProperty ($properties as node()*) as xs:str declare function qtxmi:mappedBaseNamespace($xmiFile as xs:string*) as xs:string* { if ($xmiFile = "PrimitiveTypes.xmi") then "" - else if ($xmiFile = "Superstructure.xmi") then "QtUml" - else if ($xmiFile = "UML.xmi") then "QtUml" - else if ($xmiFile = "MOF.xmi") then "QtMof" - else if ($xmiFile = "MOF-merged.xmi") then "QtMof" + else if ($xmiFile = "Superstructure.xmi") then "QtUml::" + else if ($xmiFile = "UML.xmi") then "QtUml::" + else if ($xmiFile = "MOF.xmi") then "QtMof::" + else if ($xmiFile = "MOF-merged.xmi") then "QtMof::" else "QtUnknown" }; @@ -160,9 +160,12 @@ declare function qtxmi:modifiedTypeFromNamespacedProperty ($property as node(), concat ("const ", $type) else $type - let $type := if ($collection and ($element/@xmi:type = "uml:Class" or $property/upperValue/@value != "1")) then - concat ($type, " *") - else if ($collection and $element/@xmi:type != "uml:Class" and ($property/@direction = "inout" or $property/@direction = "out")) then + let $type := if ($collection and $element/@xmi:type = "uml:Class") then + if ($property/upperValue/@value != "1") then + concat ($type, " &") + else + concat ($type, " *") + else if ($element/@xmi:type != "uml:Class" and ($property/@direction = "inout" or $property/@direction = "out")) then concat ($type, " &") else $type @@ -236,7 +239,7 @@ declare function qtxmi:subsettedBy($property as node()) as xs:string { { for $namespace in distinct-values((doc($xmiFile)//packagedElement[@xmi:type="uml:Package"] | doc($xmiFile)//uml:Package)/@xmi:id) return -<namespace path="{replace(replace(concat(qtxmi:mappedBaseNamespace($xmiFile), $namespace), "-", "/"), "::", "/")}"> +<namespace path="{replace(replace(replace(concat(qtxmi:mappedBaseNamespace($xmiFile), $namespace), "-", "/"), "::", "/"), "/$", "")}"> { for $class in doc($xmiFile)//*[@xmi:id=$namespace]/packagedElement[@xmi:type="uml:Class"] let $namespace := concat(replace(concat(qtxmi:mappedBaseNamespace($xmiFile), $namespace), "-", "::"), "::") @@ -299,9 +302,9 @@ return { for $attribute in $class/ownedAttribute let $unqualifiedType := qtxmi:modifiedTypeFromNamespacedProperty($attribute, $namespace, xs:boolean("true")) - let $unqualifiedType := if (ends-with($unqualifiedType, "*")) then $unqualifiedType else concat($unqualifiedType, " ") + let $unqualifiedType := if (ends-with($unqualifiedType, "*") or ends-with($unqualifiedType, "&")) then $unqualifiedType else concat($unqualifiedType, " ") let $singleUnqualifiedType := qtxmi:modifiedTypeFromNamespacedProperty($attribute, $namespace, xs:boolean("false")) - let $singleUnqualifiedType := if (ends-with($singleUnqualifiedType, "*")) then $singleUnqualifiedType else concat($singleUnqualifiedType, " ") + let $singleUnqualifiedType := if (ends-with($singleUnqualifiedType, "*") or ends-with($singleUnqualifiedType, "&")) then $singleUnqualifiedType else concat($singleUnqualifiedType, " ") let $isDerived := if (not($attribute/@isDerived) or $attribute/@isDerived = "false") then "false" else "true" let $isDerivedUnion := if (not($attribute/@isDerivedUnion) or $attribute/@isDerivedUnion = "false") then "false" else "true" let $isReadOnly := if (not($attribute/@isReadOnly) or $attribute/@isReadOnly = "false") then "false" else "true" @@ -341,9 +344,9 @@ return { for $attribute in $class/ownedAttribute let $unqualifiedType := qtxmi:modifiedTypeFromNamespacedProperty($attribute, $namespace, xs:boolean("true")) - let $unqualifiedType := if (ends-with($unqualifiedType, "*")) then $unqualifiedType else concat($unqualifiedType, " ") + let $unqualifiedType := if (ends-with($unqualifiedType, "*") or ends-with($unqualifiedType, "&")) then $unqualifiedType else concat($unqualifiedType, " ") let $singleUnqualifiedType := qtxmi:modifiedTypeFromNamespacedProperty($attribute, $namespace, xs:boolean("false")) - let $singleUnqualifiedType := if (ends-with($singleUnqualifiedType, "*")) then $singleUnqualifiedType else concat($singleUnqualifiedType, " ") + let $singleUnqualifiedType := if (ends-with($singleUnqualifiedType, "*") or ends-with($singleUnqualifiedType, "&")) then $singleUnqualifiedType else concat($singleUnqualifiedType, " ") let $isDerived := if (not($attribute/@isDerived) or $attribute/@isDerived = "false") then "false" else "true" let $isDerivedUnion := if (not($attribute/@isDerivedUnion) or $attribute/@isDerivedUnion = "false") then "false" else "true" let $isReadOnly := if (not($attribute/@isReadOnly) or $attribute/@isReadOnly = "false") then "false" else "true" @@ -387,7 +390,7 @@ return qtxmi:modifiedTypeFromNamespacedProperty($operation/ownedParameter[@direction = "return"], $namespace, xs:boolean("true")) else "void" - let $return := if (ends-with($return, "*")) then $return else concat($return, " ") + let $return := if (ends-with($return, "*") or ends-with($return, "&")) then $return else concat($return, " ") where empty($class/ownedAttribute[@name = $operation/@name]) return <operation return="{$return}" name="{qtxmi:mappedFunctionName($operation/@name)}" constness="{$constness}"> |