コード例 #1
0
  private ConstraintsDescriptor getMethodUsingInheritance(
      String conceptFqName, InheritanceCalculateParameters parameters) {
    for (String parent :
        ConceptRegistry.getInstance().getConceptDescriptor(conceptFqName).getParentsNames()) {
      ConstraintsDescriptor parentDescriptor =
          ConceptRegistry.getInstance().getConstraintsDescriptor(parent);

      ConstraintsDescriptor parentCalculated;

      if (parentDescriptor instanceof BaseConstraintsDescriptor) {
        parentCalculated =
            parameters.getParentCalculatedDescriptor((BaseConstraintsDescriptor) parentDescriptor);
      } else if (parentDescriptor instanceof ConstraintsDispatchable) {
        if (parameters.hasOwn((ConstraintsDispatchable) parentDescriptor)) {
          parentCalculated = parentDescriptor;
        } else {
          parentCalculated = getMethodUsingInheritance(conceptFqName, parameters);
        }
      } else {
        parentCalculated = parentDescriptor;
      }

      if (parentCalculated != null) {
        return parentCalculated;
      }
    }

    return null;
  }
コード例 #2
0
  @Override
  public void findTargets(
      TargetKind kind,
      Collection<SModel> scope,
      Consumer<NavigationTarget> consumer,
      Consumer<SModel> processedConsumer) {
    final ID<Integer, List<SNodeDescriptor>> indexName = RootNodeNameIndex.NAME;
    final FileBasedIndex fileBasedIndex = FileBasedIndex.getInstance();

    for (SModel sm : scope) {
      if (sm instanceof EditableSModel && ((EditableSModel) sm).isChanged()) {
        continue;
      }

      DataSource source = sm.getSource();
      if (!(source instanceof FileDataSource)) {
        continue;
      }

      IFile modelFile = ((FileDataSource) source).getFile();
      String ext = FileUtil.getExtension(modelFile.getName());
      if (ext == null
          || modelFile.isDirectory()
          || !(supportedExtensions.contains(ext.toLowerCase()))) {
        continue;
      }

      VirtualFile vf = VirtualFileUtils.getVirtualFile(modelFile);
      if (vf == null) continue; // e.g. model was deleted

      int fileId = FileBasedIndex.getFileId(vf);
      ConcreteFilesGlobalSearchScope fileScope =
          new ConcreteFilesGlobalSearchScope(Collections.singleton(vf));
      List<List<SNodeDescriptor>> descriptors =
          fileBasedIndex.getValues(indexName, fileId, fileScope);
      if (descriptors.isEmpty()) continue;

      boolean needToLoad = false;
      for (NavigationTarget snd : descriptors.get(0)) {
        PropertyConstraintsDescriptor descriptor =
            ConceptRegistry.getInstance()
                .getConstraintsDescriptor(snd.getConcept().getQualifiedName())
                .getProperty(SNodeUtil.property_INamedConcept_name);
        if (descriptor instanceof BasePropertyConstraintsDescriptor
            && !((BasePropertyConstraintsDescriptor) descriptor).isGetterDefault()) {
          needToLoad = true;
          break;
        }
      }

      if (!needToLoad) {
        for (SNodeDescriptor desc : descriptors.get(0)) {
          consumer.consume(desc);
        }
        processedConsumer.consume(sm);
      }
    }
  }
コード例 #3
0
 public static String call_getRelativePath_5481553824944787371(SNode thisNode) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (String)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(thisNode, "jetbrains.mps.build.structure.BuildSourcePath"),
           "virtual_getRelativePath_5481553824944787371",
           PARAMETERS_5481553824944787371);
 }
コード例 #4
0
 public static SNode call_getParent_8654221991637145399(SNode thisNode) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (SNode)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(thisNode, "jetbrains.mps.build.structure.BuildSourcePath"),
           "virtual_getParent_8654221991637145399",
           PARAMETERS_8654221991637145399);
 }
コード例 #5
0
ファイル: XmlRoot_Behavior.java プロジェクト: ttim/MPS
 public static SNode call_getSchema_1213877420378(SNode thisNode, IScope scope) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (SNode)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(thisNode, "jetbrains.mps.xml.structure.XmlRoot"),
           "virtual_getSchema_1213877420378",
           PARAMETERS_1213877420378,
           new Object[] {scope});
 }
コード例 #6
0
 public static SNode call_getSecondNodeCondition_4484478261143583672(SNode thisNode) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (SNode)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(
               thisNode, "jetbrains.mps.lang.typesystem.structure.IRuleWithTwoNodes"),
           "virtual_getSecondNodeCondition_4484478261143583672",
           PARAMETERS_4484478261143583672);
 }
コード例 #7
0
 public static boolean call_isExecuteSynchronous_1230212745736(SNode thisNode) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (Boolean)
       descriptor.invoke(
           Boolean.class,
           SNodeOperations.cast(
               thisNode, "jetbrains.mps.baseLanguage.structure.IStatementListContainer"),
           "virtual_isExecuteSynchronous_1230212745736",
           PARAMETERS_1230212745736);
 }
コード例 #8
0
 public static boolean call_isClosure_3262277503800835439(SNode thisNode) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (Boolean)
       descriptor.invoke(
           Boolean.class,
           SNodeOperations.cast(
               thisNode, "jetbrains.mps.baseLanguage.structure.IStatementListContainer"),
           "virtual_isClosure_3262277503800835439",
           PARAMETERS_3262277503800835439);
 }
コード例 #9
0
 public static String call_getLastSegment_1368030936106771141(SNode thisNode, MacroHelper helper) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (String)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(thisNode, "jetbrains.mps.build.structure.BuildSourcePath"),
           "virtual_getLastSegment_1368030936106771141",
           PARAMETERS_1368030936106771141,
           helper);
 }
コード例 #10
0
 public static List<SNode> call_getVariables_8981808925914844606(SNode thisNode) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (List<SNode>)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(
               thisNode, "jetbrains.mps.samples.lambdaCalculus.structure.LetExpression"),
           "virtual_getVariables_8981808925914841576",
           PARAMETERS_8981808925914844606,
           new Object[] {});
 }
コード例 #11
0
 public static SNode call_getMainClassifier_1213877255428(SNode thisNode) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (SNode)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(
               thisNode, "jetbrains.mps.baseLanguage.classifiers.structure.IClassifierPart"),
           "virtual_getMainClassifier_1213877255428",
           PARAMETERS_1213877255428,
           new Object[] {});
 }
