示例#1
0
  public static SNode virtual_getAttachStatementChild_4797501453850305563(
      SNode thisNode, SNode parentBuilder, SNode parentRef, SNode childRef) {

    SNode result =
        SNodeOperations.copyNode(
            SLinkOperations.getTarget(
                SLinkOperations.getTarget(thisNode, "declaration", false), "set", true));
    for (SNode p :
        SNodeOperations.getDescendants(
            result,
            "jetbrains.mps.baseLanguage.builders.structure.SimpleBuilderPropertyParent",
            false,
            new String[] {})) {
      SNodeOperations.replaceWithAnother(p, SNodeOperations.copyNode(parentRef));
    }
    for (SNode v :
        SNodeOperations.getDescendants(
            result,
            "jetbrains.mps.baseLanguage.builders.structure.SimpleBuilderPropertyValue",
            false,
            new String[] {})) {
      SNodeOperations.replaceWithAnother(v, SNodeOperations.copyNode(childRef));
    }
    return result;
  }
    public void execute(final SNode node, final EditorContext editorContext) {
      SNode templateNode =
          SNodeFactoryOperations.createNewRootNode(
              SNodeOperations.getModel(node),
              "jetbrains.mps.lang.generator.structure.TemplateDeclaration",
              null);
      SNode ruleNode =
          SNodeOperations.getAncestor(
              node, "jetbrains.mps.lang.generator.structure.BaseMappingRule", false, false);
      SLinkOperations.setTarget(
          templateNode,
          "applicableConcept",
          SLinkOperations.getTarget(ruleNode, "applicableConcept", false),
          false);
      SPropertyOperations.set(templateNode, "name", "template1");
      SLinkOperations.setTarget(
          templateNode, "contentNode", SLinkOperations.getTarget(node, "templateNode", true), true);
      SPropertyOperations.set(
          templateNode,
          "virtualPackage",
          SPropertyOperations.getString(SNodeOperations.getContainingRoot(node), "virtualPackage"));

      SNode templateRefNode =
          SNodeFactoryOperations.replaceWithNewChild(
              node, "jetbrains.mps.lang.generator.structure.TemplateDeclarationReference");
      SLinkOperations.setTarget(templateRefNode, "template", templateNode, false);

      SelectionUtil.selectNode(editorContext, templateNode);
    }
 public static boolean call_hasAnnotation_5499146221535822693(
     SNode __thisNode__, SNode annotation) {
   for (SNode annotationInstance :
       SLinkOperations.getChildren(
           __thisNode__,
           MetaAdapterFactory.getContainmentLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x114a6be947aL,
               0x114a6beb0bdL,
               "annotation"))) {
     if (SLinkOperations.getTarget(
             annotationInstance,
             MetaAdapterFactory.getReferenceLink(
                 0xf3061a5392264cc5L,
                 0xa443f952ceaf5816L,
                 0x114a6b4ccabL,
                 0x114a6b85d40L,
                 "annotation"))
         == annotation) {
       return true;
     }
   }
   return false;
 }
 private String createMethodParameterTypesString(SNode method, Map<SNode, SNode> typeByTypeVar) {
   StringBuilder result = new StringBuilder();
   for (SNode parm :
       SLinkOperations.getChildren(
           method,
           MetaAdapterFactory.getContainmentLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0xf8cc56b1fcL,
               0xf8cc56b1feL,
               "parameter"))) {
     SNode type =
         SLinkOperations.getTarget(
             parm,
             MetaAdapterFactory.getContainmentLink(
                 0xf3061a5392264cc5L,
                 0xa443f952ceaf5816L,
                 0x450368d90ce15bc3L,
                 0x4ed4d318133c80ceL,
                 "type"));
     type = GenericTypesUtil.getTypeWithResolvedTypeVars(type, typeByTypeVar);
     if (result.length() > 0) {
       result.append(',');
     }
     if (type != null) {
       result.append(
           ((String)
               BHReflection.invoke(
                   type, SMethodTrimmedId.create("getErasureSignature", null, "hEwIzNx"))));
     } else {
       result.append("");
     }
   }
   return result.toString();
 }
 public void execute(final SNode node, final EditorContext editorContext) {
   // produce throw statement
   SNode throwStatement =
       SNodeFactoryOperations.createNewNode(
           "jetbrains.mps.baseLanguage.structure.ThrowStatement", null);
   SNode newExpr = _quotation_createNode_a1x6vi_a0c0a();
   SLinkOperations.setTarget(throwStatement, "throwable", newExpr, true);
   // produce if statement
   SNode ifStatement =
       SNodeFactoryOperations.createNewNode(
           "jetbrains.mps.baseLanguage.structure.IfStatement", null);
   SNode notExpr =
       SNodeFactoryOperations.setNewChild(
           ifStatement, "condition", "jetbrains.mps.baseLanguage.structure.NotExpression");
   SLinkOperations.setTarget(
       notExpr, "expression", SLinkOperations.getTarget(node, "condition", true), true);
   SNodeFactoryOperations.setNewChild(
       ifStatement, "ifTrue", "jetbrains.mps.baseLanguage.structure.StatementList");
   ListSequence.fromList(
           SLinkOperations.getTargets(
               SLinkOperations.getTarget(ifStatement, "ifTrue", true), "statement", true))
       .insertElement(0, throwStatement);
   // replace assert with if
   SNodeOperations.replaceWithAnother(node, ifStatement);
 }
 private static boolean renderingCondition_arlg9k_a1a(
     SNode node, EditorContext editorContext, IScope scope) {
   return ListSequence.fromList(
           SLinkOperations.getTargets(
               SLinkOperations.getTarget(node, "baseMethodDeclaration", false), "parameter", true))
       .isNotEmpty();
 }
