Hacker News new | past | comments | ask | show | jobs | submit login

Parser Combinators are fun and quick for simple grammars, but for more complex grammars I will always turn to a PEG parser based on an EBNF grammar.

In Python, my go-to library is Tatsu[0], but I guess I should also give a try to ANTLR4[1].

Also, for parser combinators, Elixir have the amazing NimbleParsec[2] library which is amazingly easy to use.

  [0] - https://tatsu.readthedocs.io/en/stable/
  [1] - https://www.antlr.org
  [2] - https://hexdocs.pm/nimble_parsec/NimbleParsec.html



You might enjoy checking out Instaparse, a Clojure library. Its project page reads, “What if context-free grammars were as easy to use as regular expressions?”

It’s not over-promising, either. I went from never having heard of it before to getting complete and correct parse trees of some ancient JSP Expression Language in about 20 minutes. Most of that time was spent typing in the BNF description that I could find only in an image.

https://github.com/Engelberg/instaparse




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

Search: