hydrogen-parsing-0.17: Hydrogen Parsing Utilities

Safe HaskellNone
LanguageHaskell2010

Hydrogen.Parsing

Synopsis

Documentation

type Parser source result = source -> Either SomethingBad result Source

data ParseError :: *

The abstract data type ParseError represents parse errors. It provides the source position (SourcePos) of the error and a list of error messages (Message). A ParseError can be returned by the function parse. ParseError is an instance of the Show and Eq classes.

type Tokens t = [(SourcePos, t)] Source

sourceToken :: (Show t, Stream (Tokens t) m (SourcePos, t)) => (t -> Maybe a) -> ParsecT [(SourcePos, t)] u m a Source

manyBetween :: (Monad m, Stream s m t) => ParsecT s u m open -> ParsecT s u m close -> ParsecT s u m p -> ParsecT s u m [p] Source

(>+>) :: Parser a b -> Parser b c -> Parser a c Source

(<+<) :: Parser b c -> Parser a b -> Parser a c Source

sya Source

Arguments

:: (Ord p, Eq o) 
=> (a -> Maybe o)

Determine operator

-> (o -> Bool)

Is left precedence?

-> (o -> p)

Precedence of given operator

-> [a]

The input stream (infix notation)

-> [a]

The output stream (postfix notation)

Infix to postfix notation (an implementation of the Shunting-Yard-Algorithm)

tryRead :: Monad m => ReadS a -> String -> m a Source

tryReads :: (Monad m, Read a) => String -> m a Source