Skip to main content

icb_clang/
lib.rs

1//! # icb-clang
2//!
3//! Clang‑based C/C++ frontend for ICB.
4//!
5//! Provides parsing of single files or entire projects described by
6//! `compile_commands.json`. The parser returns a stream of [`RawNode`]
7//! facts that the rest of the ICB pipeline can consume.
8//!
9//! # Example (single file)
10//!
11//! ```rust,no_run
12//! use icb_clang::parser::parse_cpp_file;
13//! let facts = parse_cpp_file("int main() { return 0; }", &[], Some("main.cpp"), true).unwrap();
14//! assert!(!facts.is_empty());
15//! ```
16//!
17//! # Example (project via compile_commands.json)
18//!
19//! ```rust,no_run
20//! use std::path::Path;
21//! use icb_clang::project::parse_project;
22//! let all_files = parse_project(
23//!     Path::new("compile_commands.json"),
24//!     Path::new("."),
25//!     true,
26//!     true,
27//! ).unwrap();
28//! ```
29
30pub mod parser;
31pub mod project;