Skip to content
Idriss Riouak edited this page Jun 13, 2019 · 2 revisions

Red is Not Blue (RNB-Compiler) Build Status

RNB-Compiler is an accademic project, developed during my Master Degree at the University of Udine. The project has the purpose to build the front-end and the middle-end of a compiler.

Main goal:

  • Design an imperative language
  • Develop the compiler front-end and middle-end in Haskell

Minor goal:

  • Design the grammar and the syntax of the languague
  • Design a readable Abstract Syntax Tree
  • Design a Typechecker
  • Design the Static Analysis module
  • Design the TAC generator

Contributors

In order :

  • Anna Becchi
  • Renato Eugenio Garavaglia
  • Riouak Idriss

Usage

Running rnbc with the flag --help we will obtain

   ___  _  _____  _____ 
  / _ \/ |/ / _ )/ ___/ 
 / , _/    / _  / /__   
/_/|_/_/|_/____/\___/ompiler   

  --help                Display this help message.
  (files)               Parse content of files verbosely.
  --check (files)       Check the correctness of the RNBStaticAnalysis 
                        with the powerful Test-Suite.
  --verbose (files)     Show all prints.  
  --silent (files)      Remove all prints. 
  --checkTAC (files)    Check if the generated TAC is equal to the expected TAC.
  --nocolor (files)     Print output without colors.

Installation

RNB requires GHC, Cabal, Happy and Alex.

$ sudo apt-get install ghc cabal-install
$ cabal update
$ cabal install alex happy
$ make

This will produce the binary file ./rnbc.

Grammar

The grammar was defined using the BNFC format:

Operators

Keywords

Symbols

Typesystem

Diagnosis errors

Clone this wiki locally