uulib-0.9.24: Haskell Utrecht Tools Library
Safe HaskellSafe-Inferred
LanguageHaskell98

UU.Parsing.Machine

Documentation

pDynE :: forall {state} {result :: Type -> Type -> Type} {s} {p} {a}. ParsRec state result s p a -> AnaParser state result s p a Source #

pDynL :: forall {state} {result :: Type -> Type -> Type} {s} {p} {a}. ParsRec state result s p a -> AnaParser state result s p a Source #

newtype RealParser state s p a Source #

Constructors

P (forall r' r''. (a -> r'' -> r') -> (state -> Steps r'' s p) -> state -> Steps r' s p) 

newtype RealRecogn state s p Source #

Constructors

R (forall r. (state -> Steps r s p) -> state -> Steps r s p) 

newtype RealAccept state result s p a Source #

Constructors

A (forall r. (state -> Steps r s p) -> state -> Steps (result a r) s p) 

newtype ParsRec state result s p a Source #

Constructors

PR (RealParser state s p a, RealRecogn state s p, RealAccept state result s p a) 

mkPR :: forall {result :: Type -> Type -> Type} {state} {s} {p} {a}. OutputState result => (RealParser state s p a, RealRecogn state s p) -> ParsRec state result s p a Source #

unP :: RealParser state s p a -> (a -> r'' -> r') -> (state -> Steps r'' s p) -> state -> Steps r' s p Source #

unR :: RealRecogn state s p -> (state -> Steps r s p) -> state -> Steps r s p Source #

parseRecbasic :: (inp -> Steps (out c d) sym pos) -> ParsRec inp out sym pos a -> inp -> Steps (out a (out c d)) sym pos Source #

parsebasic :: (inp -> Steps (out c d) sym pos) -> AnaParser inp out sym pos a -> inp -> Steps (out a (out c d)) sym pos Source #

libAccept :: (OutputState a, InputState b s p) => ParsRec b a s p s Source #

libInsert :: forall {result :: Type -> Type -> Type} {state} {a} {p}. (OutputState result, InputState state a p) => Int# -> a -> Expecting a -> ParsRec state result a p a Source #

libSucceed :: forall {result :: Type -> Type -> Type} {a} {state} {s} {p}. OutputState result => a -> ParsRec state result s p a Source #

libSeq :: forall {result :: Type -> Type -> Type} {result :: Type -> Type -> Type} {state} {result :: Type -> Type -> Type} {s} {p} {b} {a}. (OutputState result, OutputState result) => ParsRec state result s p (b -> a) -> ParsRec state result s p b -> ParsRec state result s p a Source #

libDollar :: forall {result :: Type -> Type -> Type} {a} {a} {state} {result :: Type -> Type -> Type} {s} {p}. OutputState result => (a -> a) -> ParsRec state result s p a -> ParsRec state result s p a Source #

libDollarL :: forall {result :: Type -> Type -> Type} {a} {state} {result :: Type -> Type -> Type} {s} {p} {a}. OutputState result => a -> ParsRec state result s p a -> ParsRec state result s p a Source #

libDollarR :: forall {result :: Type -> Type -> Type} {p} {state} {result :: Type -> Type -> Type} {s} {p} {a}. OutputState result => p -> ParsRec state result s p a -> ParsRec state result s p a Source #

libSeqL :: forall {result :: Type -> Type -> Type} {state} {result :: Type -> Type -> Type} {s} {p} {a} {result :: Type -> Type -> Type} {a}. OutputState result => ParsRec state result s p a -> ParsRec state result s p a -> ParsRec state result s p a Source #

libSeqR :: forall {result :: Type -> Type -> Type} {state} {result :: Type -> Type -> Type} {s} {p} {a} {result :: Type -> Type -> Type} {a}. OutputState result => ParsRec state result s p a -> ParsRec state result s p a -> ParsRec state result s p a Source #

libOr :: forall {result :: Type -> Type -> Type} {s} {state} {result :: Type -> Type -> Type} {p} {a} {result :: Type -> Type -> Type}. (OutputState result, Ord s) => ParsRec state result s p a -> ParsRec state result s p a -> ParsRec state result s p a Source #

libFail :: OutputState a => ParsRec b a c p d Source #

getStart :: Message sym pos -> Expecting sym Source #

addToMessage :: Ord sym => Message sym pos -> Expecting sym -> Message sym pos Source #

addexpecting :: Ord s => Expecting s -> Steps val s p -> Steps val s p Source #

libBest :: Ord s => Steps b s p -> Steps b s p -> Steps b s p Source #

libBest' :: Ord s => Steps b s p -> Steps c s p -> (b -> d) -> (c -> d) -> Steps d s p Source #

lib_correct :: Ord s => (b -> c -> Steps d s p) -> (b -> c -> Steps d s p) -> b -> c -> Steps d s p Source #

libCorrect :: Ord s => Steps a s p -> Steps c s p -> (a -> d) -> (c -> d) -> Steps d s p Source #

data ToBeat a Source #

Constructors

ToBeat Int# a 

traverse :: ToBeat (Steps a s p) -> (Steps v s p -> Steps a s p, Steps v s p) -> Int# -> Int# -> ToBeat (Steps a s p) Source #

data AnaParser state result s p a Source #

Constructors

AnaParser 

Fields

Instances

Instances details
(Ord s, Symbol s, InputState state s p, OutputState result) => Alternative (AnaParser state result s p) Source # 
Instance details

Defined in UU.Parsing.Interface

Methods

empty :: AnaParser state result s p a Source #

(<|>) :: AnaParser state result s p a -> AnaParser state result s p a -> AnaParser state result s p a Source #

some :: AnaParser state result s p a -> AnaParser state result s p [a] Source #

many :: AnaParser state result s p a -> AnaParser state result s p [a] Source #

(Ord s, Symbol s, InputState state s p, OutputState result) => Applicative (AnaParser state result s p) Source # 
Instance details

Defined in UU.Parsing.Interface

Methods

pure :: a -> AnaParser state result s p a Source #

(<*>) :: AnaParser state result s p (a -> b) -> AnaParser state result s p a -> AnaParser state result s p b Source #

liftA2 :: (a -> b -> c) -> AnaParser state result s p a -> AnaParser state result s p b -> AnaParser state result s p c Source #

(*>) :: AnaParser state result s p a -> AnaParser state result s p b -> AnaParser state result s p b Source #

(<*) :: AnaParser state result s p a -> AnaParser state result s p b -> AnaParser state result s p a Source #

(Ord s, Symbol s, InputState state s p, OutputState result, Applicative (AnaParser state result s p)) => Functor (AnaParser state result s p) Source # 
Instance details

Defined in UU.Parsing.Interface

Methods

fmap :: (a -> b) -> AnaParser state result s p a -> AnaParser state result s p b Source #

(<$) :: a -> AnaParser state result s p b -> AnaParser state result s p a Source #

(Ord s, Symbol s, InputState state s p, OutputState result) => IsParser (AnaParser state result s p) s Source #

The fast AnaParser instance of the IsParser class. Note that this requires a functioning Ord for the symbol type s, as tokens are often compared using the compare function in Ord rather than always using == rom Eq. The two do need to be consistent though, that is for any two x1, x2 such that x1 == x2 you must have compare x1 x2 == EQ.

Instance details

Defined in UU.Parsing.Interface

Methods

pSucceed :: a -> AnaParser state result s p a Source #

pLow :: a -> AnaParser state result s p a Source #

pFail :: AnaParser state result s p a Source #

pCostRange :: Int# -> s -> SymbolR s -> AnaParser state result s p s Source #

pCostSym :: Int# -> s -> s -> AnaParser state result s p s Source #

pSym :: s -> AnaParser state result s p s Source #

pRange :: s -> SymbolR s -> AnaParser state result s p s Source #

getfirsts :: AnaParser state result s p v -> Expecting s Source #

setfirsts :: Expecting s -> AnaParser state result s p v -> AnaParser state result s p v Source #

getzerop :: AnaParser state result s p v -> Maybe (AnaParser state result s p v) Source #

getonep :: AnaParser state result s p v -> Maybe (AnaParser state result s p v) Source #

(InputState inp s p, OutputState out) => StateParser (AnaParser (inp, st) out s p) st Source # 
Instance details

Defined in UU.Parsing.StateParser

Methods

change :: (st -> st) -> AnaParser (inp, st) out s p st Source #

set :: st -> AnaParser (inp, st) out s p st Source #

get :: AnaParser (inp, st) out s p st Source #

data OneDescr state result s p a Source #

Constructors

OneDescr 

Fields

data TableEntry state result s p a Source #

Constructors

TableEntry (ParsRec state result s p a) (Expecting s -> ParsRec state result s p a) 

noOneParser :: forall {state} {result :: Type -> Type -> Type} {s} {p} {a}. OneDescr state result s p a Source #

pEmpty :: forall {state} {result :: Type -> Type -> Type} {s} {p} {a}. ParsRec state result s p a -> (Bool, Either a (ParsRec state result s p a)) -> AnaParser state result s p a Source #

anaSucceed :: forall {result :: Type -> Type -> Type} {a} {state} {s} {p}. OutputState result => a -> AnaParser state result s p a Source #

anaLow :: forall {result :: Type -> Type -> Type} {a} {state} {s} {p}. OutputState result => a -> AnaParser state result s p a Source #

anaDynE :: forall {state} {result :: Type -> Type -> Type} {s} {p} {a}. ParsRec state result s p a -> AnaParser state result s p a Source #

anaDynL :: forall {state} {result :: Type -> Type -> Type} {s} {p} {a}. ParsRec state result s p a -> AnaParser state result s p a Source #

anaOr :: forall {state} {s} {p} {result :: Type -> Type -> Type} {a}. (InputState state s p, Symbol s, OutputState result, Ord s) => AnaParser state result s p a -> AnaParser state result s p a -> AnaParser state result s p a Source #

anaSeq :: forall {state} {s} {p} {result :: Type -> Type -> Type} {result :: Type -> Type -> Type} {a} {state} {p} {a} {a} {state} {result :: Type -> Type -> Type} {p}. (InputState state s p, Symbol s, Ord s, OutputState result, OutputState result) => (a -> ParsRec state result s p a -> ParsRec state result s p a) -> (ParsRec state result s p a -> ParsRec state result s p a -> ParsRec state result s p a) -> (a -> a -> a) -> AnaParser state result s p a -> AnaParser state result s p a -> AnaParser state result s p a Source #

seqZeroZero :: forall {result :: Type -> Type -> Type} {t} {t} {a} {state} {s} {p} {b} {a}. OutputState result => Maybe (Bool, Either t t) -> Maybe (Bool, Either a (ParsRec state result s p a)) -> (t -> ParsRec state result s p a -> b) -> (t -> ParsRec state result s p a -> b) -> (t -> a -> a) -> Maybe (Bool, Either a b) Source #

orOneOneDescr :: forall {s} {state} {result :: Type -> Type -> Type} {p} {a}. Ord s => OneDescr state result s p a -> OneDescr state result s p a -> Bool -> OneDescr state result s p a Source #

anaCostRange :: forall {a :: Type -> Type -> Type} {b} {d} {p}. (OutputState a, InputState b d p, Symbol d, Ord d) => Int# -> d -> SymbolR d -> AnaParser b a d p d Source #

anaGetFirsts :: forall {state} {result :: Type -> Type -> Type} {s} {p} {a}. AnaParser state result s p a -> Expecting s Source #

anaSetFirsts :: forall {state} {s} {p} {result :: Type -> Type -> Type} {a}. (InputState state s p, Symbol s, Ord s, OutputState result) => Expecting s -> AnaParser state result s p a -> AnaParser state result s p a Source #

mapOnePars :: forall {state} {result :: Type -> Type -> Type} {s} {p} {a} {state} {result :: Type -> Type -> Type} {p} {a}. (ParsRec state result s p a -> ParsRec state result s p a) -> OneDescr state result s p a -> OneDescr state result s p a Source #

mkParser :: (InputState state s p, Symbol s, Ord s, OutputState result) => Nat -> Maybe (Bool, Either a (ParsRec state result s p a)) -> OneDescr state result s p a -> AnaParser state result s p a Source #

data Nat Source #

Constructors

Zero 
Succ Nat 
Infinite 

Instances

Instances details
Show Nat Source # 
Instance details

Defined in UU.Parsing.Machine

Eq Nat Source # 
Instance details

Defined in UU.Parsing.Machine

Methods

(==) :: Nat -> Nat -> Bool Source #

(/=) :: Nat -> Nat -> Bool Source #

nat_min :: Nat -> Nat -> (Nat, (b -> b -> c) -> b -> b -> c) Source #

mergeTables :: forall {a} {result :: Type -> Type -> Type} {s} {state} {p} {a}. (Symbol a, OutputState result, Ord a, Ord s) => [(SymbolR a, ParsRec state result s p a)] -> [(SymbolR a, ParsRec state result s p a)] -> [(SymbolR a, ParsRec state result s p a)] Source #

libMap :: OutputState result => (forall r r''. (b -> r -> r'') -> state -> Steps (a, r) s p -> (state, Steps r'' s p)) -> (forall r. state -> Steps r s p -> (state, Steps r s p)) -> ParsRec state result s p a -> ParsRec state result s p b Source #

pMap :: OutputState result => (forall r r''. (b -> r -> r'') -> state -> Steps (a, r) s p -> (state, Steps r'' s p)) -> (forall r. state -> Steps r s p -> (state, Steps r s p)) -> AnaParser state result s p a -> AnaParser state result s p b Source #

libWrap :: OutputState result => (forall r r''. (b -> r -> r'') -> state -> Steps (a, r) s p -> (state -> Steps r s p) -> (state, Steps r'' s p, state -> Steps r s p)) -> (forall r. state -> Steps r s p -> (state -> Steps r s p) -> (state, Steps r s p, state -> Steps r s p)) -> ParsRec state result s p a -> ParsRec state result s p b Source #

pWrap :: OutputState result => (forall r r''. (b -> r -> r'') -> state -> Steps (a, r) s p -> (state -> Steps r s p) -> (state, Steps r'' s p, state -> Steps r s p)) -> (forall r. state -> Steps r s p -> (state -> Steps r s p) -> (state, Steps r s p, state -> Steps r s p)) -> AnaParser state result s p a -> AnaParser state result s p b Source #

lookupSym :: Ord a => BinSearchTree (SymbolR a, b) -> a -> Maybe b Source #