Copyright | (c) 2017 Patrick Champion |
---|---|
License | see LICENSE file |
Maintainer | chlablak@gmail.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
- type To ast = Either ParseError ast
- class (Eq ast, Show ast) => InputGrammar ast where
- rules' :: InputGrammar ast => ast -> IO (Either String [Rule])
Documentation
type To ast = Either ParseError ast Source #
Syntactic sugar For exemple: `case PP.parseAst input :: (PP.To Ebnf.Syntax) of ...`
class (Eq ast, Show ast) => InputGrammar ast where Source #
Type class for grammars
parser :: Parsec String () ast Source #
Entry parser
parseAst :: String -> To ast Source #
Parse String to AST
stringify :: ast -> String Source #
AST to String
rules :: ast -> [Rule] Source #
AST to canonical rules
Transform terminals to lexical rules