Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cyclic resolution of lazy links
Cyclic resolution of lazy links [message #1064489] Wed, 19 June 2013 13:26 Go to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi all ,

I wrote a scop customization code but ,

I take an error .How can I solved this problem?


java.lang.AssertionError: Cyclic resolution of lazy links : ViewField.field->ViewField.field
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.handleCyclicResolution(LazyLinkingResource.java:243)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:193)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:175)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:197)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:257)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1473)
	at com.mdd4cca.msf.content.content.impl.ViewFieldImpl.getField(ViewFieldImpl.java:73)
	at com.mdd4cca.msf.content.content.util.ViewUtil.possibleFieldForViewField(ViewUtil.java:54)
	at com.mdd4cca.msf.content.scoping.ContentScopeProvider.scope_ViewField_field(ContentScopeProvider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
	at org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.polymorphicFindScopeForReferenceName(AbstractDeclarativeScopeProvider.java:150)
	at org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.getScope(AbstractDeclarativeScopeProvider.java:98)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getScope(DefaultLinkingService.java:61)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:123)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:198)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:175)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:155)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:114)
	at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:510)
	at org.eclipse.xtext.validation.ResourceValidatorImpl.resolveProxies(ResourceValidatorImpl.java:154)
	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:67)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:79)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:1)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:221)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:79)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob.createIssues(ValidationJob.java:75)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob.run(ValidationJob.java:64)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)


best regards
Re: Cyclic resolution of lazy links [message #1064505 is a reply to message #1064489] Wed, 19 June 2013 14:28 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
You have implemented a cyclic scoping resolution.
You need to show us your ScopeProvider code and some information on your
grammar and the models you are processing.


Am 6/19/13 3:26 PM, schrieb junior developer:
> Hi all ,
>
> I wrote a scop customization code but ,
>
> I take an error .How can I solved this problem?
>
>
>
> java.lang.AssertionError: Cyclic resolution of lazy links :
> ViewField.field->ViewField.field
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.handleCyclicResolution(LazyLinkingResource.java:243)
>
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:193)
>
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:175)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
>
> at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:197)
> at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:257)
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1473)
>
> at
> com.mdd4cca.msf.content.content.impl.ViewFieldImpl.getField(ViewFieldImpl.java:73)
>
> at
> com.mdd4cca.msf.content.content.util.ViewUtil.possibleFieldForViewField(ViewUtil.java:54)
>
> at
> com.mdd4cca.msf.content.scoping.ContentScopeProvider.scope_ViewField_field(ContentScopeProvider.java:112)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
>
> at
> org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.polymorphicFindScopeForReferenceName(AbstractDeclarativeScopeProvider.java:150)
>
> at
> org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.getScope(AbstractDeclarativeScopeProvider.java:98)
>
> at
> org.eclipse.xtext.linking.impl.DefaultLinkingService.getScope(DefaultLinkingService.java:61)
>
> at
> org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:123)
>
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:198)
>
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:175)
>
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:155)
>
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:114)
>
> at
> org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:510)
>
> at
> org.eclipse.xtext.validation.ResourceValidatorImpl.resolveProxies(ResourceValidatorImpl.java:154)
>
> at
> org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:67)
>
> at
> org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:79)
>
> at
> org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:1)
>
> at
> org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:221)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:79)
>
> at
> org.eclipse.xtext.ui.editor.validation.ValidationJob.createIssues(ValidationJob.java:75)
>
> at
> org.eclipse.xtext.ui.editor.validation.ValidationJob.run(ValidationJob.java:64)
>
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
>
>
> best regards


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Cyclic resolution of lazy links [message #1064588 is a reply to message #1064505] Thu, 20 June 2013 06:53 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi Sven,

My grammar is below :I used my util class
in addition I receive same error for scoping one element in the referencing element one DSL to onother DSL project project
My scop customization :
def IScope scope_ViewField_field(Function context, EReference reference) {
    Function context1 =(Function) context.eContainer();
   println("xxxxx"+context.ownedView );
    val EList<View> list = (context.ownedView) 
   
   for (i : 0 ..< list.size) {
   	val element = list.get(i)
   	 val ArrayList<Field> possiblefieldview = ViewUtil::possibleFieldForViewField(element)
   	
   return Scopes::scopeFor( possiblefieldview,qnp, IScope::NULLSCOPE)			
   }






Context returns Context:
	'context'
	name=QualifiedName
	'{'
	
	 app=Application
	'}';
	
ContextUnit returns ContentextUnit:
	Context | Application | Collection | Method | Function | Type | Field ;

Application returns WebApplication:
	'Application'
	name=QualifiedName
	'{'
	
	collection+=Collection (collection+=Collection)*
	'}';

Collection returns Collection:
	'Collection'
	name=QualifiedName
	'{'
	
	 ownmethod=Method
	'}';

Method returns Method:
	'method'
	name=QualifiedName
	'{'
	
	
	(list+=Function (list+=Function)*)?
	(ownmethod+=Method (ownmethod+=Method)*)?
	'}';

Function returns Function:
	'function'
	name=QualifiedName
	'{'
	
    (type+=Type (type+=Type)*)?
	(ownedView+=View (ownedView+=View)*)?
	'}';

View returns View:
	'View'
	name=QualifiedName
	'{'
	'type' '=' type= STRING
	('fields' '=' ownedViewField+=ViewField (','ownedViewField+=ViewField)*)?
	'}';
ViewField returns ViewField:
(field= [Field|QualifiedName]);

Type returns Type:
	'type'
	name=QualifiedName
	'{'
	
	('parent' '=' parentType=[Type|QualifiedName])?
	'fields' '{'
	(ownedField+=Field (ownedField+=Field)*)?
	
	'}'
	'}';
	
	
	

Field returns Field:
	LookUp| TextField ;




LookUp returns LookUp:
	'LookUp'
	name=QualifiedName
	'{'
		
		('type' '=' type=[Type|QualifiedName])
	 	('showField' '=' showField =[Field|QualifiedName])
	'}';
	
TextField returns TextField:
	'Text' name=QualifiedName '{'
		
		'displayName' '=' displayName=STRING
		'property''=' property=STRING
		
	'}';


QualifiedName : 
	ID('.'ID)*
;






Best Regards

[Updated on: Thu, 20 June 2013 06:58]

Report message to a moderator

Re: Cyclic resolution of lazy links [message #1468019 is a reply to message #1064489] Mon, 10 November 2014 14:07 Go to previous message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hi,

I know th post is quite old, but did you find a solution for your problem?

~Alex
Previous Topic:linking/scoping reserved words
Next Topic:RefactoringResourceSetProvider in xtext 2.6 not working
Goto Forum:
  


Current Time: Thu Apr 25 04:55:47 GMT 2024

Powered by FUDForum. Page generated in 0.02921 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top