parser for tree