loc.mli 1.96 KB
Newer Older
1 2
(**************************************************************************)
(*                                                                        *)
3
(*  Copyright (C) 2010-                                                   *)
MARCHE Claude's avatar
MARCHE Claude committed
4 5 6
(*    François Bobot                                                     *)
(*    Jean-Christophe Filliâtre                                          *)
(*    Claude Marché                                                      *)
7
(*    Andrei Paskevich                                                    *)
8 9 10 11 12 13 14 15 16 17 18
(*                                                                        *)
(*  This software is free software; you can redistribute it and/or        *)
(*  modify it under the terms of the GNU Library General Public           *)
(*  License version 2.1, with the special exception on linking            *)
(*  described in file LICENSE.                                            *)
(*                                                                        *)
(*  This software is distributed in the hope that it will be useful,      *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  *)
(*                                                                        *)
(**************************************************************************)
19 20 21

open Format

22
(* Lexing locations *)
23

24 25 26
val current_offset : int ref
val reloc : Lexing.position -> Lexing.position
val set_file : string -> Lexing.lexbuf -> unit
27

28
(* locations in files *)
29

30
type position
31

32 33
val extract : Lexing.position * Lexing.position -> position
val join : position -> position -> position
34

35
exception Located of position * exn
36

37 38 39 40
val string : position -> string

val dummy_position : position

41
val user_position : string -> int -> int -> int -> position
42

43
val get : position -> string * int * int * int
44

45
val compare : position -> position -> int
46 47 48 49

val gen_report_position : formatter -> position -> unit