4 ms·
Ah gotcha, thanks! Out of curiosity do you recall examples of any of the hardest cases it couldn't properly handle?
by dataflow 2y ago
Ah gotcha, thanks! Out of curiosity do you recall examples of any of the hardest cases it couldn't properly handle?
- HexDecOctBin 2y agoStuff like: char *(*(**foo[][8])())[]
- dataflow 2y agoAnd it would fail to parse at all, or parse as the wrong thing?
- HexDecOctBin 2y agoRecursive descent required too much backtracking and state resets, which made the code buggy and unreadable (and the error reporting was awful). Pratt parser simply parsed wrong (presumably because I couldn't figure out the right way to sort the precedences).
- dataflow 2y agoGotcha! I've been thinking of trying my hand at a C parser but it always gave me the sense that it was more annoying than it should be haha. Interesting to near your experience, thanks for sharing!