chr-parse-0.1.0.0: Parsing for chr library

Safe HaskellNone
LanguageHaskell2010

CHR.Parse

Contents

Synopsis

Documentation

module UU.Parsing

Specific parser types

type PlainParser tok gp = forall p. IsParser p tok => p gp Source #

type LayoutParser tok ep = forall i o p. (IsParser (OffsideParser i o tok p) tok, InputState i tok p, OutputState o, Position p) => OffsideParser i o tok p ep Source #

type LayoutParser2 tok ep = forall i o p. (IsParser (OffsideParser i o tok p) tok, InputState i tok p, OutputState o, Position p) => OffsideParser i o tok p ep -> OffsideParser i o tok p ep Source #

Top level wrappers/invocations

parsePlain :: (Symbol s, InputState inp s pos) => AnaParser inp Pair s pos a -> inp -> Steps (a, inp) s pos Source #

parseToResMsgs :: (Symbol s, InputState inp s pos) => AnaParser inp Pair s pos a -> inp -> (a, [Message s pos]) Source #

Invoke parser, yielding result + errors

parseToResWith :: (Symbol s, Show s, Eq s, InputState inp s pos) => (pos -> String -> String -> e) -> AnaParser inp Pair s pos a -> inp -> (a, [e]) Source #

Invoke parser, yielding result + errors processed with a function

Additional parser combinators

pAnyFromMap :: IsParser p s => (k -> p a1) -> Map k v -> p v Source #

pAnyKey :: IsParser p s => (a1 -> p a) -> [a1] -> p a Source #

pMaybe :: IsParser p s => a1 -> (a -> a1) -> p a -> p a1 Source #

pMb :: IsParser p s => p a -> p (Maybe a) Source #

pDo :: (InputState i s p, OutputState o, Position p, Symbol s, Ord s) => OffsideParser i o s p x -> OffsideParser i o s p y -> OffsideParser i o s p z -> OffsideParser i o s p a -> OffsideParser i o s p (Maybe last -> a) -> OffsideParser i o s p last -> OffsideParser i o s p [a] Source #

Re-exports

position :: GenToken k t v -> Pos #

Dealing with Message

fromMessage :: (Show s, Eq s) => (p -> String -> String -> x) -> Message s p -> x Source #

Convert from Message to anything using a function taking as String position, expected symbol and action taken respectively