String (@NotNull ZenCodingNode zenCodingNode, int level) { StringBuilder result = new StringBuilder(); result.append(StringUtil.repeatSymbol(' ', level * 2)); result.append(zenCodingNode.toString()).append("\n"); for (ZenCodingNode node : zenCodingNode.getChildren()) { result.append(nodeToString(node, level + 1)); } if (zenCodingNode instanceof FilterNode) { result.append(nodeToString(((FilterNode)zenCodingNode).getNode(), level + 1)); } if (zenCodingNode instanceof MulOperationNode) { result.append(nodeToString(((MulOperationNode)zenCodingNode).getLeftOperand(), level + 1)); result.append(StringUtil.repeatSymbol(' ', (level + 1) * 2)); result.append(((MulOperationNode)zenCodingNode).getRightOperand()).append("\n"); } if (zenCodingNode instanceof UnaryMulOperationNode) { result.append(nodeToString(((UnaryMulOperationNode)zenCodingNode).getOperand(), level + 1)); } return result.toString(); }