I'm writing a compiler (badly) in OCaml, as a learning project; I'm at the point where using Jane Street's SexpLib isn't cutting it:
match str.[0] with
| '-' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' ->
compile_int str channel
Yeah, time for a real parser.
I'm most familiar with PEG (by which I really mean I know nothing about context-free grammars and such); but all the PEG/packrat parsers I see for OCaml seem to be suuuuper ancient and dead (There's Aurochs, whose last commit was 9 years ago, and whose landing-page now belongs to a French domain-squatter; there's “Teerex”, existing in a sub-directory of a dead language project with no documentation, which is alive and kicking … with commits as recent as only five years, woah! …).
Basically, I'd love advice from someone who's done some parsing work in OCaml in the last couple of years, and who knows the most idiomatic / modern approach to take. Thanks! (=