Search code examples
mps

MPS Template use of parameter


In MPS I have defined a template:

template reduce_Car
Input Car

parameters
color : String

<TF [<Car>???</Car>] TF>

Now I wanted to use the defined parameter "color" in my template?


Solution

  • You access parameters through genContext. So wrap the text to replace with a property macro

    <TF [<Car>$[red]</Car>] TF>

    and down in the Inspector for the property macro access the parameter as 'genContext.color'