def getExpression(self, operand1=None, operator=None, _break=''):
    expression = None
    operand2 = None
    isbreak = False
    while (not self.end):
        if ((operand1 is None) and (operator is None)):
            operand1 = self.getOperand()
            operator = self.getOperator()
            if ((operator is None) or (operator in _break)):
                expression = operand1
                isbreak = True
                break
        operand2 = self.getOperand()
        nextOperator = self.getOperator()
        if ((nextOperator is None) or (nextOperator in _break)):
            expression = self.mgr.newOperator(operator, [operand1, operand2])
            isbreak = True
            break
        elif (self.priority(operator) >= self.priority(nextOperator)):
            operand1 = self.mgr.newOperator(operator, [operand1, operand2])
            operator = nextOperator
        else:
            operand2 = self.getExpression(operand1=operand2, operator=nextOperator, _break=_break)
            expression = self.mgr.newOperator(operator, [operand1, operand2])
            isbreak = True
            break
    if (not isbreak):
        expression = self.mgr.newOperator(operator, [operand1, operand2])
    if ((expression != None) and hasattr(expression, 'operands')):
        allConstants = True
        for p in expression.operands:
            if (type(p).__name__ != 'Constant'):
                allConstants = False
                break
        if allConstants:
            value = expression.value
            _type = type(value).__name__
            return Constant(value, _type)
    return expression
def getExpression(self, operand1=None, operator=None, _break=):
    expression = None
    operand2 = None
    isbreak = False
    while (not self.end):
        if ((operand1 is None) and (operator is None)):
            operand1 = self.getOperand()
            operator = self.getOperator()
            if ((operator is None) or (operator in _break)):
                expression = operand1
                isbreak = True
                break
        operand2 = self.getOperand()
        nextOperator = self.getOperator()
        if ((nextOperator is None) or (nextOperator in _break)):
            expression = self.mgr.newOperator(operator, [operand1, operand2])
            isbreak = True
            break
        elif (self.priority(operator) >= self.priority(nextOperator)):
            operand1 = self.mgr.newOperator(operator, [operand1, operand2])
            operator = nextOperator
        else:
            operand2 = self.getExpression(operand1=operand2, operator=nextOperator, _break=_break)
            expression = self.mgr.newOperator(operator, [operand1, operand2])
            isbreak = True
            break
    if (not isbreak):
        expression = self.mgr.newOperator(operator, [operand1, operand2])
    if ((expression != None) and hasattr(expression, 'operands')):
        allConstants = True
        for p in expression.operands:
            if (type(p).__name__ != 'Constant'):
                allConstants = False
                break
        if allConstants:
            value = expression.value
            _type = type(value).__name__
            return Constant(value, _type)
    return expression