Check if parameter is unit rule.
    :param rule: Object to check.
    :return: True if is parameter unit rule, false otherwise.

def _is_unit(rule):
    # type: (Type[Rule]) -> bool
    """
    Check if parameter is unit rule.
    :param rule: Object to check.
    :return: True if is parameter unit rule, false otherwise.
    """
    return len(rule.left) == 1 and len(rule.right) == 1 and \
           isclass(rule.fromSymbol) and isclass(rule.toSymbol) and \
           issubclass(rule.fromSymbol, Nonterminal) and issubclass(rule.toSymbol, Nonterminal)