Simple compiler for an abstract source language (NilNovi)
Find a file
lasercata c084c8bdec
Some checks failed
Python tests / test (push) Has been cancelled
Correction in the readme
2025-11-12 12:51:41 +01:00
.github/workflows Workflow now run only on branch main (push & PR) 2025-11-12 10:06:11 +01:00
nn_programs nn_programs/nna/correct3: swapping expected and alternate 2025-11-12 12:45:12 +01:00
Report Visual corrections in report 2025-05-23 22:26:20 +02:00
src fixing index issue in the compiler 2025-11-12 12:43:02 +01:00
Subject Adding initial files 2025-03-25 16:39:49 +01:00
tests Adding tests for the interpretor 2025-11-12 12:22:48 +01:00
.gitignore Adding pytest tests 2025-11-12 02:49:00 +01:00
LICENSE Create LICENSE 2025-05-26 04:33:40 +02:00
main.py Beginning to write the README 2025-05-14 01:55:50 +02:00
README.md Correction in the readme 2025-11-12 12:51:41 +01:00

🚀 Compilation Project

A simple tool to analyze, compile, and run NNP programs.

Python tests


📁 Project Structure

.
├── main.py
├── README.md
│
├── Subject/
│   └── Sujet_Projet_Compilation2024.pdf
│
├── Report/
│   ├── Compilation_project_report.tex
│   ├── data/
│   ├── pics/
│   └── style/
│
├── src/
│   ├── analex.py
│   ├── anasyn.py
│   ├── compiler.py
│   ├── idtable.py
│   ├── interpretor.py
│   ├── parser_ui.py
│   └── utils.py
│
└── nn_programs/
    ├── nna/
    │   ├── correct1.nno
    │   ├── ...
    │   ├── correct4.nno
    │   ├── error1.nno
    │   ├── ...
    │   ├── error7.nno
    │   │
    │   └── expected/
    │       ├── correct1.nno.expected
    │       ├── ...
    │       └── correct4.nno.expected
    │
    └── nnp/
        ├── correct1.nno
        ├── ...
        ├── correct5.nno
        │
        └── expected/
            ├── correct1.nno.expected
            ├── ...
            └── correct4.nno.expected

🛠️ Usage

🔧 Setup

Clone the repository:

git clone --depth=1 https://github.com/lasercata/Compilation_project.git
cd Compilation_project

Make the main file executable:

chmod u+x main.py

▶️ Run

To display help information:

./main.py -h

Help output:

usage: main.py [-h] [-v] {analyse,a,compile,c,run,r} ...

Analyse, compile, and run NNP programs

positional arguments:
  {analyse,a,compile,c,run,r}
    analyse (a)         runs the lexical analysis of the NNP program
    compile (c)         compile a NNP program to NNP object code
    run (r)             runs a NNP object code

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

🧪 Examples

./main.py c -h
./main.py c nn_programs/nna/correct1.nno -o correct1.obj
./main.py r correct1.obj
./main.py r nn_programs/nna/correct1.nno -c

Run tests

To run all the tests:

pytest

To have the details:

pytest -vv