Sequential composition ignoring right side.
Sequential composition ignoring right side.
Optional parsing.
Optional parsing.
Apply function to successful result.
Apply function to successful result.
Turn a successful result into a specific value which is evaluated each each time this parser is used.
Turn a successful result into a specific value which is evaluated each each time this parser is used.
Apply this rule to the given input, memoising the result.
Apply this rule to the given input, memoising the result.
Alternative entry point to directly parse a string.
Alternative entry point to directly parse a string.
Grow the current parse result according to a left recursion.
Parameterise next parse step by result from previous one.
Parameterise next parse step by result from previous one.
Process a given left recursion instance.
The section of the memo table relating to this rule.
Look up the memoised result for this rule, taking into account that it might be participating in an active left recursion.
Initialise the left recursion data for a new application of this rule.
Alternation.
Alternation.
Sequential composition.
Sequential composition.
Sequential composition ignoring left side.
Sequential composition ignoring left side.
A parser that is a memoising, left recursion-detecting encapsulation of a normal parser that returns a value of a particular type. This type of parser must be used if any of the alternatives are left recursive. Otherwise a plain
Parser
can be used if memoisation is not desired.Note that it is non-trivial (impossible?) to combine this class with
Parser
. We need the latter to be covariant but this class can't be becauseT
occurs in an invariant position inMemoEntry
.