Implement TreeBuilder