package dolmen
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=80fc33ae81817a79c6e6b2f6c01c4cfcc0af02bfe4d2d1b87cf70b84cdde3928
sha512=3a44a99bce871161bc70cf909c813e9e6c91c590873cbc163c69b2ec90ab5be65bf0bf45430bc8d00d85d75cf0af004b06b8f5f1c9d4d47c8a30ab9f28762c04
doc/dolmen.std/Dolmen_std/Loc/index.html
Module Dolmen_std.Loc
Source
Standard implementation of file locations.
Interface definition
type loc = private {
file : string;
start_line : int;
start_column : int;
start_line_offset : int;
stop_line : int;
stop_column : int;
stop_line_offset : int;
max_line_length : int;
}
A full location, including file, start position and end position. Dummy positions (i.e. with start_line = stop_line
and start_column = stop_column
) are allowed to represent unknown locations.
Meta-data about files to enable more compact location storage.
A compact representation of locations.
Interface definition
An anstract module type for providing locations. Used as argumentby much of the functors provided in Dolmen.
This module implements the signature S
.
include S with type t := t and type file := file
The exception to be raised whenever an unexpected exception is raised during parsing.
The exception to be raised when the lexer cannot parse the input.
exception Syntax_error of t
* [ `Regular of Dolmen_intf.Msg.t
| `Advanced of
string * Dolmen_intf.Msg.t * Dolmen_intf.Msg.t * Dolmen_intf.Msg.t ]
Syntax_error (loc, msg)
denotes a syntax error at the given location. In the `Advanced (error_ref, prod, parsed, expected)
case,
- error_ref is an identifier for the error state
- prod is a delayed message to print in order to identify which production/syntax construction the parser was trying to reduce,
- parsed is a description of the token which raised the error,
- expected is a messages describing what would have been corect tokens/inputs at that point.
Make a position using a lexbuf directly.
Make a position from two lewing positions.
Offer a way for the file meta-data to store the current location of the lexbuf as the start of a new line.
Update the file meta-data to store the maximum offset currently seen for this file.
Compact location handling
Register a new line whose first char is at the given offset.
Compact<->full translations
Reutnr the pari of lexing positions corresponding to a location.
Printing locations
Printing functions
misc