Compilation project - Polytech ET4 IT - Noted for S7 (2020)
All remaining bugs and unimplemented features are listed here.
- The
ast.ml
file which contains the ocaml type definitions for the Abstract Syntax Tree (AST). - The
tpParse.mly
file is the parser designed for menhir. - The
tpLex.mll
file contains the description of the lexical parser with ocamllex. - The
testLex.ml
file allows you to see what the lexical analyser returns by printing the tokens it receives. - The
Makefile
file is used to produce the different executables.
These instructions will get you a copy of the project up and running on your local machine for development purpose.
Things you need to install the project :
Here are some instructions on how to get the development env running.
First, clone this repository with the following command :
git clone https://github.com/adepreis/projet-compilation.git
Then build the executableinterp
from source code using :
make
(ormake clean
to delete the executable file and all the object files from the directory)
Note : the interp
file has already been created under /interp
folder.
You can find all the test files in the /tests
repertory.
You can test the parser using
make testLex
then ./testLex /tests/.../testFile.txt
When the code generation (PUSHI, STOREG, etc..) will work :
Use of the interpreter (at the project's root) :
./interp/interp test-file-name
with debug mode (step-by-step mode, setting breakpoints, visualize the memory content, the current instruction, etc..) :
./interp/interp -d test-file-name
- Lucas B. : grammar, parser, test files, lexical tester
- Antonin D. : grammar, parser, test files, lexical tester
- Rémy T. : grammar, AST, lexical analyser, conflicts resolution
- Tri-Man William V. : grammar, AST, lexical analyser, conflicts resolution, code generation
In the /doc
folder, you can find some documentation about the project like the grammar we have created and later our project report.
Generate the tpParse.conflicts
file that explains all the conflicts :
menhir --lalr --explain tpParse.mly
Generate the tpParse.automaton
file that describes the automaton states :
menhir --dump tpParse.mly