Esempio n. 1
0
 private void createAttribute(SNode decl, ClassInfo.MyAttribute att) {
   SNode attrDecl =
       Generator.GENERATOR.createAttributeDeclaration(
           att.getName(), Generator.Builder.getType(att.getType()));
   SPropertyOperations.set(attrDecl, "deprecated", "" + (att.isDeprecated()));
   this.addEnum(attrDecl, att.getEnumValues());
   ListSequence.fromList(SLinkOperations.getTargets(decl, "attributesDecl", true))
       .addElement(attrDecl);
 }
Esempio n. 2
0
 private void updateAttribute(SNode ad, ClassInfo.MyAttribute att) {
   SLinkOperations.setTarget(
       ad, "attributeType", Generator.Builder.getType(att.getType()), true);
   if (att.getEnumValues() != null) {
     SNode anEnum = SLinkOperations.getTarget(ad, "enum", true);
     if ((anEnum != null)
         && (SNodeOperations.isInstanceOf(
             anEnum, "jetbrains.mps.buildlanguage.structure.StringEnum"))) {
       this.updateEnum(
           SNodeOperations.cast(anEnum, "jetbrains.mps.buildlanguage.structure.StringEnum"),
           att.getEnumValues());
     } else {
       this.addEnum(ad, att.getEnumValues());
     }
   }
   if (!(AttributeDeclaration_Behavior.call_isDeprecated_353793545802643819(ad))
       && att.isDeprecated()) {
     SPropertyOperations.set(ad, "deprecated", "" + (att.isDeprecated()));
   }
 }