package dolmen
Module Dolmen_std.ParseLocation
Standard implementation of file locations.
Interface definition
module type S = Dolmen_intf.Location.SAn anstract module type for providing locations. Used as argumentby much of the functors provided in Dolmen. This module (ParseLocation) implements this specification.
Concrete positions
exception Uncaught of t * exnexception Lexing_error of t * stringexception Syntax_error of t * stringExceptions that may occur during parsing
val hash : t -> intval mk : string -> int -> int -> int -> int -> tval mk_pair : string -> (int * int) -> (int * int) -> tval mk_pos : Lexing.position -> Lexing.position -> tConstruction functions
val fmt : Format.formatter -> t -> unitval fmt_hint : Format.formatter -> t -> unitPrinting functions
Location that spans the two given positions. The file is assumed to be the same in both case, and is chosen from one of the two positions.
smaller p1 p2 is true if p1 is included in p2, ie p1 is a sub-location of p2 (interval inclusion)
Lexbuf
val set_file : Lexing.lexbuf -> string -> unitChange the file name used for positions in this lexbuf
val mk_lexbuf : [ `Stdin | `File of string ] -> Lexing.lexbuf * (unit -> unit)Returns the lexbuf associetd with the given file or stdin, with the correct filename, together with a function to close the associated file descriptor.
val of_lexbuf : Lexing.lexbuf -> tRecover a position from a lexbuf