peggy-0.2.0: The Parser Generator for Haskell

Text.Peggy.Prim

Documentation

newtype Parser tbl str s a Source

Constructors

Parser 

Fields

unParser :: tbl s -> SrcPos -> str -> ST s (Result str a)
 

Instances

MonadError ParseError (Parser tbl str s) 
Monad (Parser tbl str s) 
Functor (Parser tbl str s) 
Applicative (Parser tbl str s) 
Alternative (Parser tbl str s) 

data Result str a Source

Constructors

Parsed SrcPos str a 
Failed ParseError 

class MemoTable tbl whereSource

Methods

newTable :: ST s (tbl s)Source

Instances

MemoTable (MemoTable_0 str_3) 

parse :: MemoTable tbl => (forall s. Parser tbl str s a) -> SrcPos -> str -> Either ParseError aSource

parseString :: MemoTable tbl => (forall s. Parser tbl str s a) -> String -> str -> Either ParseError aSource

parseFile :: MemoTable tbl => (forall s. Parser tbl String s a) -> FilePath -> IO (Either ParseError a)Source

memo :: (tbl s -> HashTable s Int (Result str a)) -> Parser tbl str s a -> Parser tbl str s aSource

setPos :: SrcPos -> Parser tbl str s ()Source

anyChar :: ListLike str Char => Parser tbl str s CharSource

satisfy :: ListLike str Char => (Char -> Bool) -> Parser tbl str s CharSource

char :: ListLike str Char => Char -> Parser tbl str s CharSource

string :: ListLike str Char => String -> Parser tbl str s StringSource

expect :: ListLike str Char => Parser tbl str s a -> Parser tbl str s ()Source

unexpect :: ListLike str Char => Parser tbl str s a -> Parser tbl str s ()Source

space :: ListLike str Char => Parser tbl str s ()Source