While Parsing the xtext models,Getting Resource factory needed [message #1216053] |
Thu, 28 November 2013 04:56  |
Eclipse User |
|
|
|
I am started working on xtext, I have created some DSL grammer and Generated the artifacts,After that i ran that as eclipse application and created the sample.dmodel (example), In the editor i have added some langauge realted stuff which grammer accepts.
problem:
once the dmodel is created i need to read that particular file and get the contents from them..I have tried using loading the Resource concept. but it is not working.. I am getting resource factory is needed.
new DomainModelStandaloneSetup().createInjectorAndDoEMFRegistration();
ResourceSet rs = new ResourceSetImpl();
Resource resource = rs.getResource(URI.createURI("C:\\Users\\runtime-EclipseXtext\\sampleprj\\src\\mymodel.dmodel"), true);
DomainModel model = (DomainModel) resource.getContents().get(0);
System.out.println(model.getElements().size());
can you guys please help me how to do it.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08047 seconds