MCPcopy Index your code
hub / github.com/Eliah-Lakhin/lady-deirdre

github.com/Eliah-Lakhin/lady-deirdre @v2.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.0 ↗ · + Follow
1,982 symbols 5,462 edges 157 files 152 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Lady Deirdre

Crate API Docs User Guide Examples

Lady Deirdre Logo

Lady Deirdre is a framework for incremental programming language compilers, interpreters, and source code analyzers.

This framework helps you develop a hybrid program that acts as a language compiler or interpreter and as a language server for a code editor's language extension. It offers the necessary components to create an in-memory representation of language files, including the source code, their lexis and syntax, and the semantic model of the entire codebase. These components are specifically designed to keep the in-memory representation in sync with file changes as the codebase continuously evolves in real time.

Lady Deirdre is the perfect tool if you want to start a new programming language project.

Key Features

  • Parser Generator Using Macros.

Lexical and syntax grammar of the language are specified using derive macros on enum types, where the enum variants represent individual tokens and nodes with parsing rules.

  • Hand-Written Parsers.

The API enables the development of hand-written recursive-descent parsers with unlimited lookahead and their seamless integration with macro-generated parsers.

  • Error Resilience.

The resulting parser will be error-resistant and capable of building a syntax tree from incomplete source code.

  • Semantics Analysis Framework.

Lady Deirdre includes a built-in semantic analyzer that manages arbitrary on-demand computations on the syntax trees in terms of referential attributes.

  • Incremental Compilation.

These components continuously patch the in-memory representation of the codebase structures in response to the end user's incremental edits of the file texts. Processing of the changes is typically fast, even in large codebases.

  • Parallel Computations.

The API is specifically designed for both multi-threaded and single-threaded programs, according to your discretion.

  • Web-Assembly Compatibility.

This crate is compatible with wasm-targets and the browser environment in particular.

  • Source Code Formatters.

Lady Deirdre includes tools to develop code formatter programs that take into account code comments and blank lines.

  • Annotated Snippets.

The framework provides a configurable API to print source code snippets with syntax highlighting and annotations to the terminal, intended to display syntax and semantic errors in the codebase.

  • Self-Sufficient API.

The crate offers a self-sufficient, extendable, and highly configurable API for developing the front-end part of programming language compilers and code editor language extensions. As a foundation technology, Lady Deirdre does not have any third-party dependencies except for the Rust standard library and the macros crate.

Performance

Lady Deirdre aims to provide development infrastructure with acceptable computational performance suitable for production use.

The crate's API demonstrates solid benchmark test results, comparing individual features of the framework with specialized solutions from the Rust ecosystem.

For detailed information, refer to the Benchmarks page.

Links

Copyright

This work is proprietary software with source-available code.

To copy, use, distribute, or contribute to this work, you must agree to the terms and conditions of the General License Agreement.

For an explanation of the licensing terms, see the F.A.Q.

Copyright (c) 2024 Ilya Lakhin (Илья Александрович Лахин). All rights reserved.

Extension points exported contracts — how you extend this code

Identifiable (Interface)
A helper trait that denotes a compilation unit to which this object belongs. This trait helps an API user to look up fo [27 …
work/crates/main/src/arena/id.rs
Computable (Interface)
A function that computes [attribute](crate::analysis::Attr)'s value. By implementing this trait on a custom type `T` of [6 …
work/crates/main/src/analysis/compute.rs
ToSpan (Interface)
An object that addresses a fragment of the source code text. In Lady Deirdre, a minimal unit of text measurement is a U [8 …
work/crates/main/src/lexis/span.rs
LexisSession (Interface)
A communication channel of the lexical scanning process. Lady Deirdre distinguishes two independent sides of the lexica [6 …
work/crates/main/src/lexis/session.rs
TokenCursor (Interface)
A cursor that iterates through the lexical tokens and their metadata within the tokens stream. Most functions of this o [7 …
work/crates/main/src/lexis/cursor.rs

Core symbols most depended-on inside this repo

write_ln
called by 190
work/crates/ucd/src/generate.rs
clone
called by 134
work/crates/main/src/sync/shared.rs
get_unchecked
called by 116
work/crates/main/src/arena/repo.rs
is_some
called by 102
work/crates/main/src/format/terminal.rs
len
called by 90
work/crates/main/src/lexis/rule.rs
insert
called by 85
work/crates/derive/src/node/automata.rs
push
called by 81
work/crates/derive/src/token/output.rs
peek
called by 76
work/crates/derive/src/token/chars.rs

Shape

Method 1,550
Class 215
Enum 80
Function 76
Interface 61

Languages

Rust100%

Modules by API surface

work/crates/main/src/format/snippet.rs86 symbols
work/crates/main/src/units/document.rs49 symbols
work/crates/main/src/sync/table.rs46 symbols
work/crates/main/src/format/terminal.rs44 symbols
work/crates/tests/src/gen.rs42 symbols
work/crates/main/src/units/mutable/unit.rs38 symbols
work/crates/main/src/syntax/node.rs37 symbols
work/crates/main/src/format/printer.rs36 symbols
work/crates/main/src/syntax/error.rs35 symbols
work/crates/main/src/units/storage/page.rs32 symbols
work/crates/main/src/arena/repo.rs32 symbols
work/crates/main/src/units/unit.rs31 symbols

For agents

$ claude mcp add lady-deirdre \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page