module Lexing = struct ... end
Types | |||||||||||||||||||
lexbuf |
The type of lexer buffers. A lexer buffer is the argument passed
to the scanning functions defined by the generated scanners.
The lexer buffer holds the current state of the scanner, plus
a function to refill the buffer from the input. = {
|
||||||||||||||||||
lex_tables |
= {
|
Functions |
from_channel
: Pervasives.in_channel -> lexbuf |
Lexing.from_channel inchan
returns a lexer buffer which reads
from the input channel inchan
, at the current reading position.
from_string
: string -> lexbuf |
from_function
: (buf:string -> len:int -> int) -> lexbuf |
s
and a character
count n
. The function should put n
characters or less in s
,
starting at character number 0, and return the number of characters
provided. A return value of 0 means end of input.
lexeme
: lexbuf -> string |
Lexing.lexeme lexbuf
returns the string matched by
the regular expression.
lexeme_char
: lexbuf -> int -> char |
Lexing.lexeme_char lexbuf i
returns character number i
in
the matched string.
lexeme_start
: lexbuf -> int |
Lexing.lexeme_start lexbuf
returns the position in the
input stream of the first character of the matched string.
The first character of the stream has position 0.
lexeme_end
: lexbuf -> int |
Lexing.lexeme_end lexbuf
returns the position in the input stream
of the character following the last character of the matched
string. The first character of the stream has position 0.
engine
: lex_tables -> int -> lexbuf -> int |