Question about lexer and parser generators in Rust

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • lexertl14

    C++14 version of lexertl

  • parsertl14

    C++14 version of parsertl

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • gram_grep

    Search text using a grammar, lexer, or straight regex. Chain searches for greater refinement.

  • regex

    An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

  • I also took a look at https://github.com/rust-lang/regex and actually found the regex parsing code ('(', '{', '*', '?' etc.) so that is a good start too.

  • gramatika

    A minimal toolkit for writing parsers with Rust

  • I wrote a lexer generator. It's pretty limited and poorly architected tbh, but feel free to have a look: https://github.com/dannymcgee/gramatika

  • chumsky

    Write expressive, high-performance parsers with ease.

  • Checkout https://github.com/zesterer/chumsky or https://github.com/rust-bakery/nom

  • nom

    Rust parser combinator framework

  • Checkout https://github.com/zesterer/chumsky or https://github.com/rust-bakery/nom

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • lalrpop

    LR(1) parser generator for Rust

  • Hi! For one of my projects I am currently using lalrpop (https://github.com/lalrpop/lalrpop/tree/master/doc/calculator/src), which is far from complete, but has the basic syntax I was looking for. I took some examples and worked around some lexer stuff but I’m currently happy with it. If you use it and have Intellij stuff installed, you can also use a plug-in for highlighting and SOMETIMES error checking. Otherwise, even VSCode had a great plug-in for highlighting!

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts