3 ms·
This is going to be language-specific: parser combinators are much more pleasant in Haskell than in C++ for example. Handwritten recursive descent has a lot go
by millstone 7y ago
This is going to be language-specific: parser combinators are much more pleasant in Haskell than in C++ for example.
Handwritten recursive descent has a lot going for it, error messages in particular.
- orbifold 7y agoThere is a pretty nice parser combinator library in the capnproto compiler: https://github.com/capnproto/capnproto/tree/master/c%2B%2B/src/kj/parse https://github.com/capnproto/capnproto/tree/master/c%2B%2B/s.... Here is an example of how it is used: https://github.com/capnproto/capnproto/blob/950d23a13f1d602d38b8fe83c2c038dc5d30fba6/c%2B%2B/src/capnp/compiler/parser.c%2B%2B#L411 https://github.com/capnproto/capnproto/blob/950d23a13f1d602d...
- saagarjha 7y agoThey're not too bad in C++; I'm writing one.