示例#7
0
 public static void nodeFactory_NodeSetup_CoerceExpression_1178879020941(
     final IOperationContext operationContext, final NodeSetupContext _context) {
   if (SNodeOperations.isInstanceOf(
       _context.getSampleNode(), "jetbrains.mps.lang.typesystem.structure.CoerceExpression")) {
     SLinkOperations.setTarget(
         _context.getNewNode(),
         "nodeToCoerce",
         SLinkOperations.getTarget(
             SNodeOperations.cast(
                 _context.getSampleNode(),
                 "jetbrains.mps.lang.typesystem.structure.CoerceExpression"),
             "nodeToCoerce",
             true),
         true);
     SLinkOperations.setTarget(
         _context.getNewNode(),
         "pattern",
         SLinkOperations.getTarget(
             SNodeOperations.cast(
                 _context.getSampleNode(),
                 "jetbrains.mps.lang.typesystem.structure.CoerceExpression"),
             "pattern",
             true),
         true);
   }
 }
 public void applyRule(
     final SNode op, final TypeCheckingContext typeCheckingContext, IsApplicableStatus status) {
   {
     SNode _nodeToCheck_1029348928467 = op;
     EquationInfo _info_12389875345 =
         new EquationInfo(
             _nodeToCheck_1029348928467,
             null,
             "r:00000000-0000-4000-0000-011c895902f1(jetbrains.mps.lang.generator.generationContext.typesystem)",
             "1216860931325",
             0,
             null);
     typeCheckingContext.createEquation(
         (SNode)
             typeCheckingContext.typeOf(
                 _nodeToCheck_1029348928467,
                 "r:00000000-0000-4000-0000-011c895902f1(jetbrains.mps.lang.generator.generationContext.typesystem)",
                 "1216860931336",
                 true),
         (SNode)
             _quotation_createNode_tgcadk_a0a0b(
                 SLinkOperations.getTarget(
                     SLinkOperations.getTarget(op, "label", false), "targetConcept", false)),
         _info_12389875345);
   }
 }