コード例 #12
0
 public static SNode call_getStateType_314981645426570519(SNode thisNode) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (SNode)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(
               thisNode,
               "jetbrains.mps.execution.configurations.deprecated.structure.RunConfigurationDeclaration"),
           "virtual_getStateType_314981645426570519",
           PARAMETERS_314981645426570519);
 }
コード例 #13
0
 public static List<IModule> call_getVisibleModules_4040588429969394404(
     SNode thisNode, IScope scope) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (List<IModule>)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(
               thisNode, "jetbrains.mps.lang.smodel.structure.ModuleReferenceExpression"),
           "virtual_getVisibleModules_4040588429969394404",
           PARAMETERS_4040588429969394404,
           scope);
 }
コード例 #14
0
 public static String call_getString_1222433142247(SNode thisNode, List<SNode> vars) {
   BehaviorDescriptor descriptor =
       ConceptRegistry.getInstance().getBehaviorDescriptorForInstanceNode(thisNode);
   return (String)
       descriptor.invoke(
           Object.class,
           SNodeOperations.cast(
               thisNode,
               "jetbrains.mps.baseLanguage.regexp.structure.PredefinedSymbolClassRegexp"),
           "virtual_getString_1222432436326",
           PARAMETERS_1222433142247,
           new Object[] {vars});
 }
コード例 #15
0
  @NotNull
  @Override
  public PropertyConstraintsDescriptor getProperty(String name) {
    if (propertiesConstraints.containsKey(name)) {
      return propertiesConstraints.get(name);
    }

    if (!ConceptRegistry.getInstance().getConceptDescriptor(getConceptFqName()).hasProperty(name)) {
      return new IllegalPropertyConstraintsDescriptor(name, this);
    }

    propertiesConstraints.put(name, new BasePropertyConstraintsDescriptor(name, this));

    return propertiesConstraints.get(name);
  }
コード例 #16
0
  @NotNull
  @Override
  public ReferenceConstraintsDescriptor getReference(String refName) {
    if (referencesConstraints.containsKey(refName)) {
      return referencesConstraints.get(refName);
    }

    if (!ConceptRegistry.getInstance()
        .getConceptDescriptor(getConceptFqName())
        .hasReference(refName)) {
      return new IllegalReferenceConstraintsDescriptor(refName, this);
    }

    referencesConstraints.put(refName, new BaseReferenceConstraintsDescriptor(refName, this));

    return referencesConstraints.get(refName);
  }
