예제 #1
0
  private static String asString(MappingConfig_AbstractRef mappingRef, boolean moreDetails) {
    if (mappingRef instanceof MappingConfig_RefAllLocal) {
      return "*";
    }
    if (mappingRef instanceof MappingConfig_RefAllGlobal) {
      return "[*:*]";
    }

    if (mappingRef instanceof MappingConfig_RefSet) {
      String s = "{";
      int count = ((MappingConfig_RefSet) mappingRef).getMappingConfigs().size();
      for (MappingConfig_AbstractRef mappingSimpleRef :
          ((MappingConfig_RefSet) mappingRef).getMappingConfigs()) {
        count--;
        s = s + asString(mappingSimpleRef, moreDetails);
        if (count > 0) s += ", ";
      }
      return s + "}";
    }

    if (mappingRef instanceof MappingConfig_SimpleRef) {
      final String modelUID = ((MappingConfig_SimpleRef) mappingRef).getModelUID();
      final String nodeID = ((MappingConfig_SimpleRef) mappingRef).getNodeID();
      final SModelReference modelReference =
          PersistenceFacade.getInstance().createModelReference(modelUID);
      String modelName =
          moreDetails
              ? SModelStereotype.withoutStereotype(modelReference.getModelName())
              : NameUtil.shortNameFromLongName(
                  SModelStereotype.withoutStereotype(modelReference.getModelName()));
      StringBuilder sb = new StringBuilder();
      sb.append(modelName);
      sb.append('.');
      if (nodeID.equals("*")) {
        return sb.append('*').toString();
      } else {
        SModel refModel = SModelRepository.getInstance().getModelDescriptor(modelReference);
        if (refModel != null) {
          SNodeId nodeId = PersistenceFacade.getInstance().createNodeId(nodeID);
          assert nodeId != null : "wrong node id string";
          SNode mappingConfig = refModel.getNode(nodeId);
          if (mappingConfig != null) {
            return sb.append(mappingConfig.getName()).toString();
          }
        }
      }
      return sb.append(nodeID).append("!unresolved!").toString();
    }

    if (mappingRef instanceof MappingConfig_ExternalRef) {
      SModuleReference generatorRef = ((MappingConfig_ExternalRef) mappingRef).getGenerator();
      MappingConfig_AbstractRef extMappingRef =
          ((MappingConfig_ExternalRef) mappingRef).getMappingConfig();
      return "[" + asString(generatorRef) + ":" + asString(extMappingRef, moreDetails) + "]";
    }

    return "???";
  }
