add root rule and refactor parse()