Skip to content

Commit

Permalink
Add README content
Browse files Browse the repository at this point in the history
  • Loading branch information
epatrizio committed Mar 21, 2022
1 parent a99421c commit 598a477
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 598a477

Please sign in to comment.