c3 0.11.2

Complete C AST. Enables analysis and generation of code derived from C. Built using LLVM 4/Clang using some fragile C++ APIs to work around missing data and ambiguities in libclang.
docs.rs failed to build c3-0.11.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

C3: A tree of C nodes

This crate parses C files and exposes them as an abstract syntax tree.

The AST is a relaxed version of C's usual structure (e.g. everything pretends to be an expression), but contains enough information to rebuild complete source code. The AST also allows for some Rust features not found in C files. This is enables Citrus to convert C to Rust.

It uses LLVM and Clang's unstable C++ API. Currently, it supports LLVM 4 or 5, and requires static linking with libclang.

The stable Clang API does not expose a real AST, but a flattened, incomplete and ambiguous view of it. This crate works around the bad parts to extract more complete view of C files from Clang.

On the Rust side it's based on bindgen.

Building

Follow these instructions.