modify grammar of foreach statement