construct parse tree.