title: Build AST from C code
body: <p>How can I build an AST (Abstract Syntax Tree) from gcc C code in order to make some modifications, like converting some int variables to float, and reproduce(generate) the code to C syntax again after that. </p>
  
  <p>Actually, for the moment, the only functionality I truly need is to extract a table of variables and their types from a c program consisting of few lines... I think there is a simple parser doing so.</p>
  
  <p>I have some variables like:</p>
  
  <pre><code>int  var_bss ;           
  float var_f_bss;            
  int var_data = 4;        
  float var_f_data = 5;  
  </code></pre>
  
  <p>And a function:</p>
  
  <pre><code>int Foo(){          
     some local variables;            
  }    
  </code></pre>
  
  <p>The code is in a single c file.</p>
  
  <p>I want to introduce all the variables to the end user to let him choose a source type in a specific memory segment e.g. int variables in the .data. Then the user can convert those variables into floats. Finally, I generate the same code for the user but with the new variable types those he has chosen.</p>