title: What libraries are available for parsing c++ to extract type information
body: <p>I'm looking for a way to parse c++ code to retrieve some basic information about classes. I don't actually need much information from the code itself, but I do need it to handle things like macros and templates. In short, I want to extract the "structure" of the code, what you would show in a UML diagram.</p>
  
  <p>For each class/struct/union/enum/typedef in the code base, all I need (after templates &amp; macros have been handled) is:</p>
  
  <ul>
  <li>Their name</li>
  <li>The namespace in which they live</li>
  <li>The fields contained within (name of type, name of field and access restrictions, such as private/mutable/etc)</li>
  <li>Functions contained within (return type, name, parameters)</li>
  <li>The declaring file</li>
  <li>Line/column numbers (or byte offset in file) where the definition of this data begins</li>
  </ul>
  
  <p>The actual instructions in the code are irrelevant for my purposes.</p>
  
  <p>I'm anticipating a lot of people saying I should just use a regex for this (or even Flex &amp; Bison), but these aren't really valid, as I do need the preprocessor and template stuff handled properly.</p>