Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hydra.Grammar
Description
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 :: Name
- _LabeledPattern_pattern :: Name
- data Pattern
- _Pattern :: Name
- _Pattern_nil :: Name
- _Pattern_ignored :: Name
- _Pattern_labeled :: Name
- _Pattern_constant :: Name
- _Pattern_regex :: Name
- _Pattern_nonterminal :: Name
- _Pattern_sequence :: Name
- _Pattern_alternatives :: Name
- _Pattern_option :: Name
- _Pattern_star :: Name
- _Pattern_plus :: Name
- data Production = Production {}
- _Production :: Name
- _Production_symbol :: Name
- _Production_pattern :: Name
- newtype Regex = Regex {}
- _Regex :: Name
- newtype Symbol = Symbol {}
- _Symbol :: Name
Documentation
A constant pattern
Constructors
Constant | |
Fields
|
An enhanced Backus-Naur form (BNF) grammar
Constructors
Grammar | |
Fields
|
A name for a pattern
data LabeledPattern Source #
A pattern together with a name (label)
Constructors
LabeledPattern | |
Fields |
Instances
Read LabeledPattern Source # | |
Defined in Hydra.Grammar Methods readsPrec :: Int -> ReadS LabeledPattern # readList :: ReadS [LabeledPattern] # | |
Show LabeledPattern Source # | |
Defined in Hydra.Grammar Methods showsPrec :: Int -> LabeledPattern -> ShowS # show :: LabeledPattern -> String # showList :: [LabeledPattern] -> ShowS # | |
Eq LabeledPattern Source # | |
Defined in Hydra.Grammar Methods (==) :: LabeledPattern -> LabeledPattern -> Bool # (/=) :: LabeledPattern -> LabeledPattern -> Bool # | |
Ord LabeledPattern Source # | |
Defined in Hydra.Grammar Methods 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
Constructors
_Pattern_nil :: Name Source #
_Pattern_star :: Name Source #
_Pattern_plus :: Name Source #
data Production Source #
A BNF production
Constructors
Production | |
Fields |
Instances
Read Production Source # | |
Defined in Hydra.Grammar Methods readsPrec :: Int -> ReadS Production # readList :: ReadS [Production] # readPrec :: ReadPrec Production # readListPrec :: ReadPrec [Production] # | |
Show Production Source # | |
Defined in Hydra.Grammar Methods showsPrec :: Int -> Production -> ShowS # show :: Production -> String # showList :: [Production] -> ShowS # | |
Eq Production Source # | |
Defined in Hydra.Grammar | |
Ord Production Source # | |
Defined in Hydra.Grammar Methods 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