summaryrefslogtreecommitdiffstats
path: root/scripts/normative-xmi
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/normative-xmi')
-rw-r--r--scripts/normative-xmi/MOF-merged.qtxmi.gzbin16095 -> 16115 bytes
-rw-r--r--scripts/normative-xmi/MOF-merged.xmi.gzbin31416 -> 31416 bytes
-rw-r--r--scripts/normative-xmi/MOF.qtxmi.gzbin1839 -> 0 bytes
-rw-r--r--scripts/normative-xmi/MOF.xmi.gzbin3110 -> 0 bytes
-rw-r--r--scripts/normative-xmi/UML.qtxmi.gzbin76833 -> 76882 bytes
-rw-r--r--scripts/normative-xmi/UML.xmi.gzbin147927 -> 147927 bytes
-rw-r--r--scripts/normative-xmi/xmi2qt.xq29
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
index cdce74c2..869e5aeb 100644
--- a/scripts/normative-xmi/MOF-merged.qtxmi.gz
+++ b/scripts/normative-xmi/MOF-merged.qtxmi.gz
Binary files differ
diff --git a/scripts/normative-xmi/MOF-merged.xmi.gz b/scripts/normative-xmi/MOF-merged.xmi.gz
index 3952e921..12477f6c 100644
--- a/scripts/normative-xmi/MOF-merged.xmi.gz
+++ b/scripts/normative-xmi/MOF-merged.xmi.gz
Binary files differ
diff --git a/scripts/normative-xmi/MOF.qtxmi.gz b/scripts/normative-xmi/MOF.qtxmi.gz
deleted file mode 100644
index 65b2c646..00000000
--- a/scripts/normative-xmi/MOF.qtxmi.gz
+++ /dev/null
Binary files differ
diff --git a/scripts/normative-xmi/MOF.xmi.gz b/scripts/normative-xmi/MOF.xmi.gz
deleted file mode 100644
index 5f2293e9..00000000
--- a/scripts/normative-xmi/MOF.xmi.gz
+++ /dev/null
Binary files differ
diff --git a/scripts/normative-xmi/UML.qtxmi.gz b/scripts/normative-xmi/UML.qtxmi.gz
index 4400c005..8d0d0425 100644
--- a/scripts/normative-xmi/UML.qtxmi.gz
+++ b/scripts/normative-xmi/UML.qtxmi.gz
Binary files differ
diff --git a/scripts/normative-xmi/UML.xmi.gz b/scripts/normative-xmi/UML.xmi.gz
index 495e3f16..c087c2bf 100644
--- a/scripts/normative-xmi/UML.xmi.gz
+++ b/scripts/normative-xmi/UML.xmi.gz
Binary files differ
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, "&amp;")) 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, "&amp;")) 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, "&amp;")) 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, "&amp;")) 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, "&amp;")) then $return else concat($return, " ")
where empty($class/ownedAttribute[@name = $operation/@name])
return
<operation return="{$return}" name="{qtxmi:mappedFunctionName($operation/@name)}" constness="{$constness}">