gll-0.4.0.5: GLL parser with simple combinator interface

GLL.Combinators.Options

Synopsis

# Documentation

data PCOptions Source #

CombinatorOptions datatype * left_biased_choice: see function leftBiased * pivot_select: provide a filtering function on pivots

Constructors

 PCOptions Fieldsleft_biased_choice :: Bool pivot_select :: Maybe (Int -> Int -> Ordering) pivot_select_nt :: Bool throw_errors :: Bool do_memo :: Bool max_errors :: Int nt_select_test :: Bool alt_select_test :: Bool seq_select_test :: Bool

A list of CombinatorOptions for evaluating combinator expressions.

A single option.

The default options: no disambiguation.

Enables a 'longest-match' at production level.

Enables a 'shortest-match' at production level.

Discards a pivot select option (internal use only)

Enables 'longest-match' at non-terminal level.

Set the maximum number of errors shown in case of an unsuccessful parse.

If there are no parse results, the default behaviour is to return an empty list. If this option is used, a runtime error will be reported, with debugging information.

Turns all occurrences of <||> into a 'left biased' variant: only return results of the second alternate if the first alternate does not have any results.

Whether to use unsafe memoisation to speed up the enumeration of parse results.

maximumsWith :: (a -> a -> Ordering) -> [a] -> [a] Source #

Filter a list such that the only remaining elements are equal to the maximum element, given an ordering operator.

maintainWith :: Eq k => (k -> k -> Ordering) -> [[(k, a)]] -> [[(k, a)]] Source #

Enables select tests at all levels: nonterminal, alternative and slot.

Disables select tests at all levels: nonterminal, alternative and slot.

Enables select tests at the level of alternatives

Disables select tests at the level of alternatives

Enables select tests at the level of nonterminals

Disables select tests at the level of nonterminals

Enables select tests at the level of grammar slots

Disables select tests at the level of grammar slots