Skip to content

Commit ca325e6

Browse files
committed
ST6RI-628 Added dependency syntax to the KerML grammar.
Also fixed: - getTarget computation in DependencyImpl. - Outline tree generation for filtered imports.
1 parent 19a0f77 commit ca325e6

25 files changed

Lines changed: 18912 additions & 17830 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package Dependencies {
2+
3+
package System {
4+
package 'Application Layer';
5+
package 'Service Layer';
6+
package 'Data Layer';
7+
}
8+
9+
import System::*;
10+
11+
// dependency Use from 'Application Layer' to 'Service Layer';
12+
// dependency from 'Service Layer' to 'Data Layer';
13+
14+
feature x;
15+
feature y;
16+
feature z;
17+
18+
dependency z to x, y {
19+
feature e;
20+
}
21+
22+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//* XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
2+
ResourceSet {
3+
ThisFile {}
4+
File {from ="/library/Base.kerml"}
5+
6+
}
7+
Workspace {
8+
JavaProject {
9+
SrcFolder {
10+
ThisFile {}
11+
File {from ="/library/Base.kerml"}
12+
13+
}
14+
}
15+
}
16+
END_SETUP
17+
*/
18+
19+
// XPECT noErrors ---> ""
20+
package DependencyTest {
21+
22+
package System {
23+
package 'Application Layer';
24+
package 'Service Layer';
25+
package 'Data Layer';
26+
}
27+
28+
import System::*;
29+
30+
dependency Use from 'Application Layer' to 'Service Layer';
31+
dependency from 'Service Layer' to 'Data Layer';
32+
33+
feature x;
34+
feature y;
35+
feature z;
36+
37+
dependency z to x, y;
38+
39+
}

org.omg.kerml.xtext.ui/src/org/omg/kerml/xtext/ui/outline/KerMLOutlineTreeProvider.xtend

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,11 @@ class KerMLOutlineTreeProvider extends DefaultOutlineTreeProvider {
147147
if (import_.visibility !== null) {
148148
text += ' ' + import_.visibility._text
149149
}
150-
var imp = import_
151-
if (import_.importedNamespace?.owningRelationship === import_) {
152-
if (!import_.importedNamespace.ownedImport.isEmpty) {
153-
imp = import_.importedNamespace.ownedImport.get(0) as NamespaceImport
154-
text = text + ' filter'
155-
}
156-
}
157-
if (imp.importedNamespace?.declaredName !== null) {
158-
text += ' ' + imp.importedNamespace.declaredName
150+
if (import_.importedNamespace?.declaredName !== null) {
151+
text += ' ' + import_.importedNamespace.declaredName
159152
}
160153
text += "::*"
161-
if (imp.isRecursive) {
154+
if (import_.isRecursive) {
162155
text += "::**"
163156
}
164157
text
384 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)