Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Integrate Xtend with runtime EMF Instances(Is it possible to extend the XTEND language to make it import EObject Types )
Integrate Xtend with runtime EMF Instances [message #1831815] Mon, 31 August 2020 07:12 Go to next message
Amar Banerjee is currently offline Amar BanerjeeFriend
Messages: 14
Registered: November 2018
Junior Member
Hi everyone,

I am trying to attemp the following:-
1. I have a DSL intance (DSL file) where, I am describing my model.
2. I am trying to see if XTEND language could be further extended to import the EObject types (as described in the DSL) rather than JVM Types.
E.g.
My_Eployee{
name = 'ABC XYZ'
age =27,
role = "Developer"
}

I want the XTEND like language to be able to import the EObject Type 'Employee'. Something like this:-

import 'My_Employee'

class XTEND_LIKE_CLASS{

def checkMYDSL_EmployeeAGE(Employee emp ){
if(emp.age > 20) println('Elidigible')
}

}


Can anyone please provide any suitable direction towards how this should be achievable ?

Cheers,
Amar
Re: Integrate Xtend with runtime EMF Instances [message #1831817 is a reply to message #1831815] Mon, 31 August 2020 07:47 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
if your dsl is xbase based and you infer a jvm model from your instance dsl files, then this should work automatically

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Integrate Xtend with runtime EMF Instances [message #1831819 is a reply to message #1831817] Mon, 31 August 2020 08:38 Go to previous messageGo to next message
Amar Banerjee is currently offline Amar BanerjeeFriend
Messages: 14
Registered: November 2018
Junior Member
Thanks for the reply Christian.
The idea here is to have an xtend type language which works on EObject Types rather than JVM Types. The reason is it is easier to have xtend type templates which can define processing functions in the runtime instance on the DSL models. Would you suggest any other alternative to address this problem ?

Cheers,
Amar
Re: Integrate Xtend with runtime EMF Instances [message #1831828 is a reply to message #1831819] Mon, 31 August 2020 10:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
this wont work. to have proper integration into build cycle you need a jvm model inferer
=> anything else like generating xtend files is not officially supported


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Integrate Xtend with runtime EMF Instances [message #1831852 is a reply to message #1831828] Tue, 01 September 2020 06:43 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Xtend is a Java++, so a non-Java-based Xtend seems really weird..

If you really want an EObject-based system, have a look at UML and/or the new Pivot-based Xtext-exploiting OCL. If nothing else you will realize how much you have to re-implement once you stop re-using standard Java IDE functionalities. And if you look at Xtend more critically you will see how hard those functionalities are to extend coherently.

Regards

Ed Willink
Previous Topic:Unable to fetch data type information if defined in an imported AADL file:
Next Topic:Xtext / Xtend 2.23 release
Goto Forum:
  


Current Time: Tue Apr 16 15:07:06 GMT 2024

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

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

Back to the top