|
|
|
|
|
|
|
|
|
|
|
Re: Custom Scoping [message #1499852 is a reply to message #1499825] |
Fri, 05 December 2014 13:17 |
|
the problem is in your grammar. the ui parser treats the "." as extranous input.
thus the input model is not as expected.
i have no idea how to workaround that. (besides moving the ; to dev null or removing the predicate
FeatureReference returns Expression:
NameOrThisExpression ({FeatureReference.expression=current} '.' nameBinding=[Member])* ';';
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Re: Custom Scoping [message #1499863 is a reply to message #1499862] |
Fri, 05 December 2014 13:29 |
|
Hi,
as i said.
the following grammar and scoping works for me
FeatureReference returns Expression:
NameOrThisExpression ({FeatureReference.expression=current} '.' nameBinding=[Member])* ';'; def IScope scope_FeatureReference_nameBinding(FeatureReference ctx, EReference ref) {
val target = ctx.expression
val type = getType(target) as Class
var parentScope = IScope::NULLSCOPE
if (type == null || !(type instanceof Class)) {
return parentScope
}
return Scopes::scopeFor(type.selectMemberInRightOrder(), parentScope)
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.04098 seconds