Safe Haskell | None |
---|---|
Language | Haskell2010 |
Symantics for context-free grammars.
Synopsis
- 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_Char g, Gram_String 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.
Instances
class ContextFreeOf gram where Source #
Instances
ContextFreeOf Terminal Source # | |
ContextFreeOf (Reg lr) 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 #
Instances
Class Gram_Comment
class (Gram_Char g, Gram_String 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 #
commentLine :: CF g String -> CF g String Source #
commentBlock :: CF g String -> Reg lr g String -> CF g String Source #
lexeme :: CF g a -> CF g a Source #
Instances
Gram_Comment RuleEBNF Source # | |
Defined in Language.Symantic.Grammar.ContextFree commentable :: RuleEBNF () -> RuleEBNF () -> RuleEBNF () -> RuleEBNF () Source # commentLine :: CF RuleEBNF String -> CF RuleEBNF String Source # commentBlock :: CF RuleEBNF String -> Reg lr RuleEBNF String -> CF RuleEBNF String Source # lexeme :: CF RuleEBNF a -> CF RuleEBNF a Source # | |
Gram_Comment EBNF Source # | |
Defined in Language.Symantic.Grammar.ContextFree | |
Gram_Comment g => Gram_Comment (CF g) Source # | |
Defined in Language.Symantic.Grammar.ContextFree |
gram_comment :: forall g. (Gram_Comment g, Gram_RuleEBNF g) => [CF g ()] Source #