State diagram for parsing a tree file - part 1