/** {@inheritDoc} */ public void acceptASTVisitor(final IASTVisitor visitor) { visitor.visitAST(this); }
/** * Creates a new NoChildren AST. * * @param type The type of the AST. */ public NoChildren(final E type) { this.type = type; assert invariants(); }
/** {@inheritDoc} */ public void acceptASTVisitor(final IASTVisitor visitor) { visitor.visitEmpty(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(')'); }
public static String interpret(final IAST<Type> node) { return node.childrenAsString(); } }
/** {@inheritDoc} */ public void visitChar(final IChar tree) { buf.append(tree.getValue()); }
/** {@inheritDoc} */ public void acceptASTVisitor(final IASTVisitor visitor) { visitor.visitChar(this); }
/** * Creates a new Position. * * @param startIndex The start index of the AST position. * * @param endIndex The end index of the AST position. */ public Position(final int startIndex, final int endIndex) { this.startIndex = startIndex; this.endIndex = endIndex; assert invariants(); }
/** * Creates a new AST. * * @param type The type of the AST. * * @param children The children of the AST. * * @param position The position of the AST. */ public AST(final E type, final List<IAST<E>> children, final Position position) { this.type = type; this.children = children; this.position = position; assert invariants(); }
/** * 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(')'); }
public static String interpret(final IAST<Type> node) { return node.childrenAsString(); } }
/** {@inheritDoc} */ public void visitChar(final IChar tree) { buf.append(tree.getValue()); }
/** {@inheritDoc} */ public void acceptASTVisitor(final IASTVisitor visitor) { visitor.visitAST(this); }
/** * Creates a new NoChildren AST. * * @param type The type of the AST. */ public NoChildren(final E type) { this.type = type; assert invariants(); }
/** {@inheritDoc} */ public void acceptASTVisitor(final IASTVisitor visitor) { visitor.visitEmpty(this); }
/** {@inheritDoc} */ public void acceptASTVisitor(final IASTVisitor visitor) { visitor.visitChar(this); }
/** * Creates a new Position. * * @param startIndex The start index of the AST position. * * @param endIndex The end index of the AST position. */ public Position(final int startIndex, final int endIndex) { this.startIndex = startIndex; this.endIndex = endIndex; assert invariants(); }
public static String interpret(final IAST<Type> expr) { return expr.childrenAsString(); } }
/** {@inheritDoc} */ public final String childrenAsString() { final StringBuilder buf = new StringBuilder(); for (IAST<E> c : children) { buf.append(((IChar) c).getValue()); } return buf.toString(); }