Skip to content
Snippets Groups Projects
Commit d1df8b82 authored by René Schöne's avatar René Schöne
Browse files

Change component resolving for inherited children of type-decls.

- use equals to compare entry in RagConnectObserver
- use type-components computed by NTA ("as owned by me") consistently
parent a3a28e6c
Branches
No related tags found
1 merge request!37Resolve "Inherited components of a type can not be chosen as port targets"
Pipeline #15502 failed
......@@ -75,8 +75,9 @@ However, depending on the selected protocols and/or used features, additional de
- Required runtime dependencies: _none_
- Required options for RelAST compiler: _none_
- Required options for JastAdd:
- `--incremental`
- `--tracing=flush`
- `--incremental=param` (enable incremental evaluation)
- `--tracing=flush` (enable tracing of events)
- `--cache=all` (set all attributes to be cached)
- Remarks:
- Other (additional) values passed to those two options must be equal (e.g., `--incremental=param` passed to RagConnect must be also passed to JastAdd)
- Other values besides `flush` can be added to `--tracing`
......
......@@ -398,7 +398,7 @@ aspect MustacheReceiveAndSendAndHandleUri {
syn String PortDefinition.connectParameterName() = "uriString";
syn String PortDefinition.disconnectMethodName() {
// if both (send and receive) are defined for an port, ensure methods with different names
// if both (send and receive) are defined for a port, ensure methods with different names
String extra;
if (getPortTarget().isTokenPortTarget()) {
extra = lookupTokenPortDefinitions(token()).size() > 1 ? uniqueSuffix() : "";
......@@ -681,7 +681,7 @@ aspect MustacheTypeDecl {
syn List<TypeComponent> TypeDecl.occurencesInProductionRules() {
List<TypeComponent> result = new ArrayList<>();
for (TypeDecl typeDecl : program().typeDecls()) {
for (Component comp : typeDecl.getComponentList()) {
for (Component comp : typeDecl.allComponentsAsOwnedByMe()) {
if (comp.isTypeComponent() && comp.asTypeComponent().getTypeDecl().equals(this)) {
result.add(comp.asTypeComponent());
}
......
......@@ -27,7 +27,7 @@ aspect RagConnectNameResolution {
java.util.List<PortDefinition> result = new java.util.ArrayList<>();
for (PortDefinition def : onlyGiven ? givenPortDefinitionList() : allPortDefinitionList()) {
PortTarget target = def.getPortTarget();
if (target.isTypePortTarget() && target.asTypePortTarget().getType().equals(type)) {
if (target.isTypePortTarget() && target.asTypePortTarget().getType().matches(type) && target.asTypePortTarget().getType().containingTypeDecl().equals(type.containingTypeDecl())) {
result.add(def);
}
}
......@@ -216,9 +216,7 @@ aspect RelastNameResolution {
if (!other.isTokenComponent()) { return false; }
return getName().equals(other.getName()) && getJavaTypeUse().prettyPrint().equals(other.asTokenComponent().getJavaTypeUse().prettyPrint());
}
eq TypeComponent.matches(Component other) {
return getName().equals(other.getName()) && getTypeDecl().equals(other.asTypeComponent().getTypeDecl());
}
eq TypeComponent.matches(Component other) = matchesNameAndType(other);
eq NormalComponent.matches(Component other) {
if (!other.isTypeComponent() || !other.asTypeComponent().isNormalComponent()) { return false; }
return super.matches(other);
......@@ -231,4 +229,7 @@ aspect RelastNameResolution {
if (!other.isTypeComponent() || !other.asTypeComponent().isOptComponent()) { return false; }
return super.matches(other);
}
syn boolean TypeComponent.matchesNameAndType(Component other) {
return getName().equals(other.getName()) && getTypeDecl().equals(other.asTypeComponent().getTypeDecl());
}
}
......@@ -119,8 +119,8 @@ aspect RagConnectObserver {
}
RagConnectObserverStartEntry startEntry = startEntries.peekFirst();
if (node == startEntry.node &&
attribute == startEntry.attributeString &&
value == startEntry.flushIncToken) {
attribute.equals(startEntry.attributeString) &&
value.equals(startEntry.flushIncToken)) {
// create a copy of the queue to avoid entering this again causing an endless recursion
RagConnectObserverEntry[] entriesToProcess = entryQueue.toArray(new RagConnectObserverEntry[entryQueue.size()]);
entryQueue.clear();
......
......@@ -91,6 +91,7 @@ aspect RagConnect {
mayHaveRewrite();
// check if --incremental is active
Object checkIncremental = inc_throwAway_visited;
{{! TODO maybe check for something like _ragconnect_mqttHandler_computed to see if --cache=all }}
{{/configIncrementalOptionActive}}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment