Exemplo n.º 1
0
 public static boolean virtual_hasNewLineAfter_3080189811177340429(SNode thisNode) {
   if ((SPropertyOperations.getString(thisNode, "text") == null
           || SPropertyOperations.getString(thisNode, "text").length() == 0)
       && (SNodeOperations.getNextSibling(thisNode) != null)) {
     return !(XmlValuePart_Behavior.call_onNewLine_3080189811177340422(thisNode));
   }
   return false;
 }
Exemplo n.º 2
0
 private static boolean renderingCondition_rjgbfl_a4a(SNode node, EditorContext editorContext) {
   return ListSequence.fromList(
               SLinkOperations.getChildren(
                   node,
                   MetaAdapterFactory.getContainmentLink(
                       0x698a8d22a10447a0L,
                       0xba8d10e3ec237f13L,
                       0x36fb0dc9fd32c1b8L,
                       0x36fb0dc9fd32c1baL,
                       "subTasks")))
           .isEmpty()
       || (SNodeOperations.getNextSibling(node) == null);
 }
Exemplo n.º 3
0
 public static boolean virtual_onNewLine_3080189811177340422(SNode thisNode) {
   SNode left = SNodeOperations.getPrevSibling(thisNode);
   if (SNodeOperations.isInstanceOf(left, "jetbrains.mps.core.xml.structure.XmlValuePart")) {
     SNode leftContent =
         SNodeOperations.cast(left, "jetbrains.mps.core.xml.structure.XmlValuePart");
     return SNodeOperations.isInstanceOf(
             leftContent, "jetbrains.mps.core.xml.structure.XmlTextValue")
         || (SPropertyOperations.getString(thisNode, "text") == null
                 || SPropertyOperations.getString(thisNode, "text").length() == 0)
             && (SNodeOperations.getNextSibling(thisNode) == null);
   }
   return false;
 }
  private boolean isApplicableToNode(final SNode node, final EditorContext editorContext) {
    SNode declarationStmt;
    SNode initializerStmt;

    if (SNodeOperations.isInstanceOf(
            node,
            MetaAdapterFactory.getConcept(
                0xf3061a5392264cc5L,
                0xa443f952ceaf5816L,
                0xf8cc67c7f0L,
                "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement"))
        && SNodeOperations.isInstanceOf(
            SNodeOperations.getNextSibling(node),
            MetaAdapterFactory.getConcept(
                0xf3061a5392264cc5L,
                0xa443f952ceaf5816L,
                0xf8cc56b213L,
                "jetbrains.mps.baseLanguage.structure.ExpressionStatement"))) {
      declarationStmt =
          SNodeOperations.cast(
              node,
              MetaAdapterFactory.getConcept(
                  0xf3061a5392264cc5L,
                  0xa443f952ceaf5816L,
                  0xf8cc67c7f0L,
                  "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement"));
      initializerStmt =
          SNodeOperations.cast(
              SNodeOperations.getNextSibling(node),
              MetaAdapterFactory.getConcept(
                  0xf3061a5392264cc5L,
                  0xa443f952ceaf5816L,
                  0xf8cc56b213L,
                  "jetbrains.mps.baseLanguage.structure.ExpressionStatement"));
    } else {
      if (SNodeOperations.isInstanceOf(
              node,
              MetaAdapterFactory.getConcept(
                  0xf3061a5392264cc5L,
                  0xa443f952ceaf5816L,
                  0xf8cc56b213L,
                  "jetbrains.mps.baseLanguage.structure.ExpressionStatement"))
          && SNodeOperations.isInstanceOf(
              SNodeOperations.getPrevSibling(node),
              MetaAdapterFactory.getConcept(
                  0xf3061a5392264cc5L,
                  0xa443f952ceaf5816L,
                  0xf8cc67c7f0L,
                  "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement"))) {
        declarationStmt =
            SNodeOperations.cast(
                SNodeOperations.getPrevSibling(node),
                MetaAdapterFactory.getConcept(
                    0xf3061a5392264cc5L,
                    0xa443f952ceaf5816L,
                    0xf8cc67c7f0L,
                    "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement"));
        initializerStmt =
            SNodeOperations.cast(
                node,
                MetaAdapterFactory.getConcept(
                    0xf3061a5392264cc5L,
                    0xa443f952ceaf5816L,
                    0xf8cc56b213L,
                    "jetbrains.mps.baseLanguage.structure.ExpressionStatement"));
      } else {
        return false;
      }
    }

    if ((SLinkOperations.getTarget(
            SLinkOperations.getTarget(
                declarationStmt,
                MetaAdapterFactory.getContainmentLink(
                    0xf3061a5392264cc5L,
                    0xa443f952ceaf5816L,
                    0xf8cc67c7f0L,
                    0xf8cc67c7f1L,
                    "localVariableDeclaration")),
            MetaAdapterFactory.getContainmentLink(
                0xf3061a5392264cc5L,
                0xa443f952ceaf5816L,
                0xf8c37a7f6eL,
                0xf8c37f506eL,
                "initializer"))
        == null)) {
      if (SNodeOperations.isInstanceOf(
          SLinkOperations.getTarget(
              initializerStmt,
              MetaAdapterFactory.getContainmentLink(
                  0xf3061a5392264cc5L,
                  0xa443f952ceaf5816L,
                  0xf8cc56b213L,
                  0xf8cc56b214L,
                  "expression")),
          MetaAdapterFactory.getConcept(
              0xf3061a5392264cc5L,
              0xa443f952ceaf5816L,
              0xf8c77f1e96L,
              "jetbrains.mps.baseLanguage.structure.AssignmentExpression"))) {
        SNode assignment =
            SNodeOperations.cast(
                SLinkOperations.getTarget(
                    SNodeOperations.cast(
                        initializerStmt,
                        MetaAdapterFactory.getConcept(
                            0xf3061a5392264cc5L,
                            0xa443f952ceaf5816L,
                            0xf8cc56b213L,
                            "jetbrains.mps.baseLanguage.structure.ExpressionStatement")),
                    MetaAdapterFactory.getContainmentLink(
                        0xf3061a5392264cc5L,
                        0xa443f952ceaf5816L,
                        0xf8cc56b213L,
                        0xf8cc56b214L,
                        "expression")),
                MetaAdapterFactory.getConcept(
                    0xf3061a5392264cc5L,
                    0xa443f952ceaf5816L,
                    0xf8c77f1e96L,
                    "jetbrains.mps.baseLanguage.structure.AssignmentExpression"));
        if (SNodeOperations.isInstanceOf(
                SLinkOperations.getTarget(
                    assignment,
                    MetaAdapterFactory.getContainmentLink(
                        0xf3061a5392264cc5L,
                        0xa443f952ceaf5816L,
                        0x11b0d00332cL,
                        0xf8c77f1e97L,
                        "lValue")),
                MetaAdapterFactory.getConcept(
                    0xf3061a5392264cc5L,
                    0xa443f952ceaf5816L,
                    0xf8c77f1e98L,
                    "jetbrains.mps.baseLanguage.structure.VariableReference"))
            && eq_9fbomu_a0a0b0a0f0e(
                SLinkOperations.getTarget(
                    SNodeOperations.cast(
                        SLinkOperations.getTarget(
                            assignment,
                            MetaAdapterFactory.getContainmentLink(
                                0xf3061a5392264cc5L,
                                0xa443f952ceaf5816L,
                                0x11b0d00332cL,
                                0xf8c77f1e97L,
                                "lValue")),
                        MetaAdapterFactory.getConcept(
                            0xf3061a5392264cc5L,
                            0xa443f952ceaf5816L,
                            0xf8c77f1e98L,
                            "jetbrains.mps.baseLanguage.structure.VariableReference")),
                    MetaAdapterFactory.getReferenceLink(
                        0xf3061a5392264cc5L,
                        0xa443f952ceaf5816L,
                        0xf8c77f1e98L,
                        0xf8cc6bf960L,
                        "variableDeclaration")),
                SLinkOperations.getTarget(
                    declarationStmt,
                    MetaAdapterFactory.getContainmentLink(
                        0xf3061a5392264cc5L,
                        0xa443f952ceaf5816L,
                        0xf8cc67c7f0L,
                        0xf8cc67c7f1L,
                        "localVariableDeclaration")))
            && (boolean)
                AssignmentExpression__BehaviorDescriptor
                    .canConvertToLocalVariableDeclaration_idhLFstkU.invoke(assignment)) {
          return true;
        }
      }
    }
    return false;
  }
    @Override
    public void execute(final SNode node, final EditorContext editorContext) {
      SNode declarationStmt;
      SNode initializerStmt;

      if (SNodeOperations.isInstanceOf(
          node,
          MetaAdapterFactory.getConcept(
              0xf3061a5392264cc5L,
              0xa443f952ceaf5816L,
              0xf8cc67c7f0L,
              "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement"))) {
        declarationStmt =
            SNodeOperations.cast(
                node,
                MetaAdapterFactory.getConcept(
                    0xf3061a5392264cc5L,
                    0xa443f952ceaf5816L,
                    0xf8cc67c7f0L,
                    "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement"));
        initializerStmt =
            SNodeOperations.cast(
                SNodeOperations.getNextSibling(node),
                MetaAdapterFactory.getConcept(
                    0xf3061a5392264cc5L,
                    0xa443f952ceaf5816L,
                    0xf8cc56b213L,
                    "jetbrains.mps.baseLanguage.structure.ExpressionStatement"));
      } else {
        declarationStmt =
            SNodeOperations.cast(
                SNodeOperations.getPrevSibling(node),
                MetaAdapterFactory.getConcept(
                    0xf3061a5392264cc5L,
                    0xa443f952ceaf5816L,
                    0xf8cc67c7f0L,
                    "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement"));
        initializerStmt =
            SNodeOperations.cast(
                node,
                MetaAdapterFactory.getConcept(
                    0xf3061a5392264cc5L,
                    0xa443f952ceaf5816L,
                    0xf8cc56b213L,
                    "jetbrains.mps.baseLanguage.structure.ExpressionStatement"));
      }
      SNodeOperations.deleteNode(initializerStmt);
      SLinkOperations.setTarget(
          SLinkOperations.getTarget(
              declarationStmt,
              MetaAdapterFactory.getContainmentLink(
                  0xf3061a5392264cc5L,
                  0xa443f952ceaf5816L,
                  0xf8cc67c7f0L,
                  0xf8cc67c7f1L,
                  "localVariableDeclaration")),
          MetaAdapterFactory.getContainmentLink(
              0xf3061a5392264cc5L,
              0xa443f952ceaf5816L,
              0xf8c37a7f6eL,
              0xf8c37f506eL,
              "initializer"),
          SLinkOperations.getTarget(
              SNodeOperations.cast(
                  SLinkOperations.getTarget(
                      initializerStmt,
                      MetaAdapterFactory.getContainmentLink(
                          0xf3061a5392264cc5L,
                          0xa443f952ceaf5816L,
                          0xf8cc56b213L,
                          0xf8cc56b214L,
                          "expression")),
                  MetaAdapterFactory.getConcept(
                      0xf3061a5392264cc5L,
                      0xa443f952ceaf5816L,
                      0xf8c77f1e96L,
                      "jetbrains.mps.baseLanguage.structure.AssignmentExpression")),
              MetaAdapterFactory.getContainmentLink(
                  0xf3061a5392264cc5L,
                  0xa443f952ceaf5816L,
                  0x11b0d00332cL,
                  0xf8c77f1e99L,
                  "rValue")));
    }