コード例 #17
0
public final class StatCommand__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0xa5e4de5346a344daL,
          0xaab368fdf1c34ed0L,
          0x67f2bafb7a558c98L,
          "jetbrains.mps.console.ideCommands.structure.StatCommand");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<Void> doExecute_id2SpVAIqougW =
      new SMethodBuilder<Void>(new SJavaCompoundTypeImpl(Void.class))
          .name("doExecute")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("2SpVAIqougW")
          .registry(REGISTRY)
          .build(
              SMethodBuilder.createJavaParameter(ConsoleContext.class, ""),
              SMethodBuilder.createJavaParameter(ConsoleStream.class, ""));

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(doExecute_id2SpVAIqougW);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  /*package*/ static void doExecute_id2SpVAIqougW(
      @NotNull SNode __thisNode__, ConsoleContext context, ConsoleStream console) {
    OutputUtils.printStat(
        console,
        IStatisticsTarget__BehaviorDescriptor.getStat_id6vMIJHUBlVT.invoke(
            SLinkOperations.getTarget(
                __thisNode__,
                MetaAdapterFactory.getContainmentLink(
                    0xa5e4de5346a344daL,
                    0xaab368fdf1c34ed0L,
                    0x67f2bafb7a558c98L,
                    0x67f2bafb7a579cb3L,
                    "target")),
            context));
  }

  /*package*/ StatCommand__BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        doExecute_id2SpVAIqougW(
            node, (ConsoleContext) parameters[0], (ConsoleStream) parameters[1]);
        return null;
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept,
      @NotNull SMethod<T> method,
      @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }
}
コード例 #18
0
public final class MoneyLiteral__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0xf43135f9b8334685L,
          0x8d26ffb6c8215f72L,
          0x1144ae7606aL,
          "jetbrains.mps.baseLanguage.money.structure.MoneyLiteral");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  private static final List<SMethod<?>> BH_METHODS = Arrays.<SMethod<?>>asList();

  private static void ___init___(@NotNull SNode __thisNode__) {}

  /*package*/ MoneyLiteral__BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept,
      @NotNull SMethod<T> method,
      @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }
}
コード例 #19
0
public final class CurrentStockPrice__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0x662a9f2b58024d16L,
          0x955872c65c7a681eL,
          0x3786e3f4808999c3L,
          "org.jetbrains.mps.samples.Money.structure.CurrentStockPrice");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<Money> getCurrentPrice_id3u6SZi0yq4L =
      new SMethodBuilder<Money>(new SJavaCompoundTypeImpl(Money.class))
          .name("getCurrentPrice")
          .modifiers(SModifiersImpl.create(0, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("3u6SZi0yq4L")
          .registry(REGISTRY)
          .build();

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(getCurrentPrice_id3u6SZi0yq4L);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  /*package*/ static Money getCurrentPrice_id3u6SZi0yq4L(@NotNull SNode __thisNode__) {
    if ((SLinkOperations.getTarget(
            __thisNode__,
            MetaAdapterFactory.getContainmentLink(
                0x662a9f2b58024d16L,
                0x955872c65c7a681eL,
                0x3786e3f4808999c3L,
                0x3786e3f480b0926aL,
                "symbol"))
        == null)) {
      return new Money(BigDecimal.ZERO, "USD");
    }
    Money currentPrice =
        StockPriceDownloader.getInstance()
            .getCurrentPrice(
                SPropertyOperations.getString(
                    SLinkOperations.getTarget(
                        __thisNode__,
                        MetaAdapterFactory.getContainmentLink(
                            0x662a9f2b58024d16L,
                            0x955872c65c7a681eL,
                            0x3786e3f4808999c3L,
                            0x3786e3f480b0926aL,
                            "symbol")),
                    MetaAdapterFactory.getProperty(
                        0x662a9f2b58024d16L,
                        0x955872c65c7a681eL,
                        0x3786e3f480a9b18aL,
                        0x3786e3f480afac5bL,
                        "symbol")));
    if (currentPrice == null) {
      return new Money(BigDecimal.ZERO, "USD");
    }
    return currentPrice;
  }

  /*package*/ CurrentStockPrice__BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) ((Money) getCurrentPrice_id3u6SZi0yq4L(node));
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept,
      @NotNull SMethod<T> method,
      @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }
}
public final class QueryFunction_IsMethodCurrent__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0x18bc659203a64e29L,
          0xa83a7ff23bde13baL,
          0x5917043ba8fab771L,
          "jetbrains.mps.lang.editor.structure.QueryFunction_IsMethodCurrent");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<List<SNode>> getApplicableConceptFunctionParameter_id2D1PBM_bxJg =
      new SMethodBuilder<List<SNode>>(
              new SJavaCompoundTypeImpl((Class<List<SNode>>) ((Class) Object.class)))
          .name("getApplicableConceptFunctionParameter")
          .modifiers(SModifiersImpl.create(9, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("2D1PBM_bxJg")
          .registry(REGISTRY)
          .build();
  public static final SMethod<SNode> getExpectedReturnType_idhEwIGRD =
      new SMethodBuilder<SNode>(new SJavaCompoundTypeImpl((Class<SNode>) ((Class) Object.class)))
          .name("getExpectedReturnType")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwIGRD")
          .registry(REGISTRY)
          .build();

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(
          getApplicableConceptFunctionParameter_id2D1PBM_bxJg, getExpectedReturnType_idhEwIGRD);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  /*package*/ static List<SNode> getApplicableConceptFunctionParameter_id2D1PBM_bxJg(
      @NotNull SAbstractConcept __thisConcept__) {
    List<SNode> result =
        ConceptFunction__BehaviorDescriptor.getApplicableConceptFunctionParameter_id2D1PBM_bxJg
            .invokeSpecial(__thisConcept__);
    ListSequence.fromList(result)
        .addElement(
            SNodeOperations.getNode(
                "r:00000000-0000-4000-0000-011c8959029e(jetbrains.mps.lang.editor.structure)",
                "4203201205844553978"));
    ListSequence.fromList(result)
        .addElement(
            SNodeOperations.getNode(
                "r:00000000-0000-4000-0000-011c8959029e(jetbrains.mps.lang.editor.structure)",
                "671290755174094691"));
    ListSequence.fromList(result)
        .addElement(
            SNodeOperations.getNode(
                "r:00000000-0000-4000-0000-011c8959029e(jetbrains.mps.lang.editor.structure)",
                "1161622981231"));
    return result;
  }
  /*package*/ static SNode getExpectedReturnType_idhEwIGRD(@NotNull SNode __thisNode__) {
    return _quotation_createNode_a2589d_a0a1();
  }

  /*package*/ QueryFunction_IsMethodCurrent__BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 1:
        return (T) ((SNode) getExpectedReturnType_idhEwIGRD(node));
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept,
      @NotNull SMethod<T> method,
      @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) ((List<SNode>) getApplicableConceptFunctionParameter_id2D1PBM_bxJg(concept));
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }

  private static SNode _quotation_createNode_a2589d_a0a1() {
    PersistenceFacade facade = PersistenceFacade.getInstance();
    SNode quotedNode_1 = null;
    quotedNode_1 =
        SModelUtil_new.instantiateConceptDeclaration(
            MetaAdapterFactory.getConcept(
                0xf3061a5392264cc5L,
                0xa443f952ceaf5816L,
                0xf940d6513eL,
                "jetbrains.mps.baseLanguage.structure.BooleanType"),
            null,
            null,
            false);
    return quotedNode_1;
  }
}
コード例 #21
0
public final class Shape_BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0x16bafbb4c6cd4cc5L,
          0x83327c6de8729b3fL,
          0x51dcaa29974fc161L,
          "jetbrains.mps.samples.Shapes.structure.Shape");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<Void> drawShape_idW6XMzE_hbz =
      new SMethodBuilder<Void>(new SJavaCompoundTypeImpl(Void.class))
          .name("drawShape")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("W6XMzE_hbz")
          .registry(REGISTRY)
          .build(SParameterImpl.fromList(SJavaCompoundTypeImpl.fromClasses(Graphics.class)));
  public static final SMethod<Void> drawShapeAt_id3u6SZi0POQS =
      new SMethodBuilder<Void>(new SJavaCompoundTypeImpl(Void.class))
          .name("drawShapeAt")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("3u6SZi0POQS")
          .registry(REGISTRY)
          .build(
              SParameterImpl.fromList(
                  SJavaCompoundTypeImpl.fromClasses(Graphics.class, Integer.TYPE, Integer.TYPE)));

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(drawShape_idW6XMzE_hbz, drawShapeAt_id3u6SZi0POQS);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  private static void drawShape_idW6XMzE_hbz(@NotNull SNode __thisNode__, Graphics graphics) {
    graphics.setColor(
        ColorReference_BehaviorDescriptor.findColor_id1Os2kBLuoy8.invoke(
            SLinkOperations.getTarget(
                __thisNode__,
                MetaAdapterFactory.getContainmentLink(
                    0x16bafbb4c6cd4cc5L,
                    0x83327c6de8729b3fL,
                    0x51dcaa29974fc161L,
                    0x3a2b0182df24928cL,
                    "color"))));
  }

  private static void drawShapeAt_id3u6SZi0POQS(
      @NotNull SNode __thisNode__, Graphics graphics, int x, int y) {
    graphics.setColor(
        ColorReference_BehaviorDescriptor.findColor_id1Os2kBLuoy8.invoke(
            SLinkOperations.getTarget(
                __thisNode__,
                MetaAdapterFactory.getContainmentLink(
                    0x16bafbb4c6cd4cc5L,
                    0x83327c6de8729b3fL,
                    0x51dcaa29974fc161L,
                    0x3a2b0182df24928cL,
                    "color"))));
  }

  /*package*/ Shape_BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @NotNull Object[] array) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @NotNull Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        drawShape_idW6XMzE_hbz(node, (Graphics) parameters[0]);
        return null;
      case 1:
        drawShapeAt_id3u6SZi0POQS(
            node, (Graphics) parameters[0], (Integer) parameters[1], (Integer) parameters[2]);
        return null;
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept, @NotNull SMethod<T> method, @NotNull Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }
}
public final class ConstraintFunctionParameter_checkedNode__BehaviorDescriptor
    extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0x3f4bc5f5c6c14a28L,
          0x8b10c83066ffa4a1L,
          0x297f56a5546902a8L,
          "jetbrains.mps.lang.constraints.structure.ConstraintFunctionParameter_checkedNode");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<Boolean> dontUseParameterObject_id1653mnvAgv$ =
      new SMethodBuilder<Boolean>(new SJavaCompoundTypeImpl(Boolean.TYPE))
          .name("dontUseParameterObject")
          .modifiers(SModifiersImpl.create(9, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("1653mnvAgv$")
          .registry(REGISTRY)
          .build();

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(dontUseParameterObject_id1653mnvAgv$);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  /*package*/ static boolean dontUseParameterObject_id1653mnvAgv$(
      @NotNull SAbstractConcept __thisConcept__) {
    return true;
  }

  /*package*/ ConstraintFunctionParameter_checkedNode__BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept,
      @NotNull SMethod<T> method,
      @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) ((Boolean) dontUseParameterObject_id1653mnvAgv$(concept));
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }
}
コード例 #23
0
public final class XMLSAXChildRule_BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0xdcb5a83a19a844ffL,
          0xa4cbfc7d324ecc63L,
          0x1f6c736337b5e2d8L,
          "jetbrains.mps.core.xml.sax.structure.XMLSAXChildRule");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<String> getTagName_id1XGsQcRHuf0 =
      new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class))
          .name("getTagName")
          .modifiers(SModifiersImpl.create(0, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("1XGsQcRHuf0")
          .registry(REGISTRY)
          .build(SParameterImpl.fromList(SJavaCompoundTypeImpl.fromClasses()));
  public static final SMethod<Scope> getArgumentsScope_id460OzqriLdX =
      new SMethodBuilder<Scope>(new SJavaCompoundTypeImpl(Scope.class))
          .name("getArgumentsScope")
          .modifiers(SModifiersImpl.create(0, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("460OzqriLdX")
          .registry(REGISTRY)
          .build(
              SParameterImpl.fromList(
                  SJavaCompoundTypeImpl.fromClasses((Class<SNode>) ((Class) Object.class))));
  public static final SMethod<Scope> getScope_id3fifI_xCJOQ =
      new SMethodBuilder<Scope>(new SJavaCompoundTypeImpl(Scope.class))
          .name("getScope")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("3fifI_xCJOQ")
          .registry(REGISTRY)
          .build(
              SParameterImpl.fromList(
                  SJavaCompoundTypeImpl.fromClasses(
                      (Class<SNode>) ((Class) Object.class),
                      (Class<SNode>) ((Class) Object.class))));
  public static final SMethod<Scope> getScope_id6GEzh_Hz_wK =
      new SMethodBuilder<Scope>(new SJavaCompoundTypeImpl(Scope.class))
          .name("getScope")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("6GEzh_Hz_wK")
          .registry(REGISTRY)
          .build(
              SParameterImpl.fromList(
                  SJavaCompoundTypeImpl.fromClasses(
                      (Class<SNode>) ((Class) Object.class), String.class, Integer.TYPE)));

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(
          getTagName_id1XGsQcRHuf0,
          getArgumentsScope_id460OzqriLdX,
          getScope_id3fifI_xCJOQ,
          getScope_id6GEzh_Hz_wK);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  private static String getTagName_id1XGsQcRHuf0(@NotNull SNode __thisNode__) {
    if ((SLinkOperations.getTarget(
                __thisNode__,
                MetaAdapterFactory.getReferenceLink(
                    0xdcb5a83a19a844ffL,
                    0xa4cbfc7d324ecc63L,
                    0x1f6c736337b5e2d8L,
                    0x1f6c736337b5e2dcL,
                    "rule"))
            != null)
        && isNotEmptyString(
            SPropertyOperations.getString(
                SLinkOperations.getTarget(
                    __thisNode__,
                    MetaAdapterFactory.getReferenceLink(
                        0xdcb5a83a19a844ffL,
                        0xa4cbfc7d324ecc63L,
                        0x1f6c736337b5e2d8L,
                        0x1f6c736337b5e2dcL,
                        "rule")),
                MetaAdapterFactory.getProperty(
                    0xdcb5a83a19a844ffL,
                    0xa4cbfc7d324ecc63L,
                    0x1f6c736337b5e2f2L,
                    0x1f6c736337b5e2f9L,
                    "tagName")))
        && (SPropertyOperations.getBoolean(
                    __thisNode__,
                    MetaAdapterFactory.getProperty(
                        0xdcb5a83a19a844ffL,
                        0xa4cbfc7d324ecc63L,
                        0x1f6c736337b5e2d8L,
                        0x1f6c736337b5e2dbL,
                        "overrideTag"))
                == false
            || isEmptyString(
                SPropertyOperations.getString(
                    __thisNode__,
                    MetaAdapterFactory.getProperty(
                        0xdcb5a83a19a844ffL,
                        0xa4cbfc7d324ecc63L,
                        0x1f6c736337b5e2d8L,
                        0x1f6c736337b5e2daL,
                        "tagName"))))) {
      return SPropertyOperations.getString(
          SLinkOperations.getTarget(
              __thisNode__,
              MetaAdapterFactory.getReferenceLink(
                  0xdcb5a83a19a844ffL,
                  0xa4cbfc7d324ecc63L,
                  0x1f6c736337b5e2d8L,
                  0x1f6c736337b5e2dcL,
                  "rule")),
          MetaAdapterFactory.getProperty(
              0xdcb5a83a19a844ffL,
              0xa4cbfc7d324ecc63L,
              0x1f6c736337b5e2f2L,
              0x1f6c736337b5e2f9L,
              "tagName"));
    }
    return SPropertyOperations.getString(
        __thisNode__,
        MetaAdapterFactory.getProperty(
            0xdcb5a83a19a844ffL,
            0xa4cbfc7d324ecc63L,
            0x1f6c736337b5e2d8L,
            0x1f6c736337b5e2daL,
            "tagName"));
  }

  private static Scope getArgumentsScope_id460OzqriLdX(@NotNull SNode __thisNode__, SNode kind) {
    {
      SAbstractConcept cncpt = SNodeOperations.asSConcept((kind));
      if (SConceptOperations.isSubConceptOf(
          SNodeOperations.asSConcept(cncpt),
          MetaAdapterFactory.getConcept(
              0xf3061a5392264cc5L,
              0xa443f952ceaf5816L,
              0xf8c37a7f6eL,
              "jetbrains.mps.baseLanguage.structure.VariableDeclaration"))) {
        return new EmptyScope();
      }
      if (SConceptOperations.isSubConceptOf(
          SNodeOperations.asSConcept(cncpt),
          MetaAdapterFactory.getConcept(
              0xdcb5a83a19a844ffL,
              0xa4cbfc7d324ecc63L,
              0x1f6c736337b5e2cbL,
              "jetbrains.mps.core.xml.sax.structure.XMLSAXAttributeRule"))) {
        return SimpleRoleScope.forNamedElements(
            SNodeOperations.getNodeAncestor(
                __thisNode__,
                MetaAdapterFactory.getConcept(
                    0xdcb5a83a19a844ffL,
                    0xa4cbfc7d324ecc63L,
                    0x1f6c736337b5e2f2L,
                    "jetbrains.mps.core.xml.sax.structure.XMLSAXNodeRule"),
                false,
                false),
            MetaAdapterFactory.getContainmentLink(
                0xdcb5a83a19a844ffL,
                0xa4cbfc7d324ecc63L,
                0x1f6c736337b5e2f2L,
                0x1f6c736337b5e2f4L,
                "attrs"));
      }
    }
    return null;
  }

  private static Scope getScope_id3fifI_xCJOQ(
      @NotNull SNode __thisNode__, SNode kind, SNode child) {
    if (child != null && child.getRoleInParent().equals("actualArgument")) {
      Scope argumentsScope =
          XMLSAXChildRule_BehaviorDescriptor.getArgumentsScope_id460OzqriLdX.invoke(
              __thisNode__, kind);
      if (argumentsScope != null) {
        return argumentsScope;
      }
    }
    if (child
        == SLinkOperations.getTarget(
            __thisNode__,
            MetaAdapterFactory.getContainmentLink(
                0xdcb5a83a19a844ffL,
                0xa4cbfc7d324ecc63L,
                0x1f6c736337b5e2d8L,
                0x4180d2369beda765L,
                "condition"))) {
      {
        SAbstractConcept cncpt = SNodeOperations.asSConcept((kind));
        if (SConceptOperations.isSubConceptOf(
            SNodeOperations.asSConcept(cncpt),
            MetaAdapterFactory.getConcept(
                0xdcb5a83a19a844ffL,
                0xa4cbfc7d324ecc63L,
                0x1f6c736337b5e2cbL,
                "jetbrains.mps.core.xml.sax.structure.XMLSAXAttributeRule"))) {
          return SimpleRoleScope.forNamedElements(
              SLinkOperations.getTarget(
                  __thisNode__,
                  MetaAdapterFactory.getReferenceLink(
                      0xdcb5a83a19a844ffL,
                      0xa4cbfc7d324ecc63L,
                      0x1f6c736337b5e2d8L,
                      0x1f6c736337b5e2dcL,
                      "rule")),
              MetaAdapterFactory.getContainmentLink(
                  0xdcb5a83a19a844ffL,
                  0xa4cbfc7d324ecc63L,
                  0x1f6c736337b5e2f2L,
                  0x1f6c736337b5e2f4L,
                  "attrs"));
        }
      }
    }
    return ScopeProvider_BehaviorDescriptor.getScope_id3fifI_xCJOQ.invokeSpecial(
        __thisNode__, kind, child);
  }

  private static Scope getScope_id6GEzh_Hz_wK(
      @NotNull SNode __thisNode__, SNode kind, String role, int index) {
    if (role.equals("actualArgument")) {
      Scope argumentsScope =
          XMLSAXChildRule_BehaviorDescriptor.getArgumentsScope_id460OzqriLdX.invoke(
              __thisNode__, kind);
      if (argumentsScope != null) {
        return argumentsScope;
      }
    }
    return ScopeProvider_BehaviorDescriptor.getScope_id6GEzh_Hz_wK.invokeSpecial(
        __thisNode__, kind, role, index);
  }

  /*package*/ XMLSAXChildRule_BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @NotNull Object[] array) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @NotNull Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) getTagName_id1XGsQcRHuf0(node);
      case 1:
        return (T) getArgumentsScope_id460OzqriLdX(node, (SNode) parameters[0]);
      case 2:
        return (T) getScope_id3fifI_xCJOQ(node, (SNode) parameters[0], (SNode) parameters[1]);
      case 3:
        return (T)
            getScope_id6GEzh_Hz_wK(
                node, (SNode) parameters[0], (String) parameters[1], (Integer) parameters[2]);
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept, @NotNull SMethod<T> method, @NotNull Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }

  private static boolean isNotEmptyString(String str) {
    return str != null && str.length() > 0;
  }

  private static boolean isEmptyString(String str) {
    return str == null || str.length() == 0;
  }
}
public final class Node_GetContainingRoleOperation__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0x7866978ea0f04cc7L,
          0x81bc4d213d9375e1L,
          0x1b35e18a1a3b2c9aL,
          "jetbrains.mps.lang.smodel.structure.Node_GetContainingRoleOperation");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<Boolean> applicableToNode_id1653mnvAgrs =
      new SMethodBuilder<Boolean>(new SJavaCompoundTypeImpl(Boolean.TYPE))
          .name("applicableToNode")
          .modifiers(SModifiersImpl.create(9, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("1653mnvAgrs")
          .registry(REGISTRY)
          .build();
  public static final SMethod<Boolean> applicableToLink_id1653mnvAgvK =
      new SMethodBuilder<Boolean>(new SJavaCompoundTypeImpl(Boolean.TYPE))
          .name("applicableToLink")
          .modifiers(SModifiersImpl.create(9, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("1653mnvAgvK")
          .registry(REGISTRY)
          .build();

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(applicableToNode_id1653mnvAgrs, applicableToLink_id1653mnvAgvK);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  /*package*/ static boolean applicableToNode_id1653mnvAgrs(
      @NotNull SAbstractConcept __thisConcept__) {
    return true;
  }
  /*package*/ static boolean applicableToLink_id1653mnvAgvK(
      @NotNull SAbstractConcept __thisConcept__) {
    return true;
  }

  /*package*/ Node_GetContainingRoleOperation__BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept,
      @NotNull SMethod<T> method,
      @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) ((Boolean) applicableToNode_id1653mnvAgrs(concept));
      case 1:
        return (T) ((Boolean) applicableToLink_id1653mnvAgvK(concept));
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }
}
public final class QueryFunction_RemoveBy_Condition__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0xaee9cad2acd44608L,
          0xaef20004f6a1cdbdL,
          0x11223572c26L,
          "jetbrains.mps.lang.actions.structure.QueryFunction_RemoveBy_Condition");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<Boolean> usesParameterObjectFor_idhEwIGRw =
      new SMethodBuilder<Boolean>(new SJavaCompoundTypeImpl(Boolean.TYPE))
          .name("usesParameterObjectFor")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwIGRw")
          .registry(REGISTRY)
          .build(SMethodBuilder.createJavaParameter((Class<SNode>) ((Class) Object.class), ""));
  public static final SMethod<List<SNode>> getParameters_idhEwIGRM =
      new SMethodBuilder<List<SNode>>(
              new SJavaCompoundTypeImpl((Class<List<SNode>>) ((Class) Object.class)))
          .name("getParameters")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwIGRM")
          .registry(REGISTRY)
          .build();
  public static final SMethod<SNode> getExpectedReturnType_idhEwIGRD =
      new SMethodBuilder<SNode>(new SJavaCompoundTypeImpl((Class<SNode>) ((Class) Object.class)))
          .name("getExpectedReturnType")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwIGRD")
          .registry(REGISTRY)
          .build();

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(
          usesParameterObjectFor_idhEwIGRw,
          getParameters_idhEwIGRM,
          getExpectedReturnType_idhEwIGRD);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  /*package*/ static boolean usesParameterObjectFor_idhEwIGRw(
      @NotNull SNode __thisNode__, SNode parameter) {
    return !(SNodeOperations.isInstanceOf(
        parameter,
        MetaAdapterFactory.getConcept(
            0xaee9cad2acd44608L,
            0xaef20004f6a1cdbdL,
            0x112235845abL,
            "jetbrains.mps.lang.actions.structure.ConceptFunctionParameter_concept")));
  }
  /*package*/ static List<SNode> getParameters_idhEwIGRM(@NotNull SNode __thisNode__) {
    List<SNode> result = ListSequence.fromList(new ArrayList<SNode>());
    ListSequence.fromList(result)
        .addElement(
            MetaAdapterFactory.getConcept(
                    0xaee9cad2acd44608L,
                    0xaef20004f6a1cdbdL,
                    0x10ccb7e17b2L,
                    "jetbrains.mps.lang.actions.structure.ConceptFunctionParameter_parentNode")
                .getDeclarationNode());
    ListSequence.fromList(result)
        .addElement(
            MetaAdapterFactory.getConcept(
                    0xaee9cad2acd44608L,
                    0xaef20004f6a1cdbdL,
                    0x1122c8bef38L,
                    "jetbrains.mps.lang.actions.structure.ConceptFunctionParameter_currentTargetNode")
                .getDeclarationNode());
    ListSequence.fromList(result)
        .addElement(
            MetaAdapterFactory.getConcept(
                    0xaee9cad2acd44608L,
                    0xaef20004f6a1cdbdL,
                    0x112235845abL,
                    "jetbrains.mps.lang.actions.structure.ConceptFunctionParameter_concept")
                .getDeclarationNode());
    ListSequence.fromList(result)
        .addElement(
            MetaAdapterFactory.getConcept(
                    0xaee9cad2acd44608L,
                    0xaef20004f6a1cdbdL,
                    0x112387cf896L,
                    "jetbrains.mps.lang.actions.structure.ConceptFunctionParameter_childConcept")
                .getDeclarationNode());
    ListSequence.fromList(result)
        .addElement(
            MetaAdapterFactory.getConcept(
                    0x13744753c81f424aL,
                    0x9c1bcf8943bf4e86L,
                    0x10e761b3745L,
                    "jetbrains.mps.lang.sharedConcepts.structure.ConceptFunctionParameter_model")
                .getDeclarationNode());
    ListSequence.fromList(result)
        .addElement(
            MetaAdapterFactory.getConcept(
                    0x13744753c81f424aL,
                    0x9c1bcf8943bf4e86L,
                    0x10e761c927aL,
                    "jetbrains.mps.lang.sharedConcepts.structure.ConceptFunctionParameter_operationContext")
                .getDeclarationNode());
    return result;
  }
  /*package*/ static SNode getExpectedReturnType_idhEwIGRD(@NotNull SNode __thisNode__) {
    return _quotation_createNode_ubklel_a0a2();
  }

  /*package*/ QueryFunction_RemoveBy_Condition__BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) ((Boolean) usesParameterObjectFor_idhEwIGRw(node, (SNode) parameters[0]));
      case 1:
        return (T) ((List<SNode>) getParameters_idhEwIGRM(node));
      case 2:
        return (T) ((SNode) getExpectedReturnType_idhEwIGRD(node));
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept,
      @NotNull SMethod<T> method,
      @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }

  private static SNode _quotation_createNode_ubklel_a0a2() {
    PersistenceFacade facade = PersistenceFacade.getInstance();
    SNode quotedNode_1 = null;
    quotedNode_1 =
        SModelUtil_new.instantiateConceptDeclaration(
            MetaAdapterFactory.getConcept(
                0xf3061a5392264cc5L,
                0xa443f952ceaf5816L,
                0xf940d6513eL,
                "jetbrains.mps.baseLanguage.structure.BooleanType"),
            null,
            null,
            false);
    return quotedNode_1;
  }
}
コード例 #26
0
public final class PrimitiveType__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0xf3061a5392264cc5L,
          0xa443f952ceaf5816L,
          0x10f0ad8bde4L,
          "jetbrains.mps.baseLanguage.structure.PrimitiveType");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<String> getPresentation_idhEwIMiw =
      new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class))
          .name("getPresentation")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwIMiw")
          .registry(REGISTRY)
          .build();
  public static final SMethod<List<String>> getVariableSuffixes_idhEwIzNo =
      new SMethodBuilder<List<String>>(
              new SJavaCompoundTypeImpl((Class<List<String>>) ((Class) Object.class)))
          .name("getVariableSuffixes")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwIzNo")
          .registry(REGISTRY)
          .build();
  public static final SMethod<String> getErasureSignature_idhEwIzNx =
      new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class))
          .name("getErasureSignature")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwIzNx")
          .registry(REGISTRY)
          .build();
  public static final SMethod<SNode> getErasure_idB1mAlA38Mq =
      new SMethodBuilder<SNode>(new SJavaCompoundTypeImpl((Class<SNode>) ((Class) Object.class)))
          .name("getErasure")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("B1mAlA38Mq")
          .registry(REGISTRY)
          .build();
  public static final SMethod<SNode> getJavaType_idhEwIzO1 =
      new SMethodBuilder<SNode>(new SJavaCompoundTypeImpl((Class<SNode>) ((Class) Object.class)))
          .name("getJavaType")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwIzO1")
          .registry(REGISTRY)
          .build();

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(
          getPresentation_idhEwIMiw,
          getVariableSuffixes_idhEwIzNo,
          getErasureSignature_idhEwIzNx,
          getErasure_idB1mAlA38Mq,
          getJavaType_idhEwIzO1);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  /*package*/ static String getPresentation_idhEwIMiw(@NotNull SNode __thisNode__) {
    return SPropertyOperations.getString(
        SNodeOperations.getConceptDeclaration(__thisNode__),
        MetaAdapterFactory.getProperty(
            0xc72da2b97cce4447L,
            0x8389f407dc1158b7L,
            0x1103553c5ffL,
            0x46ab0ad5826c74caL,
            "conceptAlias"));
  }
  /*package*/ static List<String> getVariableSuffixes_idhEwIzNo(@NotNull SNode __thisNode__) {
    return ListSequence.fromListAndArray(
        new ArrayList<String>(),
        SPropertyOperations.getString(
                SNodeOperations.getConceptDeclaration(__thisNode__),
                MetaAdapterFactory.getProperty(
                    0xc72da2b97cce4447L,
                    0x8389f407dc1158b7L,
                    0x1103553c5ffL,
                    0x46ab0ad5826c74caL,
                    "conceptAlias"))
            .substring(0, 1));
  }
  /*package*/ static String getErasureSignature_idhEwIzNx(@NotNull SNode __thisNode__) {
    return SPropertyOperations.getString(
        SNodeOperations.getConceptDeclaration(__thisNode__),
        MetaAdapterFactory.getProperty(
            0xc72da2b97cce4447L,
            0x8389f407dc1158b7L,
            0x1103553c5ffL,
            0x46ab0ad5826c74caL,
            "conceptAlias"));
  }
  /*package*/ static SNode getErasure_idB1mAlA38Mq(@NotNull SNode __thisNode__) {
    return __thisNode__;
  }
  /*package*/ static SNode getJavaType_idhEwIzO1(@NotNull SNode __thisNode__) {
    return __thisNode__;
  }

  /*package*/ PrimitiveType__BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) ((String) getPresentation_idhEwIMiw(node));
      case 1:
        return (T) ((List<String>) getVariableSuffixes_idhEwIzNo(node));
      case 2:
        return (T) ((String) getErasureSignature_idhEwIzNx(node));
      case 3:
        return (T) ((SNode) getErasure_idB1mAlA38Mq(node));
      case 4:
        return (T) ((SNode) getJavaType_idhEwIzO1(node));
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept,
      @NotNull SMethod<T> method,
      @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }
}
コード例 #27
0
public final class CellKeyMapDeclaration__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0x18bc659203a64e29L,
          0xa83a7ff23bde13baL,
          0xfbc216b31bL,
          "jetbrains.mps.lang.editor.structure.CellKeyMapDeclaration");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<SNode> getBaseConcept_id2hxg_BDjKM8 =
      new SMethodBuilder<SNode>(new SJavaCompoundTypeImpl((Class<SNode>) ((Class) Object.class)))
          .name("getBaseConcept")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("2hxg_BDjKM8")
          .registry(REGISTRY)
          .build();
  public static final SMethod<Void> setBaseConcept_id5r_35Ihc58c =
      new SMethodBuilder<Void>(new SJavaCompoundTypeImpl(Void.class))
          .name("setBaseConcept")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("5r_35Ihc58c")
          .registry(REGISTRY)
          .build(SMethodBuilder.createJavaParameter((Class<SNode>) ((Class) Object.class), ""));

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(getBaseConcept_id2hxg_BDjKM8, setBaseConcept_id5r_35Ihc58c);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  /*package*/ static SNode getBaseConcept_id2hxg_BDjKM8(@NotNull SNode __thisNode__) {
    return SLinkOperations.getTarget(
        __thisNode__,
        MetaAdapterFactory.getReferenceLink(
            0x18bc659203a64e29L,
            0xa83a7ff23bde13baL,
            0xfbc216b31bL,
            0x1094c452c15L,
            "applicableConcept"));
  }
  /*package*/ static void setBaseConcept_id5r_35Ihc58c(
      @NotNull SNode __thisNode__, SNode baseConcept) {
    SLinkOperations.setTarget(
        __thisNode__,
        MetaAdapterFactory.getReferenceLink(
            0x18bc659203a64e29L,
            0xa83a7ff23bde13baL,
            0xfbc216b31bL,
            0x1094c452c15L,
            "applicableConcept"),
        baseConcept);
  }

  /*package*/ CellKeyMapDeclaration__BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) ((SNode) getBaseConcept_id2hxg_BDjKM8(node));
      case 1:
        setBaseConcept_id5r_35Ihc58c(node, (SNode) parameters[0]);
        return null;
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept,
      @NotNull SMethod<T> method,
      @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }
}
コード例 #28
0
public final class StringPropertyInstance_BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0xc7d5b9dda05f4be2L,
          0xbc73f2e16994cc67L,
          0x59e9926e84100d04L,
          "jetbrains.mps.baseLanguage.lightweightdsl.structure.StringPropertyInstance");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<SNode> getValueExpression_id3m06Jgserfw =
      new SMethodBuilder<SNode>(new SJavaCompoundTypeImpl((Class<SNode>) ((Class) Object.class)))
          .name("getValueExpression")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("3m06Jgserfw")
          .registry(REGISTRY)
          .build(SParameterImpl.fromList(SJavaCompoundTypeImpl.fromClasses()));

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(getValueExpression_id3m06Jgserfw);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  private static SNode getValueExpression_id3m06Jgserfw(@NotNull SNode __thisNode__) {
    return _quotation_createNode_2ank17_a0a0(
        SPropertyOperations.getString(
            __thisNode__,
            MetaAdapterFactory.getProperty(
                0xc7d5b9dda05f4be2L,
                0xbc73f2e16994cc67L,
                0x59e9926e84100d04L,
                0x59e9926e84100d05L,
                "value")));
  }

  /*package*/ StringPropertyInstance_BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @NotNull Object[] array) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @NotNull Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) getValueExpression_id3m06Jgserfw(node);
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept, @NotNull SMethod<T> method, @NotNull Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }

  private static SNode _quotation_createNode_2ank17_a0a0(Object parameter_1) {
    PersistenceFacade facade = PersistenceFacade.getInstance();
    SNode quotedNode_2 = null;
    quotedNode_2 =
        SModelUtil_new.instantiateConceptDeclaration(
            MetaAdapterFactory.getConcept(
                0xf3061a5392264cc5L,
                0xa443f952ceaf5816L,
                0xf93d565d10L,
                "jetbrains.mps.baseLanguage.structure.StringLiteral"),
            null,
            null,
            false);
    SNodeAccessUtil.setProperty(
        quotedNode_2,
        MetaAdapterFactory.getProperty(
            0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"),
        (String) parameter_1);
    return quotedNode_2;
  }
}
コード例 #29
0
public final class ActionGroupDeclaration_BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT =
      MetaAdapterFactory.getConcept(
          0x28f9e4973b424291L,
          0xaeba0a1039153ab1L,
          0x1181da058d2L,
          "jetbrains.mps.lang.plugin.structure.ActionGroupDeclaration");
  private static final BehaviorRegistry REGISTRY =
      ConceptRegistry.getInstance().getBehaviorRegistry();

  public static final SMethod<String> getGroupPrefix_idhEwJa7y =
      new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class))
          .name("getGroupPrefix")
          .modifiers(SModifiersImpl.create(0, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwJa7y")
          .registry(REGISTRY)
          .build(SParameterImpl.fromList(SJavaCompoundTypeImpl.fromClasses()));
  public static final SMethod<String> getGeneratedName_idhEwJa82 =
      new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class))
          .name("getGeneratedName")
          .modifiers(SModifiersImpl.create(0, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwJa82")
          .registry(REGISTRY)
          .build(SParameterImpl.fromList(SJavaCompoundTypeImpl.fromClasses()));
  public static final SMethod<String> getGeneratedClassFQName_idhEwJa8g =
      new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class))
          .name("getGeneratedClassFQName")
          .modifiers(SModifiersImpl.create(0, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwJa8g")
          .registry(REGISTRY)
          .build(SParameterImpl.fromList(SJavaCompoundTypeImpl.fromClasses()));
  public static final SMethod<SNode> createType_idhEwJimy =
      new SMethodBuilder<SNode>(new SJavaCompoundTypeImpl((Class<SNode>) ((Class) Object.class)))
          .name("createType")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("hEwJimy")
          .registry(REGISTRY)
          .build(SParameterImpl.fromList(SJavaCompoundTypeImpl.fromClasses()));
  public static final SMethod<PropertyReference> getPropertyToCheck_id4cWf37B8oYh =
      new SMethodBuilder<PropertyReference>(
              new SJavaCompoundTypeImpl((Class<PropertyReference>) ((Class) Object.class)))
          .name("getPropertyToCheck")
          .modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC))
          .concept(CONCEPT)
          .id("4cWf37B8oYh")
          .registry(REGISTRY)
          .build(SParameterImpl.fromList(SJavaCompoundTypeImpl.fromClasses()));

  private static final List<SMethod<?>> BH_METHODS =
      Arrays.<SMethod<?>>asList(
          getGroupPrefix_idhEwJa7y,
          getGeneratedName_idhEwJa82,
          getGeneratedClassFQName_idhEwJa8g,
          createType_idhEwJimy,
          getPropertyToCheck_id4cWf37B8oYh);

  private static void ___init___(@NotNull SNode __thisNode__) {}

  private static String getGroupPrefix_idhEwJa7y(@NotNull SNode __thisNode__) {
    String prefix = "";
    SNode parentGroup =
        SNodeOperations.getNodeAncestor(
            __thisNode__,
            MetaAdapterFactory.getConcept(
                0x28f9e4973b424291L,
                0xaeba0a1039153ab1L,
                0x1181da058d2L,
                "jetbrains.mps.lang.plugin.structure.ActionGroupDeclaration"),
            false,
            false);
    if (parentGroup != null) {
      prefix =
          ActionGroupDeclaration_BehaviorDescriptor.getGroupPrefix_idhEwJa7y.invoke(parentGroup)
              + SPropertyOperations.getString(
                  parentGroup,
                  MetaAdapterFactory.getProperty(
                      0xceab519525ea4f22L,
                      0x9b92103b95ca8c0cL,
                      0x110396eaaa4L,
                      0x110396ec041L,
                      "name"));
    }
    return prefix;
  }

  private static String getGeneratedName_idhEwJa82(@NotNull SNode __thisNode__) {
    return ActionGroupDeclaration_BehaviorDescriptor.getGroupPrefix_idhEwJa7y.invoke(__thisNode__)
        + NameUtil.toValidIdentifier(
            SPropertyOperations.getString(
                __thisNode__,
                MetaAdapterFactory.getProperty(
                    0xceab519525ea4f22L,
                    0x9b92103b95ca8c0cL,
                    0x110396eaaa4L,
                    0x110396ec041L,
                    "name")))
        + "_ActionGroup";
  }

  private static String getGeneratedClassFQName_idhEwJa8g(@NotNull SNode __thisNode__) {
    return jetbrains.mps.util.SNodeOperations.getModelLongName(
            SNodeOperations.getModel(__thisNode__))
        + "."
        + ActionGroupDeclaration_BehaviorDescriptor.getGeneratedName_idhEwJa82.invoke(__thisNode__);
  }

  private static SNode createType_idhEwJimy(@NotNull SNode __thisNode__) {
    SNode type =
        SConceptOperations.createNewNode(
            SNodeOperations.asInstanceConcept(
                MetaAdapterFactory.getConcept(
                    0x28f9e4973b424291L,
                    0xaeba0a1039153ab1L,
                    0x119240f9168L,
                    "jetbrains.mps.lang.plugin.structure.GroupType")));
    SLinkOperations.setTarget(
        type,
        MetaAdapterFactory.getReferenceLink(
            0x28f9e4973b424291L,
            0xaeba0a1039153ab1L,
            0x119240f9168L,
            0x119240f916aL,
            "actionGroup"),
        __thisNode__);
    return type;
  }

  private static PropertyReference getPropertyToCheck_id4cWf37B8oYh(@NotNull SNode __thisNode__) {
    return new PropertyReference(__thisNode__, "caption");
  }

  /*package*/ ActionGroupDeclaration_BehaviorDescriptor() {
    super(REGISTRY);
  }

  @Override
  protected void initNode(
      @NotNull SNode node, @NotNull SConstructor constructor, @NotNull Object[] array) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SNode node, @NotNull SMethod<T> method, @NotNull Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) getGroupPrefix_idhEwJa7y(node);
      case 1:
        return (T) getGeneratedName_idhEwJa82(node);
      case 2:
        return (T) getGeneratedClassFQName_idhEwJa8g(node);
      case 3:
        return (T) createType_idhEwJimy(node);
      case 4:
        return (T) getPropertyToCheck_id4cWf37B8oYh(node);
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(
      @NotNull SAbstractConcept concept, @NotNull SMethod<T> method, @NotNull Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }
}
コード例 #30
0
ファイル: TextGen.java プロジェクト: lilongthinker/MPS
 // helper stuff
 @NotNull
 private static TextGenDescriptor getTextGenForNode(SNode node) {
   return ConceptRegistry.getInstance().getTextGenDescriptor(node.getConcept().getId());
 }