Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EGL-EGL model transformations using ETL?
EGL-EGL model transformations using ETL? [message #821127] Thu, 15 March 2012 00:40 Go to next message
Eclipse UserFriend
I have been crawling the forum for a while. I have also screened
Epsilon-related publications and docs, but I haven't found any hints on
whether there is support for subjecting any EOL (specifically an EGL)
model to transformations into another EGL model, with the
transformations being expressed in ETL (or through the Epsilon/Java API)?

Thx for any pointers!

Stefan
Re: EGL-EGL model transformations using ETL? [message #821369 is a reply to message #821127] Thu, 15 March 2012 09:08 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Stefan,

I'm afraid that's not possible out of the box as Epsilon languages currently don't have Ecore metamodels. One option would be to define an Ecore metamodel for the language you're interested in transforming and then write a Java program that transforms the internal representation (currently a homogeneous AST) into an instance of that metamodel. Please let me know if you'd like to go ahead with this and I'll be more than happy to help.

Cheers,
Dimitris
Re: EGL-EGL model transformations using ETL? [message #821481 is a reply to message #821369] Thu, 15 March 2012 12:17 Go to previous messageGo to next message
Eclipse UserFriend
Hey Dimitris!

Thx for your prompt reply!

> I'm afraid that's not possible out of the box as Epsilon languages
> currently don't have Ecore metamodels.

This confirms what I have learnt from looking at the EGL/EOL code bases
in the meantime. I had somehow "made" myself believe that there could be
Ecore reps (by skimming over the structure diagrams in the Epsilon
book), only to find implementation details (ANTLR etc.) a tick later.

> One option would be to define an
> Ecore metamodel for the language you're interested in transforming and
> then write a Java program that transforms the internal representation
> (currently a homogeneous AST) into an instance of that metamodel.

I can imagine that, yeah.

> Please
> let me know if you'd like to go ahead with this and I'll be more than
> happy to help.

Maybe for some background: I am looking for a testbed environment to
evaluate various kinds of higher-order transformation (HOT) strategies
(for M2T; e.g., parametric templates, template rewriting, etc.). As
those cited throughout literature (e.g., AMMA/ATL) are not really
maintained (at least it appears to me) or remained research prototypes,
I had hoped to find some ready-made infrastructure in the Epsilon-verse.

For this purpose, however, I could directly mangle the AST rep of EGL
templates; expressing the transformations in ETL itself (while certainly
elegant and inviting other use cases) would require me to turn the
transformed Ecore reps into AST reps at the end of the transformation
channel.

Any thoughts in this direction?

Cheers
Stefan
Re: EGL-EGL model transformations using ETL? [message #821513 is a reply to message #821481] Thu, 15 March 2012 13:09 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Stefan,

For the Ecore->EGL part you could also emit EGL code instead of an EGL AST.

Cheers,
Dimitris
Re: EGL-EGL model transformations using ETL? [message #871774 is a reply to message #821513] Mon, 14 May 2012 20:53 Go to previous messageGo to next message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
Hi Dimitris,

I am a colleague of Stefan and we want to work on the implementation of M2T HOT in Epsilon (as mentioned by Stefan in a previous posting). I have obtained the Epsilon sources from SVN today. My question now is if you could provide us some pointers where to start and which strategy you would recommend for the implementation?

Thanks,
Bernhard
Re: EGL-EGL model transformations using ETL? [message #871784 is a reply to message #871774] Mon, 14 May 2012 21:29 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi Bernard,

I'm Antonio, another Epsilon developer. I'm mostly focused on EOL in general and the testing and debugging facilities (especially EUnit), but I'm familiar with the overall design and code structure of Epsilon Smile.

As you may already know, Epsilon development is done straight on the "trunk" branch, with the plugins in the "trunk/plugins" directory and the tests for them in the "trunk/test" directory. We've got a guide here on how to run Epsilon straight from SVN:

http://eclipse.org/epsilon/doc/articles/epsilon-source-svn/

Every Epsilon language has a ".language.engine" plugin that implements its core functionality, and the class that represents a program in those languages is usually called something like XXXModule. In this case, you'll need to look at the .egl.engine plugin and (probably) the EgxModule class. It has parse(...) methods for parsing an EGL program, the createParser(...) method for creating the raw parser itself and the getAst() method for accessing the AST produced by the ANTLR-based parser.

I'd suggest that you use the EGL parser in .egl.engine to produce the AST of the EGL program, convert it with regular Java code into an ECore model that you can load into an InMemoryEmfModel, add the InMemoryEmfModel to the model repository of the context of the EglModule with the final transformation and then launch that transformation. You'll need to create your own metamodel for EGL though, I'm afraid.

Did that help? Smile

Cheers,
Antonio
Re: EGL-EGL model transformations using ETL? [message #907268 is a reply to message #871784] Mon, 03 September 2012 16:26 Go to previous messageGo to next message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
Hi Epsilon community,

now I had the time to look a little closer at the Epsilon framework to be able to begin thinking about a HOT testbed environment. To start with, I have a question about generating the metamodel for EGL. Currently, there is no Ecore representation available. I browsed the grammar files for EOL and its EGL extension. Can anybody think of a quicker solution to generate an Ecore-based metamodel out of the ANTLR grammar files, besides doing it manually?

I found some papers about transforming context free grammars to (E)MOF-based metamodels but no tool support. Of course, this cannot be done completely automated, but some automation would help. Otherwise I need to figure out the EOL and EGL parts of the grammar which I need to represent as a metamodel. Or I need to generate a metamodel which covers all EOL/EGL aspects, which I think would be quite time-consuming.

So, if anybody has a better idea, please let me know.

Thank you!

-Bernhard
Re: EGL-EGL model transformations using ETL? [message #907307 is a reply to message #907268] Mon, 03 September 2012 18:13 Go to previous messageGo to next message
fabtagon . is currently offline fabtagon .Friend
Messages: 8
Registered: May 2012
Junior Member
Hi Bernhard,

On 03.09.2012 18:26, Bernhard Hoisl wrote:

> now I had the time to look a little closer at the Epsilon framework
> to be able to begin thinking about a HOT testbed environment.

I'm starting to work on HOTs with ETL, too. I'm glad to hear that I'm
not alone with this effort.

> I found some papers about transforming context free grammars to
> (E)MOF-based metamodels but no tool support.

There is a tool which might help you called EMFText. To put it frankly
it does not generate a metamodel for you, but one step further (after
generating the metamodel by hand) it might become quite handy.

First you have to supply EMFText with a metamodel and a context-free
grammar for your languages of choice. It then generates editors (ok, you
already have one) and model adapters (that's the new thing) for you. So
you can e.g. access a .etl file like an .xmi file without the need for
an explicit transformation step (you can directly load it with ETL's
loadModel directive). That's very handy when doing higher-order
transformations.

For my purposes (adding tracing to numerous languages in an academic
plot) I'm fine with a subset of ETL for the moment. If no automatized
silver bullet emerges we can maybe join forces?

Best regards
Fabian
Re: EGL-EGL model transformations using ETL? [message #907350 is a reply to message #907307] Mon, 03 September 2012 20:32 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Fabian, Bernhard,

We already have a prototype EOL metamodel and code that transforms EOL ASTs to models conforming to that metamodel. As the code is still in its first development iterations, we plan to share it under EpsilonLabs [1] with the intention of moving it under eclipse.org when it becomes more stable.

William Wei, who is the engineer working on this, should join the thread soon with more details on how to access and use the code.

Cheers,
Dimitris
Re: EGL-EGL model transformations using ETL? [message #907355 is a reply to message #907307] Mon, 03 September 2012 20:49 Go to previous messageGo to next message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
Hi Fabian!

> I'm starting to work on HOTs with ETL, too. I'm glad to hear that I'm
> not alone with this effort.

Actually, we wanted to transform the HOT idea to a M2T template language (like EGL), but I think the process is the same as for M2M transformations (like with ETL).

> First you have to supply EMFText with a metamodel and a context-free
> grammar for your languages of choice. It then generates editors (ok, you
> already have one) and model adapters (that's the new thing) for you. So
> you can e.g. access a .etl file like an .xmi file without the need for
> an explicit transformation step (you can directly load it with ETL's
> loadModel directive). That's very handy when doing higher-order
> transformations.

This sounds very interesting - I will definitely have a look at it. Do you have an example for ETL at hand? I would very much appreciate to look at it in practice!

> For my purposes (adding tracing to numerous languages in an academic
> plot) I'm fine with a subset of ETL for the moment. If no automatized
> silver bullet emerges we can maybe join forces?

Yes, joining forces is a very good idea. My purpose for investigating HOTs is also an academic one: composing two DSLs and facilitate reuse of the software artifacts involved. E.g., making reuse of M2T generators possible (with, e.g. HOTs or parameterized templates). Tracing the merge strategy from the language model composition (i.e. the M2M transformation) is also an aspect, thus, your tracing additions are also of interest to me.

-Bernhard
Re: EGL-EGL model transformations using ETL? [message #907356 is a reply to message #907350] Mon, 03 September 2012 20:52 Go to previous messageGo to next message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
Hi Dimitris!

Dimitris Kolovos wrote on Mon, 03 September 2012 16:32
We already have a prototype EOL metamodel and code that transforms EOL ASTs to models conforming to that metamodel. As the code is still in its first development iterations, we plan to share it under EpsilonLabs [1] with the intention of moving it under eclipse.org when it becomes more stable.


That's great and would definitely safe us some work. Looking forward to see the code base.

Thanks,
Bernhard
Re: EGL-EGL model transformations using ETL? [message #907390 is a reply to message #821127] Mon, 03 September 2012 22:42 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Fabian, Bernhard,

Thank you very much for your interest in the meta-representations for the Epsilon languages, we managed to come up with a prototype EOL meta-model, and facilities that transform EOL ASTs to EOL models conforming to this meta-mode, there is a wiki page created to elaborate the creation of the DOM in the EpsilonLabs (sorry, I could not paste the links due to the restriction of this forum). I have also uploaded the source codes, you can find it under /trunk/StaticAnalysis.

Purposes of different projects are elaborated in the wiki page. An example that transforms a EOL module into a DOM model and prints out the Dom as a EOL module can be found under trunk/StaticAnalyser/org.eclipse.epsilon.eol.dom.ast2dom.workbench.

Please note that the EOL meta-model is just a prototype and is subject to extensive testing and changes, if you do find any defects or you come up with some new ideas about the development of it, we would be glad to hear from you.

Should you have any questions please feel free to contact us.

Cheers

William


Research Associate
Department of Computer Science
University of York

[Updated on: Mon, 03 September 2012 22:58]

Report message to a moderator

Re: EGL-EGL model transformations using ETL? [message #907932 is a reply to message #907390] Tue, 04 September 2012 12:53 Go to previous messageGo to next message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
Hi William,

thanks for sharing the code with us. I obtained it from the repository and managed to run the Ast2DomWorkbench example. I will have a look at the sources and get back to you when I am more familiar with them.

Cheers,
Bernhard
Re: EGL-EGL model transformations using ETL? [message #907989 is a reply to message #907932] Tue, 04 September 2012 14:04 Go to previous messageGo to next message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
OK, I glimpsed at the code. I want to extend the AST2DOM methods to handle EGL, as well. So, from what I see up to know, I would need to use the EGL lexer and parser, extend the metamodel with the EGL-specific language elements (actually, not so much: dynamic/static sections, template, outputbuffer etc.), and then implement the AST2DOM transformation methods?

Could somebody who is familiar with the code could give me a hint where I should start and how to extend the EOL AST2DOM functions best? For example, should the DOM.emf be extended or should the EGL-specific metamodel be kept in a separate project, referencing the EOL metamodel etc.?

Up to now I am a little bit lost in the code.

Thanks!

-Bernhard
Re: EGL-EGL model transformations using ETL? [message #908032 is a reply to message #907989] Tue, 04 September 2012 15:13 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Bernhard,

The DOM is designed for EOL, however, it can be extended to support EGL, I will have a look at how this is possible and get back to you.

As how AST2DOM works:

The DOM java implementations are generated from dom.ecore meta-model (actually I worked primarily on dom.ecorediag, the diagram will provide you with a clearer structural view). Then inside the AST2DOM project, there is a set of DomElementCreators, the main access point is the DomElementCreatorFactory. To the factory you feed in an AST and it generates corresponding DomElement(s) and DomElment(s) for the children of the AST, iteratively. To extend the AST2DOM functions, create your own DomElement which deals with corresponding AST that you want to handle. To start with, I think it is probably a good idea to have a look at DomElementCreatorFactory.

The Dom.Printer facility is used for validation and testing purposes, to validate the DomElmementCreator you create, you should also validate it by creating an corresponding DomElementPrinter class for it.

Hope this helps, I will provide you with more details when I find out what is the best way to do to deal with EGL.

Cheers

William


Research Associate
Department of Computer Science
University of York
Re: EGL-EGL model transformations using ETL? [message #909137 is a reply to message #908032] Thu, 06 September 2012 15:45 Go to previous messageGo to next message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
William Wei wrote on Tue, 04 September 2012 11:13
Hi Bernhard,

The DOM is designed for EOL, however, it can be extended to support EGL, I will have a look at how this is possible and get back to you.



Thanks, I am looking forward to hearing from you. Meanwhile, I will look more closely at the source code myself.

Cheers,
Bernhard
Re: EGL-EGL model transformations using ETL? [message #911472 is a reply to message #909137] Tue, 11 September 2012 17:16 Go to previous messageGo to next message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
Hello,

I managed to get a first EGL example working. Therefore, I edited the Ast2DomWorkbench.java class to handle EGL code and added a new metamodel element to the Dom.ecore for testing purposes. I added a new EGL-specific variable type (called 'TemplateType') to the metamodel. Of course, I added also the corresponding AST2DOM class and altered the respective printer method to handle the new type.

The new EGLAst2DomWorkbench.java file is attached. I am sure, the source code can be improved (e.g., ambiguous method calls or problems with plain text handling between EGL sections), but it is just meant to be a starting point (comments very much appreciated).

As I have now looked a little deeper into the code, my question is how to best manage the code in terms of java packages? Should we separate the EOL implementations from the EGL ones? This would affect the metamodel (and the place of the automatically generated java files), the AST2DOM functions, and the print methods.

Has anybody an idea how to proceed best?

Cheers,
Bernhard
Re: EGL-EGL model transformations using ETL? [message #911557 is a reply to message #911472] Tue, 11 September 2012 21:16 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Bernhard,

I had a look at the attached EGLAst2DomWorkbench.java, I agree that EGL should be handled as an extension of EOL, which was the research that I expected to carry out for my research degree.

My research area is about automated analysis and validation of model management operations, as you may have learnt from the wiki page that I created on this topic in the EpsilonLabs. The research is still in its preliminary state and I started off by creating a meta-model for EOL, because EOL is the base line for all other Epsilon languages.

According to the design of Epsilon languages, languages such as EVL, ECL, ETL, EWL, EGL, etc all extend EOL syntax and EOL functionality. Thus, to create a meta-model for EGL for this case, it is in principle correct to say that the meta-model for EGL should extend the meta-model of EOL, since there are few systematical studies on model inheritance (to my limited knowledge), I would say that the method I would use to design EGL meta-model is to design meta-classes for EGL first then merge the meta-classes you create with the EOL meta model. However this incurs other design challenges which i wish to solve in my research. For now I do not have a accurate answer on how to proceed best until my research comes to a mile stone.

To avoid confusion, I would choose to separate the EGL meta-model with the EOL meta-model but this is the work I meant to do and have not done yet, suggestions are mostly welcome.

Cheers

William


Research Associate
Department of Computer Science
University of York
Re: EGL-EGL model transformations using ETL? [message #911876 is a reply to message #911557] Wed, 12 September 2012 13:49 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 242
Registered: October 2009
Location: Mexico
Senior Member

Hi,

I want to add my 2cents:

In UML (as in the Eclipse UML implementation) I have seen two approaches to the creation of metamodels to define UML profiles. A profile could be seen as a particular type of extension... probably...

For the TopCased guys, when they defined the SysML profile, meta-model classes in the SysML meta-model that represented a profile of a UML class inherited from that class For example: Block is a profile of Class, then the Block inherits from Class in the meta-model.

The Papyrus guys on the other hand (deciding to break all TopCased compatibility between models) came up with a new SysML meta-model in which classes in the SysML meta-model that represent a profile of a UML class have an association typed by the UML meta-model class. All associations are named "base_XXX" where XXX is replaced by the name of the base element. For example: Block is a profile of Class, then Block has an association of type Class, named base_Class. (a caveat is that a Block in your model is actually represented by a Block AND by a Class)

In my experience, the latter was a little bit cumbersome and required more elaborated select/collect statements since the association requires an additional step in the query.

Regards,


Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Re: EGL-EGL model transformations using ETL? [message #915601 is a reply to message #821127] Mon, 17 September 2012 16:06 Go to previous messageGo to next message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
Hi William,

I have worked on the EGL implementation and made a very basic example (attached). For now, I just implemented test methods for one new EGL type (called 'TemplateType'). I completely separated all the EGL work from the EOL (separate metamodel, projects etc.) and the EGL classes inherit from the EOL ones.

The EGL metamodel (MM) references the EOL MM, so development can be done separately.

Also, the three new EGL projects inherit functionality from the EOL classes and extend them where necessary.

Could you please have a look at the model and code and see if I have extended your classes in the right way? I am sure the code can be improved.

So, from an EGL script an AST is produced, from the AST, the DOM can be created, this model can be saved and I implemented also a method for loading a saved model, which again, can be transformed into an EGL script. This is basically the functionality I need for my work.

I tried to not touch the EOL-specific code, although I needed to alter two things (see the patch attached). There would be further improvements possible (or even necessary), but first I would like you to have a look at my sources and see if you agree with my design.

Thanks!

-Bernhard
Re: EGL-EGL model transformations using ETL? [message #918133 is a reply to message #915601] Thu, 20 September 2012 19:26 Go to previous message
Bernhard Hoisl is currently offline Bernhard HoislFriend
Messages: 26
Registered: March 2011
Junior Member
Hi William,

the ForStatementCreator class throws an error when creating the statements for the body of a for loop. I think this is by error, attached is a patch.

-Bernhard
Previous Topic:EOL Show user messages / modeler
Next Topic:PeriodicallyUpdateEPackageRegistryMonitorJob eats away heap
Goto Forum:
  


Current Time: Sat Apr 20 02:58:36 GMT 2024

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

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

Back to the top