Can some body help me creating a translator which translates for loop to while

Oct 6 2005 7:25 AM

I want to write a sort of translator which can translate the code of for loop to coresponding while.

for example if i have :

for(int i  = 0 ; i  < 10 ;i++)
  Console.WriteLine("Hello");

it should translate like :

int i = 0;
while( i < 10)
{
   Console.WriteLine("Hello");
   i++;
}


Answers (1)