2 * Normal MIR exceptions.
4 * ----------------------------------------------------------------
7 * Copyright (C) 2001 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}
42 * Location of exception.
47 | AtomClass
of atom_class
51 type pos
= item
Position.pos
56 exception MirException
of pos
* mir_error
58 (************************************************************************
60 ************************************************************************)
63 * Get the source location for an exception.
65 let string_loc = bogus_loc
"<Mir_pos>"
67 let rec loc_of_value x
=
78 * Print debugging info.
80 let rec pp_print_value buf x
=
83 pp_print_expr_size
(exn_expr_size
()) buf e
89 pp_print_atom_class buf ac
97 (************************************************************************
99 ************************************************************************)
103 val loc_pos
: loc
-> pos
105 val exp_pos
: exp
-> pos
106 val var_exp_pos
: var
-> pos
107 val string_exp_pos
: string -> pos
108 val string_pos
: string -> pos
-> pos
109 val pos_pos
: pos
-> pos
-> pos
110 val int_pos
: int -> pos
-> pos
111 val var_pos
: var
-> pos
-> pos
112 val atom_pos
: atom
-> pos
-> pos
113 val atom_class_pos
: atom_class
-> pos
-> pos
115 val del_pos
: (formatter
-> unit) -> loc
-> pos
116 val del_exp_pos
: (formatter
-> unit) -> pos
-> pos
119 val loc_of_pos
: pos
-> loc
120 val pp_print_pos
: formatter
-> pos
-> unit
123 module type NameSig
=
128 module MakePos
(Name
: NameSig
) : PosSig
=
136 let loc_of_value = loc_of_value
137 let pp_print_value = pp_print_value
140 module Pos
= Position.MakePos
(Name'
)
144 let exp_pos e
= base_pos
(Exp e
)
145 let atom_pos a pos
= cons_pos
(Atom a
) pos
146 let atom_class_pos ac pos
= cons_pos
(AtomClass ac
) pos
147 let var_exp_pos v
= base_pos
(Symbol v
)
148 let string_exp_pos s
= base_pos
(String s
)
149 let var_pos = symbol_pos
157 * Caml-master: "compile"