Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

pest isn't a parser combinator. It also uses a grammar file.


Oh, wow! Thanks for the correction. I had somehow missed that. I'm working on a rust parser of Elixir myself, and using LALRPOP for it. But looks like I'll have to check out pest, too. LALRPOP has the advantage that it takes a BNF grammar, which the Elixir parser in erlang includes, so it's a somewhat straightforward translation. Not too sure how similar it is to a PEG grammar that pest takes.


LALRPOP is an LR parser, which is a very different formalism to PEG: it's easy to write a grammar in either that's difficult/impossible to express in the other.

If you'll permit the immodesty, another Rust parser is lrpar (https://crates.io/crates/lrpar) which is a more direct drop-in replacement for Yacc, but with better error recovery. [Note: I'm biased because I wrote parts of lrpar and the wider framework, grmtools, it's a part of.]




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: