Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » ETL file structure
ETL file structure [message #1768906] Mon, 24 July 2017 19:14 Go to next message
Jens VdP is currently offline Jens VdPFriend
Messages: 2
Registered: July 2017
Junior Member
Hi

I'm working on an application to find patterns in .etl files. Therefore I have to get a kind of AST of the file, or any other means to explore the file in a structural manner. However, I cannot find an easy way to do this.

When reading an .etl file, I use the EtlModule class to represent it internally. But, it seems that there is no way to get an AST out of the EtlModule, or any other representation that would let me explore the structure of the file easily. Do you know how this can be done? I know how to extract the transformation rules etc. out of the EtlModule, but this is as far as I get. I need to be able to explore the structure of the .etl file and its transformations.

Thanks in advance for your reply.

Best regards
Jens
Re: ETL file structure [message #1768988 is a reply to message #1768906] Tue, 25 July 2017 13:11 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 Jens,

Starting from a transformation rule you can drill down to its source/target parameters, its body etc. e.g. rule.getBody().getBody().getStatements() will return all the statements of the body of the rule.

Cheers,
Dimitris
Re: ETL file structure [message #1769016 is a reply to message #1768988] Tue, 25 July 2017 16:59 Go to previous messageGo to next message
Jens VdP is currently offline Jens VdPFriend
Messages: 2
Registered: July 2017
Junior Member
Dimitris

Thanks for your reply. However, since I am interested in the detailed representation of the .etl files, for me I think the solution is to go back to version 1.3 and use the getAst() method. Also, when trying your solution, I could not get held of the final getStatements() method you mention. This method is also not listed in the online API documentation.

Best regards
Jens
Re: ETL file structure [message #1769084 is a reply to message #1769016] Wed, 26 July 2017 11:43 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

The code below works fine with the latest interim version of Epsilon. In principle you should be able to access all information in an ETL module in this way and should not have to go back to 1.3.

public static void main(String[] args) throws Exception {
  EtlModule module = new EtlModule();
  module.parse("rule A transform b : B to c : C { f1(); f2(); }");
  System.out.println(((StatementBlock) module.getTransformationRules().
    get(0).getBody().getBody()).getStatements().size());
}


Cheers,
Dimitris
Previous Topic:ETL standalone problem
Next Topic:changing the model locally
Goto Forum:
  


Current Time: Thu Apr 25 10:42:21 GMT 2024

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

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

Back to the top