Value | Description |
val flush_input : lexbuf -> unit |
Remove all input, though don't discard the except the current lexeme
|
val from_binary_reader : #BinaryReader -> lexbuf |
Fuel a lexer using the given BinaryReader.
|
val from_bytearray : byte [] -> lexbuf |
Fuel a lexer from an array of bytes
|
val from_channel : in_channel -> lexbuf |
Fuel a lexer using the given in_channel. The bytes are read using Pervasives.input.
If the in_channel is a textual channel the bytes are
presented to the lexer by decoding the characters using System.Text.Encoding.ASCII.
|
val from_function : (byte [] -> int -> int) -> lexbuf |
Fuel a lexer from function that fills an array of bytes up to the given length, returning the
number of bytes filled.
|
val from_string : string -> lexbuf |
Fuel a lexer from a string, converted to ascii using [[System.Text.Encoding.ASCII.GetBytes]]
|
val from_text_reader : #Encoding -> #TextReader -> lexbuf |
Fuel a lexer using the given TextReader or StreamReader.
The characters read are decoded to bytes using the given encoding (e.g. System.Text.Encoding.ASCII)
and the bytes presented to the lexer. The encoding used to decode the characters
is associated with the expectations of the lexer (e.g. a lexer may be constructed to accept only
ASCII or pseudo-UTF8 bytes) and will typically be different to
the encoding used to decode the file.
|
val lexeme : lexbuf -> string |
Return the matched string
|
val lexeme_bytes : lexbuf -> byte array |
Return the bytes for the matched string
|
val lexeme_char : lexbuf -> int -> char |
Return a character from the matched string, innterpreting the bytes using an ASCII encoding
|
val lexeme_end : lexbuf -> int |
Return absolute positions into the entire stream of characters
|
val lexeme_end_p : lexbuf -> position |
Return the positions stored in the lexbuf for the matched string
|
val lexeme_start : lexbuf -> int |
Return absolute positions into the entire stream of characters
|
val lexeme_start_p : lexbuf -> position |
Return the positions stored in the lexbuf for the matched string
|
val lexeme_utf8 : lexbuf -> string |
Return the matched string interpreting the bytes using the given Unicode text encoding
|