示例#1
0
 /**
  * This method shall be invoked only if {@link
  * #isImplementationWithStub(org.jetbrains.mps.openapi.language.SConcept)} == <code>true</code>
  */
 @NotNull
 public SConcept getStubConcept(@NotNull SConcept original) {
   final ConceptInfo ci = myMetaRegistry.find(original);
   assert ci.getKind() == ConceptKind.IMPLEMENTATION_WITH_STUB;
   final SConceptId stub = ci.getStubCounterpart();
   assert stub != null;
   return MetaAdapterFactory.getConcept(stub, ci.constructStubConceptName());
 }
示例#2
0
 // @param stub is optional
 public void withConcept(String id, String name, String index, String nodeInfo, String stub) {
   assert myActualLang != null;
   SConceptId conceptId = myIdEncoder.parseConceptId(myActualLang.getLanguageId(), id);
   myActualConcept = myMetaRegistry.registerConcept(conceptId, name);
   myActualConcept.parseImplementationKind(nodeInfo);
   myConcepts.put(index, MetaAdapterFactory.getConcept(conceptId, name));
   myMetaInfoProvider.setConceptName(conceptId, name);
   myMetaInfoProvider.setKind(conceptId, myActualConcept.getKind());
   myMetaInfoProvider.setScope(conceptId, myActualConcept.getScope());
   if (stub != null) {
     // XXX here we imply stub concepts live in the save language as their origin
     final SConceptId stubId = myIdEncoder.parseConceptId(myActualLang.getLanguageId(), stub);
     myActualConcept.setStubCounterpart(stubId);
     myMetaInfoProvider.setStubConcept(conceptId, stubId);
   }
 }
示例#3
0
 public void withLanguage(String id, String name) {
   final SLanguageId languageId = myIdEncoder.parseLanguageId(id);
   myActualLang = myMetaRegistry.registerLanguage(languageId, name);
   myMetaInfoProvider.setLanguageName(languageId, name);
 }
示例#4
0
 public boolean isImplementationWithStub(@NotNull SConcept concept) {
   return myMetaRegistry.find(concept).isImplementationWithStub();
 }
示例#5
0
 public boolean isInterface(@NotNull SConcept concept) {
   return ConceptKind.INTERFACE == myMetaRegistry.find(concept).getKind();
 }