Safe Haskell | None |
---|---|
Language | Haskell2010 |
- raise :: SyntaxTree -> SyntaxTree
- raiseIdentifier :: [Char]
- cleanup :: SyntaxTree -> SyntaxTree
- data GrammarRule = GrammarRule {}
- type ConstructedParser = [GrammarRule] -> Parser SyntaxTree
- nullGrammar :: GrammarRule
- grToTuple :: GrammarRule -> (String, ConstructedParser)
- lookupGrammar :: String -> [GrammarRule] -> Maybe ConstructedParser
- buildSyntax :: SyntaxTree -> [Either String GrammarRule]
- buildSyntaxRule :: SyntaxTree -> Either String GrammarRule
- pollRulename :: SyntaxTree -> Identifier
- buildDefList :: SyntaxTree -> ConstructedParser
- buildSingleDef :: SyntaxTree -> ConstructedParser
- buildSyntacticTerm :: SyntaxTree -> ConstructedParser
- buildSTWithException :: SyntaxTree -> ConstructedParser
- buildSTWithoutException :: SyntaxTree -> ConstructedParser
- buildSyntacticFactor :: SyntaxTree -> ConstructedParser
- buildSyntacticPrimary :: SyntaxTree -> ConstructedParser
- buildOptionalSequence :: SyntaxTree -> ConstructedParser
- buildRepeatedSequence :: SyntaxTree -> ConstructedParser
- buildGroupedSequence :: SyntaxTree -> ConstructedParser
- buildMetaIdentifier :: SyntaxTree -> ConstructedParser
- buildTerminalString :: SyntaxTree -> ConstructedParser
Documentation
raise :: SyntaxTree -> SyntaxTree Source
For each instance of a SyntaxTree with the identifier raiseIdentifier, merge it's children with it's parent's children.
raiseIdentifier :: [Char] Source
The identifier for syntax trees that have no content and need their children risen to the children of the syntax tree's parent.
cleanup :: SyntaxTree -> SyntaxTree Source
data GrammarRule Source
type ConstructedParser = [GrammarRule] -> Parser SyntaxTree Source
ConstructedParser is the type of the parser as generated, which takes a list of GrammarRules and returns a syntax tree.
nullGrammar :: GrammarRule Source
Null grammar rule, bad form but useful for early version. to be replaced by Maybe later..
grToTuple :: GrammarRule -> (String, ConstructedParser) Source
lookupGrammar :: String -> [GrammarRule] -> Maybe ConstructedParser Source
lookup for grammars.
buildSyntax :: SyntaxTree -> [Either String GrammarRule] Source
builds a rule from syntax tree that represents a valid EBNF file.
pollRulename :: SyntaxTree -> Identifier Source
for a SyntaxTree that represents a whole rule, finds the first meta identifier. does not recurse into the tree's children.
buildDefList :: SyntaxTree -> ConstructedParser Source
build a definitions list, a list of parsers to try one at a time until one succeeds.
buildOptionalSequence :: SyntaxTree -> ConstructedParser Source
A sequence that does not have to be parsed