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.
1
2
3
4
5
6
7
8
9
10
11
12

use std::env;
use std::path::Path;

fn main() {
    let file = env::args().nth(1);
    let file = file.as_ref().map_or("test.c", |s|s.as_ref());
    match c3::C3::parse_file(Path::new(file), &[]).and_then(|mut c|c.ast()) {
        Ok(tu) => println!("{tu:#?}"),
        Err(err) => println!("ERROR: {err}"),
    };
}