loc.mli 2.21 KB
Newer Older
Andrei Paskevich's avatar
Andrei Paskevich committed
1 2 3
(********************************************************************)
(*                                                                  *)
(*  The Why3 Verification Platform   /   The Why3 Development Team  *)
4
(*  Copyright 2010-2013   --   INRIA - CNRS - Paris-Sud University  *)
Andrei Paskevich's avatar
Andrei Paskevich committed
5 6 7 8 9 10
(*                                                                  *)
(*  This software is distributed under the terms of the GNU Lesser  *)
(*  General Public License version 2.1, with the special exception  *)
(*  on linking described in file LICENSE.                           *)
(*                                                                  *)
(********************************************************************)
11 12 13

open Format

14
(* Lexing locations *)
15

16 17 18
val current_offset : int ref
val reloc : Lexing.position -> Lexing.position
val set_file : string -> Lexing.lexbuf -> unit
19

20 21
val transfer_loc : Lexing.lexbuf -> Lexing.lexbuf -> unit

22
(* locations in files *)
23

24
type position
25

26 27
val extract : Lexing.position * Lexing.position -> position
val join : position -> position -> position
28 29 30

val dummy_position : position

31
val user_position : string -> int -> int -> int -> position
32

33
val get : position -> string * int * int * int
34

35
val compare : position -> position -> int
36 37
val equal : position -> position -> bool
val hash : position -> int
38 39 40

val gen_report_position : formatter -> position -> unit

41
val report_position : formatter -> position -> unit
42

43 44 45 46
(* located exceptions *)

exception Located of position * exn

Andrei Paskevich's avatar
minor  
Andrei Paskevich committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
val try1: position -> ('a -> 'b) -> ('a -> 'b)
val try2: position -> ('a -> 'b -> 'c) -> ('a -> 'b -> 'c)
val try3: position -> ('a -> 'b -> 'c -> 'd) -> ('a -> 'b -> 'c -> 'd)

val try4: position ->
  ('a -> 'b -> 'c -> 'd -> 'e) -> ('a -> 'b -> 'c -> 'd -> 'e)

val try5: position ->
  ('a -> 'b -> 'c -> 'd -> 'e -> 'f) -> ('a -> 'b -> 'c -> 'd -> 'e -> 'f)

val try6: position ->
  ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g) ->
  ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g)

val try7: position ->
  ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h) ->
  ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h)
64 65 66 67 68 69 70 71

val error: ?loc:position -> exn -> 'a

(* messages *)

exception Message of string

val errorm: ?loc:position -> ('a, Format.formatter, unit, 'b) format4 -> 'a