uulib-0.9.13: Haskell Utrecht Tools Library

UU.Parsing.Machine

Documentation

newtype RealParser state s p a

Constructors

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

newtype RealRecogn state s p

Constructors

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

newtype RealAccept state result s p a

Constructors

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

newtype ParsRec state result s p a

Constructors

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

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

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

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

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

starting :: Steps a s p -> Expecting s

hasSuccess :: Steps a s p -> Bool

eor :: Ord a => Expecting a -> Expecting a -> Expecting a

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

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

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

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

data ToBeat a

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)

data AnaParser state result s p a

Constructors

AnaParser 

Fields

pars :: ParsRec state result s p a
 
leng :: Nat
 
zerop :: Maybe (Bool, Either a (ParsRec state result s p a))
 
onep :: OneDescr state result s p a
 

Instances

(InputState inp s p, OutputState out) => StateParser (AnaParser (inp, st) out s p) st 
(Ord s, Symbol s, InputState state s p, OutputState result) => IsParser (AnaParser state result s p) s

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.

data OneDescr state result s p a

Constructors

OneDescr 

Fields

firsts :: Expecting s
 
table :: [(SymbolR s, TableEntry state result s p a)]
 

data TableEntry state result s p a

Constructors

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

anaFail :: OutputState a => AnaParser b a c p d

data Nat

Constructors

Zero 
Succ Nat 
Infinite 

Instances

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

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

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

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

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