|
|
|
Re: Create and configure instances [message #1855403 is a reply to message #1855380] |
Wed, 12 October 2022 09:30  |
|
would expect
new User MyUser {
set firstName = "Ny first name"
set lastName = "Ny last name"
}
FeatureInstance: // remove the bad return
'set' type=[Feature] "=" value=Literal;
in grammar and a scope provider like (untessted)
public class MyDslScopeProvider extends AbstractMyDslScopeProvider {
@Override
public IScope getScope(EObject context, EReference reference) {
if (reference == MyDslPackage.Literals.FEATURE_INSTANCE__TYPE) {
Instance inst = null;
if (context instanceof Instance) {
inst = (Instance) context;
} else if (context instanceof FeatureInstance) {
inst = (Instance) context.eContainer();
}
if (inst != null) {
return Scopes.scopeFor(inst.getType().getFeatures());
} else {
return IScope.NULLSCOPE;
}
}
return super.getScope(context, reference);
}
}
is it intentional you have this wired syntax set User.xxxxx
then you sould have also two references there,
but the user would be redundant / implemented as in
https://dietrich-it.de/xtext/2013/05/18/xtext-and-dot/path-expressions/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Wed, 12 October 2022 09:33] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02170 seconds