LibClang is a stable high level C interface to the clang compiler.
LibClang is a stable high level C interface to clang.
When in doubt, LibClang is probably the best clang interface to use, since it:
- can be called from any language interfaced with C (python bindings come out of the box),
- is stable,
- provides high enough abstraction over clang's implementation details.
LibClang provides the following features:
- C/C++/ObjC/ObjC++ code parsing and syntax checking,
- AST indexing and cross-referencing,
- source code tokenization (e.g. for syntax highlighting),
- code completion.
Useful links
- The description of clang interfaces.
- The official API documentation.
- A blog post by Eli Bendersky presenting libclang and its python bindings.
- A presentation by Doug Gregor showing usage examples for various key features.