refactor parser_generator