Example compiler starter project using Menhir for parsing and the Dune build system.
The compiler example is adapted from https://github.com/derdon/menhir-example
opam switch create . 4.07.0 --deps-only && eval $(opam env)
opam install . --deps-only
dune exec bin/main.exe
The compiler understands arithmetic expressions ending in semicolons, read in through STDIN
.
For example:
echo "3;4*(2+8);3-4;" | dune exec bin/main.exe
Be sure to modify compiler-example.opam
with your project details.