Parsec/peg parsers in Elixir?

Does Elixir have libraries for Parsec ( Parser combinator - Wikipedia ) or Packrat ( Packrat Parsing and Parsing Expression Grammars ) parsing ?

Google seems to point to GitHub - relops/leex_yecc_example: A simple example of how to use Leex and Yecc

Check out NimbleParsec

3 Likes

Will do, thanks! Is there also one for PEG/Packtrat parsing? For grammars that are inherently left-recursive, it is sometimes easier to not refactor them into Parsec style.

For PEG/packtrat there’s Neotoma

It hasn’t been updated in while, but that’s largely because it is stable.

Normally when I’m parsing in Erlang or Elixir I use leex and yecc, which come with Erlang.

7 Likes