package transept

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include Transept_specs.Parser.CORE
type e

The element abstract type. Elements are provided by the stream used during the parsing.

type _ t

The parse abstract type

val parse : 'a t -> e Stream.t -> (e Stream.t, 'a) Response.t

Main parse function. It takes a Parser.t type, a Stream of elements and returns a Response.t.

include Transept_specs.Parser.MONAD with type 'a t := 'a t
include Transept_specs.Parser.BASIC with type 'a t := 'a t
val return : 'a -> 'a t

Parser return a success with the parametric value.

val fail : 'a t

Parser return a failure.

val eos : unit t

Parser checking when a stream has been completly analyze.

include Transept_specs.Parser.FLOW with type 'a t := 'a t
val (<&>) : 'a t -> 'b t -> ('a * 'b) t

Parser dedicated to parser sequence.

val (&>) : 'a t -> 'b t -> 'b t

Parser dedicated to parser sequence removing the left parser result.

val (<&) : 'a t -> 'b t -> 'a t

Parser dedicated to parser sequence removing the right parser result.

val (<|>) : 'a t -> 'a t -> 'a t

Parser dedicated to parser disjunction.

val (<?>) : 'a t -> ('a -> bool) -> 'a t

Parser dedicated to parser satifying a given predicate.

val to_list : ('a * 'a list) t -> 'a list t
include Transept_specs.Parser.EXECUTION with type 'a t := 'a t
val do_try : 'a t -> 'a t

Define a backtracking parser.

val do_lazy : (unit -> 'a t) -> 'a t

Define a lazy parser.

val lookahead : 'a t -> 'a t

Define a lookahead parser.

include Transept_specs.Parser.ATOMIC with type 'a t := 'a t and type e := e
val any : e t

Define parser accepting any element

val not : e t -> e t

Define parser accepting any element except the recognized one.

val atom : e -> e t

Define parser accepting a given element.

val in_list : e list -> e t

Define parser accepting an element in a given list.

val in_range : e -> e -> e t

Define parser accepting an element in a given range.

val atoms : e list -> e list t

Define parser accepting a given element list i.e. a sequence.

include Transept_specs.Parser.REPEATABLE with type 'a t := 'a t
val opt : 'a t -> 'a option t

Define a parser maybe accepting something.

val optrep : 'a t -> 'a list t

Define a parser accepting something more than once or nothing.

val rep : 'a t -> 'a list t

Define a parser accepting something more than once.

include Transept_specs.Parser.MONAD with type 'a t := 'a t
val (<$>) : 'a t -> ('a -> 'b) -> 'b t

Mapping over from 'a to 'b over 'a t to 'b t.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

m >>= f passes the result of computation m to function f.

OCaml

Innovation. Community. Security.