Question about lexer and parser generators in Rust

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

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • lexertl14

    C++14 version of lexertl

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • parsertl14

    C++14 version of parsertl

  • 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

  • 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

  • Analogues of nom crate.

    3 projects | /r/rust | 7 Feb 2022
  • Chumsky, a parser combinator crate that makes writing error-tolerant parsers with recovery easy and fun!

    14 projects | /r/rust | 28 Oct 2021
  • Challenge accepted: announcing SurrealDB 2.0

    2 projects | dev.to | 17 Sep 2024
  • Lelwel: A resilient LL(1) parser generator for Rust

    1 project | news.ycombinator.com | 12 Jul 2024
  • Trip C++Now 2024 – think-cell

    4 projects | news.ycombinator.com | 10 May 2024