Problems with the import statement in my grammar [message #654498] |
Wed, 16 February 2011 03:56 |
|
Hi,
I was trying to create a grammar using xtext. I was doin this by reading the xText user guide :- http://www.eclipse.org/Xtext/documentation/latest/xtext.html
In my grammar, i have defined an "import" statement which has to take namespace uris of ecore models. I have defined a scope provider MyScopeProvider which extends AbstractDeclarativeScopeProvider.
The problem i am facing is that, for giving the namespace uri of an ecore file in the import statement, the project containing the ecore file as well as the source folder should be either in the design time workbench or must be installed using update site.
If i put the whole project with sources, ecore file, genmodel etc in the runtime workbench, the import statement doesn't work and gives an error saying unable to resolve.
Is there anything extra that i will have to do in my scoping to include runtime workspace also, so that imports can be recognized??
Regards,
Animesh
|
|
|
|
Re: Problems with the import statement in my grammar [message #654772 is a reply to message #654706] |
Thu, 17 February 2011 03:37 |
|
Hi Alexander,
Thanks for the reply.
But the problem is that, I don't want to use the ECore file directly (using the platform:/resource).
Is there any way i can use namespace uris of the EPackages in the ECore files which are there in my runtime workbench?
The Problem Statement is :-
I have created a grammar for my DSL. As in Java, my DSL can have import statements. So When i run my generated DSL and in the editor for the DSL, i give namespace uris for EPackages, in the import statement of my DSL.
The Problem is that, my DSL recognizes namespace URIs of only those EPackages whose Ecore file and Source Folder in there in Design Time Work Bench ( Where I had created my grammar) or the project ( The one containing Ecore file and Sources) must be already installed via update site. But if i keep all the sources and the Ecore file in runtime workbench, the DSL gives an error saying couldnot resolve. Why is it so?
I don't know where i went wrong. The ScopeProvider which I am using extends AbstractDeclarativeScopeProvider
Regards,
Animesh
|
|
|
|
Powered by
FUDForum. Page generated in 0.03657 seconds