diff options
Diffstat (limited to 'lib/qparser/lexbuf.mli')
-rw-r--r-- | lib/qparser/lexbuf.mli | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/qparser/lexbuf.mli b/lib/qparser/lexbuf.mli index 97a4d65..5a0bbcd 100644 --- a/lib/qparser/lexbuf.mli +++ b/lib/qparser/lexbuf.mli @@ -1,4 +1,7 @@ +(** Lexing buffer. *) + type t +(** The state of the buffer *) val from_lexbuf : ?reset_line:bool -> Sedlexing.lexbuf -> t (** Create a new buffer *) @@ -16,12 +19,21 @@ val content : t -> string (** Extract the token matched by the rule *) val set_start_position : t -> Lexing.position -> unit +(** Reset the starting position. Used while parsing the string to keep the + begining of the whole string. *) + val tokenize : (t -> 'a) -> t -> unit -> 'a * Lexing.position * Lexing.position +(** Function to use in the parser in order to extract the token match, and the + starting and ending position. *) + +val level : t -> int +(** The state track the nesting level in the expression. Depending of the + level, the token [!] will be considered as a comment or a boolean + operation. *) + val incr_level : t -> unit val decr_level : t -> unit val reset_level : t -> unit -val level : t -> int -(** Return the nested expression level *) - val rollback : t -> unit +(** Rollback the latest token matched *) |