Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A common API for BNF-based grammars, specifying context-free languages
Synopsis
- newtype Constant = Constant {
- unConstant :: String
- _Constant :: Name
- newtype Grammar = Grammar {
- unGrammar :: [Production]
- _Grammar :: Name
- newtype Label = Label {}
- _Label :: Name
- data LabeledPattern = LabeledPattern {}
- _LabeledPattern :: Name
- _LabeledPattern_label :: FieldName
- _LabeledPattern_pattern :: FieldName
- data Pattern
- _Pattern :: Name
- _Pattern_nil :: FieldName
- _Pattern_ignored :: FieldName
- _Pattern_labeled :: FieldName
- _Pattern_constant :: FieldName
- _Pattern_regex :: FieldName
- _Pattern_nonterminal :: FieldName
- _Pattern_sequence :: FieldName
- _Pattern_alternatives :: FieldName
- _Pattern_option :: FieldName
- _Pattern_star :: FieldName
- _Pattern_plus :: FieldName
- data Production = Production {}
- _Production :: Name
- _Production_symbol :: FieldName
- _Production_pattern :: FieldName
- newtype Regex = Regex {}
- _Regex :: Name
- newtype Symbol = Symbol {}
- _Symbol :: Name
Documentation
A constant pattern
Constant | |
|
An enhanced Backus-Naur form (BNF) grammar
Grammar | |
|
A name for a pattern
data LabeledPattern Source #
A pattern together with a name (label)
Instances
Read LabeledPattern Source # | |
Defined in Hydra.Grammar readsPrec :: Int -> ReadS LabeledPattern # readList :: ReadS [LabeledPattern] # | |
Show LabeledPattern Source # | |
Defined in Hydra.Grammar showsPrec :: Int -> LabeledPattern -> ShowS # show :: LabeledPattern -> String # showList :: [LabeledPattern] -> ShowS # | |
Eq LabeledPattern Source # | |
Defined in Hydra.Grammar (==) :: LabeledPattern -> LabeledPattern -> Bool # (/=) :: LabeledPattern -> LabeledPattern -> Bool # | |
Ord LabeledPattern Source # | |
Defined in Hydra.Grammar compare :: LabeledPattern -> LabeledPattern -> Ordering # (<) :: LabeledPattern -> LabeledPattern -> Bool # (<=) :: LabeledPattern -> LabeledPattern -> Bool # (>) :: LabeledPattern -> LabeledPattern -> Bool # (>=) :: LabeledPattern -> LabeledPattern -> Bool # max :: LabeledPattern -> LabeledPattern -> LabeledPattern # min :: LabeledPattern -> LabeledPattern -> LabeledPattern # |
A pattern which matches valid expressions in the language
data Production Source #
A BNF production
Instances
Read Production Source # | |
Defined in Hydra.Grammar readsPrec :: Int -> ReadS Production # readList :: ReadS [Production] # readPrec :: ReadPrec Production # readListPrec :: ReadPrec [Production] # | |
Show Production Source # | |
Defined in Hydra.Grammar showsPrec :: Int -> Production -> ShowS # show :: Production -> String # showList :: [Production] -> ShowS # | |
Eq Production Source # | |
Defined in Hydra.Grammar (==) :: Production -> Production -> Bool # (/=) :: Production -> Production -> Bool # | |
Ord Production Source # | |
Defined in Hydra.Grammar compare :: Production -> Production -> Ordering # (<) :: Production -> Production -> Bool # (<=) :: Production -> Production -> Bool # (>) :: Production -> Production -> Bool # (>=) :: Production -> Production -> Bool # max :: Production -> Production -> Production # min :: Production -> Production -> Production # |
_Production :: Name Source #
A regular expression