Skip to content
Snippets Groups Projects

Resolve "Feature: Add context-free connect"

Merged René Schöne requested to merge 34-feature-add-context-free-connect into dev
18 files
+ 478
75
Compare changes
  • Side-by-side
  • Inline
Files
18
  • 57d9d7e6
    working on context-free connect · 57d9d7e6
    René Schöne authored
    - add context-free-endpoint-target (only for receive for now)
    - using this target automatically will generate all context-sensitive connect-methods, and a connect method that dispatches to them
    - methods are only generated if not given in spec already
    - todo: update documentation
aspect ParserRewrites {
rewrite UntypedEndpointTarget {
when (tryGloballyResolveTypeComponentByToken(getTokenOrType()) != null)
when (getChildName() != null && tryGloballyResolveTypeComponentByToken(combinedName()) != null)
to TypeEndpointTarget {
TypeEndpointTarget result = new TypeEndpointTarget();
result.setType(TypeComponent.createRef(this.getTokenOrType()));
result.setType(TypeComponent.createRef(this.combinedName()));
return result;
}
when (tryGloballyResolveTokenComponentByToken(getTokenOrType()) != null)
when (getChildName() != null && tryGloballyResolveTokenComponentByToken(combinedName()) != null)
to TokenEndpointTarget {
TokenEndpointTarget result = new TokenEndpointTarget();
result.setToken(TokenComponent.createRef(this.getTokenOrType()));
result.setToken(TokenComponent.createRef(this.combinedName()));
return result;
}
when (getChildName() == "")
to ContextFreeTypeEndpointTarget {
ContextFreeTypeEndpointTarget result = new ContextFreeTypeEndpointTarget();
result.setTypeDecl(TypeDecl.createRef(getTypeName()));
return result;
}
}
syn String UntypedEndpointTarget.combinedName() = getTypeName() + "." + getChildName();
eq UntypedEndpointTarget.senderName() = "<untyped.senderName>";
eq UntypedEndpointTarget.getterMethodName() = "<untyped.getterMethodName>";
eq UntypedEndpointTarget.parentTypeName() = "<untyped.parentTypeName>";
Loading