module BatCharParser:Parsing character strings.sig
..end
This module defines common functions for parsing character strings,
encoded in Latin-1. These functions are meant to be used in conjunction
with the ParserCo
module.
Note As ParserCo, this module is still very rough and needs testing.
Author(s): David Teller
type
position = {
|
offset : |
(* | Offset on the line (starting at 0) | *) |
|
line : |
(* | Line number (starting at 0) | *) |
val advance : char -> position -> position
advance c p
returns a new position advanced by one char. If c
is '\r' or '\n',
the result is {offset = 0; line = p.line + 1}
. Other wise, the result is
{offset = p.offset + 1; line = p.line}
.
val source_of_string : string -> (char, position) BatParserCo.Source.t
val source_of_enum : char BatEnum.t -> (char, position) BatParserCo.Source.t
val parse : (char, 'a, position) BatParserCo.t ->
string -> ('a, position BatParserCo.report) BatStd.result
val char : char -> (char, char, position) BatParserCo.t
val none_of : char list -> (char, char, position) BatParserCo.t
ParserCo.none_of
, just with improved error message.val not_char : char -> (char, char, position) BatParserCo.t
none_of
.val string : string -> (char, string, position) BatParserCo.t
val case_char : char -> (char, char, position) BatParserCo.t
char
, but case-insensitiveval case_string : string -> (char, string, position) BatParserCo.t
case_string
, but case-insensitiveval newline : (char, char, position) BatParserCo.t
val whitespace : (char, char, position) BatParserCo.t
val uppercase : (char, char, position) BatParserCo.t
val lowercase : (char, char, position) BatParserCo.t
val letter : (char, char, position) BatParserCo.t
val uppercase_latin1 : (char, char, position) BatParserCo.t
val lowercase_latin1 : (char, char, position) BatParserCo.t
val latin1 : (char, char, position) BatParserCo.t
val digit : (char, char, position) BatParserCo.t
val hex : (char, char, position) BatParserCo.t