add gencode to for and while stmt