applicative-parsec-0.1.0.0: An applicative parser combinator library

Safe HaskellNone
LanguageHaskell2010

Text.Parsec.Applicative.Grammar

Documentation

data Grammar s t Source

Constructors

Grammar 

Fields

start :: s
 
productions :: Map s (Expr s t)
 

Instances

(Show s, Show t) => Show (Grammar s t) 

data Expr s t Source

Constructors

End 
Empty 
Terminal t 
NonTerminal s 
Sequence [Expr s t] 
Choice [Expr s t] 
Repeat (Expr s t) 
Try (Expr s t) 
Fail (Maybe String) 

Instances

(Show s, Show t) => Show (Expr s t) 

nonTerminals :: Eq s => [(s, Parser s tt td ())] -> Parser s tt td a -> [(s, Parser s tt td ())] Source

parserToGrammar :: Ord s => Parser s tt td a -> Maybe (Grammar s tt) Source

ce :: Parser s tt td a -> Expr s tt Source

flatten :: Expr s t -> Expr s t Source

flattenChoice :: Expr s t -> [Expr s t] Source