Module Gramlib.LStream
val from : ?loc:Loc.t -> ('e -> ('a * Loc.t) option) -> ('e, 'a) tval current_loc : ('e, 'a) t -> Loc.tReturning the loc of the last consumed element or the initial loc if no element is consumed
val max_peek_loc : ('e, 'a) t -> Loc.tReturning the loc of the max visited element or the initial loc if no element is consumed
val interval_loc : int -> int -> ('e, 'a) t -> Loc.tinterval_loc bp ep strmreturns the loc starting after elementbp(counting from 0) and spanning up to already peeked element at positionep, under the assumption thatbp<=ep; returns an empty interval ifbp=ep; returns the empty initial interval if additionallybp= 0; fails if the elements have not been peeked yet
val get_loc : int -> ('e, 'a) t -> Loc.tReturn location of an already peeked element at some position counting from 0; fails if the element has not been peeked yet
val count : ('e, 'a) t -> intval peek : 'e -> ('e, 'a) t -> 'a optionval npeek : 'e -> int -> ('e, 'a) t -> 'a listval junk : 'e -> ('e, 'a) t -> unitconsumes the next element if there is one
val njunk : 'e -> int -> ('e, 'a) t -> unitnjunk e n strmconsumesnelements fromstrm
val next : 'e -> ('e, 'a) t -> 'anext e strmreturns and consumes the next element; raiseStream.Failureif the stream is empty
val peek_nth : 'e -> int -> ('e, 'a) t -> 'apeek_nth e n strmreturns the nth element counting from 0 without consuming the stream; raisesStream.Failureif not enough elements