Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Using EOL source code or developing haetae
Using EOL source code or developing haetae [message #1833837] Sun, 25 October 2020 12:41 Go to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi there,

I would like to implement a tool for EOL. I need to parse the program and apply some changes to it. I would like my tool works on the newer version of Epsilon. Since Haetae works on Epsilon 1.3, I cannot use it. Any suggestion? Shall I use EOL parser directly?

Sincerely,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: Using EOL source code or developing haetae [message #1833838 is a reply to message #1833837] Sun, 25 October 2020 13:34 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 Banafsheh,

I think so. The only other option I can think of would be to clone Haetae and update it so that it works with more recent versions of Epsilon.

Thanks,
Dimitris
Re: Using EOL source code or developing haetae [message #1833839 is a reply to message #1833838] Sun, 25 October 2020 13:37 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi Dimitris,

Thank you so much.

Sincerely,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: Using EOL source code or developing haetae [message #1833913 is a reply to message #1833839] Tue, 27 October 2020 16:20 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi,

I decided to choose the first option and work with EOL parser. I have got two questions.

1. How can I delete an element or replace it with another element?
I have done something like below.

Integer elementIndex = element.getParent().getChildren().indexOf(element);
element.getParent().getChildren().set(elementIndex, statement);


But it seems as if it does not correct. Because eolModule is not changed.

2. How can I see the result of my changes as an EOL program?


Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: Using EOL source code or developing haetae [message #1833918 is a reply to message #1833913] Tue, 27 October 2020 17:55 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 Banafsheh,

Modifying getChidren() is not advisable. Instead you should modify specific properties of elements. For example, if you are modifying a ForStatement and you want to change its iterator parameter you should use forStatement.setIteratorParameter(...).

> 2. How can I see the result of my changes as an EOL program?

There are no built-in facilities for transforming EOL abstract syntax trees to text, so I'm afraid that you'd have to implement this functionality yourself.

Thanks,
Dimitris
Re: Using EOL source code or developing haetae [message #1833933 is a reply to message #1833918] Wed, 28 October 2020 09:30 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 again,

Actually, I have just added support for visitors to EOL and implemented a first version of an unparser that can convert an EolModule to EOL source code (see [1]).

The unparser has a few known limitations but hopefully, it will get better with time, and the plan is to implement similar unparsers for the rest of the Epsilon languages too.

Any contributions in the form of patches would be more than welcome!

Thanks,
Dimitris

[1] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/tests/org.eclipse.epsilon.eol.engine.test.acceptance/src/org/eclipse/epsilon/eol/engine/test/acceptance/unparser/UnparserTests.java
Re: Using EOL source code or developing haetae [message #1833949 is a reply to message #1833933] Wed, 28 October 2020 16:39 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi Dimitris,

Dimitris Kolovos wrote on Tue, 27 October 2020 17:55

Modifying getChidren() is not advisable. Instead you should modify specific properties of elements. For example, if you are modifying a ForStatement and you want to change its iterator parameter you should use forStatement.setIteratorParameter(...).

Is it possible to replace element with another element (not modifying part of it)? or remove an element? e.g., delete one of the if statements.
How can I add element without modifying getChildren()?

Dimitris Kolovos wrote on Wed, 28 October 2020 09:30

Actually, I have just added support for visitors to EOL and implemented a first version of an unparser that can convert an EolModule to EOL source code (see [1]).
[1] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/tests/org.eclipse.epsilon.eol.engine.test.acceptance/src/org/eclipse/epsilon/eol/engine/test/acceptance/unparser/UnparserTests.java

Many thanks for your support. I am trying it.

Sincerely,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Wed, 28 October 2020 18:03]

Report message to a moderator

Re: Using EOL source code or developing haetae [message #1833956 is a reply to message #1833949] Wed, 28 October 2020 19: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

Yes; for example you you could remove the first statement of an EolModule as follows:

eolModule.getMain().getStatements().remove(0);


Thanks,
Dimitris
Re: Using EOL source code or developing haetae [message #1833969 is a reply to message #1833956] Thu, 29 October 2020 06:43 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi,

Thanks a lot.

Sincerely,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: Using EOL source code or developing haetae [message #1834025 is a reply to message #1833949] Fri, 30 October 2020 13:21 Go to previous message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Banafsheh Azizi wrote on Wed, 28 October 2020 16:39

Dimitris Kolovos wrote on Wed, 28 October 2020 09:30

Actually, I have just added support for visitors to EOL and implemented a first version of an unparser that can convert an EolModule to EOL source code (see [1]).
[1] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/tests/org.eclipse.epsilon.eol.engine.test.acceptance/src/org/eclipse/epsilon/eol/engine/test/acceptance/unparser/UnparserTests.java

Many thanks for your support. I am trying it.

Hi,

I just wanted to confirm that I tried it for a simple program and it works well. Thanks again.

Sincerely,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir
Previous Topic:Automatic generation of the .diagram folder when using EuGENia
Next Topic:how to read xmi:id field in EuGENia model file?
Goto Forum:
  


Current Time: Sat Apr 20 12:35:10 GMT 2024

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

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

Back to the top