buildTreeGrid function

Parse Tree