Unable to load the cross referenced Dsl elements. [message #1434121] |
Mon, 29 September 2014 17:52 |
raju ak 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
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03236 seconds