java2kdm.atl [message #1769573] |
Tue, 01 August 2017 14:12  |
Eclipse User |
|
|
|
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()
)}
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04526 seconds