ocaml-parsing
Writing a parser in OCaml requires a surprising amount of boilerplate code. This is a fully functional skeleton using standard tools:
- Menhir, a LR(1) parser generator
- Sedlex, a lexer generator with Unicode support
- Jane Street's core, the inofficial standard library for OCaml
- Jane Street's jbuilder, an OCaml build system
How to build
With opam, OCaml's packet manager, all dependencies can be installed automatically:
opam update # ensure opam is up to date
opam switch 4.05 # install OCaml 4.05
eval `opam config env` # set env variables
opam pin add --yes --no-action ocaml_parsing . # install other...
opam install --yes --deps-only ocaml_parsing # ...dependencies
Then, simply run make
to build, and make test
to build the test file. To run the test file, execute _build/default/test/test.exe
.
The code has been last tested with OCaml 4.05.
Suggestion and Improvements
Feel free to submit pull requests. Suggestions and changes are welcome.