Skip to content
Snippets Groups Projects
Commit 30011b02 authored by Johannes Mey's avatar Johannes Mey
Browse files

nonterminals with NTA children AND relations now get the correct constructor

parent 3872f912
No related branches found
No related tags found
No related merge requests found
Pipeline #3786 passed
......@@ -170,7 +170,9 @@ aspect Constructors {
list.addAll(getSuper().decl().componentsTransitive());
}
for (Component c: getComponents()) {
list.add(c);
if (c.inConstructor()) {
list.add(c);
}
}
return list;
}
......@@ -186,6 +188,12 @@ aspect Constructors {
&& getSuper().decl() != null
&& getSuper().decl().needsConstructor();
}
/**
* @return true, if the component should be added to the constructor (i.e., is not an NTA)
*/
syn boolean Component.inConstructor() = true;
eq NTAComponent.inConstructor() = false;
}
aspect Utils {
......
Root ::= A* B*;
A ::= <Name>;
A ::= <Name> /SomeNTA:A/;
B ::= <Name>;
rel A.Di1 -> B;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment