Initial snarf.
[shack.git] / fir / util / fir_pos.mli
blobacda3a7c42cbc46b910f4b90d7da4729070e6575
1 (*
2 * FIR position information.
4 * ----------------------------------------------------------------
6 * @begin[license]
7 * Copyright (C) 2002 Jason Hickey, Caltech
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * Author: Jason Hickey
24 * @email{jyh@cs.caltech.edu}
25 * @end[license]
27 open Format
29 open Location
31 open Fir
32 open Fir_exn
35 * Position information.
37 type pos
40 * General exception includes debugging info.
42 exception FirException of pos * fir_error
45 * Module for creating positions.
46 * You have to specify the name of the module
47 * where the exception are being created: use
48 * MakePos in each file where Name.name is set
49 * to the name of the module.
51 module type PosSig =
52 sig
53 val loc_pos : loc -> pos
55 val exp_pos : exp -> pos
56 val var_exp_pos : var -> pos
57 val string_exp_pos : string -> pos
58 val type_exp_pos : loc -> ty -> pos
59 val atom_exp_pos : loc -> atom -> pos
61 val pos_pos : pos -> pos -> pos
62 val int_pos : int -> pos -> pos
63 val var_pos : var -> pos -> pos
64 val type_pos : ty -> pos -> pos
65 val atom_pos : atom -> pos -> pos
66 val error_pos : fir_error -> pos -> pos
67 val string_pos : string -> pos -> pos
68 val fundef_pos : var -> fundef -> pos
70 val del_pos : (formatter -> unit) -> loc -> pos
71 val del_exp_pos : (formatter -> unit) -> pos -> pos
73 (* Utilities *)
74 val loc_of_pos : pos -> loc
75 val pp_print_pos : formatter -> pos -> unit
76 end
78 module type NameSig =
79 sig
80 val name : string
81 end
83 module MakePos (Name : NameSig) : PosSig
86 * Exception printer.
88 val pp_print_error : formatter -> fir_error -> unit
90 (*!
91 * @docoff
93 * -*-
94 * Local Variables:
95 * Caml-master: "compile"
96 * End:
97 * -*-