示例#9
0
  public SNode convertField(PsiField x, SNode parentConcept) {
    SNode field;
    if (isStatic(x)
        || SConceptOperations.isSubConceptOf(
            parentConcept, "jetbrains.mps.baseLanguage.structure.Interface")) {
      field =
          SConceptOperations.createNewNode(
              "jetbrains.mps.baseLanguage.structure.StaticFieldDeclaration", null);
    } else {
      field =
          SConceptOperations.createNewNode(
              "jetbrains.mps.baseLanguage.structure.FieldDeclaration", null);
      SPropertyOperations.set(
          SNodeOperations.cast(field, "jetbrains.mps.baseLanguage.structure.FieldDeclaration"),
          "isVolatile",
          "" + (x.hasModifierProperty(PsiModifier.VOLATILE)));
      SPropertyOperations.set(
          SNodeOperations.cast(field, "jetbrains.mps.baseLanguage.structure.FieldDeclaration"),
          "isTransient",
          "" + (x.hasModifierProperty(PsiModifier.TRANSIENT)));
    }

    SPropertyOperations.set(field, "name", x.getName());
    SLinkOperations.setTarget(
        SNodeOperations.cast(field, "jetbrains.mps.baseLanguage.structure.ClassifierMember"),
        "visibility",
        getVisibility(x),
        true);
    SPropertyOperations.set(field, "isFinal", "" + (isFinal(x)));
    SLinkOperations.setTarget(field, "type", convertType(x.getType()), true);
    addAnnotations(x, field);

    return field;
  }
 public void applyRule(
     final SNode efr, final TypeCheckingContext typeCheckingContext, IsApplicableStatus status) {
   {
     SNode _nodeToCheck_1029348928467 = efr;
     EquationInfo _info_12389875345 =
         new EquationInfo(
             _nodeToCheck_1029348928467,
             null,
             "r:4b1ddbe6-5067-4a27-8697-eb786b50451b(jetbrains.mps.lang.extension.typesystem)",
             "7036359038356115138",
             0,
             null);
     typeCheckingContext.createEquation(
         (SNode)
             typeCheckingContext.typeOf(
                 _nodeToCheck_1029348928467,
                 "r:4b1ddbe6-5067-4a27-8697-eb786b50451b(jetbrains.mps.lang.extension.typesystem)",
                 "7036359038356115126",
                 true),
         (SNode)
             SLinkOperations.getTarget(
                 SLinkOperations.getTarget(efr, "declaration", false), "fieldType", true),
         _info_12389875345);
   }
 }
  private static SNode getDependencyTarget_id4RsV8qJH_ED(
      @NotNull SNode __thisNode__, VisibleArtifacts artifacts) {
    if (SNodeOperations.getContainingRoot(__thisNode__)
        == SNodeOperations.getContainingRoot(
            SLinkOperations.getTarget(
                __thisNode__,
                MetaAdapterFactory.getReferenceLink(
                    0x798100da4f0a421aL,
                    0xb99171f8c50ce5d2L,
                    0x4ddcec86afb65a3fL,
                    0x4ddcec86afb65a40L,
                    "folder")))) {
      return null;
    }

    return JavaExportUtil.requireJarFolder(
        artifacts,
        SLinkOperations.getTarget(
            __thisNode__,
            MetaAdapterFactory.getReferenceLink(
                0x798100da4f0a421aL,
                0xb99171f8c50ce5d2L,
                0x4ddcec86afb65a3fL,
                0x4ddcec86afb65a40L,
                "folder")),
        __thisNode__);
  }
 public void doGenerateText(SNode node) {
   if (getBuffer().hasPositionsSupport()) {
     TraceInfoGenerationUtil.createPositionInfo(this, node);
   }
   for (SNode item : SLinkOperations.getTargets(node, "item", true)) {
     if (item != ListSequence.fromList(SLinkOperations.getTargets(node, "item", true)).first()) {
       TextGenManager.instance()
           .appendNodeText(
               this.getContext(),
               this.getBuffer(),
               SLinkOperations.getTarget(node, "separator", true),
               this.getSNode());
     }
     TextGenManager.instance()
         .appendNodeText(this.getContext(), this.getBuffer(), item, this.getSNode());
   }
   if (getBuffer().hasPositionsSupport()) {
     {
       String traceableProperty = "";
       try {
         traceableProperty =
             BehaviorReflection.invokeVirtual(
                 String.class,
                 SNodeOperations.cast(
                     node, "jetbrains.mps.lang.traceable.structure.TraceableConcept"),
                 "virtual_getTraceableProperty_5067982036267369901",
                 new Object[] {});
       } catch (Throwable t) {
         LOG.error("Can't calculate traceable prorerty for a node " + node + ".", t);
       }
       TraceInfoGenerationUtil.fillPositionInfo(this, node, traceableProperty);
     }
   }
 }
