/** * Creates a new ArrowPrinter. * * @param tree The ast to print. */ public ArrowPrinter(final IAST<?> tree) { this.buf = new StringBuilder(); this.indentLevel = 0; tree.acceptASTVisitor(this); }
/** * Creates a new ArrowPrinter. * * @param tree The ast to print. */ public ArrowPrinter(final IAST<?> tree) { this.buf = new StringBuilder(); this.indentLevel = 0; tree.acceptASTVisitor(this); }
/** * Creates a new SexprPrinter. * * @param tree The ast to print. */ public SexprPrinter(final IAST<?> tree) { this.buf = new StringBuilder(); tree.acceptASTVisitor(this); }
/** * Creates a new SexprPrinter. * * @param tree The ast to print. */ public SexprPrinter(final IAST<?> tree) { this.buf = new StringBuilder(); tree.acceptASTVisitor(this); }
/** {@inheritDoc} */ public void visitAST(final IAST<?> tree) { buf.append('('); buf.append(tree.getType()); for (IAST<?> child : tree.getChildren()) { buf.append(' '); child.acceptASTVisitor(this); } buf.append(')'); }
/** {@inheritDoc} */ public void visitAST(final IAST<?> tree) { buf.append('('); buf.append(tree.getType()); for (IAST<?> child : tree.getChildren()) { buf.append(' '); child.acceptASTVisitor(this); } buf.append(')'); }
/** {@inheritDoc} */ public void visitAST(final IAST<?> tree) { for (int i = 1; i < indentLevel; i++) { buf.append(" "); } if (indentLevel > 0) { buf.append("-> "); } buf.append(tree.getType()); indentLevel++; for (IAST<?> child : tree.getChildren()) { buf.append("\n"); child.acceptASTVisitor(this); } indentLevel--; }
/** {@inheritDoc} */ public void visitAST(final IAST<?> tree) { for (int i = 1; i < indentLevel; i++) { buf.append(" "); } if (indentLevel > 0) { buf.append("-> "); } buf.append(tree.getType()); indentLevel++; for (IAST<?> child : tree.getChildren()) { buf.append("\n"); child.acceptASTVisitor(this); } indentLevel--; }