What libraries are available for parsing c++ to extract type information

  • Elsa: The Elkhound-based C/C++ Parser,
  • clang: a C language family frontend for LLVM/Clang Static Analyzer,
  • ANTLR Parser Generator Grammar List (search for C++, there is more than one grammar),
  • OpenC++ (adds reflection capabilities to C++),
  • Stratego XT (full programs transformation - see CodeBoost, which for parsing uses OpenC++ just mentioned, for an example application to C++ programs),
  • Parsing C++ at nobugs.org (not a parser but interesting bits of information; in particular Edward D. Willink's "Meta-Compilation for C++" PhD thesis and Mike Dimmick overview of his attempt to parse C++).

See also Ira Baxter here, where he cites his own product.

Warning: mind you, only Elsa "..I hear does a fairly good job.." at constructing a symbol table, which according to Ira Baxter is necessary for OP's original intent (see comments to this answer - I quote him because he is an expert in the field).


Sounds like a job for gcc-xml in combination with the c++ xml-library or xml-friendly scripting language of your choice.

Tags:

C++

Types

Parsing