示例#13
0
 public void execute(final SNode node, final EditorContext editorContext) {
   String name = CreateFromUsageUtil.getText(editorContext);
   if (name == null || name.length() == 0) {
     name = "default_" + SPropertyOperations.getString(node, "name");
   }
   SNode t =
       SNodeFactoryOperations.createNewRootNode(
           SNodeOperations.getModel(node),
           "jetbrains.mps.lang.generator.structure.TemplateDeclaration",
           null);
   SPropertyOperations.set(t, "name", name);
   t.setProperty(
       SModelTreeNode.PACK,
       SPropertyOperations.getString(
           SNodeOperations.cast(
               SNodeOperations.getContainingRoot(node),
               "jetbrains.mps.lang.core.structure.BaseConcept"),
           "virtualPackage"));
   // make reference
   SNode tr =
       SNodeFactoryOperations.createNewNode(
           "jetbrains.mps.lang.generator.structure.TemplateDeclarationReference", null);
   SLinkOperations.setTarget(tr, "template", t, false);
   SLinkOperations.setTarget(node, "defaultConsequence", tr, true);
 }
示例#14
0
 public static boolean baseMappingRule_Condition_1217891542034(
     final BaseMappingRuleContext _context) {
   return SNodeOperations.isInstanceOf(
       SLinkOperations.getTarget(
           SNodeOperations.as(
               SLinkOperations.getTarget(
                   _context.getNode(),
                   MetaAdapterFactory.getContainmentLink(
                       0xf3061a5392264cc5L,
                       0xa443f952ceaf5816L,
                       0x11b0d00332cL,
                       0xf8c77f1e97L,
                       "lValue")),
               MetaAdapterFactory.getConcept(
                   0xf3061a5392264cc5L,
                   0xa443f952ceaf5816L,
                   0x116b46a08c4L,
                   "jetbrains.mps.baseLanguage.structure.DotExpression")),
           MetaAdapterFactory.getContainmentLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0x116b46a08c4L,
               0x116b46b36c4L,
               "operation")),
       MetaAdapterFactory.getConcept(
           0xd7706f639be2479cL,
           0xa3daae92af1e64d5L,
           0x11b8fe60348L,
           "jetbrains.mps.lang.generator.generationContext.structure.GenerationContextOp_UserObjectAccessBase"));
 }
 public static boolean call_isVariableDefinedInThisMethod_1225456272518(SNode thisNode) {
   // todo: method from LocalVariableReference. Remove
   if (!(SNodeOperations.isInstanceOf(
       SLinkOperations.getTarget(thisNode, "variableDeclaration", false),
       "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"))) {
     throw new IllegalArgumentException();
   }
   SNode anchor = thisNode;
   if ((SNodeOperations.getAncestor(
           thisNode, "jetbrains.mps.lang.quotation.structure.AbstractAntiquotation", false, false)
       != null)) {
     anchor =
         SNodeOperations.getAncestor(
             thisNode, "jetbrains.mps.lang.quotation.structure.Quotation", false, false);
   }
   if (SNodeOperations.getAncestor(
           anchor, "jetbrains.mps.baseLanguage.structure.BaseMethodDeclaration", false, false)
       == SNodeOperations.getAncestor(
           SLinkOperations.getTarget(thisNode, "variableDeclaration", false),
           "jetbrains.mps.baseLanguage.structure.BaseMethodDeclaration",
           false,
           false)) {
     if (SNodeOperations.getAncestor(
             anchor, "jetbrains.mps.baseLanguage.structure.Closureoid", false, false)
         == SNodeOperations.getAncestor(
             SLinkOperations.getTarget(thisNode, "variableDeclaration", false),
             "jetbrains.mps.baseLanguage.structure.Closureoid",
             false,
             false)) {
       return true;
     }
   }
   return false;
 }
