Hi Sebastien,
--> ConditionalUnits have
either two or three sub-units: if, then,
(and else).
If a match for the if unit
can be found, the then unit
is executed. Otherwise, if present, the else unit
is executed. Note that any changes specified in the if unit
are ignored; it is used for matching only.
In your case, I think the engine should be smart enough to
convert a string into an enum. Then you would just use one
rule. The rule needs to have a parameter called, say, "w" that
is used to store the word size. In your Platform node, create
an attribute
wordSize = w
This will store the value of the wordSize attribute in the
w-parameter. In the MyNewPlatform node, you also add the
wordSize attribute. If this node is created by the rule, set
the attribute to
wordSize = "_" + w
If the MyNewPlatform node is not created by the rule (it is
matched) then you need to set the attribute to
wordSize = ? -> "_" + w
This means that the wordSize attribute is not matched by
the LHS, but it is modified in the RHS of the rule.
The engine should automatically convert the string "_" + w
into the corresponding enum literal.
Cheers,
Christian