Convert semi pseudo to code