Skip to content
Snippets Groups Projects
user avatar
Claire Girot authored
e39d64a9
History
AUTHORS
-------

- Claire Girot--Person
- Augustin Jaujay

===============

Description of the project
--------------------------

This μ-project is a very simple compiler implemented in OCaml. It can read source files written both in Expr of Pfx. The compiler compiles from Expr to Pfx and executes the Pfx instructions in a small virtual machine.

Please refer to the pdf report at the root of the project which indexes the answers. 

Git repository: http://gitlab.imt-atlantique.fr/a19jauja/compilerlalog

Release : release (tag)

===============

How to…
-------

…retrieve the sources?

  git clone git@gitlab.imt-atlantique.fr:a19jauja/compilerlalog.git

…compile?

  dune build

…execute and test?

  dune exec ./pfx/pfxVM.exe -- TESTFILE.pfx

===============

Structure of the project
------------------------

The project is organized as following:

Explain here the organization of your project, what is the use of each file or
group of files, etc.

You may also show the file tree as the following example:

project
├── README
├── dune-project
├── .gitignore
├── expr: the expr compiler
│   ├── README
│   ├── basic
│   │   ├── ast.ml
│   │   ├── ast.mli
│   │   ├── dune
│   │   ├── eval.ml
│   │   ├── eval.mli
│   │   ├── lexer.mll
│   │   ├── parser.mly
│   │   ├── tests: for tests
│   │   │   └── an_example.expr
│   │   ├── toPfx.ml             <- To edit
│   │   └── toPfx.mli
│   ├── common
│   │   ├── binOp.ml
│   │   ├── binOp.mli
│   │   └── dune
│   ├── compiler.ml: main file for the expr compiler
│   ├── dune
│   ├── fun: the expr parser for section 7
│   │   ├── ast.ml
│   │   ├── ast.mli
│   │   ├── dune
│   │   ├── eval.ml
│   │   ├── eval.mli
│   │   ├── lexer.mll
│   │   ├── parser.mly
│   │   ├── tests: for tests
│   │   │   └── an_example.expr
│   │   ├── toPfx.ml
│   │   └── toPfx.mli
│   └── main.ml
├── pfx: the pfx VM
│   ├── basic
│   │   ├── ast.ml               <- To edit
│   │   ├── ast.mli
│   │   ├── dune
│   │   ├── eval.ml              <- To edit
│   │   ├── eval.mli
│   │   ├── lexer.mll            <- To edit
│   │   ├── parser.mly           <- To edit
│   │   └── tests: for tests
│   │       └── ok_prog.pfx
│   ├── dune
│   └── pfxVM.ml: main file for the pfx VM
└── utils
    ├── dune
    ├── location.ml: module offering a data type for a location in a file
    └── location.mli
===============

Progress
--------

- We stopped at question 10.4.

===============

Know bugs and issues
--------------------

- There is still a bug in question 10.3 : we couldnt find how to properly decrement the index of a variable in the environment (useful after applying a Binop or having an App(Fun(_,_),_) as argument in antoher App(Fun(_,_),_)).

===============

Helpful resources
-----------------

- we used Stack Ocaml documentation to solve the problem of the environment for variables :
  https://ocaml.org/learn/tutorials/pointers.html
  https://ocaml.org/api/List.html

===============

Difficulties
------------

- We never got completly stuck in a problem, even if we were slowed down by some questions (math questions and question 10).
- Very interesting project :)