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

Text.GrammarCombinators.Base.Processor

Synopsis

Documentation

type GProcessor phi r rr = forall ix. phi ix -> rr ix -> r ixSource

type Processor phi r = GProcessor phi r (PF phi r)Source

identityProcessor :: GProcessor phi r rSource

A trivial identity processor that keeps current production rule results unmodified.

trivialProcessor :: Processor phi (K0 ())Source

A trivial processor that throws everything away and returns a value of the type K0 ().

applyProcessor' :: (ProductionRule p, EpsProductionRule p) => (forall ix. phi ix -> p (r ix)) -> GProcessor phi r' r -> forall ix. phi ix -> p (r' ix)Source

applyProcessor :: GContextFreeGrammar phi t r rr -> GProcessor phi rr' rr -> GContextFreeGrammar phi t r rr'Source

Apply a given processor to a given context-free grammar.

applyProcessorL :: LiftFam phi => GLContextFreeGrammar phi t r rr -> GProcessor phi rr' rr -> Q Exp -> GLContextFreeGrammar phi t r rr'Source

applyProcessorLE :: LiftFam phi => GLExtendedContextFreeGrammar phi t r rr -> GProcessor phi rr' rr -> Q Exp -> GLExtendedContextFreeGrammar phi t r rr'Source

Apply a given processor to a given extended liftable context-free grammar.

applyProcessorE :: GExtendedContextFreeGrammar phi t r rr -> GProcessor phi rr' rr -> GExtendedContextFreeGrammar phi t r rr'Source

Apply a given processor to a given extended context-free grammar.