Skip to content

Dahbani1/Compilation-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AUTHORS
-------

- DAHBANI Mohammed
- EZZAKRI Anas

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

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

This project implements a working Expr compiler and a Pfx virtual machine in OCaml. The work progresses incrementally, with questions guiding the development of both the compiler and virtual machine.

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

Sources
-------

Git repository: https://github.com/Dahbani1/Compilation-project
A pdf containing answers to the non-code-related questions.

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

How to…
-------

…retrieve the sources?

  git clone https://redmine-df.telecom-bretagne.eu/git/PROJECTNAME

…compile?

  dune …

…execute and test?

  dune utop and then use the libraries
  (from project root) dune exec expr/main.exe -- expr/basic/tests/an_example.expr
  dune exec ./pfxVM.exe -- TESTFILE.pfx -a 12 -a 52


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

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

The project is organized as following:

project
β”œβ”€β”€ README
β”œβ”€β”€ dune-project
β”œβ”€β”€ 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
β”‚   β”‚   β”œβ”€β”€ lexer.mll
β”‚   β”‚   └── parser.mly
β”‚   └── main.ml
β”œβ”€β”€ pfx: the pfx VM
β”‚   β”œβ”€β”€ basic
β”‚   β”‚   β”œβ”€β”€ ast.ml               
β”‚   β”‚   β”œβ”€β”€ ast.mli
β”‚   β”‚   β”œβ”€β”€ dune
β”‚   β”‚   β”œβ”€β”€ eval.ml              
β”‚   β”‚   β”œβ”€β”€ eval.mli
β”‚   β”‚   β”œβ”€β”€ lexer.mll            
β”‚   β”‚   β”œβ”€β”€ parser.mly           
β”‚   β”‚   └── tests: for tests
β”‚   β”‚       └── ok_prog.pfx
β”‚   └── 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
--------

- All of the exercices up to 8 were done successfully (inclusing compilation and tests)
- Exercices 9 to 12 were done but without being tested: we couldn't figure out how to run tests for the lambda expressions (i.e ((Ξ»x.Ξ»y.(x βˆ’ y)) 12) 8 ...)

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

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

- We were not able to run tests for the lamnda expressions (i.e ((Ξ»x.Ξ»y.(x βˆ’ y)) 12) 8 ...) in exercies 9 to 11

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

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

- Most of the time, we used stackoverflow to look for solution of some n=bugs we encountered.
- Compilation - Notes provided on Moodle were really helpful.

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

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

- Figuring out how to translate coding instructions to a new programming language we are not used to
- Using new tools and new commands to compile the script and make it work
- Code in a new environment and a new paradigm
- Testing the code using utop, but we figure it out in the end.
- Testing in section 10.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages