I am trying to learn about stream parsers (with or without Camlp4).
Some simple examples would really help, but the documentation is
sparse. Can someone please suggest implementations for the following
functions. (Stream parsers may not be the best way to implement these,
but I think they will help get started with stream parsers).
val parse_int : char Stream.t -> int
val parse_line : char Stream.t -> string
(* return the characters up to but not including the end of line
marker, where the marker is either a newline 'n', or a 'r'
immediately followed by 'n'. *)
The following would be useful to process a file line by line.
type line = string
val channelToLineStream : in_channel -> line Stream.t
Eventually, I would like a module that allows me to flexibly process
files with rows of data, but without loading the file in memory since
they will be very large. Thanks for any help!
.