A fast command-line tool that searches C/C++ source code using AST parsing and prints matching code snippets.
fccf is a fast command-line code search tool specifically for C and C++ source code. It allows developers to search through directories for code snippets matching a query, using AST parsing to accurately identify functions, classes, expressions, and other constructs. It solves the problem of navigating large, complex C/C++ codebases by providing context-aware results beyond simple text matching.
C and C++ developers working on large codebases, such as the Linux kernel or other substantial projects, who need to quickly locate specific code constructs without relying on IDE indexing or basic grep tools.
Developers choose fccf for its combination of speed (via SIMD and parallel processing) and accuracy (via libclang AST parsing), offering a terminal-based solution that delivers precise, readable code snippets. It fills a gap between generic text search and heavyweight IDE tools.
fccf: A command-line tool that quickly searches through C/C++ source code in a directory based on a search string and prints relevant code snippets that match the query.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses libclang to parse source files into an abstract syntax tree, enabling accurate identification of code structures like functions, classes, and expressions, as demonstrated in search examples for the Linux kernel.
Employs multi-threaded SIMD string searching (modified Rabin-Karp algorithm) to quickly filter candidate files before AST analysis, speeding up searches in large directories.
Supports specific constructs via command-line flags (e.g., --enum, --for-statement, --include-expressions), allowing developers to narrow searches precisely, as shown in the usage examples.
Pretty-prints and colorizes matched code snippets in the terminal using a built-in lexer, improving readability over raw text output, evidenced in the screenshots and videos.
Requires libclang and LLVM to be installed separately (e.g., via apt on Linux), which can be cumbersome and error-prone, especially in environments without package managers.
Users often need to manually specify include directories with -I flags to avoid libclang parsing errors, as highlighted in the verbose output example, adding overhead for unfamiliar codebases.
Only works for C and C++ code, making it unsuitable for multi-language projects or teams using other programming languages.