Hi,
the (qualified) name of the parameters is contructed of its and its parents names. so in your case the qualified name is a.a1. you have to adapt NameProvider and Scoping
public class MyQNP extends DefaultDeclarativeQualifiedNameProvider {
public String qualifiedName(Parameter p) {
return p.getName();
}
}
public class MyDslRuntimeModule extends org.xtext.example.mydsl.AbstractMyDslRuntimeModule {
@Override
public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
return MyQNP.class;
}
}
public class MyDslScopeProvider extends AbstractDeclarativeScopeProvider {
public IScope scope_EquationCondition_parameter(EquationCondition ec, EReference ref) {
return Scopes.scopeFor(ec.getGroup().getParameters());
}
}
or you change the grammer to make use of the QualifiedNames
EquationCondition:
parameter=[Parameter|FQN] '=' value=INT;
FQN: ID ("." ID)*;
~Christian
[Updated on: Mon, 14 March 2011 20:07]
Report message to a moderator