Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] expand in a dynamic binding manner
[Xpand] expand in a dynamic binding manner [message #643538] Tue, 07 December 2010 05:23 Go to next message
Stefan Jurack is currently offline Stefan Jurack
Messages: 24
Registered: February 2010
Junior Member
Hi again,

is there a way to specify an EXPAND and let it related to different DEFINE sections due to dynamic binding? Consider the following grammar rule:

WebPage: 'page' name=ID '{' contents+=AbstractContent* '}';
AbstractContent: (Chapter | Image | Paragraph); ...etc.

I would like to do simething like:

«EXPAND content FOREACH this.contents»
«DEFINE content FOR Chapter» ... «ENDDEFINE»
«DEFINE content FOR Image» ... «ENDDEFINE»
«DEFINE content FOR Paragraph» ... «ENDDEFINE»

An alternative but quite ugly way is to check "this.eClass().name" on a content entry and to redirect to a certain DEFINE.

Thanks in advance,
Stefan
Re: [Xpand] expand in a dynamic binding manner [message #643543 is a reply to message #643538] Tue, 07 December 2010 05:46 Go to previous message
Stefan Jurack is currently offline Stefan Jurack
Messages: 24
Registered: February 2010
Junior Member
Well, this seems to be implemented already. However, you have to have a (useless) rule for the "abstract rule" as well:

«DEFINE content FOR AbstractContent»
«ENDDEFINE»

With this, it is working!

greetx, Stefan
Previous Topic:Acceleo 3.x - reset generate module problem
Next Topic:[Acceleo] Debugging problems with propertys
Goto Forum:
  


Current Time: Sat Apr 19 18:43:38 EDT 2014

Powered by FUDForum. Page generated in 0.04206 seconds