/** * Returns the depth of this node. The root is depth 0, its * children are depth 1, and so on. * @return the node depth in the tree */ public int depth() { return parent == null ? 0 : 1 + parent.depth(); }
/** * Returns the depth of this node. The root is depth 0, its * children are depth 1, and so on. * @return the node depth in the tree */ public int depth() { return parent == null ? 0 : 1 + parent.depth(); }
/** * Returns the depth of this node. The root is depth 0, its * children are depth 1, and so on. * @return the node depth in the tree */ public int depth() { return parent == null ? 0 : 1 + parent.depth(); }
/** * Returns the depth of this node. The root is depth 0, its * children are depth 1, and so on. * @return the node depth in the tree */ public int depth() { return parent == null ? 0 : 1 + parent.depth(); }
public boolean visit(AstNode node) { int tt = node.getType(); String name = Token.typeToName(tt); buffer.append(node.getAbsolutePosition()).append("\t"); buffer.append(makeIndent(node.depth())); buffer.append(name).append(" "); buffer.append(node.getPosition()).append(" "); buffer.append(node.getLength()); if (tt == Token.NAME) { buffer.append(" ").append(((Name)node).getIdentifier()); } buffer.append("\n"); return true; // process kids } }
public boolean visit(AstNode node) { int tt = node.getType(); String name = Token.typeToName(tt); buffer.append(node.getAbsolutePosition()).append("\t"); buffer.append(makeIndent(node.depth())); buffer.append(name).append(" "); buffer.append(node.getPosition()).append(" "); buffer.append(node.getLength()); if (tt == Token.NAME) { buffer.append(" ").append(((Name)node).getIdentifier()); } buffer.append("\n"); return true; // process kids } }
public boolean visit(AstNode node) { int tt = node.getType(); String name = Token.typeToName(tt); buffer.append(node.getAbsolutePosition()).append("\t"); buffer.append(makeIndent(node.depth())); buffer.append(name).append(" "); buffer.append(node.getPosition()).append(" "); buffer.append(node.getLength()); if (tt == Token.NAME) { buffer.append(" ").append(((Name)node).getIdentifier()); } buffer.append("\n"); return true; // process kids } }
public boolean visit(AstNode node) { int tt = node.getType(); String name = Token.typeToName(tt); buffer.append(node.getAbsolutePosition()).append("\t"); buffer.append(makeIndent(node.depth())); buffer.append(name).append(" "); buffer.append(node.getPosition()).append(" "); buffer.append(node.getLength()); if (tt == Token.NAME) { buffer.append(" ").append(((Name)node).getIdentifier()); } buffer.append("\n"); return true; // process kids } }