| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
CharacterTokenGrammar
Contents
Description
Abstract syntax instance for grammars with single-character tokens.
Synopsis
- type Term = Char
- type NTName = Ident
- type RuleName = Ident
- type Grammar = Grammar' NTName RuleName Term
- type NT = NT' NTName
- type NTDef = NTDef' NTName RuleName Term
- type Form = Form' Term
- type IRule = (NT, RuleName, [Entry])
- type Error = Either String
- checkGrammar :: Grammar -> Error (Maybe NT, Grammar)
- reifyGrammar :: Grammar -> Grammar
- ntToIdent :: Grammar -> NT -> NTName
Documentation
checkGrammar :: Grammar -> Error (Maybe NT, Grammar) Source #
Convert grammar to internal format; check for single-character terminals. Also return start non-terminal if the grammar has any rules
reifyGrammar :: Grammar -> Grammar Source #
Turn grammar back to original format.
Printing
Orphan instances
| DebugPrint Term Source # | |
Methods debugPrint :: Term -> String Source # | |
| DebugPrint Ident Source # | |
Methods debugPrint :: Ident -> String Source # | |