Bypassing nodes during generation


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?



Comment actions Permalink

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.

Comment actions Permalink

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?



Comment actions Permalink

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.


Please sign in to leave a comment.