#lexer #parser #grammarsmith

grammarsmith

Common helpers for handwriting lexers and parsers

2 unstable releases

0.3.0 Mar 8, 2025
0.1.0 Feb 16, 2025

#121 in Parser tooling

Download history 83/week @ 2025-02-11 32/week @ 2025-02-18 5/week @ 2025-02-25 118/week @ 2025-03-04 25/week @ 2025-03-11 3/week @ 2025-03-18

147 downloads per month

Custom license

31KB
588 lines

Grammarsmith provides common helpers for writing lexers and parsers.

Examples

use grammarsmith::*;

Crate Features

  • serde: Enable Serde serialization and deserialization for BytePos and Span.

Grammarsmith

Tools to build your own lexer and parsers by hand.

Motivation

Creating lexers and parsers by hand turns out to not be that difficult, however I have found that there is some code I keep copying around. This crate is a collection of those utilities so that I don't have to keep rewriting them.

Installation

[dependencies]
grammarsmith = "0.1.0"

or if you want to use the serde features:

[dependencies]
grammarsmith = { version = "0.1.0", features = ["serde"] }

Dependencies

~155KB