public void addOperator(BinaryOperator operator) {

        if (!functionContextStack.isEmpty()) {
            Integer sizeOperators = functionContextStack.peek().getSizeOperatorsForParameters();
            if (sizeOperators != null) {
                while (!operatorStack.isEmpty() &&
                        sizeOperators != operatorStack.size() &&
                        operator.compareTo(operatorStack.peek()) <= 0) {
                    final BinaryOperator binaryOperator =
                            operatorStack.pop();
                    applyOperator(binaryOperator);
                }
            }
        } else {
            while (!operatorStack.isEmpty() &&
                    operator.compareTo(operatorStack.peek()) <= 0) {
                applyOperator(operatorStack.pop());
            }
        }

        operatorStack.push(operator);
    }