B.Sc. Project, Compiler

Project name : Compiler for simplified C
Technical info : Java based, Platform free
Language : English
Ordered by : School Project, Programing project-INF2100

I have coded a compiler for a simplified C language which is called Rusc. This project was designed at a course(INF2100) at university of Oslo, IFI. The course name is Programming project and the goal was to write a major program in small groups(our case 2 students). My friend (Jim) and I implemented the compiler in Java to run the code written in Rusc(simplified C). The language(Rusc) contains integer, variables, functions(void or of int type), IF, Else, While, for, expressions, names, libraries of pre-coded functions which are imported.  The code is available here.

The project was divided into 3 parts. The first part was reading the code character by character and having them in a row of two char(currentChar, nextChar). The 2nd phase was to read the characters and make tokens out of them(intToken, ifToken, …). The 3rd and final phase was parsing the read tokens into a logical code for assembler(breaking the code into small expressions).

INF2100
Course content :
The core of the subject is a major programming task to be solved in small groups.Learning
Outcomes : Students will understand how a computer is constructed from the basic circuit elements to high-level principles. They will receive practical training in programming computers at the machine level.