QualifiedNameProvider ends up in cyclic resolution, when referring to object of other resource [message #1785512] |
Mon, 16 April 2018 06:54 |
Girish Kumar Messages: 48 Registered: May 2011 |
Member |
|
|
Hi All,
I want to actually reference a unnamed Object.
My Grammar is something like this
MyModel:
clientConfig+=ClientConfiguration*;
ClientConfiguration:
'Client' name=ID
'{'
(
states+=ComponentState*
'}';
ComponentState:
'State' state=[coom::State|FQN]
'{'
(stateDependency=StateDependency)?
'}';
StateDependency:
'depends on states' states+=[ComponentState|FQN] (',' states+=[ComponentState|FQN])*;
My Model Should look like this
Client Client1 {
State S1 {
}
}
Client Client2 {
State S1 {
depends on states Client1.S1 //Client name + State name
}
}
I tried to implement IQualifiedNameProvider
class StatesQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {
def QualifiedName qualifiedName(ComponentState cs){
val cc = cs.eContainer() as ClientConfiguration
return QualifiedName.create(cc.name, cs.state.name);
}
}
But with this i run in to this
org.eclipse.xtext.linking.lazy.LazyLinkingResource$CyclicLinkingException: Cyclic resolution of lazy links : ComponentState.state->ClientConfiguration.coomRef->ComponentState.state in resource 'platform:/resource/Test/src/Test.nsd'.
Any ways i can get this done
[Updated on: Mon, 16 April 2018 06:55] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06982 seconds