'Check that filter conditions are valid and throw errors if not.
Args:
identifier: identifier being used in comparison
condition: string form of the comparison operator used in the filter'

def __CheckFilterSyntax(self, identifier, condition):

    if (identifier.lower() == 'ancestor'):
        if (condition.lower() == 'is'):
            if self.__has_ancestor:
                self.__Error('Only    one    ANCESTOR    IS"    clause    allowed')
        else:
            self.__Error('"IS"    expected    to    follow    "ANCESTOR"')
    elif (condition.lower() == 'is'):
        self.__Error('"IS"    can    only    be    used    when    comparing    against    "ANCESTOR"')
