Skip to content

⚙ Compilation project - Polytech ET4 IT - Noted for S7 (2020)

Notifications You must be signed in to change notification settings

adepreis/projet-compilation

Repository files navigation

projet-compilation

Compilation project - Polytech ET4 IT - Noted for S7 (2020)

powered by Ocaml

Asked work

All remaining bugs and unimplemented features are listed here.

How it works

  • 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.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development purpose.

Prerequisites

Things you need to install the project :

Installation

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 executable interp from source code using :

make (or make 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.


Testing

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


Contribution of each member of the group

  • 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

Documentation

In the /doc folder, you can find some documentation about the project like the grammar we have created and later our project report.

Debugging commands

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

About

⚙ Compilation project - Polytech ET4 IT - Noted for S7 (2020)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published