Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Extending a DSL with Plugins
Extending a DSL with Plugins [message #1383449] Mon, 26 May 2014 11:15 Go to next message
Oliver Ilnicki is currently offline Oliver IlnickiFriend
Messages: 4
Registered: May 2014
Junior Member
Hello there, I am new to Xtext so I hope it will be easy to solve this question.

I have created a DSL and I want to enhance it with the use of Plugins.

How can I implement Plugins for my DSL? How can the Plugins acces variables of my DSL?

For exampel I have the following DSL:


Model:
greetings+=Objects*;

Objects:
Project|Content|Flow
;

Project:
'Contentlist:' conelement+=Content+
'Flowlist:' flowelements+=Flow+
;
Content:
'content' name=ID
;
Flow:
'Flow from ' source=[Content] 'to' target=[Content]
;


I have created language artifacts and launched a runtime Eclipse.

there I wrote the following code:
Contentlist:
content storageA
content StorageB

Flowlist:
Flow from storageA to StorageB


Now I want to create a Plugin, which checks in the runtime eclipse if a Flow in the "Flowliste" has the same source and target.

How can I do that?

Looking Forward to an aswer, kind Regards
OI

Re: Extending a DSL with Plugins [message #1383779 is a reply to message #1383449] Mon, 26 May 2014 14:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13469
Registered: July 2009
Senior Member
Why a Plugin?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Extending a DSL with Plugins [message #1383843 is a reply to message #1383779] Mon, 26 May 2014 15:12 Go to previous messageGo to next message
Oliver Ilnicki is currently offline Oliver IlnickiFriend
Messages: 4
Registered: May 2014
Junior Member
It doesn't need to be a Plugin excactly (a friend advised me to use them).

It is important that different developers should be able to create 'extensions' and/or new features for the DSL independently from each other.

Is there maybe a better way than plugins? What does the DSL need to be easily extended?
Re: Extending a DSL with Plugins [message #1383877 is a reply to message #1383843] Mon, 26 May 2014 15:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13469
Registered: July 2009
Senior Member
Hi there is no easy way doing this. Validation might not be a Problem
but for other aspects ...


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Extending a DSL with Plugins [message #1383883 is a reply to message #1383449] Mon, 26 May 2014 16:48 Go to previous messageGo to next message
Oliver Ilnicki is currently offline Oliver IlnickiFriend
Messages: 4
Registered: May 2014
Junior Member
ok, if I limit myself to validation, how would I do it?
Is there a step by step tutorial?

For exampel can the DSL check if source and destination of a flow are the same object?
Re: Extending a DSL with Plugins [message #1383886 is a reply to message #1383883] Mon, 26 May 2014 16:51 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13469
Registered: July 2009
Senior Member
No there is no tutorial and it is a theoretical hook only. The idea
is to do basically the same as it is done in the main plugin


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Need help getting started on a grammar (again) (SOLVED)
Next Topic:Errors in generated java code when extending Xcore
Goto Forum:
  


Current Time: Thu Jun 04 21:51:51 GMT 2020

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

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

Back to the top