예제 #2
0
 protected SNode applyPart0(@NotNull final TemplateContext context) throws GenerationException {
   final TemplateExecutionEnvironment environment = context.getEnvironment();
   final SNode tnode1 =
       environment.createOutputNode(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0xfc37588bc8L,
               "jetbrains.mps.baseLanguage.structure.EnumConstantReference"));
   try {
     environment.nodeCopied(
         context, tnode1, "tpl/r:3ab3501c-2f4b-48e6-9b6c-e31ff8ef3185/3308300503039683834");
     tnode1.setReference(
         MetaAdapterFactory.getReferenceLink(
             0xf3061a5392264cc5L,
             0xa443f952ceaf5816L,
             0xfc37588bc8L,
             0xfc37588bcaL,
             "enumConstantDeclaration"),
         SReference.create(
             MetaAdapterFactory.getReferenceLink(
                 0xf3061a5392264cc5L,
                 0xa443f952ceaf5816L,
                 0xfc37588bc8L,
                 0xfc37588bcaL,
                 "enumConstantDeclaration"),
             tnode1,
             PersistenceFacade.getInstance()
                 .createModelReference("r:f5e9b11f-5073-4786-8ed1-a9e42307c3f8(JavaKaja.runtime)"),
             PersistenceFacade.getInstance().createNodeId("3308300503039569144")));
     tnode1.setReference(
         MetaAdapterFactory.getReferenceLink(
             0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfc37588bc8L, 0x10a758428feL, "enumClass"),
         SReference.create(
             MetaAdapterFactory.getReferenceLink(
                 0xf3061a5392264cc5L,
                 0xa443f952ceaf5816L,
                 0xfc37588bc8L,
                 0x10a758428feL,
                 "enumClass"),
             tnode1,
             PersistenceFacade.getInstance()
                 .createModelReference("r:f5e9b11f-5073-4786-8ed1-a9e42307c3f8(JavaKaja.runtime)"),
             PersistenceFacade.getInstance().createNodeId("3308300503039569134")));
   } finally {
   }
   return tnode1;
 }
 @Nullable
 @Override
 public SNodeReference getScriptNode() {
   return PersistenceFacade.getInstance()
       .createNodeReference(
           "r:00000000-0000-4000-0000-011c895902c9(jetbrains.mps.baseLanguage.scripts)/8355037393080348187");
 }
 private static SNode _quotation_createNode_icy1a5_a0a2a1(Object parameter_1, Object parameter_2) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_3 = null;
   SNode quotedNode_4 = null;
   SNode quotedNode_5 = null;
   quotedNode_3 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x8388864671ce4f1cL,
               0x9c53c54016f6ad4fL,
               0x120c2ad6432L,
               "jetbrains.mps.baseLanguage.collections.structure.LinkedHashMapCreator"),
           null,
           null,
           false);
   quotedNode_4 = (SNode) parameter_1;
   if (quotedNode_4 != null) {
     quotedNode_3.addChild(
         MetaAdapterFactory.getContainmentLink(
             0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x116dbb34f2dL, 0x116dbb5b4d0L, "keyType"),
         HUtil.copyIfNecessary(quotedNode_4));
   }
   quotedNode_5 = (SNode) parameter_2;
   if (quotedNode_5 != null) {
     quotedNode_3.addChild(
         MetaAdapterFactory.getContainmentLink(
             0x8388864671ce4f1cL,
             0x9c53c54016f6ad4fL,
             0x116dbb34f2dL,
             0x116dbb5d76dL,
             "valueType"),
         HUtil.copyIfNecessary(quotedNode_5));
   }
   return quotedNode_3;
 }
 private static SNode _quotation_createNode_qal9w4_a0a0a3() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "498d89d2-c2e9-11e2-ad49-6cf049e62fe5/java:com.intellij.execution(MPS.IDEA/)"),
           facade.createNodeId("~ExecutionException")));
   return quotedNode_1;
 }
예제 #6
0
 private static SNode _quotation_createNode_rsqk7y_a0a0(Object parameter_1) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_2 = null;
   SNode quotedNode_3 = null;
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x8388864671ce4f1cL,
               0x9c53c54016f6ad4fL,
               0x2e9a0b9a890137e9L,
               "jetbrains.mps.baseLanguage.collections.structure.LinkedListType"),
           null,
           null,
           false);
   quotedNode_3 = (SNode) parameter_1;
   if (quotedNode_3 != null) {
     quotedNode_2.addChild(
         MetaAdapterFactory.getContainmentLink(
             0x8388864671ce4f1cL,
             0x9c53c54016f6ad4fL,
             0x10c25fb076aL,
             0x10c25fe95c5L,
             "elementType"),
         HUtil.copyIfNecessary(quotedNode_3));
   }
   return quotedNode_2;
 }
 private static SNode _quotation_createNode_baxqxe_a0a0a2(Object parameter_1) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_2 = null;
   SNode quotedNode_3 = null;
   SNode quotedNode_4 = null;
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.DotExpression",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   quotedNode_3 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.ThisExpression",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   quotedNode_2.addChild("operand", quotedNode_3);
   quotedNode_4 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.FieldReferenceOperation",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   SNodeAccessUtil.setReferenceTarget(quotedNode_4, "fieldDeclaration", (SNode) parameter_1);
   quotedNode_2.addChild("operation", quotedNode_4);
   return quotedNode_2;
 }
 private static SNode _quotation_createNode_fj2vg7_a1a0a0a7a1() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xed6d7656532c4bc2L,
               0x81d1af945aeb8280L,
               0x10de9cbf8e8L,
               "jetbrains.mps.baseLanguage.blTypes.structure.PrimitiveTypeRef"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xed6d7656532c4bc2L, 0x81d1af945aeb8280L, 0x10de9cbf8e8L, 0x10de9cbf8e7L, "descriptor"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xed6d7656532c4bc2L,
               0x81d1af945aeb8280L,
               0x10de9cbf8e8L,
               0x10de9cbf8e7L,
               "descriptor"),
           quotedNode_1,
           facade.createModelReference(
               "r:00000000-0000-4000-0000-011c895902de(jetbrains.mps.baseLanguage.blTypes.primitiveDescriptors)"),
           facade.createNodeId("1196683941620")));
   return quotedNode_1;
 }
 private static SNode _quotation_createNode_mrte6h_a0a0() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "742f6602-5a2f-4313-aa6e-ae1cd4ffdc61/java:jetbrains.mps.project(MPS.Platform/)"),
           facade.createNodeId("~MPSProject")));
   return quotedNode_1;
 }
 private static SNode _quotation_createNode_1lf6x4_a0a0b() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "1ed103c3-3aa6-49b7-9c21-6765ee11f224/java:jetbrains.mps.nodeEditor(MPS.Editor/)"),
           facade.createNodeId("~EditorComponent")));
   return quotedNode_1;
 }
