In your grammar, you need an expression that looks something like this:
foreach := foreach ( name in name ) { statements }
When you analyze this, you should be able to translate it directly into the while loop in your AST with an optional expression that assigns the variable at the beginning.
, , , , (, ). , .