replace the first terminal node
replacefirstterminal(&t,value);