1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Objective Caml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
2002-11-01 09:06:47 -08:00
|
|
|
(* Source code locations (ranges of positions), used in parsetree. *)
|
|
|
|
|
2000-03-06 14:12:09 -08:00
|
|
|
open Format
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2002-11-01 09:06:47 -08:00
|
|
|
type t = {
|
|
|
|
loc_start: Lexing.position;
|
|
|
|
loc_end: Lexing.position;
|
|
|
|
loc_ghost: bool;
|
|
|
|
}
|
|
|
|
|
2002-11-26 09:14:28 -08:00
|
|
|
(* Note on the use of Lexing.position in this module.
|
|
|
|
If [pos_fname = ""], then use [!input_name] instead.
|
2002-12-12 02:48:49 -08:00
|
|
|
If [pos_lnum = -1], then [pos_bol = 0]. Use [pos_cnum] and
|
2002-11-26 09:14:28 -08:00
|
|
|
re-parse the file to get the line and character numbers.
|
|
|
|
Else all fields are correct.
|
|
|
|
*)
|
|
|
|
|
2002-11-01 09:06:47 -08:00
|
|
|
val none : t
|
|
|
|
(** An arbitrary value of type [t]; describes an empty ghost range. *)
|
2005-03-24 09:20:54 -08:00
|
|
|
val in_file : string -> t;;
|
|
|
|
(** Return an empty ghost range located in a given file. *)
|
2002-11-01 09:06:47 -08:00
|
|
|
val init : Lexing.lexbuf -> string -> unit
|
|
|
|
(** Set the file name and line number of the [lexbuf] to be the start
|
|
|
|
of the named file. *)
|
|
|
|
val curr : Lexing.lexbuf -> t
|
|
|
|
(** Get the location of the current token from the [lexbuf]. *)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1999-09-08 10:42:36 -07:00
|
|
|
val symbol_rloc: unit -> t
|
|
|
|
val symbol_gloc: unit -> t
|
1995-05-04 03:15:53 -07:00
|
|
|
val rhs_loc: int -> t
|
|
|
|
|
|
|
|
val input_name: string ref
|
|
|
|
val input_lexbuf: Lexing.lexbuf option ref
|
|
|
|
|
2002-11-26 09:14:28 -08:00
|
|
|
val get_pos_info : Lexing.position -> string * int * int (* file, line, char *)
|
2007-12-04 05:38:58 -08:00
|
|
|
val print_error: formatter -> t -> unit
|
|
|
|
val print_error_cur_file: formatter -> unit
|
2000-03-06 14:12:09 -08:00
|
|
|
val print_warning: t -> formatter -> Warnings.t -> unit
|
|
|
|
val prerr_warning: t -> Warnings.t -> unit
|
1997-04-15 12:18:41 -07:00
|
|
|
val echo_eof: unit -> unit
|
1995-09-08 01:55:59 -07:00
|
|
|
val reset: unit -> unit
|
1997-11-12 04:32:53 -08:00
|
|
|
|
2002-04-18 04:04:52 -07:00
|
|
|
val highlight_locations: formatter -> t -> t -> bool
|