sig
module Loc :
sig
type t = Token.Loc.t
val mk : string -> t
val ghost : t
val of_lexing_position : Lexing.position -> t
val to_ocaml_location : t -> Camlp4_import.Location.t
val of_ocaml_location : Camlp4_import.Location.t -> t
val of_lexbuf : Lexing.lexbuf -> t
val of_tuple : string * int * int * int * int * int * int * bool -> t
val to_tuple : t -> string * int * int * int * int * int * int * bool
val merge : t -> t -> t
val join : t -> t
val move : [ `both | `start | `stop ] -> int -> t -> t
val shift : int -> t -> t
val move_line : int -> t -> t
val file_name : t -> string
val start_line : t -> int
val stop_line : t -> int
val start_bol : t -> int
val stop_bol : t -> int
val start_off : t -> int
val stop_off : t -> int
val start_pos : t -> Lexing.position
val stop_pos : t -> Lexing.position
val is_ghost : t -> bool
val ghostify : t -> t
val set_file_name : string -> t -> t
val strictly_before : t -> t -> bool
val make_absolute : t -> t
val print : Format.formatter -> t -> unit
val dump : Format.formatter -> t -> unit
val to_string : t -> string
exception Exc_located of t * exn
val raise : t -> exn -> 'a
val name : string ref
end
module Token :
sig
module Loc :
sig
type t = Token.Loc.t
val mk : string -> t
val ghost : t
val of_lexing_position : Lexing.position -> t
val to_ocaml_location : t -> Camlp4_import.Location.t
val of_ocaml_location : Camlp4_import.Location.t -> t
val of_lexbuf : Lexing.lexbuf -> t
val of_tuple :
string * int * int * int * int * int * int * bool -> t
val to_tuple :
t -> string * int * int * int * int * int * int * bool
val merge : t -> t -> t
val join : t -> t
val move : [ `both | `start | `stop ] -> int -> t -> t
val shift : int -> t -> t
val move_line : int -> t -> t
val file_name : t -> string
val start_line : t -> int
val stop_line : t -> int
val start_bol : t -> int
val stop_bol : t -> int
val start_off : t -> int
val stop_off : t -> int
val start_pos : t -> Lexing.position
val stop_pos : t -> Lexing.position
val is_ghost : t -> bool
val ghostify : t -> t
val set_file_name : string -> t -> t
val strictly_before : t -> t -> bool
val make_absolute : t -> t
val print : Format.formatter -> t -> unit
val dump : Format.formatter -> t -> unit
val to_string : t -> string
exception Exc_located of t * exn
val raise : t -> exn -> 'a
val name : string ref
end
type t = Sig.camlp4_token
val to_string : t -> string
val print : Format.formatter -> t -> unit
val match_keyword : string -> t -> bool
val extract_string : t -> string
module Filter :
sig
type token_filter = (t, Loc.t) Sig.stream_filter
type t = Token.Filter.t
val mk : (string -> bool) -> t
val define_filter : t -> (token_filter -> token_filter) -> unit
val filter : t -> token_filter
val keyword_added : t -> string -> bool -> unit
val keyword_removed : t -> string -> unit
end
module Error :
sig
type t = Token.Error.t
exception E of t
val to_string : t -> string
val print : Format.formatter -> t -> unit
end
end
module Error :
sig
type t =
Struct.Lexer.Make(Token).Error.t =
Illegal_character of char
| Illegal_escape of string
| Unterminated_comment
| Unterminated_string
| Unterminated_quotation
| Unterminated_antiquot
| Unterminated_string_in_comment
| Comment_start
| Comment_not_end
| Literal_overflow of string
exception E of t
val print : Format.formatter -> t -> unit
val to_string : t -> string
end
type context =
Struct.Lexer.Make(Token).context = {
loc : Loc.t;
in_comment : bool;
quotations : bool;
antiquots : bool;
lexbuf : Lexing.lexbuf;
buffer : Buffer.t;
}
val default_context : Lexing.lexbuf -> context
val store : context -> unit
val istore_char : context -> int -> unit
val buff_contents : context -> string
val loc : context -> Loc.t
val quotations : context -> bool
val antiquots : context -> bool
val is_in_comment : context -> bool
val in_comment : context -> context
val set_start_p : context -> unit
val move_start_p : int -> context -> unit
val update_loc : context -> context
val with_curr_loc : (context -> Lexing.lexbuf -> 'a) -> context -> 'a
val parse_nested : (context -> Lexing.lexbuf -> 'a) -> context -> string
val shift : int -> context -> context
val store_parse : (context -> Lexing.lexbuf -> 'a) -> context -> 'a
val parse : (context -> Lexing.lexbuf -> 'a) -> context -> 'a
val mk_quotation :
(context -> Lexing.lexbuf -> 'a) ->
context -> string -> string -> int -> Sig.camlp4_token
val update_loc : context -> string option -> int -> bool -> int -> unit
val err : Error.t -> Loc.t -> 'a
val warn : Error.t -> Loc.t -> unit
val __ocaml_lex_tables : Lexing.lex_tables
val token : context -> Lexing.lexbuf -> Sig.camlp4_token
val __ocaml_lex_token_rec :
context -> Lexing.lexbuf -> int -> Sig.camlp4_token
val comment : context -> Lexing.lexbuf -> unit
val __ocaml_lex_comment_rec : context -> Lexing.lexbuf -> int -> unit
val string : context -> Lexing.lexbuf -> unit
val __ocaml_lex_string_rec : context -> Lexing.lexbuf -> int -> unit
val symbolchar_star :
string -> context -> Lexing.lexbuf -> Sig.camlp4_token
val __ocaml_lex_symbolchar_star_rec :
string -> context -> Lexing.lexbuf -> int -> Sig.camlp4_token
val maybe_quotation_at : context -> Lexing.lexbuf -> Sig.camlp4_token
val __ocaml_lex_maybe_quotation_at_rec :
context -> Lexing.lexbuf -> int -> Sig.camlp4_token
val maybe_quotation_colon : context -> Lexing.lexbuf -> Sig.camlp4_token
val __ocaml_lex_maybe_quotation_colon_rec :
context -> Lexing.lexbuf -> int -> Sig.camlp4_token
val quotation : context -> Lexing.lexbuf -> unit
val __ocaml_lex_quotation_rec : context -> Lexing.lexbuf -> int -> unit
val dollar : context -> Lexing.lexbuf -> Sig.camlp4_token
val __ocaml_lex_dollar_rec :
context -> Lexing.lexbuf -> int -> Sig.camlp4_token
val antiquot : string -> context -> Lexing.lexbuf -> Sig.camlp4_token
val __ocaml_lex_antiquot_rec :
string -> context -> Lexing.lexbuf -> int -> Sig.camlp4_token
val lexing_store : char Stream.t -> string -> int -> int
val from_context : context -> (Sig.camlp4_token * Loc.t) Stream.t
val from_lexbuf :
?quotations:bool -> Lexing.lexbuf -> (Sig.camlp4_token * Loc.t) Stream.t
val setup_loc : Lexing.lexbuf -> Loc.t -> unit
val from_string :
?quotations:bool ->
Loc.t -> string -> (Sig.camlp4_token * Loc.t) Stream.t
val from_stream :
?quotations:bool ->
Loc.t -> char Stream.t -> (Sig.camlp4_token * Loc.t) Stream.t
val mk :
unit -> Loc.t -> char Stream.t -> (Sig.camlp4_token * Loc.t) Stream.t
end