A simple tool to analyze, compile, and run NNP programs.
.
├── 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
Clone the repository:
git clone --depth=1 https://github.com/lasercata/Compilation_project.git
cd Compilation_projectMake the main file executable:
chmod u+x main.pyTo display help information:
./main.py -hHelp 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
./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 -cTo run all the tests:
pytest
To have the details:
pytest -vv