summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rtemsqual/interface.py4
-rw-r--r--rtemsqual/tests/spec-interface/forward-decl.yml3
-rw-r--r--spec/spec/interface-forward-declaration.yml12
-rw-r--r--spec/spec/interface-target.yml23
4 files changed, 32 insertions, 10 deletions
diff --git a/rtemsqual/interface.py b/rtemsqual/interface.py
index 64648e83..aa9c19ac 100644
--- a/rtemsqual/interface.py
+++ b/rtemsqual/interface.py
@@ -50,8 +50,8 @@ def _get_group_identifiers(groups: ItemMap) -> List[str]:
def _forward_declaration(item: Item) -> str:
- target = item.map(item["interface-target"])
- return target["interface-type"] + " " + target["name"]
+ target = next(item.parents("interface-target"))
+ return f"{target['interface-type']} {target['name']}"
class _InterfaceMapper(ItemMapper):
diff --git a/rtemsqual/tests/spec-interface/forward-decl.yml b/rtemsqual/tests/spec-interface/forward-decl.yml
index 58d24125..31f104ad 100644
--- a/rtemsqual/tests/spec-interface/forward-decl.yml
+++ b/rtemsqual/tests/spec-interface/forward-decl.yml
@@ -2,9 +2,10 @@ SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
-interface-target: s
interface-type: forward-declaration
links:
- role: interface-placement
uid: h
+- role: interface-target
+ uid: s
type: interface
diff --git a/spec/spec/interface-forward-declaration.yml b/spec/spec/interface-forward-declaration.yml
index 853d8cc7..c21da0a5 100644
--- a/spec/spec/interface-forward-declaration.yml
+++ b/spec/spec/interface-forward-declaration.yml
@@ -13,14 +13,12 @@ spec-description: null
spec-example: null
spec-info:
dict:
- attributes:
- interface-target:
- description: |
- It shall be the UID of the interface target type declared by the
- forward declaration.
- spec-type: uid
+ attributes: {}
description: |
- This set of attributes specifies a forward declaration.
+ Items of this type specify a forward declaration. The item shall have
+ exactly one link with the :ref:`SpecTypeInterfaceTargetLinkRole` to an
+ :ref:`SpecTypeInterfaceCompoundItemType` item. This link defines the
+ type declared by the forward declaration.
required-attributes: all
spec-name: Interface Forward Declaration Item Type
spec-type: interface-forward-declaration
diff --git a/spec/spec/interface-target.yml b/spec/spec/interface-target.yml
new file mode 100644
index 00000000..4fc4db68
--- /dev/null
+++ b/spec/spec/interface-target.yml
@@ -0,0 +1,23 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links:
+- role: spec-member
+ uid: root
+- role: spec-refinement
+ spec-key: role
+ spec-value: interface-target
+ uid: link
+spec-description: null
+spec-example: null
+spec-info:
+ dict:
+ attributes: {}
+ description: |
+ It defines the interface target role of links. It is used for interface
+ forward declarations.
+ required-attributes: all
+spec-name: Interface Target Link Role
+spec-type: interface-target
+type: spec