Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Reading text file in EOL/EGL(Generating code with complete method bodies.)
Reading text file in EOL/EGL [message #1791739] Wed, 04 July 2018 15:23 Go to next message
Rachel Howard is currently offline Rachel HowardFriend
Messages: 2
Registered: July 2018
Junior Member
I have only recently started looking into model driven code generation. I have made UML diagrams in papyrus from which, using EGL and EGX, I have created basic java code structures.
Does anyone know of a way for the code to be generated with method bodies obtained from other files? txt, java, eol or other?
I want to keep generated code and manually written code as separate as possible to make model extension and regeneration as easy as possible.

A java-read-file-esq function in the EGL file would be perfect.

snippet of EGL code:
[% for(anOperation in allOperations){ %]
[%=anOperation.visibility%] static void [%=anOperation.name%](){
System.out.println("In generated code, looking for manually enter body.");
[*read file and print body here *]
}
[% }%]

Re: Reading text file in EOL/EGL [message #1791913 is a reply to message #1791739] Fri, 06 July 2018 20: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 Rachel,

There are several strategies for integrating hand-written with auto-generated code and [1] provides an overview of some of them. For EGL, you may want to have a look at "protected regions" in the book.

Cheers,
Dimitris

[1] http://www.se-rwth.de/publications/A-Comparison-of-Mechanisms-for-Integrating-Handwritten-and-Generated-Code-for-Object-Oriented-Programming-Languages.pdf
Re: Reading text file in EOL/EGL [message #1791983 is a reply to message #1791913] Mon, 09 July 2018 09:53 Go to previous message
Rachel Howard is currently offline Rachel HowardFriend
Messages: 2
Registered: July 2018
Junior Member
Thank-you
Previous Topic:replace object without
Next Topic:Accessing OSGi component instance
Goto Forum:
  


Current Time: Fri Apr 26 17:30:26 GMT 2024

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

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

Back to the top