1

私は JetBrains MPS Shapes チュートリアルに従っています: https://confluence.jetbrains.com/display/MPSD32/Shapes+-+an+introductory+MPS+tutorial

チュートリアルのセクション「正方形のより堅牢な生成」には、次の定義があります。

template reduce_Square                                                                                          
input Square                                                                                                    

parameters                                                                                                      
<< ... >>                                                                                                       

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

また、g の参照マクロ (カーソルを ->$g に置くと、エディターのインスペクター部分で確認できます) は次のとおりです。

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

}

それでも、「Shapes」言語を再構築しようとすると、次のエラー メッセージが表示されます (4 回、それぞれに 2 回 ->$g)。

type node<> is not a subtype of node<VariableDeclaration>
4

1 に答える 1