예제 #11
0
  @Override
  public void rename(String newModelName, boolean changeFile) {
    assertCanChange();

    SModelReference oldName = getReference();
    fireBeforeModelRenamed(new SModelRenamedEvent(this, oldName.getModelName(), newModelName));

    // TODO update SModelId (if it contains modelName)
    // if(getReference().getModelId().getModelName() != null) { }
    SModelReference newModelReference =
        PersistenceFacade.getInstance()
            .createModelReference(
                getReference().getModuleReference(), getReference().getModelId(), newModelName);

    fireBeforeModelRenamed(newModelReference);
    changeModelReference(newModelReference);

    if (!changeFile) {
      save();
    } else {
      if (changeFile && !(getSource() instanceof FileDataSource)) {
        throw new UnsupportedOperationException("cannot change model file on non-file data source");
      }

      IFile oldFile = ((FileDataSource) getSource()).getFile();
      ModelRoot root = ModelRootUtil.getModelRoot(this);
      if (root instanceof DefaultModelRoot) {
        DefaultModelRoot defaultModelRoot = (DefaultModelRoot) root;
        String sourceRoot = null;
        for (String sr : defaultModelRoot.getFiles(FileBasedModelRoot.SOURCE_ROOTS)) {
          if (oldFile.getPath().startsWith(sr)) {
            // using the same sourceRoot
            sourceRoot = sr;
            break;
          }
        }
        try {
          IFile newFile =
              defaultModelRoot
                  .createSource(
                      newModelName,
                      FileUtil.getExtension(oldFile.getName()),
                      sourceRoot,
                      new HashMap<String, String>())
                  .getFile();
          newFile.getParent().mkdirs();
          newFile.createNewFile();
          changeModelFile(newFile);
          save();
          oldFile.delete();
        } catch (IOException e) {
          LOG.error("cannot rename " + getModelName() + ": " + e.getMessage());
          save();
        }
      }
    }

    fireModelRenamed(new SModelRenamedEvent(this, oldName.getModelName(), newModelName));
    fireModelRenamed(oldName);
  }
