updated tree functions and gram.y