CodePeters / Dana_Compiler

A Dana Compiler developed for Compiler's Course at NTUA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dana Compiler 2017

Authors:

Alexander Moschos
Giorgos Petrou

Implementation of a compiler for the Dana programming language for the 2017 Compilers Course in NTUA.

Dependencies:

1. LLVM 3.8(llc,opt)
2. flex
3. bison
4. clang and clang++
5. edsger-lib( https://github.com/abenetopoulos/edsger_lib )

Building:

To build everything do

make

Execution

To run the compiler with layout do with a sample file sample.dna:

./do.sh -l sample.dna

To run the compiler with begin/end blocks with input in stdin do:

./do.sh -b -O3

The executable supports a number of flags

-l     Language with Layout(by default enabled).
-b     Language with begin/end blocks(by default disabled).
-f     Program in stdin x86_64 Assembly in stdout.
-i     Program in stdin LLVM IR in stdout.
-O<n>  Optimization flag where n = {0,1,2,3}(Applied to the IR and the Assembly code)

The compiled executable will be called a.out

About

A Dana Compiler developed for Compiler's Course at NTUA


Languages

Language:C++ 41.7%Language:Assembly 20.8%Language:C 19.0%Language:Yacc 10.6%Language:Lex 5.0%Language:Shell 1.7%Language:Makefile 1.2%