Eliminate unecessary nodes from parse tree.