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

Hi Mps - Professionals,

just a simple question. In my model i have imported the joda.org.* (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("joda.org.DateTime")

Best from Austria
Dan
1 comment
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>;"
0

Please sign in to leave a comment.