|
|
|
|
|
by colanderman
4666 days ago
|
|
PEG parsers use backtracking and do not operate in a single pass. Backtracking + memoization is but one implementation technique for PEG parsers. Another such technique is akin to dynamic programming -- fill in a table with possible parsing outcomes as you go. No "backtracking" (which really, is moot in a memoized PEG parser) required. Either way, the performance is identical to that of a recursive descent parser (linear in the size of the input and number of nonterminals). |
|
And performance is not just time, but also space.
There are niches for most parsing algorithms, but PEGs are a poor fit for most tasks except lightweight ad-hoc use, especially implementation languages for which tool support is poor.