CCParse.U
This is useful to parse OCaml-like values in a simple way. All the parsers are whitespace-insensitive (they skip whitespace).
list p
parses a list of p
, with the OCaml conventions for start token "[", stop token "]" and separator ";". Whitespace between items are skipped.
val int : int t
Parse an int in decimal representation.
in_parens_opt p
parses p
in an arbitrary number of nested parenthesis (possibly 0).
option p
parses "Some <x>" into Some x
if p
parses "<x>" into x
, and parses "None" into None
.
val hexa_int : int t
Parse an int int hexadecimal format. Accepts an optional 0x
prefix, and ignores capitalization.
val word : string t
Non empty string of alpha num, start with alpha.
val bool : bool t
Accepts "true" or "false"
Parse a pair using OCaml syntactic conventions. The default is "(a, b)".