Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to integrate Xtext with an existing eclipse plug-in developed for a DSL?
How to integrate Xtext with an existing eclipse plug-in developed for a DSL? [message #715359] Sat, 13 August 2011 15:13 Go to next message
Harshani Nawarathna is currently offline Harshani NawarathnaFriend
Messages: 9
Registered: August 2011
Junior Member
There is an existing Eclipse plug-in developed for a DSL which lacks code suggestion and does not provide proper errors.

I managed to build code suggestion and error identification for the DSL using Xtext separately.

How can I integrate my code with existing eclipse plug-in for the DSL and fix the issue in the current plug-in?

Thanks in advance.
Re: How to integrate Xtext with an existing eclipse plug-in developed for a DSL? [message #715363 is a reply to message #715359] Sat, 13 August 2011 15:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

can you elaborate a bit about what you mean with "integrate"?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to integrate Xtext with an existing eclipse plug-in developed for a DSL? [message #715369 is a reply to message #715363] Sat, 13 August 2011 16:14 Go to previous messageGo to next message
Harshani Nawarathna is currently offline Harshani NawarathnaFriend
Messages: 9
Registered: August 2011
Junior Member
Hi,

I am totally new to Xtext.

A DSL, Processing has it's own eclipse plug-in to write it's code and run them. That plug-in lacks of code suggestion.
What I want to do is add code suggestion facility to the existing plug-in.

I refered the Xtext manual and managed to create code suggestion for the syntax of Processing separately.

Now I want to integrate my code to the existing plug-in.

How can I do that, if this is not the optimal way to add code suggestions?

Thanks

(no subject) [message #715372 is a reply to message #715369] Sat, 13 August 2011 16:23 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
How was the original DSL/Editor implemented? With Xtext?
If not, you have to ask the provider of that plugin/technology if it is
possible to modify its behavior.

If it was done with Xtext, the easiest would naturally be to modify the
source directly. If that is not possible, you could look at launching an
editor with a different guice module (where you override the defaults).

You naturally always have the option to provide an alternative editor
for the same DSL. (Suspect there will be issues to solve if both are
done with Xtext and both register parsers).

Anyway - can you provide more information?

- henrik

On 8/13/11 6:14 PM, Harshani Nawarathna wrote:
> Hi,
>
> I am totally new to Xtext.
> A DSL, Processing has it's own eclipse plug-in to write it's code and
> run them. That plug-in lacks of code suggestion.
> What I want to do is add code suggestion facility to the existing plug-in.
>
> I refered the Xtext manual and managed to create code suggestion for the
> syntax of Processing separately.
>
> Now I want to integrate my code to the existing plug-in.
>
> How can I do that, if this is not the optimal way to add code suggestions?
>
> Thanks
>
>
Re: (no subject) [message #715379 is a reply to message #715372] Sat, 13 August 2011 16:51 Go to previous messageGo to next message
Harshani Nawarathna is currently offline Harshani NawarathnaFriend
Messages: 9
Registered: August 2011
Junior Member
Hi Henrik,

The DSL editor is not implemented using Xtext. It is created using ANTRL and java.

What is the best way to proceed with my work?





Henrik Lindberg wrote on Sat, 13 August 2011 12:23
How was the original DSL/Editor implemented? With Xtext?
If not, you have to ask the provider of that plugin/technology if it is
possible to modify its behavior.

If it was done with Xtext, the easiest would naturally be to modify the
source directly. If that is not possible, you could look at launching an
editor with a different guice module (where you override the defaults).

You naturally always have the option to provide an alternative editor
for the same DSL. (Suspect there will be issues to solve if both are
done with Xtext and both register parsers).

Anyway - can you provide more information?

- henrik


>

Re: (no subject) [message #715386 is a reply to message #715379] Sat, 13 August 2011 17:45 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
If the author of that editor did not include the ability to add proposal
providers you are out of luck.

Why not simply write a new and better editor with Xtext and use that
instead ;-)

- henrik

On 8/13/11 6:51 PM, Harshani Nawarathna wrote:
> Hi Henrik,
>
> The DSL editor is not implemented using Xtext. It is created using ANTRL
> and java.
>
> What is the best way to proceed with my work?
>
>
>
>
>
> Henrik Lindberg wrote on Sat, 13 August 2011 12:23
>> How was the original DSL/Editor implemented? With Xtext?
>> If not, you have to ask the provider of that plugin/technology if it
>> is possible to modify its behavior.
>>
>> If it was done with Xtext, the easiest would naturally be to modify
>> the source directly. If that is not possible, you could look at
>> launching an editor with a different guice module (where you override
>> the defaults).
>>
>> You naturally always have the option to provide an alternative editor
>> for the same DSL. (Suspect there will be issues to solve if both are
>> done with Xtext and both register parsers).
>>
>> Anyway - can you provide more information?
>>
>> - henrik
>>
>>
>> >
>
>
Re: (no subject) [message #715388 is a reply to message #715386] Sat, 13 August 2011 17:56 Go to previous messageGo to next message
Harshani Nawarathna is currently offline Harshani NawarathnaFriend
Messages: 9
Registered: August 2011
Junior Member
Hi Henrik,

yes, That is what I want to do.

I am new to Xtext and I wrote a simple editor with code suggestions using Xtext. But how can I compile and run my code? Though I managed to write the grammar for DSL I have no idea how to proceed and give it the ability of compiling and running.

Please suggest me good references to use. I am quite lost with Xtext user guide.

Thanks a lot.
Re: (no subject) [message #715392 is a reply to message #715388] Sat, 13 August 2011 18:16 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

are you saying you were not able to follow the tutorials?

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: (no subject) [message #715432 is a reply to message #715388] Sun, 14 August 2011 01:09 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Do you want to write the compiler as well, or do you already have one
and want to use it?

- henrik

On 8/13/11 7:56 PM, Harshani Nawarathna wrote:
> Hi Henrik,
>
> yes, That is what I want to do.
> I am new to Xtext and I wrote a simple editor with code suggestions
> using Xtext. But how can I compile and run my code? Though I managed to
> write the grammar for DSL I have no idea how to proceed and give it the
> ability of compiling and running.
>
> Please suggest me good references to use. I am quite lost with Xtext
> user guide.
>
> Thanks a lot.
Re: (no subject) [message #715508 is a reply to message #715432] Sun, 14 August 2011 08:39 Go to previous messageGo to next message
Harshani Nawarathna is currently offline Harshani NawarathnaFriend
Messages: 9
Registered: August 2011
Junior Member
Hi henrik,

The existing plug-in has it's own pre-compiler and it uses java compiler within eclipse.
I still have no idea how it works.

Thanks
Re: (no subject) [message #715588 is a reply to message #715508] Sun, 14 August 2011 17:24 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

I can only hope you are not expecting us to know "the existing plugin". If you are not able to explain what *exactly* you are trying to do, it will not make sense to continue this thread (I don't see that you answered Christian's initial reply).
Making a wild guess, IXtextBuilderParticipant is what you are looking for. When the file is saved and a build of the project is invoked, you hook into that process and call the relevant code of "the existing plugin". You may have a look at the domain model example shipped with Xtext, where the builder invokes the code generation for modified model files.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: (no subject) [message #715673 is a reply to message #715588] Mon, 15 August 2011 06:55 Go to previous messageGo to next message
Harshani Nawarathna is currently offline Harshani NawarathnaFriend
Messages: 9
Registered: August 2011
Junior Member
Hi Alex,

Thanks a lot for the reply. This was my reply to Cristian in this thread.

Harshani Nawarathna wrote on Sat, 13 August 2011 12:14
Hi,

I am totally new to Xtext.

A DSL, Processing has it's own eclipse plug-in to write it's code and run them. That plug-in lacks of code suggestion.
What I want to do is add code suggestion facility to the existing plug-in.

I refered the Xtext manual and managed to create code suggestion for the syntax of Processing separately.

Now I want to integrate my code to the existing plug-in.

How can I do that, if this is not the optimal way to add code suggestions?

Thanks



I am talking about Processing plug-in for eclipse, Processing is a DSL. It lacks code suggestion and does not identify errors.
I want to add that missing features to the Processing plug-in for eclipse.

I managed to implement code and error suggestion using xtext separately by referring xtext manual.
But now I have a problem in adding the functionality I have implemented externally to the existing Processing plug-in for eclipse.

I will try the steps you have mentioned.

Thanks again.
Re: (no subject) [message #715679 is a reply to message #715673] Mon, 15 August 2011 07:24 Go to previous message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

I saw that *reply* but as I said, I don't really see that it is an *answer*. If I understand correctly, you have you written the Processing plugin. But how are *we* supposed to know how to add the additional functionality, if you don't tell us what exactly that functionality is and at which point in time it is to be used (e.g. "There is a compile method that is to be executed every time the user hits Enter")?

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Previous Topic:Xtext 2.0.1 Fixes
Next Topic:How to replace ANTLR?
Goto Forum:
  


Current Time: Thu Apr 25 07:54:58 GMT 2024

Powered by FUDForum. Page generated in 0.04828 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top