예제 #12
0
 public static DefaultCellInfo loadFrom(Element e) {
   String cellId;
   int cellNumber;
   boolean isInList;
   final String nodeReference;
   DefaultCellInfo parentInfo = null;
   cellId = e.getAttributeValue(CELL_ID);
   String num = e.getAttributeValue(CELL_NUMBER);
   if (num == null) return null;
   try {
     cellNumber = Integer.parseInt(num);
   } catch (NumberFormatException ex) {
     return null;
   }
   isInList = "true".equals(e.getAttributeValue(IS_IN_LIST));
   Element nodeElem = e.getChild(NODE);
   if (nodeElem == null) return null;
   nodeReference = nodeElem.getAttributeValue(NODE_REFERENCE);
   if (nodeReference == null) return null;
   Element parentElem = e.getChild(PARENT);
   if (parentElem != null) {
     parentInfo = loadFrom(parentElem);
     if (parentInfo == null) return null;
   }
   final DefaultCellInfo result = new DefaultCellInfo();
   result.myNodeReference = PersistenceFacade.getInstance().createNodeReference(nodeReference);
   result.myCellId = cellId;
   result.myParentInfo = parentInfo;
   result.myIsInList = isInList;
   result.myCellNumber = cellNumber;
   return result;
 }
 private static SNode _quotation_createNode_exju2j_a0a1() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "r:b60215f1-3d3e-41cc-8321-723ef8eb59dd(jetbrains.mps.lang.editor.table.runtime)"),
           facade.createNodeId("4490468428501048480")));
   return quotedNode_1;
 }
 private static SNode _quotation_createNode_yti4yq_a0a0a8a1a0a(
     Object parameter_1, Object parameter_2) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_3 = null;
   SNode quotedNode_4 = null;
   SNode quotedNode_5 = null;
   SNode quotedNode_6 = null;
   quotedNode_3 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration", null, null, false);
   SNodeAccessUtil.setProperty(quotedNode_3, "isAbstract", "true");
   SNodeAccessUtil.setProperty(quotedNode_3, "name", (String) parameter_1);
   quotedNode_4 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.PublicVisibility", null, null, false);
   quotedNode_3.addChild("visibility", quotedNode_4);
   quotedNode_5 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.StatementList", null, null, false);
   quotedNode_3.addChild("body", quotedNode_5);
   quotedNode_6 = (SNode) parameter_2;
   if (quotedNode_6 != null) {
     quotedNode_3.addChild("returnType", HUtil.copyIfNecessary(quotedNode_6));
   }
   return quotedNode_3;
 }
 private static SNode _quotation_createNode_mxwyp3_a0a8a0(Object parameter_1) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_2 = null;
   SNode quotedNode_3 = null;
   SNode quotedNode_4 = null;
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.lang.typesystem.structure.JoinType",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   quotedNode_3 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.lang.smodel.structure.SNodeType",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   SNodeAccessUtil.setReferenceTarget(quotedNode_3, "concept", (SNode) parameter_1);
   quotedNode_2.addChild("argument", quotedNode_3);
   quotedNode_4 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.StringType",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   quotedNode_2.addChild("argument", quotedNode_4);
   return quotedNode_2;
 }
예제 #16
0
 private static SNode _quotation_createNode_baxqxe_a0a0c0b(
     Object parameter_1, Object parameter_2, Object parameter_3, Object parameter_4) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_5 = null;
   SNode quotedNode_6 = null;
   SNode quotedNode_7 = null;
   SNode quotedNode_8 = null;
   quotedNode_5 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.FieldDeclaration",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   SNodeAccessUtil.setProperty(quotedNode_5, "name", (String) parameter_4);
   quotedNode_6 = (SNode) parameter_1;
   if (quotedNode_6 != null) {
     quotedNode_5.addChild("visibility", HUtil.copyIfNecessary(quotedNode_6));
   }
   quotedNode_7 = (SNode) parameter_2;
   if (quotedNode_7 != null) {
     quotedNode_5.addChild("type", HUtil.copyIfNecessary(quotedNode_7));
   }
   quotedNode_8 = (SNode) parameter_3;
   if (quotedNode_8 != null) {
     quotedNode_5.addChild("initializer", HUtil.copyIfNecessary(quotedNode_8));
   }
   return quotedNode_5;
 }
