Memoisation (both as described by Norvig 1991, giving Packrat
parsers for non-left recursive grammars, and the equivalent described by
Frost and Hafiz 2006 which allows left-recursive grammars to be used).
Note that neither paper describes the extension to backtracking with
generators implemented here.
|
|
MemoException
Exception raised for problems with memoisation.
|
|
|
_RMemo
A simple memoizer for grammars that do not have left recursion.
|
|
|
RTable
Wrap a generator so that separate uses all call the same core generator,
which is itself tabulated as it unrolls.
|
|
|
_DummyMatcher
Fake matcher used to provide the appropriate interface to the generator
wrapper from within RTable.
|
|
|
_LMemo
A memoizer for grammars that do have left recursion.
|
|
|
PerStreamCache
Manage the counter (one for each different stream) that limits the
number of (left-)recursive calls.
|
|
|
PerCallCache
The "final" cache for a matcher at a certain recursive depth and with a
certain input stream.
|