3 ms·
> it tends to be much easier to provide good error messages with a recursive-descent parser It is not any more complicated with a parser generator (if it's a P
by sklogic 10y ago
> it tends to be much easier to provide good error messages with a recursive-descent parser
It is not any more complicated with a parser generator (if it's a PEG-based one). In fact, it's much easier, you're avoiding a lot of boilerplate this way.
> There's also something to be said for not having a dependency on an extra tool
Do not have a dependency on an extra tool. Use a meta-language, in which a parser generator can be embedded as a first class language feature.
- groovy2shoes 10y ago> It is not any more complicated with a parser generator (if it's a PEG-based one). In fact, it's much easier, you're avoiding a lot of boilerplate this way. True. PEGs are effing great! > Do not have a dependency on an extra tool. Use a meta-language, in which a parser generator can be embedded as a first class language feature. This is ideal, but unfortunately not always possible. For example, if you're stuck writing a language processor in C, you don't get the necessary tools for linguistic abstraction without an external dependency. In general, though, I agree with the sentiment.