uulib-0.9.23: Haskell Utrecht Tools Library

Safe Haskell | None
Language | Haskell98

UU.Parsing.Offside

Synopsis

- parseOffside :: (Symbol s, InputState i s p, Position p) => OffsideParser i Pair s p a -> OffsideInput i s p -> Steps (a, OffsideInput i s p) (OffsideSymbol s) p
- pBlock :: (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 [a]
- pBlock1 :: (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 [a]
- pOffside :: (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 a -> OffsideParser i o s p a -> OffsideParser i o s p a
- pOpen :: (OutputState o, InputState i s p, Position p, Symbol s, Ord s) => OffsideParser i o s p ()
- pClose :: (OutputState o, InputState i s p, Position p, Symbol s, Ord s) => OffsideParser i o s p ()
- pSeparator :: (OutputState o, InputState i s p, Position p, Symbol s, Ord s) => OffsideParser i o s p ()
- scanOffside :: (InputState i s p, Position p, Eq s) => s -> s -> s -> [s] -> i -> OffsideInput i s p
- scanOffsideWithTriggers :: forall i s p. (InputState i s p, Position p, Eq s) => s -> s -> s -> [(OffsideTrigger, s)] -> i -> OffsideInput i s p
- scanLiftTokensToOffside :: InputState t s p => t -> OffsideInput inp s p -> OffsideInput inp s p
- data OffsideTrigger
  - = Trigger_IndentGT
  - | Trigger_IndentGE
- data OffsideSymbol s
  - = Symbol s
  - | SemiColon
  - | CloseBrace
  - | OpenBrace
- data OffsideInput inp s p
- data Stream inp s p
- newtype OffsideParser i o s p a = OP (AnaParser (OffsideInput i s p) o (OffsideSymbol s) p a)

# Documentation

parseOffside :: (Symbol s, InputState i s p, Position p) => OffsideParser i Pair s p a -> OffsideInput i s p -> Steps (a, OffsideInput i s p) (OffsideSymbol s) p Source #

pBlock :: (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 [a] Source #

pBlock1 :: (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 [a] Source #

pOffside :: (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 a -> OffsideParser i o s p a -> OffsideParser i o s p a Source #

pOpen :: (OutputState o, InputState i s p, Position p, Symbol s, Ord s) => OffsideParser i o s p () Source #

pClose :: (OutputState o, InputState i s p, Position p, Symbol s, Ord s) => OffsideParser i o s p () Source #

pSeparator :: (OutputState o, InputState i s p, Position p, Symbol s, Ord s) => OffsideParser i o s p () Source #

scanOffside :: (InputState i s p, Position p, Eq s) => s -> s -> s -> [s] -> i -> OffsideInput i s p Source #

convert tokens to offside tokens, dealing with Haskell's layout rule

scanOffsideWithTriggers :: forall i s p. (InputState i s p, Position p, Eq s) => s -> s -> s -> [(OffsideTrigger, s)] -> i -> OffsideInput i s p Source #

scanLiftTokensToOffside :: InputState t s p => t -> OffsideInput inp s p -> OffsideInput inp s p Source #

plainly lift tokens to offside tokens scanLiftTokensToOffside :: (InputState i s p) => [i] -> OffsideInput i s p -> OffsideInput i s p

data OffsideTrigger Source #

Constructors

Trigger_IndentGT |
Trigger_IndentGE |

Instances

Eq OffsideTrigger Source # |
Instance details Defined in UU.Parsing.Offside Methods (==) :: OffsideTrigger -> OffsideTrigger -> Bool Source # (/=) :: OffsideTrigger -> OffsideTrigger -> Bool Source #

data OffsideSymbol s Source #

Constructors

Symbol s |
SemiColon |
CloseBrace |
OpenBrace |

Instances

Eq s => Eq (OffsideSymbol s) Source # |
Instance details Defined in UU.Parsing.Offside Methods (==) :: OffsideSymbol s -> OffsideSymbol s -> Bool Source # (/=) :: OffsideSymbol s -> OffsideSymbol s -> Bool Source #
Ord s => Ord (OffsideSymbol s) Source # |

Instance details

Defined in UU.Parsing.Offside

Methods

compare :: OffsideSymbol s -> OffsideSymbol s -> Ordering Source #

(<) :: OffsideSymbol s -> OffsideSymbol s -> Bool Source #

(<=) :: OffsideSymbol s -> OffsideSymbol s -> Bool Source #

(>) :: OffsideSymbol s -> OffsideSymbol s -> Bool Source #

(>=) :: OffsideSymbol s -> OffsideSymbol s -> Bool Source #

max :: OffsideSymbol s -> OffsideSymbol s -> OffsideSymbol s Source #

min :: OffsideSymbol s -> OffsideSymbol s -> OffsideSymbol s Source #

Show s => Show (OffsideSymbol s) Source # |
Instance details Defined in UU.Parsing.Offside Methods showsPrec :: Int -> OffsideSymbol s -> ShowS Source # show :: OffsideSymbol s -> String Source # showList :: [OffsideSymbol s] -> ShowS Source #
Symbol s => Symbol (OffsideSymbol s) Source # |
Instance details Defined in UU.Parsing.Offside Methods deleteCost :: OffsideSymbol s -> Int# Source # symBefore :: OffsideSymbol s -> OffsideSymbol s Source # symAfter :: OffsideSymbol s -> OffsideSymbol s Source #
InputState inp s p => InputState (OffsideInput inp s p) (OffsideSymbol s) p Source # |

Instance details

Defined in UU.Parsing.Offside

Methods

splitStateE :: OffsideInput inp s p -> Either' (OffsideInput inp s p) (OffsideSymbol s) Source #

splitState :: OffsideInput inp s p -> (#OffsideSymbol s, OffsideInput inp s p#) Source #

getPosition :: OffsideInput inp s p -> p Source #

reportError :: Message (OffsideSymbol s) p -> OffsideInput inp s p -> OffsideInput inp s p Source #

insertSymbol :: OffsideSymbol s -> OffsideInput inp s p -> OffsideInput inp s p Source #

deleteSymbol :: OffsideSymbol s -> OffsideInput inp s p -> OffsideInput inp s p Source #

data OffsideInput inp s p Source #

Instances

InputState inp s p => InputState (OffsideInput inp s p) (OffsideSymbol s) p Source # |

Instance details

Defined in UU.Parsing.Offside

Methods

splitStateE :: OffsideInput inp s p -> Either' (OffsideInput inp s p) (OffsideSymbol s) Source #

splitState :: OffsideInput inp s p -> (#OffsideSymbol s, OffsideInput inp s p#) Source #

getPosition :: OffsideInput inp s p -> p Source #

reportError :: Message (OffsideSymbol s) p -> OffsideInput inp s p -> OffsideInput inp s p Source #

insertSymbol :: OffsideSymbol s -> OffsideInput inp s p -> OffsideInput inp s p Source #

deleteSymbol :: OffsideSymbol s -> OffsideInput inp s p -> OffsideInput inp s p Source #

data Stream inp s p Source #

newtype OffsideParser i o s p a Source #

Constructors

OP (AnaParser (OffsideInput i s p) o (OffsideSymbol s) p a) |

Instances

(Symbol s, Ord s, InputState i s p, OutputState o, Applicative (OffsideParser i o s p)) => Functor (OffsideParser i o s p) Source # |
Instance details Defined in UU.Parsing.Offside Methods fmap :: (a -> b) -> OffsideParser i o s p a -> OffsideParser i o s p b Source # (<$) :: a -> OffsideParser i o s p b -> OffsideParser i o s p a Source #
(Symbol s, Ord s, InputState i s p, OutputState o) => Applicative (OffsideParser i o s p) Source # |

Instance details

Defined in UU.Parsing.Offside

Methods

pure :: a -> OffsideParser i o s p a Source #

(<*>) :: OffsideParser i o s p (a -> b) -> OffsideParser i o s p a -> OffsideParser i o s p b Source #

liftA2 :: (a -> b -> c) -> OffsideParser i o s p a -> OffsideParser i o s p b -> OffsideParser i o s p c Source #

(*>) :: OffsideParser i o s p a -> OffsideParser i o s p b -> OffsideParser i o s p b Source #

(<*) :: OffsideParser i o s p a -> OffsideParser i o s p b -> OffsideParser i o s p a Source #

(Symbol s, Ord s, InputState i s p, OutputState o) => Alternative (OffsideParser i o s p) Source # |
Instance details Defined in UU.Parsing.Offside Methods empty :: OffsideParser i o s p a Source # (<|>) :: OffsideParser i o s p a -> OffsideParser i o s p a -> OffsideParser i o s p a Source # some :: OffsideParser i o s p a -> OffsideParser i o s p [a] Source # many :: OffsideParser i o s p a -> OffsideParser i o s p [a] Source #
(Symbol s, Ord s, InputState i s p, OutputState o) => IsParser (OffsideParser i o s p) s Source # |

Instance details

Defined in UU.Parsing.Offside

Methods

pSucceed :: a -> OffsideParser i o s p a Source #

pLow :: a -> OffsideParser i o s p a Source #

pFail :: OffsideParser i o s p a Source #

pCostRange :: Int# -> s -> SymbolR s -> OffsideParser i o s p s Source #

pCostSym :: Int# -> s -> s -> OffsideParser i o s p s Source #

pSym :: s -> OffsideParser i o s p s Source #

pRange :: s -> SymbolR s -> OffsideParser i o s p s Source #

getfirsts :: OffsideParser i o s p v -> Expecting s Source #

setfirsts :: Expecting s -> OffsideParser i o s p v -> OffsideParser i o s p v Source #

getzerop :: OffsideParser i o s p v -> Maybe (OffsideParser i o s p v) Source #

getonep :: OffsideParser i o s p v -> Maybe (OffsideParser i o s p v) Source #