|
|
Re: Alternative types in cross references [message #1115676 is a reply to message #1115670] |
Tue, 24 September 2013 12:25 |
Peter Simon Messages: 3 Registered: September 2013 |
Junior Member |
|
|
Hi Christian,
thanks for your reply.
As common supertype I have an ecore::EObject. In the attached grammar I just wanted to show what I'd like to have.
So actually the grammar rule looks like this:
ReferenceAttribute:
type = [ecore::EObject|QualifiedName]
name = ID
;
The problem is that I don't know exactly how the scoping should be implemented.
[Updated on: Tue, 24 September 2013 12:28] Report message to a moderator
|
|
|
Re: Alternative types in cross references [message #1115682 is a reply to message #1115676] |
Tue, 24 September 2013 12:31 |
|
Hi,
maybe something like (pseudo code)
IScope scope_X_y(EObject ctx, EReference ref) {
Predicate<IEObjectDescription> filter = new Predicate<IEObjectDescription>() {
@Override
public boolean apply(IEObjectDescription arg0) {
return TypesPackage.Literals.JVM_GENERIC_TYPE.isSuperTypeOf(arg0.getEClass())
|| MydslPackage.Literals.XXX_YYY.isSuperTypeOf(arg0.getEClass());
}
};
return new FilteringScope(delegateGetScope(ctx, ref), filter);
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.04544 seconds