Efficient way to print ForStmt Header?

Hi,

How can print ForStmt header to a file quickly? Is there any simple function to do that.

e.g

for(int i=0;i<10;i++)

a[i]=a[i]+1;

I want

for(int i=0;i<10;i++)

line in a separate file. As of now, I am reconstructing “ForStmt” first line with getInit(),getCond() and getInc().