4 ms·
I also slightly dislike parser combinators. Mainly because usually you cannot easily debug them by placing a breakpoint. In the best case scenario the specific
by bd82 9y ago
I also slightly dislike parser combinators.
Mainly because usually you cannot easily debug them
by placing a breakpoint.
In the best case scenario the specific parser combinator
has good tracing support to enable debugging.
However, imho this is still inferior to simple breakpoints and debugging "directly" in one's favorite IDE.
- aidenn0 9y agoThe only parser combinator library I used (smug, for common lisp) had little trouble with breakpoints; (any parse with significant backtracking was annoying but breakpoints worked fine) is it common that one cannot use breakpoints for debugging in other parser-combinator libraries?
- bd82 9y agoI'm not familiar with Smug, but I would guess that the combinator is implemented using LISP macros which are than expanded into "real" source code (lisp lists) which is evaluated directly and can halt on break points. In programing languages which do not have true macros The combinator API normally creates a data structure representing the grammar which is than interpreted Which usually makes debugging harder and the parsing slower.
- kmicklas 9y agoI would argue that if you're tying to debug a parser with a tracing debugger you're doing something wrong.