ptera-core-0.1.0.0: A parser generator
Safe HaskellNone
LanguageHaskell2010

Language.Parser.Ptera.Syntax.Grammar

Documentation

type T start nonTerminal terminal elem varDoc altDoc action = GrammarT start nonTerminal terminal elem varDoc altDoc action Source #

type GrammarT start nonTerminal terminal elem varDoc altDoc action = StateT (Context start nonTerminal terminal elem varDoc altDoc action) Source #

data Context start nonTerminal terminal elem varDoc altDoc action Source #

Constructors

Context 

Fields

fixGrammarT :: Monad m => GrammarT start nonTerminal terminal elem varDoc altDoc action m () -> m (FixedGrammar start nonTerminal terminal elem varDoc altDoc action) Source #

data FixedGrammar start nonTerminal terminal elem varDoc altDoc action Source #

Constructors

FixedGrammar 

Fields

data Action (action :: [Type] -> Type -> Type) where Source #

Constructors

Action :: action us a -> Action action 

data RuleExpr nonTerminal terminal elem altDoc action where Source #

Constructors

RuleExpr :: [Alt nonTerminal terminal elem altDoc action a] -> RuleExpr nonTerminal terminal elem altDoc action 

data Alt nonTerminal terminal elem altDoc action a where Source #

Constructors

Alt :: Expr nonTerminal terminal elem us -> altDoc -> action us a -> Alt nonTerminal terminal elem altDoc action a 

type Expr nonTerminal terminal elem = T (Unit nonTerminal terminal elem) Source #

data Unit nonTerminal terminal elem u where Source #

Constructors

UnitToken :: terminal -> Unit nonTerminal terminal elem elem 
UnitVar :: nonTerminal -> Unit nonTerminal terminal elem u 

initialT :: Enum start => Monad m => start -> nonTerminal -> GrammarT start nonTerminal terminal elem varDoc altDoc action m () Source #

ruleT :: Enum nonTerminal => Monad m => nonTerminal -> varDoc -> RuleExpr nonTerminal terminal elem altDoc action -> GrammarT start nonTerminal terminal elem varDoc altDoc action m () Source #