parse dot file to a tree object