Show HN: Anyone interested in a tool helps to explore C++ ASTs
Recorded: May 23, 2026, 11:59 p.m.
| Original | Summarized |
ACAV: Overview ACAVĀ f0ba4b7c9529 Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C Loading... Overview ACAV (Aurora Clang AST Viewer) is an interactive Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C, built with Clang and Qt. Given a JSON compilation database such as compile_commands.json, ACAV lets you open a real project, inspect the AST for a translation unit, and move directly between source code and AST nodes. Screenshot: ACAV displaying the file explorer, source-code panel, AST tree view, declaration-context panels, and log panel. Project Links Project codebase At a Glance inspect the AST for a translation unit in a navigable tree, ACAV follows a three-program architecture: acav is the interactive GUI application. Purpose and Scope Quick Start Generate or locate a compilation database for the target project. Browse files in the file explorer, then double-click a file or press F5 to generate or load its AST. Documentation Organization License points to the authoritative license file. How to Use This Manual Generated by 1.16.1 |
ACAV, or Aurora Clang AST Viewer, is an interactive tool designed for visualizing the Abstract Syntax Tree (AST) of C, C++, and Objective-C code, leveraging Clang and Qt for its implementation. The core functionality of ACAV centers on allowing users to inspect the AST for a specific translation unit within a navigable structure, linking source code locations directly to corresponding AST nodes. This functionality is enabled by reading a compilation database, such as compile_commands.json, which provides the necessary context to analyze real projects. The utility of ACAV is defined by several key capabilities: enabling navigation between the source code and the AST, viewing declaration context while exploring the program structure, facilitating searching across both the source text and the AST nodes, and allowing the reuse of dependency and AST-cache artifacts across different sessions. To achieve this interactive exploration in large codebases, ACAV employs a three-program architectural design. This architecture consists of acav, which serves as the interactive graphical user interface; query-dependencies, which is responsible for extracting dependency information from the compilation database; and make-ast, which handles the process of building and caching serialized AST files for individual source files. ACAV is positioned to address a critical gap in the field by facilitating the practical exploration of Clang's powerful front-end infrastructure. It is intended for use on actual codebases rather than simple examples, processing build settings recorded in a compilation database to accurately analyze the structure. The scope of ACAV is intentionally limited to read-only AST exploration; it does not possess capabilities for modifying source code, performing refactoring operations, or functioning as a general-purpose editor, focusing instead on displaying the AST of a single translation unit at any given time. The typical workflow for using ACAV begins with generating or locating a suitable compilation database for the target project. Following setup, the user launches the application, typically by specifying the path to the compilation database, which initiates the interaction. The workflow involves browsing files in the file explorer, loading or generating the AST for selected files, and utilizing the source view, AST view, and declaration context view to survey the program structure. Comprehensive documentation is provided to support this usage, covering installation procedures, user manuals detailing common workflows and keyboard shortcuts, instructions for setting up containerized environments, and references to related technologies and project artifacts. |