adp-multi-0.2.3: ADP for multiple context-free languages

Safe HaskellSafe-Inferred

ADP.Multi.Combinators

Description

Parser combinators for use in grammars

Synopsis

Documentation

(<<<) :: Parseable p a b => (b -> c) -> p -> ([ParserInfo], [SubwordTree] -> Parser a c)Source

(~~~) :: Parseable p a b => ([ParserInfo], [SubwordTree] -> Parser a (b -> c)) -> p -> ([ParserInfo], [SubwordTree] -> Parser a c)Source

class Rewritable r a b whereSource

Methods

(>>>) :: ([ParserInfo], [SubwordTree] -> Parser a b) -> r -> RichParser a bSource

Instances

rewriteSource

Arguments

:: SubwordConstructionAlgorithm a 
-> ([ParserInfo], [SubwordTree] -> Parser b c) 
-> a

rewriting function

-> Parser b c 

(...) :: RichParser a b -> ([b] -> [b]) -> RichParser a bSource

type Filter a = Array Int a -> Subword -> BoolSource

Filters are not part of ADP-MCFL, but are sometimes used in RNA folding to skip parses where subwords are too long, e.g. restricting loop size to 30. It is included here for convenience.

yieldSize1 :: (Int, Maybe Int) -> RichParser a b -> RichParser a bSource

Explicitly specify yield size of a 1-dim parser.

yieldSize2 :: (Int, Maybe Int) -> (Int, Maybe Int) -> RichParser a b -> RichParser a bSource

Explicitly specify yield size of a 2-dim parser.