示例#16
0
 public static boolean baseMappingRule_Condition_1196428788645(
     final BaseMappingRuleContext _context) {
   return SNodeOperations.isInstanceOf(
           TypeChecker.getInstance()
               .getTypeOf(
                   SLinkOperations.getTarget(
                       _context.getNode(),
                       MetaAdapterFactory.getContainmentLink(
                           0xf3061a5392264cc5L,
                           0xa443f952ceaf5816L,
                           0xfbdeb6fecfL,
                           0xfbdeb7a11cL,
                           "leftExpression"))),
           MetaAdapterFactory.getConcept(
               0xff24ab03965e4d15L,
               0x9aed52dc276658f4L,
               0x11686a0422aL,
               "jetbrains.mps.samples.complex.structure.ComplexType"))
       && TypeChecker.getInstance()
           .getSubtypingManager()
           .isSubtype(
               TypeChecker.getInstance()
                   .getTypeOf(
                       SLinkOperations.getTarget(
                           _context.getNode(),
                           MetaAdapterFactory.getContainmentLink(
                               0xf3061a5392264cc5L,
                               0xa443f952ceaf5816L,
                               0xfbdeb6fecfL,
                               0xfbdeb7a11bL,
                               "rightExpression"))),
               _quotation_createNode_x583g4_b0a0a0c());
 }
 public void execute(SNode node) {
   if ((boolean)
       Expression__BehaviorDescriptor.singleValue_id1o8Ht9sES3u.invoke(
           SNodeOperations.asSConcept(
               SNodeOperations.getConceptDeclaration(
                   SLinkOperations.getTarget(
                       ((SNode)
                           RemoveUnnecessaryParentheses_QuickFix.this
                               .getField("bottomLineParens")[0]),
                       MetaAdapterFactory.getContainmentLink(
                           0xf3061a5392264cc5L,
                           0xa443f952ceaf5816L,
                           0xfb4ed32b7fL,
                           0xfb4ed32b80L,
                           "expression")))))) {
     SNodeOperations.replaceWithAnother(
         node,
         SLinkOperations.getTarget(
             ((SNode) RemoveUnnecessaryParentheses_QuickFix.this.getField("bottomLineParens")[0]),
             MetaAdapterFactory.getContainmentLink(
                 0xf3061a5392264cc5L,
                 0xa443f952ceaf5816L,
                 0xfb4ed32b7fL,
                 0xfb4ed32b80L,
                 "expression")));
   }
   SNodeOperations.replaceWithAnother(
       node, ((SNode) RemoveUnnecessaryParentheses_QuickFix.this.getField("bottomLineParens")[0]));
 }
 private String getNodeName(SNode node, boolean isLast)
     throws ArtifactsRelativePathHelper.RelativePathException {
   if (SNodeOperations.isInstanceOf(node, "jetbrains.mps.build.structure.BuildLayout_Folder")) {
     return getBSName(
         SLinkOperations.getTarget(
             SNodeOperations.cast(node, "jetbrains.mps.build.structure.BuildLayout_Folder"),
             "containerName",
             true));
   } else if (SNodeOperations.isInstanceOf(node, "jetbrains.mps.build.structure.BuildLayout_Copy")
       && isLast) {
     SNode fileset =
         SLinkOperations.getTarget(
             SNodeOperations.cast(node, "jetbrains.mps.build.structure.BuildLayout_Copy"),
             "fileset",
             true);
     if (SNodeOperations.isInstanceOf(
         fileset, "jetbrains.mps.build.structure.BuildInputSingleFile")) {
       return BuildSourcePath_Behavior.call_getLastSegment_1368030936106771141(
           SLinkOperations.getTarget(
               SNodeOperations.cast(fileset, "jetbrains.mps.build.structure.BuildInputSingleFile"),
               "path",
               true),
           null);
     } else {
       throw new ArtifactsRelativePathHelper.RelativePathException(
           "cannot build relative path for copy, fileset is " + node.getConceptShortName());
     }
   }
   throw new ArtifactsRelativePathHelper.RelativePathException(
       "cannot build relative path for " + node.getConceptShortName());
 }
