Overview
Packrat Parsing caches each parser result at each input position so backtracking does not repeat work.
Parses with memoized recursive descent for linear-time parsing expression grammars.
Compact metadata for implementation and discovery.
Packrat Parsing caches each parser result at each input position so backtracking does not repeat work.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(n)
Worst
O(n)
Space
O(nr)
Show parser calls being cached by input position.
Packrat Parsing operates in O(n) time and O(nr) space within the Memoized Parsing family. Often compared with Recursive Descent Parsing and Earley Parser.
What each reference supports for this entry.
Reference for packrat parsing, memoized recursive descent, and linear-time PEG-style parsing.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Packrat parsing memoizes PEG-style recursive descent to guarantee linear parsing time.