|
Re: [QVTO] AST and Pretty Printing [message #555659 is a reply to message #555635] |
Fri, 27 August 2010 13:46 |
Eclipse User |
|
|
|
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?
|
|
|
Powered by
FUDForum. Page generated in 0.03285 seconds