#compiler #incremental #editor #parser

macro no-std lady-deirdre-derive

Compiler front-end foundation technology. Macro crate.

6 stable releases

1.0.5 May 12, 2023
1.0.4 Apr 16, 2023
1.0.3 Feb 16, 2023
1.0.1 Nov 21, 2022

#218 in #parsing

39 downloads per month
Used in lady-deirdre

Custom license

420KB
7K SLoC

Lady Deirdre.

Lady Deirdre Main Crate API Docs Lady Deirdre Macro Crate API Docs Lady Deirdre Main Crate Lady Deirdre Macro Crate

Compiler front-end foundation technology.

If you want to create your own programming language with IDE support from day one, or if you are going to develop new IDE from scratch, or a programming language LSP plugin, this Technology is for you!

Lady Deirdre provides a framework to develop Lexical Scanner, Syntax Parser and Semantic Analyzer that could work in live coding environment applying user-input changes incrementally to all underlying data structures.

This Technology represents a set of essential instruments to develop modern programming language compilers with seamless IDE integration.

Features:

  • Written in Rust entirely.
  • Derive-macros to define PL Grammar directly on Enum types.
  • Smart error recovery system out of the box.
  • Dependency-free no-std ready API.
  • Works faster than Tree Sitter.

Links:

This Work is a proprietary software with source available code.

To copy, use, distribute, and contribute into this Work you must agree to the terms of the End User License Agreement.

The Agreement let you use this Work in commercial and non-commercial purposes. Commercial use of the Work is free of charge to start, but the Agreement obligates you to pay me royalties under certain conditions.

If you want to contribute into the source code of this Work, the Agreement obligates you to assign me all exclusive rights to the Derivative Work made by you (this includes GitHub forks and pull requests to my repository).

The Agreement does not limit rights of the third party software developers as long as the third party software uses public API of this Work only, and the third party software does not incorporate or distribute this Work directly.

If you do not or cannot agree to the terms of this Agreement, do not use this Work.

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

Macro Crate API Documentation.

This Crate provides two optional companion macros to the Main Crate to construct Lexis Scanner and Syntax Parser using derive Rust syntax on enum types.

The Token macro constructs a Lexical Scanner through the set of user-defined regular expressions specified directly on enum variants using macro-attributes. And the Node macro, in turn, constructs a Syntax Parser through the set of user-defined LL(1) grammar rules over the Token variants.

Both macros implement Token and Node traits accordingly, and considered to be the primary recommended way to define Programming Language grammar.

Dependencies

~1.5MB
~33K SLoC