Just translate expression for(E1; B; E2) S1 into exactly the same tree that you would have generated for statement

  {
    E1
    while(B) do
    {
      S1
      E2
    }
  }
That is, build an abstract syntax tree for that and then call the code generator on that tree.

No new rules for generating code are required because you use existing rules for sequencing (doing one thing after another) and while loops.