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
Pipeline #3786 passed with stage
in 1 minute and 4 seconds
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment