From cf676a4340f64f6a5b9f38b4e2bd3401c6d57d47 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Wed, 24 Jan 2018 11:45:33 +0100 Subject: added depencies detection support for symbols. See symbol.dependencies. It returns a list of TypeSymbol. There are filters in the qtcpp helpers which make use of these dependencies. The idea is that we can generate header includes and source includes for the individual C++ documents. --- qface/idl/domain.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qface/idl') diff --git a/qface/idl/domain.py b/qface/idl/domain.py index 75a2950..e82aeb3 100644 --- a/qface/idl/domain.py +++ b/qface/idl/domain.py @@ -124,6 +124,7 @@ class Symbol(NamedElement): self._tags = dict() self._contentMap = ChainMap() + self._dependencies = set() self.type = TypeSymbol('', self) self.kind = self.__class__.__name__.lower() """ the associated type information """ @@ -162,6 +163,12 @@ class Symbol(NamedElement): """ return general list of symbol contents """ return self._contentMap.values() + @property + def dependencies(self): + if not self._dependencies: + self._dependencies = [x.type for x in self.contents] + return self._dependencies + def toJson(self): o = super().toJson() if self.type.is_valid: -- cgit v1.2.3