* http://helm.cs.unibo.it/
*)
+open Printf
+
type location = Lexing.position * Lexing.position
+let pp_location (loc_begin, loc_end) =
+ sprintf "(%d,%d)-(%d,%d)"
+ loc_begin.Lexing.pos_lnum
+ (loc_begin.Lexing.pos_cnum - loc_begin.Lexing.pos_bol)
+ loc_end.Lexing.pos_lnum
+ (loc_end.Lexing.pos_cnum - loc_end.Lexing.pos_bol)
+
let floc_of_loc (loc_begin, loc_end) =
let floc_begin =
{ Lexing.pos_fname = ""; Lexing.pos_lnum = -1; Lexing.pos_bol = -1;
(** {2 Parsing related types} *)
type location = Lexing.position * Lexing.position
+val pp_location: location -> string
(** maps old style (i.e. <= 3.07) lexer location to new style location,
* padding with dummy values where needed *)