public final boolean matches(final AstNodeCollection<T> other, final Match match) { return Pattern.matchesCollection( _role, _node.getFirstChild(), VerifyArgument.notNull(other, "other")._node.getFirstChild(), VerifyArgument.notNull(match, "match") ); }
public final boolean matches(final AstNodeCollection<T> other, final Match match) { return Pattern.matchesCollection( _role, _node.getFirstChild(), VerifyArgument.notNull(other, "other")._node.getFirstChild(), VerifyArgument.notNull(match, "match") ); }
public final boolean matches(final AstNodeCollection<T> other, final Match match) { return Pattern.matchesCollection( _role, _node.getFirstChild(), VerifyArgument.notNull(other, "other")._node.getFirstChild(), VerifyArgument.notNull(match, "match") ); }
void startNode(final AstNode node) { // Ensure that nodes are visited in the proper nested order. // Jumps to different subtrees are allowed only for the child of a placeholder node. assert containerStack.isEmpty() || node.getParent() == containerStack.peek() || containerStack.peek().getNodeType() == NodeType.PATTERN; if (positionStack.size() > 0) { writeSpecialsUpToNode(node); } containerStack.push(node); positionStack.push(node.getFirstChild()); formatter.startNode(node); }
@Override protected AstNode visitChildren(final AstNode node, final Void data) { AstNode next; for (AstNode child = node.getFirstChild(); child != null; child = next) { next = child.getNextSibling(); final AstNode childResult = child.acceptVisitor(this, data); if (childResult != null && childResult != child) { next = childResult; } } return node; }
@Override public boolean isEmpty() { for (AstNode current = _node.getFirstChild(); current != null; current = current.getNextSibling()) { if (current.getRole() == _role) { return false; } } return true; }
@Override public int size() { int count = 0; for (AstNode current = _node.getFirstChild(); current != null; current = current.getNextSibling()) { if (current.getRole() == _role) { count++; } } return count; }
protected S visitChildren(final AstNode node, final T data) { AstNode next; for (AstNode child = node.getFirstChild(); child != null; child = next) { // // Store next to allow the loop to continue if the visitor removes/replaces child. // next = child.getNextSibling(); child.acceptVisitor(this, data); } return null; }
@Override public boolean isEmpty() { for (AstNode current = _node.getFirstChild(); current != null; current = current.getNextSibling()) { if (current.getRole() == _role) { return false; } } return true; }
@Override public int size() { int count = 0; for (AstNode current = _node.getFirstChild(); current != null; current = current.getNextSibling()) { if (current.getRole() == _role) { count++; } } return count; }
@Override public boolean isEmpty() { for (AstNode current = _node.getFirstChild(); current != null; current = current.getNextSibling()) { if (current.getRole() == _role) { return false; } } return true; }
public boolean hasSingleElement() { boolean hasElement = false; for (AstNode current = _node.getFirstChild(); current != null; current = current.getNextSibling()) { if (current.getRole() == _role) { if (hasElement) { return false; } hasElement = true; } } return hasElement; }
@Override protected Void visitChildren(final AstNode node, final Void data) { AstNode next; for (AstNode child = node.getFirstChild(); child != null; child = next) { // // Store next to allow the loop to continue if the visitor removes/replaces child. // next = child.getNextSibling(); child.acceptVisitor(this, data); } return null; }
protected S visitChildren(final AstNode node, final T data) { AstNode next; for (AstNode child = node.getFirstChild(); child != null; child = next) { // // Store next to allow the loop to continue if the visitor removes/replaces child. // next = child.getNextSibling(); child.acceptVisitor(this, data); } return null; }
public boolean hasSingleElement() { boolean hasElement = false; for (AstNode current = _node.getFirstChild(); current != null; current = current.getNextSibling()) { if (current.getRole() == _role) { if (hasElement) { return false; } hasElement = true; } } return hasElement; }
@Override public int size() { int count = 0; for (AstNode current = _node.getFirstChild(); current != null; current = current.getNextSibling()) { if (current.getRole() == _role) { count++; } } return count; }
@Override protected AstNode visitChildren(final AstNode node, final Void data) { AstNode next; for (AstNode child = node.getFirstChild(); child != null; child = next) { next = child.getNextSibling(); final AstNode childResult = child.acceptVisitor(this, data); if (childResult != null && childResult != child) { next = childResult; } } return node; }
public void acceptVisitor(final IAstVisitor<? super T, ?> visitor) { AstNode next; for (AstNode current = _node.getFirstChild(); current != null; current = next) { assert current.getParent() == _node; next = current.getNextSibling(); if (current.getRole() == _role) { current.acceptVisitor(visitor, null); } } }
public void acceptVisitor(final IAstVisitor<? super T, ?> visitor) { AstNode next; for (AstNode current = _node.getFirstChild(); current != null; current = next) { assert current.getParent() == _node; next = current.getNextSibling(); if (current.getRole() == _role) { current.acceptVisitor(visitor, null); } } }
public void acceptVisitor(final IAstVisitor<? super T, ?> visitor) { AstNode next; for (AstNode current = _node.getFirstChild(); current != null; current = next) { assert current.getParent() == _node; next = current.getNextSibling(); if (current.getRole() == _role) { current.acceptVisitor(visitor, null); } } }