diff --git a/README.md b/README.md index 1aeb548..e00d73a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,32 @@ -# comp2mzam -Imperative language compilation to the Mini-ZAM +# comp2mzam - Imperative language compiler to the Mini-ZAM + +Here is a compiler producing bytecode for a simplified implementation of the OCaml Virtual Machine, called Mini-ZAM. + +*This project is part of the Advanced Compilation course of my professional training.* + +## Technical stack / choices + +I made the choice of OCaml ecosystem for the compiler implementation : + +* [OCaml V4.13.1](https://ocaml.org) + * [OCamlLex standard component for lexical analysis](https://ocaml.org/manual/lexyacc.html) +* [Menhir 20211230 tool for syntax analysis](https://gitlab.inria.fr/fpottier/menhir) + * Use [OPAM 2.1.1 Ocaml PAckage Manager](https://opam.ocaml.org/packages/menhir) for Menhir installation + +## Compilation and execution + +To compile the project source code, run the default Makefile command + +```console +make +``` + +To execute the project (bytecode generation for the Mini-ZAM), run this command.\ +In the following example, tests/t0.txt file is compiled to tests/build/bc_t0.txt file.\ +To get an idea of the result, see the bytecode sample file tests/build/demo-bytecode.txt + +```console +S=t0.txt make compile +``` + +Then, you need a Mini-ZAM to interpret the generated bytecode.