Expand description
§icb-parser
Language frontends that turn source code into a stream of [RawNode]s.
The parser crate is the first stage of the ICB pipeline. It reads source files, invokes language-specific parsers, and produces a flat list of facts that the graph engine can consume.
§Architecture
manager::ParserManagerselects the right parser for a given [Language].- Each language lives in its own module:
langfor Python (and future languages),cpp_tree_sitterfor C/C++ via tree‑sitter. - Output is a
facts::RawNodevector that represents AST nodes, calls, references, etc.
§Quick example
use icb_parser::manager::ParserManager;
use icb_common::Language;
let manager = ParserManager::new();
let facts = manager.parse_file(Language::CppTreeSitter, "void f() {}")
.unwrap();
assert_eq!(facts.len(), 1);
assert_eq!(facts[0].kind, icb_common::NodeKind::Function);Modules§
- cpp_
tree_ sitter - Lightweight C/C++ parser using [
tree-sitter-cpp]. - facts
- heuristic_
parser - Ultra Heuristic Near-AST Parser v3
- lang
- Language-specific parser implementations.
- manager
- Universal high-performance parser manager.