Just translate expression for(S1; B; S2) S3 into exactly the same tree that you would have built for
{
S1
while(B) do
{
S3
S2
}
}
No new rules for generating code are required because you use
existing rules for sequencing and while loops.