- type UnfoldDepth phi = forall ix. phi ix -> Integer
- unfoldRecursion :: ProcessingContextFreeGrammar phi t r -> ProcessingRegularGrammar phi t r
- unfoldRecursionP :: ProcessingPenaltyContextFreeGrammar phi t r -> ProcessingPenaltyRegularGrammar phi t r
- unfoldRecursionB :: ProcessingBiasedContextFreeGrammar phi t r -> ProcessingBiasedRegularGrammar phi t r
- unfoldRecursionE :: ProcessingExtendedContextFreeGrammar phi t r -> ProcessingRegularGrammar phi t r
- selectNothing :: UnfoldDepth phi
- selectAllOnce :: UnfoldDepth phi
- selectNT :: EqFam phi => UnfoldDepth phi -> phi ix -> UnfoldDepth phi
- unselectNT :: EqFam phi => UnfoldDepth phi -> phi ix -> UnfoldDepth phi
- sumUD :: UnfoldDepth phi -> UnfoldDepth phi -> UnfoldDepth phi
- scaleUD :: Integer -> UnfoldDepth phi -> UnfoldDepth phi
- modifyUnfoldDepth :: EqFam phi => UnfoldDepth phi -> (Integer -> Integer) -> phi ix -> UnfoldDepth phi
- unfoldSelective :: EqFam phi => UnfoldDepth phi -> ProcessingContextFreeGrammar phi t r -> ProcessingContextFreeGrammar phi t r
- unfoldSelectiveE :: EqFam phi => UnfoldDepth phi -> ProcessingExtendedContextFreeGrammar phi t r -> ProcessingExtendedContextFreeGrammar phi t r
- unfoldRule :: ContextFreeRule phi r t v -> ProcessingContextFreeGrammar phi t r -> ContextFreeRule phi r t v
- unfoldRuleE :: ExtendedContextFreeRule phi r t v -> ProcessingExtendedContextFreeGrammar phi t r -> ExtendedContextFreeRule phi r t v
Documentation
type UnfoldDepth phi = forall ix. phi ix -> IntegerSource
A value of type UnfoldDepth defines for each non-terminal in a
grammar how many times it should be unfolded by the unfoldSelective
or unfoldSelectiveE
algorithms.
unfoldRecursion :: ProcessingContextFreeGrammar phi t r -> ProcessingRegularGrammar phi t rSource
Unfold recursion in a given contextx-free grammar, replacing
calls to
ref
idx with the non-terminal's production rule. This produces
production rules similar to those in traditional parser combinator
libraries.
unfoldRecursionP :: ProcessingPenaltyContextFreeGrammar phi t r -> ProcessingPenaltyRegularGrammar phi t rSource
unfoldRecursionB :: ProcessingBiasedContextFreeGrammar phi t r -> ProcessingBiasedRegularGrammar phi t rSource
unfoldRecursionE :: ProcessingExtendedContextFreeGrammar phi t r -> ProcessingRegularGrammar phi t rSource
Unfold recursion in a given extended context-free grammar,
replacing calls to
ref
idx with the non-terminal's production rule. This produces
production rules similar to those in traditional parser combinator
libraries.
selectNothing :: UnfoldDepth phiSource
A value of type UnfoldDepth
phi indicating nothing should be
unfolded at all. This can be used as a start value and then further
modified with the selectNT
function.
selectAllOnce :: UnfoldDepth phiSource
A value of type UnfoldDepth
phi indicating every non-terminal
should be unfolded once.
selectNT :: EqFam phi => UnfoldDepth phi -> phi ix -> UnfoldDepth phiSource
A function modifying a given UnfoldDepth
phi by increasing
the depth for a given non-terminal by 1.
unselectNT :: EqFam phi => UnfoldDepth phi -> phi ix -> UnfoldDepth phiSource
A function modifying a given UnfoldDepth
phi by decreasing
the depth for a given non-terminal by 1.
sumUD :: UnfoldDepth phi -> UnfoldDepth phi -> UnfoldDepth phiSource
scaleUD :: Integer -> UnfoldDepth phi -> UnfoldDepth phiSource
modifyUnfoldDepth :: EqFam phi => UnfoldDepth phi -> (Integer -> Integer) -> phi ix -> UnfoldDepth phiSource
A function modifying a given UnfoldDepth
phi by applying a given
function to the depth for a given non-terminal.
unfoldSelective :: EqFam phi => UnfoldDepth phi -> ProcessingContextFreeGrammar phi t r -> ProcessingContextFreeGrammar phi t rSource
Selectively unfold a given context-free grammar according to a
given UnfoldDepth
.
unfoldSelectiveE :: EqFam phi => UnfoldDepth phi -> ProcessingExtendedContextFreeGrammar phi t r -> ProcessingExtendedContextFreeGrammar phi t rSource
Selectively unfold a given extended context-free grammar
according to a given UnfoldDepth
.
unfoldRule :: ContextFreeRule phi r t v -> ProcessingContextFreeGrammar phi t r -> ContextFreeRule phi r t vSource
Unfold a given context-free rule by replacing all references to non-terminals with the production rule for that non-terminal in a given processing context-free grammar.
unfoldRuleE :: ExtendedContextFreeRule phi r t v -> ProcessingExtendedContextFreeGrammar phi t r -> ExtendedContextFreeRule phi r t vSource
Unfold a given extended context-free rule by replacing all references to non-terminals with the production rule for that non-terminal in a given processing extended context-free grammar.