@Override public final boolean matchesCollection( final Role role, final INode position, final Match match, final BacktrackingInfo backtrackingInfo) { backtrackingInfo.stack.push(new PossibleMatch(position, match.getCheckPoint())); return _node.matches(position, match); }
@Override public final boolean matchesCollection( final Role role, final INode position, final Match match, final BacktrackingInfo backtrackingInfo) { backtrackingInfo.stack.push(new PossibleMatch(position, match.getCheckPoint())); return _node.matches(position, match); }
@Override public final boolean matchesCollection( final Role role, final INode position, final Match match, final BacktrackingInfo backtrackingInfo) { backtrackingInfo.stack.push(new PossibleMatch(position, match.getCheckPoint())); return _node.matches(position, match); }
@Override public final boolean matches(final INode other, final Match match) { final int checkpoint = match.getCheckPoint(); for (final INode alternative : _alternatives) { if (alternative.matches(other, match)) { return true; } match.restoreCheckPoint(checkpoint); } return false; } }
@Override public final boolean matches(final INode other, final Match match) { final int checkpoint = match.getCheckPoint(); for (final INode alternative : _alternatives) { if (alternative.matches(other, match)) { return true; } match.restoreCheckPoint(checkpoint); } return false; } }
@Override public final boolean matches(final INode other, final Match match) { final int checkpoint = match.getCheckPoint(); for (final INode alternative : _alternatives) { if (alternative.matches(other, match)) { return true; } match.restoreCheckPoint(checkpoint); } return false; } }
@Override public final boolean matchesCollection( final Role role, final INode position, final Match match, final BacktrackingInfo backtrackingInfo) { final Stack<PossibleMatch> backtrackingStack = backtrackingInfo.stack; assert position == null || position.getRole() == role; int matchCount = 0; INode current = position; if (_minCount <= 0) backtrackingStack.push(new PossibleMatch(current, match.getCheckPoint())); while (matchCount < _maxCount && current != null && _node.matches(current, match)) { matchCount++; do { current = current.getNextSibling(); } while (current != null && current.getRole() != role); if (matchCount >= _minCount) { backtrackingStack.push(new PossibleMatch(current, match.getCheckPoint())); } } // // Never do a single-element match; always make the caller look at the results on the // back-tracking stack. // return false; }
@Override public final boolean matchesCollection( final Role role, final INode position, final Match match, final BacktrackingInfo backtrackingInfo) { final Stack<PossibleMatch> backtrackingStack = backtrackingInfo.stack; assert position == null || position.getRole() == role; int matchCount = 0; INode current = position; if (_minCount <= 0) backtrackingStack.push(new PossibleMatch(current, match.getCheckPoint())); while (matchCount < _maxCount && current != null && _node.matches(current, match)) { matchCount++; do { current = current.getNextSibling(); } while (current != null && current.getRole() != role); if (matchCount >= _minCount) { backtrackingStack.push(new PossibleMatch(current, match.getCheckPoint())); } } // // Never do a single-element match; always make the caller look at the results on the // back-tracking stack. // return false; }
@Override public final boolean matchesCollection( final Role role, final INode position, final Match match, final BacktrackingInfo backtrackingInfo) { final Stack<PossibleMatch> backtrackingStack = backtrackingInfo.stack; assert position == null || position.getRole() == role; int matchCount = 0; INode current = position; if (_minCount <= 0) backtrackingStack.push(new PossibleMatch(current, match.getCheckPoint())); while (matchCount < _maxCount && current != null && _node.matches(current, match)) { matchCount++; do { current = current.getNextSibling(); } while (current != null && current.getRole() != role); if (matchCount >= _minCount) { backtrackingStack.push(new PossibleMatch(current, match.getCheckPoint())); } } // // Never do a single-element match; always make the caller look at the results on the // back-tracking stack. // return false; }
stack.push(new PossibleMatch(firstOtherChild, match.getCheckPoint()));
stack.push(new PossibleMatch(firstOtherChild, match.getCheckPoint()));
stack.push(new PossibleMatch(firstOtherChild, match.getCheckPoint()));
final int checkPoint = match.getCheckPoint();
final int checkPoint = match.getCheckPoint();
final int checkPoint = match.getCheckPoint();
@Override public boolean matches(final INode other, final Match match) { if (_pattern.matches(other, match)) { return true; } if (other instanceof BinaryOperatorExpression) { final BinaryOperatorExpression binary = (BinaryOperatorExpression) other; if (_operator != BinaryOperatorType.ANY && binary.getOperator() != _operator) { return false; } final int checkPoint = match.getCheckPoint(); if (matches(binary.getLeft(), match) && matches(binary.getRight(), match)) { return true; } match.restoreCheckPoint(checkPoint); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (_pattern.matches(other, match)) { return true; } if (other instanceof BinaryOperatorExpression) { final BinaryOperatorExpression binary = (BinaryOperatorExpression) other; if (_operator != BinaryOperatorType.ANY && binary.getOperator() != _operator) { return false; } final int checkPoint = match.getCheckPoint(); if (matches(binary.getLeft(), match) && matches(binary.getRight(), match)) { return true; } match.restoreCheckPoint(checkPoint); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (_pattern.matches(other, match)) { return true; } if (other instanceof BinaryOperatorExpression) { final BinaryOperatorExpression binary = (BinaryOperatorExpression) other; if (_operator != BinaryOperatorType.ANY && binary.getOperator() != _operator) { return false; } final int checkPoint = match.getCheckPoint(); if (matches(binary.getLeft(), match) && matches(binary.getRight(), match)) { return true; } match.restoreCheckPoint(checkPoint); } return false; } }