Check ambiguous grammar