A complete compiler for the Tony language for the course of Compilers in ECE, NTUA.
Ιάσων Λαζαρίδης Θανάσης Κουτρούμπας
- flex → For Lexical Analysis
- bison → For Syntax/Semantic Analysis
- LLVM → For IR Code/Code Generation/Optimizations
- edsger-lib → A x86 assembly runtime libraby for Linux
- bdwgc → Boehm's Garbage Collector
- flex (v2.6.4)
- bison (v3.0.4)
- llmv-9
- libgc-dev
- For a Ubuntu/Debian system download the Automatic Installation Script and install with version 9:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 9
- For other systems build version 9 from source from here https://releases.llvm.org/download.html
- For a Ubuntu/Debian system install header files for Boehm's Garbage Collector from apt package:
sudo apt install libgc-dev
- For other systems find here https://www.hboehm.info/gc/ or find appropriate packages for your distribution.
To build everything do:
make
To run the compiler:
./tony [flags] [FILE]
The supported flags are:
- -O: Enable optimizations
- -i: The input must be given on stdin and the intermediate code will be printed on stdout
- -f: The input must be given on stdin and the final code will be printed on stdout
If no -i or -f flags are given the input file must be given as a command line parameter.