created term_prime function for the expression grammar