Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Tranformation Question ( KDM Model to JAVA Model)
Tranformation Question ( KDM Model to JAVA Model) [message #1748854] Tue, 29 November 2016 11:11 Go to next message
Guisella Angulo is currently offline Guisella AnguloFriend
Messages: 10
Registered: September 2016
Junior Member
Good Morning Very Happy,
I would like to know, why I can do this (Transformation JAVA model to KDM Model):

abstract rule ASTNodeToAbstractCodeElement {
from
src: java!ASTNode
to
tgt: kdm!AbstractCodeElement (

-- Code
)
}
and I can't do the follow Transformation (KDM to JAVA):

abstract rule ASTNodeToAbstractCodeElement {
from
tgt: kdm!AbstractCodeElement
to
src: java!ASTNode (

-- Code
)

}

Thanks in advance!

[Updated on: Tue, 29 November 2016 11:12]

Report message to a moderator

Re: Tranformation Question ( KDM Model to JAVA Model) [message #1748920 is a reply to message #1748854] Wed, 30 November 2016 07:56 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 357
Registered: September 2012
Location: Belgium
Senior Member

You cannot do that in the same transformation, because the target model may not be read. You can do it in a separate reverse transformation, though.

Cheers,
Dennis
Re: Tranformation Question ( KDM Model to JAVA Model) [message #1749005 is a reply to message #1748920] Thu, 01 December 2016 02:52 Go to previous messageGo to next message
Guisella Angulo is currently offline Guisella AnguloFriend
Messages: 10
Registered: September 2016
Junior Member
I try to do this in other transformation but I can't
Re: Tranformation Question ( KDM Model to JAVA Model) [message #1749028 is a reply to message #1749005] Thu, 01 December 2016 09:43 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 357
Registered: September 2012
Location: Belgium
Senior Member

Ok, please post your transformation module headers (module...create...from...), as well as the exact error you get.

Cheers,
Dennis
Re: Tranformation Question ( KDM Model to JAVA Model) [message #1749424 is a reply to message #1749028] Tue, 06 December 2016 14:47 Go to previous messageGo to next message
Guisella Angulo is currently offline Guisella AnguloFriend
Messages: 10
Registered: September 2016
Junior Member
module Projeto_KDM2JAVA_ATL;
create OUT: JAVA from IN: KDM;

abstract rule AbstractCodeElementToASTNode {
from
source : KDM!AbstractCodeElement
to
target : JAVA!ASTNode(
comment <- source.comments
)
}
error: org.eclipse.m2m.atl.engine.emfvm.VMException: The class 'ASTNode' is not a valid classifier
Caused by: java.lang.IllegalArgumentException: The class 'ASTNode' is not a valid classifier

Thanks, Obrigada, Gracias! Very Happy
Re: Tranformation Question ( KDM Model to JAVA Model) [message #1751011 is a reply to message #1749424] Tue, 03 January 2017 16:22 Go to previous message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 357
Registered: September 2012
Location: Belgium
Senior Member

The KDM metamodel is spread over many ecore files. In which file can I find the ASTNode metaclass?

EDIT: sorry, ASTNode is not mentioned for KDM, but for the JAVA metamodel only. The JAVA metamodel (http://www.eclipse.org/MoDisco/Java/0.2.incubation/java) does have an abstract EClass ASTNode, which should work for abstract rules. Can you also indicate which concrete rules inherit from AbstractCodeElementToASTNode? These concrete rules should all specify a concrete subclass of ASTNode...


Cheers,
Dennis

[Updated on: Tue, 03 January 2017 16:25]

Report message to a moderator

Previous Topic:Cross-references in EMFTVM VM standalone
Next Topic:KDM Model - Identify variable to return
Goto Forum:
  


Current Time: Mon Apr 23 21:39:36 GMT 2018

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

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