예제 #17
0
 private static SNode _quotation_createNode_w26thq_a0a3a1(Object parameter_1) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_2 = null;
   SNode quotedNode_3 = null;
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.ClassifierType",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   quotedNode_2.setReference(
       "classifier",
       SReference.create(
           "classifier",
           quotedNode_2,
           facade.createModelReference(
               "f:java_stub#6354ebe7-c22a-4a0f-ac54-50b52ab9b065#java.util(JDK/java.util@java_stub)"),
           facade.createNodeId("~List")));
   quotedNode_3 = (SNode) parameter_1;
   if (quotedNode_3 != null) {
     quotedNode_2.addChild("parameter", HUtil.copyIfNecessary(quotedNode_3));
   }
   return quotedNode_2;
 }
 private static SNode _quotation_createNode_v18lly_a0a1() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "r:bd8551c6-e2e3-4499-a261-45b0c886d1d1(jetbrains.mps.refactoring.framework)"),
           facade.createNodeId("4792031542972811415")));
   return quotedNode_1;
 }
 private static SNode _quotation_createNode_4qk8lm_a0d0b() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "r:d98d04fb-4a60-4106-81cf-6cb40b67de4d(jetbrains.mps.ide.findusages.model)"),
           facade.createNodeId("847291649004065516")));
   return quotedNode_1;
 }
 private static SNode _quotation_createNode_topy54_a0b0b() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/f:java_stub#6ed54515-acc8-4d1e-a16c-9fd6cfe951ea#jetbrains.mps.lang.dataFlow.framework.instructions(MPS.Core/jetbrains.mps.lang.dataFlow.framework.instructions@java_stub)"),
           facade.createNodeId("~Instruction")));
   return quotedNode_1;
 }
 private static SNode _quotation_createNode_fj2vg7_a0m0b(Object parameter_1, Object parameter_2) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_3 = null;
   SNode quotedNode_4 = null;
   quotedNode_3 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   SNodeAccessUtil.setReferenceTarget(
       quotedNode_3,
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       (SNode) parameter_1);
   {
     List<SNode> nodes = (List<SNode>) parameter_2;
     for (SNode child : nodes) {
       quotedNode_3.addChild(
           MetaAdapterFactory.getContainmentLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x102419671abL,
               "parameter"),
           HUtil.copyIfNecessary(child));
     }
   }
   return quotedNode_3;
 }
 private static SNode _quotation_createNode_78c6t8_a0a0a(
     Object parameter_1, Object parameter_2, Object parameter_3) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_4 = null;
   SNode quotedNode_5 = null;
   SNode quotedNode_6 = null;
   SNode quotedNode_7 = null;
   quotedNode_4 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.TernaryOperatorExpression",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   quotedNode_5 = (SNode) parameter_1;
   if (quotedNode_5 != null) {
     quotedNode_4.addChild("condition", HUtil.copyIfNecessary(quotedNode_5));
   }
   quotedNode_6 = (SNode) parameter_2;
   if (quotedNode_6 != null) {
     quotedNode_4.addChild("ifTrue", HUtil.copyIfNecessary(quotedNode_6));
   }
   quotedNode_7 = (SNode) parameter_3;
   if (quotedNode_7 != null) {
     quotedNode_4.addChild("ifFalse", HUtil.copyIfNecessary(quotedNode_7));
   }
   return quotedNode_4;
 }
 private static SNode _quotation_createNode_bwi1fo_a0a3() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang(JDK/)"),
           facade.createNodeId("~Object")));
   return quotedNode_1;
 }
 private static SNode _quotation_createNode_9rcmzr_a0f0b(Object parameter_1) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_2 = null;
   SNode quotedNode_3 = null;
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x8388864671ce4f1cL,
               0x9c53c54016f6ad4fL,
               0x11d91cbbcd0L,
               "jetbrains.mps.baseLanguage.collections.structure.SetType"),
           null,
           null,
           false);
   quotedNode_3 = (SNode) parameter_1;
   if (quotedNode_3 != null) {
     quotedNode_2.addChild(
         MetaAdapterFactory.getContainmentLink(
             0x8388864671ce4f1cL,
             0x9c53c54016f6ad4fL,
             0x11d91cbbcd0L,
             0x11d91cc51e3L,
             "elementType"),
         HUtil.copyIfNecessary(quotedNode_3));
   }
   return quotedNode_2;
 }
예제 #25
0
 private static SNode _quotation_createNode_t7bv23_a0a0() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               "jetbrains.mps.baseLanguage.structure.ClassifierType"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x101de48bf9eL,
               0x101de490babL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "8865b7a8-5271-43d3-884c-6fd1d9cfdd34/f:java_stub#8865b7a8-5271-43d3-884c-6fd1d9cfdd34#org.jetbrains.mps.openapi.module(MPS.OpenAPI/org.jetbrains.mps.openapi.module@java_stub)"),
           facade.createNodeId("~SModule")));
   return quotedNode_1;
 }
