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

前端 未结 7 1335
走了就别回头了
走了就别回头了 2021-02-05 18:33

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 hand

7条回答
  •  再見小時候
    2021-02-05 19:01

    • 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).

提交回复
热议问题