castxml
« Back to VersTracker
Description:
C-family Abstract Syntax Tree XML Output
Type: Formula  |  Latest Version: 0.6.13@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: c++ ast xml clang static-analysis code-generation
Install: brew install castxml
About:
CastXML is a command-line tool that generates XML output from C, C++, and Objective-C source code by leveraging the Clang compiler frontend. It provides a structured representation of the Abstract Syntax Tree (AST), enabling other tools to parse and analyze code structure without implementing a full compiler front-end. This makes it a foundational component for static analysis, code documentation, and interoperability tools.
Key Features:
  • Outputs XML representations of C/C++/Objective-C ASTs
  • Leverages the robust Clang compiler frontend for accurate parsing
  • Provides a stable API for tool developers to consume code structure
  • Supports cross-platform static compilation
Use Cases:
  • Generating code documentation from source ASTs
  • Building static analysis and linting tools
  • Creating bindings for other programming languages (e.g., Python, Fortran)
Alternatives:
  • libclang – Provides a C API for the Clang AST, but CastXML offers a simpler, XML-based output that is easier to consume for non-C++ tools.
  • c2xml – An older tool for C code, whereas CastXML supports modern C++ and Objective-C features via Clang.
License: Apache-2.0
Dependencies: llvm
Bottles available for: arm64_tahoe, arm64_sequoia, arm64_sonoma, arm64_ventura, sonoma, ventura, arm64_linux, x86_64_linux
Version History
Detected Version Rev Change Commit
Sep 13, 2025 6:46am 0 VERSION_BUMP 6991a46f
Sep 29, 2024 1:46pm 2 VERSION_BUMP 7684109e