public List<Block> generateSubBlocks() {

    // For binary expressions
    PsiElement blockPsi = myNode.getPsi();

    if (blockPsi instanceof GrBinaryExpression
        && !(blockPsi.getParent() instanceof GrBinaryExpression)) {
      return generateForBinaryExpr();
    }

    // For multiline strings
    if ((myNode.getElementType() == mSTRING_LITERAL || myNode.getElementType() == mGSTRING_LITERAL)
        && myBlock.getTextRange().equals(myNode.getTextRange())) {
      String text = myNode.getText();
      if (text.length() > 6) {
        if (text.substring(0, 3).equals("'''") && text.substring(text.length() - 3).equals("'''")
            || text.substring(0, 3).equals("\"\"\"")
                & text.substring(text.length() - 3).equals("\"\"\"")) {
          return generateForMultiLineString();
        }
      }
    }

    if (myNode.getElementType() == mGSTRING_BEGIN
        && myBlock.getTextRange().equals(myNode.getTextRange())) {
      String text = myNode.getText();
      if (text.length() > 3) {
        if (text.substring(0, 3).equals("\"\"\"")) {
          return generateForMultiLineGStringBegin();
        }
      }
    }

    // for gstrings
    if (myNode.getElementType() == GSTRING) {
      final ArrayList<Block> subBlocks = new ArrayList<Block>();
      ASTNode[] children = getGroovyChildren(myNode);
      for (ASTNode childNode : children) {
        if (childNode.getTextRange().getLength() > 0) {
          final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode);
          subBlocks.add(
              new GroovyBlock(
                  childNode,
                  myAlignment,
                  indent,
                  myWrap,
                  mySettings,
                  myGroovySettings,
                  myInnerAlignments));
        }
      }
      return subBlocks;
    }

    // chained properties, calls, indexing, etc
    if (NESTED.contains(myNode.getElementType())
        && blockPsi.getParent() != null
        && !NESTED.contains(blockPsi.getParent().getNode().getElementType())) {
      final List<Block> subBlocks = new ArrayList<Block>();
      Alignment dotsAlignment =
          mySettings.ALIGN_MULTILINE_CHAINED_METHODS ? Alignment.createAlignment() : null;
      addNestedChildren(myNode.getPsi(), subBlocks, dotsAlignment, true);
      return subBlocks;
    }

    // For Parameter lists
    if (isListLikeClause(blockPsi)) {
      final ArrayList<Block> subBlocks = new ArrayList<Block>();
      List<ASTNode> astNodes = visibleChildren(myNode);
      final Alignment newAlignment =
          mustAlign(blockPsi, astNodes) ? Alignment.createAlignment() : null;
      for (ASTNode childNode : astNodes) {
        final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode);
        subBlocks.add(
            new GroovyBlock(
                childNode,
                isKeyword(childNode) ? null : newAlignment,
                indent,
                myWrap,
                mySettings,
                myGroovySettings,
                myInnerAlignments));
      }
      return subBlocks;
    }

    boolean classLevel = blockPsi instanceof GrTypeDefinitionBody;
    if (blockPsi instanceof GrCodeBlock || blockPsi instanceof GroovyFile || classLevel) {
      List<ASTNode> children = visibleChildren(myNode);
      calculateAlignments(children, classLevel);
      final ArrayList<Block> subBlocks = new ArrayList<Block>();
      for (ASTNode childNode : children) {
        final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode);
        Alignment alignmentToUse =
            classLevel ? myAlignment : myInnerAlignments.get(childNode.getPsi());
        subBlocks.add(
            new GroovyBlock(
                childNode,
                alignmentToUse,
                indent,
                myWrap,
                mySettings,
                myGroovySettings,
                myInnerAlignments));
      }
      return subBlocks;
    }

    // For other cases
    final ArrayList<Block> subBlocks = new ArrayList<Block>();
    for (ASTNode childNode : visibleChildren(myNode)) {
      final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode);
      subBlocks.add(
          new GroovyBlock(
              childNode,
              myInnerAlignments.get(childNode.getPsi()),
              indent,
              myWrap,
              mySettings,
              myGroovySettings,
              myInnerAlignments));
    }
    return subBlocks;
  }
  public List<Block> generateSubBlocks() {

    // For binary expressions
    PsiElement blockPsi = myNode.getPsi();

    if (blockPsi instanceof GrBinaryExpression
        && !(blockPsi.getParent() instanceof GrBinaryExpression)) {
      return generateForBinaryExpr();
    }

    // For multiline strings
    if ((myNode.getElementType() == mSTRING_LITERAL || myNode.getElementType() == mGSTRING_LITERAL)
        && myBlock.getTextRange().equals(myNode.getTextRange())) {
      String text = myNode.getText();
      if (text.length() > 6) {
        if (text.substring(0, 3).equals("'''") && text.substring(text.length() - 3).equals("'''")
            || text.substring(0, 3).equals("\"\"\"")
                & text.substring(text.length() - 3).equals("\"\"\"")) {
          return generateForMultiLineString();
        }
      }
    }

    if (myNode.getElementType() == mGSTRING_BEGIN
        && myBlock.getTextRange().equals(myNode.getTextRange())) {
      String text = myNode.getText();
      if (text.length() > 3) {
        if (text.substring(0, 3).equals("\"\"\"")) {
          return generateForMultiLineGStringBegin();
        }
      }
    }

    // for gstrings
    if (myNode.getElementType() == GSTRING) {
      final ArrayList<Block> subBlocks = new ArrayList<Block>();
      ASTNode[] children = getGroovyChildren(myNode);
      for (ASTNode childNode : children) {
        if (childNode.getTextRange().getLength() > 0) {
          final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode);
          subBlocks.add(
              new GroovyBlock(
                  childNode, indent, myWrap, mySettings, myGroovySettings, myAlignmentProvider));
        }
      }
      return subBlocks;
    }

    // chained properties, calls, indexing, etc
    if (NESTED.contains(myNode.getElementType())
        && blockPsi.getParent() != null
        && !NESTED.contains(blockPsi.getParent().getNode().getElementType())) {
      final List<Block> subBlocks = new ArrayList<Block>();
      AlignmentProvider.Aligner dotsAligner =
          mySettings.ALIGN_MULTILINE_CHAINED_METHODS
              ? myAlignmentProvider.createAligner(true)
              : null;
      addNestedChildren(myNode.getPsi(), subBlocks, dotsAligner, true);
      return subBlocks;
    }

    if (blockPsi instanceof GrListOrMap
        && ((GrListOrMap) blockPsi).isMap()
        && myGroovySettings.ALIGN_NAMED_ARGS_IN_MAP) {
      AlignmentProvider.Aligner labels = myAlignmentProvider.createAligner(false);
      AlignmentProvider.Aligner exprs = myAlignmentProvider.createAligner(true);
      GrNamedArgument[] namedArgs = ((GrListOrMap) blockPsi).getNamedArguments();
      for (GrNamedArgument arg : namedArgs) {
        GrArgumentLabel label = arg.getLabel();
        if (label != null) labels.append(label);

        PsiElement colon = arg.getColon();
        if (colon == null) colon = arg.getExpression();
        if (colon != null) exprs.append(colon);
      }
    }

    // For Parameter lists
    if (isListLikeClause(blockPsi)) {
      final ArrayList<Block> subBlocks = new ArrayList<Block>();
      List<ASTNode> astNodes = visibleChildren(myNode);

      if (mustAlign(blockPsi, astNodes)) {
        final AlignmentProvider.Aligner aligner = myAlignmentProvider.createAligner(false);
        for (ASTNode node : astNodes) {
          if (!isKeyword(node)) aligner.append(node.getPsi());
        }
      }
      for (ASTNode childNode : astNodes) {
        final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode);
        subBlocks.add(
            new GroovyBlock(
                childNode, indent, myWrap, mySettings, myGroovySettings, myAlignmentProvider));
      }
      return subBlocks;
    }

    boolean classLevel = blockPsi instanceof GrTypeDefinitionBody;
    if (blockPsi instanceof GrCodeBlock || blockPsi instanceof GroovyFile || classLevel) {
      List<ASTNode> children = visibleChildren(myNode);
      calculateAlignments(children, classLevel);
      final ArrayList<Block> subBlocks = new ArrayList<Block>();

      if (classLevel && myAlignment != null) {
        final AlignmentProvider.Aligner aligner = myAlignmentProvider.createAligner(true);
        for (ASTNode child : children) {
          aligner.append(child.getPsi());
        }
      }
      for (ASTNode childNode : children) {
        final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode);
        subBlocks.add(
            new GroovyBlock(
                childNode, indent, myWrap, mySettings, myGroovySettings, myAlignmentProvider));
      }
      return subBlocks;
    }

    // For other cases
    final ArrayList<Block> subBlocks = new ArrayList<Block>();
    for (ASTNode childNode : visibleChildren(myNode)) {
      final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode);
      subBlocks.add(
          new GroovyBlock(
              childNode, indent, myWrap, mySettings, myGroovySettings, myAlignmentProvider));
    }
    return subBlocks;
  }