Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] AST and Pretty Printing
[QVTO] AST and Pretty Printing [message #555635] Fri, 27 August 2010 13:12 Go to next message
Al  is currently offline Al Friend
Messages: 8
Registered: August 2010
Junior Member
Hi,

How can I obtain the AST of a given .qvto file in order to process it with QVTO itself? I figured out how to extract the concrete syntax using the internal Parser, but couldn't quite find out how to do it for AST.


Also, how can I pretty print EMF AST or CST back to QVT code?
Re: [QVTO] AST and Pretty Printing [message #555659 is a reply to message #555635] Fri, 27 August 2010 13:46 Go to previous message
Eclipse UserFriend
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl

Hi Al,

using this transformation:

modeltype mm_qvto "strict" uses 
'http://www.eclipse.org/QVT/1.0.0/Operational';

transformation qvtocopy(in inModel : mm_qvto, out outModel : mm_qvto);

main() {
     log("in rootObjects=", inModel.rootObjects());
 
inModel.rootObjects()[qvtoperational::expressions::OperationalTransformation]->xmap 
trans();
     log("out rootObjects=", outModel.rootObjects());
}

mapping qvtoperational::expressions::OperationalTransformation::trans()
       : qvtoperational::expressions::OperationalTransformation
{
     init {
         log("Mapping...");
         result := 
self.deepclone().oclAsType(qvtoperational::expressions::OperationalTransformation);
    }
}


and as input some .qvto file, and as output a .xmi file. The input .qvto
text file is automatically parsed, so that it can be used as an input
resource for the transformation. I got an XMI file as output with some
QVTo AST in there, so it seemed. Not sure about pretty printing back to
code. Using .qvto as output file did not result in an output file at all...

I think it should be possible to transform QVTo transformations using
QVTo, as QVTo itself is based on a metamodel...

Dennis


Al wrote:
> Hi,
> How can I obtain the AST of a given .qvto file in order to process it
> with QVTO itself? I figured out how to extract the concrete syntax using
> the internal Parser, but couldn't quite find out how to do it for AST.
>
> Also, how can I pretty print EMF AST or CST back to QVT code?
Previous Topic:[QVTo] mapping operation not executed
Next Topic:Batch transformation
Goto Forum:
  


Current Time: Sat Dec 20 00:18:48 GMT 2014

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

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