module Lexer: sig
.. end
The lexer for Mezzo.
type
error
The abstract type of lexer errors.
exception LexingError of error
A lexer error can be thrown by the function token
.
val init : string -> unit
init filename
must be called before using the lexer.
val token : Ulexing.lexbuf -> Grammar.token * Lexing.position * Lexing.position
token
is the main entry point of the lexer. It produces one
token or raises LexingError
.
val print_error : Buffer.t -> Ulexing.lexbuf * error -> unit
print_error
displays a lexer error.
val print_position : Buffer.t -> Ulexing.lexbuf -> unit
print_position
displays the lexer's current position. It can be used
to build a syntax error message.
val p : Buffer.t -> Lexing.position * Lexing.position -> unit
p
displays the position that is passed as an argument. It can be used
to build (say) type error messages.