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
- getRulename :: 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
Prunes any nulltree
s
data GrammarRule Source
Represents an EBNF grammar rule
type ConstructedParser = [GrammarRule] -> Parser SyntaxTree Source
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.
buildSyntaxRule :: SyntaxTree -> Either String GrammarRule Source
Builds a single syntax rule
getRulename :: 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
Builds 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
buildRepeatedSequence :: SyntaxTree -> ConstructedParser Source
A sequence that will parse 0 or more times