예제 #26
0
 private static SNode _quotation_createNode_icy1a5_a0a2() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x103fb730c14L,
               "jetbrains.mps.baseLanguage.structure.ClassifierClassExpression"),
           null,
           null,
           false);
   quotedNode_1.setReference(
       MetaAdapterFactory.getReferenceLink(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x103fb730c14L, 0x103fb73a43eL, "classifier"),
       SReference.create(
           MetaAdapterFactory.getReferenceLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x103fb730c14L,
               0x103fb73a43eL,
               "classifier"),
           quotedNode_1,
           facade.createModelReference(
               "6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.util(JDK/)"),
           facade.createNodeId("~Map")));
   return quotedNode_1;
 }
 private static SNode _quotation_createNode_9rcmzr_a0e0b(Object parameter_1, Object parameter_2) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_3 = null;
   SNode quotedNode_4 = null;
   SNode quotedNode_5 = null;
   quotedNode_3 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x8388864671ce4f1cL,
               0x9c53c54016f6ad4fL,
               0x120cf0ddd15L,
               "jetbrains.mps.baseLanguage.collections.structure.MappingType"),
           null,
           null,
           false);
   quotedNode_4 = (SNode) parameter_1;
   if (quotedNode_4 != null) {
     quotedNode_3.addChild(
         MetaAdapterFactory.getContainmentLink(
             0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x120cf0ddd15L, 0x120cf0e3925L, "keyType"),
         HUtil.copyIfNecessary(quotedNode_4));
   }
   quotedNode_5 = (SNode) parameter_2;
   if (quotedNode_5 != null) {
     quotedNode_3.addChild(
         MetaAdapterFactory.getContainmentLink(
             0x8388864671ce4f1cL,
             0x9c53c54016f6ad4fL,
             0x120cf0ddd15L,
             0x120cf0e4f44L,
             "valueType"),
         HUtil.copyIfNecessary(quotedNode_5));
   }
   return quotedNode_3;
 }
 private static SNode _quotation_createNode_501tdc_a0a0b() {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_1 = null;
   SNode quotedNode_2 = null;
   quotedNode_1 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x8388864671ce4f1cL,
               0x9c53c54016f6ad4fL,
               0x10c260e9444L,
               "jetbrains.mps.baseLanguage.collections.structure.SequenceType"),
           null,
           null,
           false);
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           MetaAdapterFactory.getConcept(
               0x7866978ea0f04cc7L,
               0x81bc4d213d9375e1L,
               0x10a2d94c0cdL,
               "jetbrains.mps.lang.smodel.structure.SModelType"),
           null,
           null,
           false);
   quotedNode_1.addChild(
       MetaAdapterFactory.getContainmentLink(
           0x8388864671ce4f1cL,
           0x9c53c54016f6ad4fL,
           0x10c260e9444L,
           0x10c260ee40eL,
           "elementType"),
       quotedNode_2);
   return quotedNode_1;
 }
예제 #29
0
  protected Iterable<ModelRoot> loadRoots() {
    ModuleDescriptor descriptor = getModuleDescriptor();
    if (descriptor == null) {
      return Collections.emptyList();
    }

    List<ModelRoot> result = new ArrayList<ModelRoot>();
    for (ModelRootDescriptor modelRoot : descriptor.getModelRootDescriptors()) {
      try {
        ModelRootFactory modelRootFactory =
            PersistenceFacade.getInstance().getModelRootFactory(modelRoot.getType());
        if (modelRootFactory == null) {
          LOG.error(
              "Unknown model root type: `" + modelRoot.getType() + "'. Requested by: " + this);
          continue;
        }

        ModelRoot root = modelRootFactory.create();
        Memento mementoWithFS = new MementoWithFS(modelRoot.getMemento(), myFileSystem);
        root.load(mementoWithFS);
        result.add(root);
      } catch (Exception e) {
        LOG.error(
            "Error loading models from root with type: `"
                + modelRoot.getType()
                + "'. Requested by: "
                + this,
            e);
      }
    }
    return result;
  }
예제 #30
0
 private static SNode _quotation_createNode_kvqths_a0a0j(Object parameter_1) {
   PersistenceFacade facade = PersistenceFacade.getInstance();
   SNode quotedNode_2 = null;
   SNode quotedNode_3 = null;
   SNode quotedNode_4 = null;
   quotedNode_2 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.core.structure.structure.SStructureContainer",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   SNodeAccessUtil.setProperty(quotedNode_2, "name", "a");
   quotedNode_3 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.core.structure.structure.SStructureEmptyLine",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   quotedNode_2.addChild("structure", quotedNode_3);
   quotedNode_4 =
       SModelUtil_new.instantiateConceptDeclaration(
           "jetbrains.mps.core.structure.structure.SInterfaceConcept",
           null,
           null,
           GlobalScope.getInstance(),
           false);
   SNodeAccessUtil.setProperty(quotedNode_4, "name", (String) parameter_1);
   quotedNode_2.addChild("structure", quotedNode_4);
   return quotedNode_2;
 }