ebnf-bff-0.1.0.0: Parser combinators & EBNF, BFFs!

Safe HaskellNone
LanguageHaskell2010

Text.EBNF.Build.Parser.Parts

Synopsis

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.

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..

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