rewrite tool for OO programming