GroteTrap-0.5: Parser and selection library for expression languages.

Language.GroteTrap

Contents

Synopsis

Re-exports

Parsing and evaluating

parseSentence :: Monad m => Language a -> String -> m ParseTreeSource

Given a language and a string, yields the parse tree.

readParseTree :: Language a -> String -> ParseTreeSource

Given a language and a string, yields the parse tree or throws an exception.

readExpression :: Language a -> String -> aSource

Given a language and a string, parses and evaluates the string.

evaluate :: Language a -> ParseTree -> aSource

Evaluates a parse tree from a language.

evalRange :: Monad m => Language a -> ParseTree -> Range -> m [a]Source

Evaluates part of a parse tree. The relevant part is indicated by the range.