|
Re: QVT - how to programatically retrieve the model(AST) from the transformation script [message #500699 is a reply to message #500685] |
Fri, 27 November 2009 15:03 |
Eclipse User |
|
|
|
Originally posted by: dvorak.radek.gmail.com
Hi Dana,
You can do it just like this,
EList<EObject> contents = new ResourceSetImpl().getResource(uri,
true).getContents();
OperationalTransformation transf =
(OperationalTransformation)contents.get(0);
ModelType modelType =
(ModelType)transf.getModelParameter().get(0).getType();
EPackage usedMetamodel = modelType.getMetamodel().get(0);
Well, code a little bit more defensive then me ;).
Note, the AST classes are still from internal packages, though the AST
metamodel structure is pretty stable. It will be open, but can't say when
we have higher prio tasks at the moment.
Regards,
/Radek
On Fri, 27 Nov 2009 15:09:45 +0100, Dana Wong <dana.wong@bmw-carit.de>
wrote:
> Hello
>
> Is it possible to programatically retrieve the abstract syntax tree of
> the QVT Transformation script?
>
> This is my use case:
> My QVT script transforms only a subset of the elements from the input
> model. I was hoping to analyse the model behind the qvt script so that I
> can determine which elements can and cannot be transformed from the
> input model . The input model elements that could not be transformed
> will then be written to a separate file.
>
> Thanks for your help.
>
> Thank you,
> Dana
|
|
|
Powered by
FUDForum. Page generated in 0.04487 seconds