cco-0.0.3: Utilities for compiler constructionContentsIndex
CCO.Tree.Parser
Portabilityportable
Stabilityprovisional
Maintainerstefan@cs.uu.nl
Contents
Parsing ATerms
Parsing arguments
Description
A set of simple parsing utilities that facilitate the conversion from ATerms to Trees.
Synopsis
data TreeParser a
integer :: TreeParser Integer
float :: TreeParser Double
string :: TreeParser String
app :: Con -> ArgumentParser a -> TreeParser a
tuple :: ArgumentParser a -> TreeParser a
list :: [TreeParser a] -> TreeParser [a]
parseTree :: [TreeParser a] -> ATerm -> Feedback a
data ArgumentParser a
arg :: Tree a => ArgumentParser a
Parsing ATerms
data TreeParser a
Parser that consumes ATerms and, if successful, produces a value of a specified type.
show/hide Instances
integer :: TreeParser Integer
A TreeParser that consumes an Integer term.
float :: TreeParser Double
A TreeParser that consumes a Float term.
string :: TreeParser String
A TreeParser that consumes a String term.
app :: Con -> ArgumentParser a -> TreeParser a
A TreeParser that consumes an application of a given constructor and that uses a specified ArgumentParser to parse the argument terms of the application.
tuple :: ArgumentParser a -> TreeParser a
A TreeParser that consumes a tuple term and that uses a specified ArgumentParser to parse the component terms of the tuple.
list :: [TreeParser a] -> TreeParser [a]
A TreeParser that consumes a list term and that uses a specified family of TreeParsers to parse the elements of the list.
parseTree :: [TreeParser a] -> ATerm -> Feedback a
Uses a family of TreeParsers to parse a given ATerm.
Parsing arguments
data ArgumentParser a
Parser that consumes a list of ATerms and, if successful, produces a value of a specified type.
show/hide Instances
arg :: Tree a => ArgumentParser a
An ArgumentParser that consumes a single ATerm, converting it to a Tree of the appropriate type.
Produced by Haddock version 2.3.0