grammar-combinators-0.2.7: A parsing library of context-free grammar combinators.

Safe HaskellNone

Text.GrammarCombinators.Transform.UnfoldLoops

Synopsis

Documentation

unfoldLoops :: GExtendedContextFreeGrammar phi t r rr -> GContextFreeGrammar phi t r rrSource

Unfold loops in a given grammar, replacing calls to manyRef idx by manyInf (ref idx) and likewise for many1Ref

unfoldLoopsP :: GPenaltyExtendedContextFreeGrammar phi t r rr -> GPenaltyContextFreeGrammar phi t r rrSource

Unfold loops in a given grammar, replacing calls to manyRef idx by manyInf (ref idx) and likewise for many1Ref

unfoldLoopsRule :: ExtendedContextFreeRule phi r t v -> ContextFreeRule phi r t vSource

Unfold loops in a given rule, replacing calls to manyRef idx by manyInf (ref idx) and likewise for many1Ref

replaceLoopsRule :: (ProductionRule p, EpsProductionRule p, RecProductionRule p phi r, TokenProductionRule p t) => ExtendedContextFreeRule phi r t v -> (forall ix. phi ix -> p [r ix]) -> (forall ix. phi ix -> p [r ix]) -> p vSource

Replace loops in a given rule by rules provided in two provided sets of rules, replacing calls to manyRef by the corresponding rule from the first set, and calls to manyRef by the corresponding rule from the second set. You likely don't need this and should be looking at unfoldLoops or unfoldLoopsRule instead.