Skip to content

This repository contains the source code for the compiler I wrote as a part of my BSc research project at the University of Kent. Later improvements were made to the compiler as a minor component of my Masters thesis.

Notifications You must be signed in to change notification settings

Zelatrix/golf-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler

This repository contains the source code for my compiler. I have also included source files for the language that is being compiled. The language I am compiling is of my own devising. This compiler was written for my BSc research project as part of my degree at the University of Kent.

Version History

Version 0.0.1

This version of the compiler is a very rudimentary edition, and acts like a calculator. It features all the basic arithmetic operations, including addition, subtraction, multiplication and division. It also supports the modulus operation.

Version 0.0.2

Version 0.0.2 introduces the capability to parse multiple statements from a file, so that programs longer than a single line are able to be handled by the compiler. It also adds the capability to perform comparisons with Boolean results, using operators such as >, >=, <, <=, ==, and /=. The Boolean values of true and false are represented as 1 and 0 respectively,

This version of the compiler also adds support for variables. It uses the LLVMlite library in Python to allocate the amount of space required on the stack for the type of variable in question, then it stores the specified value in that newly-allocated space on the stack. When the variable is required, the value is loaded into memory and returned.

Version 0.0.3

Version 0.0.3 of the compiler adds types for strings and characters, so that the functionality can be extended beyond basic arithmetical expressions. Version 0.0.3 also adds if-then and if-then-else blocks to the language, allowing the programmer to perform operations based on Boolean conditions.

References

About

This repository contains the source code for the compiler I wrote as a part of my BSc research project at the University of Kent. Later improvements were made to the compiler as a minor component of my Masters thesis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published