aboutsummaryrefslogtreecommitdiff
path: root/lib/lexbuf.mli
blob: b058f3cca472f5a0c4b40901e7ca1f814b8b9b42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
type t

val from_lexbuf : Sedlexing.lexbuf -> t
(** Create a new buffer *)

val start : t -> unit
(** Intialize a new run *)

val buffer : t -> Sedlexing.lexbuf
(** Extract the sedlex buffer. Required in each rule. *)

val positions : t -> Lexing.position * Lexing.position
(** Extract the starting and ending position for the matched token *)

val content : t -> string
(** Extract the token matched by the rule *)

val set_start_position : t -> Lexing.position -> unit
val tokenize : (t -> 'a) -> t -> unit -> 'a * Lexing.position * Lexing.position