ebnf-bff-0.1.1.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.

cleanup :: SyntaxTree -> SyntaxTree Source

Prunes any nulltrees

data GrammarRule Source

Represents an EBNF grammar rule

Constructors

GrammarRule 

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.

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