java2kdm.atl [message #1769573] |
Tue, 01 August 2017 18:12 |
Guisella Angulo Messages: 17 Registered: September 2016 |
Junior Member |
|
|
Hi,
In the ATL 'java2kdm.atl' for transformation JAVA in KDM Model, I do not understand the transformation rule 'InfixExpressionToActionElement'.
In the rule, the java's elements leftOperand e rightOperand of type "Expression" are transforms in 'CodeElements' through the helper 'filterExpression'. However, the type 'Expression' can be 'SingleVariableAccess' that are discarded in the helper.
As a consequence if the Java Model has a 'java: InfixExpression' (+) e nested has a rightOperand of type 'SingleVariableAccess' and a leftOperand of type 'NumberLiteral', only the 'NumberLiteral' will be displayed in the Model KDM.
The information are lost? it's correct?
Thanks!
rule InfixExpressionToActionElement extends ASTNodeToAbstractCodeElement {
from
src: java!InfixExpression
to
tgt: kdm!ActionElement (
kind <- 'infix expression',
name <- src.operator.toString() ,
codeElement <- thisModule -> filterExpression(src.leftOperand),
codeElement <- thisModule -> filterExpression(src.rightOperand),
codeElement <- src.extendedOperands -> collect(e | thisModule ->
filterExpression(e)) -> flatten()
)}
|
|
|
|
|
|
|
Re: java2kdm.atl [message #1774851 is a reply to message #1774682] |
Fri, 20 October 2017 14:08 |
Hugo Bruneliere Messages: 674 Registered: July 2009 |
Senior Member |
|
|
Thanks, we are going to look to this.
--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
|
|
|
Powered by
FUDForum. Page generated in 0.03457 seconds