GroteTrap-0.2: GroteTrap

Language.GroteTrap.Parser

Contents

Description

Generates a full parser from a language and offers some utility functions for immediate evaluation.

Synopsis

Parsing and reading

parseSentence :: Language a -> String -> Either ParseError ParseTreeSource

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

readParseTree :: Language a -> String -> ParseTreeSource

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

readExpression :: Language a -> String -> aSource

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