Code Monkey home page Code Monkey logo

projet-compilation's Introduction

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

projet-compilation's People

Contributors

0xwryth avatar adepreis avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.