@@ -0,0 +1,3007 @@
+# coding: utf8%0A%0Afrom enum import Enum%0Aimport abc%0A%0A%0Aclass OperatorType(Enum):%0A    AND = 'and'%0A    OR = 'or'%0A    XOR = 'xor'%0A%0A%0Aclass ParsingEntity(metaclass=abc.ABCMeta):%0A    def __and__(self, other):%0A        parsing_operator = ParsingOperator(OperatorType.AND, self, other)%0A        return parsing_operator%0A%0A    def __or__(self, other):%0A        parsing_operator = ParsingOperator(OperatorType.OR, self, other)%0A        return parsing_operator%0A%0A    def __xor__(self, other):%0A        parsing_operator = ParsingOperator(OperatorType.XOR, self, other)%0A        return parsing_operator%0A%0A    @abc.abstractmethod%0A    def __str__(self):%0A        pass%0A%0A    @abc.abstractmethod%0A    def __repr__(self):%0A        self.__str__()%0A%0A    @abc.abstractmethod%0A    def __copy__(self):%0A        pass%0A%0A    @abc.abstractmethod%0A    def __deepcopy__(self):%0A        pass%0A%0A    @abc.abstractmethod%0A    def check(self, element, ref_position):%0A        pass%0A%0A%0Aclass ParsingOperator(ParsingEntity):%0A    def __init__(self, operator_type, operand_a, operand_b):%0A        self.operatorType = operator_type%0A        self.operandA = operand_a%0A        self.operandB = operand_b%0A%0A    def __str__(self):%0A        pass%0A%0A    def __repr__(self):%0A        self.__str__()%0A%0A    def __copy__(self):%0A        pass%0A%0A    def __deepcopy__(self):%0A        pass%0A%0A    def check(self, element, ref_position=0):%0A        if self.operatorType is OperatorType.AND:%0A            if self.operandA.check(element, ref_position) is True and self.operandB.check(element, ref_position) is True:%0A                return True%0A            else:%0A                return False%0A        elif self.operatorType is OperatorType.OR:%0A            if self.operandA.check(element, ref_position) is True or self.operandB.check(element, ref_position) is True:%0A                return True%0A            else:%0A                return False%0A        else:%0A            if (self.operandA.check(element, ref_position) is True) %5E (self.operandB.check(element, ref_position) is True):%0A                return True%0A            else:%0A                return False%0A%0A%0Aclass ParsingCondition(ParsingEntity):%0A    def __init__(self, character, rel_position=0):%0A        self.rel_position = rel_position%0A        self.character = character%0A%0A    def __str__(self):%0A        pass%0A%0A    def __repr__(self):%0A        self.__str__()%0A%0A    def __copy__(self):%0A        pass%0A%0A    def __deepcopy__(self):%0A        pass%0A%0A    def check(self, element, ref_position=0):%0A        element_size = len(element)%0A        if 0 %3C= ref_position %3C element_size:%0A            position = ref_position + self.rel_position%0A            if 0 %3C= position %3C element_size:%0A                if self.character in element%5Bposition%5D:%0A                    return True%0A                else:%0A                    return False%0A            else:%0A                raise IndexError('relative position out of range ( 0 %3C= ref_position + rel_position %3C len(element) )')%0A        else:%0A            raise IndexError('reference position out of range ( 0 %3C= ref_position %3C len(element) )')%0A

Create main classes