For Haskell there is Happy. Is there something similar for Elixir?

For Haskell, there is a program named Happy which given a set of definition, rules, and some code, results into a lexer.hs or parser.hs. Is there something similar for Elixir ?

Leex and Yecc, but these will require a little Erlang. Alternatively you can use NimbleParsec which use Elixir meta programming facilities to define parser.

3 Likes

A decent example is https://github.com/narrowtux/abacus - the src folder contains the lexer & parser code (Erlang-land), and the lib folder contains calls into this (e.g. Abacus.lex/1)