Best Practice (Scoping) - how to do that properly!

Hi Mps - Professionals,

just a simple question. In my model i have imported the* (just as example). Thus the DateTime class is available. How can i get easily and FAST a reference to the classifier. I need to construct a ClassifierType

node<ClassifierType> ct = new node<ClassifierType>
ct.classifier = SomeSpecialScopeClass.getClassifierByName("")

Best from Austria
1 comment
Comment actions Permalink
You can use quotations:
  1. Import the Language jetbrains.mps.lang.quotation (Ctrl + L)
  2. Then create a quotation by typing "<quotation>". In your case you type: "node<ClassifierType> ct = <quotation>;". It will change to "node<ClassifierType> ct = <<abstract concept>>;".
  3. Replace the concept inside the quotation with ClassifierType by typing "ClassifierType" after the first <. It will change to "node<ClassifierType> ct = <<no classifier>>;"
  4. Now specify the Classifier by typing "DateTime" after the first <. The final result will look like this: "node<ClassifierType> ct = <DateTime>;"

Please sign in to leave a comment.