compute move function in parser