Device, program, recording means and method for generating a robot program