示例#19
0
 public static void nodeFactory_NodeSetup_IsSubtypeExpression_1177408248540(
     final IOperationContext operationContext, final NodeSetupContext _context) {
   if (SNodeOperations.isInstanceOf(
       _context.getSampleNode(), "jetbrains.mps.lang.typesystem.structure.IsSubtypeExpression")) {
     SLinkOperations.setTarget(
         _context.getNewNode(),
         "subtypeExpression",
         SLinkOperations.getTarget(
             SNodeOperations.cast(
                 _context.getSampleNode(),
                 "jetbrains.mps.lang.typesystem.structure.IsSubtypeExpression"),
             "subtypeExpression",
             true),
         true);
     SLinkOperations.setTarget(
         _context.getNewNode(),
         "supertypeExpression",
         SLinkOperations.getTarget(
             SNodeOperations.cast(
                 _context.getSampleNode(),
                 "jetbrains.mps.lang.typesystem.structure.IsSubtypeExpression"),
             "supertypeExpression",
             true),
         true);
   }
 }
示例#20
0
 public void build(
     final IOperationContext operationContext, final DataFlowBuilderContext _context) {
   _context
       .getBuilder()
       .build(
           (SNode)
               SLinkOperations.getTarget(
                   _context.getNode(),
                   MetaAdapterFactory.getContainmentLink(
                       0xf61473f9130f42f6L,
                       0xb98d6c438812c2f6L,
                       0x74f562a3a993fd3dL,
                       0x74f562a3a993fd44L,
                       "expected")));
   _context
       .getBuilder()
       .build(
           (SNode)
               SLinkOperations.getTarget(
                   _context.getNode(),
                   MetaAdapterFactory.getContainmentLink(
                       0xf61473f9130f42f6L,
                       0xb98d6c438812c2f6L,
                       0x74f562a3a993fd3dL,
                       0x74f562a3a993fd45L,
                       "actual")));
 }
示例#21
0
 public static void nodeFactory_NodeSetup_TypeOfExpression_1179476271704(
     final IOperationContext operationContext, final NodeSetupContext _context) {
   if (SNodeOperations.isInstanceOf(
       _context.getSampleNode(), "jetbrains.mps.baseLanguage.structure.Expression")) {
     if (!(SNodeOperations.isInstanceOf(
         _context.getSampleNode(), "jetbrains.mps.lang.typesystem.structure.TypeOfExpression"))) {
       SLinkOperations.setTarget(
           _context.getNewNode(),
           "term",
           SNodeOperations.cast(
               _context.getSampleNode(), "jetbrains.mps.baseLanguage.structure.Expression"),
           true);
     } else {
       SLinkOperations.setTarget(
           _context.getNewNode(),
           "term",
           SLinkOperations.getTarget(
               SNodeOperations.cast(
                   _context.getSampleNode(),
                   "jetbrains.mps.lang.typesystem.structure.TypeOfExpression"),
               "term",
               true),
           true);
     }
   }
 }
