Debian Codegraph @

gramlib/plexing.mli

raw symbols SCIP
1 (* camlp5r *)
2 (* plexing.mli,v *)
3 (* Copyright (c) INRIA 2007-2017 *)
4
5 (** Lexing for Camlp5 grammars.
6
7 This module defines the Camlp5 lexer type to be used in extensible
8 grammars (see module [Grammar]). It also provides some useful functions
9 to create lexers. *)
10
11 (** Lexer type *)
12
13 module type S = sig
14 type keyword_state
15 type te
16 type 'c pattern
17 val tok_pattern_eq : 'a pattern -> 'b pattern -> ('a, 'b) Util.eq option
18 val tok_pattern_exact : _ pattern -> bool
19 val tok_pattern_strings : keyword_state -> 'c pattern -> string * string option
20
21 (** Returning a stream equipped with a location function *)
22 val tok_func : ?loc:Loc.t -> (unit,char) Stream.t -> (keyword_state,te) LStream.t
23
24 val tok_match : 'c pattern -> te -> 'c option
25 val tok_text : 'c pattern -> string
26
27 (* State for the comments, at some point we should make it functional *)
28 module State : sig
29 type t
30 val init : unit -> t
31 val set : t -> unit
32 val get : unit -> t
33 val drop : unit -> unit
34 val get_comments : t -> ((int * int) * string) list
35 end
36
37 end