Bypassing nodes during generation

Hi,

I am generating from my own custom language to baselanguage. However, I reused the EnumClass concept from baselanguage in my custom language.

During generation, I simply want to pass each EnumClass node of the input model to the output model. (In other words: I just want the generator to produce a simple copy of the enum.)

How can I do this?

Thanks!

Yann

3 comments

Hi Yann,

By default generator will copy all root nodes unaffected by root mapping rules.

You literally should do nothing to get the enums copied to the output model.

0

Hi Igor,

ok, thanks. I just tried it out and it works well.

Till now, I did not define the enum concept as root concept because I wanted to be able to edit them all in one editor. So my root concept ("EnumResource") has EnumClass children. Is there also a way to do it in this case?

Greetings

Yann

0

Yes, there is.

You can try to write a pre-processing script where you will remove enums from EnumResource and add them back to the model as root nodes.

MPS will then copy those enums to the output model, I believe.

Regards, Igor.

0

Please sign in to leave a comment.