General Xtext question [message #1850960] |
Wed, 23 March 2022 09:50  |
Eclipse User |
|
|
|
Hello,
I am trying to understand how to use Xtext, not the grammar part but rather how to reuse the model.
Right now I have the grammar (file .xtext) but I cannot wrap my head around on how to use it outside the in-built editor of Xtext.
Let's say I start a new project (general purpose) on Eclipse, how do I add the model into Eclipse so that I can have the syntax highlight/autocompletion in a new file?
For example purpose, let's say I defined 'real' and 'complex' as keyword into the model. I wish to start a new project on Eclipse and be able to write in a
new blank file:
real rValue = 1.2;
complex cValue = 1.5 + 2.1i;
Then, the file will be sent through a compiler outside Eclipse.
Being a complete beginner on Eclipse, the Xtext documentation is rather obscure and I keep circling on the same topic without making any progress. Plus, I am not even sure Xtext is the right tool to do that.
Kind regards,
Edit: I am interessted in a number of features of Xtext, not just the highlighting of keywords
[Updated on: Wed, 23 March 2022 10:30] by Moderator
|
|
|
|
|
|
Re: General Xtext question [message #1851017 is a reply to message #1850992] |
Thu, 24 March 2022 11:23  |
Eclipse User |
|
|
|
Thank you for your response Ed, but sadly I didn't understand a single word.
That being said, I've found a way to do it. By exporting the grammar+ide+ui and asking eclipse to instal them in 'this' Eclipse in the Export Wizard, I can make new file with the right extension and Xtext detects them. The .jar are indeed in the p2 repo.
Kind regards,
|
|
|
Powered by
FUDForum. Page generated in 0.05006 seconds