uulib-0.9.8: Haskell Utrecht Tools Library

UU.Parsing.Machine

Documentation

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) 

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

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

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

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

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

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

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

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

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 Source

Constructors

OneDescr 

Fields

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

data TableEntry state result s p a Source

Constructors

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

data Nat Source

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 bSource

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 bSource

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 bSource

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 bSource

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