Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Unable to load the cross referenced Dsl elements.(I have one DSL having cross-reference to another DSL, im referring one dsl elemtns in another, sometimes the elements are not loading due to some issue.)
Unable to load the cross referenced Dsl elements. [message #1434121] Mon, 29 September 2014 17:52 Go to next message
raju ak is currently offline raju akFriend
Messages: 15
Registered: October 2013
Junior Member
Hi all
I have one DSL having cross-reference to another DSL ,The first DSL is not being able to refer to the other DSL cross-referred elements, but if i close the DSL1-file and reopen it ,its able to refer the other DSL elements.If i again close and reopen the file it is not refering again,The same problem is repeating.( My first DSL size is (8KB) ,it has approximately 35 objects in ECORE model and we are using Scoping in our DSL,,Second DSL has 30 Objects in Ecore model and is also of same size ). So can you suggest any solution for the problem mentioned above ,below i am specifying how the two DSL grammar look like and we are using XTEXT 2.2.1
//grammar1
grammar com.abc.grammar1 with org.eclipse.xtext.common.Terminals
hidden (WS)
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate grammar1 "http://www.abc.com/grammar1"

/*------------------------------------------------------------------------------------------ */
/*This is used to import the other grammar*/
import "http://www.abc.com/grammar2" as g2
model:
	( Elements  )  
;
Elements:
Type 
;
Type:
'Viewname' type=[g2:Entity] 
'{'
   attr=[g2:Attribute]
'}'
;

//end of grammar1
//Grammar2:

grammar com.abc.grammar2 with org.eclipse.xtext.common.Terminals
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate grammar2 "http://www.abc.com/grammar2"
Table:
Entity
;
Entity:
'entity' name=ID '{'
(attr+=Attribute)*
'}'
;
Attribute:
name=ID 
;

//end of grammar2
In the Grammar 2-file i wrote like this
entity animal {
size
weight
}
In the Grammar 1-file ,i wrote like this
'Viewname' and press ctrl+space is not displaying the entities i created in Grammar2-editor
and i closed the file and reopened it did the same and now it is able to display the animal entity i created .
viewname animal

[Updated on: Mon, 29 September 2014 17:55]

Report message to a moderator

Re: Unable to load the cross referenced Dsl elements. [message #1434487 is a reply to message #1434121] Tue, 30 September 2014 06:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
hi do you have build automatically on?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unable to load the cross referenced Dsl elements. [message #1445354 is a reply to message #1434487] Wed, 15 October 2014 10:20 Go to previous messageGo to next message
raju ak is currently offline raju akFriend
Messages: 15
Registered: October 2013
Junior Member
Hi Dietrich,

Thanks for the Reply, Yes build automatically is on.
Re: Unable to load the cross referenced Dsl elements. [message #1445377 is a reply to message #1445354] Wed, 15 October 2014 10:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
then i have no clue what could cause this

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unable to load the cross referenced Dsl elements. [message #1450177 is a reply to message #1445377] Wed, 22 October 2014 07:07 Go to previous messageGo to next message
Kunal Khaware is currently offline Kunal KhawareFriend
Messages: 41
Registered: December 2013
Location: Hyderabad,India
Member

Hi Christian,
The problem is the loading ofcross referenced Dsl Elements is not consistent ie Sometimes it gets loaded and sometimes it doesn't. The Build Automatically is On and we are not getting any clue about this . Do you have any idea ?

Cheers
Kunal
Re: Unable to load the cross referenced Dsl elements. [message #1450235 is a reply to message #1450177] Wed, 22 October 2014 08:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

can you share a complete example and steps how to try to reproduce it. maybe i can find the time to have a look at the weekend


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unable to load the cross referenced Dsl elements. [message #1453746 is a reply to message #1450235] Mon, 27 October 2014 12:11 Go to previous messageGo to next message
Kunal Khaware is currently offline Kunal KhawareFriend
Messages: 41
Registered: December 2013
Location: Hyderabad,India
Member

Hi Christian,

We tried to create an example which replicates the same scenario which we are facing on our product, but somehow the example runs fine .Quick question how to make sure that all dsl resources are loaded before the dsl is loaded completely into editor for editing?

Thanks
Kunal
Re: Unable to load the cross referenced Dsl elements. [message #1456250 is a reply to message #1453746] Thu, 30 October 2014 06:51 Go to previous message
Kunal Khaware is currently offline Kunal KhawareFriend
Messages: 41
Registered: December 2013
Location: Hyderabad,India
Member

Hi ,
We got the issue, it was due to we tried to override the Add Xtext Nature dialogue using
	@Override
	public void afterCreatePartControl(XtextEditor editor) {
		super.afterCreatePartControl(editor);
		IResource resource = editor.getResource();
		toggleNature.toggleNature(resource.getProject());
	}

Previous Topic:Cross references Issues in Xtext
Next Topic:Suppress Add Xtext Nature Dialogue causes Problem
Goto Forum:
  


Current Time: Thu Mar 28 15:28:59 GMT 2024

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

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

Back to the top