|Re: How to Integrate Xtext into other projects [message #1772117 is a reply to message #1772057]
||Tue, 05 September 2017 17:03
| Robert Klinger
Registered: July 2017
The file extension should be correct.|
I am not exporting anything manually yet. Should I?
I am not sure If I really understood on how to import the language the right way.
I ve used Properties - Java Build Path and added under project the org.xtext.toolLanguage and under libraries the 5 .jars mentioned in the other post. Am I missing something?
The platform resource: I am working in one Eclipse workspace with the Xtext-Project and another Java-Project. Should this work or am I missing here something? :)
I have another question though and don´t want to make a new topic out of it: Is the xtext-File written Xtext? So is there a grammar for the file extension "xtext" and if so, is it public?
EDIT: I somehow fixed it, I am not sure how, but it works. Maybe the file could not get parsed properly with the grammar, I am not sure though. Sadly I was not really able to understand the exceptions I got :)
The code now:
//these would be the imports for the default dsl
Injector injector = new ToolLanguageStandaloneSetup().createInjectorAndDoEMFRegistration();
XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
Resource resource = resourceSet.getResource(URI.createFileURI("./example.toolLanguage"), true);
Model model = (Model) resource.getContents().get(0);
I manually added under properties - Java Build Path:
Projects: The xtext Project needed
You should find some of these jars referenced in the Xtext-Project too :)
Though you might want to consider using some build-tool or something :D
Again thank you very much for your help, specially thank you Christian Dietrich, you helped me a lot so far :)
[Updated on: Tue, 05 September 2017 17:30]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02397 seconds