def _count_of_curr_and_next(rule):
    """Count tokens to be matched and those to follow them in rule."""
    return len(rule.tokens) + len(rule.next_tokens or []) + len(rule.
        next_classes or [])
