Beta release: Predicated Recursive Descent for Rust

11 points by LenFalken


bitshift

This is not a PEG or packrat thing. It's more like "handwrite an LL(k) parser".

As I understand it, PEG is recursive descent with backtracking and (often) a nice grammar-looking syntax. Whereas this project is a nice syntax for vanilla recursive descent. Basically, trading the ordered-choice operator for a lookahead operator.

Looks promising! Seems like there might be another sweet spot for conceptually simple parser generators. I'm curious to see if it can give better error messages than PEGs.

wrs

If I understood this correctly, it’s an intriguing approach to solving the reliance on conventions for consistency that always makes me uncomfortable when I write a recursive descent parser. That is, lookahead, backtracking, etc. are all done by repeated code patterns — but how do I know they’re actually correctly repeated? I end up doing a lot of code inspection. So a little DSL that ensures they really are consistent sounds good.

On the other hand, I’m not sure how this compares to parser combinators, which address that in a different way.

LesleyLai
Comment removed by author