Safe Haskell | None |
---|---|
Language | Haskell2010 |
Symantics for context-free grammars.
- newtype CF g a = CF {
- unCF :: g a
- class ContextFreeOf gram where
- class Gram_CF g where
- class Applicative g => Gram_App g where
- class (Gram_Alt g, Gram_App g) => Gram_AltApp g where
- class (Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_App g, Gram_AltApp g, Gram_CF g) => Gram_Comment g where
- gram_comment :: forall g. (Gram_Comment g, Gram_RuleEBNF g) => [CF g ()]
Type CF
Context-free grammar.
Gram_Error err g => Gram_Error err (CF g) Source # | |
Gram_State st g => Gram_State st (CF g) Source # | |
Gram_Reader st g => Gram_Reader st (CF g) Source # | |
Functor g => Functor (CF g) Source # | |
Applicative g => Applicative (CF g) Source # | |
Gram_RuleEBNF g => Gram_RuleEBNF (CF g) Source # | |
Gram_Rule g => Gram_Rule (CF g) Source # | |
Gram_Terminal g => Gram_Terminal (CF g) Source # | |
Gram_RegL g => Gram_RegL (CF g) Source # | |
Gram_RegR g => Gram_RegR (CF g) Source # | |
Gram_Try g => Gram_Try (CF g) Source # | |
Gram_Alt g => Gram_Alt (CF g) Source # | |
Gram_Comment g => Gram_Comment (CF g) Source # | |
Gram_AltApp g => Gram_AltApp (CF g) Source # | |
Gram_App g => Gram_App (CF g) Source # | |
Gram_CF g => Gram_CF (CF g) Source # | |
Gram_Op g => Gram_Op (CF g) Source # | |
IsString (g a) => IsString (CF g a) Source # | |
class ContextFreeOf gram where Source #
Class Gram_CF
class Gram_CF g where Source #
Symantics for context-free grammars.
(<&) :: CF g (a -> b) -> Reg lr g a -> CF g b infixl 4 Source #
NOTE: CFL ∩ RL is a CFL. See ISBN 81-7808-347-7, Theorem 7.27, p.286
(&>) :: Reg lr g (a -> b) -> CF g a -> CF g b infixl 4 Source #
minus :: CF g a -> Reg lr g b -> CF g a Source #
NOTE: CFL - RL is a CFL. See ISBN 81-7808-347-7, Theorem 7.29, p.289
Class Gram_App
class Applicative g => Gram_App g where Source #
Class Gram_AltApp
class (Gram_Alt g, Gram_App g) => Gram_AltApp g where Source #
option :: a -> g a -> g a Source #
optional :: g a -> g (Maybe a) Source #
manyFoldL :: b -> (a -> b -> b) -> g a -> g b Source #
someFoldL :: b -> (a -> b -> b) -> g a -> g b Source #
manySkip :: g a -> g () Source #
someSkip :: g a -> g () Source #
inside :: (in_ -> next) -> CF g begin -> CF g in_ -> CF g end -> CF g next -> CF g next Source #
Gram_AltApp RuleEBNF Source # | |
Gram_AltApp EBNF Source # | |
Gram_AltApp g => Gram_AltApp (CF g) Source # | |
Class Gram_Comment
class (Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_App g, Gram_AltApp g, Gram_CF g) => Gram_Comment g where Source #
Symantics for handling comments after each lexeme
.
commentable :: g () -> g () -> g () -> g () Source #
comment_line :: CF g String -> CF g String Source #
comment_block :: CF g String -> Reg lr g String -> CF g String Source #
lexeme :: CF g a -> CF g a Source #
Gram_Comment RuleEBNF Source # | |
Gram_Comment EBNF Source # | |
Gram_Comment g => Gram_Comment (CF g) Source # | |
gram_comment :: forall g. (Gram_Comment g, Gram_RuleEBNF g) => [CF g ()] Source #