示例#22
0
 public Set<? extends IVertex> getNexts() {
   if (targets == null) {
     if (ListSequence.fromList(SLinkOperations.getTargets(module, "dependencies", true))
         .isEmpty()) {
       targets = Collections.emptySet();
     } else {
       targets = new HashSet<CycleHelper.Module>();
       for (SNode ref :
           ListSequence.fromList(SLinkOperations.getTargets(module, "dependencies", true))
               .where(
                   new IWhereFilter<SNode>() {
                     public boolean accept(SNode it) {
                       return SNodeOperations.isInstanceOf(
                           it, "jetbrains.mps.build.workflow.structure.BwfJavaModuleReference");
                     }
                   })) {
         CycleHelper.Module tm =
             map.get(
                 SLinkOperations.getTarget(
                     SNodeOperations.cast(
                         ref, "jetbrains.mps.build.workflow.structure.BwfJavaModuleReference"),
                     "target",
                     false));
         if (tm == null) {
           genContext.showErrorMessage(ref, "internal problem: unsatisfied local dependency");
         } else {
           targets.add(tm);
         }
       }
     }
   }
   return targets;
 }
 public void applyRule(
     final SNode annotationInstance,
     final TypeCheckingContext typeCheckingContext,
     IsApplicableStatus status) {
   SNode annotation = SLinkOperations.getTarget(annotationInstance, "annotation", false);
   for (SNode annotationMethod : SLinkOperations.getTargets(annotation, "method", true)) {
     if ((SLinkOperations.getTarget(annotationMethod, "defaultValue", true) != null)) {
       continue;
     }
     boolean found = false;
     for (SNode annotationInstanceValue :
         SLinkOperations.getTargets(annotationInstance, "value", true)) {
       if (SLinkOperations.getTarget(annotationInstanceValue, "key", false) == annotationMethod) {
         found = true;
         break;
       }
     }
     if (!(found)) {
       {
         MessageTarget errorTarget = new NodeMessageTarget();
         IErrorReporter _reporter_2309309498 =
             typeCheckingContext.reportTypeError(
                 annotationInstance,
                 "'"
                     + SPropertyOperations.getString(annotationMethod, "name")
                     + "' missing though required",
                 "r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)",
                 "6624237184121162632",
                 null,
                 errorTarget);
       }
     }
   }
 }
 private boolean nodeCondition_d5p1uc_a2a() {
   return (SLinkOperations.getTarget(
               myNode,
               MetaAdapterFactory.getReferenceLink(
                   0xf3061a5392264cc5L,
                   0xa443f952ceaf5816L,
                   0x114a6b4ccabL,
                   0x114a6b85d40L,
                   "annotation"))
           != null)
       && ListSequence.fromList(
               SLinkOperations.getChildren(
                   SLinkOperations.getTarget(
                       myNode,
                       MetaAdapterFactory.getReferenceLink(
                           0xf3061a5392264cc5L,
                           0xa443f952ceaf5816L,
                           0x114a6b4ccabL,
                           0x114a6b85d40L,
                           "annotation")),
                   MetaAdapterFactory.getContainmentLink(
                       0xf3061a5392264cc5L,
                       0xa443f952ceaf5816L,
                       0x101d9d3ca30L,
                       0x101f2cc410bL,
                       "method")))
           .isNotEmpty();
 }
