| Copyright | (c) 2017 Patrick Champion |
|---|---|
| License | see LICENSE file |
| Maintainer | chlablak@gmail.com |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
PP.Rule
Description
- data Rule
- uniformize :: [Rule] -> [Rule]
- extend :: [Rule] -> Either String [Rule]
- separate :: [Rule] -> ([Rule], [Rule])
- regexfy :: [Rule] -> [Rule]
- type RuleSet = Map String [[Rule]]
- ruleSet :: [Rule] -> RuleSet
- rule :: String -> RuleSet -> [Rule]
- check :: RuleSet -> ([String], [String])
- type FirstSet = Map String [Rule]
- firstSet :: RuleSet -> FirstSet
- first :: Rule -> FirstSet -> [Rule]
Canonical low-level rule
Canonical rule type
Constructors
| Rule String [Rule] | A rule is defined by a non terminal and a list of Term and NonTerm The list should end with Empty |
| NonTerm String | Non terminal string |
| Term IToken | Terminal character |
| TermToken String | Terminal token |
| Empty | Empty |
| Concat [Rule] | Concatenated rules, useful for PP.InputGrammar.rules |
| RegEx String | Regular expression, useful for lexical rules |
| RegExString String | No parse-string |
uniformize :: [Rule] -> [Rule] Source #
Uniformize a list of rules `uniformize = sort . nub . concatMap (flatten . clean)`