completed function to parse rhs of binary expressions