expr = pp.operatorPrecedence(condition, [('NOT', 1, pp.opAssoc.RIGHT), (
    'AND', 2, pp.opAssoc.LEFT), ('OR', 2, pp.opAssoc.LEFT)])
parsing a complex logical expression in pyparsing in a binary tree fashion