Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Modularizing an Acceleo transformation
Modularizing an Acceleo transformation [message #729927] Tue, 27 September 2011 09:45 Go to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4154
Registered: July 2009
Senior Member
Hi

My transformation is sufficiently large that I want to partition a
number of getXXX queries into separate modules so that they can be
invoked by a hierarchical name such as XXX::getA(), YYY::getB() etc,
rather than a lexical XXX_getA(), YYY_getB().

MOFM2T appears to support this through the use of PathNameCS in the
grammar but:

[module XXX::YYY ...

is not permitted by Acceleo. Reports that module must be defined in its
own file.

[import XXX::YYY

is not permitted by Acceleo. Reports that XXX::YYY cannot be found.
Surely XXX::YYY should be resolved relative to the transformation
module? Instead Acceleo seems to find any *.mtl file in the project
regardless of its folder path, which is a tenable implementation if
qualified names are supported on the module declaration, but it would
seem better to impose the constraint that file hierarchy and module
hierarchy align.i.e [module A::B::C ...] must be in .../A/B/C.mtl and
subsequent imports resolve with respect to .../, possibly extended by a
module path of additional roots.

XXX::YYY() invocation

of course fails with an unknown type since the module/import do not
support the declaration of the path scopes.

Is there any way to use hierarchical names in Acceleo?

Regards

Ed Willink
Re: Modularizing an Acceleo transformation [message #730024 is a reply to message #729927] Tue, 27 September 2011 14:09 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 413
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

[import XXX::YYY
is not permitted by Acceleo. Reports that XXX::YYY cannot be found. 


It is permitted and it is the recommended way(C. 8.) to realize an import. You can see an example here.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo



Re: Modularizing an Acceleo transformation [message #730085 is a reply to message #730024] Tue, 27 September 2011 15:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4154
Registered: July 2009
Senior Member
Hi Stephane

Thanks. It seems to work perfectly; just need to observe the reasonable
restriction of starting paths at the classpath root.

A properly qualified import just like Java is so much more professional
that perhaps you should make the unqualified form a warning. Perhaps an
error because without qualification, refactoring to rename one of a two
same-named pair of modules in independent plugins can have miraculous
side effects ignoring classpath visibilities.

It would be really good if the Acceleo documentation had a Language
Statements reference section that defined the above and described
Acceleo from the Concrete Syntax point of view. The MOFM2T spec
concentrates only on the Abstract Syntax.

Regards

Ed Willink


On 27/09/2011 15:09, Stephane Begaudeau wrote:
> Hi,
>
> [import XXX::YYY
> is not permitted by Acceleo. Reports that XXX::YYY cannot be found.
> It is permitted and it is the
> http://www.obeonetwork.com/page/acceleo-best-practices(C. 8.) to
> realize an import. You can see an example
> https://github.com/ObeoNetwork/UML-Java-Generation/blob/master/plugins/org.obeonetwork.pim.uml2.gen.java/src/org/obeonetwork/pim/uml2/gen/java/main/workflow.mtl.
>
> Regards,
>
> Stephane Begaudeau, Obeo
>
> --
> Twitter: http://twitter.com/#!/sbegaudeau
> Google+: http://www.google.com/profiles/stephane.begaudeau
> Blog: http://stephanebegaudeau.tumblr.com
> Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: Modularizing an Acceleo transformation [message #730793 is a reply to message #730085] Thu, 29 September 2011 07:40 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1638
Registered: July 2009
Senior Member
Ed,

The unqualified form for imports is a legacy of the first versions of Acceleo 3... we kept it in when we added the qualified form in order not to break existing modules. However warning the users that this is not the recommended form is probably something we should do. Could you raise a bug to track this?

As for a "concrete syntax" reference for the Acceleo language, yes, that too would be interesting to have... as would an up-to-date, typo-free documentation in general :s.

Laurent Goubet
Obeo
Re: Modularizing an Acceleo transformation [message #730875 is a reply to message #730793] Thu, 29 September 2011 12:24 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4154
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=359411

On 29/09/2011 08:40, Laurent Goubet wrote:
> Ed,
>
> The unqualified form for imports is a legacy of the first versions of
> Acceleo 3... we kept it in when we added the qualified form in order
> not to break existing modules. However warning the users that this is
> not the recommended form is probably something we should do. Could you
> raise a bug to track this?
>
> As for a "concrete syntax" reference for the Acceleo language, yes,
> that too would be interesting to have... as would an up-to-date,
> typo-free documentation in general :s.
>
> Laurent Goubet
> Obeo
Previous Topic:Out of Order text generation
Next Topic:[Acceleo 3.1] Metamodel loading issues
Goto Forum:
  


Current Time: Fri Nov 28 04:46:45 GMT 2014

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

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