[cfe-dev] rewriteCLikeFileToASimplerFile

redder_0210 redder_0210 at yeah.net
Mon Mar 19 05:38:04 PDT 2012


Dear all,
   I am interested in the rewriting function of Clang. 
  Now I have a simple C-like syntax.The syntax and semantic is detailed. 
  The question is how to translate the inputting C file into the new file written by C-like language?


  Here is an example:
The inputting program is 
///////////////////////////////////
int main(){
   int i;
   i = 0;
   if(i > 1){
      i ++; 
  }
  else{
     i --; 
  }
  return 0;
}
//////////////////////////////////


The outputting program is wished to be 
//////////////////////////////////////////
int main(){
   int i;
   i = 0;
   if(i > 1){
      i ++; 
  }
  endif;
  else{
     i --; 
  }
  endelse;
  return 0;
}
///////////////////////////////////////////




/cheers.
/by Redder.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120319/2f66f90a/attachment.html>


More information about the cfe-dev mailing list