1

I've been following the JetBrains MPS Shapes tutorial: https://confluence.jetbrains.com/display/MPSD32/Shapes+-+an+introductory+MPS+tutorial

In the tutorial section "A more robust generation for Squares" there is the following definition:

template reduce_Square                                                                                          
input Square                                                                                                    

parameters                                                                                                      
<< ... >>                                                                                                       

content node:                                                                                                   
   { 
      Graphics g = null; 
      <TF { 
          ->$g.setColor(Color.->$red); 
          ->$g.drawRect($10, $10, $10, $10); 
       } TF> 
    }

And the reference macro for g (which you can see in the Inspector part of the editor if you put the cursor at ->$g) is:

(outputNode, genContext, operationContext, node)->join(node<VariableDeclaration> | string) { 
  genContext.get output graphicParam for (node.parent : Canvas); 

}

Yet when trying to rebuild the "Shapes" language I get the following error message (4 times, twice for each ->$g):

type node<> is not a subtype of node<VariableDeclaration>
Dan789
  • 81
  • 4

1 Answers1

0

Could you please check that you specify the from and to concepts for the mapping label correctly? It should be "label graphicsParam : Canvas -> ParameterDeclaration", as specified in the tutorial.

Vaclav Pech
  • 1,431
  • 8
  • 6