|While Parsing the xtext models,Getting Resource factory needed [message #1216053]
||Thu, 28 November 2013 09:56
| raju ak
Registered: October 2013
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. |
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.
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);
can you guys please help me how to do it.
Powered by FUDForum
. Page generated in 0.13008 seconds