A library for lexing and parsing D programming language source code, enabling syntax analysis and tooling.
libdparse is a library for lexing and parsing D programming language source code. It provides tokenization and abstract syntax tree generation capabilities, enabling developers to build tools that analyze, transform, or validate D code. The library serves as a foundational component for D language tooling ecosystems.
D language tool developers, compiler engineers, and those building IDE integrations, linters, or code formatters for the D programming language.
Developers choose libdparse because it is a community-maintained, specialized parsing library for D that offers accurate AST generation and a flexible visitor pattern, making it easier to implement custom code analysis without building a parser from scratch.
Library for lexing and parsing D source code
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers configurable lexer settings for tokenizing D source code, allowing customization based on tool requirements, as highlighted in the lexical analysis feature.
Uses a rollback allocator to generate abstract syntax trees from token streams, providing a stable foundation for code analysis and transformation, as described in the parser functionality.
Implements an ASTVisitor class that simplifies traversing and inspecting parsed code structures, demonstrated in the example with custom visitor implementation.
Includes automatically generated HTML documentation of the D grammar, aiding developers in understanding and implementing parsers without manual reference.
Testing is not supported on Windows, as stated in the README, which can hinder development and validation for cross-platform tools.
Has known differences with the official D grammar, such as in static array initialization syntax, potentially causing parsing errors in edge cases, as noted in the differences section.
Does not support deprecated D features like class allocators and deallocators, limiting its use for analyzing legacy codebases, as admitted in the unsupported syntax list.