Copyright | (c) 2008 Utrecht University |
---|---|
License | All rights reserved |
Maintainer | stefan@cs.uu.nl |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
CCO.Tree.Parser
Contents
- 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 Source
Parser that consumes ATerm
s and, if successful, produces a value of a
specified type.
Instances
integer :: TreeParser Integer Source
A TreeParser
that consumes an Integer
term.
float :: TreeParser Double Source
A TreeParser
that consumes a Float
term.
string :: TreeParser String Source
A TreeParser
that consumes a String
term.
app :: Con -> ArgumentParser a -> TreeParser a infix 4 Source
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 Source
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] Source
A TreeParser
that consumes a list term and that uses a specified
family of TreeParser
s to parse the elements of the list.
parseTree :: [TreeParser a] -> ATerm -> Feedback a Source
Uses a family of TreeParser
s to parse a given ATerm
.
Parsing arguments
data ArgumentParser a Source
Parser that consumes a list of ATerm
s and, if successful, produces a
value of a specified type.
arg :: Tree a => ArgumentParser a Source
An ArgumentParser
that consumes a single ATerm
, converting it to
a Tree
of the appropriate type.