示例#25
0
 public void synchronize() {
   Set<SNode> existingBlocks = new HashSet<SNode>(myBlocks);
   ListIterator<SNode> blocksIterator = myBlocks.listIterator();
   Set<SNode> existingConnectors = new HashSet<SNode>(myConnectors);
   ListIterator<SNode> connectorsIterator = myConnectors.listIterator();
   syncDiagramElements(
       SLinkOperations.getTargets(getSNode(), "component", true),
       blocksIterator,
       existingBlocks,
       connectorsIterator,
       existingConnectors);
   syncDiagramElements(
       ListSequence.fromList(SLinkOperations.getTargets(getSNode(), "component", true))
           .translate(
               new ITranslator2<SNode, SNode>() {
                 public Iterable<SNode> translate(SNode it) {
                   return SLinkOperations.getTargets(it, "dep", true);
                 }
               }),
       blocksIterator,
       existingBlocks,
       connectorsIterator,
       existingConnectors);
   purgeTailNodes(blocksIterator);
   purgeTailNodes(connectorsIterator);
 }
 private static void attachReference_id2wBFdLy8qmn(@NotNull SNode __thisNode__, SNode reference) {
   assert IReferenceAttachable_BehaviorDescriptor.canAttachReference_id2wBFdLy7HtS.invoke(
       __thisNode__, reference);
   SLinkOperations.setTarget(
       __thisNode__,
       MetaAdapterFactory.getContainmentLink(
           0x8585453e6bfb4d80L,
           0x98deb16074f1d86cL,
           0x73a7cdcfbbbf8aadL,
           0x73a7cdcfbbbf8c41L,
           "warningRef"),
       SConceptOperations.createNewNode(
           SNodeOperations.asInstanceConcept(
               MetaAdapterFactory.getConcept(
                   0x8585453e6bfb4d80L,
                   0x98deb16074f1d86cL,
                   0x6abc06f5f4af0d67L,
                   "jetbrains.mps.lang.test.structure.UnknownRuleReference"))));
   SLinkOperations.setTarget(
       SLinkOperations.getTarget(
           __thisNode__,
           MetaAdapterFactory.getContainmentLink(
               0x8585453e6bfb4d80L,
               0x98deb16074f1d86cL,
               0x73a7cdcfbbbf8aadL,
               0x73a7cdcfbbbf8c41L,
               "warningRef")),
       MetaAdapterFactory.getReferenceLink(
           0x8585453e6bfb4d80L,
           0x98deb16074f1d86cL,
           0x6abc06f5f4afab9dL,
           0x73a7cdcfba51f755L,
           "declaration"),
       reference);
 }
 public static String call_getErasureSignature_2830572026628006618(SNode __thisNode__) {
   StringBuilder sb = new StringBuilder();
   List<SNode> parameters =
       SLinkOperations.getChildren(
           __thisNode__,
           MetaAdapterFactory.getContainmentLink(
               0xf3061a5392264cc5L,
               0xa443f952ceaf5816L,
               0xf8cc56b1fcL,
               0xf8cc56b1feL,
               "parameter"));
   for (int i = 0; i < ListSequence.fromList(parameters).count(); i++) {
     SNode param = ListSequence.fromList(parameters).getElement(i);
     sb.append(
         Type_BehaviorDescriptor.getErasureSignature_idhEwIzNx.invoke(
             SLinkOperations.getTarget(
                 param,
                 MetaAdapterFactory.getContainmentLink(
                     0xf3061a5392264cc5L,
                     0xa443f952ceaf5816L,
                     0x450368d90ce15bc3L,
                     0x4ed4d318133c80ceL,
                     "type"))));
     if (i < ListSequence.fromList(parameters).count() - 1) {
       sb.append(",");
     }
   }
   return sb.toString();
 }
 public static boolean call_isParameterOfThisMethod_1240394425603(SNode thisNode) {
   // todo: method from ParameterReference. Remove.
   if (!(SNodeOperations.isInstanceOf(
       SLinkOperations.getTarget(thisNode, "variableDeclaration", false),
       "jetbrains.mps.baseLanguage.structure.ParameterDeclaration"))) {
     throw new IllegalArgumentException();
   }
   if (SNodeOperations.getAncestor(
           thisNode, "jetbrains.mps.baseLanguage.structure.BaseMethodDeclaration", false, false)
       == SNodeOperations.getAncestor(
           SLinkOperations.getTarget(thisNode, "variableDeclaration", false),
           "jetbrains.mps.baseLanguage.structure.BaseMethodDeclaration",
           false,
           false)) {
     if (SNodeOperations.getAncestor(
             thisNode, "jetbrains.mps.baseLanguage.structure.Closureoid", false, false)
         == SNodeOperations.getAncestor(
             SLinkOperations.getTarget(thisNode, "variableDeclaration", false),
             "jetbrains.mps.baseLanguage.structure.Closureoid",
             false,
             false)) {
       return true;
     }
   }
   return false;
 }
 /*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;
 }
 public static List<SNode> call_getProperties_5389689214217081373(
     SNode __thisNode__, SModel model) {
   List<SNode> result = new ArrayList<SNode>();
   for (SNode a :
       SimpleBuilderDeclaration_BehaviorDescriptor.getAncestors_id6K2Bohp6U4S.invoke(
           __thisNode__)) {
     ListSequence.fromList(result)
         .addSequence(
             ListSequence.fromList(
                 SLinkOperations.getChildren(
                     a,
                     MetaAdapterFactory.getContainmentLink(
                         0x132aa4d8a3f7441cL,
                         0xa7eb3fce23492c6aL,
                         0x6524536b2e1a1e38L,
                         0x4acc05c8d729d207L,
                         "property"))));
   }
   for (SNode ext :
       SimpleBuilderDeclaration_BehaviorDescriptor.getExtensions_id6K2Bohp73wF.invoke(
           __thisNode__, model)) {
     ListSequence.fromList(result)
         .addSequence(
             ListSequence.fromList(
                 SLinkOperations.getChildren(
                     ext,
                     MetaAdapterFactory.getContainmentLink(
                         0x132aa4d8a3f7441cL,
                         0xa7eb3fce23492c6aL,
                         0x56cd40dfa78dcaf3L,
                         0x56cd40dfa78dcaf5L,
                         "property"))));
   }
   return result;
 }