Hi all,
I am trying to use an existing EMF model as a base for a parser written in XText. However, I am having trouble getting the grammar to build with an ecore model that is in a series of sub-packages- The referenced EObjects are in org/eclipse/january/geometry (org is the top EPackage), where the last nsURI is "http://www.eclipse.org/january/geometry". There are no errors with the workflow or the grammar, but when generating the Xtext artifacts, there is an error stating that the package "http:/www.eclipse.org/january/geometry" cannot be resolved. I made sure the xtext nature is added to the project, as well as registered the package in the StandaloneSetup class. I should also mention that for dependency reasons, I have the xtext and EMF model code all in the same plugin project.
In my grammar (.xtext file), I simply import the package:
import "http://www.eclipse.org/january/geometry"
And in the mwe2:
referencedResource = "platform:/resource/org.eclipse.january.geometry.model/model/geometry.genmodel
And the first error line when generating the artifacts is something like this:
672 [main] ERROR xt.generator.XtextGeneratorLanguage - [XtextLinkingDiagnostic: null:3 Couldn't resolve reference to EPackage 'http://www.eclipse.org/january/geometry'., XtextLinkingDiagnostic: null:6 Couldn't resolve reference to EClassifier 'Geometry'., XtextLinkingDiagnostic: null:7 Couldn't resolve reference to EClassifier 'Geometry'., XtextLinkingDiagnostic: null:14 Couldn't resolve reference to EClassifier 'Shape'., XtextLinkingDiagnostic: null:15 Couldn't resolve reference to EClassifier 'Shape'., XtextLinkingDiagnostic: null:19 Couldn't resolve reference to EClassifier 'Triangle'., XtextLinkingDiagnostic: null:20 Couldn't resolve reference to EClassifier 'Triangle'., XtextLinkingDiagnostic: null:28 Couldn't resolve reference to EClassifier 'Vertex'., XtextLinkingDiagnostic: null:29 Couldn't resolve reference to EClassifier 'Vertex'.]
674 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow org.eclipse.january.model.xtext.GenerateSTL: Problem parsing 'file:/home/k7e/Documents/ICE/dev/eavp/org.eclipse.january.geometry.model/../org.eclipse.january.geometry.model/src/xtext/STL.xtext':
Is this because the package I want is a subpackge, and Is it possible to use objects from EMF subpackges? Or should I resturcture the EMF model to not have any subpackges?
Thanks, I appreciate any help on this!
Kasper Gammeltoft
Oak Ridge National Laboratory
Computer Science Research Group