NQCC - a not-quite-C compiler
A compiler for a tiny (but growing!) subset of C, written in OCaml.
- Install OCaml and OPAM
- Configure OPAM
- Install dependencies:
opam install oasis opam install batteries opam install ounit # only needed for tests
- Build it
- To run it, invoke the
nqccscript in the project root
The compiled executable will be in the same directory as the source file, and have the same name (e.g.
source in the example above).
ocaml setup.ml -configure --enable-tests # you only need to run this once make test # run unit tests ./test_examples.sh # compile sample programs
You can also test against this test suite.