| ▲ | adev_ 20 hours ago | |
> A simple recursive-descent parser is easy to write by hand and runs in linear time. Recursive descenrs parsers are not linear. They are generally O(n^2) and can even can go exponential with some grammars if written naively. It can be pretty easy to do adverserival attacks on most naive descent parser and bring it to its knees. Packrat parser [^1] are linear, but they are by no means "trivial 200 lines" type of parsers. | ||