Search code examples
mps

SWITCH macro's initValue


In a template, I want to use a $SWITCH$ macro. It requires me to specify an <initValue>:

enter image description here

What's the role of this <initValue>? What should/can I pass in as <initValue>? Note that no autocomplete suggestions appear on Ctrl+Space.

Below is the Inspector of the macro:

enter image description here


Solution

  • <initValue> is the editor of the template node which will be replaced in the process of the generation. The SWITCH specifies how it will be replaced. In case of the SWITCH has the <ignore switch> as the default and there are no matches in the SWITCH, the template node will stay in the output model.

    Modifying the template node is a bit tricky, the best option is to remove the SWITCH macro, modify the node (e.g. with the auto-completion) and then add the SWITCH macro back